@davidorex/pi-workflows 0.11.3 → 0.12.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.
@@ -82,6 +82,141 @@ Subcommands: `init`, `list`, `run`, `resume`, `validate`, `status`, `help`
82
82
  See references/bundled-resources.md for full inventory.
83
83
  </bundled_resources>
84
84
 
85
+ <agent_vocabulary>
86
+
87
+ | Agent | Role | Tools | Input (required) | Output | Context Blocks |
88
+ |-------|------|-------|------------------|--------|----------------|
89
+ | `architecture-designer` | reasoning | read | — | json | — |
90
+ | `architecture-inferrer` | sensor | read, bash, grep, find | analysis, path | json | — |
91
+ | `audit-finding-verifier` | quality | read, bash, grep, find | — | json | — |
92
+ | `audit-fixer` | action | read, write, edit, bash, grep, find | — | json | — |
93
+ | `audit-results-router` | reasoning | read | — | json | — |
94
+ | `code-explorer` | sensor | read, bash, ls | — | json | — |
95
+ | `decomposer` | decomposer | — | — | json | — |
96
+ | `gap-identifier` | sensor | read, bash, grep, find | analysis, architecture, path | json | — |
97
+ | `gap-resolution-assessor` | quality | read, bash, grep, find | — | json | — |
98
+ | `handoff-writer` | reasoning | read | project_state, path | json | — |
99
+ | `investigator` | investigator | read, bash, grep, find | — | json | — |
100
+ | `pattern-analyzer` | sensor | read, bash, ls | exploration, path | json | — |
101
+ | `phase-author` | reasoning | read, bash, grep, find | — | json | — |
102
+ | `plan-creator` | reasoning | read, bash, grep, find | — | json | — |
103
+ | `plan-decomposer` | reasoning | read, bash, grep, find | — | json | — |
104
+ | `project-definer` | reasoning | read | — | json | — |
105
+ | `project-inferrer` | sensor | read, bash, grep, find | analysis, path | json | — |
106
+ | `quality-analyzer` | sensor | read, bash, ls | exploration, path | json | — |
107
+ | `requirements-gatherer` | reasoning | read | — | json | — |
108
+ | `researcher` | researcher | — | — | json | — |
109
+ | `spec-implementer` | action | read, write, edit, bash, grep, find | — | json | — |
110
+ | `structure-analyzer` | sensor | read, bash, ls | exploration, path | json | — |
111
+ | `synthesizer` | reasoning | read | structure, quality, patterns | json | — |
112
+ | `task-verifier` | quality | read, bash, glob, grep | task_id, acceptance_criteria, changes | json | — |
113
+ | `task-worker` | action | read, write, edit, bash, grep, glob, ls | task | json | — |
114
+ | `verifier` | quality | read, bash, grep, find | — | json | — |
115
+
116
+ **Agent Input Schemas:**
117
+
118
+ <agent_input name="architecture-inferrer">
119
+ - `analysis` [required] — Prior codebase analysis output (structure, patterns, dependencies)
120
+ - `path` string [required] — Root path of the project being analyzed
121
+ </agent_input>
122
+
123
+ <agent_input name="gap-identifier">
124
+ - `analysis` [required] — Prior codebase analysis output (structure, patterns, dependencies)
125
+ - `architecture` [required] — Architecture block (modules, patterns, boundaries)
126
+ - `path` string [required] — Root path of the project being analyzed
127
+ </agent_input>
128
+
129
+ <agent_input name="handoff-writer">
130
+ - `project_state` [required] — Current project state (from projectState() or /project status — includes phases, blocks, gaps, decisions, recent commits)
131
+ - `path` string [required] — Root path of the project
132
+ </agent_input>
133
+
134
+ <agent_input name="pattern-analyzer">
135
+ - `exploration` [required] — Prior exploration output (typed JSON)
136
+ - `path` string [required]
137
+ </agent_input>
138
+
139
+ <agent_input name="project-inferrer">
140
+ - `analysis` [required] — Prior codebase analysis output (structure, patterns, dependencies)
141
+ - `path` string [required] — Root path of the project being analyzed
142
+ </agent_input>
143
+
144
+ <agent_input name="quality-analyzer">
145
+ - `exploration` [required] — Prior exploration output (typed JSON)
146
+ - `path` string [required]
147
+ </agent_input>
148
+
149
+ <agent_input name="structure-analyzer">
150
+ - `exploration` [required] — Prior exploration output (typed JSON)
151
+ - `path` string [required]
152
+ </agent_input>
153
+
154
+ <agent_input name="synthesizer">
155
+ - `structure` [required] — Structure analysis (typed JSON)
156
+ - `quality` [required] — Quality analysis (typed JSON)
157
+ - `patterns` [required] — Pattern analysis (typed JSON)
158
+ </agent_input>
159
+
160
+ <agent_input name="task-verifier">
161
+ - `task_id` string [required] — ID of the task being verified
162
+ - `acceptance_criteria` array [required] — Acceptance criteria from the task block
163
+ - `changes` [required] — Implementation summary or diff from the worker agent
164
+ </agent_input>
165
+
166
+ <agent_input name="task-worker">
167
+ - `task` object [required] — Task block entry with description, acceptance_criteria, files
168
+ - `context` string [optional] — Narrative context from prior steps
169
+ </agent_input>
170
+
171
+ **Template References:**
172
+
173
+ - `architecture-designer`: task: `architecture-designer/task.md`
174
+ - `architecture-inferrer`: task: `architecture-inferrer/task.md`
175
+ - `audit-finding-verifier`: task: `audit-finding-verifier/task.md`
176
+ - `audit-fixer`: task: `audit-fixer/task.md`
177
+ - `audit-results-router`: task: `audit-results-router/task.md`
178
+ - `code-explorer`: system: `explorer/system.md`, task: `explorer/task.md`
179
+ - `decomposer`: task: `decomposer/task.md`
180
+ - `gap-identifier`: task: `gap-identifier/task.md`
181
+ - `gap-resolution-assessor`: task: `gap-resolution-assessor/task.md`
182
+ - `handoff-writer`: task: `handoff-writer/task.md`
183
+ - `investigator`: task: `investigator/task.md`
184
+ - `pattern-analyzer`: system: `analyzers/patterns.md`, task: `analyzers/patterns-task.md`
185
+ - `phase-author`: task: `templates/phase-author/task.md`
186
+ - `plan-creator`: task: `plan-creator/task.md`
187
+ - `plan-decomposer`: task: `plan-decomposer/task.md`
188
+ - `project-definer`: task: `project-definer/task.md`
189
+ - `project-inferrer`: task: `project-inferrer/task.md`
190
+ - `quality-analyzer`: system: `analyzers/quality.md`, task: `analyzers/quality-task.md`
191
+ - `requirements-gatherer`: task: `requirements-gatherer/task.md`
192
+ - `researcher`: task: `researcher/task.md`
193
+ - `spec-implementer`: task: `spec-implementer/task.md`
194
+ - `structure-analyzer`: system: `analyzers/structure.md`, task: `analyzers/structure-task.md`
195
+ - `synthesizer`: system: `synthesizer/system.md`, task: `synthesizer/task.md`
196
+ - `task-verifier`: task: `task-verifier/task.md`
197
+ - `task-worker`: task: `task-worker/task.md`
198
+ - `verifier`: task: `verifier/task.md`
199
+
200
+ </agent_vocabulary>
201
+
202
+ <validation_vocabulary>
203
+
204
+ | Check | Severity | Description |
205
+ |-------|----------|-------------|
206
+ | `agent-resolution` | error | Referenced agents exist in search paths |
207
+ | `monitor-resolution` | warning | Referenced monitors exist in search paths |
208
+ | `schema-existence` | error | Referenced schema files exist on disk |
209
+ | `step-references` | error | Expression step references point to declared steps |
210
+ | `step-ordering` | error | Steps do not forward-reference later steps |
211
+ | `context-references` | error | context[] entries point to declared steps |
212
+ | `filter-names` | warning | Expression filters are recognized |
213
+ | `steptype-metadata` | error | retry/input/output declarations match step type capabilities |
214
+ | `inputschema-required` | error | Agent required input keys are provided by step |
215
+ | `contextblocks-existence` | warning | Declared context blocks exist in .project/ |
216
+ | `template-alignment` | error | Template variables match step inputs and source schemas |
217
+
218
+ </validation_vocabulary>
219
+
85
220
  <objective>
