@agile-vibe-coding/avc 0.3.1 → 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.
Files changed (2) hide show
  1. package/README.md +475 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,477 @@
1
- # ⚠️ UNDER DEVELOPMENT - DO NOT USE ⚠️
1
+ # Agile Vibe Coding (AVC)
2
2
 
3
- This package is currently under active development and is not ready for production use.
3
+ **A CLI and web UI toolkit for structured AI-assisted software development**
4
4
 
5
- **[CLI Commands Reference ](../COMMANDS.md)**
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%+.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agile-vibe-coding/avc",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Agile Vibe Coding (AVC) - Framework for managing AI agent-based software development projects",
5
5
  "type": "module",
6
6
  "main": "cli/index.js",