@davidorex/pi-workflows 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 (79) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/agents/requirements-gatherer.agent.yaml +1 -1
  3. package/dist/auth-required.d.ts +10 -0
  4. package/dist/auth-required.d.ts.map +1 -0
  5. package/dist/auth-required.js +10 -0
  6. package/dist/auth-required.js.map +1 -0
  7. package/dist/bundled-dirs.d.ts +1 -1
  8. package/dist/bundled-dirs.d.ts.map +1 -1
  9. package/dist/bundled-dirs.js +8 -3
  10. package/dist/bundled-dirs.js.map +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +30 -8
  13. package/dist/index.js.map +1 -1
  14. package/dist/render-by-id.d.ts.map +1 -1
  15. package/dist/render-by-id.js +7 -4
  16. package/dist/render-by-id.js.map +1 -1
  17. package/dist/template-validation.js +3 -3
  18. package/dist/template-validation.js.map +1 -1
  19. package/dist/template.d.ts.map +1 -1
  20. package/dist/template.js +2 -2
  21. package/dist/template.js.map +1 -1
  22. package/dist/test-helpers.d.ts.map +1 -1
  23. package/dist/test-helpers.js +4 -5
  24. package/dist/test-helpers.js.map +1 -1
  25. package/dist/workflow-sdk.d.ts.map +1 -1
  26. package/dist/workflow-sdk.js +6 -5
  27. package/dist/workflow-sdk.js.map +1 -1
  28. package/package.json +11 -5
  29. package/skill-narrative.md +3 -3
  30. package/skills/pi-workflows/SKILL.md +6 -6
  31. package/skills/pi-workflows/references/bundled-resources.md +0 -51
  32. package/templates/analyzers/base-analyzer.md +0 -9
  33. package/templates/analyzers/patterns-task.md +0 -11
  34. package/templates/analyzers/patterns.md +0 -15
  35. package/templates/analyzers/quality-task.md +0 -11
  36. package/templates/analyzers/quality.md +0 -15
  37. package/templates/analyzers/structure-task.md +0 -17
  38. package/templates/analyzers/structure.md +0 -15
  39. package/templates/architecture-designer/task.md +0 -117
  40. package/templates/architecture-inferrer/task.md +0 -61
  41. package/templates/audit-finding-verifier/task.md +0 -59
  42. package/templates/audit-fixer/task.md +0 -67
  43. package/templates/audit-results-router/task.md +0 -37
  44. package/templates/decomposer/task.md +0 -56
  45. package/templates/explorer/system.md +0 -3
  46. package/templates/explorer/task.md +0 -9
  47. package/templates/gap-identifier/task.md +0 -103
  48. package/templates/gap-resolution-assessor/task.md +0 -48
  49. package/templates/handoff-writer/task.md +0 -101
  50. package/templates/investigator/task.md +0 -30
  51. package/templates/items/architecture.md +0 -33
  52. package/templates/items/conformance.md +0 -26
  53. package/templates/items/conventions.md +0 -19
  54. package/templates/items/decisions.md +0 -47
  55. package/templates/items/domain.md +0 -21
  56. package/templates/items/features.md +0 -63
  57. package/templates/items/framework-gaps.md +0 -43
  58. package/templates/items/issues.md +0 -21
  59. package/templates/items/layer-plans.md +0 -50
  60. package/templates/items/project.md +0 -48
  61. package/templates/items/requirements.md +0 -20
  62. package/templates/items/research.md +0 -57
  63. package/templates/items/spec-reviews.md +0 -51
  64. package/templates/items/tasks.md +0 -29
  65. package/templates/phase-author/task.md +0 -82
  66. package/templates/plan-creator/task.md +0 -143
  67. package/templates/plan-decomposer/task.md +0 -46
  68. package/templates/project-definer/task.md +0 -67
  69. package/templates/project-inferrer/task.md +0 -56
  70. package/templates/requirements-gatherer/task.md +0 -90
  71. package/templates/researcher/task.md +0 -26
  72. package/templates/shared/macros.md +0 -137
  73. package/templates/shared/render-helpers.md +0 -106
  74. package/templates/spec-implementer/task.md +0 -53
  75. package/templates/synthesizer/system.md +0 -3
  76. package/templates/synthesizer/task.md +0 -38
  77. package/templates/task-verifier/task.md +0 -44
  78. package/templates/task-worker/task.md +0 -52
  79. package/templates/verifier/task.md +0 -57
