arey-pi 0.1.0 → 0.3.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,354 @@
1
+ # Arey Pi Commands
2
+
3
+ Arey Pi ships a Pi extension that registers native slash commands.
4
+ The extension uses Pi's documented directory style at `extensions/arey-pi/index.ts`.
5
+
6
+ The commands are designed for two modes of use:
7
+
8
+ - quick explicit workflows such as `/arey-feature` or `/arey-sync`;
9
+ - natural-language work where the parent agent acts as the Arey Pi tech lead and uses the same workflow expectations.
10
+
11
+ ## Command overview
12
+
13
+ ```txt
14
+ /arey-doctor
15
+ /arey-bootstrap [--agentsmd] [--specs] [--docs] [--full] [--force]
16
+ /arey-feature <feature request>
17
+ /arey-bugfix <bug description>
18
+ /arey-sync [scope]
19
+ /arey-review [scope]
20
+ /arey-assess [scope]
21
+ ```
22
+
23
+ ## `/arey-doctor`
24
+
25
+ Checks whether Arey Pi is available and whether the current project is ready for subagent-backed workflows.
26
+
27
+ It reports:
28
+
29
+ - Arey Pi package version;
30
+ - current project path;
31
+ - whether packaged rules are present;
32
+ - whether packaged templates are present;
33
+ - whether packaged agents are present;
34
+ - whether `pi-subagents` appears to be installed;
35
+ - whether project-local Arey Pi agents exist in `.pi/agents/arey-pi/`;
36
+ - whether root `AGENTS.md` exists;
37
+ - whether `.pi/settings.json` exists;
38
+ - how many Arey Pi prompts and skills are discovered;
39
+ - missing project-local agent files;
40
+ - recommended next step.
41
+
42
+ Usage:
43
+
44
+ ```txt
45
+ /arey-doctor
46
+ ```
47
+
48
+ Use this after installing Arey Pi,
49
+ after running `/arey-bootstrap`,
50
+ or when subagent workflows are not behaving as expected.
51
+
52
+ ## `/arey-bootstrap`
53
+
54
+ Installs Arey Pi's packaged subagent definitions into the current project and performs a safe starter scaffold.
55
+
56
+ With no flags, `/arey-bootstrap` runs the full bootstrap path:
57
+
58
+ ```txt
59
+ --agentsmd --specs --docs
60
+ ```
61
+
62
+ Default agent target:
63
+
64
+ ```txt
65
+ .pi/agents/arey-pi/
66
+ ```
67
+
68
+ By default, existing project-local agent files and scaffold files are not overwritten.
69
+ Starter scaffold files are copied from the packaged `templates/` directory.
70
+ Selective flags are available when you only want one part of the scaffold.
71
+
72
+ Usage:
73
+
74
+ ```txt
75
+ /arey-bootstrap
76
+ ```
77
+
78
+ This creates or installs, where missing:
79
+
80
+ ```txt
81
+ .pi/agents/arey-pi/
82
+ AGENTS.md
83
+ specs/README.md
84
+ specs/features/README.md
85
+ specs/features/example.feature
86
+ specs/database/README.md
87
+ specs/database/schema.dbml
88
+ specs/architecture/README.md
89
+ specs/decisions/README.md
90
+ specs/decisions/0001-record-architecture-decision.md
91
+ specs/glossary.md
92
+ docs/README.md
93
+ docs/project-readiness-report.md
94
+ ```
95
+
96
+ Options:
97
+
98
+ ```txt
99
+ /arey-bootstrap --agentsmd
100
+ ```
101
+
102
+ Also creates a starter root `AGENTS.md` when one does not already exist.
103
+
104
+ ```txt
105
+ /arey-bootstrap --specs
106
+ ```
107
+
108
+ Creates starter Arey Pi spec structure when files do not already exist:
109
+
110
+ ```txt
111
+ specs/README.md
112
+ specs/features/README.md
113
+ specs/features/example.feature
114
+ specs/database/README.md
115
+ specs/database/schema.dbml
116
+ specs/architecture/README.md
117
+ specs/decisions/README.md
118
+ specs/decisions/0001-record-architecture-decision.md
119
+ specs/glossary.md
120
+ ```
121
+
122
+ ```txt
123
+ /arey-bootstrap --docs
124
+ ```
125
+
126
+ Creates starter project documentation structure when files do not already exist:
127
+
128
+ ```txt
129
+ docs/README.md
130
+ docs/project-readiness-report.md
131
+ ```
132
+
133
+ ```txt
134
+ /arey-bootstrap --full
135
+ ```
136
+
137
+ Explicitly runs the same combined bootstrap path as `/arey-bootstrap` with no flags:
138
+
139
+ ```txt
140
+ --agentsmd --specs --docs
141
+ ```
142
+
143
+ ```txt
144
+ /arey-bootstrap --force
145
+ ```
146
+
147
+ Overwrites existing project-local Arey Pi agent files and scaffold files selected by the other flags.
148
+ When used alone, it applies to the default full bootstrap path.
149
+ It also creates a starter `AGENTS.md` when one does not already exist.
150
+
151
+ Examples:
152
+
153
+ ```txt
154
+ /arey-bootstrap --specs --docs
155
+ /arey-bootstrap --full
156
+ /arey-bootstrap --full --force
157
+ ```
158
+
159
+ Use this command after installing Arey Pi and `pi-subagents` in a repository where you want the Arey Pi agents to be discoverable by `pi-subagents`.
160
+
161
+ ## `/arey-feature`
162
+
163
+ Starts the Arey Pi feature delivery workflow.
164
+
165
+ Usage:
166
+
167
+ ```txt
168
+ /arey-feature <feature request>
169
+ ```
170
+
171
+ Example:
172
+
173
+ ```txt
174
+ /arey-feature Add password reset with expiring email links
175
+ ```
176
+
177
+ The command sends a structured request to the parent agent to act as the Arey Pi tech lead.
178
+ The expected workflow is:
179
+
180
+ ```txt
181
+ spec-author → tdd-implementer → spec-syncer → engineering-reviewer
182
+ ```
183
+
184
+ The workflow should:
185
+
186
+ - confirm or update canonical specs;
187
+ - 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.
191
+
192
+ ## `/arey-bugfix`
193
+
194
+ Starts the Arey Pi regression-test-first bugfix workflow.
195
+
196
+ Usage:
197
+
198
+ ```txt
199
+ /arey-bugfix <bug description>
200
+ ```
201
+
202
+ Example:
203
+
204
+ ```txt
205
+ /arey-bugfix Users can bypass email verification by refreshing the session
206
+ ```
207
+
208
+ The workflow should:
209
+
210
+ - reproduce the bug with a failing regression test;
211
+ - implement the smallest high-quality fix;
212
+ - keep TDD evidence visible;
213
+ - update Gherkin, docs, DBML, ADRs, glossary, or architecture docs when affected;
214
+ - run validation and report residual risks.
215
+
216
+ ## `/arey-sync`
217
+
218
+ Runs Arey Pi sync review for the current repository or a specific scope.
219
+
220
+ Usage:
221
+
222
+ ```txt
223
+ /arey-sync
224
+ /arey-sync <scope>
225
+ ```
226
+
227
+ Examples:
228
+
229
+ ```txt
230
+ /arey-sync
231
+ /arey-sync authentication flow
232
+ /arey-sync current diff
233
+ ```
234
+
235
+ The command asks the parent agent to verify alignment across:
236
+
237
+ - Gherkin specs;
238
+ - tests;
239
+ - code;
240
+ - DBML;
241
+ - ADRs;
242
+ - glossary;
243
+ - architecture docs;
244
+ - README files;
245
+ - `docs/`;
246
+ - `AGENTS.md`;
247
+ - skills, prompts, rules, agents, examples, templates;
248
+ - command and tooling instructions.
249
+
250
+ The final report should include both:
251
+
252
+ ```txt
253
+ Specs updated
254
+ ```
255
+
256
+ or:
257
+
258
+ ```txt
259
+ Specs unaffected: <reason>
260
+ ```
261
+
262
+ and:
263
+
264
+ ```txt
265
+ Docs updated
266
+ ```
267
+
268
+ or:
269
+
270
+ ```txt
271
+ Docs unaffected: <reason>
272
+ ```
273
+
274
+ ## `/arey-review`
275
+
276
+ Runs an adversarial Arey Pi engineering review.
277
+
278
+ Usage:
279
+
280
+ ```txt
281
+ /arey-review
282
+ /arey-review <scope>
283
+ ```
284
+
285
+ Examples:
286
+
287
+ ```txt
288
+ /arey-review
289
+ /arey-review current diff
290
+ /arey-review persistence layer
291
+ ```
292
+
293
+ The review should examine:
294
+
295
+ - architecture and code quality;
296
+ - test quality;
297
+ - quality tooling and validation evidence;
298
+ - security and privacy;
299
+ - reliability and operability;
300
+ - maintainability;
301
+ - spec, ADR, DBML, glossary, and documentation sync concerns;
302
+ - generated-code or agent-authored-code slop.
303
+
304
+ Findings should be classified by severity.
305
+
306
+ ## `/arey-assess`
307
+
308
+ Runs Arey Pi project readiness assessment.
309
+
310
+ Usage:
311
+
312
+ ```txt
313
+ /arey-assess
314
+ /arey-assess <scope>
315
+ ```
316
+
317
+ Examples:
318
+
319
+ ```txt
320
+ /arey-assess
321
+ /arey-assess backend package only
322
+ ```
323
+
324
+ The assessment is read-only by default.
325
+ It should score the repository against Arey Pi rules,
326
+ provide evidence with file paths,
327
+ identify blockers and quick wins,
328
+ and propose a prioritised improvement plan.
329
+
330
+ Use this when adopting Arey Pi in an existing repository or checking whether a project remains aligned.
331
+
332
+ ## Busy agent behaviour
333
+
334
+ Workflow commands send a user message to the current Pi session.
335
+
336
+ If the agent is idle,
337
+ the workflow starts immediately.
338
+
339
+ If the agent is already working,
340
+ the workflow is queued as a follow-up message.
341
+
342
+ ## Relationship to natural language
343
+
344
+ Commands are optional.
345
+
346
+ Users can also work naturally:
347
+
348
+ ```txt
349
+ Implement magic links following Arey Pi.
350
+ ```
351
+
352
+ The commands exist to make common workflows explicit,
353
+ repeatable,
354
+ and easier to discover.
@@ -0,0 +1,121 @@
1
+ export const requiredAgents = [
2
+ "tech-lead.md",
3
+ "spec-author.md",
4
+ "tdd-implementer.md",
5
+ "spec-syncer.md",
6
+ "engineering-reviewer.md",
7
+ "project-evaluator.md",
8
+ ] as const;
9
+
10
+ export type ScaffoldFile = { template: string; target: string };
11
+
12
+ export const specScaffoldFiles: ScaffoldFile[] = [
13
+ { template: "specs-readme.md", target: "specs/README.md" },
14
+ { template: "features-readme.md", target: "specs/features/README.md" },
15
+ { template: "feature.feature", target: "specs/features/example.feature" },
16
+ { template: "database-readme.md", target: "specs/database/README.md" },
17
+ { template: "database.dbml", target: "specs/database/schema.dbml" },
18
+ { template: "architecture-readme.md", target: "specs/architecture/README.md" },
19
+ { template: "decisions-readme.md", target: "specs/decisions/README.md" },
20
+ { template: "adr.md", target: "specs/decisions/0001-record-architecture-decision.md" },
21
+ { template: "glossary.md", target: "specs/glossary.md" },
22
+ ];
23
+
24
+ export const docsScaffoldFiles: ScaffoldFile[] = [
25
+ { template: "docs-readme.md", target: "docs/README.md" },
26
+ { template: "project-readiness-report.md", target: "docs/project-readiness-report.md" },
27
+ ];
28
+
29
+ const selectiveBootstrapFlags = ["--agentsmd", "--specs", "--docs", "--full"];
30
+
31
+ export type BootstrapPlan = {
32
+ flags: string[];
33
+ force: boolean;
34
+ full: boolean;
35
+ defaultFullBootstrap: boolean;
36
+ createAgentsMd: boolean;
37
+ createSpecs: boolean;
38
+ createDocs: boolean;
39
+ };
40
+
41
+ export function parseBootstrapFlags(args: string): BootstrapPlan {
42
+ const flags = args.split(/\s+/).filter(Boolean);
43
+ const force = flags.includes("--force");
44
+ const full = flags.includes("--full");
45
+ const hasSelectiveScaffoldFlag = flags.some((flag) => selectiveBootstrapFlags.includes(flag));
46
+ const defaultFullBootstrap = !hasSelectiveScaffoldFlag;
47
+
48
+ return {
49
+ flags,
50
+ force,
51
+ full,
52
+ defaultFullBootstrap,
53
+ createAgentsMd: defaultFullBootstrap || flags.includes("--agentsmd") || full,
54
+ createSpecs: defaultFullBootstrap || flags.includes("--specs") || full,
55
+ createDocs: defaultFullBootstrap || flags.includes("--docs") || full,
56
+ };
57
+ }
58
+
59
+ export type WorkflowKind = "feature" | "bugfix" | "sync" | "review" | "assess" | string;
60
+
61
+ export function workflowMessage(kind: WorkflowKind, args: string): string {
62
+ const target = args.trim() || "the current repository/task";
63
+ const common = `Act as the Arey Pi tech lead. Use pi-subagents when available and appropriate. Keep orchestration authority in the parent session. Follow Arey Pi rules, preserve TDD, and report evidence clearly.`;
64
+
65
+ switch (kind) {
66
+ case "feature":
67
+ return `${common}\n\nRun the Arey Pi feature workflow for: ${target}\n\nExpected flow: spec-author for canonical specs, tdd-implementer for Red-Green-Refactor, spec-syncer for final alignment, and engineering-reviewer for adversarial quality review when risk warrants it.`;
68
+ case "bugfix":
69
+ return `${common}\n\nRun the Arey Pi bugfix workflow for: ${target}\n\nStart with a regression test that fails for the bug, then implement the minimal high-quality fix, synchronise specs, and review engineering quality.`;
70
+ case "sync":
71
+ return `${common}\n\nRun Arey Pi spec and documentation sync for: ${target}\n\nVerify Gherkin, tests, code, DBML, ADRs, glossary, architecture docs, README files, docs, AGENTS.md, skills, prompts, rules, agents, commands, and tooling instructions. End with both a spec status and a documentation status.`;
72
+ case "review":
73
+ return `${common}\n\nRun an Arey Pi engineering review for: ${target}\n\nReview architecture, code quality, test quality, quality tooling, security, privacy, operability, maintainability, and spec/ADR/DBML concerns. Classify findings by severity.`;
74
+ case "assess":
75
+ return `${common}\n\nAssess this repository against Arey Pi Project Readiness. Audit only by default. Produce scores, evidence, blockers, quick wins, and a prioritised improvement plan.`;
76
+ default:
77
+ return `${common}\n\nWork on: ${target}`;
78
+ }
79
+ }
80
+
81
+ export type DoctorReportInput = {
82
+ packageVersion: string;
83
+ cwd: string;
84
+ packageRulesPresent: boolean;
85
+ packageTemplatesPresent: boolean;
86
+ packageAgentsCount: number;
87
+ requiredAgentsCount: number;
88
+ hasSubagentsCommand: boolean;
89
+ installedAgentsCount: number;
90
+ hasRootAgentsMd: boolean;
91
+ hasPiSettings: boolean;
92
+ promptsCount: number;
93
+ skillsCount: number;
94
+ missingAgents: string[];
95
+ };
96
+
97
+ export function buildDoctorReport(input: DoctorReportInput): string {
98
+ return [
99
+ "# Arey Pi Doctor",
100
+ "",
101
+ `- Package: arey-pi@${input.packageVersion}`,
102
+ `- Project: ${input.cwd}`,
103
+ `- Package rules present: ${input.packageRulesPresent ? "yes" : "no"}`,
104
+ `- Package templates present: ${input.packageTemplatesPresent ? "yes" : "no"}`,
105
+ `- Package agents present: ${input.packageAgentsCount}/${input.requiredAgentsCount}`,
106
+ `- pi-subagents command detected: ${input.hasSubagentsCommand ? "yes" : "no"}`,
107
+ `- Project-local Arey Pi agents: ${input.installedAgentsCount}/${input.requiredAgentsCount}`,
108
+ `- Root AGENTS.md: ${input.hasRootAgentsMd ? "yes" : "no"}`,
109
+ `- .pi/settings.json: ${input.hasPiSettings ? "yes" : "no"}`,
110
+ `- Arey Pi prompts discovered: ${input.promptsCount}`,
111
+ `- Arey Pi skills discovered: ${input.skillsCount}`,
112
+ "",
113
+ "## Missing project agents",
114
+ input.missingAgents.length ? input.missingAgents.map((agent) => `- ${agent}`).join("\n") : "- none",
115
+ "",
116
+ "## Recommended next step",
117
+ input.installedAgentsCount === input.requiredAgentsCount
118
+ ? "- Project-local Arey Pi subagents are installed. Use `/arey-feature`, `/arey-bugfix`, `/arey-sync`, `/arey-review`, or natural language."
119
+ : "- Run `/arey-bootstrap` to install project-local Arey Pi subagents.",
120
+ ].join("\n");
121
+ }