From e1ef10be6eed2efb064152cdbcd6890a3e5cd163 Mon Sep 17 00:00:00 2001 From: Ken Yasue Date: Sun, 28 Jun 2026 18:29:48 +0200 Subject: [PATCH] feat: autonomous setup flow and per-feature doc reconciliation - setup-project: run end-to-end without pausing for human approval between steps - add-feature Step 8: reconcile all six persistent docs with each implemented feature - AGENTS.md: align document-management principles with the new sync rule - opencode.json: simplify permission config --- .opencode/command/add-feature.md | 15 ++++++++++++--- .opencode/command/setup-project.md | 10 +++++----- AGENTS.md | 4 ++-- opencode.json | 23 +++++------------------ 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.opencode/command/add-feature.md b/.opencode/command/add-feature.md index 6a087ab..c825d02 100644 --- a/.opencode/command/add-feature.md +++ b/.opencode/command/add-feature.md @@ -114,9 +114,18 @@ If any of the following situations occur while the implementation loop is runnin - Lessons learned - Improvement suggestions for next time -2. Determine whether this change affects the project's fundamental design or architecture. +2. **Reconcile all six persistent documents in `docs/` with the feature just implemented.** For each document, read its current content, then use the edit tool to update it so it reflects the new feature. An update may be skipped **only** when the document genuinely requires no change for this feature — in that case, leave the document untouched and note the skip reason in the retrospective. -3. If there is an impact, use the edit tool to update the relevant persistent documents in `docs/`. + - ✅ `docs/product-requirements.md` — add/update user stories, acceptance criteria, non-functional requirements, and success metrics for the feature + - ✅ `docs/functional-design.md` — add/update functional modules, screens, data flows, and state changes introduced by the feature + - ✅ `docs/architecture.md` — add/update components, layers, data models, APIs, and non-functional decisions affected by the feature + - ✅ `docs/repository-structure.md` — add/update any new directories, files, or modules created for the feature + - ✅ `docs/development-guidelines.md` — add/update any new conventions, patterns, or standards established during the feature + - ✅ `docs/glossary.md` — add/update any new domain terms introduced by the feature + +3. **Consistency check**: re-read each updated document and confirm it is consistent with the other documents and with the implemented code. Fix any inconsistencies found. + +4. **Once this step completes successfully, never stop; immediately proceed to the Completion Criteria.** ## Completion Criteria @@ -124,6 +133,6 @@ This workflow completes automatically once all of the following conditions are m - Step 5: All tasks in `tasklist.md` are complete (`[x]` or skipped for a valid reason). - Step 6: The `implementation-validator` subagent's validation passes. - Step 7: The `test`, `lint`, and `typecheck` commands all succeed without errors. -- Step 8: Handover notes are recorded in `tasklist.md`. +- Step 8: Handover notes are recorded in `tasklist.md`, and all six persistent documents in `docs/` have been reconciled with the feature (updates applied, or a skip reason noted for each). Until these completion criteria are met, continue to think autonomously, solve problems, and carry on the work. diff --git a/.opencode/command/setup-project.md b/.opencode/command/setup-project.md index 23e074d..6e6c922 100644 --- a/.opencode/command/setup-project.md +++ b/.opencode/command/setup-project.md @@ -1,11 +1,11 @@ --- -description: Initial setup - interactively create the six persistent documents +description: Initial setup - automatically create the six persistent documents agent: build --- # Initial Project Setup -This command interactively creates the project's six persistent documents. +This command automatically creates the project's six persistent documents without pausing for human feedback between steps. ## How to Run @@ -28,7 +28,7 @@ ls docs/ideas/ # If no files exist ⚠️ No files found in docs/ideas/ - The PRD will be created interactively + The PRD will be created from the project context ``` ## Procedure @@ -47,9 +47,9 @@ ls docs/ideas/ - Acceptance criteria - Non-functional requirements - Success metrics -4. Ask the user for confirmation and **wait until approved** +4. Run the skill's self-check checkpoints; if issues are found, fix them inline, then proceed immediately to the next step -**The subsequent steps are based on the Product Requirements Document, so they are created automatically** +**All subsequent steps run automatically without waiting for human feedback.** ### Step 2: Create the Functional Design Document diff --git a/AGENTS.md b/AGENTS.md index 0e36d14..44d47dd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,7 +15,7 @@ 2. **Work planning**: Plan "what to do this time" in steering files (`.steering/`) 3. **Implementation**: Implement according to tasklist.md and update progress as you go 4. **Verification**: Testing and operation checks -5. **Update**: Update documents as needed +5. **Update**: Reconcile all `docs/` documents with the implemented feature (see `/add-feature` Step 8) ### Important Rules @@ -124,8 +124,8 @@ Define "what to do this time" for a specific development task: ### Persistent Documents (`docs/`) - Describe the fundamental design -- Not updated frequently - The "north star" for the entire project +- **Kept in sync with every feature**: at the end of `/add-feature` (Step 8), all six documents are reconciled with the implemented feature (product-requirements, functional-design, architecture, repository-structure, development-guidelines, glossary) ### Work-Unit Documents (`.steering/`) diff --git a/opencode.json b/opencode.json index 4ff13d2..c9821df 100644 --- a/opencode.json +++ b/opencode.json @@ -1,20 +1,7 @@ { "$schema": "https://opencode.ai/config.json", - "instructions": ["AGENTS.md"], - "permission": { - "skill": "allow", - "bash": { - "*": "ask", - "npm *": "allow", - "npx *": "allow", - "node *": "allow", - "git *": "allow", - "ls": "allow", - "ls *": "allow", - "cat *": "allow", - "mkdir *": "allow", - "date": "allow", - "date *": "allow" - } - } -} + "instructions": [ + "AGENTS.md" + ], + "permission": "allow" +} \ No newline at end of file