@@ -1,15 +0,0 @@
1
- {% extends "analyzers/base-analyzer.md" %}
2
-
3
- {% block identity %}You are a design pattern analyst.{% endblock %}
4
-
5
- {% block checklist %}
6
- 1. **Design patterns**: What patterns are used? Are they applied correctly?
7
- 2. **Idioms**: What language/framework idioms are followed or violated?
8
- 3. **Conventions**: Naming, file organization, import style — are they consistent?
9
- 4. **Anti-patterns**: Are there patterns that work against the codebase?
10
- 5. **Recommendations**: What patterns would improve the codebase?
11
- {% endblock %}
12
-
13
- {% block constraints %}
14
- Focus on patterns and conventions, not raw quality or architecture. Be specific — cite examples.
15
- {% endblock %}
@@ -1,11 +0,0 @@
1
- Analyze code quality at `{{ path }}`.
2
-
3
- {% if exploration.files is defined %}
4
- ## Codebase
5
- {% for file in exploration.files %}
6
- - `{{ file.path }}` ({{ file.lines }} lines)
7
- {% endfor %}
8
- {% endif %}
9
-
10
- Assess test coverage, error handling, code smells, and maintainability.
11
- Write your analysis as JSON conforming to the output schema.
@@ -1,15 +0,0 @@
1
- {% extends "analyzers/base-analyzer.md" %}
2
-
3
- {% block identity %}You are a code quality analyst.{% endblock %}
4
-
5
- {% block checklist %}
6
- 1. **Test coverage**: What is tested? What isn't? Are tests meaningful?
7
- 2. **Error handling**: How are errors handled? Are there gaps?
8
- 3. **Code smells**: Duplicated logic, overly complex functions, magic numbers?
9
- 4. **Documentation**: Is the code documented? Are the docs accurate?
10
- 5. **Maintainability**: How easy would it be to modify this code?
11
- {% endblock %}
12
-
13
- {% block constraints %}
14
- Focus on quality concerns, not architecture or design patterns. Be specific — cite files and line ranges.
15
- {% endblock %}
@@ -1,17 +0,0 @@
1
- Analyze the code at `{{ path }}`.
2
-
3
- {% if exploration.files is defined %}
4
- ## Prior Exploration
5
- {% for file in exploration.files %}
6
- - `{{ file.path }}` ({{ file.lines }} lines){% if file.exports %}: {{ file.exports | length }} exports{% endif %}
7
- {% endfor %}
8
- {% endif %}
9
-
10
- {% if exploration.types is defined %}
11
- ## Known Types
12
- {% for t in exploration.types %}
13
- - `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
14
- {% endfor %}
15
- {% endif %}
16
-
17
- Write your analysis as JSON conforming to the output schema.
@@ -1,15 +0,0 @@
1
- {% extends "analyzers/base-analyzer.md" %}
2
-
3
- {% block identity %}You are a code structure analyst.{% endblock %}
4
-
5
- {% block checklist %}
6
- 1. **Architecture**: How is the code organized? What patterns are used?
7
- 2. **Module boundaries**: Are responsibilities clearly separated?
8
- 3. **Dependencies**: What are the key dependency relationships?
9
- 4. **Entry points**: How does execution flow through the code?
10
- 5. **Configuration**: How is the system configured?
11
- {% endblock %}
12
-
13
- {% block constraints %}
14
- Focus on structural concerns, not code quality or patterns. Be specific — cite files and directories.
15
- {% endblock %}
@@ -1,117 +0,0 @@
1
- ## Project Identity
2
-
3
- **Name:** {{ project.name }}
4
- **Description:** {{ project.description }}
5
- **Core Value:** {{ project.core_value }}
6
- {% if project.stack %}
7
-
8
- ### Stack
9
- {% for item in project.stack %}
10
- - {{ item }}
11
- {% endfor %}
12
- {% endif %}
13
-
14
- ### Constraints
15
- {% for constraint in project.constraints %}
16
- - [{{ constraint.type }}] {{ constraint.description }}
17
- {% endfor %}
18
-
19
- ### Scope Boundaries
20
-
21
- **In scope:**
22
- {% for item in project.scope_boundaries.in %}
23
- - {{ item }}
24
- {% endfor %}
25
-
26
- **Out of scope:**
27
- {% for item in project.scope_boundaries.out %}
28
- - {{ item }}
29
- {% endfor %}
30
-
31
- ## Requirements
32
-
33
- ### Must
34
- {% for req in requirements.requirements %}
35
- {% if req.priority == "must" %}
36
- - **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
37
- {% endif %}
38
- {% endfor %}
39
-
40
- ### Should
41
- {% for req in requirements.requirements %}
42
- {% if req.priority == "should" %}
43
- - **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
44
- {% endif %}
45
- {% endfor %}
46
-
47
- ### Could
48
- {% for req in requirements.requirements %}
49
- {% if req.priority == "could" %}
50
- - **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
51
- {% endif %}
52
- {% endfor %}
53
-
54
- ## Instructions
55
-
56
- Design the initial architecture for this project. Produce modules, patterns, and boundaries that satisfy the requirements above — starting with "must" requirements and ensuring "should" requirements have a clear home.
57
-
58
- ### For each module, provide:
59
-
60
- 1. **name** — short identifier (e.g., "api", "auth", "storage", "cli")
61
- 2. **file** — primary file path relative to project root (e.g., "src/api.ts")
62
- 3. **responsibility** — one sentence: what this module owns and what it does not
63
- 4. **dependencies** — array of other module names this depends on (empty if none)
64
- 5. **lines** — estimated lines of code (rough order of magnitude)
65
-
66
- ### For each pattern, provide:
67
-
68
- 1. **name** — recognized pattern name (e.g., "Repository Pattern", "Event Sourcing", "Middleware Pipeline")
69
- 2. **description** — why this pattern is appropriate for this project's specific needs
70
- 3. **used_in** — array of module names that implement this pattern
71
-
72
- ### For boundaries, provide:
73
-
74
- An array of strings — each describing a hard architectural constraint. These should be specific to this project, not generic ("All database access goes through the storage module", not "separate concerns").
75
-
76
- ### Design principles
77
-
78
- - Module count should be proportional to requirements — a 5-requirement project needs 3-5 modules, not 15
79
- - Every "must" functional requirement should map to at least one module's responsibility
80
- - Every "must" non-functional requirement should be addressed by a pattern or boundary
81
- - Dependencies should flow in one direction — avoid circular module dependencies
82
- - If the project has a stated stack, modules should use file extensions and conventions matching that stack
83
- - Prefer explicit boundaries over implicit conventions
84
-
85
- ### Overview
86
-
87
- Write an `overview` paragraph (required) summarizing:
88
- - The architectural style (layered, modular, pipeline, etc.)
89
- - The key structural decisions and why they fit this project
90
- - How the architecture supports the core_value
91
-
92
- ### Output format
93
-
94
- Produce a single JSON object:
95
-
96
- ```json
97
- {
98
- "overview": "string (required)",
99
- "modules": [
100
- {
101
- "name": "string (required)",
102
- "file": "string (required)",
103
- "responsibility": "string (required)",
104
- "dependencies": ["string"],
105
- "lines": 100
106
- }
107
- ],
108
- "patterns": [
109
- {
110
- "name": "string (required)",
111
- "description": "string (required)",
112
- "used_in": ["module-name"]
113
- }
114
- ],
115
- "boundaries": ["string"]
116
- }
117
- ```
@@ -1,61 +0,0 @@
1
- Infer the architecture of the project at `{{ path }}`.
2
-
3
- ## Codebase Analysis
4
-
5
- {% if exploration.files is defined %}
6
- ### Files
7
- {% for file in exploration.files %}
8
- - `{{ file.path }}` ({{ file.language | default("unknown") }}, {{ file.lines | default("?") }} lines){% if file.exports %} — {{ file.exports | length }} exports{% endif %}
9
- {% endfor %}
10
- {% endif %}
11
-
12
- {% if exploration.types is defined %}
13
- ### Types
14
- {% for t in exploration.types %}
15
- - `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
16
- {% endfor %}
17
- {% endif %}
18
-
19
- {% if exploration.dependencies is defined %}
20
- ### Dependencies
21
- {% for d in exploration.dependencies %}
22
- - `{{ d.from }}` → `{{ d.to }}` ({{ d.type | default("import") }})
23
- {% endfor %}
24
- {% endif %}
25
-
26
- {% if exploration.entryPoints is defined %}
27
- ### Entry Points
28
- {% for ep in exploration.entryPoints %}
29
- - `{{ ep }}`
30
- {% endfor %}
31
- {% endif %}
32
-
33
- ## Instructions
34
-
35
- From the analysis above and targeted code reads, produce an architecture block:
36
-
37
- 1. **Modules** — each cohesive unit with a clear responsibility. For each:
38
- - `name`: concise identifier (e.g., "block-api", "expression-engine")
39
- - `file`: primary file path relative to project root
40
- - `responsibility`: one-sentence description of what this module does
41
- - `dependencies`: array of other module names this module depends on
42
- - `lines`: approximate line count
43
-
44
- 2. **Patterns** — design patterns evidenced in the code. For each:
45
- - `name`: pattern name (e.g., "registry", "factory", "middleware")
46
- - `description`: how this pattern is applied in this codebase
47
- - `used_in`: array of module names that use this pattern
48
-
49
- 3. **Boundaries** — architectural seams where modules interact through defined interfaces (e.g., "block-api validates all writes before persistence", "dispatch spawns subprocesses through a single entry point")
50
-
51
- 4. **Overview** — one paragraph summarizing the architecture: what the system does, how it's organized, and what the key design decisions are
52
-
53
- Read entry points, config files, and module interfaces to confirm the exploration. Do not read every file.
54
-
55
- ## Required Output Schema
56
-
57
- You MUST produce JSON conforming exactly to this schema. Every required field must be present.
58
-
59
- ```json
60
- {{ output_schema }}
61
- ```
@@ -1,59 +0,0 @@
1
- Verify whether the following audit findings have been resolved.
2
-
3
- ## Audit Findings
4
-
5
- {% for finding in audit.findings %}
6
- ### Finding: {{ finding.id }}
7
-
8
- **Description**: {{ finding.description }}
9
- **Severity**: {{ finding.severity | default("unspecified") }}
10
- **Category**: {{ finding.category | default("unspecified") }}
11
- **Principle**: {{ finding.principle | default("unspecified") }}
12
-
13
- **Locations**:
14
- {% for loc in finding.locations %}
15
- - `{{ loc.file }}` {% if loc.line %}line {{ loc.line }}{% endif %} {% if loc.description %} — {{ loc.description }}{% endif %}
16
- {% endfor %}
17
-
18
- {% if finding.fix %}
19
- **Fix suggestion**: {{ finding.fix.suggestion | default("none") }}
20
- {% endif %}
21
-
22
- {% if finding.resolution and finding.resolution.status == 'passed' %}
23
- *Previously marked as resolved — re-verify.*
24
- {% endif %}
25
- ---
26
- {% endfor %}
27
-
28
- ## Implementation Results
29
-
30
- {% if implementation_results is iterable and implementation_results is not string %}
31
- {% for result in implementation_results %}
32
- - {{ result.spec_name | default(result.name | default("task")) }}: {{ result.status | default("unknown") }}
33
- {% endfor %}
34
- {% else %}
35
- ```json
36
- {{ implementation_results | dump(2) }}
37
- ```
38
- {% endif %}
39
-
40
- {% if conformance_reference %}
41
- ## Conformance Reference
42
-
43
- ```json
44
- {{ conformance_reference | dump(2) }}
45
- ```
46
- {% endif %}
47
-
48
- ## Instructions
49
-
50
- For EACH finding above:
51
-
52
- 1. Read the code at the referenced location(s)
53
- 2. Determine if the finding's described issue is addressed
54
- 3. Record your verdict: `passed`, `failed`, or `needs_inspect`
55
- 4. Provide specific evidence (code snippet, file:line reference)
56
-
57
- Do NOT use grep exit codes as evidence. Read the code and assess whether the issue described in the finding is genuinely resolved.
58
-
59
- Produce JSON output with a `findings` array containing one entry per finding, plus summary statistics.
@@ -1,67 +0,0 @@
1
- ## Audit Findings to Fix
2
-
3
- ### Principle: {{ task.principle }}
4
- ### Category: {{ task.category }}
5
- ### Severity: {{ task.severity }}
6
-
7
- ### Findings
8
-
9
- {% for finding in task.findings %}
10
- #### {{ finding.id }}: {{ finding.description }}
11
-
12
- {% for loc in finding.locations %}
13
- - `{{ loc.file }}` lines {{ loc.lines | join(', ') }}
14
- {% endfor %}
15
-
16
- {% if finding.fix %}
17
- **Fix**: {{ finding.fix.suggestion }}
18
- {% if finding.fix.verify_method == "grep" %}
19
- **Verify**: pattern `{{ finding.fix.verify_pattern }}` should NOT match after fix
20
- {% endif %}
21
- {% endif %}
22
-
23
- {% endfor %}
24
-
25
- ### Files to Modify
26
-
27
- {% for file in task.files %}
28
- - `{{ file }}`
29
- {% endfor %}
30
-
31
- ### Acceptance Criteria
32
-
33
- {% for criterion in task.acceptance_criteria %}
34
- - {{ criterion }}
35
- {% endfor %}
36
-
37
- {% if conformance_reference %}
38
- ### Conformance Reference
39
-
40
- {% for principle in conformance_reference.principles %}
41
- {% if principle.id == task.principle.split(':')[0] %}
42
- #### {{ principle.name }}
43
-
44
- {{ principle.description }}
45
-
46
- {% for rule in principle.rules %}
47
- - **{{ rule.id }}**: {{ rule.rule }}
48
- {% if rule.examples %}
49
- - Correct: `{{ rule.examples[0] }}`
50
- {% endif %}
51
- {% if rule.anti_patterns %}
52
- - Wrong: `{{ rule.anti_patterns[0] }}`
53
- {% endif %}
54
- {% endfor %}
55
- {% endif %}
56
- {% endfor %}
57
- {% endif %}
58
-
59
- ## Instructions
60
-
61
- 1. Read the files listed above to understand the current code
62
- 2. Fix each finding according to the fix suggestion
63
- 3. Ensure fixes follow the conformance reference principles
64
- 4. Run the test suite: `node --experimental-strip-types --test src/*.test.ts`
65
- 5. Fix any test failures caused by your changes
66
-
67
- Produce a JSON result conforming to the execution-results schema.
@@ -1,37 +0,0 @@
1
- Review the audit fix results and produce a routing manifest.
2
-
3
- ## Implementation Results
4
-
5
- {% if implementation_results is iterable and implementation_results is not string %}
6
- {% for result in implementation_results %}
7
- ### Task: {{ result.spec_name | default(result.name | default("unnamed")) }}
8
-
9
- - Status: {{ result.status | default("unknown") }}
10
- {% if result.decisions %}
11
- - Decisions: {{ result.decisions | length }}
12
- {% endif %}
13
- {% if result.issues %}
14
- - Issues flagged: {{ result.issues | length }}
15
- {% endif %}
16
- {% endfor %}
17
- {% else %}
18
- ```json
19
- {{ implementation_results | dump(2) }}
20
- ```
21
- {% endif %}
22
-
23
- ## Verification Results
24
-
25
- ```json
26
- {{ verification | dump(2) }}
27
- ```
28
-
29
- ## Instructions
30
-
31
- Produce a routing manifest with:
32
-
33
- 1. **decisions** — validated decisions from implementation results (with complete id, description, rationale fields)
34
- 2. **new_issues** — genuine issues that should be tracked (with stable id, description, status: "open", category, priority)
35
- 3. **summary** — accurate summary of what was completed, what failed, what needs inspection
36
-
37
- Only include items that are well-formed and represent genuine project artifacts. Do not route items that are missing required fields or describe hypothetical concerns.
@@ -1,56 +0,0 @@
1
- ## Decomposition Request
2
-
3
- **Gap:** {{ gap.id }} — {{ gap.description }}
4
-
5
- ## Investigation Findings
6
-
7
- **Complexity:** {{ investigation.complexity }}
8
- **Summary:** {{ investigation.summary }}
9
-
10
- ### Affected Files
11
- {% for f in investigation.affected_files %}
12
- - `{{ f.path }}` — {{ f.role }}: {{ f.current_behavior }}
13
- {% endfor %}
14
-
15
- ### Constraints
16
- {% for c in investigation.constraints %}
17
- - {{ c }}
18
- {% endfor %}
19
-
20
- ### Risks
21
- {% for r in investigation.risks %}
22
- - {{ r }}
23
- {% endfor %}
24
-
25
- {% if research %}
26
- ## Research Findings
27
-
28
- ### Patterns
29
- {% for p in research.patterns %}
30
- - **{{ p.name }}**: {{ p.description }} — {{ p.applicability }}
31
- {% endfor %}
32
-
33
- ### Recommendations
34
- {% for r in research.recommendations %}
35
- - {{ r }}
36
- {% endfor %}
37
- {% endif %}
38
-
39
- ## Instructions
40
-
41
- Decompose this gap into implementation specs. Each spec is a unit of work for a single implementing agent.
42
-
43
- 1. Break the work into the smallest meaningful units
44
- 2. Declare file targets for each spec
45
- 3. Set `depends_on` for specs that must be sequential (shared files, interface dependencies)
46
- 4. Mark `parallel_safe` for specs that can run concurrently
47
- 5. Write acceptance criteria that are verifiable (grep patterns, test commands, not "it works")
48
- 6. Estimate complexity per spec
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
- ```
@@ -1,3 +0,0 @@
1
- You are a code explorer. Given a path, produce a comprehensive structural overview as JSON.
2
-
3
- Include files with their sizes, exports, imports, and line counts. Identify types, interfaces, and key functions. Map dependencies between files.
@@ -1,9 +0,0 @@
1
- Explore the code at `{{ path }}`.
2
-
3
- Produce a JSON object with:
4
- - `files`: array of { path, type, language, lines, exports, imports }
5
- - `types`: array of { name, file, line, kind, definition }
6
- - `dependencies`: array of { from, to, type }
7
- - `entryPoints`: array of file paths that serve as entry points
8
-
9
- Write your findings as valid JSON.
@@ -1,103 +0,0 @@
1
- Identify gaps in the project at `{{ path }}`.
2
-
3
- ## Architecture
4
-
5
- {% if architecture.overview %}
6
- {{ architecture.overview }}
7
- {% endif %}
8
-
9
- ### Modules
10
- {% if architecture.modules is defined %}
11
- {% for m in architecture.modules %}
12
- - **{{ m.name }}** (`{{ m.file }}`{% if m.lines %}, {{ m.lines }} lines{% endif %}): {{ m.responsibility }}
13
- {% endfor %}
14
- {% endif %}
15
-
16
- {% if architecture.patterns is defined %}
17
- ### Patterns
18
- {% for p in architecture.patterns %}
19
- - **{{ p.name }}**: {{ p.description }}{% if p.used_in %} — used in: {{ p.used_in | join(", ") }}{% endif %}
20
- {% endfor %}
21
- {% endif %}
22
-
23
- {% if architecture.boundaries is defined %}
24
- ### Boundaries
25
- {% for b in architecture.boundaries %}
26
- - {{ b }}
27
- {% endfor %}
28
- {% endif %}
29
-
30
- ## Codebase Analysis
31
-
32
- {% if exploration.files is defined %}
33
- ### Files ({{ exploration.files | length }} total)
34
- {% for file in exploration.files %}
35
- - `{{ file.path }}` ({{ file.language | default("unknown") }}, {{ file.lines | default("?") }} lines){% if file.exports %} — {{ file.exports | length }} exports{% endif %}
36
- {% endfor %}
37
- {% endif %}
38
-
39
- {% if exploration.types is defined %}
40
- ### Types
41
- {% for t in exploration.types %}
42
- - `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
43
- {% endfor %}
44
- {% endif %}
45
-
46
- ## Instructions
47
-
48
- Cross-reference the architecture and analysis to identify gaps. Use targeted reads to verify findings.
49
-
50
- ### Gap categories to check
51
-
52
- 1. **missing** — functionality that should exist based on architecture but doesn't
53
- - Test files for source modules (find test files, compare against source)
54
- - Error handling for public APIs
55
- - Documentation for exported interfaces
56
- - Schema validation for user-facing inputs
57
-
58
- 2. **incomplete** — partially implemented functionality
59
- - TODO/FIXME/HACK comments (`grep -r "TODO\|FIXME\|HACK"`)
60
- - Stub or placeholder implementations
61
- - Functions that return hardcoded values or throw "not implemented"
62
-
63
- 3. **defect** — likely bugs or incorrect behavior
64
- - Uncaught promise rejections, missing null checks
65
- - Type assertions that bypass safety (`as any`, `!` operator overuse)
66
- - Error paths that swallow exceptions silently
67
-
68
- 4. **technical-debt** — code that works but hampers maintenance
69
- - Duplicated logic across modules
70
- - Outdated patterns inconsistent with the rest of the codebase
71
- - Overly complex functions (high cyclomatic complexity)
72
-
73
- 5. **improvement** — opportunities to improve existing working code
74
- - Performance bottlenecks
75
- - Missing caching or memoization for expensive operations
76
- - Public APIs that could be more ergonomic
77
-
78
- 6. **question** — ambiguities requiring human or further investigation
79
- - Unclear design decisions without documented rationale
80
- - Behavior that could be intentional or accidental
81
-
82
- ### Gap ID format
83
-
84
- Use the pattern: `gap-{abbrev}-{nnn}` where abbrev is:
85
- - `miss` for missing, `inc` for incomplete, `def` for defect
86
- - `debt` for technical-debt, `imp` for improvement, `q` for question
87
-
88
- ### Priority calibration
89
-
90
- - **critical**: blocks further development or causes data loss
91
- - **high**: significant impact on reliability, correctness, or developer experience
92
- - **medium**: notable but workable; should be addressed in normal development
93
- - **low**: minor cleanup or cosmetic; address opportunistically
94
-
95
- Set `source` to `"agent"` for all gaps. Set `status` to `"open"` for all gaps.
96
-
97
- ## Required Output Schema
98
-
99
- You MUST produce JSON conforming exactly to this schema. Every required field must be present.
100
-
101
- ```json
102
- {{ output_schema }}
103
- ```
@@ -1,48 +0,0 @@
1
- Assess whether the implementation resolves this gap.
2
-
3
- ## Gap
4
-
5
- **ID**: {{ gap.id }}
6
- **Description**: {{ gap.description }}
7
- **Category**: {{ gap.category | default("unspecified") }}
8
- **Priority**: {{ gap.priority | default("unspecified") }}
9
-
10
- ## Investigation Findings
11
-
12
- ```json
13
- {{ investigation | dump(2) }}
14
- ```
15
-
16
- ## Implementation Results
17
-
18
- {% if implementation_results is iterable and implementation_results is not string %}
19
- {% for result in implementation_results %}
20
- ### Spec: {{ result.spec_name | default("unnamed") }}
21
- - Status: {{ result.status | default("unknown") }}
22
- - Files changed: {{ result.files_changed | default([]) | join(", ") }}
23
- {% if result.commit_hash %}- Commit: {{ result.commit_hash }}{% endif %}
24
- {% endfor %}
25
- {% else %}
26
- ```json
27
- {{ implementation_results | dump(2) }}
28
- ```
29
- {% endif %}
30
-
31
- ## Check Results
32
-
33
- - Status: {{ check_results.status }}
34
- {% if check_results.errors | length > 0 %}
35
- - Errors:
36
- {% for err in check_results.errors %}
37
- - {{ err }}
38
- {% endfor %}
39
- {% endif %}
40
-
41
- ## Instructions
42
-
43
- 1. Read the gap description above. Understand what root cause it identifies.
44
- 2. Examine the implementation results — what files were changed and what was the stated work.
45
- 3. Run `git diff HEAD~{{ implementation_results | length | default(1) }}` (or appropriate range) to see actual code changes.
46
- 4. Judge: do the code changes address the root cause described in the gap?
47
- 5. If tests failed or lint errors exist, the gap is NOT resolved regardless of code quality.
48
- 6. Produce your assessment as JSON.