arey-pi 0.2.0 → 0.4.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.
@@ -0,0 +1,292 @@
1
+ # Using pi-subagents with Arey Pi
2
+
3
+ Arey Pi is designed to work well with `pi-subagents`.
4
+
5
+ `pi-subagents` gives the parent Pi session focused child agents for scouting,
6
+ planning,
7
+ implementation,
8
+ review,
9
+ and advisory second opinions.
10
+ Arey Pi adds an opinionated delivery framework around specs,
11
+ TDD,
12
+ quality,
13
+ and synchronisation.
14
+
15
+ ## Install
16
+
17
+ Install both packages in the project:
18
+
19
+ ```bash
20
+ pi install -l npm:arey-pi
21
+ pi install -l npm:pi-subagents
22
+ ```
23
+
24
+ Optional:
25
+
26
+ ```bash
27
+ pi install -l npm:pi-intercom
28
+ ```
29
+
30
+ `pi-intercom` is useful when background child agents may need to ask the parent for a blocking decision instead of guessing.
31
+ It is not required for normal use.
32
+
33
+ Reload Pi after installation:
34
+
35
+ ```txt
36
+ /reload
37
+ ```
38
+
39
+ Then check setup:
40
+
41
+ ```txt
42
+ /arey-doctor
43
+ /subagents-doctor
44
+ ```
45
+
46
+ ## Bootstrap
47
+
48
+ Run:
49
+
50
+ ```txt
51
+ /arey-bootstrap
52
+ ```
53
+
54
+ This installs Arey Pi's project-local subagent definitions into:
55
+
56
+ ```txt
57
+ .pi/agents/arey-pi/
58
+ ```
59
+
60
+ The runtime names include the package prefix:
61
+
62
+ ```txt
63
+ arey-pi.tech-lead
64
+ arey-pi.spec-author
65
+ arey-pi.tdd-implementer
66
+ arey-pi.spec-syncer
67
+ arey-pi.engineering-reviewer
68
+ arey-pi.project-evaluator
69
+ ```
70
+
71
+ ## Parent Owns Orchestration
72
+
73
+ The parent Pi session should own orchestration.
74
+
75
+ Child agents should receive concrete,
76
+ bounded tasks.
77
+ They should not create their own subagent workflows unless explicitly launched with the `subagent` tool for a bounded fanout task.
78
+
79
+ Good parent request:
80
+
81
+ ```txt
82
+ Implement password reset following Arey Pi.
83
+ Use specialist subagents where useful.
84
+ ```
85
+
86
+ Good child handoff:
87
+
88
+ ```txt
89
+ Use arey-pi.tdd-implementer to implement the accepted password-reset scenarios.
90
+ Write tests under tests/,
91
+ not beside production files.
92
+ Report Red-Green-Refactor evidence and validation commands.
93
+ ```
94
+
95
+ Poor child handoff:
96
+
97
+ ```txt
98
+ Figure out everything and use more subagents if needed.
99
+ ```
100
+
101
+ ## Recommended Arey Pi Orchestration
102
+
103
+ For meaningful feature work:
104
+
105
+ ```txt
106
+ clarify → spec-author → tdd-implementer → fresh reviewers → sync/fix → finalise
107
+ ```
108
+
109
+ For risky decisions:
110
+
111
+ ```txt
112
+ oracle → parent decision → worker or Arey Pi implementer
113
+ ```
114
+
115
+ For hard codebase discovery:
116
+
117
+ ```txt
118
+ scout/context-builder → planner → Arey Pi implementation workflow
119
+ ```
120
+
121
+ For review loops:
122
+
123
+ ```txt
124
+ worker → fresh reviewers → parent synthesis → single fix worker
125
+ ```
126
+
127
+ Keep one writer in the active worktree at a time.
128
+ Use parallel agents for read-only scouting,
129
+ planning,
130
+ and review.
131
+
132
+ ## Context Choices
133
+
134
+ Use fresh context for independent review:
135
+
136
+ ```txt
137
+ fresh reviewers for correctness,
138
+ tests,
139
+ and simplicity
140
+ ```
141
+
142
+ Fresh reviewers are less likely to inherit the parent agent's assumptions.
143
+
144
+ Use forked context for decision review where conversation history matters:
145
+
146
+ ```txt
147
+ oracle reviewing current plan and assumptions
148
+ ```
149
+
150
+ Forked context is useful when the child should understand prior reasoning,
151
+ but it is not a substitute for a focused task prompt.
152
+
153
+ ## Builtin Agents and Arey Pi Agents
154
+
155
+ Use builtin `pi-subagents` agents for generic support:
156
+
157
+ - `scout` for local codebase reconnaissance;
158
+ - `context-builder` for implementation handoff context;
159
+ - `planner` for implementation plans;
160
+ - `worker` for generic approved implementation;
161
+ - `reviewer` for generic review and small fixes;
162
+ - `oracle` for second opinions and decision challenges;
163
+ - `researcher` for external evidence when web access is available.
164
+
165
+ Use Arey Pi agents for framework-specific delivery:
166
+
167
+ - `arey-pi.spec-author` for Gherkin,
168
+ DBML,
169
+ ADR,
170
+ and glossary impact;
171
+ - `arey-pi.tdd-implementer` for strict Red-Green-Refactor;
172
+ - `arey-pi.spec-syncer` for spec and documentation sync;
173
+ - `arey-pi.engineering-reviewer` for Arey Pi quality review;
174
+ - `arey-pi.project-evaluator` for readiness audits.
175
+
176
+ ## Prompting Pattern
177
+
178
+ A strong subagent task should include:
179
+
180
+ - goal;
181
+ - relevant files,
182
+ diffs,
183
+ specs,
184
+ plans,
185
+ or decisions;
186
+ - success criteria;
187
+ - hard constraints;
188
+ - validation expectations;
189
+ - expected output format;
190
+ - stop rules.
191
+
192
+ Example:
193
+
194
+ ```txt
195
+ Review the current diff as arey-pi.engineering-reviewer.
196
+ Focus on correctness,
197
+ test quality and location,
198
+ simplicity,
199
+ security,
200
+ and documentation sync.
201
+ Do not modify files.
202
+ Return blocking findings first with file references.
203
+ ```
204
+
205
+ ## Async and Background Work
206
+
207
+ Use background subagents for long-running implementation,
208
+ large reviews,
209
+ or broad audits.
210
+
211
+ If the parent has no useful independent work while a background child runs,
212
+ end the turn and wait for completion rather than polling repeatedly.
213
+
214
+ Use status checks when needed:
215
+
216
+ ```txt
217
+ Show active async runs.
218
+ ```
219
+
220
+ or:
221
+
222
+ ```txt
223
+ /subagents-doctor
224
+ ```
225
+
226
+ ## Model Overrides
227
+
228
+ Builtin `pi-subagents` agents inherit the current Pi default model.
229
+ For normal tweaks,
230
+ prefer `subagents.agentOverrides` in settings rather than copying builtin agents.
231
+
232
+ Project-local example:
233
+
234
+ ```json
235
+ {
236
+ "subagents": {
237
+ "agentOverrides": {
238
+ "reviewer": {
239
+ "thinking": "high",
240
+ "fallbackModels": ["openai/gpt-5-mini"]
241
+ }
242
+ }
243
+ }
244
+ }
245
+ ```
246
+
247
+ Use `.pi/settings.json` for project overrides.
248
+ Use `~/.pi/agent/settings.json` for user-wide overrides.
249
+
250
+ ## Recommended Natural Language Requests
251
+
252
+ ```txt
253
+ Ask oracle to challenge this plan before we edit.
254
+ ```
255
+
256
+ ```txt
257
+ Use scout to map the auth flow,
258
+ then ask me the clarification questions that matter.
259
+ ```
260
+
261
+ ```txt
262
+ Run parallel reviewers on this diff:
263
+ one for correctness,
264
+ one for tests,
265
+ and one for unnecessary complexity.
266
+ ```
267
+
268
+ ```txt
269
+ Have a worker implement this approved plan,
270
+ then run fresh reviewers and apply only fixes worth doing now.
271
+ ```
272
+
273
+ ```txt
274
+ Run a review loop on this change with a max of 3 rounds.
275
+ ```
276
+
277
+ ## Arey Pi Completion Rule
278
+
279
+ Subagents can contribute evidence,
280
+ but the parent session finalises.
281
+
282
+ The final response should still include:
283
+
284
+ ```txt
285
+ - Specs:
286
+ - Tests/TDD, including test location:
287
+ - Validation:
288
+ - Spec sync:
289
+ - Documentation sync:
290
+ - Quality review:
291
+ - Residual risks:
292
+ ```
@@ -0,0 +1,146 @@
1
+ # Arey Pi Templates
2
+
3
+ Arey Pi ships starter templates used by `/arey-bootstrap`.
4
+
5
+ Templates are intentionally useful but generic.
6
+ They should be edited after bootstrap to reflect the real project.
7
+
8
+ ## Template List
9
+
10
+ ```txt
11
+ templates/AGENTS.md
12
+ templates/adr.md
13
+ templates/feature.feature
14
+ templates/database.dbml
15
+ templates/glossary.md
16
+ templates/project-readiness-report.md
17
+ templates/specs-readme.md
18
+ templates/features-readme.md
19
+ templates/database-readme.md
20
+ templates/architecture-readme.md
21
+ templates/decisions-readme.md
22
+ templates/docs-readme.md
23
+ ```
24
+
25
+ ## Bootstrap Targets
26
+
27
+ `/arey-bootstrap` maps templates to project files:
28
+
29
+ ```txt
30
+ templates/AGENTS.md → AGENTS.md
31
+ templates/specs-readme.md → specs/README.md
32
+ templates/features-readme.md → specs/features/README.md
33
+ templates/feature.feature → specs/features/example.feature
34
+ templates/database-readme.md → specs/database/README.md
35
+ templates/database.dbml → specs/database/schema.dbml
36
+ templates/architecture-readme.md → specs/architecture/README.md
37
+ templates/decisions-readme.md → specs/decisions/README.md
38
+ templates/adr.md → specs/decisions/0001-record-architecture-decision.md
39
+ templates/glossary.md → specs/glossary.md
40
+ templates/docs-readme.md → docs/README.md
41
+ templates/project-readiness-report.md → docs/project-readiness-report.md
42
+ ```
43
+
44
+ Existing files are not overwritten unless `--force` is used.
45
+
46
+ ## `AGENTS.md`
47
+
48
+ The `AGENTS.md` template provides project-level AI harness instructions.
49
+
50
+ After bootstrap,
51
+ replace placeholders with real project commands:
52
+
53
+ - dependency installation;
54
+ - formatting;
55
+ - lint/static analysis;
56
+ - typecheck;
57
+ - tests;
58
+ - full validation;
59
+ - database validation when applicable.
60
+
61
+ Add local architecture,
62
+ safety,
63
+ and operational constraints.
64
+
65
+ Use nested `AGENTS.md` files for subtrees that need local instructions.
66
+
67
+ ## `feature.feature`
68
+
69
+ The Gherkin template includes:
70
+
71
+ - tags;
72
+ - a feature description;
73
+ - actor/outcome framing;
74
+ - a rule section;
75
+ - background context;
76
+ - happy path;
77
+ - scenario outline for validation or boundary cases;
78
+ - regression scenario.
79
+
80
+ Delete sections that are not useful for the real behaviour.
81
+ Do not keep placeholder scenarios as fake coverage.
82
+
83
+ ## `database.dbml`
84
+
85
+ The DBML template demonstrates:
86
+
87
+ - project metadata;
88
+ - enum modelling;
89
+ - primary keys;
90
+ - unique constraints;
91
+ - indexes;
92
+ - foreign-key relationships;
93
+ - JSON payload notes;
94
+ - table notes.
95
+
96
+ Replace the example schema with the canonical project schema.
97
+ Do not leave example tables in a real project unless they are clearly marked as placeholders and not used as canonical truth.
98
+
99
+ ## `adr.md`
100
+
101
+ The ADR template is decision-focused.
102
+
103
+ Use it for significant technical decisions,
104
+ not routine implementation details.
105
+
106
+ A good ADR should include:
107
+
108
+ - status;
109
+ - date;
110
+ - context;
111
+ - decision drivers;
112
+ - options considered;
113
+ - the chosen decision;
114
+ - consequences;
115
+ - validation;
116
+ - supersession and relationship metadata;
117
+ - revisit conditions.
118
+
119
+ ## `glossary.md`
120
+
121
+ The glossary template is for durable domain language.
122
+
123
+ Add terms when names or meanings matter to behaviour,
124
+ specs,
125
+ architecture,
126
+ or user-facing concepts.
127
+
128
+ Do not use it as a dumping ground for obvious technical vocabulary.
129
+
130
+ ## `project-readiness-report.md`
131
+
132
+ The readiness report template captures Arey Pi assessment output.
133
+
134
+ Use it when you want a persistent audit snapshot under `docs/`.
135
+ For routine checks,
136
+ `/arey-assess` can report directly in the session.
137
+
138
+ ## Template Maintenance
139
+
140
+ When templates change,
141
+ update:
142
+
143
+ - `docs/templates.md`;
144
+ - `docs/commands.md` if bootstrap behaviour changes;
145
+ - `README.md` if user-facing package behaviour changes;
146
+ - extension tests if scaffold targets change.
@@ -0,0 +1,92 @@
1
+ # Arey Pi Workflow Diagram
2
+
3
+ This diagram shows the intended Arey Pi delivery workflow.
4
+
5
+ The parent Pi session owns orchestration.
6
+ Specialist subagents contribute bounded evidence,
7
+ but the parent decides when to continue,
8
+ ask the user,
9
+ repair,
10
+ or finalise.
11
+
12
+ ```mermaid
13
+ graph TD
14
+ A["User request"] --> B["Parent acts as Arey Pi tech lead"]
15
+ B --> C{"Classify change mode"}
16
+
17
+ C -->|"Assessment"| EVAL["Project evaluator"]
18
+ EVAL --> EVALREPORT["Readiness report and improvement plan"]
19
+
20
+ C -->|"Bootstrap"| BOOT["arey-bootstrap"]
21
+ BOOT --> HARNESS["AGENTS.md, specs, docs, templates, project agents"]
22
+ HARNESS --> DOCTOR["arey-doctor and subagents-doctor"]
23
+
24
+ C -->|"Direct change"| DIRECT{"Specs, tests, docs unaffected?"}
25
+ DIRECT -->|"No or unclear"| SPEC
26
+ DIRECT -->|"Yes, justified"| IMPL
27
+
28
+ C -->|"Feature, bugfix, rebuild, risky change"| CONTEXT{"Enough context?"}
29
+ CONTEXT -->|"No"| RECON["Scout, context-builder, or planner"]
30
+ RECON --> SPEC["Spec author"]
31
+ CONTEXT -->|"Yes"| SPEC
32
+
33
+ SPEC --> SPECCHECK{"Canonical intent clear?"}
34
+ SPECCHECK -->|"No"| ASK["Ask user or resolve conflict"]
35
+ ASK --> SPEC
36
+ SPECCHECK -->|"Yes"| IMPL["TDD implementer"]
37
+
38
+ IMPL --> RED["Red: failing behaviour or regression test"]
39
+ RED --> GREEN["Green: minimal high-quality implementation"]
40
+ GREEN --> REFACTOR["Refactor while tests stay green"]
41
+ REFACTOR --> VALIDATE["Run validation and quality tooling"]
42
+
43
+ VALIDATE --> SYNC["Spec syncer"]
44
+ SYNC --> SYNCCHECK{"Specs and docs aligned?"}
45
+ SYNCCHECK -->|"No"| REPAIR["Repair sync gaps"]
46
+ REPAIR --> VALIDATE
47
+ SYNCCHECK -->|"Yes"| REVIEWGATE{"Risk warrants review?"}
48
+
49
+ REVIEWGATE -->|"Yes"| REVIEW["Fresh reviewers or engineering reviewer"]
50
+ REVIEW --> FINDINGS{"Blocking findings?"}
51
+ FINDINGS -->|"Yes"| FIX["Single writer applies accepted fixes"]
52
+ FIX --> VALIDATE
53
+ FINDINGS -->|"No"| DONE
54
+
55
+ REVIEWGATE -->|"No"| DONE["Parent finalises"]
56
+
57
+ DONE --> REPORT["Done summary with specs, TDD, validation, sync, quality, commits, and risks"]
58
+
59
+ ORACLE["Oracle second opinion"] -.-> B
60
+ ```
61
+
62
+ ## Safety Rules
63
+
64
+ - The parent session owns orchestration.
65
+ - Use fresh reviewers for independent adversarial review.
66
+ - Use `oracle` when the decision itself is risky.
67
+ - Use `scout`,
68
+ `context-builder`,
69
+ or `planner` before large changes when context is weak.
70
+ - Keep one writer in the active worktree at a time.
71
+ - Parallel subagents are best for read-only review,
72
+ planning,
73
+ scouting,
74
+ and audits.
75
+ - Chains are best for repeatable sequential workflows where one step's output feeds the next.
76
+
77
+ ## Required Completion Evidence
78
+
79
+ ```txt
80
+ Done summary:
81
+ - Behaviour/spec impact:
82
+ - Tests/TDD, including test location:
83
+ - Validation:
84
+ - Quality tooling:
85
+ - Spec sync:
86
+ - Documentation sync:
87
+ - Architecture/code quality:
88
+ - Architecture/ADR/glossary:
89
+ - Database/DBML:
90
+ - Commits:
91
+ - Residual risks:
92
+ ```