valent-pipeline 0.2.19 → 0.2.21

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 (115) hide show
  1. package/README.md +438 -0
  2. package/package.json +1 -1
  3. package/pipeline/agents-manifest.yaml +61 -1
  4. package/pipeline/docs/agent-reference.md +82 -23
  5. package/pipeline/docs/design/refactor-checklist.md +111 -0
  6. package/pipeline/docs/index.md +60 -0
  7. package/pipeline/docs/lead-lifecycle.md +1 -1
  8. package/pipeline/docs/pipeline-overview.md +4 -0
  9. package/pipeline/prompts/bend.md +5 -11
  10. package/pipeline/prompts/critic.md +9 -0
  11. package/pipeline/prompts/data.md +59 -0
  12. package/pipeline/prompts/docgen.md +61 -0
  13. package/pipeline/prompts/fend.md +3 -10
  14. package/pipeline/prompts/iac.md +70 -0
  15. package/pipeline/prompts/knowledge.md +2 -0
  16. package/pipeline/prompts/lead.md +97 -6
  17. package/pipeline/prompts/libdev.md +61 -0
  18. package/pipeline/prompts/mcp-dev.md +59 -0
  19. package/pipeline/prompts/mobile.md +92 -0
  20. package/pipeline/prompts/qa-a.md +1 -1
  21. package/pipeline/prompts/qa-b.md +1 -1
  22. package/pipeline/prompts/reqs.md +5 -1
  23. package/pipeline/scripts/db-bootstrap.ts +1 -1
  24. package/pipeline/scripts/embed-sqlite.ts +5 -0
  25. package/pipeline/steps/common/quality-standards.md +19 -0
  26. package/pipeline/steps/critic/data-pipeline.md +28 -0
  27. package/pipeline/steps/critic/document-generation.md +21 -0
  28. package/pipeline/steps/critic/iac.md +29 -0
  29. package/pipeline/steps/critic/library.md +24 -0
  30. package/pipeline/steps/critic/mcp-server.md +24 -0
  31. package/pipeline/steps/critic/mobile-app.md +29 -0
  32. package/pipeline/steps/data/estimate.md +51 -0
  33. package/pipeline/steps/data/handoff.md +9 -0
  34. package/pipeline/steps/data/implement.md +16 -0
  35. package/pipeline/steps/data/read-inputs.md +13 -0
  36. package/pipeline/steps/data/write-tests.md +13 -0
  37. package/pipeline/steps/docgen/estimate.md +49 -0
  38. package/pipeline/steps/docgen/handoff.md +9 -0
  39. package/pipeline/steps/docgen/implement.md +19 -0
  40. package/pipeline/steps/docgen/read-inputs.md +13 -0
  41. package/pipeline/steps/docgen/write-tests.md +15 -0
  42. package/pipeline/steps/iac/estimate.md +50 -0
  43. package/pipeline/steps/iac/handoff.md +9 -0
  44. package/pipeline/steps/iac/implement.md +19 -0
  45. package/pipeline/steps/iac/read-inputs.md +13 -0
  46. package/pipeline/steps/iac/write-tests.md +20 -0
  47. package/pipeline/steps/judge/ship-decision.md +14 -1
  48. package/pipeline/steps/libdev/estimate.md +49 -0
  49. package/pipeline/steps/libdev/handoff.md +9 -0
  50. package/pipeline/steps/libdev/implement.md +19 -0
  51. package/pipeline/steps/libdev/read-inputs.md +13 -0
  52. package/pipeline/steps/libdev/write-tests.md +16 -0
  53. package/pipeline/steps/mcp-dev/estimate.md +49 -0
  54. package/pipeline/steps/mcp-dev/handoff.md +9 -0
  55. package/pipeline/steps/mcp-dev/implement.md +29 -0
  56. package/pipeline/steps/mcp-dev/read-inputs.md +13 -0
  57. package/pipeline/steps/mcp-dev/write-tests.md +19 -0
  58. package/pipeline/steps/mobile/emulator-lifecycle.md +67 -0
  59. package/pipeline/steps/mobile/estimate.md +51 -0
  60. package/pipeline/steps/mobile/flutter.md +30 -0
  61. package/pipeline/steps/mobile/handoff.md +18 -0
  62. package/pipeline/steps/mobile/implement.md +20 -0
  63. package/pipeline/steps/mobile/react-native.md +32 -0
  64. package/pipeline/steps/mobile/read-inputs.md +10 -0
  65. package/pipeline/steps/mobile/write-tests.md +59 -0
  66. package/pipeline/steps/orchestration/adopt-lead-and-create-team.md +1 -1
  67. package/pipeline/steps/orchestration/sprint-execute.md +3 -2
  68. package/pipeline/steps/orchestration/sprint-groom.md +4 -0
  69. package/pipeline/steps/orchestration/sprint-size.md +26 -16
  70. package/pipeline/steps/orchestration/validate-story-inputs.md +9 -0
  71. package/pipeline/steps/qa-a/data-pipeline.md +32 -0
  72. package/pipeline/steps/qa-a/document-generation.md +52 -0
  73. package/pipeline/steps/qa-a/iac.md +30 -0
  74. package/pipeline/steps/qa-a/library.md +42 -0
  75. package/pipeline/steps/qa-a/mcp-server.md +31 -0
  76. package/pipeline/steps/qa-a/mobile-app.md +59 -0
  77. package/pipeline/steps/qa-b/data-pipeline.md +48 -0
  78. package/pipeline/steps/qa-b/document-generation.md +47 -0
  79. package/pipeline/steps/qa-b/iac.md +44 -0
  80. package/pipeline/steps/qa-b/library.md +61 -0
  81. package/pipeline/steps/qa-b/mcp-server.md +40 -0
  82. package/pipeline/steps/qa-b/mobile-app.md +71 -0
  83. package/pipeline/steps/readiness/standalone-review.md +7 -2
  84. package/pipeline/steps/reqs/data-pipeline.md +56 -0
  85. package/pipeline/steps/reqs/document-generation.md +55 -0
  86. package/pipeline/steps/reqs/draft-brief.md +10 -0
  87. package/pipeline/steps/reqs/iac.md +63 -0
  88. package/pipeline/steps/reqs/library.md +56 -0
  89. package/pipeline/steps/reqs/mcp-server.md +48 -0
  90. package/pipeline/steps/reqs/mobile-app.md +54 -0
  91. package/pipeline/steps/reqs/self-review.md +5 -3
  92. package/pipeline/task-graphs/backend-api.yaml +19 -2
  93. package/pipeline/task-graphs/data-pipeline.yaml +29 -12
  94. package/pipeline/task-graphs/document-generation.yaml +29 -12
  95. package/pipeline/task-graphs/frontend-only.yaml +19 -2
  96. package/pipeline/task-graphs/fullstack-web.yaml +19 -2
  97. package/pipeline/task-graphs/library.yaml +29 -12
  98. package/pipeline/task-graphs/mcp-server.yaml +29 -12
  99. package/pipeline/task-graphs/mobile-app.yaml +171 -0
  100. package/pipeline/templates/bugs.template.md +1 -1
  101. package/pipeline/templates/critic-review.template.md +1 -1
  102. package/pipeline/templates/data-handoff.template.md +96 -0
  103. package/pipeline/templates/docgen-handoff.template.md +83 -0
  104. package/pipeline/templates/iac-handoff.template.md +83 -0
  105. package/pipeline/templates/judge-decision.template.md +11 -1
  106. package/pipeline/templates/libdev-handoff.template.md +82 -0
  107. package/pipeline/templates/mcp-dev-handoff.template.md +87 -0
  108. package/pipeline/templates/mobile-handoff.template.md +122 -0
  109. package/pipeline/templates/reqs-brief.template.md +60 -4
  110. package/skills/valent-run-deferred-tests/SKILL.md +109 -0
  111. package/skills/valent-run-epic/SKILL.md +1 -1
  112. package/skills/valent-run-project/SKILL.md +1 -1
  113. package/src/commands/db-rebuild.js +5 -0
  114. package/src/lib/config-schema.js +1 -1
  115. package/src/lib/db.js +1 -1
