Skip to content

Template Storage

Templates use the exact same storage and download pipeline as plugins. They are listed in the same content-manifest.json and fetched on demand by the ContentDownloadService.

~/.ptah/
└── templates/
└── agents/
├── frontend-developer.md
├── backend-developer.md
├── security-auditor.md
└── devops-engineer.md
PathPurpose
~/.ptah/templates/Downloaded template tree
~/.ptah/cache/content-manifest.jsonShared manifest (plugins + templates)

The templates section of content-manifest.json looks like:

{
"templates": {
"basePath": "libs/backend/agent-generation/templates",
"files": ["agents/frontend-developer.md", "agents/backend-developer.md", "agents/security-auditor.md", "agents/devops-engineer.md"]
}
}

basePath is the path inside the Ptah repository; files is a flat list of every template artifact. Ptah rebuilds the tree under ~/.ptah/templates/ preserving the relative paths.

  1. On app launch (or when the Templates panel is first opened), Ptah fetches the manifest.
  2. It diffs the templates.files list against ~/.ptah/templates/ using content hashes.
  3. Missing or changed files are downloaded in parallel.
  4. The Templates panel reads ~/.ptah/templates/ and indexes each entry by its frontmatter.

If GitHub is unreachable, Ptah falls back to whatever is already in ~/.ptah/templates/. The Templates panel displays an Offline banner, and template installs queue for retry.

CommandEffect
Ptah: Open Template Cache FolderOpens ~/.ptah/templates/ in your file manager
Ptah: Refresh TemplatesRe-reads the manifest and re-downloads changed files
Ptah: Clear Template CacheDeletes ~/.ptah/templates/ (re-downloads on next use)