arey-pi 0.3.0 → 0.5.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.
package/README.md CHANGED
@@ -50,6 +50,12 @@ The rules are the policy layer.
50
50
  The skills and prompts make those policies usable inside Pi.
51
51
  The agents define the intended specialist roles for subagent-backed delivery.
52
52
 
53
+ Arey Pi includes focused prompt templates and skills for feature specs,
54
+ strict Red-Green-Refactor,
55
+ spec drift repair,
56
+ ADR assessment,
57
+ and adversarial engineering review.
58
+
53
59
  ## Current subagent architecture
54
60
 
55
61
  Arey Pi is designed to work with `pi-subagents`.
@@ -143,7 +149,14 @@ Arey Pi includes a polished extension-backed workflow:
143
149
  The goal is that users can either speak naturally or use explicit commands,
144
150
  while Arey Pi handles the disciplined workflow behind the scenes.
145
151
 
146
- See `docs/commands.md` for detailed command behaviour, options, and examples.
152
+ See:
153
+
154
+ - `docs/commands.md` for detailed command behaviour, options, and examples;
155
+ - `docs/adoption.md` for adopting Arey Pi in an existing repository;
156
+ - `docs/workflows.md` for workflow expectations;
157
+ - `docs/workflow-diagram.md` for the visual framework workflow;
158
+ - `docs/pi-subagents.md` for optimised `pi-subagents` usage;
159
+ - `docs/templates.md` for bootstrap template details.
147
160
 
148
161
  ## Development
149
162
 
@@ -184,6 +197,12 @@ documentation sync rule,
184
197
  core subagent role definitions,
185
198
  and professional extension commands exist.
186
199
 
187
- Next milestones include richer templates,
200
+ Arey Pi now includes stronger workflow command contracts,
201
+ focused prompts,
202
+ TDD/spec-sync/review skills,
203
+ and extension-core tests.
204
+
205
+ Next improvements include guided interactive workflows,
188
206
  stronger bootstrap scaffolding,
189
- and deeper integration with `pi-subagents` discovery.
207
+ custom Arey Pi tools,
208
+ and deeper enforcement through Pi extension events.
package/agents/README.md CHANGED
@@ -5,6 +5,29 @@ Arey Pi uses subagents to turn Arey Pi rules into repeatable delivery workflows.
5
5
  Subagents are not independent product owners.
6
6
  They are specialised engineering roles with bounded responsibilities, explicit handoffs, and shared commitment to canonical specs, TDD, quality, and rebuildability.
7
7
 
8
+ ## Relationship to pi-subagents
9
+
10
+ Arey Pi assumes the parent Pi session owns orchestration.
11
+
12
+ Specialist children should receive concrete,
13
+ bounded tasks and return evidence-backed handoffs.
14
+ They should not launch their own subagent workflows unless explicitly assigned a bounded fanout job with the `subagent` tool.
15
+
16
+ Use Arey Pi agents for framework-specific delivery.
17
+ Use builtin `pi-subagents` agents for generic support:
18
+
19
+ - `scout` for local codebase reconnaissance;
20
+ - `context-builder` for planning handoff context;
21
+ - `planner` for implementation plans;
22
+ - `worker` for approved generic implementation;
23
+ - `reviewer` for fresh independent review;
24
+ - `oracle` for second opinions and risky decisions;
25
+ - `researcher` for external evidence when web access is available.
26
+
27
+ Prefer fresh-context reviewers for adversarial review.
28
+ Use forked context for `oracle` when the parent conversation history matters.
29
+ Keep one writer in the active worktree at a time.
30
+
8
31
  ## Core Principles
9
32
 
10
33
  ### Specs remain canonical
@@ -179,14 +202,20 @@ Does not own:
179
202
  For meaningful feature or bug-fix work, use this sequence:
180
203
 
181
204
  ```txt
182
- 1. tech-lead classifies change mode and scope
183
- 2. spec-author writes or confirms canonical specs
184
- 3. tdd-implementer performs Red → Green → Refactor
185
- 4. spec-syncer verifies specs/tests/code and documentation alignment
186
- 5. engineering-reviewer performs adversarial review
187
- 6. tech-lead finalises evidence, risks, and commits
205
+ 1. parent tech lead classifies change mode and scope
206
+ 2. arey-pi.spec-author writes or confirms canonical specs
207
+ 3. arey-pi.tdd-implementer performs Red → Green → Refactor
208
+ 4. arey-pi.spec-syncer verifies specs/tests/code and documentation alignment
209
+ 5. fresh reviewers perform adversarial review when risk warrants it
210
+ 6. parent tech lead synthesises findings and finalises evidence, risks, and commits
188
211
  ```
189
212
 
213
+ For broad or risky work,
214
+ use builtin `scout`,
215
+ `context-builder`,
216
+ `planner`,
217
+ or `oracle` before the Arey Pi delivery sequence.
218
+
190
219
  Small direct changes may skip specialised agents only when the tech lead can explicitly justify that specs, tests, architecture, DBML, ADRs, and documentation are unaffected.
191
220
 
192
221
  ## Handoff Contracts
@@ -13,7 +13,10 @@ defaultReads: AGENTS.md, agents/README.md, rules/README.md, rules/core/principle
13
13
  You are the Arey Pi tech lead.
14
14
  Your job is to orchestrate high-quality software delivery under Arey Pi rules.
15
15
 
16
- You preserve scope, choose the correct change mode, coordinate specialist agents, and ensure final evidence satisfies Definition of Done.
16
+ You preserve scope, choose the correct change mode, coordinate specialist work, and ensure final evidence satisfies Definition of Done.
17
+
18
+ In normal Arey Pi use, the parent Pi session acts as the tech lead and calls specialist subagents.
19
+ If this `arey-pi.tech-lead` agent is itself launched as a child, produce an orchestration plan and evidence checklist; do not attempt nested delegation unless the parent explicitly gave you the `subagent` tool for a bounded fanout task.
17
20
 
18
21
  ## Operating principles
19
22
 
@@ -30,7 +33,7 @@ Own:
30
33
 
31
34
  - classifying work as Spec-Driven Mode, Direct Change Mode, Rebuild Mode, Bootstrap Mode, or Assessment Mode;
32
35
  - decomposing work into spec, TDD, implementation, sync, review, and finalisation phases;
33
- - deciding when to use `spec-author`, `tdd-implementer`, `spec-syncer`, `engineering-reviewer`, or `project-evaluator`;
36
+ - deciding when the parent should use `arey-pi.spec-author`, `arey-pi.tdd-implementer`, `arey-pi.spec-syncer`, `arey-pi.engineering-reviewer`, `arey-pi.project-evaluator`, or builtin `pi-subagents` roles such as `scout`, `planner`, `worker`, `reviewer`, and `oracle`;
34
37
  - making handoffs explicit and evidence-backed;
35
38
  - resolving conflicts only when the canonical source is clear;
36
39
  - asking the user when product intent or policy is ambiguous;
@@ -62,15 +65,20 @@ Small direct changes may skip specialist agents only when you can explicitly jus
62
65
 
63
66
  ## Delegation guidance
64
67
 
65
- Use `spec-author` when specs are missing, behaviour changes, DBML might change, ADRs may be warranted, or domain language changes.
68
+ Use `arey-pi.spec-author` when specs are missing, behaviour changes, DBML might change, ADRs may be warranted, or domain language changes.
69
+
70
+ Use `arey-pi.tdd-implementer` when accepted specs or bug reports need implementation through Red-Green-Refactor.
66
71
 
67
- Use `tdd-implementer` when accepted specs or bug reports need implementation through Red-Green-Refactor.
72
+ Use `arey-pi.spec-syncer` near completion or whenever drift is suspected.
68
73
 
69
- Use `spec-syncer` near completion or whenever drift is suspected.
74
+ Use `arey-pi.engineering-reviewer` for material implementation, generated code, high-risk tests, architecture concerns, security/privacy/operability risk, or missing quality-tooling evidence.
70
75
 
71
- Use `engineering-reviewer` for material implementation, generated code, high-risk tests, architecture concerns, security/privacy/operability risk, or missing quality-tooling evidence.
76
+ Use `arey-pi.project-evaluator` for read-only repository readiness assessment.
72
77
 
73
- Use `project-evaluator` for read-only repository readiness assessment.
78
+ Use builtin `scout`, `context-builder`, or `planner` before large changes when more context or planning is needed.
79
+ Use builtin `oracle` for risky decisions and second opinions.
80
+ Use fresh-context `reviewer` agents for independent adversarial review.
81
+ Keep one writer in the active worktree at a time.
74
82
 
75
83
  ## Final response format
76
84
 
Binary file
@@ -0,0 +1,218 @@
1
+ # Adopting Arey Pi
2
+
3
+ This guide explains how to introduce Arey Pi into an existing repository.
4
+
5
+ Arey Pi adoption should be incremental.
6
+ Do not rewrite a project just to satisfy the framework.
7
+ Start by making project intent,
8
+ validation,
9
+ and agent instructions discoverable.
10
+
11
+ ## Recommended Adoption Path
12
+
13
+ ### 1. Install the package
14
+
15
+ Install Arey Pi in the project:
16
+
17
+ ```bash
18
+ pi install -l npm:arey-pi
19
+ ```
20
+
21
+ For subagent-backed workflows,
22
+ install `pi-subagents` too:
23
+
24
+ ```bash
25
+ pi install -l npm:pi-subagents
26
+ ```
27
+
28
+ Optionally install `pi-intercom` when background subagents may need to ask the parent for blocking decisions:
29
+
30
+ ```bash
31
+ pi install -l npm:pi-intercom
32
+ ```
33
+
34
+ Reload Pi after installation:
35
+
36
+ ```txt
37
+ /reload
38
+ ```
39
+
40
+ ### 2. Run doctor
41
+
42
+ Check what Pi can discover:
43
+
44
+ ```txt
45
+ /arey-doctor
46
+ /subagents-doctor
47
+ ```
48
+
49
+ Use these before and after bootstrap.
50
+
51
+ ### 3. Bootstrap safely
52
+
53
+ Run:
54
+
55
+ ```txt
56
+ /arey-bootstrap
57
+ ```
58
+
59
+ With no flags,
60
+ this creates a safe starter harness where files do not already exist:
61
+
62
+ ```txt
63
+ .pi/agents/arey-pi/
64
+ AGENTS.md
65
+ specs/
66
+ docs/
67
+ ```
68
+
69
+ It does not overwrite existing files unless `--force` is used.
70
+
71
+ ### 4. Fill project-specific commands
72
+
73
+ Edit `AGENTS.md` and replace command placeholders with real project commands.
74
+
75
+ At minimum,
76
+ agents should be able to discover:
77
+
78
+ - dependency installation;
79
+ - formatter;
80
+ - lint/static analysis;
81
+ - typecheck;
82
+ - tests;
83
+ - full validation command;
84
+ - database validation or migration checks when applicable.
85
+
86
+ ### 5. Assess readiness
87
+
88
+ Run:
89
+
90
+ ```txt
91
+ /arey-assess
92
+ ```
93
+
94
+ or:
95
+
96
+ ```txt
97
+ /assess-project
98
+ ```
99
+
100
+ Treat the report as a prioritised improvement plan,
101
+ not as a reason to stop work.
102
+
103
+ ### 6. Adopt specs incrementally
104
+
105
+ Start with high-value behaviour:
106
+
107
+ - risky workflows;
108
+ - customer-visible behaviour;
109
+ - bug-prone areas;
110
+ - persistence boundaries;
111
+ - permissions and security-sensitive logic;
112
+ - APIs and CLI contracts.
113
+
114
+ Use Gherkin for behaviour specs.
115
+ Use DBML for database specs when the project has persistence.
116
+
117
+ ### 7. Keep tests outside source trees
118
+
119
+ Prefer dedicated test roots:
120
+
121
+ ```txt
122
+ tests/
123
+ test/
124
+ __tests__/
125
+ spec/
126
+ ```
127
+
128
+ Mirror production module structure inside the test root where useful.
129
+
130
+ Example:
131
+
132
+ ```txt
133
+ src/domain/accounts/password-reset.ts
134
+ tests/domain/accounts/password-reset.test.ts
135
+ ```
136
+
137
+ Do not colocate new tests inside `src/` unless the project or framework requires it.
138
+
139
+ ## Adoption Modes
140
+
141
+ ### Light adoption
142
+
143
+ Use this for small projects or early evaluation.
144
+
145
+ - Install Arey Pi.
146
+ - Run `/arey-bootstrap`.
147
+ - Fill `AGENTS.md` commands.
148
+ - Add specs only for new or risky changes.
149
+
150
+ ### Standard adoption
151
+
152
+ Use this for active product repositories.
153
+
154
+ - Complete light adoption.
155
+ - Add Gherkin specs for core behaviours.
156
+ - Add DBML if persistence exists.
157
+ - Add ADRs for significant decisions.
158
+ - Require `/arey-sync` before completing non-trivial work.
159
+
160
+ ### Strict adoption
161
+
162
+ Use this for high-risk or agent-heavy projects.
163
+
164
+ - Complete standard adoption.
165
+ - Require TDD evidence for every production behaviour change.
166
+ - Require separate test directories.
167
+ - Require readiness assessment follow-ups.
168
+ - Use engineering review for significant changes.
169
+ - Consider coverage and mutation testing for critical behaviour.
170
+
171
+ ## Subagent Adoption Notes
172
+
173
+ See `docs/pi-subagents.md` for deeper guidance.
174
+
175
+ In short:
176
+
177
+ - keep orchestration in the parent Pi session;
178
+ - use Arey Pi agents for framework-specific delivery;
179
+ - use builtin `scout`,
180
+ `planner`,
181
+ `worker`,
182
+ `reviewer`,
183
+ `oracle`,
184
+ `context-builder`,
185
+ and `researcher` for generic support;
186
+ - prefer fresh reviewers for independent review;
187
+ - use `oracle` when the decision itself is risky;
188
+ - keep one writer in the active worktree at a time;
189
+ - use `.pi/settings.json` `subagents.agentOverrides` for model/thinking tweaks instead of copying builtin agents.
190
+
191
+ ## What Not To Do
192
+
193
+ Do not:
194
+
195
+ - create low-value ADRs for trivial choices;
196
+ - generate broad specs that nobody will maintain;
197
+ - move all tests or docs in a single unrelated change;
198
+ - accept shallow generated tests as proof of quality;
199
+ - overwrite existing project conventions without review;
200
+ - treat bootstrap as a substitute for project-specific instructions.
201
+
202
+ ## Completion Standard
203
+
204
+ After adoption work,
205
+ run:
206
+
207
+ ```txt
208
+ /arey-doctor
209
+ /arey-assess
210
+ ```
211
+
212
+ A good first adoption result is not perfection.
213
+ It is a repository where humans and agents can discover how to work safely,
214
+ validate changes,
215
+ and keep specs,
216
+ docs,
217
+ tests,
218
+ and code aligned.
package/docs/commands.md CHANGED
@@ -181,13 +181,16 @@ The expected workflow is:
181
181
  spec-author → tdd-implementer → spec-syncer → engineering-reviewer