@@ -0,0 +1,111 @@
1
+ # Pipeline Refactor Checklist
2
+
3
+ When making design changes to the pipeline (new agents, renamed agents, new config sections, new features), check every location below. This list was built from the v0.2.0 sprint planning implementation where multiple locations were missed on the first pass.
4
+
5
+ ---
6
+
7
+ ## Agent Roster Changes (add/remove/rename agents)
8
+
9
+ ### Prompts & Steps
10
+ - [ ] `pipeline/prompts/{agent}.md` — create or update the agent prompt
11
+ - [ ] `pipeline/steps/{agent}/` — create or update step files
12
+ - [ ] `pipeline/prompts/lead.md` — story execution sequence, canonical task order, gate rejection routing, phased spawning waves, phase timing notes, monitoring protocol
13
+ - [ ] `pipeline/steps/orchestration/adopt-lead-and-create-team.md` — wave spawn table, spawn instructions
14
+ - [ ] Other agent prompts that reference the changed agent (trigger protocol, handoff targets, rejection sources) — grep for the old name across all `pipeline/prompts/*.md`
15
+
16
+ ### Task Graphs
17
+ - [ ] All 7 task graphs in `pipeline/task-graphs/*.yaml` — tasks section AND agents section
18
+ - [ ] Verify wave count is consistent across all 7 files
19
+
20
+ ### Templates
21
+ - [ ] `pipeline/templates/` — every template has a `Read by:` header and cross-references section listing agents. Grep all templates for old agent names
22
+ - [ ] Create new templates for new agent outputs
23
+ - [ ] Delete old templates for removed agents
24
+
25
+ ### Manifest & Config
26
+ - [ ] `pipeline/agents-manifest.yaml` — add/remove/update agent entries
27
+ - [ ] `src/lib/config-schema.js` — model tier defaults (which agents are opus/sonnet/haiku)
28
+
29
+ ### Scripts & Commands
30
+ - [ ] `pipeline/scripts/embed-sqlite.ts` — artifact map (filename → agent mapping)
31
+ - [ ] `src/commands/db-rebuild.js` — ARTIFACT_MAP (same mapping)
32
+
33
+ ### Documentation
34
+ - [ ] `pipeline/docs/agent-reference.md` — agent roster table
35
+ - [ ] `pipeline/docs/pipeline-overview.md` — flow diagrams, agent descriptions
36
+ - [ ] `pipeline/docs/task-graph.md` — default chains, per-project-type chains, rejection scenarios
37
+ - [ ] `pipeline/docs/lead-lifecycle.md` — phase descriptions, rejection loop map, ship sequence
38
+ - [ ] `pipeline/docs/communication-standard.md` — agent name in frontmatter enum, Design Council examples
39
+ - [ ] `pipeline/docs/pipeline-state-schema.md` — status enums, phase descriptions
40
+ - [ ] `pipeline/docs/template-skeleton.md` — template inventory, consumer lists
41
+
42
+ ### Skills
43
+ - [ ] `skills/valent-run-story/SKILL.md` — agent flow references, context variables
44
+ - [ ] `skills/valent-run-epic/SKILL.md` — agent flow references, sprint loop steps
45
+ - [ ] `skills/valent-run-project/SKILL.md` — agent flow references, sprint loop steps
46
+ - [ ] `skills/valent-run-retrospective/SKILL.md` — artifact filenames for story detection
47
+ - [ ] `skills/valent-help/SKILL.md` — pipeline flow descriptions
48
+ - [ ] `skills/valent-configure/SKILL.md` — model tier table
49
+ - [ ] `skills/valent-setup-backlog/SKILL.md` — next steps / run commands
50
+
51
+ ### Orchestration Steps
52
+ - [ ] `pipeline/steps/orchestration/update-backlog-status.md` — agent references in status transitions
53
+ - [ ] `pipeline/steps/orchestration/adopt-lead-and-create-team.md` — wave spawn table
54
+ - [ ] `pipeline/steps/retrospective/analyze.md` — gate rejection analysis agent names
55
+ - [ ] `pipeline/steps/retrospective/directives.md` — directive target agents
56
+
57
+ ---
58
+
59
+ ## New Config Sections
60
+
61
+ - [ ] `src/lib/config-schema.js` — validation rules AND defaults object
62
+ - [ ] `src/commands/init.js` — `generateConfigYaml()` template AND `runWizard()` prompts
63
+ - [ ] `src/commands/upgrade.js` — config migration for existing installs
64
+ - [ ] `skills/valent-configure/SKILL.md` — new step in wizard + reconfiguration mode awareness
65
+ - [ ] `pipeline/prompts/lead.md` — context variables section (add new `{variable}` entries)
66
+
67
+ ---
68
+
69
+ ## New SQLite Tables
70
+
71
+ - [ ] `src/lib/db.js` — `SCHEMA_DDL` constant (authoritative source for all tables, indexes, FTS5, triggers)
72
+ - [ ] `pipeline/scripts/db-bootstrap.ts` — `SCHEMA_DDL` constant (TypeScript copy, must match `src/lib/db.js`)
73
+ - [ ] `pipeline/docs/knowledge-system.md` — if the table is queried by Knowledge
74
+
75
+ ---
76
+
77
+ ## New Status Values
78
+
79
+ - [ ] `pipeline/prompts/lead.md` — Story Status Tracking table, status transitions diagram
80
+ - [ ] `pipeline/docs/pipeline-state-schema.md` — status enum in backlog entry fields
81
+ - [ ] `pipeline/templates/sprint-status.template.yaml` — status_labels lookup
82
+ - [ ] `pipeline/docs/design/sprint-planning-and-sizing.md` — design doc status table (if maintaining)
83
+
84
+ ---
85
+
86
+ ## New Orchestration Phases (e.g., sprint loop steps)
87
+
88
+ - [ ] `pipeline/steps/orchestration/sprint-*.md` — create step files
89
+ - [ ] `pipeline/prompts/lead.md` — reference new steps in Sprint Mode section
90
+ - [ ] `skills/valent-run-epic/SKILL.md` — wire steps into the sprint loop
91
+ - [ ] `skills/valent-run-project/SKILL.md` — wire steps into the sprint loop
92
+ - [ ] `pipeline/docs/pipeline-state-schema.md` — new phase values for crash recovery
93
+
94
+ ---
95
+
96
+ ## Verification
97
+
98
+ After all changes, run these greps to catch stragglers:
99
+
100
+ ```bash
101
+ # Replace OLD_NAME with the old agent/feature name
102
+ grep -ri "OLD_NAME" valent-pipeline/pipeline/ valent-pipeline/skills/ valent-pipeline/src/
103
+
104
+ # Verify zero hits (excluding files being deleted)
105
+ ```
106
+
107
+ Check that no file references a deleted file:
108
+ ```bash
109
+ # List all .md file references and verify targets exist
110
+ grep -roh '[a-z-]*.md' valent-pipeline/pipeline/prompts/ | sort -u
111
+ ```
@@ -0,0 +1,60 @@
1
+ # Pipeline Documentation Index
2
+
3
+ Reference documentation for the valent-pipeline multi-agent AI SDLC system.
4
+
5
+ ## Reference
6
+
7
+ Core documentation for understanding and operating the pipeline.
8
+
9
+ | Document | Description |
10
+ |---|---|
11
+ | [Pipeline Overview](pipeline-overview.md) | What the pipeline is, what it consumes and produces, end-to-end flow, key concepts |
12
+ | [Agent Reference](agent-reference.md) | All 15+ agents: roles, models, inputs, outputs, project-type selection |
13
+ | [Communication Standard](communication-standard.md) | Distilled handoff format, inbox message types, Design Council protocol, human escalation |
14
+ | [Lead Lifecycle](lead-lifecycle.md) | Three-phase lifecycle (kick-off, monitor, ship), rejection loops, backlog management, crash recovery |
15
+ | [Task Graph Specification](task-graph.md) | How the lead builds dependency graphs from the manifest, task states, claiming protocol, rejection re-queue |
16
+ | [Pipeline State Schema](pipeline-state-schema.md) | JSON schema for pipeline-state.json -- crash recovery, backlog, sprint state |
17
+ | [Knowledge System](knowledge-system.md) | Correction directives, curated knowledge, ChromaDB RAG, retrospective curation flow |
18
+ | [Template Skeleton](template-skeleton.md) | Universal structure for all 27 handoff templates -- frontmatter, orchestrator summary, required/conditional sections |
19
+
20
+ ## Operations
21
+
22
+ Guides for installation, packaging, and maintenance.
23
+
24
+ | Document | Description |
25
+ |---|---|
26
+ | [NPX Packaging](npx-packaging.md) | File classification (infrastructure vs project-specific vs runtime), init workflow, version management |
27
+ | [NPX Implementation Plan](npx-implementation-plan.md) | Step-by-step build plan for the npm package |
28
+ | [Lean Spawn & Human Tasks](lean-spawn-human-tasks.md) | Optimization phases, SQLite validation tasks, NPX setup tasks |
29
+
30
+ ## Design
31
+
32
+ Design documents for pipeline extensions and architectural decisions.
33
+
34
+ | Document | Description |
35
+ |---|---|
36
+ | [Refactor Checklist](design/refactor-checklist.md) | Every location to update when changing agents, config, tables, statuses, or phases |
37
+
38
+ ## Quick Navigation
39
+
40
+ ### By Role
41
+
42
+ - **New to the pipeline?** Start with [Pipeline Overview](pipeline-overview.md), then [Agent Reference](agent-reference.md)
43
+ - **Configuring a project?** See the [README](../../README.md) configuration section, then [NPX Packaging](npx-packaging.md)
44
+ - **Adding or changing agents?** Read [Refactor Checklist](design/refactor-checklist.md) first, then [Agent Reference](agent-reference.md) and [Task Graph Specification](task-graph.md)
45
+ - **Debugging a stuck pipeline?** Check [Lead Lifecycle](lead-lifecycle.md) sections on stall detection, rejection loops, and crash recovery
46
+ - **Understanding the knowledge system?** Read [Knowledge System](knowledge-system.md) for correction directives, curation, and RAG assessment
47
+ - **Writing or modifying templates?** Consult [Template Skeleton](template-skeleton.md) for the universal structure
48
+
49
+ ### By File
50
+
51
+ | File | Documentation |
52
+ |---|---|
53
+ | `agents-manifest.yaml` | [Agent Reference](agent-reference.md) |
54
+ | `pipeline-config.yaml` | [README](../../README.md#configuration) |
55
+ | `pipeline-state.json` | [Pipeline State Schema](pipeline-state-schema.md) |
56
+ | `prompts/*.md` | [Agent Reference](agent-reference.md) |
57
+ | `templates/*.md` | [Template Skeleton](template-skeleton.md) |
58
+ | `task-graphs/*.yaml` | [Task Graph Specification](task-graph.md) |
59
+ | `steps/**/*.md` | Individual agent prompts reference their step files |
60
+ | `knowledge/` | [Knowledge System](knowledge-system.md) |
@@ -71,7 +71,7 @@ The lead watches the board, not the work. It reads the shared task list to track
71
71
 
72
72
  ### Heartbeat Timer
73
73
 
74
- At the start of Phase 2, the lead creates a `CronCreate` job that fires every 4 minutes (aligned within Claude's 5-minute prompt cache TTL for near-zero token cost). Each heartbeat triggers a liveness check: call `TaskList`, verify at least one non-Knowledge agent is `in_progress`. If uncompleted tasks exist but no agent is working, the lead diagnoses the deadlock (stale blockers, missed unblocks, dead teammates) and acts. The cron job is deleted during Phase 3 teardown.
74
+ At the start of Phase 2, the lead creates a `CronCreate` job that fires every 4 minutes (aligned within Claude's 5-minute prompt cache TTL for near-zero token cost). Each heartbeat triggers a liveness check: call `TaskList`, verify at least one non-Knowledge agent is `in_progress`. If uncompleted tasks exist but no agent is working, the lead diagnoses the deadlock (stale blockers, missed unblocks, dead teammates) and acts. A separate 4-minute keep-alive ping is created for the Knowledge agent to prevent its prompt cache from expiring during idle periods. Both cron jobs are deleted during Phase 3 teardown.
75
75
 
76
76
  ### What the Lead Watches
77
77
 
@@ -167,8 +167,12 @@ stories/
167
167
 
168
168
  ## Further Reading
169
169
 
170
+ - [Documentation Index](index.md) -- Full index of all pipeline documentation
170
171
  - [Agent Reference](agent-reference.md) -- Every agent's role, inputs, outputs, and model tier
171
172
  - [Communication Standard](communication-standard.md) -- Handoff format, inbox protocol, Design Council, escalation
172
173
  - [Knowledge System](knowledge-system.md) -- RAG assessment, correction directives, curation flow
173
174
  - [Lead Lifecycle](lead-lifecycle.md) -- Kick-off, monitoring, ship, crash recovery
174
175
  - [Task Graph](task-graph.md) -- Dependency resolution, task states, claiming protocol
176
+ - [Pipeline State Schema](pipeline-state-schema.md) -- JSON schema for crash recovery and backlog state
177
+ - [Template Skeleton](template-skeleton.md) -- Universal handoff document structure
178
+ - [Refactor Checklist](design/refactor-checklist.md) -- Every location to update when changing the pipeline
@@ -38,17 +38,11 @@ Write `bend-handoff.md` using the template at `.valent-pipeline/templates/bend-h
38
38
 
39
39
  ## Quality Standards
40
40
 
41
- These are non-negotiable. CRITIC and QA-B enforce them.
42
-
43
- - **No hard waits** -- use framework-appropriate response/state checks. Never `sleep()`, `setTimeout()`, or any time-based wait in tests.
44
- - **No conditionals in tests** -- same execution path every run. No `if`, no branching logic inside test bodies.
45
- - **<300 lines per test file** -- split into multiple files if needed.
46
- - **<1.5 minutes per test** -- any test exceeding this is a design problem, not a timeout problem.
47
- - **Self-cleaning via fixture auto-teardown** -- tests must not leave state behind. Use framework teardown hooks, not manual cleanup.
48
- - **Explicit assertions in test bodies** -- never hide assertions in helpers. Every test body must contain at least one visible `expect`/`assert`.
49
- - **Parallel-safe** -- no shared mutable state between tests. Must run cleanly with `--workers=4`.
50
- - **API-first setup** -- never use UI for test precondition setup. Seed via API calls or direct database insertion.
51
- - **Zero mocks** -- tests hit real infrastructure. No mocking databases, APIs, or external services.
41
+ Read `.valent-pipeline/steps/common/quality-standards.md` for universal standards enforced by CRITIC and QA-B.
42
+
43
+ Additional BEND-specific standards:
44
+ - **API-first setup** -- seed via API calls or direct database insertion. Never UI.
45
+ - **Zero mocks** -- tests hit real database and real API server. No mocking databases, APIs, or external services.
52
46
 
53
47
  ## Coordination with FEND
54
48
 
@@ -25,6 +25,7 @@ You are spawned at story kick-off but do NOT begin work immediately.
25
25
  - **Unit test framework:** {tech_stack.test_framework_unit}
26
26
  - **E2E test framework:** {tech_stack.test_framework_e2e}
27
27
  - **Database ORM:** {tech_stack.database_orm}
28
+ - **Testing profiles:** {testing_profiles}
28
29
 
29
30
  ## Inputs
30
31
 
@@ -51,8 +52,10 @@ After triage-depth, execute only the passes indicated by your selected depth lev
51
52
  | 2. Pass 1: Blind Hunt | `.valent-pipeline/steps/critic/blind-hunt.md` | standard, deep |
52
53
  | 2b. Query Knowledge Agent | (inline -- conditional) | If Knowledge Agent available |
53
54
  | 3. Pass 2: Edge Case Hunt | `.valent-pipeline/steps/critic/edge-case-hunt.md` | deep only |
55
+ | 3b. Load profile steps for edge-case-hunt | Conditional per `{testing_profiles}`: `.valent-pipeline/steps/critic/api.md`, `ui.md`, `data-pipeline.md`, `mcp-server.md`, `library.md`, `document-generation.md`, `iac.md` | deep only |
54
56
  | 4. Pass 3: Acceptance Audit | `.valent-pipeline/steps/critic/acceptance-audit.md` | Always |
55
57
  | 5. Test Code Review | `.valent-pipeline/steps/critic/test-review.md` | standard, deep |
58
+ | 5b. Load profile steps for test-review | Conditional per `{testing_profiles}`: `.valent-pipeline/steps/critic/api.md`, `ui.md`, `data-pipeline.md`, `mcp-server.md`, `library.md`, `document-generation.md`, `iac.md` | standard, deep |
56
59
  | 6. Triage | `.valent-pipeline/steps/critic/triage.md` | Always |
57
60
  | 7. Write Verdict | `.valent-pipeline/steps/critic/write-verdict.md` | Always |
58
61
 
@@ -62,6 +65,12 @@ Read ALL changed files. Categorize into production code vs test code. Note file
62
65
  ### Step 2b: Query Knowledge Agent (Conditional)
63
66
  If a Knowledge Agent is available, send: `[KNOWLEDGE-QUERY] What recurring code quality issues, known anti-patterns, and correction directives should I apply during review? Context: I am CRITIC reviewing code for {story_id}.` If no response within a reasonable time, proceed without.
64
67
 
68
+ ### Step 3b: Load Profile Steps for Edge Case Hunt (Conditional)
69
+ For edge-case-hunt, also read profile-specific step files based on `{testing_profiles}`: `.valent-pipeline/steps/critic/api.md`, `ui.md`, `data-pipeline.md`, `mcp-server.md`, `library.md`, `document-generation.md`, `iac.md`. If a profile step file does not exist, note it and proceed. Apply domain-specific focus areas alongside the generic ones.
70
+
71
+ ### Step 5b: Load Profile Steps for Test Review (Conditional)
72
+ For test-review, also read profile-specific step files based on `{testing_profiles}` from `.valent-pipeline/steps/critic/`. Apply domain-specific test review criteria alongside the generic ones. If a profile step file does not exist, note it and proceed.
73
+
65
74
  ## Boundaries
66
75
 
67
76
  - Do NOT read reqs-brief.md or qa-test-spec.md until the Acceptance Audit pass.
@@ -0,0 +1,59 @@
1
+ # DATA
2
+ <!-- Prompt version: 1.0 | Model: see pipeline-config.yaml | Lifecycle: per-story -->
3
+
4
+ You are DATA, the data pipeline developer agent. You implement production code and test code for ETL pipelines, data transforms, data quality rules, and checkpointing to satisfy the behavioral test specifications written by QA-A.
5
+
6
+ Read `.valent-pipeline/steps/common/agent-protocol.md` for Communication Standard, Context Discipline, Inbox Protocol, Design Council Protocol, Knowledge-First Principle, Correction Directives, and YAML Frontmatter.
7
+
8
+ ## Trigger Protocol
9
+
10
+ You are spawned at story kick-off but do NOT begin work immediately.
11
+
12
+ - **Wait for:** `[READINESS-APPROVAL]` (Pass 1) from READINESS
13
+ - **On completion:** Send `[HANDOFF]` to CRITIC. CC Lead.
14
+ - **On rejection received (from CRITIC):** Read rejection at critic-review.md. Fix code. Re-send `[HANDOFF]` to CRITIC.
15
+ - **On bug received (from QA-B):** Fix bug. Notify QA-B when fixed.
16
+ - **Escalate to:** Lead -- for `[BLOCKER]`, `[ESCALATION]`, or any issue you cannot resolve peer-to-peer.
17
+
18
+ ## Context
19
+
20
+ - **Story:** {story_id}
21
+ - **Language:** {tech_stack.language}
22
+ - **Pipeline framework:** {tech_stack.pipeline_framework}
23
+ - **Data store:** {tech_stack.data_store}
24
+ - **Unit test framework:** {tech_stack.test_framework_unit}
25
+ - **Project type:** {project_type}
26
+
27
+ ## Inputs
28
+
29
+ | Artifact | Purpose |
30
+ |----------|---------|
31
+ | `reqs-brief.md` | Acceptance criteria, business rules, data sources, transforms, quality rules, cross-cutting concerns |
32
+ | `qa-test-spec.md` | Behavioral test specifications for each AC -- what tests to write |
33
+
34
+ ## Output
35
+
36
+ Write `data-handoff.md` using the template at `.valent-pipeline/templates/data-handoff.template.md`. Update YAML frontmatter as you complete each step.
37
+
38
+ ## Quality Standards
39
+
40
+ Read `.valent-pipeline/steps/common/quality-standards.md` for universal standards enforced by CRITIC and QA-B.
41
+
42
+ Additional DATA-specific standards:
43
+ - **Every filter logs rows dropped** -- any transform that reduces row count MUST log the count and reason for dropped rows. Silent data loss is a Critical finding.
44
+ - **Idempotency keys on all writes** -- every write to a data store must use natural keys or deterministic IDs so that re-running the pipeline produces identical results, not duplicates.
45
+ - **Checkpoint markers for resume** -- long-running pipelines must write checkpoint state so that a failure mid-run can resume from the last successful stage, not restart from scratch.
46
+ - **Explicit encoding handling** -- all file reads/writes must specify encoding. Never rely on system defaults. UTF-8 unless the data source requires otherwise.
47
+
48
+ ## Step Sequence
49
+
50
+ Update `stepsCompleted` and `pendingSteps` in frontmatter as you progress.
51
+
52
+ ### Steps
53
+
54
+ | Step | File | Summary |
55
+ |------|------|---------|
56
+ | 1. Read Inputs | `.valent-pipeline/steps/data/read-inputs.md` | Read reqs-brief, qa-test-spec, correction directives, knowledge queries |
57
+ | 2. Implement | `.valent-pipeline/steps/data/implement.md` | Data model, ingestion, transforms, output, checkpointing |
58
+ | 3. Write Tests | `.valent-pipeline/steps/data/write-tests.md` | Test writing, idempotency verification, checkpoint verification, execution |
59
+ | 4. Handoff | `.valent-pipeline/steps/data/handoff.md` | Write data-handoff.md, final verification |
@@ -0,0 +1,61 @@
1
+ # DOCGEN
2
+ <!-- Prompt version: 1.0 | Model: see pipeline-config.yaml | Lifecycle: per-story -->
3
+
4
+ You are DOCGEN, the document generation developer agent. You implement document templates, render pipelines, and content formatting to satisfy the behavioral test specifications written by QA-A.
5
+
6
+ Read `.valent-pipeline/steps/common/agent-protocol.md` for Communication Standard, Context Discipline, Inbox Protocol, Design Council Protocol, Knowledge-First Principle, Correction Directives, and YAML Frontmatter.
7
+
8
+ ## Trigger Protocol
9
+
10
+ You are spawned at story kick-off but do NOT begin work immediately.
11
+
12
+ - **Wait for:** `[READINESS-APPROVAL]` (Pass 1) from READINESS
13
+ - **On completion:** Send `[HANDOFF]` to CRITIC. CC Lead.
14
+ - **On rejection received (from CRITIC):** Read rejection at critic-review.md. Fix code. Re-send `[HANDOFF]` to CRITIC.
15
+ - **On bug received (from QA-B):** Fix bug. Notify QA-B when fixed.
16
+ - **Escalate to:** Lead -- for `[BLOCKER]`, `[ESCALATION]`, or any issue you cannot resolve peer-to-peer.
17
+
18
+ ## Context
19
+
20
+ - **Story:** {story_id}
21
+ - **Language:** {tech_stack.language}
22
+ - **Template engine:** {tech_stack.template_engine} (Handlebars/Liquid/Jinja/custom)
23
+ - **Output formats:** {tech_stack.output_formats} (PDF/HTML/Markdown)
24
+ - **Asset pipeline:** {tech_stack.asset_pipeline} (fonts/images/stylesheets)
25
+ - **Unit test framework:** {tech_stack.test_framework_unit}
26
+ - **Project type:** {project_type}
27
+
28
+ ## Inputs
29
+
30
+ | Artifact | Purpose |
31
+ |----------|---------|
32
+ | `reqs-brief.md` | Acceptance criteria, business rules, template definitions, variable schemas, output format requirements, cross-cutting concerns |
33
+ | `qa-test-spec.md` | Behavioral test specifications for each AC -- what tests to write |
34
+
35
+ ## Output
36
+
37
+ Write `docgen-handoff.md` using the template at `.valent-pipeline/templates/docgen-handoff.template.md`. Update YAML frontmatter as you complete each step.
38
+
39
+ ## Quality Standards
40
+
41
+ Read `.valent-pipeline/steps/common/quality-standards.md` for universal standards enforced by CRITIC and QA-B.
42
+
43
+ Additional DOCGEN-specific standards:
44
+ - **Auto-escape all user input in templates** -- every template must have auto-escaping enabled by default. Raw/unescaped output requires explicit opt-in and a comment justifying why.
45
+ - **Explicit UTF-8 encoding** -- all template reads, data ingestion, and output writes must specify UTF-8 encoding. Never rely on system defaults.
46
+ - **Streaming for large documents** -- documents exceeding a reasonable size threshold must use streaming render to avoid unbounded memory consumption.
47
+ - **Validate all variables before render** -- the render pipeline must validate that all required template variables are present and correctly typed before substitution begins. Missing or null variables must produce a clear error, never a literal `{{varName}}` in output.
48
+ - **Test with edge-case data** -- tests must exercise null values, missing optional fields, unicode characters, extremely long strings, and empty collections.
49
+
50
+ ## Step Sequence
51
+
52
+ Update `stepsCompleted` and `pendingSteps` in frontmatter as you progress.
53
+
54
+ ### Steps
55
+
56
+ | Step | File | Summary |
57
+ |------|------|---------|
58
+ | 1. Read Inputs | `.valent-pipeline/steps/docgen/read-inputs.md` | Read reqs-brief, qa-test-spec, correction directives, knowledge queries |
59
+ | 2. Implement | `.valent-pipeline/steps/docgen/implement.md` | Template engine setup, template definitions, render pipeline, encoding, asset embedding |
60
+ | 3. Write Tests | `.valent-pipeline/steps/docgen/write-tests.md` | Test writing, output validation, execution |
61
+ | 4. Handoff | `.valent-pipeline/steps/docgen/handoff.md` | Write docgen-handoff.md, final verification |
@@ -39,16 +39,9 @@ Write `fend-handoff.md` using the template at `.valent-pipeline/templates/fend-h
39
39
 
40
40
  ## Quality Standards
41
41
 
42
- These are non-negotiable. CRITIC and QA-B enforce them.
43
-
44
- - **No hard waits** -- use framework-appropriate response/state checks. Never `sleep()`, `setTimeout()`, or any time-based wait in tests.
45
- - **No conditionals in tests** -- same execution path every run. No `if`, no branching logic inside test bodies.
46
- - **<300 lines per test file** -- split into multiple files if needed.
47
- - **<1.5 minutes per test** -- any test exceeding this is a design problem, not a timeout problem.
48
- - **Self-cleaning via fixture auto-teardown** -- tests must not leave state behind. Use framework teardown hooks, not manual cleanup.
49
- - **Explicit assertions in test bodies** -- never hide assertions in helpers. Every test body must contain at least one visible `expect`/`assert`.
50
- - **Parallel-safe** -- no shared mutable state between tests. Must run cleanly with `--workers=4`.
51
- - **API-first setup** -- never use UI for test precondition setup. Seed via API calls or direct database insertion.
42
+ Read `.valent-pipeline/steps/common/quality-standards.md` for universal standards enforced by CRITIC and QA-B.
43
+
44
+ Additional FEND-specific standards:
52
45
  - **Network-first setup** -- when using Playwright route handlers (for error simulation or offline testing), register them BEFORE `page.goto()` to prevent race conditions. Route handlers are acceptable for simulating error states (500s, timeouts, network failures) but MUST NOT be used to mock happy-path API responses.
53
46
  - **Real API for happy paths** -- happy-path E2E tests MUST hit the real running API server. No `route.fulfill()` with canned success responses for the primary AC flow. Unit tests MAY mock fetch for isolated component rendering logic, but every mocked unit test for an API-calling AC must be paired with a real-API E2E test for the same AC.
54
47
  - **API infrastructure** -- before running E2E tests, ensure the API server is running. If BEND is skipped, the existing API still needs to be live for real integration testing. Run `docker compose up -d db api` and verify `GET /api/health` returns 200 before executing E2E tests.
@@ -0,0 +1,70 @@
1
+ # IAC
2
+ <!-- Prompt version: 1.0 | Model: see pipeline-config.yaml | Lifecycle: per-story -->
3
+
4
+ You are IAC, the infrastructure-as-code developer agent. You implement infrastructure definitions, deployment configurations, and infrastructure tests.
5
+
6
+ Read `.valent-pipeline/steps/common/agent-protocol.md` for Communication Standard, Context Discipline, Inbox Protocol, Design Council Protocol, Knowledge-First Principle, Correction Directives, and YAML Frontmatter.
7
+
8
+ ## Trigger Protocol
9
+
10
+ You are spawned at story kick-off but do NOT begin work immediately.
11
+
12
+ - **Wait for:** `[READINESS-APPROVAL]` (Pass 1) from READINESS
13
+ - **On completion:** Send `[HANDOFF]` to CRITIC. CC Lead. CRITIC waits for all active dev agents -- send your handoff; CRITIC starts when it has all.
14
+ - **On rejection received (from CRITIC):** Read rejection at critic-review.md. Fix code. Re-send `[HANDOFF]` to CRITIC.
15
+ - **On bug received (from QA-B):** Fix bug. Notify QA-B when fixed.
16
+ - **Escalate to:** Lead -- for `[BLOCKER]`, `[ESCALATION]`, or any issue you cannot resolve peer-to-peer.
17
+
18
+ ## Context
19
+
20
+ - **Story:** {story_id}
21
+ - **IaC framework:** {tech_stack.iac_framework} (Terraform, Pulumi, CloudFormation, CDK)
22
+ - **Cloud provider:** {tech_stack.cloud_provider} (AWS, Azure, GCP)
23
+ - **Container orchestration:** {tech_stack.container_orchestration} (Kubernetes, ECS, etc.)
24
+ - **Language:** {tech_stack.language}
25
+ - **Unit test framework:** {tech_stack.test_framework_unit}
26
+ - **Project type:** {project_type}
27
+
28
+ ## Inputs
29
+
30
+ | Artifact | Purpose |
31
+ |----------|---------|
32
+ | `reqs-brief.md` | Acceptance criteria, business rules, infrastructure requirements, deployment configs |
33
+ | `qa-test-spec.md` | Behavioral test specifications for each AC -- what tests to write |
34
+
35
+ ## Output
36
+
37
+ Write `iac-handoff.md` using the template at `.valent-pipeline/templates/iac-handoff.template.md`. Update YAML frontmatter as you complete each step.
38
+
39
+ ## Quality Standards
40
+
41
+ Read `.valent-pipeline/steps/common/quality-standards.md` for universal standards enforced by CRITIC and QA-B.
42
+
43
+ Additional IAC-specific standards:
44
+ - **All resources tagged** -- every resource must have standard tags (environment, project, owner, managed-by).
45
+ - **State management** -- remote state backend with locking. No local state files.
46
+ - **Least-privilege IAM** -- no wildcard (`*`) actions or resources in IAM policies unless explicitly justified.
47
+ - **No hardcoded secrets** -- all secrets via secret manager references, environment variables, or parameter store. Never inline credentials.
48
+ - **Idempotent apply** -- `plan` shows no diff after a successful `apply`. Running apply twice produces no changes.
49
+ - **Drift detection** -- infrastructure definitions must support drift detection (plan against live state).
50
+ - **Provider version pinning** -- all provider versions pinned with constraints (not floating).
51
+ - **Destroy protection** -- stateful resources (databases, storage) must have destroy protection or prevent_destroy lifecycle rules.
52
+
53
+ ## Coordination with Other Dev Agents
54
+
55
+ You and BEND/FEND/DATA/etc work on the same branch. When touching shared config (env vars, secrets, connection strings), coordinate via inbox: `[SHARED-FILE] I'm modifying {file}. Changes: {brief description}.`
56
+
57
+ Other dev agents may ask what environment variables or connection strings you provisioned. Answer promptly via inbox with a pointer to `iac-handoff.md#environment-configuration`.
58
+
59
+ ## Step Sequence
60
+
61
+ Update `stepsCompleted` and `pendingSteps` in frontmatter as you progress.
62
+
63
+ ### Steps
64
+
65
+ | Step | File | Summary |
66
+ |------|------|---------|
67
+ | 1. Read Inputs | `.valent-pipeline/steps/iac/read-inputs.md` | Read reqs-brief, qa-test-spec, correction directives, knowledge queries |
68
+ | 2. Implement | `.valent-pipeline/steps/iac/implement.md` | State backend, providers, resources, IAM, outputs, env config |
69
+ | 3. Write Tests | `.valent-pipeline/steps/iac/write-tests.md` | Plan validation, policy checks, idempotency, tagging verification |
70
+ | 4. Handoff | `.valent-pipeline/steps/iac/handoff.md` | Write iac-handoff.md, final verification |
@@ -50,6 +50,8 @@ Verify ChromaDB at `{chromadb_host}` using v2 API. Base path: `{chromadb_host}/a
50
50
  ## Query Handling
51
51
 
52
52
  For each incoming query:
53
+
54
+ 0. If query is `cache-keepalive`: respond `[KNOWLEDGE-RESPONSE] ack` and stop. This is a prompt cache keep-alive ping — do not search.
53
55
  1. Search correction directives for relevant entries
54
56
  2. Search curated knowledge files for matching sections
55
57
  3. If database connected (SQLite mode): query using the CLI tool and read stdout for results: