@groupby/ai-dev 0.5.1 → 0.5.4

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.
@@ -1,402 +0,0 @@
1
- ---
2
- name: docs-init-v2
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-v2` or requests like "update the docs v2", "create the docs v2", "refresh project documentation v2", "init docs v2".
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
- - **Exception:** If canonical files are missing but the repo has substantial
41
- existing documentation (e.g. `docs/` with other files, detailed README,
42
- wiki-style markdown), treat as **refresh mode** — bridge existing docs
43
- into the canonical structure rather than creating from scratch. Mention
44
- existing docs in the report and propose how to integrate or link them.
45
- - Announce the detected mode to the user before proceeding.
46
-
47
- ### 2. Scan the repo
48
-
49
- Gather facts from the actual code, not assumptions:
50
-
51
- - **Stack & build:** `build.gradle` / `pom.xml` / `package.json` /
52
- `Cargo.toml` / `go.mod` / `pyproject.toml` / `setup.py` /
53
- `requirements.txt` / `Makefile` / equivalent — language version,
54
- framework, key libraries.
55
- - **Run commands:** README scripts, build-tool tasks (`./gradlew tasks`,
56
- `npm run`, `make`, `cargo`, `go`, `pytest`, etc.), `docker-compose.yml`.
57
- - **Package layout:** top-level dirs under `src/` (or `lib/`, `app/`,
58
- `cmd/`, `internal/`, `pkg/` for Go, `dags/`/`jobs/` for Airflow,
59
- `packages/`/`apps/` for monorepos, `manifests/` for infra repos).
60
- - **Domain types:** entity/model/record/struct/schema classes; group by
61
- package or module.
62
- - **Tests:** test framework, conventions, fixture locations.
63
- - **Migrations:** Flyway / Liquibase / Alembic / Knex / equivalent paths
64
- and naming.
65
- - **CI/CD:** files under `.github/workflows/`, `.circleci/`, `Jenkinsfile`,
66
- `cloudbuild.yaml`, or equivalent. Note the CI system in use.
67
- - **Deploy:** `helm/`, `k8s/`, `kustomize/`, `terraform/`, Dockerfile,
68
- `Procfile`, Argo CD manifests.
69
- - **Observability:** OpenTelemetry / logging / Prometheus / Datadog config.
70
- - **Secrets:** Vault references, sealed-secrets, workload identity, ADC,
71
- env var injection.
72
- - **API surface:** controller annotations, OpenAPI spec, route definitions,
73
- proto definitions, GraphQL schema.
74
-
75
- For refresh mode, also collect `git log --since="<doc-mtime>"` per doc to
76
- narrow attention to changes the doc may not yet reflect.
77
-
78
- ### 3a. Init mode — draft (do NOT write yet)
79
-
80
- Draft the seven files in memory using the canonical templates below. Every
81
- `docs/` file starts with the `Scope` block. Leave honest placeholders where
82
- the repo does not yet have the answer (e.g. operations runbooks, dashboard
83
- links). Do not fabricate.
84
-
85
- **Verification checklist — apply to every claim before including it:**
86
-
87
- 1. **Commands** — Before writing any `./gradlew <task>`, `npm run <script>`,
88
- `make <target>`, `go <cmd>`, or similar, confirm the task exists (check
89
- `build.gradle` tasks, `package.json` scripts, Makefile targets, workflow
90
- files). Never guess task names.
91
- 2. **Config keys** — Quote exact property paths from the actual config file
92
- (YAML, properties, JSON, TOML, `.env`, Helm values, Kustomize overlays).
93
- Do not paraphrase or use placeholder syntax like `${...}`.
94
- 3. **Directory contents** — List (`ls`) the directory before describing what it
95
- contains. Never say "contains templates only" or "contains X" without
96
- checking.
97
- 4. **Credentials** — Never instruct placing credentials in a repo-tracked file.
98
- Recommend user-home config instead: `~/.gradle/gradle.properties`,
99
- `~/.m2/settings.xml`, `~/.npmrc`, `~/.pypirc`, `~/.docker/config.json`,
100
- or environment variables / Application Default Credentials (ADC).
101
- 5. **Submodule commands** — Use `git submodule update --init --recursive`
102
- (pinned commit). Never use `--remote` (breaks reproducible builds).
103
- 6. **CI/CD triggers** — Read the actual trigger/filter syntax for the CI system
104
- in use (GitHub Actions `on:` block, CircleCI `filters:`, Jenkins pipeline
105
- triggers, etc.). List all branches/events accurately.
106
- 7. **Scope qualifiers** — When stating "all X do Y," verify there are no
107
- exceptions (e.g. health, metrics, actuator endpoints outside the API prefix).
108
- 8. **File references** — When describing what a file is used for, trace its
109
- references (grep for the filename) so the description matches actual usage.
110
-
111
- Targets: `CLAUDE.md` ≤ 40 lines, `README.md` ≤ 30 lines.
112
-
113
- **Do not write these files to disk yet.** Continue to step 4, where the
114
- draft contents are summarized in the audit report and the user approves
115
- before any file is created.
116
-
117
- ### 3b. Refresh mode — audit each file
118
-
119
- For each existing doc, classify findings into three buckets:
120
-
121
- - **Outdated** — the doc states something that is no longer true (a removed
122
- command, a renamed package, a retired workflow, a wrong version number).
123
- - **Drifted** — the doc is technically correct but missing material the
124
- code now contains (a new package, a new build task, a new workflow, a
125
- new env profile).
126
- - **New opportunities** — content the doc does not have but probably
127
- should (a recently added feature area, a new observability surface).
128
-
129
- `decisions.md` is **append-only**: propose new entries on approval, but
130
- never rewrite or remove existing ones.
131
-
132
- ### 4. Report to the user (human-friendly, NOT a diff)
133
-
134
- In **init mode**, the report summarizes what each new file will contain
135
- (one paragraph per file describing scope and key sections drafted), and
136
- the "Proposed actions" list reads as `Create <path>` items.
137
-
138
- In **refresh mode**, the report follows the per-file findings format
139
- below.
140
-
141
- Output a single readable report in this exact shape:
142
-
143
- ```markdown
144
- # Documentation audit — <YYYY-MM-DD>
145
-
146
- Mode: <init | refresh>
147
-
148
- ## Summary
149
- <2-3 sentences: what was created or what needs attention overall>
150
-
151
- ## Per-file findings
152
-
153
- ### docs/architecture.md
154
- **Outdated:**
155
- - The package list mentions `legacy/` but that directory was removed in <commit>.
156
- - Lists framework version X.Y; build file now pins X.Z.
157
-
158
- **Drifted:**
159
- - A new top-level package is not mentioned.
160
-
161
- **New opportunities:**
162
- - A retry strategy was added in <PR>; worth a short paragraph.
163
-
164
- ### docs/local-setup.md
165
- **Outdated:**
166
- - (none)
167
-
168
- **Drifted:**
169
- - A new build/test task was added in <commit> but the doc does not list it.
170
-
171
- (... continue for each file ...)
172
-
173
- ### CLAUDE.md
174
- **Outdated:** (none)
175
- **Drifted:** Pointer to `docs/operations.md` is missing.
176
-
177
- ### README.md
178
- **Outdated:** Quick-start references an old env-var value that has been
179
- renamed.
180
-
181
- ## Proposed actions
182
-
183
- Numbered list of concrete edits I would make if you approve. Group by
184
- file. Each item is one sentence — no diffs.
185
-
186
- ## Verified against source
187
-
188
- List what was checked to ensure accuracy:
189
- - Commands: <which tasks were confirmed and how>
190
- - Config keys: <which files were read for exact property names>
191
- - Directories: <which directories were listed>
192
- - Workflow triggers: <which workflow files were read>
193
- - Credentials: <confirm no repo-tracked file instructions>
194
-
195
- ## Awaiting your approval
196
-
197
- Reply "apply" to make the changes, "apply <numbers>" to apply a subset
198
- (e.g. "apply 1,3,5"), or "skip" to make no changes.
199
- ```
200
-
201
- If a bucket is empty for a file, write `(none)` — do not omit the bucket.
202
- This makes it obvious that the check ran.
203
-
204
- ### 5. Apply on approval
205
-
206
- - On `apply` — create or edit each affected file. In init mode this means
207
- creating all seven files from the drafts in step 3a. In refresh mode
208
- it means editing existing files in place. Preserve `Scope` blocks. Do
209
- not reorganize content across files. Do not change file names.
210
- - On `apply <numbers>` — apply only the selected proposed actions.
211
- - On `skip` — make no edits or creations; thank the user and exit.
212
- - After applying, print a short summary of which files were created or
213
- changed and suggest a commit message.
214
-
215
- ## Hard rules
216
-
217
- - **Apply edits only after explicit user approval.** No file under `docs/`,
218
- `CLAUDE.md`, or `README.md` is edited before the user replies `apply` or
219
- `apply <numbers>`.
220
- - **`decisions.md` is append-only.** New entries may be added on approval;
221
- existing entries are never edited or removed.
222
- - **Preserve every `> **Scope:**` block** verbatim on edited docs.
223
- - **Do not move content between files.** Each file's scope is the
224
- convention. If content does not fit any of the five, mention it in the
225
- report and ask whether to create a new file or fold it elsewhere.
226
- - **Do not fabricate.** If the repo has no dashboards, no runbooks, no
227
- decisions yet, leave honest placeholders or empty sections.
228
- - **Verify every factual claim.** Before including any command, config key,
229
- directory description, or workflow trigger in the docs, confirm it against
230
- the actual source file. See the verification checklist in step 3a.
231
- - **Never reference repo-tracked files for credentials.** Always use
232
- user-home paths (`~/.gradle/gradle.properties`, `~/.m2/settings.xml`,
233
- `~/.npmrc`, `~/.pypirc`) or environment variables / ADC.
234
- - **Never use `--remote` in submodule commands.** Use pinned commits for
235
- reproducible builds.
236
- - **Qualify universal statements.** If writing "all endpoints do X," verify
237
- there are no exceptions and add qualifiers if needed.
238
- - **Do not delete sections without flagging them.** Surfacing a removal
239
- belongs in the report, not as a silent edit.
240
- - **Do not edit `.github/PULL_REQUEST_TEMPLATE.md`, CI files, or code.**
241
- This skill only touches docs.
242
- - **Keep `CLAUDE.md` ≤ 40 lines and `README.md` ≤ 30 lines** after edit.
243
- If pointers no longer fit, ask before expanding.
244
-
245
- ## Canonical templates
246
-
247
- When in init mode, use these skeletons. Fill from the repo scan.
248
-
249
- ### `docs/architecture.md`
250
-
251
- ```markdown
252
- # Architecture
253
-
254
- > **Scope:** What this system is, how it's structured, and the domain it models.
255
- > Put here: tech stack, package/module layout, key components, domain entities,
256
- > cross-cutting concerns (auth, multi-tenancy, observability).
257
- > Do **not** put here: how to run it (→ local-setup.md), how to deploy it
258
- > (→ operations.md), code style (→ conventions.md).
259
- >
260
- > **Referenced from:** `README.md` and `CLAUDE.md`.
261
-
262
- ## Overview
263
- ## Package Structure
264
- ## Key Libraries
265
- ## Domain Model
266
- ## Cross-Cutting Concerns
267
- ```
268
-
269
- ### `docs/local-setup.md`
270
-
271
- ```markdown
272
- # Local Setup
273
-
274
- > **Scope:** Everything needed to clone, run, and test on a fresh machine.
275
- > Put here: prerequisites, full setup steps, env vars, build/test commands,
276
- > troubleshooting.
277
- > Do **not** put here: deployment (→ operations.md), architecture
278
- > (→ architecture.md).
279
- >
280
- > **Referenced from:** `README.md` quick-start (links here for detail) and `CLAUDE.md`.
281
-
282
- ## Prerequisites
283
- ## Run the Service
284
- ## Common Tasks
285
- ## Environment Profiles
286
- ## Troubleshooting
287
- ```
288
-
289
- ### `docs/conventions.md`
290
-
291
- ```markdown
292
- # Conventions
293
-
294
- > **Scope:** How we write and review code in this repo.
295
- > Put here: language conventions, testing philosophy, naming rules, API
296
- > rules, migration rules, PR norms.
297
- > Do **not** put here: architecture (→ architecture.md), ops (→ operations.md).
298
- >
299
- > **Referenced from:** `CLAUDE.md` (so AI agents follow these) and `README.md`.
300
-
301
- ## Code Style
302
- ## Testing
303
- ## API Conventions
304
- ## Database Migrations
305
- ## PRs and Commits
306
- ```
307
-
308
- ### `docs/operations.md`
309
-
310
- ```markdown
311
- # Operations
312
-
313
- > **Scope:** What happens after merge — deploy, run, observe, recover.
314
- > Put here: deploy pipelines, environments, secrets source, dashboards,
315
- > alerts, runbooks.
316
- > Do **not** put here: architecture (→ architecture.md), local dev
317
- > (→ local-setup.md).
318
- >
319
- > **Referenced from:** `README.md` and `CLAUDE.md`.
320
-
321
- ## Deploy
322
- ## Secrets
323
- ## Observability
324
- ## Common Runbooks
325
- ## On-Call
326
- ```
327
-
328
- ### `docs/decisions.md`
329
-
330
- ```markdown
331
- # Decisions
332
-
333
- > **Scope:** Short, append-only log of *why* this codebase is the way it is.
334
- > Captures decisions whose rationale is not obvious from reading the code.
335
- > Put here: framework choices, trade-offs taken, deliberate deviations.
336
- > Do **not** put here: how-to instructions, code-level comments.
337
- >
338
- > **Referenced from:** `CLAUDE.md`, and linked from PRs that introduce a
339
- > non-obvious choice.
340
-
341
- ## Format
342
-
343
- Append a new entry as a new top-level section. Don't edit prior entries —
344
- if a 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're giving 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 (Claude Code, Copilot CLI). Keep this file short —
362
- point to `docs/` for substance.
363
-
364
- ## What this repo is
365
-
366
- <one-paragraph description from the repo scan>
367
-
368
- ## Where things live
369
-
370
- - **Architecture, domain model, package layout** → [docs/architecture.md](docs/architecture.md)
371
- - **Build / run / test commands** → [docs/local-setup.md](docs/local-setup.md)
372
- - **Code style, testing conventions, API/migration rules** → [docs/conventions.md](docs/conventions.md)
373
- - **Deploy, secrets, observability, runbooks** → [docs/operations.md](docs/operations.md)
374
- - **Why things are the way they are** → [docs/decisions.md](docs/decisions.md)
375
-
376
- ## Rules for working in this repo
377
-
378
- <3-6 short bullets — only repo-specific gotchas an agent must follow on
379
- every turn. Do not duplicate detail that lives in docs/>
380
- ```
381
-
382
- ### `README.md`
383
-
384
- ```markdown
385
- # <repo name>
386
-
387
- <one-paragraph description>
388
-
389
- ## Quick start
390
-
391
- <3-5 lines: the shortest possible happy path>
392
-
393
- Requires <prereqs>. For detail see [docs/local-setup.md](docs/local-setup.md).
394
-
395
- ## Documentation
396
-
397
- - [Architecture](docs/architecture.md) — system overview, domain model, package layout
398
- - [Local setup](docs/local-setup.md) — full setup, tasks, troubleshooting
399
- - [Conventions](docs/conventions.md) — code style, testing, API & migration rules
400
- - [Operations](docs/operations.md) — deploy, secrets, observability, runbooks
401
- - [Decisions](docs/decisions.md) — why things are the way they are
402
- ```