86
221
  pi-workflows orchestrates multi-step agent workflows defined in YAML. Workflows are DAGs of typed steps with data flow via `${{ }}` expressions.
87
222
  </objective>
@@ -68,7 +68,6 @@
68
68
  ## templates/ (33 files)
69
69
 
70
70
  - `templates/analyzers/base-analyzer.md`
71
- - `templates/analyzers/macros.md`
72
71
  - `templates/analyzers/patterns-task.md`
73
72
  - `templates/analyzers/patterns.md`
74
73
  - `templates/analyzers/quality-task.md`
@@ -94,6 +93,7 @@
94
93
  - `templates/project-inferrer/task.md`
95
94
  - `templates/requirements-gatherer/task.md`
96
95
  - `templates/researcher/task.md`
96
+ - `templates/shared/macros.md`
97
97
  - `templates/spec-implementer/task.md`
98
98
  - `templates/synthesizer/system.md`
99
99
  - `templates/synthesizer/task.md`
@@ -0,0 +1,152 @@
1
+ {#- Block rendering macros — one per schema with agent prompt use cases.
2
+ Import via: {% from "shared/macros.md" import render_project, render_architecture %}
3
+ Each macro: null guard, markdown heading, field rendering. Missing data renders nothing. -#}
4
+
5
+ {% macro render_project(data) %}
6
+ {% if data %}
7
+ ## Project
8
+ **{{ data.name }}** — {{ data.description }}
9
+ {% if data.core_value %}Core value: {{ data.core_value }}{% endif %}
10
+ {% if data.vision %}
11
+ Vision: {{ data.vision }}{% endif %}
12
+ {% if data.status %}Status: {{ data.status }}{% endif %}
13
+ {% if data.target_users %}
14
+ Target users: {{ data.target_users | join(", ") }}{% endif %}
15
+ {% if data.constraints %}
16
+ ### Constraints
17
+ {% for c in data.constraints %}- [{{ c.type }}] {{ c.description }}
18
+ {% endfor %}{% endif %}
19
+ {% if data.scope_boundaries %}
20
+ ### Scope
21
+ **In:** {% for s in data.scope_boundaries.in %}{{ s }}{% if not loop.last %}, {% endif %}{% endfor %}
22
+
23
+ **Out:** {% for s in data.scope_boundaries.out %}{{ s }}{% if not loop.last %}, {% endif %}{% endfor %}
24
+ {% endif %}
25
+ {% if data.goals %}
26
+ ### Goals
27
+ {% for g in data.goals %}- **{{ g.id }}**: {{ g.description }}{% if g.success_criteria %} — criteria: {{ g.success_criteria | join("; ") }}{% endif %}
28
+ {% endfor %}{% endif %}
29
+ {% endif %}
30
+ {% endmacro %}
31
+
32
+ {% macro render_architecture(data) %}
33
+ {% if data %}
34
+ ## Architecture
35
+ {% if data.overview %}{{ data.overview }}
36
+ {% endif %}
37
+ {% if data.modules %}
38
+ ### Modules
39
+ {% for m in data.modules %}- **{{ m.name }}** (`{{ m.file }}`{% if m.lines %}, {{ m.lines }} lines{% endif %}): {{ m.responsibility }}{% if m.dependencies %} — deps: {{ m.dependencies | join(", ") }}{% endif %}
40
+ {% endfor %}{% endif %}
41
+ {% if data.patterns %}
42
+ ### Patterns
43
+ {% for p in data.patterns %}- **{{ p.name }}**: {{ p.description }}{% if p.used_in %} — used in: {{ p.used_in | join(", ") }}{% endif %}
44
+ {% endfor %}{% endif %}
45
+ {% if data.boundaries %}
46
+ ### Boundaries
47
+ {% for b in data.boundaries %}- {{ b }}
48
+ {% endfor %}{% endif %}
49
+ {% endif %}
50
+ {% endmacro %}
51
+
52
+ {% macro render_requirements(data) %}
53
+ {% if data and data.requirements and data.requirements | length > 0 %}
54
+ ## Requirements
55
+ {% for r in data.requirements %}- **{{ r.id }}** [{{ r.priority }}] ({{ r.type }}, {{ r.status }}): {{ r.description }}{% if r.acceptance_criteria %}
56
+ Criteria: {{ r.acceptance_criteria | join("; ") }}{% endif %}
57
+ {% endfor %}
58
+ {% endif %}
59
+ {% endmacro %}
60
+
61
+ {% macro render_conformance(data) %}
62
+ {% if data and data.principles %}
63
+ ## Conformance Reference
64
+ {% if data.name %}**{{ data.name }}**{% endif %}
65
+ {% for p in data.principles %}
66
+ ### {{ p.id }}: {{ p.name }}
67
+ {% if p.description %}{{ p.description }}{% endif %}
68
+ {% for r in p.rules %}- **{{ r.id }}**: {{ r.rule }}{% if r.severity %} [{{ r.severity }}]{% endif %}{% if r.check_method %} — check: {{ r.check_method }}{% endif %}
69
+ {% if r.anti_patterns %} Anti-patterns: {{ r.anti_patterns | join("; ") }}
70
+ {% endif %}{% endfor %}
71
+ {% endfor %}
72
+ {% endif %}
73
+ {% endmacro %}
74
+
75
+ {% macro render_domain(data) %}
76
+ {% if data and data.entries %}
77
+ ## Domain Knowledge
78
+ {% for e in data.entries %}- **{{ e.id }}** [{{ e.category }}]: {{ e.title }}
79
+ {{ e.content }}{% if e.tags %} — tags: {{ e.tags | join(", ") }}{% endif %}
80
+ {% endfor %}
81
+ {% endif %}
82
+ {% endmacro %}
83
+
84
+ {% macro render_decisions(data) %}
85
+ {% if data and data.decisions %}
86
+ ## Decisions
87
+ {% for d in data.decisions %}- **{{ d.id }}** ({{ d.status }}): {{ d.decision }}
88
+ Rationale: {{ d.rationale }}{% if d.context %} — context: {{ d.context }}{% endif %}
89
+ {% endfor %}
90
+ {% endif %}
91
+ {% endmacro %}
92
+
93
+ {% macro render_tasks(data) %}
94
+ {% if data and data.tasks %}
95
+ ## Tasks
96
+ {% for t in data.tasks %}- **{{ t.id }}** [{{ t.status }}]: {{ t.description }}{% if t.phase %} (phase {{ t.phase }}){% endif %}{% if t.files %} — files: {{ t.files | join(", ") }}{% endif %}
97
+ {% endfor %}
98
+ {% endif %}
99
+ {% endmacro %}
100
+
101
+ {% macro render_issues(data) %}
102
+ {% if data and data.issues %}
103
+ ## Issues
104
+ {% for i in data.issues %}- **{{ i.id }}** [{{ i.priority }}, {{ i.status }}]: {{ i.title }}
105
+ {{ i.body }}{% if i.location %} — {{ i.location }}{% endif %}{% if i.package %} ({{ i.package }}){% endif %}
106
+ {% endfor %}
107
+ {% endif %}
108
+ {% endmacro %}
109
+
110
+ {% macro render_exploration(exploration) %}
111
+ {% if exploration %}
112
+ {% if exploration.files is defined %}
113
+ ## Prior Exploration
114
+ {% for file in exploration.files %}- `{{ file.path }}` ({{ file.lines | default("?") }} lines){% if file.exports %}: {{ file.exports | length }} exports{% endif %}
115
+ {% endfor %}{% endif %}
116
+ {% if exploration.types is defined %}
117
+ ### Known Types
118
+ {% for t in exploration.types %}- `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
119
+ {% endfor %}{% endif %}
120
+ {% endif %}
121
+ {% endmacro %}
122
+
123
+ {% macro render_exploration_full(exploration) %}
124
+ {% if exploration %}
125
+ {% if exploration.files is defined %}
126
+ ### Files{% if exploration.files | length > 20 %} ({{ exploration.files | length }} total){% endif %}
127
+ {% for file in exploration.files %}- `{{ file.path }}` ({{ file.language | default("unknown") }}, {{ file.lines | default("?") }} lines){% if file.exports %} — {{ file.exports | length }} exports{% endif %}
128
+ {% endfor %}{% endif %}
129
+ {% if exploration.types is defined %}
130
+ ### Types
131
+ {% for t in exploration.types %}- `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
132
+ {% endfor %}{% endif %}
133
+ {% if exploration.dependencies is defined %}
134
+ ### Dependencies
135
+ {% for d in exploration.dependencies %}- `{{ d.from }}` → `{{ d.to }}` ({{ d.type | default("import") }})
136
+ {% endfor %}{% endif %}
137
+ {% if exploration.entryPoints is defined %}
138
+ ### Entry Points
139
+ {% for ep in exploration.entryPoints %}- `{{ ep }}`
140
+ {% endfor %}{% endif %}
141
+ {% endif %}
142
+ {% endmacro %}
143
+
144
+ {% macro render_gap(gap) %}
145
+ {% if gap %}
146
+ **ID:** {{ gap.id }}
147
+ **Description:** {{ gap.description }}
148
+ **Category:** {{ gap.category | default("unspecified") }}
149
+ **Priority:** {{ gap.priority | default("unspecified") }}
150
+ {% if gap.details %}**Details:** {{ gap.details }}{% endif %}
151
+ {% endif %}
152
+ {% endmacro %}
@@ -1 +0,0 @@
1
- {% macro cite_instruction(level) %}{% if level == "files" %}Be specific — cite files and directories.{% elif level == "lines" %}Be specific — cite files and line ranges.{% else %}Be specific — cite examples.{% endif %}{% endmacro %}