Skip to content

Consider extracting vault-agent into standalone repository #1973

Description

@laurigates

Summary

Extract vault-agent into its own repository (laurigates/vault-agent), the same way git-repo-agent was extracted in #1017. vault-agent is a standalone Claude Agent SDK / Typer CLI that lives in this monorepo but is not a Claude Code plugin (absent from marketplace.json and release-please). Extracting it enables clean uvx vault-agent / uv tool install vault-agent, independent versioning, and PyPI publishing.

This is the direct sibling of #1017 — reuse the proven template there (laurigates/git-repo-agent, PR #1, and this repo's sync workflow PR #1972).

Motivation

Same rationale as #1017:

  • uvx vault-agent / uv tool install vault-agent without a claude-plugins checkout.
  • Clearer separation of concerns and independent release cadence for a self-contained CLI.
  • Consistency with git-repo-agent, now extracted.

Current coupling

vault-agent/src/vault_agent/prompts/compiler.py reads Obsidian-plugin skills from the monorepo at runtime:

_REPO_ROOT = _MODULE_DIR.parent.parent.parent  # vault-agent/
_PLUGINS_ROOT = _REPO_ROOT.parent              # claude-plugins/
# sources: obsidian-plugin/skills/vault-{frontmatter,tags,templates,wikilinks,orphans,stubs,mocs}/SKILL.md

This is ADR-0005 ("skill-source-obsidian-plugin") — analogous to git-repo-agent's compiler reading its sibling plugins.

Key difference from #1017: git-repo-agent had already solved the standalone-install problem (ADR-009: a compiler fallback that ships pre-compiled generated/ artifacts). vault-agent has not — its compiler.py has no standalone mode and no committed src/vault_agent/prompts/generated/. So the extraction has an extra Phase 0 prerequisite that git-repo-agent did not.

Proposed approach

Mirror #1017's phased, verify-before-remove cutover (per this repo's tool-migration-cutover rule), with the added Phase 0:

Phase 0 — standalone-install prompt fallback (prerequisite; the ADR-009 analog)

  • Add a fallback to compiler.py: monorepo (dev) mode live-compiles from sibling obsidian-plugin/skills/*/SKILL.md; standalone (installed) mode reads pre-compiled artifacts from src/vault_agent/prompts/generated/ when siblings are absent (per-skill selection).
  • Commit the generated/ artifacts; add a scripts/compile_prompts.py --check drift check.
  • tests/test_compiler_standalone.py simulating standalone mode (empty _PLUGINS_ROOT).
  • Record the decision as a vault-agent ADR (mirror git-repo-agent's ADR-009).

Phase 1 — stand up the standalone repo

  • Create the public repo; seed with history via git subtree split --prefix=vault-agent.
  • pyproject.toml: MIT license, project URLs, PyPI classifiers/keywords (keep requires-python >= 3.13), widen the uv_build constraint.
  • CI (ci.yml): ruff + pytest + a build & standalone-CLI smoke. Configure a git identity + init.defaultBranch main if any test shells out to real git (git-repo-agent's tests did; check vault-agent's test_worktree.py).
  • publish.yml: PyPI Trusted Publishing (OIDC) on a GitHub Release.
  • README: standalone install/dev/release sections; fix the monorepo-relative uv tool install -e ./vault-agent.
  • Verify uv build + uv run --isolated --no-project --with dist/*.whl vault-agent --help works with no claude-plugins parent.

Phase 2 — cross-repo sync

Phase 3 — remove from the monorepo (after Phases 1–2 verified)

  • Replace vault-agent/ with a pointer README.
  • Update the path-scoped rules that reference it: .claude/rules/agent-cli-worktree-safety.md (vault-agent/** glob + the test_worktree.py mirror reference), .claude/rules/typer-cli-completion.md (vault-agent/** glob), and the version-pinning.md sibling-repo follow-up note.

Owner actions (manual, mirror #1017)

  • PyPI pending publisher for project vault-agent (workflow publish.yml, environment pypi).
  • VAULT_AGENT_SYNC_TOKEN secret (contents + PR write on vault-agent).

References

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions