Public template repository for generating a per-project agent-vault/ folder.
Apache-2.0. See LICENSE.
This repo is a reusable scaffold for teams using AI coding agents (for example Codex, Claude, and Gemini CLI) and Obsidian.
It gives each code repository a standard agent-vault/ directory with Markdown files for:
- shared context
- handoffs between sessions/agents
- open questions and decisions
- project plan and coding standards
Generated vaults are intended to preserve human control over material trade-offs, not just record decisions after an agent already chose a path.
When multiple agents (or humans + agents) collaborate, context often gets lost between sessions. Typical failures are:
- repeated rediscovery of decisions
- unclear handoffs
- stale docs compared to implementation
- no consistent place for unresolved questions
- agents silently making architecture or workflow trade-offs that should stay owner-controlled
This template standardizes where that context lives and how it is updated.
The generated vault is plain Markdown and works directly in Obsidian.
- Open your project repo as an Obsidian vault.
- Use
agent-vault/as the project memory area. - Keep code in normal source folders and context in
agent-vault/.
- Clone this template repo once:
git clone https://github.com/ssheld/agent-vault.git
- For a new project repo, run:
./scripts/new-project.sh <project-name> <repo-path>- Example:
./scripts/new-project.sh auto-ai ~/workspaces/auto-ai - Optional migration mode (for existing root policy files):
./scripts/new-project.sh <project-name> <repo-path> --migrate-existing-root-md
- For an existing project repo, run:
./scripts/update-project.sh <repo-path> --dry-run./scripts/update-project.sh <repo-path>- Optional template refresh:
./scripts/update-project.sh <repo-path> --dry-run --sync-templates./scripts/update-project.sh <repo-path> --sync-templates
- Optional coding-standards refresh:
./scripts/update-project.sh <repo-path> --dry-run --sync-coding-standards./scripts/update-project.sh <repo-path> --sync-coding-standards
- Example:
./scripts/update-project.sh ~/workspaces/harrier - To migrate unmanaged root wrappers to managed versions:
./scripts/update-project.sh <repo-path> --migrate-root
new-project.shandupdate-project.shautomatically enable the tracked metadata hook in the current clone whencore.hooksPathis not already customized.- For additional clones, or when you want to opt into the tracked hook manually:
git -C <repo-path> config core.hooksPath agent-vault/_assets/hooks
- Commit generated or updated files in the target project repo.
Generated workflows also expect:
- accepted decision records to preserve owner approval provenance in the file before they are used as an automatic Human Decision Gate bypass
- same-session daily/context/design-log notes to avoid leaving immediate publication mechanics (
git commit,git push, PR creation) in future-tense carry-forward text unless those actions will truly remain unfinished
This repo should stay template-only. Do not store project-specific session logs here.
- Runtime scaffold copied into projects lives at:
scaffold/agent-vault/
- Project-root scaffold copied into project repos lives at:
scaffold/root/
If you want changes to propagate to future projects, edit files under scaffold/agent-vault/ and scaffold/root/.
This repository intentionally keeps three mirrored policy blocks for compatibility:
AGENTS.mdmirrors the review section fromscaffold/agent-vault/review-policy.md(with a repo-local path alias normalization in the check).scaffold/root/AGENTS.mdmirrors the review section fromscaffold/agent-vault/review-policy.md.scaffold/agent-vault/AGENTS.mdmirrors shared workflow rules fromscaffold/agent-vault/shared-rules.md.- Each check compares its mirrored block from the start heading through EOF, covering all mirrored top-level sections.
- Root
CLAUDE.mdandGEMINI.mdin this template repo are lightweight repo-local helper docs and are not drift-checked. scaffold/root/CLAUDE.mdandscaffold/root/GEMINI.mdremain thin wrappers overagent-vault/*.mdplusreview-policy.md; no additional drift enforcement is added for them.
To prevent accidental drift, run:
bash scripts/check-policy-mirrors.sh
CI also enforces this via .github/workflows/policy-mirror-check.yml on pull requests and pushes to main.
Run the scaffold regression scripts locally when changing bootstrap, sync, or tracked hook behavior:
bash scripts/test-gitignore-management.shbash scripts/test-coding-standards-sync.shbash scripts/test-decision-template-sync.shbash scripts/test-session-metadata-hook.sh
CI also runs these checks via .github/workflows/scaffold-regression-checks.yml.
update-project.sh updates these managed scaffold files:
- Always managed:
<repo>/agent-vault/shared-rules.md<repo>/agent-vault/review-policy.md<repo>/agent-vault/AGENTS.md<repo>/agent-vault/CLAUDE.md<repo>/agent-vault/GEMINI.md<repo>/agent-vault/handoff.md<repo>/agent-vault/_assets/hooks/README.md<repo>/agent-vault/_assets/hooks/pre-commit<repo>/agent-vault/design-log/README.md<repo>/agent-vault/context/handoffs/README.md<repo>/agent-vault/decisions/README.md<repo>/agent-vault/daily/README.md<repo>/agent-vault/Templates/Decision Record.md
- Root wrappers (managed only when the root file has the
agent-vault-managedmarker):<repo>/AGENTS.md<repo>/CLAUDE.md<repo>/GEMINI.md
- Seeded if missing:
<repo>/.github/pull_request_template.md<repo>/docs/design.md<repo>/agent-vault/project-context.md<repo>/agent-vault/project-commands.md<repo>/agent-vault/lessons.md
<repo>/agent-vault/coding-standards.md remains project-owned by default. update-project.sh does not replace it unless you explicitly pass --sync-coding-standards.
If an existing root policy file does not have the managed marker, update-project.sh leaves it unchanged and reports a skip notice suggesting --migrate-root.
Template refresh is opt-in:
./scripts/update-project.sh <repo-path> --sync-templatesupdatesagent-vault/Templates/from the scaffold and backs up replaced files underagent-vault/context/updates/<timestamp>/.- Without
--sync-templates, project-local template customizations are left alone except for policy-critical templates that are always managed (agent-vault/Templates/Decision Record.md).
Coding standards refresh is also opt-in:
./scripts/update-project.sh <repo-path> --sync-coding-standardsreplacesagent-vault/coding-standards.mdwith the scaffold version and backs up the previous file underagent-vault/context/updates/<timestamp>/.- Without
--sync-coding-standards, the script leaves project-owned coding standards untouched and reports when they differ from the scaffold.
When running update-project.sh with --migrate-root, unmanaged root wrappers (those missing the agent-vault-managed marker) are backed up and replaced with the current scaffold versions. This is useful for workspaces created before root wrapper management was introduced.
When a managed file changes, the script backs up the previous version under:
<repo>/agent-vault/context/updates/<timestamp>/...
Generated projects auto-enable the tracked metadata gate in the clone where new-project.sh or update-project.sh runs, unless core.hooksPath is already set to something else. Additional clones can enable it with:
git -C <repo-path> config core.hooksPath agent-vault/_assets/hooks
That tracked hook enforces the baseline session artifacts and validates staged agent-vault/context-log.md ordering/freshness so newer entries do not get appended below stale headers.
Both scripts also ensure root .gitignore includes managed local-only ignore entries (added only when missing):
.obsidian/workspace.json.obsidian/app.json.obsidian/appearance.json.obsidian/workspace-mobile.json.obsidian/cache/.obsidian/backup/.obsidian/plugins/*/data.json/agent-vault/context/updates/
When running new-project.sh with --migrate-existing-root-md:
- Existing root policy files are backed up under
agent-vault/context/updates/<timestamp>/. - Existing root content is appended into the corresponding
agent-vault/*.mdpolicy file under aMigrated Legacy ...section. - Root wrappers from
scaffold/root/are then written to:<repo>/AGENTS.md<repo>/CLAUDE.md<repo>/GEMINI.md
- The
CLAUDE.mdandGEMINI.mdroot wrappers includeagent-vault/CLAUDE.mdandagent-vault/GEMINI.mdso migrated legacy guidance remains part of root entrypoint context.
Without this flag, new-project.sh leaves pre-existing root files unchanged and prints a notice.
Generated projects get a starter docs/design.md that uses Mermaid fenced code blocks as the default diagram format.
- GitHub renders Mermaid in Markdown natively.
- Obsidian renders Mermaid in Markdown natively.
- No Mermaid-specific install is required for agents to create or update the diagrams.
- Add Mermaid CLI, separate
.mmdfiles, or rendered SVG/PNG artifacts only if a specific project later needs validation or exported assets.
new-project.sh creates <repo-path>/agent-vault/ with:
shared-rules.md(single source of truth for implementation rules)review-policy.md(single source of truth for PR review guidelines, including required format for responding to review feedback)AGENTS.md,CLAUDE.md, andGEMINI.md(policy files;agent-vault/CLAUDE.mdandagent-vault/GEMINI.mdimportshared-rules.md,project-context.md, andproject-commands.md; root wrappers importreview-policy.md; andAGENTS.mdinlines review guidance)- Compatibility note:
AGENTS.mdfiles intentionally inline mirrored policy content for Codex review-path compatibility; this duplication is expected, but mirrored files should stay synchronized. README.mdcontext-log.mdplan.mdcoding-standards.mdproject-context.mdproject-commands.mddecision-log.mdopen-questions.mdlessons.mdhandoff.mddaily/,context/,design-log/,decisions/,_assets/(including the optional trackedpre-commithook underagent-vault/_assets/hooks/)Templates/(copied from template source; instantiated notes belong outside this folder)
It also creates project-root files when missing:
<repo-path>/AGENTS.md-> contains PR review guidance (inline) for Codex GitHub reviews and points workflow execution toagent-vault/AGENTS.md<repo-path>/CLAUDE.md-> importsagent-vault/CLAUDE.mdandagent-vault/review-policy.md<repo-path>/GEMINI.md-> importsagent-vault/GEMINI.mdandagent-vault/review-policy.md<repo-path>/docs/design.md-> starter architecture/design document with embedded Mermaid diagrams<repo-path>/.github/pull_request_template.md-> standardized agent PR body template- Bootstrap behavior:
new-project.shhydrates project metadata placeholders (repo_reference, active branch, dates) in the baselineagent-vault/docs, seeds non-empty baseline content inagent-vault/README.md,plan.md,coding-standards.md, andcontext-log.md, copies structured starter templates forproject-context.mdandproject-commands.md, and copies scaffold helper docs such asagent-vault/design-log/README.mdplusdocs/design.md.
If root files already exist, the script leaves them unchanged unless --migrate-existing-root-md is provided.