@groupby/ai-dev 0.5.0 → 0.5.1

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.0",
3
+ "version": "0.5.1",
4
4
  "description": "Interactive installer for Rezolve Ai development content",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,20 @@
1
+ [S4R-1234](https://rezolvetech.atlassian.net/browse/S4R-1234)
2
+
3
+ ## Description
4
+
5
+ A high-level description of what is changed by this PR.
6
+
7
+ ## Checks
8
+
9
+ - [ ] Unit Tests
10
+ - [ ] Update 'vault' variables
11
+ - [ ] Feature flag added / updated / removed
12
+ - [ ] Update documentation (diagram, confluence pages, content inside "/docs" directory, swagger)
13
+
14
+ ## AI Development Checklist
15
+
16
+ - [ ] Spec/requirement linked: <!-- link here -->
17
+ - [ ] AI tool used: <!-- Copilot / Claude / Agent / Other -->
18
+ - [ ] Tests generated/refined with AI
19
+ - [ ] AI review pass completed
20
+ - [ ] Repo context files are still accurate (update if not)
@@ -0,0 +1,343 @@
1
+ ---
2
+ name: docs-init
3
+ description: Use when the user wants to initialize or refresh the canonical `/docs` folder, `CLAUDE.md`, and `README.md` based on the current repo state. Creates the five canonical docs if missing; audits them for drift against the code if present. Triggered by `/docs-init` or requests like "update the docs", "create the docs", "refresh project documentation", "init docs", "bring docs up to date".
4
+ ---
5
+
6
+ # docs-init
7
+
8
+ Initialize or refresh project documentation. Works in two modes automatically:
9
+
10
+ - **Init mode** — `/docs` is missing or incomplete. Create the canonical
11
+ five-file structure from a fresh repo scan.
12
+ - **Refresh mode** — `/docs` exists. Audit each file against the current
13
+ code and report what is outdated, drifted, or newly worth documenting.
14
+ Apply updates only after the user approves the human-readable report.
15
+
16
+ ## The Canonical Structure
17
+
18
+ ```text
19
+ README.md ← 30-second landing page + links into docs/
20
+ CLAUDE.md ← thin index for AI agents
21
+ docs/
22
+ architecture.md ← system, packages, domain model, cross-cutting concerns
23
+ local-setup.md ← prerequisites, run, test, troubleshooting
24
+ conventions.md ← code style, testing, API, migrations, PR norms
25
+ operations.md ← deploy, secrets, observability, runbooks
26
+ decisions.md ← append-only "why" log (ADR-lite)
27
+ ```
28
+
29
+ Every doc under `docs/` MUST start with a `> **Scope:**` block explaining
30
+ what belongs there, what does not, and where it is referenced from.
31
+ Preserve this block on every edit.
32
+
33
+ ## Procedure
34
+
35
+ ### 1. Detect mode
36
+
37
+ - Check for `README.md`, `CLAUDE.md`, and each of the five `docs/*.md` files.
38
+ - If three or more are missing → **init mode**.
39
+ - Otherwise → **refresh mode**.
40
+ - Announce the detected mode to the user before proceeding.
41
+
42
+ ### 2. Scan the repo
43
+
44
+ Gather facts from the actual code, not assumptions:
45
+
46
+ - **Stack & build:** `build.gradle` / `pom.xml` / `package.json` /
47
+ `Cargo.toml` / `go.mod` / `pyproject.toml` / equivalent — language
48
+ version, framework, key libraries.
49
+ - **Run commands:** README scripts, build-tool tasks (`./gradlew tasks`,
50
+ `npm run`, `make`, `cargo`, `go`, `pytest`, etc.), `docker-compose.yml`.
51
+ - **Package layout:** top-level dirs under `src/` (or `lib/`, `app/`).
52
+ - **Domain types:** entity/model/record classes; group by package.
53
+ - **Tests:** test framework, conventions, fixture locations.
54
+ - **Migrations:** Flyway / Liquibase / equivalent paths and naming.
55
+ - **CI/CD:** files under `.github/workflows/` (or equivalent).
56
+ - **Deploy:** `helm/`, `k8s/`, `terraform/`, Dockerfile, `Procfile`.
57
+ - **Observability:** OpenTelemetry / logging configuration.
58
+ - **Secrets:** Vault references, sealed-secrets, etc.
59
+ - **API surface:** controller annotations, OpenAPI spec, route definitions.
60
+
61
+ For refresh mode, also collect `git log --since="<doc-mtime>"` per doc to
62
+ narrow attention to changes the doc may not yet reflect.
63
+
64
+ ### 3a. Init mode — draft (do NOT write yet)
65
+
66
+ Draft the seven files in memory using the canonical templates below. Every
67
+ `docs/` file starts with the `Scope` block. Leave honest placeholders where
68
+ the repo does not yet have the answer (e.g. operations runbooks, dashboard
69
+ links). Do not fabricate.
70
+
71
+ Targets: `CLAUDE.md` ≤ 40 lines, `README.md` ≤ 30 lines.
72
+
73
+ **Do not write these files to disk yet.** Continue to step 4, where the
74
+ draft contents are summarized in the audit report and the user approves
75
+ before any file is created.
76
+
77
+ ### 3b. Refresh mode — audit each file
78
+
79
+ For each existing doc, classify findings into three buckets:
80
+
81
+ - **Outdated** — the doc states something that is no longer true (a removed
82
+ command, a renamed package, a retired workflow, a wrong version number).
83
+ - **Drifted** — the doc is technically correct but missing material the
84
+ code now contains (a new package, a new build task, a new workflow, a
85
+ new env profile).
86
+ - **New opportunities** — content the doc does not have but probably
87
+ should (a recently added feature area, a new observability surface).
88
+
89
+ `decisions.md` is **append-only**: propose new entries on approval, but
90
+ never rewrite or remove existing ones.
91
+
92
+ ### 4. Report to the user (human-friendly, NOT a diff)
93
+
94
+ In **init mode**, the report summarizes what each new file will contain
95
+ (one paragraph per file describing scope and key sections drafted), and
96
+ the "Proposed actions" list reads as `Create <path>` items.
97
+
98
+ In **refresh mode**, the report follows the per-file findings format
99
+ below.
100
+
101
+ Output a single readable report in this exact shape:
102
+
103
+ ```markdown
104
+ # Documentation audit — <YYYY-MM-DD>
105
+
106
+ Mode: <init | refresh>
107
+
108
+ ## Summary
109
+ <2-3 sentences: what was created or what needs attention overall>
110
+
111
+ ## Per-file findings
112
+
113
+ ### docs/architecture.md
114
+ **Outdated:**
115
+ - The package list mentions `legacy/` but that directory was removed in <commit>.
116
+ - Lists framework version X.Y; build file now pins X.Z.
117
+
118
+ **Drifted:**
119
+ - A new top-level package is not mentioned.
120
+
121
+ **New opportunities:**
122
+ - A retry strategy was added in <PR>; worth a short paragraph.
123
+
124
+ ### docs/local-setup.md
125
+ **Outdated:**
126
+ - (none)
127
+
128
+ **Drifted:**
129
+ - A new build/test task was added in <commit> but the doc does not list it.
130
+
131
+ (... continue for each file ...)
132
+
133
+ ### CLAUDE.md
134
+ **Outdated:** (none)
135
+ **Drifted:** Pointer to `docs/operations.md` is missing.
136
+
137
+ ### README.md
138
+ **Outdated:** Quick-start references an old env-var value that has been
139
+ renamed.
140
+
141
+ ## Proposed actions
142
+
143
+ Numbered list of concrete edits I would make if you approve. Group by
144
+ file. Each item is one sentence — no diffs.
145
+
146
+ ## Awaiting your approval
147
+
148
+ Reply "apply" to make the changes, "apply <numbers>" to apply a subset
149
+ (e.g. "apply 1,3,5"), or "skip" to make no changes.
150
+ ```
151
+
152
+ If a bucket is empty for a file, write `(none)` — do not omit the bucket.
153
+ This makes it obvious that the check ran.
154
+
155
+ ### 5. Apply on approval
156
+
157
+ - On `apply` — create or edit each affected file. In init mode this means
158
+ creating all seven files from the drafts in step 3a. In refresh mode
159
+ it means editing existing files in place. Preserve `Scope` blocks. Do
160
+ not reorganize content across files. Do not change file names.
161
+ - On `apply <numbers>` — apply only the selected proposed actions.
162
+ - On `skip` — make no edits or creations; thank the user and exit.
163
+ - After applying, print a short summary of which files were created or
164
+ changed and suggest a commit message.
165
+
166
+ ## Hard rules
167
+
168
+ - **Apply edits only after explicit user approval.** No file under `docs/`,
169
+ `CLAUDE.md`, or `README.md` is edited before the user replies `apply` or
170
+ `apply <numbers>`.
171
+ - **`decisions.md` is append-only.** New entries may be added on approval;
172
+ existing entries are never edited or removed.
173
+ - **Preserve every `> **Scope:**` block** verbatim on edited docs.
174
+ - **Do not move content between files.** Each file's scope is the
175
+ convention. If content does not fit any of the five, mention it in the
176
+ report and ask whether to create a new file or fold it elsewhere.
177
+ - **Do not fabricate.** If the repo has no dashboards, no runbooks, no
178
+ decisions yet, leave honest placeholders or empty sections.
179
+ - **Do not delete sections without flagging them.** Surfacing a removal
180
+ belongs in the report, not as a silent edit.
181
+ - **Do not edit `.github/PULL_REQUEST_TEMPLATE.md`, CI files, or code.**
182
+ This skill only touches docs.
183
+ - **Keep `CLAUDE.md` ≤ 40 lines and `README.md` ≤ 30 lines** after edit.
184
+ If pointers no longer fit, ask before expanding.
185
+
186
+ ## Canonical templates
187
+
188
+ When in init mode, use these skeletons. Fill from the repo scan.
189
+
190
+ ### `docs/architecture.md`
191
+
192
+ ```markdown
193
+ # Architecture
194
+
195
+ > **Scope:** What this system is, how it's structured, and the domain it models.
196
+ > Put here: tech stack, package/module layout, key components, domain entities,
197
+ > cross-cutting concerns (auth, multi-tenancy, observability).
198
+ > Do **not** put here: how to run it (→ local-setup.md), how to deploy it
199
+ > (→ operations.md), code style (→ conventions.md).
200
+ >
201
+ > **Referenced from:** `README.md` and `CLAUDE.md`.
202
+
203
+ ## Overview
204
+ ## Package Structure
205
+ ## Key Libraries
206
+ ## Domain Model
207
+ ## Cross-Cutting Concerns
208
+ ```
209
+
210
+ ### `docs/local-setup.md`
211
+
212
+ ```markdown
213
+ # Local Setup
214
+
215
+ > **Scope:** Everything needed to clone, run, and test on a fresh machine.
216
+ > Put here: prerequisites, full setup steps, env vars, build/test commands,
217
+ > troubleshooting.
218
+ > Do **not** put here: deployment (→ operations.md), architecture
219
+ > (→ architecture.md).
220
+ >
221
+ > **Referenced from:** `README.md` quick-start (links here for detail) and `CLAUDE.md`.
222
+
223
+ ## Prerequisites
224
+ ## Run the Service
225
+ ## Common Tasks
226
+ ## Environment Profiles
227
+ ## Troubleshooting
228
+ ```
229
+
230
+ ### `docs/conventions.md`
231
+
232
+ ```markdown
233
+ # Conventions
234
+
235
+ > **Scope:** How we write and review code in this repo.
236
+ > Put here: language conventions, testing philosophy, naming rules, API
237
+ > rules, migration rules, PR norms.
238
+ > Do **not** put here: architecture (→ architecture.md), ops (→ operations.md).
239
+ >
240
+ > **Referenced from:** `CLAUDE.md` (so AI agents follow these) and `README.md`.
241
+
242
+ ## Code Style
243
+ ## Testing
244
+ ## API Conventions
245
+ ## Database Migrations
246
+ ## PRs and Commits
247
+ ```
248
+
249
+ ### `docs/operations.md`
250
+
251
+ ```markdown
252
+ # Operations
253
+
254
+ > **Scope:** What happens after merge — deploy, run, observe, recover.
255
+ > Put here: deploy pipelines, environments, secrets source, dashboards,
256
+ > alerts, runbooks.
257
+ > Do **not** put here: architecture (→ architecture.md), local dev
258
+ > (→ local-setup.md).
259
+ >
260
+ > **Referenced from:** `README.md` and `CLAUDE.md`.
261
+
262
+ ## Deploy
263
+ ## Secrets
264
+ ## Observability
265
+ ## Common Runbooks
266
+ ## On-Call
267
+ ```
268
+
269
+ ### `docs/decisions.md`
270
+
271
+ ```markdown
272
+ # Decisions
273
+
274
+ > **Scope:** Short, append-only log of *why* this codebase is the way it is.
275
+ > Captures decisions whose rationale is not obvious from reading the code.
276
+ > Put here: framework choices, trade-offs taken, deliberate deviations.
277
+ > Do **not** put here: how-to instructions, code-level comments.
278
+ >
279
+ > **Referenced from:** `CLAUDE.md`, and linked from PRs that introduce a
280
+ > non-obvious choice.
281
+
282
+ ## Format
283
+
284
+ Append a new entry as a new top-level section. Don't edit prior entries —
285
+ if a decision is reversed, add a new entry that supersedes the old one.
286
+
287
+ Each entry:
288
+ - **Context:** what prompted the decision
289
+ - **Decision:** what we chose
290
+ - **Consequence:** what this means going forward (and what we're giving up)
291
+
292
+ ## Entries
293
+
294
+ *(No entries yet.)*
295
+ ```
296
+
297
+ ### `CLAUDE.md`
298
+
299
+ ```markdown
300
+ # CLAUDE.md
301
+
302
+ Index for AI coding agents (Claude Code, Copilot CLI). Keep this file short —
303
+ point to `docs/` for substance.
304
+
305
+ ## What this repo is
306
+
307
+ <one-paragraph description from the repo scan>
308
+
309
+ ## Where things live
310
+
311
+ - **Architecture, domain model, package layout** → [docs/architecture.md](docs/architecture.md)
312
+ - **Build / run / test commands** → [docs/local-setup.md](docs/local-setup.md)
313
+ - **Code style, testing conventions, API/migration rules** → [docs/conventions.md](docs/conventions.md)
314
+ - **Deploy, secrets, observability, runbooks** → [docs/operations.md](docs/operations.md)
315
+ - **Why things are the way they are** → [docs/decisions.md](docs/decisions.md)
316
+
317
+ ## Rules for working in this repo
318
+
319
+ <3-6 short bullets — only repo-specific gotchas an agent must follow on
320
+ every turn. Do not duplicate detail that lives in docs/>
321
+ ```
322
+
323
+ ### `README.md`
324
+
325
+ ```markdown
326
+ # <repo name>
327
+
328
+ <one-paragraph description>
329
+
330
+ ## Quick start
331
+
332
+ <3-5 lines: the shortest possible happy path>
333
+
334
+ Requires <prereqs>. For detail see [docs/local-setup.md](docs/local-setup.md).
335
+
336
+ ## Documentation
337
+
338
+ - [Architecture](docs/architecture.md) — system overview, domain model, package layout
339
+ - [Local setup](docs/local-setup.md) — full setup, tasks, troubleshooting
340
+ - [Conventions](docs/conventions.md) — code style, testing, API & migration rules
341
+ - [Operations](docs/operations.md) — deploy, secrets, observability, runbooks
342
+ - [Decisions](docs/decisions.md) — why things are the way they are
343
+ ```