feat(agents): project-local agent overrides

loadAgents merges <cwd>/agents/*.md on top of the extension's baseline:
a repo agent wins on name collision and may add brand-new agents. The
unknown-agent error now names both searched directories.
This commit is contained in:
2026-08-09 16:45:30 -04:00
parent c605a709fb
commit cb8a88d0bd
4 changed files with 149 additions and 23 deletions

View File

@@ -137,7 +137,10 @@ registerCheck(def) ← checks/*.ts self-register on load
`cwd` (see `src/agent-runner.ts`), with the agent definition's system prompt
and tool allowlist applied. Agent definitions are plain editable markdown in
[`agents/`](./agents/) (frontmatter `name` + `allowedTools`, body = system
prompt) — tuning a sub-agent never needs TypeScript changes.
prompt) — tuning a sub-agent never needs TypeScript changes. A scanned
project can ship its own `agents/*.md` at its root: those are loaded as
overrides (repo agent wins on name collision), so teams can tune prompts or
add project-specific agents without touching the extension.
- **Run-state** is a single JSON file at `<cwd>/.pygienium/run-state.json`
(`src/run-state.ts`): per-check phase progress, captured findings/changes
text, and recon status. `/pygienium-status`, `/pygienium-resume`, and