Repository navigation
Conversation
…, validators - Add tool.execute.before hook blocking direct read/edit/write/bash/glob/grep on docs/specs/, docs/exec-plans/, docs/briefs/ (tools/artifact-guard.js) - Replace 5 old lifecycle tools with 19 new domain-specific tools: spec_get/create/update/validate/list/delete, plan_get/create/update/validate/block_done/list/delete, brief_get/create/update/list/delete, project_state - Add spec-validator, plan-validator, spec-reviewer agents - Update team-lead prompt with Spec Protocol, new lifecycle tool references - Expand test suite to 92 tests (0 fail) - Update all docs: AGENTS.md, README.md, CHANGELOG.md, website/ Closes #12
Direct read access to docs/exec-plans/ is blocked by artifact-guard. plan-validator must use lifecycle tools to access plans.
…ce detection - spec-reviewer now detects when a delivery contradicts an existing spec - New SPEC_VIOLATION verdict triggers immediate escalation to user - team-lead prompt updated: SPEC_VIOLATION treated as BLOCKED (user decides) - Update website docs: review-cluster and agents index reflect 4 verdicts
…-mode - Add spec_format() and plan_format() lifecycle tools — return canonical format inline so agents always know expected structure before calling spec_create or plan_create - Add spec-writer agent (temperature 0.3) — workflow: spec_format → spec_list → explore → spec_create → spec_validate, max 2 retry on reject - Gardener dual-mode: Bootstrap (< 3 active specs, delegates to spec-writer) and Maintenance (existing behavior preserved) - Add spec_format/plan_format to team-lead, gardener, spec-writer permissions - Update specs: lifecycle-tools, gardener-agent - 106 tests, 0 fail
- Maintenance mode: spawn explore agents, compile Gardener Report, return findings to team-lead. Never edits files or opens PRs. - Bootstrap mode: unchanged — delegates to spec-writer sequentially - Remove question, gh pr create, plan_list, plan_get, edit, write from permissions - Add task (explore + spec-writer only), glob to permissions - Remove QUALITY_SCORE.md from scope entirely - Update gardener-agent spec, docs, website, CHANGELOG
- Update 4 drifted specs: lifecycle-tools (20 tools), team-lead-delegation (14 agents), planning-agent (lifecycle tool permissions), review-cluster (task restriction documented) - Create 4 missing specs: spec-validator-agent, plan-validator-agent, spec-reviewer-agent, spec-writer-agent - Fix stale docs: docs/index.md (20 tools + 4 new agents), docs/architecture.md (hook name, compress-only, 15 agent files), AGENTS.md (gardener description) - Fix stale website pages: getting-started (20 tools), index (15 agents), architecture (bug-finder + researcher mode: all) - Harmonize frontmatter/body status in 6 specs (draft/stable → implemented) - Fix lifecycle tool count 19 → 20 across all docs - Note 2 harness candidates in CHANGELOG
- Update 4 drifted specs: lifecycle-tools, team-lead-delegation, planning-agent, review-cluster - Create 4 new agent specs: spec-validator, plan-validator, spec-reviewer, spec-writer - Fix stale docs: docs/index.md, docs/architecture.md, AGENTS.md, website/getting-started, website/index, website/architecture - Fix frontmatter/body divergence in 6 spec files (draft → implemented) - Correct tool count 19 → 20 across all docs and prompts - Remove doc-only skip-review shortcut from agents/prompt.md
Summary of all changesThis PR implements a complete overhaul of the artifact lifecycle system, plus several follow-up improvements. Here's everything that landed: 🔒 Protected zones (artifact guard)Direct 🛠️ 20 lifecycle tools (replacing 5)The old
🤖 3 new validator/reviewer agents
✍️ spec-writer agentNew 🌱 Gardener refonte (v2)Maintenance mode is now a pure audit orchestrator — it spawns Bootstrap mode (< 3 active specs) delegates to Permissions updated: removed 📋 Team-lead prompt updates
🧪 Tests92 → 106 tests, 0 fail. Covers all 20 lifecycle tools, artifact guard (read/edit/write/bash/glob/grep), edge cases (path traversal, multiple matches, idempotence, empty directories). 📚 Docs & specs sync (post-gardener-report)
|
- Add plan-reviewer orchestrator with light/deep review modes - Add plan-functional-reviewer, plan-technical-reviewer, plan-code-reviewer - Remove plan-validator agent (replaced by plan-reviewer cluster) - Add hint field to plan_create, plan_update, spec_create, spec_update - Update all docs, specs, and website to reflect new architecture - Update CHANGELOG
New commit — plan-reviewer clusterWhat changedNew
|
| Agent | Role | Mode |
|---|---|---|
plan-reviewer |
Orchestrator — asks for review depth, spawns sub-reviewers in parallel, arbitrates verdicts | light + deep |
plan-functional-reviewer |
Checks plan coherence against functional specs | light + deep |
plan-technical-reviewer |
Checks plan coherence against technical/architectural specs | light + deep |
plan-code-reviewer |
Checks block feasibility against the existing codebase (targeted exploration only) | deep only |
Review levels:
light— spec coherence only (functional + technical)deep— spec coherence + code feasibility
Verdict: APPROVED / CHANGES_REQUESTED / BLOCKED (aligned with review-manager)
The mechanical
plan_validatetool is unchanged — it still runs the structural linting check (sections present, valid blocks, etc.)
Hints on lifecycle tools
plan_create, plan_update, spec_create, and spec_update now return a hint field — a contextual suggestion to relay to the user to run a validation review once they are done building their plan/spec. No more false auto-trigger promise.
tool.execute.after investigation
We investigated whether OpenCode allows a lifecycle tool to automatically spawn an agent via the tool.execute.after hook. The answer: technically possible (the hook can mutate the output returned to the LLM), but blocking and complex. The chosen approach (enriching the output with a hint) is simpler, more predictable, and avoids race conditions.
- Extract GLOBAL_AGENTS_CONTENT, SUBAGENT_DEFS, mergePermissions, loadAgentPrompt, and registerSubagent into config/agents.js - Extract the 20 lifecycle tool handlers into tools/registry.js behind a buildToolRegistry(projectRoot, paths) factory function - Remove dead skill-loading code (spec-writer skill hook was never supported by OpenCode's plugin API) - Remove legacy agent-write-dirs-exist entry from AGENTS.md - index.js reduced from 961 to ~140 lines — pure orchestration only - All 106 tests pass
Refactor: split index.js into focused modulesSplit the monolithic
Cleanup included:
All 106 tests pass. |
Update all docs and specs to reflect that @opencode-ai/plugin moves from peerDependency to a runtime dependency, with a CI carve-out in the zero-deps check.
Remove the old plan-validator agent (prompt + spec) and replace it with the plan-reviewer cluster spec covering plan-reviewer, plan-functional-reviewer, plan-technical-reviewer, and plan-code-reviewer. Update all cross-references in team-lead-delegation and review-cluster specs.
…hidden migration Update AGENTS.md, README, internal docs, website, and remaining specs to reflect: - config/agents.js holds SUBAGENT_DEFS (was index.js) - tools/registry.js registers the 21 lifecycle tools - silent flag replaced by hidden across agent config tables - 21 lifecycle tools count (was 20)
Summary
Implements the artifact lifecycle refonte described in issue #12.
What changed
tool.execute.beforehook blocks directread/edit/write/bash/glob/grepaccess todocs/specs/,docs/exec-plans/,docs/briefs/. All access goes through lifecycle tools.project_state,mark_block_done,complete_plan,register_spec,check_artifacts) with domain-specific tools:spec_get/create/update/validate/list/deleteplan_get/create/update/validate/block_done/list/deletebrief_get/create/update/list/deleteproject_state(refactored — specs + active plans only, no briefs)spec-validator(auto on spec_create/update),plan-validator(auto on plan_create),spec-reviewer(in review-manager pool)Closes #12