@groupby/ai-dev 0.5.11 → 0.5.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groupby/ai-dev",
3
- "version": "0.5.11",
3
+ "version": "0.5.13",
4
4
  "description": "Interactive installer for Rezolve Ai development content",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,405 @@
1
+ ---
2
+ name: docs-init
3
+ description: Use when the user wants to initialize or refresh the fast-layer summary docs (`docs/*.md`), `CLAUDE.md`, and `README.md` from the current repo state. The authoritative source of truth stays in `docs/architecture/`; these summaries index and link into it. Triggered by `/docs-init` or requests like "update the docs", "refresh project documentation", "init docs", "bring docs up to date".
4
+ ---
5
+
6
+ # docs-init
7
+
8
+ Generate and audit the **fast/index layer** of project documentation. This layer
9
+ indexes and links into the authoritative `docs/architecture/`, never duplicating
10
+ it and never fabricating facts.
11
+
12
+ This is a **standalone utility** — not part of the main AI workflow pipeline.
13
+ Run it any time, independently of tickets or implementation.
14
+
15
+ ## Two documentation layers
16
+
17
+ This project has two doc layers. Keep them distinct:
18
+
19
+ 1. **`docs/architecture/`** — the authoritative, detailed source of truth.
20
+ 13+ files covering system overview, module structure, state management, data
21
+ flow, auth, tenancy, feature flags, services, integrations, build, testing,
22
+ code conventions, git workflow. **This skill never modifies these — it only
23
+ reads them.**
24
+
25
+ 2. **Fast layer (this skill manages it)** — `docs/*.md` summaries
26
+ (`architecture.md`, `local-setup.md`, `conventions.md`, `operations.md`,
27
+ `decisions.md`) plus `CLAUDE.md` and `README.md` as thin indexes. These are
28
+ executive summaries for quick human onboarding and quick AI context. They
29
+ **summarize and link into** `docs/architecture/` — they never replace or
30
+ duplicate it.
31
+
32
+ ## The fast-layer structure
33
+
34
+ ```text
35
+ README.md ← 30-second landing page + links
36
+ CLAUDE.md ← thin index for AI agents (~40 lines)
37
+ docs/
38
+ architecture.md ← summary: system, packages, domain model
39
+ local-setup.md ← prerequisites, run, test commands
40
+ conventions.md ← summary: code style, testing, PR norms
41
+ operations.md ← deploy, secrets, observability
42
+ decisions.md ← append-only "why" log (ADR-lite)
43
+ ```
44
+
45
+ Every `docs/*.md` summary MUST start with a disclaimer block naming
46
+ `docs/architecture/` as the authoritative source. Two rules govern it:
47
+
48
+ **Which convention to use:**
49
+ - New file (init mode), or an existing file with no disclaimer → use the
50
+ `> **Note:**` template below.
51
+ - Existing file that already has a disclaimer (e.g. a `> **Scope:**` /
52
+ `> **Referenced from:**` block) → **preserve it as-is**. Do not swap
53
+ conventions; mixing them is noise, not an improvement.
54
+
55
+ **The Doc Routing Table link is conditional.** The base disclaimer always points
56
+ to `docs/architecture/`. Append the Doc Routing Table sentence **only if
57
+ `.github/copilot-instructions.md` actually exists in the repo** (confirm with
58
+ `ls` first). If it does not exist, omit that sentence — never emit a link to a
59
+ file that is not there.
60
+
61
+ Base (always):
62
+
63
+ ```markdown
64
+ > **Note:** This is an executive summary for quick AI context. The
65
+ > authoritative source of truth is `docs/architecture/`.
66
+ ```
67
+
68
+ Append only when `.github/copilot-instructions.md` exists:
69
+
70
+ ```markdown
71
+ > See the [Doc Routing Table](../.github/copilot-instructions.md) for which
72
+ > architecture doc to consult for each task type.
73
+ ```
74
+
75
+ ## Procedure
76
+
77
+ ### 1. Detect mode
78
+
79
+ - Check for `README.md`, `CLAUDE.md`, and each of the five `docs/*.md` summaries.
80
+ - If three or more summaries are missing → **init mode**.
81
+ - Otherwise → **refresh mode**.
82
+ - Announce the detected mode before proceeding.
83
+
84
+ ### 2. Scan sources
85
+
86
+ The primary source for the fast layer is `docs/architecture/` — **not raw code**:
87
+
88
+ - Read the relevant `docs/architecture/*.md` files to extract facts.
89
+ - Cross-reference actual code only where architecture docs may be stale.
90
+ - `package.json` — versions, dependencies, and **yarn scripts** (the run/build/
91
+ test commands).
92
+ - `.github/workflows/` — CI details and triggers.
93
+ - `helm/`, `Dockerfile` — deploy details.
94
+ - `docs/architecture/13-git-workflow.md` — commit/PR conventions.
95
+
96
+ For refresh mode, also run `git log --since="<doc-mtime>"` per summary to narrow
97
+ attention to recent changes a summary may not yet reflect.
98
+
99
+ ### 3a. Init mode — draft (do NOT write yet)
100
+
101
+ Draft the seven fast-layer files in memory using the **canonical templates**
102
+ below. Content comes from `docs/architecture/` — summarize and link, do not
103
+ duplicate. Every `docs/*.md` starts with the `> **Note:**` disclaimer. Leave
104
+ honest placeholders where no authoritative source exists yet. Do not fabricate.
105
+
106
+ **Verification checklist — apply to every claim before including it.** The core
107
+ rule: **every fact in a summary must trace to `docs/architecture/`, or to real
108
+ source when the architecture docs are silent or stale.**
109
+
110
+ 1. **Commands** — Before writing any `yarn <script>` / `npm run <script>`,
111
+ confirm the script exists in `package.json`. Never guess script names.
112
+ 2. **Config keys** — Quote exact property paths from the actual config file
113
+ (`.env`, JSON, YAML, Helm values). Do not paraphrase or use placeholder
114
+ syntax like `${...}`.
115
+ 3. **Directory contents** — `ls` the directory before describing what it
116
+ contains. Never say "contains X" without checking.
117
+ 4. **Credentials** — Never instruct placing credentials in a repo-tracked file.
118
+ Recommend user-home config (`~/.npmrc`) or environment variables instead.
119
+ 5. **CI/CD triggers** — Read the actual GitHub Actions `on:` block. List all
120
+ branches/events accurately; do not guess.
121
+ 6. **Scope qualifiers** — When stating "all X do Y," verify there are no
122
+ exceptions before writing it.
123
+ 7. **File references** — When describing what a file is for, trace its
124
+ references (grep the filename) so the description matches actual usage.
125
+ 8. **Architecture-doc links** — When a summary section points to
126
+ `docs/architecture/NN-*.md`, confirm that file exists and covers that topic.
127
+ 9. **Cross-references resolve** — Every link in `CLAUDE.md`, `README.md`, and
128
+ the disclaimer's conditional Routing Table line must point to a file that
129
+ exists. `ls` before linking; omit or fix any link whose target is absent.
130
+
131
+ Targets: `CLAUDE.md` ≤ 40 lines, `README.md` ≤ 30 lines, each `docs/*.md`
132
+ summary ≤ 80 lines.
133
+
134
+ **Do not write these files to disk yet.** Continue to step 4, where the drafts
135
+ are summarized in the audit report and the user approves before any file is
136
+ created.
137
+
138
+ ### 3b. Refresh mode — audit each summary
139
+
140
+ For each existing summary, compare against `docs/architecture/` and code, and
141
+ classify findings into three buckets:
142
+
143
+ - **Outdated** — the summary states something no longer true.
144
+ - **Drifted** — correct but missing material that `docs/architecture/` or the
145
+ code now contains.
146
+ - **New opportunities** — content the summary does not have but probably should.
147
+
148
+ `decisions.md` is **append-only**: propose new entries on approval, but never
149
+ rewrite or remove existing ones.
150
+
151
+ ### 4. Report to the user (human-readable, NOT a diff)
152
+
153
+ In **init mode**, the report summarizes what each new file will contain (one
154
+ paragraph per file) and the "Proposed actions" list reads as `Create <path>`
155
+ items. In **refresh mode**, it follows the per-file findings format below.
156
+
157
+ ```markdown
158
+ # Documentation audit — <YYYY-MM-DD>
159
+
160
+ Mode: <init | refresh>
161
+
162
+ ## Summary
163
+ <2-3 sentences: what was created or what needs attention overall>
164
+
165
+ ## Per-file findings
166
+
167
+ ### docs/architecture.md (summary)
168
+ **Outdated:** ...
169
+ **Drifted:** ...
170
+ **New opportunities:** ...
171
+
172
+ (... continue for each file ...)
173
+
174
+ ## Proposed actions
175
+ Numbered list of concrete edits. Group by file. Each item is one sentence — no diffs.
176
+
177
+ ## Verified against source
178
+ - Commands: <which package.json scripts were confirmed>
179
+ - Config keys: <which files were read for exact names>
180
+ - Directories: <which directories were listed>
181
+ - Workflow triggers: <which workflow files were read>
182
+ - Architecture links: <which docs/architecture/ files were confirmed>
183
+ - Line limits: <CLAUDE.md ≤40, README.md ≤30, each docs/*.md ≤80 — confirmed>
184
+ - Credentials: <confirm no repo-tracked file instructions>
185
+
186
+ ## Awaiting your approval
187
+ Reply "apply" to make the changes, "apply <numbers>" to apply a subset
188
+ (e.g. "apply 1,3,5"), or "skip" to make no changes.
189
+ ```
190
+
191
+ If a bucket is empty for a file, write `(none)` — do not omit it. This makes it
192
+ obvious the check ran.
193
+
194
+ ### 5. Apply on approval
195
+
196
+ - On `apply` — create or edit each affected file. In init mode, create all seven
197
+ fast-layer files from the step-3a drafts. In refresh mode, edit existing files
198
+ in place. Preserve `> **Note:**` and `> **Scope:**` blocks. Do not reorganize
199
+ content across files. Do not change file names.
200
+ - On `apply <numbers>` — apply only the selected proposed actions.
201
+ - On `skip` — make no edits or creations; thank the user and exit.
202
+ - After applying, print a short summary of which files changed and suggest a
203
+ commit message.
204
+
205
+ ## Hard rules
206
+
207
+ - **Apply edits only after explicit user approval.** No fast-layer file is
208
+ written before the user replies `apply` or `apply <numbers>`.
209
+ - **Never touch `docs/architecture/`.** It is authoritative and managed
210
+ separately. Read it; never edit it.
211
+ - **`decisions.md` is append-only.** New entries on approval; existing entries
212
+ are never edited or removed.
213
+ - **Preserve every `> **Note:**` and `> **Scope:**` block** verbatim on edit.
214
+ - **Do not move content between files.** Each file's scope is the convention.
215
+ If content fits none of the five, mention it in the report and ask.
216
+ - **Do not fabricate.** If the repo has no dashboards, runbooks, or decisions
217
+ yet, leave honest placeholders or empty sections.
218
+ - **Verify every factual claim** against `docs/architecture/` or source before
219
+ including it. See the verification checklist in step 3a.
220
+ - **Summaries link, never duplicate.** Reference architecture docs by relative
221
+ path (e.g. "See `docs/architecture/03-state-management.md` for details")
222
+ instead of copying their content.
223
+ - **Never reference repo-tracked files for credentials.** Use `~/.npmrc` or
224
+ environment variables.
225
+ - **Qualify universal statements.** If writing "all X do Y," verify there are no
226
+ exceptions and add qualifiers if needed.
227
+ - **Do not delete sections without flagging them** in the report.
228
+ - **Do not edit `.github/`, CI files, or source code.** This skill only touches
229
+ the fast-layer docs.
230
+ - **Keep line limits:** `CLAUDE.md` ≤ 40, `README.md` ≤ 30, each `docs/*.md`
231
+ ≤ 80. If pointers no longer fit, ask before expanding.
232
+
233
+ ## Common mistakes
234
+
235
+ - Duplicating content from `docs/architecture/` into summaries (summarize and
236
+ link, do not copy).
237
+ - Treating summaries as the source of truth — they are NOT.
238
+ - Editing `docs/architecture/` files (out of scope for this skill).
239
+ - Removing the `> **Note:**` disclaimer from a summary.
240
+ - Making changes before user approval.
241
+ - Fabricating operations info (dashboards, runbook URLs) that does not exist.
242
+ - Guessing a `yarn` script name instead of confirming it in `package.json`.
243
+
244
+ ## Canonical templates
245
+
246
+ When in init mode, use these summary-shaped skeletons. Each section holds 1–2
247
+ sentences plus a link into `docs/architecture/` — not the details themselves.
248
+ Fill from the architecture-doc scan.
249
+
250
+ ### `docs/architecture.md`
251
+
252
+ ```markdown
253
+ # Architecture (summary)
254
+
255
+ > <disclaimer block — see "The fast-layer structure" section.
256
+ > Always points to `docs/architecture/`; append the Doc Routing Table line
257
+ > only if `.github/copilot-instructions.md` exists.>
258
+
259
+ ## Overview
260
+ <one paragraph: what this system is. → `docs/architecture/01-*.md`>
261
+
262
+ ## Module Structure
263
+ <top-level layout in 2-3 lines. → `docs/architecture/02-*.md`>
264
+
265
+ ## State & Data Flow
266
+ <one line each. → `docs/architecture/03-state-management.md`, `…-data-flow.md`>
267
+
268
+ ## Cross-Cutting Concerns
269
+ <auth, tenancy, feature flags — one line each, with links into docs/architecture/>
270
+ ```
271
+
272
+ ### `docs/local-setup.md`
273
+
274
+ ```markdown
275
+ # Local Setup (summary)
276
+
277
+ > <disclaimer block — see "The fast-layer structure" section.
278
+ > Always points to `docs/architecture/`; append the Doc Routing Table line
279
+ > only if `.github/copilot-instructions.md` exists.>
280
+
281
+ ## Prerequisites
282
+ <node/yarn versions and required tooling — confirmed from package.json>
283
+
284
+ ## Run / Build / Test
285
+ <the actual `yarn <script>` commands, confirmed in package.json>
286
+
287
+ ## Environment
288
+ <key env vars, exact names. → relevant docs/architecture/ doc>
289
+
290
+ ## Troubleshooting
291
+ <common gotchas, or an honest placeholder if none documented yet>
292
+ ```
293
+
294
+ ### `docs/conventions.md`
295
+
296
+ ```markdown
297
+ # Conventions (summary)
298
+
299
+ > <disclaimer block — see "The fast-layer structure" section.
300
+ > Always points to `docs/architecture/`; append the Doc Routing Table line
301
+ > only if `.github/copilot-instructions.md` exists.>
302
+
303
+ ## Code Style
304
+ <one line. → `docs/architecture/` code-conventions doc>
305
+
306
+ ## Testing
307
+ <framework + philosophy in 1-2 lines. → testing doc>
308
+
309
+ ## PRs & Commits
310
+ <commit/PR norms. → `docs/architecture/13-git-workflow.md`>
311
+ ```
312
+
313
+ ### `docs/operations.md`
314
+
315
+ ```markdown
316
+ # Operations (summary)
317
+
318
+ > <disclaimer block — see "The fast-layer structure" section.
319
+ > Always points to `docs/architecture/`; append the Doc Routing Table line
320
+ > only if `.github/copilot-instructions.md` exists.>
321
+
322
+ ## Deploy
323
+ <pipeline + environments in 1-2 lines. → relevant docs/architecture/ doc>
324
+
325
+ ## Secrets
326
+ <where secrets come from — never a repo-tracked file>
327
+
328
+ ## Observability
329
+ <dashboards/alerts, or an honest placeholder if none exist yet>
330
+ ```
331
+
332
+ ### `docs/decisions.md`
333
+
334
+ ```markdown
335
+ # Decisions
336
+
337
+ > **Scope:** Short, append-only log of *why* this codebase is the way it is.
338
+ > Captures decisions whose rationale is not obvious from reading the code.
339
+ > Do **not** put how-to instructions here.
340
+
341
+ ## Format
342
+
343
+ Append a new entry as a new top-level section. Don't edit prior entries — if a
344
+ decision is reversed, add a new entry that supersedes the old one.
345
+
346
+ Each entry:
347
+ - **Context:** what prompted the decision
348
+ - **Decision:** what we chose
349
+ - **Consequence:** what this means going forward (and what we give up)
350
+
351
+ ## Entries
352
+
353
+ *(No entries yet.)*
354
+ ```
355
+
356
+ ### `CLAUDE.md`
357
+
358
+ ```markdown
359
+ # CLAUDE.md
360
+
361
+ Index for AI coding agents. Keep this file short — point to `docs/` for substance.
362
+
363
+ ## What this repo is
364
+
365
+ <one-paragraph description from the architecture-doc scan>
366
+
367
+ ## Where things live
368
+
369
+ - **Architecture, domain model, module layout** → [docs/architecture.md](docs/architecture.md)
370
+ - **Build / run / test commands** → [docs/local-setup.md](docs/local-setup.md)
371
+ - **Code style, testing, PR rules** → [docs/conventions.md](docs/conventions.md)
372
+ - **Deploy, secrets, observability** → [docs/operations.md](docs/operations.md)
373
+ - **Why things are the way they are** → [docs/decisions.md](docs/decisions.md)
374
+
375
+ > **Note:** `docs/*.md` files are executive summaries; the authoritative source
376
+ > is `docs/architecture/`. (If `.github/copilot-instructions.md` exists, route
377
+ > via its Doc Routing Table.)
378
+
379
+ ## Rules for working in this repo
380
+
381
+ <3-6 short bullets — only repo-specific gotchas an agent must follow every turn.
382
+ Do not duplicate detail that lives in docs/>
383
+ ```
384
+
385
+ ### `README.md`
386
+
387
+ ```markdown
388
+ # <repo name>
389
+
390
+ <one-paragraph description>
391
+
392
+ ## Quick start
393
+
394
+ <3-5 lines: the shortest possible happy path, using confirmed yarn scripts>
395
+
396
+ Requires <prereqs>. For detail see [docs/local-setup.md](docs/local-setup.md).
397
+
398
+ ## Documentation
399
+
400
+ - [Architecture](docs/architecture.md) — system overview, domain model, layout
401
+ - [Local setup](docs/local-setup.md) — full setup, tasks, troubleshooting
402
+ - [Conventions](docs/conventions.md) — code style, testing, PR rules
403
+ - [Operations](docs/operations.md) — deploy, secrets, observability
404
+ - [Decisions](docs/decisions.md) — why things are the way they are
405
+ ```
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: team-code-review
3
3
  description: >-
4
- Review current changes against the repository's AI routing docs, working agreement, architecture, code-review checklist, and changed files. Use for phase reviews, final branch reviews, PR readiness checks, or focused reviews where findings should be prioritized before summary.
4
+ Review current changes against the repository's AI routing docs, working agreement, architecture, code-review checklist, and changed files. Scores the change across review axes (correctness, readability, architecture, security, performance) and tags each finding with a severity label so blockers are obvious. Use for phase reviews, final branch reviews, PR readiness checks, or focused reviews where findings should be prioritized before summary.
5
5
  ---
6
6
 
7
7
  # Team Code Review
@@ -28,39 +28,59 @@ Use this skill for read-first review work. The project docs define the review st
28
28
  - architecture or task-specific docs named by the router
29
29
  4. Inspect changed files and nearby code before writing findings.
30
30
 
31
- ## Review Standards
31
+ ## Review Axes
32
32
 
33
- Prioritize defects and regressions over style. Check:
33
+ Review the change across these axes and score each one. Scoring forces a deliberate pass over every axis instead of stopping at the first issue found.
34
34
 
35
- - correctness and user-visible behavior
36
- - architecture and documented conventions
37
- - security, permissions, and sensitive data handling
38
- - error handling and failure states
39
- - performance and lifecycle cleanup
40
- - accessibility for UI work
41
- - test coverage and validation gaps
42
- - docs drift caused by the change
35
+ - **Correctness** user-visible behavior, edge cases, error handling and failure states, test coverage and validation gaps.
36
+ - **Readability** — clarity, naming, and complexity. Could another engineer follow this without explanation?
37
+ - **Architecture** — documented conventions, module boundaries, and docs drift caused by the change.
38
+ - **Security** input validation, permissions, auth, and sensitive data handling.
39
+ - **Performance** — inefficient or expensive code, and lifecycle cleanup.
43
40
 
44
- If the code contradicts project docs, treat that as a finding unless the change deliberately updates the documented target state.
41
+ For UI work, also review accessibility (semantic markup, keyboard navigation, focus management) under Readability and Correctness.
42
+
43
+ Prioritize defects and regressions over style. If the code contradicts project docs, treat that as a finding unless the change deliberately updates the documented target state.
44
+
45
+ ## Severity Labels
46
+
47
+ Tag every finding so the reader instantly knows what blocks merge versus what is optional:
48
+
49
+ | Label | Meaning |
50
+ |---|---|
51
+ | `Critical:` | Blocks merge — security hole, data loss, broken or wrong behavior. |
52
+ | `Required:` | Must change before merge, but not merge-breaking on its own. |
53
+ | `Consider:` | Worth evaluating. A suggestion, not a blocker. |
54
+ | `Nit:` | Optional minor or style feedback. |
55
+ | `FYI:` | Informational only, no action needed. |
45
56
 
46
57
  ## Output
47
58
 
48
- Lead with findings ordered by severity. Include tight file and line references when possible.
59
+ Group findings by axis, and prefix each with its severity label. Include tight file and line references when possible. Lead with the axes that have the most severe findings.
49
60
 
50
61
  Use this shape:
51
62
 
52
63
  ```markdown
53
64
  ## Findings
54
- - [P1/P2/P3] file:line - Issue and impact.
65
+
66
+ ### Correctness
67
+ - Critical: file:line - Issue and impact.
68
+ - Consider: file:line - Issue and impact.
69
+
70
+ ### Security
71
+ - Critical: file:line - Issue and impact.
72
+
73
+ ### Readability
74
+ - Nit: file:line - Issue and impact.
55
75
 
56
76
  ## Open Questions
57
77
  - [Question]
58
78
 
59
79
  ## Summary
60
- [Brief assessment]
80
+ [Brief assessment, with a per-axis read and the total count by severity, e.g. "2 critical, 1 consider, 1 nit. Blocks merge until criticals are fixed."]
61
81
 
62
82
  ## Validation Gaps
63
83
  - [Gap]
64
84
  ```
65
85
 
66
- If the project workflow requires a review artifact, write it to the documented scratch location, commonly `tmp/review-phase-XX.md` or `tmp/review-final.md`.
86
+ Only include axes that have findings. If the project workflow requires a review artifact, write it to the documented scratch location, commonly `tmp/review-phase-XX.md` or `tmp/review-final.md`.