@agile-vibe-coding/avc 0.2.3 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +475 -3
- package/cli/agents/agent-selector.md +23 -0
- package/cli/agents/code-implementer.md +117 -0
- package/cli/agents/code-validator.md +80 -0
- package/cli/agents/context-reviewer-epic.md +101 -0
- package/cli/agents/context-reviewer-story.md +92 -0
- package/cli/agents/context-writer-epic.md +145 -0
- package/cli/agents/context-writer-story.md +111 -0
- package/cli/agents/doc-writer-epic.md +42 -0
- package/cli/agents/doc-writer-story.md +43 -0
- package/cli/agents/duplicate-detector.md +110 -0
- package/cli/agents/epic-story-decomposer.md +318 -39
- package/cli/agents/mission-scope-generator.md +68 -4
- package/cli/agents/mission-scope-validator.md +40 -6
- package/cli/agents/project-context-extractor.md +21 -6
- package/cli/agents/scaffolding-generator.md +99 -0
- package/cli/agents/seed-validator.md +71 -0
- package/cli/agents/story-scope-reviewer.md +147 -0
- package/cli/agents/story-splitter.md +83 -0
- package/cli/agents/validator-documentation.json +31 -0
- package/cli/agents/validator-documentation.md +3 -1
- package/cli/api-reference-tool.js +368 -0
- package/cli/checks/catalog.json +76 -0
- package/cli/checks/code/quality.json +26 -0
- package/cli/checks/code/testing.json +14 -0
- package/cli/checks/code/traceability.json +26 -0
- package/cli/checks/cross-refs/epic.json +171 -0
- package/cli/checks/cross-refs/story.json +149 -0
- package/cli/checks/epic/api.json +114 -0
- package/cli/checks/epic/backend.json +126 -0
- package/cli/checks/epic/cloud.json +126 -0
- package/cli/checks/epic/data.json +102 -0
- package/cli/checks/epic/database.json +114 -0
- package/cli/checks/epic/developer.json +182 -0
- package/cli/checks/epic/devops.json +174 -0
- package/cli/checks/epic/frontend.json +162 -0
- package/cli/checks/epic/mobile.json +102 -0
- package/cli/checks/epic/qa.json +90 -0
- package/cli/checks/epic/security.json +184 -0
- package/cli/checks/epic/solution-architect.json +192 -0
- package/cli/checks/epic/test-architect.json +90 -0
- package/cli/checks/epic/ui.json +102 -0
- package/cli/checks/epic/ux.json +90 -0
- package/cli/checks/fixes/epic-fix-template.md +10 -0
- package/cli/checks/fixes/story-fix-template.md +10 -0
- package/cli/checks/story/api.json +186 -0
- package/cli/checks/story/backend.json +102 -0
- package/cli/checks/story/cloud.json +102 -0
- package/cli/checks/story/data.json +210 -0
- package/cli/checks/story/database.json +102 -0
- package/cli/checks/story/developer.json +168 -0
- package/cli/checks/story/devops.json +102 -0
- package/cli/checks/story/frontend.json +174 -0
- package/cli/checks/story/mobile.json +102 -0
- package/cli/checks/story/qa.json +210 -0
- package/cli/checks/story/security.json +198 -0
- package/cli/checks/story/solution-architect.json +230 -0
- package/cli/checks/story/test-architect.json +210 -0
- package/cli/checks/story/ui.json +102 -0
- package/cli/checks/story/ux.json +102 -0
- package/cli/coding-order.js +401 -0
- package/cli/dependency-checker.js +72 -0
- package/cli/epic-story-validator.js +284 -799
- package/cli/index.js +0 -0
- package/cli/init-model-config.js +17 -10
- package/cli/init.js +514 -92
- package/cli/kanban-server-manager.js +1 -2
- package/cli/llm-claude.js +98 -31
- package/cli/llm-gemini.js +29 -5
- package/cli/llm-local.js +493 -0
- package/cli/llm-openai.js +262 -41
- package/cli/llm-provider.js +147 -8
- package/cli/llm-token-limits.js +113 -4
- package/cli/llm-verifier.js +209 -1
- package/cli/llm-xiaomi.js +143 -0
- package/cli/message-constants.js +3 -12
- package/cli/messaging-api.js +6 -12
- package/cli/micro-check-fixer.js +335 -0
- package/cli/micro-check-runner.js +449 -0
- package/cli/micro-check-scorer.js +148 -0
- package/cli/micro-check-validator.js +538 -0
- package/cli/model-pricing.js +23 -0
- package/cli/model-selector.js +3 -2
- package/cli/prompt-logger.js +57 -0
- package/cli/repl-ink.js +106 -346
- package/cli/repl-old.js +1 -2
- package/cli/seed-processor.js +194 -24
- package/cli/sprint-planning-processor.js +2638 -289
- package/cli/template-processor.js +50 -3
- package/cli/token-tracker.js +50 -23
- package/cli/tools/generate-story-validators.js +1 -1
- package/cli/validation-router.js +70 -8
- package/cli/worktree-runner.js +654 -0
- package/kanban/client/dist/assets/index-D_KC5EQT.css +1 -0
- package/kanban/client/dist/assets/index-DjY5zqW7.js +351 -0
- package/kanban/client/dist/index.html +2 -2
- package/kanban/client/src/App.jsx +43 -14
- package/kanban/client/src/components/ceremony/AskArchPopup.jsx +7 -3
- package/kanban/client/src/components/ceremony/AskModelPopup.jsx +23 -10
- package/kanban/client/src/components/ceremony/CeremonyWorkflowModal.jsx +320 -133
- package/kanban/client/src/components/ceremony/ProviderSwitcherButton.jsx +290 -0
- package/kanban/client/src/components/ceremony/SponsorCallModal.jsx +80 -13
- package/kanban/client/src/components/ceremony/SprintPlanningModal.jsx +156 -22
- package/kanban/client/src/components/ceremony/steps/ArchitectureStep.jsx +11 -11
- package/kanban/client/src/components/ceremony/steps/CompleteStep.jsx +3 -21
- package/kanban/client/src/components/ceremony/steps/ReviewAnswersStep.jsx +214 -10
- package/kanban/client/src/components/ceremony/steps/RunningStep.jsx +23 -2
- package/kanban/client/src/components/kanban/CardDetailModal.jsx +97 -10
- package/kanban/client/src/components/kanban/GroupingSelector.jsx +7 -1
- package/kanban/client/src/components/kanban/KanbanCard.jsx +23 -14
- package/kanban/client/src/components/kanban/RefineWorkItemPopup.jsx +9 -14
- package/kanban/client/src/components/kanban/RunButton.jsx +162 -0
- package/kanban/client/src/components/kanban/SeedButton.jsx +176 -0
- package/kanban/client/src/components/settings/AgentsTab.jsx +103 -75
- package/kanban/client/src/components/settings/ApiKeysTab.jsx +31 -2
- package/kanban/client/src/components/settings/CeremonyModelsTab.jsx +9 -2
- package/kanban/client/src/components/settings/CheckEditorPopup.jsx +507 -0
- package/kanban/client/src/components/settings/CostThresholdsTab.jsx +3 -2
- package/kanban/client/src/components/settings/ModelPricingTab.jsx +72 -7
- package/kanban/client/src/components/settings/OpenAIAuthSection.jsx +412 -0
- package/kanban/client/src/components/settings/SettingsModal.jsx +4 -4
- package/kanban/client/src/components/stats/CostModal.jsx +34 -3
- package/kanban/client/src/hooks/useGrouping.js +59 -0
- package/kanban/client/src/lib/api.js +118 -4
- package/kanban/client/src/lib/status-grouping.js +10 -0
- package/kanban/client/src/store/kanbanStore.js +8 -0
- package/kanban/server/index.js +23 -2
- package/kanban/server/routes/ceremony.js +153 -4
- package/kanban/server/routes/costs.js +9 -3
- package/kanban/server/routes/openai-oauth.js +366 -0
- package/kanban/server/routes/settings.js +447 -14
- package/kanban/server/routes/websocket.js +7 -2
- package/kanban/server/routes/work-items.js +141 -1
- package/kanban/server/services/CeremonyService.js +275 -24
- package/kanban/server/services/TaskRunnerService.js +261 -0
- package/kanban/server/workers/run-task-worker.js +121 -0
- package/kanban/server/workers/seed-worker.js +94 -0
- package/kanban/server/workers/sponsor-call-worker.js +14 -6
- package/kanban/server/workers/sprint-planning-worker.js +94 -12
- package/package.json +2 -3
- package/cli/agents/solver-epic-api.json +0 -15
- package/cli/agents/solver-epic-api.md +0 -39
- package/cli/agents/solver-epic-backend.json +0 -15
- package/cli/agents/solver-epic-backend.md +0 -39
- package/cli/agents/solver-epic-cloud.json +0 -15
- package/cli/agents/solver-epic-cloud.md +0 -39
- package/cli/agents/solver-epic-data.json +0 -15
- package/cli/agents/solver-epic-data.md +0 -39
- package/cli/agents/solver-epic-database.json +0 -15
- package/cli/agents/solver-epic-database.md +0 -39
- package/cli/agents/solver-epic-developer.json +0 -15
- package/cli/agents/solver-epic-developer.md +0 -39
- package/cli/agents/solver-epic-devops.json +0 -15
- package/cli/agents/solver-epic-devops.md +0 -39
- package/cli/agents/solver-epic-frontend.json +0 -15
- package/cli/agents/solver-epic-frontend.md +0 -39
- package/cli/agents/solver-epic-mobile.json +0 -15
- package/cli/agents/solver-epic-mobile.md +0 -39
- package/cli/agents/solver-epic-qa.json +0 -15
- package/cli/agents/solver-epic-qa.md +0 -39
- package/cli/agents/solver-epic-security.json +0 -15
- package/cli/agents/solver-epic-security.md +0 -39
- package/cli/agents/solver-epic-solution-architect.json +0 -15
- package/cli/agents/solver-epic-solution-architect.md +0 -39
- package/cli/agents/solver-epic-test-architect.json +0 -15
- package/cli/agents/solver-epic-test-architect.md +0 -39
- package/cli/agents/solver-epic-ui.json +0 -15
- package/cli/agents/solver-epic-ui.md +0 -39
- package/cli/agents/solver-epic-ux.json +0 -15
- package/cli/agents/solver-epic-ux.md +0 -39
- package/cli/agents/solver-story-api.json +0 -15
- package/cli/agents/solver-story-api.md +0 -39
- package/cli/agents/solver-story-backend.json +0 -15
- package/cli/agents/solver-story-backend.md +0 -39
- package/cli/agents/solver-story-cloud.json +0 -15
- package/cli/agents/solver-story-cloud.md +0 -39
- package/cli/agents/solver-story-data.json +0 -15
- package/cli/agents/solver-story-data.md +0 -39
- package/cli/agents/solver-story-database.json +0 -15
- package/cli/agents/solver-story-database.md +0 -39
- package/cli/agents/solver-story-developer.json +0 -15
- package/cli/agents/solver-story-developer.md +0 -39
- package/cli/agents/solver-story-devops.json +0 -15
- package/cli/agents/solver-story-devops.md +0 -39
- package/cli/agents/solver-story-frontend.json +0 -15
- package/cli/agents/solver-story-frontend.md +0 -39
- package/cli/agents/solver-story-mobile.json +0 -15
- package/cli/agents/solver-story-mobile.md +0 -39
- package/cli/agents/solver-story-qa.json +0 -15
- package/cli/agents/solver-story-qa.md +0 -39
- package/cli/agents/solver-story-security.json +0 -15
- package/cli/agents/solver-story-security.md +0 -39
- package/cli/agents/solver-story-solution-architect.json +0 -15
- package/cli/agents/solver-story-solution-architect.md +0 -39
- package/cli/agents/solver-story-test-architect.json +0 -15
- package/cli/agents/solver-story-test-architect.md +0 -39
- package/cli/agents/solver-story-ui.json +0 -15
- package/cli/agents/solver-story-ui.md +0 -39
- package/cli/agents/solver-story-ux.json +0 -15
- package/cli/agents/solver-story-ux.md +0 -39
- package/cli/agents/validator-epic-api.json +0 -93
- package/cli/agents/validator-epic-api.md +0 -137
- package/cli/agents/validator-epic-backend.json +0 -93
- package/cli/agents/validator-epic-backend.md +0 -130
- package/cli/agents/validator-epic-cloud.json +0 -93
- package/cli/agents/validator-epic-cloud.md +0 -137
- package/cli/agents/validator-epic-data.json +0 -93
- package/cli/agents/validator-epic-data.md +0 -130
- package/cli/agents/validator-epic-database.json +0 -93
- package/cli/agents/validator-epic-database.md +0 -137
- package/cli/agents/validator-epic-developer.json +0 -74
- package/cli/agents/validator-epic-developer.md +0 -153
- package/cli/agents/validator-epic-devops.json +0 -74
- package/cli/agents/validator-epic-devops.md +0 -153
- package/cli/agents/validator-epic-frontend.json +0 -74
- package/cli/agents/validator-epic-frontend.md +0 -153
- package/cli/agents/validator-epic-mobile.json +0 -93
- package/cli/agents/validator-epic-mobile.md +0 -130
- package/cli/agents/validator-epic-qa.json +0 -93
- package/cli/agents/validator-epic-qa.md +0 -130
- package/cli/agents/validator-epic-security.json +0 -74
- package/cli/agents/validator-epic-security.md +0 -154
- package/cli/agents/validator-epic-solution-architect.json +0 -74
- package/cli/agents/validator-epic-solution-architect.md +0 -156
- package/cli/agents/validator-epic-test-architect.json +0 -93
- package/cli/agents/validator-epic-test-architect.md +0 -130
- package/cli/agents/validator-epic-ui.json +0 -93
- package/cli/agents/validator-epic-ui.md +0 -130
- package/cli/agents/validator-epic-ux.json +0 -93
- package/cli/agents/validator-epic-ux.md +0 -130
- package/cli/agents/validator-story-api.json +0 -104
- package/cli/agents/validator-story-api.md +0 -152
- package/cli/agents/validator-story-backend.json +0 -104
- package/cli/agents/validator-story-backend.md +0 -152
- package/cli/agents/validator-story-cloud.json +0 -104
- package/cli/agents/validator-story-cloud.md +0 -152
- package/cli/agents/validator-story-data.json +0 -104
- package/cli/agents/validator-story-data.md +0 -152
- package/cli/agents/validator-story-database.json +0 -104
- package/cli/agents/validator-story-database.md +0 -152
- package/cli/agents/validator-story-developer.json +0 -104
- package/cli/agents/validator-story-developer.md +0 -152
- package/cli/agents/validator-story-devops.json +0 -104
- package/cli/agents/validator-story-devops.md +0 -152
- package/cli/agents/validator-story-frontend.json +0 -104
- package/cli/agents/validator-story-frontend.md +0 -152
- package/cli/agents/validator-story-mobile.json +0 -104
- package/cli/agents/validator-story-mobile.md +0 -152
- package/cli/agents/validator-story-qa.json +0 -104
- package/cli/agents/validator-story-qa.md +0 -152
- package/cli/agents/validator-story-security.json +0 -104
- package/cli/agents/validator-story-security.md +0 -152
- package/cli/agents/validator-story-solution-architect.json +0 -104
- package/cli/agents/validator-story-solution-architect.md +0 -152
- package/cli/agents/validator-story-test-architect.json +0 -104
- package/cli/agents/validator-story-test-architect.md +0 -152
- package/cli/agents/validator-story-ui.json +0 -104
- package/cli/agents/validator-story-ui.md +0 -152
- package/cli/agents/validator-story-ux.json +0 -104
- package/cli/agents/validator-story-ux.md +0 -152
- package/kanban/client/dist/assets/index-CiD8PS2e.js +0 -306
- package/kanban/client/dist/assets/index-nLh0m82Q.css +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,477 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agile Vibe Coding (AVC)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**A CLI and web UI toolkit for structured AI-assisted software development**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
AVC is a toolkit — combining a command-line interface with an interactive web-based kanban board — that implements the principles of the [Agile Vibe Coding Manifesto](https://agilevibecoding.org). It provides ceremonies, assets, and validation workflows that guide AI coding agents toward coherent, long-term software delivery — shaping context, constraints, and verification so that LLM limitations don't silently degrade your project.
|
|
6
|
+
|
|
7
|
+
## How to Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @agile-vibe-coding/avc
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then, in your project root directory:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
avc
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This launches the AVC interactive CLI. From there:
|
|
20
|
+
|
|
21
|
+
1. Run `/init` to initialize AVC in your project (creates `.avc/` config directory and `.env` for API keys)
|
|
22
|
+
2. Run `/kanban` to launch the web-based kanban board at `http://localhost:4174`
|
|
23
|
+
3. From the kanban board, configure your LLM provider in **Settings** (API keys, ceremony models)
|
|
24
|
+
4. Start the **Sponsor Call** ceremony to define your project scope
|
|
25
|
+
5. Run **Sprint Planning** to decompose into Epics and Stories
|
|
26
|
+
6. Use **Seed** to break Stories into Tasks, then **Run** to implement code
|
|
27
|
+
|
|
28
|
+
AVC auto-detects available API keys and switches ceremony models accordingly — if only one provider key is set, all ceremonies use that provider automatically.
|
|
29
|
+
|
|
30
|
+
## Core Concepts
|
|
31
|
+
|
|
32
|
+
AVC organizes AI-assisted development through three pillars: a **hierarchical asset structure** for context management, **ceremonies** that drive project planning and decomposition, and **multi-perspective validation** that catches issues before they reach code.
|
|
33
|
+
|
|
34
|
+
### Assets Hierarchy
|
|
35
|
+
|
|
36
|
+
The Assets Hierarchy establishes a structured folder architecture to organize work items and documentation. Each node contains a `doc.md` (scoped documentation), a `context.md` (canonical specification generated by LLM context writers with tool-augmented API reference discovery), and a `work.json` (work item definition with validation tests).
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
project/
|
|
40
|
+
├── doc.md # project-level documentation
|
|
41
|
+
├── context.md # project context
|
|
42
|
+
├── coding-order.md # dependency graph + phased implementation order
|
|
43
|
+
├── coding-order.json # structured phase data for kanban board
|
|
44
|
+
└── context-0001/
|
|
45
|
+
├── doc.md # epic-specific documentation
|
|
46
|
+
├── context.md # project + epic context (accumulated)
|
|
47
|
+
├── work.json # work item (EPIC)
|
|
48
|
+
└── context-0001-0001/
|
|
49
|
+
├── doc.md # story-specific documentation
|
|
50
|
+
├── context.md # project + epic + story context
|
|
51
|
+
├── work.json # work item (STORY)
|
|
52
|
+
└── context-0001-0001-0001/
|
|
53
|
+
├── doc.md # task-specific documentation
|
|
54
|
+
├── context.md # full accumulated context
|
|
55
|
+
├── work.json # work item (TASK)
|
|
56
|
+
├── context-0001-0001-0001-0001/
|
|
57
|
+
│ ├── doc.md # subtask documentation
|
|
58
|
+
│ ├── context.md # full accumulated context
|
|
59
|
+
│ └── work.json # work item (SUBTASK)
|
|
60
|
+
└── context-0001-0001-0001-0002/
|
|
61
|
+
├── ...
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Documentation
|
|
65
|
+
|
|
66
|
+
Each node in the hierarchy maintains a single `doc.md` file, scoped to introduce only the information that is new and specific to that node — no duplication of what parent levels already define. Agents accumulate the full picture by reading all `doc.md` files along the path from root to the current node.
|
|
67
|
+
|
|
68
|
+
### Work Item
|
|
69
|
+
|
|
70
|
+
Work items define what needs to get done, including dependencies, acceptance criteria, validation scores, and implementation metadata.
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"id": "context-0001-0001-0001",
|
|
75
|
+
"name": "Implement Calculator Layout",
|
|
76
|
+
"type": "task",
|
|
77
|
+
"description": "Create the responsive HTML/CSS grid layout for the calculator UI",
|
|
78
|
+
"acceptance": [
|
|
79
|
+
"Calculator renders with display area and button grid",
|
|
80
|
+
"Layout adapts from 320px mobile to desktop widths",
|
|
81
|
+
"Touch targets are minimum 44x44 CSS pixels"
|
|
82
|
+
],
|
|
83
|
+
"status": "ready",
|
|
84
|
+
"dependencies": ["context-0001-0001-0001"],
|
|
85
|
+
"children": [],
|
|
86
|
+
"metadata": {
|
|
87
|
+
"codingPhase": 2,
|
|
88
|
+
"codingOrder": 5,
|
|
89
|
+
"created": "2026-03-26T20:59:37.935+01:00",
|
|
90
|
+
"ceremony": "sprint-planning",
|
|
91
|
+
"validationResult": {
|
|
92
|
+
"averageScore": 96,
|
|
93
|
+
"overallStatus": "excellent"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
#### Work Items Flow
|
|
101
|
+
|
|
102
|
+
Work items are implemented bottom-up in the tree.
|
|
103
|
+
Start with the smallest, most concrete tasks (leaf nodes). Once those are done and validated, move up to their parents.
|
|
104
|
+
|
|
105
|
+
If it has children, it waits.
|
|
106
|
+
|
|
107
|
+
**Implementation Rules**
|
|
108
|
+
|
|
109
|
+
1. **Start at the bottom**
|
|
110
|
+
- Begin with the deepest atomic tasks (leaf nodes).
|
|
111
|
+
- Tasks should be small, self-contained, and testable.
|
|
112
|
+
|
|
113
|
+
2. **Parents wait for children**
|
|
114
|
+
- A parent work item cannot start until:
|
|
115
|
+
- All child items are marked `completed`
|
|
116
|
+
- All related tests are passing
|
|
117
|
+
- No partial roll-ups.
|
|
118
|
+
|
|
119
|
+
3. **Parallel work — with limits**
|
|
120
|
+
- Parallel implementation is allowed only for **sibling nodes**.
|
|
121
|
+
- Do not parallelize across dependency chains.
|
|
122
|
+
- If two items depend on each other (directly or indirectly), they must be executed sequentially.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
**Example execution order**
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
context-0001/ # Epic
|
|
129
|
+
├── context-0001-0001/ # Story
|
|
130
|
+
│ ├── context-0001-0001-0001/ # Task
|
|
131
|
+
│ │ ├── context-0001-0001-0001-0001/ <- 1. Implement first (atomic subtask)
|
|
132
|
+
│ │ └── context-0001-0001-0001-0002/ <- 1. Parallel with sibling -0001
|
|
133
|
+
│ │ # Task starts only after both subtasks complete
|
|
134
|
+
│ └── context-0001-0001-0002/ <- 2. Parallel with sibling task -0001
|
|
135
|
+
│ # Story starts only after both tasks complete
|
|
136
|
+
└── context-0001-0002/ <- 2. Parallel with sibling story -0001
|
|
137
|
+
# Epic completes only after both stories complete
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Hierarchical Documentation
|
|
141
|
+
|
|
142
|
+
Every work item carries two documentation files with distinct roles:
|
|
143
|
+
|
|
144
|
+
- **`context.md`** — Structured canonical specification. Fixed sections (Identity, Purpose, Scope In/Out, Features, NFRs, Dependencies, Success Criteria). Machine-oriented: micro-check validators score against it, auto-fixers refine it, doc-writers derive from it. This is the **single source of truth** for what a work item delivers.
|
|
145
|
+
|
|
146
|
+
- **`doc.md`** — Narrative documentation. Prose written for developers and implementation agents. Explains *how things work together* — API contracts, error handling, data models, business rules, edge cases. Generated from `context.md` by doc-writer agents and enriched with implementation-ready detail.
|
|
147
|
+
|
|
148
|
+
Both files follow the **hierarchical inheritance** principle: each level introduces only what is new and specific to its scope — no duplication of what parent levels already define. Context flows downward, and each child inherits its parent's decisions without repeating their justification.
|
|
149
|
+
|
|
150
|
+
Research confirms this approach. Gloaguen et al. (2025) found that broad, comprehensive context files reduce agent task-success rates and increase inference cost by more than 20% ([arXiv:2602.11988](https://arxiv.org/abs/2602.11988)). The key principle: agents perform best when context is **minimal and scoped** — only what is new at each level.
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
project/
|
|
154
|
+
├── context.md # Project context — tech stack, deployment, team, constraints
|
|
155
|
+
├── doc.md # Project narrative — mission, target users, full scope brief
|
|
156
|
+
└── context-0001/ # Epic
|
|
157
|
+
├── context.md # Epic spec — domain purpose, features, NFRs, in/out scope
|
|
158
|
+
├── doc.md # Epic narrative — how features connect, security considerations
|
|
159
|
+
├── work.json # Epic metadata (name, domain, validation scores)
|
|
160
|
+
└── context-0001-0001/ # Story
|
|
161
|
+
├── context.md # Story spec — user story, acceptance criteria, dependencies
|
|
162
|
+
├── doc.md # Story narrative — API contracts, error tables, DB fields
|
|
163
|
+
├── work.json # Story metadata (name, userType, validation scores)
|
|
164
|
+
└── context-0001-0001-0001/ # Task
|
|
165
|
+
├── doc.md # Task narrative — implementation pattern for this task
|
|
166
|
+
└── work.json # Task metadata
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**When an agent implements task `context-0001-0001-0001`**, it reads all `doc.md` files along the path (project -> epic -> story -> task) as its complete context. Each level adds one layer of specificity: the project defines the stack, the epic defines the domain rules, the story defines the endpoint contract, and the task defines the implementation pattern for one piece of that story.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
#### Validation Order
|
|
173
|
+
|
|
174
|
+
Testing follows the same bottom-up execution model as implementation:
|
|
175
|
+
|
|
176
|
+
1. **Subtask (Unit) tests must pass first.**
|
|
177
|
+
2. Once all subtask tests pass, run **Task (Integration) tests**.
|
|
178
|
+
3. Only when all task tests pass, run **Story (E2E) tests**.
|
|
179
|
+
4. Only when all stories pass, run **Epic (System) tests**.
|
|
180
|
+
|
|
181
|
+
No higher-level tests should run if lower-level tests are failing.
|
|
182
|
+
|
|
183
|
+
This ensures:
|
|
184
|
+
- Failures are caught at the smallest possible scope
|
|
185
|
+
- Debugging remains localized and efficient
|
|
186
|
+
- System-level validation reflects fully verified lower layers
|
|
187
|
+
|
|
188
|
+
## Ceremonies
|
|
189
|
+
|
|
190
|
+
AVC ceremonies guide a project from initial vision through to implementable work units. Each ceremony produces structured artifacts that feed into the next.
|
|
191
|
+
|
|
192
|
+
```mermaid
|
|
193
|
+
graph LR
|
|
194
|
+
A[Sponsor Call] --> B[Sprint Planning]
|
|
195
|
+
B --> C[Seed]
|
|
196
|
+
C --> D[Run]
|
|
197
|
+
D --> E[Human Review]
|
|
198
|
+
E --> D
|
|
199
|
+
E --> B
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
All ceremonies are launched from the **kanban board** (`/kanban` in the CLI). Each ceremony has its own model configuration in Settings, with per-stage model selection and provider presets.
|
|
203
|
+
|
|
204
|
+
### Sponsor Call
|
|
205
|
+
|
|
206
|
+
The foundational ceremony. Through a guided questionnaire, it captures the project's mission, scope, and constraints, then generates the root `doc.md` and project brief. All downstream ceremonies build on this output.
|
|
207
|
+
|
|
208
|
+
### Sprint Planning
|
|
209
|
+
|
|
210
|
+
Decomposes the project scope into domain-based Epics and Stories, validates each work item through multi-agent domain expert review, and generates hierarchical documentation. The ceremony runs through these phases:
|
|
211
|
+
|
|
212
|
+
#### Scope Collection
|
|
213
|
+
|
|
214
|
+
Before any LLM call, the system gathers and prepares all inputs the decomposer will need. No LLM is involved — this phase is pure file I/O and data preparation.
|
|
215
|
+
|
|
216
|
+
1. **Read project scope** — Loads the root `doc.md` (generated by Sponsor Call) which contains the full project brief: mission statement, target users, initial scope, deployment target, technical considerations, and security requirements. This document is the single source of truth for what the project should build.
|
|
217
|
+
|
|
218
|
+
2. **Analyse existing hierarchy** — Scans `.avc/project/` for any Epics and Stories already on disk from prior sprint planning runs. For each existing Epic it reads `work.json` to extract the name, domain, description, features, and story names.
|
|
219
|
+
|
|
220
|
+
This phase produces five outputs that flow into downstream stages:
|
|
221
|
+
|
|
222
|
+
| Output | Type | Consumed by |
|
|
223
|
+
|--------|------|-------------|
|
|
224
|
+
| `scope` | Full text of `doc.md` | Decomposition — injected into the LLM prompt as the project scope to decompose |
|
|
225
|
+
| `existingEpics` | Map of epic name -> id | Decomposition — listed in the prompt under "Existing Epics (DO NOT DUPLICATE)" so the LLM skips them |
|
|
226
|
+
| `existingStories` | Map of story name -> id | Decomposition — listed in the prompt under "Existing Stories (DO NOT DUPLICATE)" |
|
|
227
|
+
| `preRunSnapshot` | Array of rich epic objects (id, name, domain, description, story names) | Duplicate Detection (Stage 4.1) — passed to the duplicate detector agent as existing on-disk epics for cross-run overlap analysis |
|
|
228
|
+
| `maxEpicNum` / `maxStoryNums` | Counters tracking the highest existing context IDs | Documentation & Output — used to assign sequential IDs to new Epics and Stories without colliding with existing ones |
|
|
229
|
+
|
|
230
|
+
All outputs are held in memory and passed as function arguments through the stage pipeline — nothing is written to disk during this phase.
|
|
231
|
+
|
|
232
|
+
#### Decomposition
|
|
233
|
+
|
|
234
|
+
The system calls the LLM to break the project scope into Epics (domain-based groupings) and Stories (user-facing capabilities per Epic) — as many as needed to fully cover the scope. The decomposer agent calibrates granularity to project complexity: a single-file app gets 1-2 epics, a multi-service project gets 6-15.
|
|
235
|
+
|
|
236
|
+
**Agent** — [`src/cli/agents/epic-story-decomposer.md`](src/cli/agents/epic-story-decomposer.md) — defines domain-driven design rules, project complexity calibration, the JSON output schema, scope completeness guidelines, tech stack fidelity requirements, dependency completeness rules, and the story split pattern for overly broad stories.
|
|
237
|
+
|
|
238
|
+
**Output** — A `hierarchy` JSON object containing an `epics` array. Each epic carries `id`, `name`, `domain`, `description`, `features`, `dependencies`, and a nested `stories` array. Each story carries `id`, `name`, `userType`, `description`, `acceptance` (criteria array), and `dependencies`. Dependencies are normalized to context IDs (not names) before writing to disk.
|
|
239
|
+
|
|
240
|
+
**Quality gate** — After decomposition, a quality check verifies structural issues (0-story epics, invalid ID formats, missing acceptance criteria). If issues are found, the decomposer retries with violation feedback (up to 3 retries).
|
|
241
|
+
|
|
242
|
+
#### Duplicate Avoidance
|
|
243
|
+
|
|
244
|
+
Sprint planning runs incrementally — each run generates new Epics and Stories alongside those already on disk from prior runs. Duplicate avoidance works in three layers:
|
|
245
|
+
|
|
246
|
+
1. **Prompt-level prevention** — Before calling the LLM, existing Epic and Story names are injected into the prompt with an explicit instruction to skip them.
|
|
247
|
+
|
|
248
|
+
2. **LLM-based semantic deduplication** — A second LLM call ([`src/cli/agents/duplicate-detector.md`](src/cli/agents/duplicate-detector.md)) analyses the newly generated epics for semantic overlaps. On any LLM error, the system falls back to Jaccard-similarity algorithmic deduplication.
|
|
249
|
+
|
|
250
|
+
3. **Story scope review** — One LLM call per Epic reviews each Story's scope for cohesion. Stories that mix too many concerns are split into focused vertical slices.
|
|
251
|
+
|
|
252
|
+
#### Context Generation
|
|
253
|
+
|
|
254
|
+
After decomposition, each Epic and Story receives a canonical `context.md` — a structured specification that serves as the single source of truth for validation and documentation.
|
|
255
|
+
|
|
256
|
+
The system runs a **Write -> Review -> Refine** loop (up to 3 rounds per item) using paired agents:
|
|
257
|
+
|
|
258
|
+
- **Context Writer** ([`context-writer-epic.md`](src/cli/agents/context-writer-epic.md) / [`context-writer-story.md`](src/cli/agents/context-writer-story.md)) generates the initial context.
|
|
259
|
+
- **Context Reviewer** ([`context-reviewer-epic.md`](src/cli/agents/context-reviewer-epic.md) / [`context-reviewer-story.md`](src/cli/agents/context-reviewer-story.md)) independently audits the generated context.
|
|
260
|
+
- If the reviewer finds issues, the writer refines. This loop ensures context quality without relying on a single LLM pass.
|
|
261
|
+
|
|
262
|
+
Context generation enforces consistency checks:
|
|
263
|
+
|
|
264
|
+
- **Auth mechanism detection** — Detects whether the project has no auth, session-based auth, or JWT from the project brief. Projects with no backend/no login get `mechanism: none` — no auth boilerplate is injected.
|
|
265
|
+
- **Cross-reference accuracy** — Validates that epic IDs referenced in dependency sections point to correct epics.
|
|
266
|
+
- **Rate limit consistency** — Flags contradictions such as "10 requests/min" in one section vs "10 requests/sec" in another.
|
|
267
|
+
|
|
268
|
+
#### External API Documentation Discovery
|
|
269
|
+
|
|
270
|
+
When context writers generate `context.md` for stories or epics that integrate with external services, they can call a `fetch_api_reference` tool that resolves API documentation through [Context7](https://context7.com) (Upstash) — topic-specific, LLM-optimized documentation for thousands of libraries and APIs. This prevents hallucinating API details like payload formats, field names, and authentication mechanisms.
|
|
271
|
+
|
|
272
|
+
#### Project Scaffolding Epic (Auto-Generated)
|
|
273
|
+
|
|
274
|
+
After all domain epic and story contexts are generated, the system automatically creates a **Project Scaffolding** epic (`context-0000`) that bootstraps the project's development environment. Unlike domain epics which are generated during decomposition, the scaffolding epic is generated **last** so it can read the actual tech requirements from every epic and story context.
|
|
275
|
+
|
|
276
|
+
**How it works:**
|
|
277
|
+
|
|
278
|
+
1. **Tech extraction** — scans all cached context.md files for technology mentions using pattern matching.
|
|
279
|
+
2. **LLM generation** — calls the scaffolding generator agent with the extracted tech requirements. The agent generates 2-4 stories adapted to the project's actual stack.
|
|
280
|
+
3. **Dependency injection** — the scaffolding epic is inserted as the first epic. All domain epics are programmatically updated to depend on it. Scaffolding stories are chained sequentially (story 2 depends on story 1, etc.) so only the first story starts as `ready`.
|
|
281
|
+
|
|
282
|
+
#### Micro-Check Validation (3-Tier)
|
|
283
|
+
|
|
284
|
+
Each Epic and Story is validated through a 3-tier micro-check system: hundreds of small, atomic YES/NO quality checks run in parallel across 15 domain perspectives, followed by cross-reference consistency checks, deterministic scoring, and targeted auto-fixes.
|
|
285
|
+
|
|
286
|
+
The validation flow per work item:
|
|
287
|
+
|
|
288
|
+
1. **Context extraction** — A single LLM call infers the project's deployment type, tech stack, and domain characteristics.
|
|
289
|
+
|
|
290
|
+
2. **Perspective selection** — An AI selector picks which domain perspectives are relevant per Epic/Story, excluding inapplicable roles.
|
|
291
|
+
|
|
292
|
+
3. **Tier 1 — Domain checks** (~342 checks across 15 perspectives):
|
|
293
|
+
- Each check is 1-2 small LLM calls: an applicability gate and a YES/NO quality question.
|
|
294
|
+
- Checks run in parallel, limited by the `concurrency` setting (default 5).
|
|
295
|
+
- Each perspective has 7-19 checks defined in JSON files under [`src/cli/checks/`](src/cli/checks/).
|
|
296
|
+
|
|
297
|
+
4. **Tier 2 — Cross-reference checks** (~28 checks):
|
|
298
|
+
- Run after all Tier 1 checks complete — they depend on Tier 1 evidence.
|
|
299
|
+
- Verify that different perspectives agree (e.g., security role model matches API endpoint access control).
|
|
300
|
+
|
|
301
|
+
5. **Tier 3 — Scoring + fixing** (0 LLM calls for scoring, 1 LLM call per fix):
|
|
302
|
+
- **Deterministic scoring** based on pass/fail counts by severity.
|
|
303
|
+
- **Atomic per-check fixes** for critical/major failures: each fix is 1 LLM call, verified after application, reverted if the check still fails.
|
|
304
|
+
|
|
305
|
+
6. **Story splitting** — If a story remains below threshold with 15+ acceptance criteria, it's split into 2-3 focused stories that replace the original and re-enter validation.
|
|
306
|
+
|
|
307
|
+
Check definitions are JSON files in [`src/cli/checks/`](src/cli/checks/). They can be customized per project via the kanban board's Settings -> Agents tab.
|
|
308
|
+
|
|
309
|
+
#### Documentation & Output
|
|
310
|
+
|
|
311
|
+
The final phase writes all files to disk and generates two documentation layers:
|
|
312
|
+
|
|
313
|
+
1. **Write hierarchy files** — Renumbers IDs to sequential order, normalizes dependencies from names to IDs, writes `work.json` and `context.md` for each item. Computes coding order from the dependency graph.
|
|
314
|
+
2. **Generate doc.md** — One LLM call per Epic and Story, converting `context.md` -> narrative `doc.md`.
|
|
315
|
+
3. **Enrich story docs** — One LLM call per Story, augmenting `doc.md` with implementation-ready detail (API contracts, error tables, DB fields).
|
|
316
|
+
4. **Set ready status** — Items with no unresolved dependencies are set to `ready` status. Items whose dependencies are not yet completed stay `planned`.
|
|
317
|
+
|
|
318
|
+
#### Implementation Ordering
|
|
319
|
+
|
|
320
|
+
AVC computes a dependency-based implementation order from the epic/story dependency graph using topological sort (Kahn's algorithm). Epics are grouped into parallelizable phases — Phase 1 has no dependencies, Phase 2 depends only on Phase 1, etc.
|
|
321
|
+
|
|
322
|
+
Outputs:
|
|
323
|
+
- **`coding-order.md`** — Human-readable document with Mermaid dependency graph, critical path, and phased story order.
|
|
324
|
+
- **`coding-order.json`** — Structured data for the kanban board with phase assignments and ordering metadata.
|
|
325
|
+
|
|
326
|
+
Each work item's `work.json` receives `codingPhase` and `codingOrder` fields. The kanban board displays phase badges (P1, P2, etc.) and supports a "Phase" grouping mode.
|
|
327
|
+
|
|
328
|
+
#### Resume After Failure
|
|
329
|
+
|
|
330
|
+
If sprint planning fails mid-ceremony (after files are written to disk), the system detects the aborted run on the next start and offers **Resume** or **Start Fresh**. Resume rebuilds the hierarchy from disk and skips directly to the remaining stages (doc generation, enrichment), avoiding re-running expensive decomposition and validation.
|
|
331
|
+
|
|
332
|
+
### Seed (Kanban Seed Button)
|
|
333
|
+
|
|
334
|
+
Decomposes a Story into Tasks (2-5) and Subtasks (1-3 per Task), creating atomic work units ready for AI-assisted implementation. Each unit gets its own `context.md`, `doc.md`, and `work.json` in the asset hierarchy.
|
|
335
|
+
|
|
336
|
+
#### Decompose -> Validate -> Refine Loop
|
|
337
|
+
|
|
338
|
+
Seed uses the same iterative quality pattern as Sprint Planning:
|
|
339
|
+
|
|
340
|
+
1. **Decompose** — LLM ([`task-subtask-decomposer.md`](src/cli/agents/task-subtask-decomposer.md)) breaks the story into tasks with acceptance criteria, dependencies, and subtasks.
|
|
341
|
+
2. **Structural validation** (deterministic) — checks ID formats, task count (2-5), subtask count (1-3), and acceptance criteria presence. No LLM cost.
|
|
342
|
+
3. **Semantic validation** (LLM, [`seed-validator.md`](src/cli/agents/seed-validator.md)) — checks story AC coverage, task distinctness, naming clarity, AC quality, dependency correctness, and subtask granularity.
|
|
343
|
+
4. **Refinement** — if validation fails, violations are fed back to the decomposer for the next iteration (up to 3 retries).
|
|
344
|
+
|
|
345
|
+
#### Dependency Gating
|
|
346
|
+
|
|
347
|
+
Before seeding, the system checks whether the story's dependencies (other stories, parent epic dependencies) are all `completed`. If not, the Seed button shows the blocker list and prevents execution.
|
|
348
|
+
|
|
349
|
+
#### Kanban Integration
|
|
350
|
+
|
|
351
|
+
The Seed button appears on story cards in the kanban board detail modal. It runs as a background worker process via `TaskRunnerService`, streaming progress via WebSocket. Multiple stories can be seeded in parallel. Model configuration is available in Settings -> Ceremony Models -> Seed.
|
|
352
|
+
|
|
353
|
+
### Run (Kanban Run Button)
|
|
354
|
+
|
|
355
|
+
Implements a task's code in an isolated git worktree using AI agents, runs tests, and merges to the main branch on success.
|
|
356
|
+
|
|
357
|
+
#### Worktree Lifecycle
|
|
358
|
+
|
|
359
|
+
1. **Pre-flight check** — verifies package.json and git repo exist.
|
|
360
|
+
2. **Create worktree** — `git worktree add .avc/worktrees/{taskId} -b avc/{taskId}` creates an isolated branch.
|
|
361
|
+
3. **Read documentation chain** — walks the full hierarchy (project -> epic -> story -> task -> subtasks), concatenating all `doc.md` and `context.md` files into a single context string.
|
|
362
|
+
4. **Code generation** (LLM, [`code-implementer.md`](src/cli/agents/code-implementer.md)) — generates source files and tests following traceability rules: hierarchy-prefixed naming, JSDoc provenance headers, functional purity, domain vocabulary.
|
|
363
|
+
5. **Code validation** (LLM, [`code-validator.md`](src/cli/agents/code-validator.md)) — verifies generated code against check definitions in [`src/cli/checks/code/`](src/cli/checks/code/). If violations found, feeds them back to the implementer (up to 3 iterations).
|
|
364
|
+
6. **Run tests** — executes the project's test command in the worktree. If tests fail, the worktree is cleaned up and the task is marked `failed`.
|
|
365
|
+
7. **Commit and merge** — stages all changes, commits, merges to main with `--no-ff`, then cleans up the worktree and branch.
|
|
366
|
+
|
|
367
|
+
#### Function Registry
|
|
368
|
+
|
|
369
|
+
After implementation, the task's `work.json` receives a `functions` array listing every generated function with its file path, type, purity flag, line count, and which acceptance criterion it satisfies. This registry propagates upward — stories aggregate from tasks, epics from stories. The kanban board displays it under a "Code" tab.
|
|
370
|
+
|
|
371
|
+
#### Configuration
|
|
372
|
+
|
|
373
|
+
The Run ceremony is configured in `.avc/avc.json` with per-stage model selection (`code-generation`, `code-validation`), `maxValidationIterations`, and `acceptanceThreshold`. Code check definitions in `src/cli/checks/code/` are customizable via the kanban Settings -> Agents tab.
|
|
374
|
+
|
|
375
|
+
### Kanban Board (`/kanban`)
|
|
376
|
+
|
|
377
|
+
Interactive web-based kanban board for visualizing and managing work items across workflow stages (Backlog, Ready, In Progress, Review, Done). Supports filtering, grouping (by status, epic, type, or implementation phase), and real-time WebSocket updates.
|
|
378
|
+
|
|
379
|
+
The kanban board is the primary interface for running ceremonies, configuring models, managing API keys, and monitoring progress. All ceremonies (Sponsor Call, Sprint Planning, Seed, Run) are launched from the board.
|
|
380
|
+
|
|
381
|
+
#### Seed and Run Buttons
|
|
382
|
+
|
|
383
|
+
Story cards display a **Seed** button that decomposes the story into tasks. Task cards display a **Run** button that implements the code in a worktree. Both buttons check dependencies before execution and show streaming progress logs. Multiple seeds and runs can execute in parallel.
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
## Multi-Provider LLM Support
|
|
387
|
+
|
|
388
|
+
AVC supports **different LLM providers for each ceremony stage**, allowing you to optimize for cost, speed, or quality.
|
|
389
|
+
|
|
390
|
+
### Supported Providers
|
|
391
|
+
|
|
392
|
+
- **Claude** (Anthropic) — Best for long-form documentation, complex reasoning, structured thinking
|
|
393
|
+
- **Gemini** (Google) — Fast and cost-effective for iteration-heavy tasks
|
|
394
|
+
- **OpenAI** — GPT models via API key or OAuth
|
|
395
|
+
- **Xiaomi MiMo** — MiMo V2 models (Flash, Pro, Omni) via OpenAI-compatible API. Flash ($0.09/$0.29 per 1M tokens) for validation, Pro ($1/$3, 1M context) for reasoning-heavy stages. Get a key at [platform.xiaomimimo.com](https://platform.xiaomimimo.com).
|
|
396
|
+
- **Local** (LM Studio / Ollama) — Run ceremonies with local models via OpenAI-compatible API. Supports tool-augmented context generation with streaming fallback. Set `LOCAL_LLM_URL` in `.env` or auto-discovers on standard ports.
|
|
397
|
+
|
|
398
|
+
### API Keys
|
|
399
|
+
|
|
400
|
+
Set in `.env` file (created by `/init`):
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
404
|
+
GEMINI_API_KEY=...
|
|
405
|
+
OPENAI_API_KEY=sk-...
|
|
406
|
+
XIAOMI_API_KEY=sk-...
|
|
407
|
+
LOCAL_LLM_URL=http://localhost:1234/v1 # optional
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Auto-Provider Fallback
|
|
411
|
+
|
|
412
|
+
When a ceremony starts, AVC checks if the configured provider has a valid API key. If not, it automatically switches all ceremony stages to the first available provider (priority: Claude -> Gemini -> OpenAI -> Xiaomi -> Local), applies the provider's preset models for each stage, and persists the change to `avc.json`. This means you only need one API key to get started — AVC configures everything else.
|
|
413
|
+
|
|
414
|
+
### Per-Stage Model Configuration
|
|
415
|
+
|
|
416
|
+
Each ceremony has multiple stages (e.g., decomposition, validation, context-generation), each configurable with its own provider and model. Provider presets define optimal model choices per stage (e.g., Opus for architecture, Haiku for validation). Configure via the kanban Settings -> Ceremony Models tab.
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
## AI Agent Strategy: Single Prompt Approach
|
|
420
|
+
|
|
421
|
+
AVC uses a **single prompt strategy** where agent instructions and task data are combined into one user message, rather than separating them into system instructions and user prompts.
|
|
422
|
+
|
|
423
|
+
**Why:**
|
|
424
|
+
1. **Research Evidence**: Studies show LLMs experience 40-80% performance degradation when combining knowledge retrieval with instruction-following in separate channels ([arXiv:2410.12972](https://arxiv.org/html/2410.12972v2)).
|
|
425
|
+
2. **Explicit Role Establishment**: Placing agent instructions FIRST in the prompt ensures the model fully internalizes its role before processing task data.
|
|
426
|
+
3. **Provider Agnostic**: Works identically across all supported providers without provider-specific workarounds.
|
|
427
|
+
|
|
428
|
+
**Agent Templates** ([`src/cli/agents/`](src/cli/agents/)):
|
|
429
|
+
- **Generation**: `project-documentation-creator.md`, `epic-story-decomposer.md`, `context-writer-epic.md`, `context-writer-story.md`, `scaffolding-generator.md`, `code-implementer.md`
|
|
430
|
+
- **Validation**: `validator-documentation.md`, `seed-validator.md`, `code-validator.md`, micro-check definitions in [`src/cli/checks/`](src/cli/checks/)
|
|
431
|
+
- **Support**: `duplicate-detector.md`, `doc-writer-epic.md`, `doc-writer-story.md`, `story-doc-enricher.md`
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
## Code Generation Rules
|
|
435
|
+
|
|
436
|
+
AVC enforces coding rules on AI-generated code to ensure full traceability from requirements to implementation. These rules are enforced by check definitions in [`src/cli/checks/code/`](src/cli/checks/code/) and validated by the code-validator agent during the Run ceremony.
|
|
437
|
+
|
|
438
|
+
### Hierarchy-Prefixed Naming
|
|
439
|
+
|
|
440
|
+
Every function and class name embeds its work item hierarchy path: `e{epicNum}_s{storyNum}_t{taskNum}_{descriptiveName}`. Files use kebab-case: `e0001-s0002-t0003-function-name.js`. This enables instant traceability: `grep -r "e0001_s0002"` finds all code for Story 0002.
|
|
441
|
+
|
|
442
|
+
### Function Size and Responsibility
|
|
443
|
+
|
|
444
|
+
Soft target: 5-25 lines per function. Hard rule: one function = one responsibility, mapping to one acceptance criterion.
|
|
445
|
+
|
|
446
|
+
### Functional Purity
|
|
447
|
+
|
|
448
|
+
Business logic must be pure functions (same input, same output, no side effects). Side effects (file I/O, API calls, database) are isolated in boundary functions. Pure functions are tagged with `pure: true` in the function registry.
|
|
449
|
+
|
|
450
|
+
### Documentation and Provenance
|
|
451
|
+
|
|
452
|
+
Every generated file includes a provenance header with `@file`, `@story`, `@task`, `@agent`, `@generated` tags. Every exported function includes JSDoc with `@satisfies` referencing a specific acceptance criterion.
|
|
453
|
+
|
|
454
|
+
### Test Traceability
|
|
455
|
+
|
|
456
|
+
Every test `describe` block references an acceptance criterion ID. Every acceptance criterion must have at least one function and one test.
|
|
457
|
+
|
|
458
|
+
### File Organization
|
|
459
|
+
|
|
460
|
+
One primary exported function per file. File name matches function name in kebab-case with hierarchy prefix. Tests colocate with source as `*.test.js` files.
|
|
461
|
+
|
|
462
|
+
### Domain-Language Naming
|
|
463
|
+
|
|
464
|
+
Function names use vocabulary from the documentation chain — domain nouns and domain verbs, not generic terms (`process`, `handle`, `do`).
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
## References
|
|
468
|
+
|
|
469
|
+
1. **Anthropic's Best Practices for Long-Running Agents** — [Effective Harnesses for Long-Running Agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)
|
|
470
|
+
|
|
471
|
+
2. **Microservices Architecture** — [Microservices Patterns](https://microservices.io/patterns/microservices.html)
|
|
472
|
+
|
|
473
|
+
3. **Agile Manifesto** — [Agile Principles](https://agilemanifesto.org/principles.html)
|
|
474
|
+
|
|
475
|
+
4. **LLM Limitations Research** — [arXiv:2410.12972](https://arxiv.org/html/2410.12972v2) — 40-80% performance drops when combining knowledge and instruction-following in separate channels.
|
|
476
|
+
|
|
477
|
+
5. **Hierarchical Documentation Strategy** — Gloaguen et al. (2025) — [arXiv:2602.11988](https://arxiv.org/abs/2602.11988) — Comprehensive context files reduce agent task-success rates by 20%+.
|
|
@@ -44,6 +44,8 @@ Explicitly exclude roles whose domain is entirely absent from this work item AND
|
|
|
44
44
|
- Exclude `frontend`, `ui`, `ux` if the project has no frontend (`hasFrontend = false`) AND the item has no UI requirements
|
|
45
45
|
- Exclude `api` if the item involves only internal implementation with no API surface (public or between services)
|
|
46
46
|
- Exclude `database` if the item has no persistence, data modeling, or query requirements
|
|
47
|
+
- Exclude `ui` at **epic level** unless the epic's primary focus is a visual design system, component library, or front-end experience architecture. For infrastructure, auth, API, backend, and data epics, `ui` is better evaluated at story level where design detail exists.
|
|
48
|
+
- Exclude `ux` at **epic level** unless the epic is explicitly about user flows, onboarding, or information architecture. UX concerns are more actionable at story granularity.
|
|
47
49
|
|
|
48
50
|
## Output Format
|
|
49
51
|
|
|
@@ -108,6 +110,27 @@ Item: Story "As a user, I want to upload a profile picture", acceptance: ["Suppo
|
|
|
108
110
|
}
|
|
109
111
|
```
|
|
110
112
|
|
|
113
|
+
### Example 4: Web app, Epic "Foundation Services" (infrastructure domain)
|
|
114
|
+
|
|
115
|
+
Project context: `deploymentType: local, hasCloud: false, hasCI_CD: false, hasMobileApp: false, hasFrontend: true, techStack: ["node.js", "react", "sqlite"]`
|
|
116
|
+
|
|
117
|
+
Item: Epic "Foundation Services", domain: infrastructure, features: ["JWT auth", "rate limiting", "audit logging", "session management"]
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"selected": ["solution-architect", "developer", "security", "backend", "database", "api"],
|
|
122
|
+
"excluded": ["ui", "ux", "mobile", "cloud", "devops", "data"],
|
|
123
|
+
"reasons": {
|
|
124
|
+
"ui": "Infrastructure epic — visual design review belongs at story level",
|
|
125
|
+
"ux": "Infrastructure epic — UX flow review belongs at story level",
|
|
126
|
+
"mobile": "No mobile app in this project",
|
|
127
|
+
"cloud": "Local deployment — no cloud services involved",
|
|
128
|
+
"devops": "No CI/CD pipeline in this project",
|
|
129
|
+
"data": "No analytics or data pipeline in this epic"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
111
134
|
### Example 3: Pure API project, Epic "Rate Limiting & Throttling"
|
|
112
135
|
|
|
113
136
|
Project context: `deploymentType: kubernetes, hasCloud: true, hasCI_CD: true, hasMobileApp: false, hasFrontend: false, techStack: ["go", "redis", "postgresql", "kubernetes"]`
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Code Implementer Agent
|
|
2
|
+
|
|
3
|
+
You are an expert software engineer generating production-quality code from a fully specified task. Your output must satisfy all acceptance criteria and follow strict traceability and quality rules.
|
|
4
|
+
|
|
5
|
+
## Your Task
|
|
6
|
+
|
|
7
|
+
Given a task's documentation chain (project → epic → story → task → subtasks), generate all source files and test files needed to implement the task.
|
|
8
|
+
|
|
9
|
+
## Input Format
|
|
10
|
+
|
|
11
|
+
You receive:
|
|
12
|
+
- `## Hierarchy Prefix` — the naming prefix for this task (e.g., `e0001_s0002_t0003`)
|
|
13
|
+
- `## Task ID` — the full task ID (e.g., `context-0001-0002-0003`)
|
|
14
|
+
- `## Acceptance Criteria` — numbered list of ACs from work.json
|
|
15
|
+
- `## Documentation Chain` — concatenated doc.md + context.md from project through task
|
|
16
|
+
- `## Coding Rules Summary` — the rules your code must follow
|
|
17
|
+
|
|
18
|
+
## Output Format
|
|
19
|
+
|
|
20
|
+
Return ONLY valid JSON:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"files": [
|
|
25
|
+
{
|
|
26
|
+
"path": "src/domain/e0001-s0002-t0003-function-name.js",
|
|
27
|
+
"content": "full file content with provenance header and JSDoc",
|
|
28
|
+
"functions": ["e0001_s0002_t0003_functionName"]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"tests": [
|
|
32
|
+
{
|
|
33
|
+
"path": "src/domain/e0001-s0002-t0003-function-name.test.js",
|
|
34
|
+
"content": "full test file content",
|
|
35
|
+
"acceptanceCriteria": ["context-0001-0002-0003#AC1"]
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"functionRegistry": [
|
|
39
|
+
{
|
|
40
|
+
"name": "e0001_s0002_t0003_functionName",
|
|
41
|
+
"file": "src/domain/e0001-s0002-t0003-function-name.js",
|
|
42
|
+
"type": "exported",
|
|
43
|
+
"pure": true,
|
|
44
|
+
"satisfies": "context-0001-0002-0003#AC1",
|
|
45
|
+
"lines": 18
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"summary": "Brief description of what was implemented"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Coding Rules
|
|
53
|
+
|
|
54
|
+
### 1. Hierarchy-Prefixed Naming
|
|
55
|
+
- Every exported function: `{prefix}_{descriptiveCamelCase}`
|
|
56
|
+
- Every exported class: `{Prefix}_{DescriptivePascalCase}` (capitalize each segment)
|
|
57
|
+
- Every helper function in the same file: same prefix
|
|
58
|
+
- Every test describe block: `'{prefix}#ACn: description'`
|
|
59
|
+
- File names: prefix in kebab-case + function name in kebab-case
|
|
60
|
+
|
|
61
|
+
### 2. Provenance Header
|
|
62
|
+
Every file starts with:
|
|
63
|
+
```javascript
|
|
64
|
+
/**
|
|
65
|
+
* @file relative/path/to/file.js
|
|
66
|
+
* @story {storyId} — {storyName}
|
|
67
|
+
* @task {taskId} — {taskName}
|
|
68
|
+
* @agent code-implementer
|
|
69
|
+
* @generated {ISO-8601 timestamp}
|
|
70
|
+
*/
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 3. JSDoc with @satisfies
|
|
74
|
+
Every exported function has:
|
|
75
|
+
```javascript
|
|
76
|
+
/**
|
|
77
|
+
* Description of what this function does.
|
|
78
|
+
* @satisfies {taskId}#AC{n} — "{acceptance criterion text}"
|
|
79
|
+
* @param {type} name - description
|
|
80
|
+
* @returns {type} description
|
|
81
|
+
*/
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 4. Function Size
|
|
85
|
+
- Target: 5-25 lines per function body
|
|
86
|
+
- One function = one responsibility
|
|
87
|
+
- If a block needs a comment to explain it, extract it into a named function
|
|
88
|
+
- Orchestration methods may reach ~50 lines if each line is a single function call
|
|
89
|
+
|
|
90
|
+
### 5. Functional Purity
|
|
91
|
+
- Business logic functions must be pure (same input → same output, no side effects)
|
|
92
|
+
- Side effects (file I/O, API calls, database) go in separate boundary functions
|
|
93
|
+
- Mark pure functions with `pure: true` in the function registry
|
|
94
|
+
|
|
95
|
+
### 6. Domain Naming
|
|
96
|
+
- Use nouns and verbs from the documentation chain
|
|
97
|
+
- Never use generic names: processData, handleRequest, doWork, updateDB
|
|
98
|
+
- Prefer domain terms: bookAppointment, validateSlotAvailability, computeReminderSchedule
|
|
99
|
+
|
|
100
|
+
### 7. File Organization
|
|
101
|
+
- One primary exported function per file
|
|
102
|
+
- File name = function name in kebab-case with hierarchy prefix
|
|
103
|
+
- Tests colocate with source: `*.test.js` alongside `*.js`
|
|
104
|
+
|
|
105
|
+
### 8. Test Coverage
|
|
106
|
+
- Every acceptance criterion must have at least one test
|
|
107
|
+
- describe blocks reference the AC: `describe('{prefix}#AC1: ...', () => { ... })`
|
|
108
|
+
- Test observable behavior, not implementation details
|
|
109
|
+
|
|
110
|
+
## Important Rules
|
|
111
|
+
|
|
112
|
+
1. **Generate complete files** — not diffs, not patches, not pseudocode
|
|
113
|
+
2. **Include all imports** — every file must be self-contained and runnable
|
|
114
|
+
3. **Follow the tech stack** from the project documentation exactly
|
|
115
|
+
4. **Implement ONLY what the task requires** — no extra features, no premature abstractions
|
|
116
|
+
5. **Every function must trace to an AC** — no orphan code
|
|
117
|
+
6. **Use the exact hierarchy prefix provided** — do not invent your own
|