@davidorex/pi-jit-agents 0.26.0 → 0.28.0

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 (73) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +2 -2
  3. package/dist/compile.d.ts.map +1 -1
  4. package/dist/compile.js +9 -3
  5. package/dist/compile.js.map +1 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/jit-runtime.d.ts +11 -0
  11. package/dist/jit-runtime.d.ts.map +1 -1
  12. package/dist/jit-runtime.js +36 -0
  13. package/dist/jit-runtime.js.map +1 -1
  14. package/dist/renderer-registry.d.ts +23 -7
  15. package/dist/renderer-registry.d.ts.map +1 -1
  16. package/dist/renderer-registry.js +34 -21
  17. package/dist/renderer-registry.js.map +1 -1
  18. package/dist/template.d.ts +15 -0
  19. package/dist/template.d.ts.map +1 -1
  20. package/dist/template.js +19 -0
  21. package/dist/template.js.map +1 -1
  22. package/dist/types.d.ts +4 -0
  23. package/dist/types.d.ts.map +1 -1
  24. package/package.json +7 -3
  25. package/schemas/agent-trace.schema.json +30 -2
  26. package/templates/analyzers/base-analyzer.md +9 -0
  27. package/templates/analyzers/patterns-task.md +11 -0
  28. package/templates/analyzers/patterns.md +15 -0
  29. package/templates/analyzers/quality-task.md +11 -0
  30. package/templates/analyzers/quality.md +15 -0
  31. package/templates/analyzers/structure-task.md +17 -0
  32. package/templates/analyzers/structure.md +15 -0
  33. package/templates/architecture-designer/task.md +117 -0
  34. package/templates/architecture-inferrer/task.md +61 -0
  35. package/templates/audit-finding-verifier/task.md +59 -0
  36. package/templates/audit-fixer/task.md +67 -0
  37. package/templates/audit-results-router/task.md +37 -0
  38. package/templates/decomposer/task.md +56 -0
  39. package/templates/explorer/system.md +3 -0
  40. package/templates/explorer/task.md +9 -0
  41. package/templates/gap-identifier/task.md +103 -0
  42. package/templates/gap-resolution-assessor/task.md +48 -0
  43. package/templates/handoff-writer/task.md +101 -0
  44. package/templates/investigator/task.md +30 -0
  45. package/templates/items/architecture.md +33 -0
  46. package/templates/items/conformance.md +26 -0
  47. package/templates/items/conventions.md +19 -0
  48. package/templates/items/decisions.md +47 -0
  49. package/templates/items/domain.md +21 -0
  50. package/templates/items/features.md +63 -0
  51. package/templates/items/framework-gaps.md +43 -0
  52. package/templates/items/issues.md +21 -0
  53. package/templates/items/layer-plans.md +50 -0
  54. package/templates/items/project.md +48 -0
  55. package/templates/items/requirements.md +20 -0
  56. package/templates/items/research.md +57 -0
  57. package/templates/items/spec-reviews.md +51 -0
  58. package/templates/items/tasks.md +29 -0
  59. package/templates/phase-author/task.md +82 -0
  60. package/templates/plan-creator/task.md +143 -0
  61. package/templates/plan-decomposer/task.md +46 -0
  62. package/templates/project-definer/task.md +67 -0
  63. package/templates/project-inferrer/task.md +56 -0
  64. package/templates/requirements-gatherer/task.md +90 -0
  65. package/templates/researcher/task.md +26 -0
  66. package/templates/shared/macros.md +169 -0
  67. package/templates/shared/render-helpers.md +106 -0
  68. package/templates/spec-implementer/task.md +53 -0
  69. package/templates/synthesizer/system.md +3 -0
  70. package/templates/synthesizer/task.md +38 -0
  71. package/templates/task-verifier/task.md +44 -0
  72. package/templates/task-worker/task.md +52 -0
  73. package/templates/verifier/task.md +57 -0