182
182
  ```
183
183
 
184
+ The command now sends a stronger execution contract.
184
185
  The workflow should:
185
186
 
186
- - confirm or update canonical specs;
187
+ - identify scope, non-goals, risk, and unknowns;
188
+ - confirm or update canonical specs before production behaviour changes;
187
189
  - preserve TDD through Red → Green → Refactor;
188
- - synchronise specs, docs, tests, code, DBML, ADRs, glossary, and architecture docs;
189
- - run engineering review when risk warrants it;
190
- - report validation evidence and residual risks.
190
+ - keep tests outside production source directories by default;
191
+ - synchronise specs, docs, tests, code, DBML, ADRs, glossary, README files, AGENTS.md, skills, prompts, rules, agents, commands, templates, and tooling instructions when affected;
192
+ - run fresh-context engineering review when risk warrants it;
193
+ - report validation evidence and residual risks using the Arey Pi final evidence format.
191
194
 
192
195
  ## `/arey-bugfix`
193
196
 
@@ -205,12 +208,15 @@ Example:
205
208
  /arey-bugfix Users can bypass email verification by refreshing the session
206
209
  ```
207
210
 
211
+ The command now sends a regression-test-first execution contract.
208
212
  The workflow should:
209
213
 
210
- - reproduce the bug with a failing regression test;
214
+ - identify expected versus actual behaviour and affected scope;
215
+ - reproduce the bug with a meaningful failing regression test before production changes;
211
216
  - implement the smallest high-quality fix;
212
- - keep TDD evidence visible;
217
+ - keep Red → Green → Refactor evidence visible;
213
218
  - update Gherkin, docs, DBML, ADRs, glossary, or architecture docs when affected;
219
+ - request fresh engineering review for security, data-loss, concurrency, auth, payment, migration, or public API bugs;
214
220
  - run validation and report residual risks.
215
221
 
216
222
  ## `/arey-sync`
@@ -247,6 +253,12 @@ The command asks the parent agent to verify alignment across:
247
253
  - skills, prompts, rules, agents, examples, templates;
248
254
  - command and tooling instructions.
249
255
 
256
+ The sync contract asks the agent to classify drift as blocking,
257
+ recommended,
258
+ or unaffected.
259
+ It may fix safe drift directly when canonical intent is clear,
260
+ but it must ask before changing intent.
261
+
250
262
  The final report should include both:
251
263
 
252
264
  ```txt
@@ -329,6 +341,32 @@ and propose a prioritised improvement plan.
329
341
 
330
342
  Use this when adopting Arey Pi in an existing repository or checking whether a project remains aligned.
331
343
 
344
+ ## Prompt templates and skills
345
+
346
+ Arey Pi also ships focused prompt templates:
347
+
348
+ ```txt
349
+ /feature-spec
350
+ /red-green-refactor
351
+ /sync-drift
352
+ /engineering-review
353
+ /adr-review
354
+ /assess-project
355
+ ```
356
+
357
+ And focused skills:
358
+
359
+ ```txt
360
+ /skill:tdd-red-green-refactor
361
+ /skill:spec-sync
362
+ /skill:engineering-review
363
+ /skill:project-readiness
364
+ ```
365
+
366
+ Use slash commands for full workflow orchestration,
367
+ prompts for targeted one-off work,
368
+ and skills when you want the model to load specialised Arey Pi instructions on demand.
369
+
332
370
  ## Busy agent behaviour
333
371
 
334
372
  Workflow commands send a user message to the current Pi session.