@@ -0,0 +1,20 @@
1
+ {#-
2
+ Per-item macro for the `requirements` block (Plan 8 / per-item-macros wave 4).
3
+
4
+ Block schema: .project/schemas/requirements.schema.json. Each item is one
5
+ requirement inside data.requirements[]. Required: id (^REQ-\d{3,}$),
6
+ description, type, status, priority. Optional: acceptance_criteria,
7
+ source, traces_to (phase/task IDs), depends_on (other requirement IDs).
8
+
9
+ Cross-block reference recursion (traces_to, depends_on) is delegated to
10
+ shared/render-helpers.md — see that file for the depth contract, ambient
11
+ globals, and empty-array convention shared across all per-item macros.
12
+ -#}
13
+ {% from "shared/render-helpers.md" import render_id_list_inline %}
14
+
15
+ {% macro render_requirement(req, depth=0) %}
16
+ {% if req %}- **{{ req.id }}** [{{ req.priority }}] ({{ req.type }}, {{ req.status }}): {{ enforceBudget(req.description, "requirements", "requirements.items.description") }}{% if req.acceptance_criteria %}
17
+ Criteria: {% for ac in req.acceptance_criteria %}{{ enforceBudget(ac, "requirements", "requirements.items.acceptance_criteria.items") }}{% if not loop.last %}; {% endif %}{% endfor %}{% endif %}
18
+ {% if req.source %} Source: {{ req.source }}
19
+ {% endif %}{{ render_id_list_inline("Traces to", req.traces_to, depth) }}{{ render_id_list_inline("Depends on", req.depends_on, depth) }}{% endif %}
20
+ {% endmacro %}
@@ -0,0 +1,57 @@
1
+ {#-
2
+ Per-item macro for the `research` block.
3
+
4
+ Block schema: .project/schemas/research.schema.json (Plan 7 / per-item-macros wave 4).
5
+
6
+ Cross-block reference recursion (informs, informed_by, related_research,
7
+ produces_findings, supersedes, superseded_by) is delegated to
8
+ shared/render-helpers.md — see that file for the depth contract, ambient
9
+ globals, and empty-array convention.
10
+
11
+ Embedded substructures:
12
+ `grounding` is an object with dependencies/revisions/external_refs
13
+ string arrays — rendered inline as labelled sub-lists, never recursed.
14
+ `citations[]` carries label/path/lines/url/retrieved_at — labelled
15
+ pointers to source material, not block IDs; rendered inline.
16
+ `stale_conditions[]` and `scope[]` are simple string arrays rendered as
17
+ bullet sub-lists.
18
+
19
+ x-prompt-budget integration:
20
+ The schema annotates `findings_summary`, `question`, `method` with
21
+ `x-prompt-budget`. enforceBudget is wired for these per Plan 5.
22
+ -#}
23
+ {% from "shared/render-helpers.md" import render_id_list_block, render_id_single_block, render_optional_scalar %}
24
+
25
+ {% macro render_research(r, depth=0) %}
26
+ ID: {{ r.id }}
27
+ Title: {{ r.title }}
28
+ Status: {{ r.status }}
29
+ Layer: {{ r.layer }}
30
+ Type: {{ r.type }}
31
+ Created by: {{ r.created_by }}
32
+ Created at: {{ r.created_at }}
33
+ {{ render_optional_scalar("Modified by", r.modified_by) }}{{ render_optional_scalar("Modified at", r.modified_at) }}{{ render_optional_scalar("Conducted by", r.conducted_by) }}{{ render_optional_scalar("Conducted at", r.conducted_at) }}{{ render_optional_scalar("Grounded at", r.grounded_at) }}
34
+ Question:
35
+ {{ enforceBudget(r.question, "research", "research.items.question") }}
36
+
37
+ Method:
38
+ {{ enforceBudget(r.method, "research", "research.items.method") }}
39
+
40
+ {% if r.scope is defined %}Scope:
41
+ {% if r.scope | length > 0 %}{% for s in r.scope %} - {{ s }}
42
+ {% endfor %}{% else %} (none)
43
+ {% endif %}{% endif %}Findings summary:
44
+ {{ enforceBudget(r.findings_summary, "research", "research.items.findings_summary") }}
45
+
46
+ {% if r.findings_document %}Findings document: {{ r.findings_document }}
47
+ {% endif %}{% if r.grounding is defined %}Grounding:
48
+ {% if r.grounding.dependencies is defined %} Dependencies: {% if r.grounding.dependencies | length > 0 %}{% for d in r.grounding.dependencies %}{{ d }}{% if not loop.last %}, {% endif %}{% endfor %}{% else %}(none){% endif %}
49
+ {% endif %}{% if r.grounding.revisions is defined %} Revisions: {% if r.grounding.revisions | length > 0 %}{% for rv in r.grounding.revisions %}{{ rv }}{% if not loop.last %}, {% endif %}{% endfor %}{% else %}(none){% endif %}
50
+ {% endif %}{% if r.grounding.external_refs is defined %} External refs: {% if r.grounding.external_refs | length > 0 %}{% for er in r.grounding.external_refs %}{{ er }}{% if not loop.last %}, {% endif %}{% endfor %}{% else %}(none){% endif %}
51
+ {% endif %}{% endif %}{% if r.stale_conditions is defined %}Stale conditions:
52
+ {% if r.stale_conditions | length > 0 %}{% for sc in r.stale_conditions %} - {{ sc }}
53
+ {% endfor %}{% else %} (none)
54
+ {% endif %}{% endif %}{% if r.citations is defined %}Citations:
55
+ {% if r.citations | length > 0 %}{% for c in r.citations %} - {{ c.label }}{% if c.path %} — path: {{ c.path }}{% if c.lines %}:{{ c.lines }}{% endif %}{% endif %}{% if c.url %} — url: {{ c.url }}{% endif %}{% if c.retrieved_at %} — retrieved_at: {{ c.retrieved_at }}{% endif %}
56
+ {% endfor %}{% else %} (none)
57
+ {% endif %}{% endif %}{{ render_id_list_block("Informs", r.informs, depth) }}{{ render_id_list_block("Informed by", r.informed_by, depth) }}{{ render_id_list_block("Related research", r.related_research, depth) }}{{ render_id_list_block("Produces findings", r.produces_findings, depth) }}{{ render_id_list_block("Supersedes", r.supersedes, depth) }}{{ render_id_single_block("Superseded by", r.superseded_by, depth) }}{% endmacro %}
@@ -0,0 +1,51 @@
1
+ {#-
2
+ Per-item macro for the `spec-reviews` block.
3
+
4
+ Block schema: .project/schemas/spec-reviews.schema.json (Plan 7 / per-item-macros wave 4).
5
+
6
+ Findings:
7
+ Each review carries an embedded findings registry (definitions/finding
8
+ in the schema). Findings are rendered inline as a sub-list under the
9
+ review body — they are not block items in their own right and have no
10
+ per-item macro of their own. Each finding's `produces_decision` (when
11
+ present and depth > 0) recurses into the decisions block via
12
+ resolve/render_recursive — that pattern stays inline because it has a
13
+ deeper indent (4 spaces) than the helper convention assumes and is
14
+ embedded in a finding-iteration loop rather than a top-level field.
15
+ `related_findings` on a finding refer to sibling findings within the
16
+ same review by their string ids; they are emitted as bare IDs (no
17
+ recursion — finding IDs are scoped to the review and not in the global
18
+ ID index).
19
+
20
+ Optional review-level scalars (target_revision, reviewer, completed_at,
21
+ clean) and the method body delegate to shared/render-helpers.md
22
+ render_optional_scalar where the shape matches.
23
+ -#}
24
+ {% from "shared/render-helpers.md" import render_optional_scalar %}
25
+
26
+ {% macro render_spec_review(rev, depth=0) %}
27
+ ID: {{ rev.id }}
28
+ Target: {{ rev.target }}
29
+ Status: {{ rev.status }}
30
+ Created by: {{ rev.created_by }}
31
+ Created at: {{ rev.created_at }}
32
+ {{ render_optional_scalar("Target revision", rev.target_revision) }}{{ render_optional_scalar("Reviewer", rev.reviewer) }}{{ render_optional_scalar("Completed at", rev.completed_at) }}{% if rev.clean is defined %}Clean: {{ rev.clean }}
33
+ {% endif %}{% if rev.method %}Method:
34
+ {{ enforceBudget(rev.method, "spec-reviews", "reviews.items.method") }}
35
+
36
+ {% endif %}{% if rev.scope is defined %}Scope:
37
+ {% if rev.scope | length > 0 %}{% for s in rev.scope %} - {{ s }}
38
+ {% endfor %}{% else %} (none)
39
+ {% endif %}{% endif %}Findings:
40
+ {% if rev.findings and rev.findings | length > 0 %}{% for f in rev.findings %} - {{ f.id }} [{{ f.severity }}/{{ f.category }}/{{ f.state }}] reporter={{ f.reporter }} at={{ f.created_at }}
41
+ Description: {{ enforceBudget(f.description, "spec-reviews", "reviews.items.findings.items.description") }}
42
+ {% if f.evidence %} Evidence: {{ f.evidence }}
43
+ {% endif %}{% if f.location %} Location: {{ f.location }}
44
+ {% endif %}{% if f.resolution %} Resolution: {{ f.resolution }}
45
+ {% endif %}{% if f.resolved_by %} Resolved by: {{ f.resolved_by }}
46
+ {% endif %}{% if f.resolved_at %} Resolved at: {{ f.resolved_at }}
47
+ {% endif %}{% if f.produces_decision %} Produces decision: {% if depth > 0 %}{% set loc = resolve(f.produces_decision) %}{% if loc %}
48
+ {{ render_recursive(loc, depth - 1) }}{% else %}{{ f.produces_decision }}{% endif %}{% else %}{{ f.produces_decision }}{% endif %}
49
+ {% endif %}{% if f.related_findings is defined %} Related findings: {% if f.related_findings | length > 0 %}{% for rf in f.related_findings %}{{ rf }}{% if not loop.last %}, {% endif %}{% endfor %}{% else %}(none){% endif %}
50
+ {% endif %}{% endfor %}{% else %} (none)
51
+ {% endif %}{% endmacro %}
@@ -0,0 +1,29 @@
1
+ {#-
2
+ Per-item macro for the `tasks` block (Plan 8 / per-item-macros wave 4).
3
+
4
+ Block schema: .project/schemas/tasks.schema.json. Each item is one task
5
+ inside data.tasks[]. Required: id (^TASK-\d{3,}$), description, status.
6
+ Optional: phase (string|integer), files, acceptance_criteria, depends_on
7
+ (other task IDs), assigned_agent, verification (verification ID), notes.
8
+
9
+ When status === "completed", schema additionally requires verification
10
+ (the if/then conditional in the schema).
11
+
12
+ Cross-block reference recursion (depends_on, verification) is delegated to
13
+ shared/render-helpers.md — see that file for the depth contract, ambient
14
+ globals, and empty-array convention. verification is rendered as a single
15
+ inline reference (one ID) rather than a list.
16
+
17
+ Files field:
18
+ files[] is a list of code paths, not project-block IDs. Rendered inline
19
+ as a comma-separated list; never recursed.
20
+ -#}
21
+ {% from "shared/render-helpers.md" import render_id_list_inline, render_id_single_inline %}
22
+
23
+ {% macro render_task(t, depth=0) %}
24
+ {% if t %}- **{{ t.id }}** [{{ t.status }}]: {{ enforceBudget(t.description, "tasks", "tasks.items.description") }}{% if t.phase %} (phase {{ t.phase }}){% endif %}{% if t.files %} — files: {{ t.files | join(", ") }}{% endif %}
25
+ {% if t.acceptance_criteria %} Criteria: {% for ac in t.acceptance_criteria %}{{ enforceBudget(ac, "tasks", "tasks.items.acceptance_criteria.items") }}{% if not loop.last %}; {% endif %}{% endfor %}
26
+ {% endif %}{% if t.assigned_agent %} Assigned agent: {{ t.assigned_agent }}
27
+ {% endif %}{% if t.notes %} Notes: {{ enforceBudget(t.notes, "tasks", "tasks.items.notes") }}
28
+ {% endif %}{{ render_id_list_inline("Depends on", t.depends_on, depth) }}{{ render_id_single_inline("Verification", t.verification, depth) }}{% endif %}
29
+ {% endmacro %}
@@ -0,0 +1,82 @@
1
+ ## Intent
2
+
3
+ {{ intent }}
4
+
5
+ ## Existing Phases
6
+
7
+ {% for phase in phases %}
8
+ - Phase {{ phase.number }}: {{ phase.name }} ({{ phase.status }})
9
+ {% endfor %}
10
+
11
+ {% if architecture and architecture.modules %}
12
+ ## Current Architecture
13
+
14
+ {% for module in architecture.modules %}
15
+ - **{{ module.name }}** ({{ module.file }}, {{ module.lines }} lines): {{ module.responsibility }}
16
+ {% endfor %}
17
+
18
+ {% if architecture.compilation_pipeline %}
19
+ ### Compilation Pipeline
20
+ {% for stage in architecture.compilation_pipeline %}
21
+ {{ loop.index }}. **{{ stage.stage }}**: {{ stage.description }}
22
+ {% endfor %}
23
+ {% endif %}
24
+ {% endif %}
25
+
26
+ {% if conventions and conventions.rules %}
27
+ ## Conventions
28
+
29
+ {% for rule in conventions.rules %}
30
+ - {{ rule.id }}: {{ rule.description }} ({{ rule.enforcement }})
31
+ {% endfor %}
32
+ {% endif %}
33
+
34
+ {% if gaps and gaps.gaps %}
35
+ ## Current Gaps
36
+
37
+ {% for gap in gaps.gaps %}
38
+ {% if gap.status == "open" %}
39
+ - [{{ gap.priority }}] {{ gap.id }}: {{ gap.description }}
40
+ {% endif %}
41
+ {% endfor %}
42
+ {% endif %}
43
+
44
+ {% if inventory %}
45
+ ## Current Inventory
46
+
47
+ {% if inventory.step_types %}- Step types: {{ inventory.step_types | length }}
48
+ {% endif %}{% if inventory.agent_specs %}- Agent specs: {{ inventory.agent_specs | length }}
49
+ {% endif %}{% if inventory.schemas %}- Schemas: {{ inventory.schemas | length }}
50
+ {% endif %}{% if inventory.test_count is defined %}- Tests: {{ inventory.test_count }}
51
+ {% endif %}{% endif %}
52
+
53
+ ## Instructions
54
+
55
+ Convert the intent above into a structured phase spec. Read the codebase to understand what exists and what the intent requires.
56
+
57
+ 1. **Determine the phase number** — next after the highest existing phase number
58
+ 2. **Write a clear intent statement** — what this phase accomplishes and why
59
+ 3. **Define success criteria** — each with a verify_method:
60
+ - `command`: can be verified by running a shell command (test suite, grep, validate)
61
+ - `inspect`: requires reading files and assessing content
62
+ - `human`: requires human judgment
63
+ 4. **Decompose into specs** — each spec is a focused unit of work:
64
+ - Sequential numbering continuing from the last spec in the previous phase
65
+ - Clear intent per spec
66
+ - Concrete acceptance criteria (strings, each independently checkable)
67
+ - Specs should be ordered by dependency — earlier specs don't depend on later ones
68
+ 5. **Identify dependencies** — which phase numbers this phase depends on
69
+ 6. **List artifacts produced** — file paths this phase will create or modify
70
+
71
+ ### Sizing guidance
72
+
73
+ - Each spec should be completable by one agent in one context window
74
+ - If a spec needs more than ~5 files changed, split it
75
+ - If a spec has more than ~5 acceptance criteria, it might be doing too much
76
+ - Group related changes (e.g., schema + instance + validation test = one spec)
77
+
78
+ ### Cross-reference gaps
79
+
80
+ Check if any existing open gaps are addressed by this phase. If so, note that in the spec intent — the gap can be marked resolved when the spec completes.
81
+
82
+ Produce a JSON object conforming to the phase schema.
@@ -0,0 +1,143 @@
1
+ ## Project Identity
2
+
3
+ **Name:** {{ project.name }}
4
+ **Description:** {{ project.description }}
5
+ **Core Value:** {{ project.core_value }}
6
+ **Status:** {{ project.status }}
7
+ {% if project.stack %}
8
+
9
+ ### Stack
10
+ {% for item in project.stack %}
11
+ - {{ item }}
12
+ {% endfor %}
13
+ {% endif %}
14
+
15
+ ## Requirements Summary
16
+
17
+ {% for req in requirements.requirements %}
18
+ {% if req.priority == "must" %}
19
+ - **{{ req.id }}** [must/{{ req.type }}]: {{ req.description }}
20
+ {% endif %}
21
+ {% endfor %}
22
+ {% for req in requirements.requirements %}
23
+ {% if req.priority == "should" %}
24
+ - **{{ req.id }}** [should/{{ req.type }}]: {{ req.description }}
25
+ {% endif %}
26
+ {% endfor %}
27
+ {% for req in requirements.requirements %}
28
+ {% if req.priority == "could" %}
29
+ - **{{ req.id }}** [could/{{ req.type }}]: {{ req.description }}
30
+ {% endif %}
31
+ {% endfor %}
32
+
33
+ ## Architecture
34
+
35
+ **Overview:** {{ architecture.overview }}
36
+
37
+ ### Modules
38
+ {% for module in architecture.modules %}
39
+ - **{{ module.name }}** (`{{ module.file }}`): {{ module.responsibility }}{% if module.dependencies %} [depends: {{ module.dependencies | join(", ") }}]{% endif %}
40
+ {% endfor %}
41
+
42
+ ### Patterns
43
+ {% for pattern in architecture.patterns %}
44
+ - **{{ pattern.name }}**: {{ pattern.description }} (used in: {{ pattern.used_in | join(", ") }})
45
+ {% endfor %}
46
+
47
+ ### Boundaries
48
+ {% for boundary in architecture.boundaries %}
49
+ - {{ boundary }}
50
+ {% endfor %}
51
+
52
+ {% if existing_files %}
53
+ ## Existing Project Files
54
+
55
+ The project directory already contains these files:
56
+ {% for file in existing_files %}
57
+ - {{ file }}
58
+ {% endfor %}
59
+
60
+ Account for existing structure — do not plan to recreate files that already exist unless they need modification.
61
+ {% endif %}
62
+
63
+ ## Instructions
64
+
65
+ Create implementation phases and tasks that build this project incrementally. The plan should take the project from its current state ({{ project.status }}) to a working system that satisfies all "must" requirements and addresses "should" requirements.
66
+
67
+ ### Phase guidelines
68
+
69
+ 1. **Phase 1** — Foundation: project structure, core module scaffolding, configuration, initial tests
70
+ 2. **Phase 2+** — Layer functionality in priority order: "must" requirements first, then "should"
71
+ 3. **Final phase** — Integration, documentation, and verification
72
+ 4. Each phase should represent a meaningful milestone — the project is more capable after each phase
73
+ 5. A phase with more than 8-10 tasks is likely too large — split it
74
+
75
+ ### For each phase, provide:
76
+
77
+ - **number** — sequential starting at 1
78
+ - **name** — short descriptive name
79
+ - **intent** — what this phase accomplishes and why it comes at this point
80
+ - **goal** — what is true after this phase that was not true before
81
+ - **status** — `"planned"`
82
+ - **success_criteria** — array of `{ criterion, verify_method }` (verify_method: "command", "inspect", or "test")
83
+ - **dependencies** — array of phase numbers this depends on (empty for phase 1)
84
+ - **inputs** — what this phase needs from prior phases or external sources
85
+ - **outputs** — what this phase produces for later phases or users
86
+
87
+ ### For each task, provide:
88
+
89
+ - **id** — unique, formatted as T-001, T-002, etc.
90
+ - **description** — clear statement of what to do
91
+ - **status** — `"planned"`
92
+ - **phase** — phase number this belongs to
93
+ - **files** — array of file paths this task creates or modifies
94
+ - **acceptance_criteria** — array of specific, verifiable statements
95
+ - **depends_on** — array of task IDs this depends on (empty if none)
96
+ - **notes** — optional: any implementation guidance or caveats
97
+
98
+ ### Task sizing
99
+
100
+ - Each task should be completable by one agent in one context window
101
+ - A task touching more than 3-5 files likely needs splitting
102
+ - A task with more than 5 acceptance criteria may be doing too much
103
+ - Group related changes: schema + implementation + test = one task when files are few
104
+
105
+ ### Traceability
106
+
107
+ - Every "must" requirement should be addressed by at least one task
108
+ - Every task's files should map to at least one architecture module
109
+ - Note requirement IDs in task descriptions or notes where the mapping is clear
110
+
111
+ ### Output format
112
+
113
+ Produce a single JSON object with two arrays:
114
+
115
+ ```json
116
+ {
117
+ "phases": [
118
+ {
119
+ "number": 1,
120
+ "name": "string",
121
+ "intent": "string",
122
+ "goal": "string",
123
+ "status": "planned",
124
+ "success_criteria": [{ "criterion": "string", "verify_method": "command" }],
125
+ "dependencies": [],
126
+ "inputs": ["string"],
127
+ "outputs": ["string"]
128
+ }
129
+ ],
130
+ "tasks": [
131
+ {
132
+ "id": "T-001",
133
+ "description": "string",
134
+ "status": "planned",
135
+ "phase": 1,
136
+ "files": ["src/file.ts"],
137
+ "acceptance_criteria": ["string"],
138
+ "depends_on": [],
139
+ "notes": "optional string"
140
+ }
141
+ ]
142
+ }
143
+ ```
@@ -0,0 +1,46 @@
1
+ ## Phase: {{ phase.name }}
2
+
3
+ ### Intent
4
+ {{ phase.intent }}
5
+
6
+ ### Success Criteria
7
+ {% for criterion in phase.success_criteria %}
8
+ - {{ criterion.criterion }} (verify: {{ criterion.verify_method }})
9
+ {% endfor %}
10
+
11
+ ### Specs
12
+ {% if phase.specs %}
13
+ {% for spec in phase.specs %}
14
+ - **{{ spec.id }}**: {{ spec.name }}
15
+ {% endfor %}
16
+ {% endif %}
17
+
18
+ ### Current Architecture
19
+ {% for module in architecture.modules %}
20
+ - **{{ module.name }}** ({{ module.file }}): {{ module.responsibility }}
21
+ {% endfor %}
22
+
23
+ ### Conventions
24
+ {% for rule in conventions.rules %}
25
+ - {{ rule.id }}: {{ rule.description }} ({{ rule.enforcement }})
26
+ {% endfor %}
27
+
28
+ ## Instructions
29
+
30
+ Decompose this phase into implementation plans. Each plan should be a focused unit of work that one agent can complete in a single context window.
31
+
32
+ Before creating plans:
33
+ 1. Read source files referenced in the architecture to understand existing patterns
34
+ 2. Identify logical boundaries — which specs or features are independent
35
+ 3. Determine which plans can run in parallel (independent file sets)
36
+
37
+ For each plan, produce:
38
+ - **name**: short identifier for the plan
39
+ - **intent**: what this plan accomplishes and why
40
+ - **tasks**: concrete list of things to do (create files, add tests, wire up)
41
+ - **files_to_change**: paths that will be created or modified
42
+ - **acceptance_criteria**: how to know the plan is done
43
+ - **context_needed**: files or modules the implementing agent should read first
44
+ - **parallel_group**: group name — plans in the same group can run concurrently (independent file sets get the same group; dependent plans get different groups)
45
+
46
+ Output a JSON object with a `plans` array conforming to the plan-breakdown schema.
@@ -0,0 +1,67 @@
1
+ ## Vision Statement
2
+
3
+ {{ vision }}
4
+
5
+ {% if context %}
6
+ ## Additional Context
7
+
8
+ {{ context }}
9
+ {% endif %}
10
+
11
+ ## Instructions
12
+
13
+ Produce a structured project identity from the vision statement above. Extract, infer, or derive each field — do not leave gaps where the vision provides signal.
14
+
15
+ ### Fields to produce
16
+
17
+ 1. **name** — short, lowercase-hyphenated project identifier
18
+ 2. **description** — 1-3 sentences capturing what the project does and why it matters
19
+ 3. **core_value** — one sentence a stakeholder outside the project could understand
20
+ 4. **target_users** — array of user roles or personas who benefit
21
+ 5. **constraints** — array of `{ type, description }` objects reflecting real limitations from the vision
22
+ - type examples: "technical", "organizational", "timeline", "budget", "regulatory", "compatibility"
23
+ 6. **scope_boundaries** — `{ in: [...], out: [...] }` capturing what is and is not in scope
24
+ - `out` is especially important: document what a reader might assume is in scope but is not
25
+ 7. **goals** — array of `{ id, description, success_criteria: [...] }` objects
26
+ - IDs: G-001, G-002, etc.
27
+ - success_criteria: measurable or verifiable statements (not aspirational)
28
+ 8. **status** — set to `"inception"`
29
+
30
+ {% if stack %}
31
+ ### Stack
32
+
33
+ The following technology stack has been specified:
34
+
35
+ {% for item in stack %}
36
+ - {{ item }}
37
+ {% endfor %}
38
+
39
+ Include these in the output `stack` array.
40
+ {% endif %}
41
+
42
+ {% if repository %}
43
+ ### Repository
44
+
45
+ Repository: {{ repository }}
46
+
47
+ Include this in the output `repository` field.
48
+ {% endif %}
49
+
50
+ ### Output format
51
+
52
+ Produce a single JSON object. Every required field must be present. The object should conform to the project block schema:
53
+
54
+ ```json
55
+ {
56
+ "name": "string (required)",
57
+ "description": "string (required)",
58
+ "core_value": "string (required)",
59
+ "target_users": ["string"],
60
+ "constraints": [{ "type": "string", "description": "string" }],
61
+ "scope_boundaries": { "in": ["string"], "out": ["string"] },
62
+ "goals": [{ "id": "G-001", "description": "string", "success_criteria": ["string"] }],
63
+ "status": "inception",
64
+ "repository": "string (if provided)",
65
+ "stack": ["string (if provided)"]
66
+ }
67
+ ```
@@ -0,0 +1,56 @@
1
+ Infer the project identity for the project at `{{ path }}`.
2
+
3
+ ## Codebase Analysis
4
+
5
+ {% if exploration.files is defined %}
6
+ ### Files ({{ exploration.files | length }} total)
7
+ {% for file in exploration.files | batch(20) | first %}
8
+ - `{{ file.path }}` ({{ file.language | default("unknown") }})
9
+ {% endfor %}
10
+ {% if exploration.files | length > 20 %}
11
+ ... and {{ exploration.files | length - 20 }} more files
12
+ {% endif %}
13
+ {% endif %}
14
+
15
+ {% if exploration.entryPoints is defined %}
16
+ ### Entry Points
17
+ {% for ep in exploration.entryPoints %}
18
+ - `{{ ep }}`
19
+ {% endfor %}
20
+ {% endif %}
21
+
22
+ ## Instructions
23
+
24
+ Read project metadata and documentation to determine the project's identity. Start with:
25
+ - README.md (or equivalent)
26
+ - Package manifest (package.json, Cargo.toml, pyproject.toml, go.mod, etc.)
27
+ - CLAUDE.md or similar project instructions if present
28
+ - CI/CD configuration if present
29
+
30
+ Produce a project identity block:
31
+
32
+ 1. **name** — the project's canonical name (from package manifest, not directory name)
33
+ 2. **description** — concise summary of what the project does (2-3 sentences max)
34
+ 3. **core_value** — single sentence: why does this project exist? What value does it provide?
35
+ 4. **target_users** — who uses this? (e.g., "TypeScript developers", "DevOps engineers", "data scientists")
36
+ 5. **constraints** — each with `type` and `description`:
37
+ - Runtime constraints (Node.js version, browser support, etc.)
38
+ - Language constraints (TypeScript strict mode, ESM-only, etc.)
39
+ - Compatibility constraints (API stability, backward compat, etc.)
40
+ 6. **scope_boundaries**:
41
+ - `in`: what the project explicitly does
42
+ - `out`: what the project explicitly does not do (deferred or excluded)
43
+ 7. **goals** — each with `id`, `description`, and optional `success_criteria` array
44
+ - Only include goals evidenced by the codebase (README roadmap, issues, TODO markers)
45
+ 8. **status** — one of: inception, planning, development, maintenance, complete
46
+ - Infer from: version maturity, commit recency, test coverage, presence of CI
47
+ 9. **repository** — repository URL if discoverable from package manifest or git remote
48
+ 10. **stack** — primary technology choices only (language, framework, key libraries — not every dependency)
49
+
50
+ ## Required Output Schema
51
+
52
+ You MUST produce JSON conforming exactly to this schema. Every required field must be present.
53
+
54
+ ```json
55
+ {{ output_schema }}
56
+ ```
@@ -0,0 +1,90 @@
1
+ ## Project Identity
2
+
3
+ **Name:** {{ project.name }}
4
+ **Description:** {{ project.description }}
5
+ **Core Value:** {{ project.core_value }}
6
+
7
+ ### Target Users
8
+ {% for user in project.target_users %}
9
+ - {{ user }}
10
+ {% endfor %}
11
+
12
+ ### Constraints
13
+ {% for constraint in project.constraints %}
14
+ - [{{ constraint.type }}] {{ constraint.description }}
15
+ {% endfor %}
16
+
17
+ ### Scope Boundaries
18
+
19
+ **In scope:**
20
+ {% for item in project.scope_boundaries.in %}
21
+ - {{ item }}
22
+ {% endfor %}
23
+
24
+ **Out of scope:**
25
+ {% for item in project.scope_boundaries.out %}
26
+ - {{ item }}
27
+ {% endfor %}
28
+
29
+ ### Goals
30
+ {% for goal in project.goals %}
31
+ - **{{ goal.id }}**: {{ goal.description }}
32
+ {% for criterion in goal.success_criteria %}- {{ criterion }}
33
+ {% endfor %}
34
+ {% endfor %}
35
+
36
+ {% if vision %}
37
+ ## Original Vision
38
+
39
+ {{ vision }}
40
+ {% endif %}
41
+
42
+ ## Instructions
43
+
44
+ Derive requirements from the project identity above. Produce a comprehensive but proportionate set of requirements covering what the system must do (functional), quality attributes it must exhibit (non-functional), hard limits it must respect (constraint), and external connections it must support (integration).
45
+
46
+ ### For each requirement, provide:
47
+
48
+ 1. **id** — unique, formatted as REQ-NNN (zero-padded three-digit suffix)
49
+ 2. **description** — clear statement of what is required
50
+ 3. **type** — one of: `functional`, `non-functional`, `constraint`, `integration`
51
+ 4. **status** — set to `"proposed"` for all
52
+ 5. **priority** — MoSCoW: `must`, `should`, `could`, `wont`
53
+ 6. **acceptance_criteria** — array of specific, verifiable statements
54
+ 7. **source** — set to `"agent"` for all
55
+ 8. **depends_on** — array of other requirement IDs this depends on (empty array if none)
56
+
57
+ ### Priority guidance
58
+
59
+ - **must**: the project fails without this — directly tied to core_value and essential goals
60
+ - **should**: important for target users but the project could ship a minimal version without it
61
+ - **could**: enhances the experience but is clearly secondary
62
+ - **wont**: explicitly excluded — derive these from scope_boundaries.out
63
+
64
+ ### Coverage expectations
65
+
66
+ - Every goal should map to at least one "must" requirement
67
+ - Every constraint should appear as a "constraint" type requirement
68
+ - Include at least one non-functional requirement for each quality attribute the project implies (performance, security, usability, reliability, etc. — only those that are relevant)
69
+ - Include "wont" requirements for major items in scope_boundaries.out
70
+
71
+ ### Output format
72
+
73
+ Produce a single JSON object with a `requirements` array:
74
+
75
+ ```json
76
+ {
77
+ "requirements": [
78
+ {
79
+ "id": "REQ-NNN",
80
+ "description": "string",
81
+ "type": "functional",
82
+ "status": "proposed",
83
+ "priority": "must",
84
+ "acceptance_criteria": ["string"],
85
+ "source": "agent",
86
+ "depends_on": []
87
+ }
88
+ ]
89
+ }
90
+ ```
@@ -0,0 +1,26 @@
1
+ ## Research Request
2
+
3
+ **Gap:** {{ gap.id }} — {{ gap.description }}
4
+
5
+ ## Questions
6
+
7
+ {% for q in research_questions %}
8
+ {{ loop.index }}. {{ q }}
9
+ {% endfor %}
10
+
11
+ ## Instructions
12
+
13
+ For each question:
14
+ 1. Answer based on known software engineering patterns, best practices, and established solutions
15
+ 2. Rate your confidence: `high` (well-known, widely used), `medium` (established but context-dependent), `low` (best guess)
16
+ 3. List sources where possible — documentation, known projects, pattern names
17
+
18
+ Also identify applicable patterns and concrete recommendations.
19
+
20
+ ## Required Output Schema
21
+
22
+ You MUST produce JSON conforming exactly to this schema. Every required field must be present.
23
+
24
+ ```json
25
+ {{ output_schema }}
26
+ ```