incitaciones 0.7.0 → 0.9.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.
Files changed (45) hide show
  1. package/README.md +4 -7
  2. package/content/distilled/close/SKILL.md +11 -3
  3. package/content/distilled/code-review/SKILL.md +1 -1
  4. package/content/distilled/code-review/references/criteria.md +2 -1
  5. package/content/distilled/codebase-cartography/SKILL.md +4 -3
  6. package/content/distilled/codebase-cartography/references/report-template.md +59 -7
  7. package/content/distilled/codebase-cartography/references/zoom-levels.md +11 -3
  8. package/content/distilled/context-guardian.md +3 -2
  9. package/content/distilled/create-issues/SKILL.md +3 -1
  10. package/content/distilled/create-issues/references/templates.md +1 -0
  11. package/content/distilled/file-headers.md +26 -0
  12. package/content/distilled/implement-plan/SKILL.md +2 -0
  13. package/content/distilled/implement-plan/references/verification-template.md +1 -0
  14. package/content/distilled/issue-review/SKILL.md +1 -0
  15. package/content/distilled/issue-review/references/pass-5-executability.md +2 -0
  16. package/content/distilled/modularity-diagnostician.md +1 -0
  17. package/content/distilled/resonant-refactor.md +2 -1
  18. package/content/distilled/tdd/SKILL.md +3 -2
  19. package/content/distilled/tdd/references/criteria.md +1 -0
  20. package/content/distilled/whisper/SKILL.md +47 -83
  21. package/content/manifest.json +28 -8
  22. package/package.json +1 -1
  23. package/pi-package/prompts/file-headers.md +10 -0
  24. package/pi-package/prompts/whisper.md +1 -1
  25. package/pi-package/skills/close/SKILL.md +11 -3
  26. package/pi-package/skills/code-review/SKILL.md +1 -1
  27. package/pi-package/skills/code-review/references/criteria.md +2 -1
  28. package/pi-package/skills/codebase-cartography/SKILL.md +4 -3
  29. package/pi-package/skills/codebase-cartography/references/report-template.md +59 -7
  30. package/pi-package/skills/codebase-cartography/references/zoom-levels.md +11 -3
  31. package/pi-package/skills/context-guardian/SKILL.md +3 -2
  32. package/pi-package/skills/create-issues/SKILL.md +3 -1
  33. package/pi-package/skills/create-issues/references/templates.md +1 -0
  34. package/pi-package/skills/file-headers/SKILL.md +32 -0
  35. package/pi-package/skills/implement-plan/SKILL.md +2 -0
  36. package/pi-package/skills/implement-plan/references/verification-template.md +1 -0
  37. package/pi-package/skills/issue-review/SKILL.md +1 -0
  38. package/pi-package/skills/issue-review/references/pass-5-executability.md +2 -0
  39. package/pi-package/skills/modularity-diagnostician/SKILL.md +1 -0
  40. package/pi-package/skills/resonant-refactor/SKILL.md +2 -1
  41. package/pi-package/skills/tdd/SKILL.md +3 -2
  42. package/pi-package/skills/tdd/references/criteria.md +1 -0
  43. package/pi-package/skills/whisper/SKILL.md +48 -84
  44. package/scripts/cli.mjs +7 -2
  45. package/scripts/generate-pi-resources.mjs +5 -0
package/README.md CHANGED
@@ -39,13 +39,10 @@ cd incitaciones
39
39
  **Install options:**
40
40
 
41
41
  ```bash
42
- ./install.sh --bundle essentials # Core prompts only
43
- ./install.sh --bundle planning # Planning workflows
44
- ./install.sh --bundle reviews # Review prompts
45
- ./install.sh --bundle documentation # Documentation tools
42
+ ./install.sh --bundle essentials # Core prompts only (see all 8 bundles: --list)
43
+ ./install.sh --list # Show available prompts and bundles
46
44
  ./install.sh --format commands # Legacy flat-file format for other tools
47
45
  ./install.sh --disable-model-invocation # Require explicit /skill:name usage
48
- ./install.sh --list # Show available prompts
49
46
  ./install.sh --help # Show all options
50
47
  ```
51
48
 
@@ -83,12 +80,12 @@ pi install git:github.com/charly-vibes/incitaciones
83
80
  pi install .
84
81
  ```
85
82
 
86
- The repository includes checked-in pi package resources under `pi-package/`, and the generation step can refresh them when content changes:
83
+ The npm package ships generated pi package resources under `pi-package/`. The directory is **gitignored, not checked in** — CI regenerates it during npm publish (`npm-publish.yml` runs `scripts/generate-pi-resources.mjs` before `npm publish`), so there is nothing to commit. Locally, the pre-push hook runs `just validate-pi-package`, which regenerates and verifies the resources match the manifest:
87
84
 
88
85
  - `pi-package/skills/` — Agent Skills with pi-compatible frontmatter
89
86
  - `pi-package/prompts/` — prompt templates for slash-command shortcuts
90
87
 
91
- After changing distilled content or manifest entries, run `just generate-pi-resources` and commit the updated `pi-package/` files.
88
+ After changing distilled content or manifest entries, you don't need to touch `pi-package/` — it is regenerated and validated automatically (CI on publish, pre-push hook locally). To preview the generated resources manually, run `just generate-pi-resources`.
92
89
 
93
90
  ### Publishing a new version
94
91
 
@@ -8,14 +8,22 @@ tools: Read, Write, Edit, Glob, Bash
8
8
 
9
9
  End the current session: log what was done, update tasks, route durable knowledge to `~/.whisper/`, commit and push, clear context.
10
10
 
11
- Uses `$JOURNAL_PATH` (defaults to `~/dev/status`) for the daily log journal, and `~/.whisper/` for accumulated operational knowledge. The log subdirectory defaults to `log/`; set `$JOURNAL_LOG_SUBDIR` to override (e.g. `areas/log` for the JORNAL layout).
11
+ Uses `$JOURNAL_PATH` for the daily log journal, and `~/.whisper/` for accumulated operational knowledge. Agent shells run non-interactive and never source `.bashrc`, so the environment may be missing these exports — resolve both values per step 1 (env → shell config → convention → legacy fallback).
12
12
 
13
13
  ## Steps
14
14
 
15
15
  1. Pull the journal repo:
16
16
  ```bash
17
- JOURNAL="${JOURNAL_PATH:-$HOME/dev/status}"
18
- LOG_SUBDIR="${JOURNAL_LOG_SUBDIR:-log}"
17
+ # Non-interactive shells never source .bashrc, so $JOURNAL_PATH etc. are
18
+ # usually unset here. Source the config in a throwaway shell — bash itself
19
+ # handles comments, quotes, and nested vars ($JORNAL) — then fall back.
20
+ shellval() { bash -c 'source ~/.bashrc >/dev/null 2>&1; printf "%s\n" "${'"'$1'"'}"' 2>/dev/null; }
21
+ JOURNAL="${JOURNAL_PATH:-$(shellval JOURNAL_PATH)}"
22
+ [ -n "$JOURNAL" ] || JOURNAL="$(shellval JORNAL)"
23
+ [ -n "$JOURNAL" ] || JOURNAL="$HOME/para/areas/jornal" # JORNAL convention
24
+ [ -d "$JOURNAL/.git" ] || JOURNAL="$HOME/dev/status" # legacy clone; flag this fallback in the reply
25
+ LOG_SUBDIR="${JOURNAL_LOG_SUBDIR:-$(shellval JOURNAL_LOG_SUBDIR)}"
26
+ [ -n "$LOG_SUBDIR" ] || LOG_SUBDIR="areas/log"
19
27
  cd "$JOURNAL" && git pull
20
28
  ```
21
29
 
@@ -1,4 +1,4 @@
1
- <!-- skill: code-review, version: 1.2.0, status: verified -->
1
+ <!-- skill: code-review, version: 1.3.0, status: verified -->
2
2
  # Iterative Code Review (Rule of 5)
3
3
 
4
4
  Perform a multi-pass, iterative code review using Steve Yegge's Rule of 5 to achieve high-quality refinement through breadth-first exploration.
@@ -8,7 +8,7 @@ Use these criteria to categorize findings and determine when the review process
8
8
  | :--- | :--- | :--- |
9
9
  | **CRITICAL** | Blocks merge. Severe security vulnerability, data loss risk, or fundamental logic failure. | SQL Injection, plaintext passwords, unhandled exceptions in core path. |
10
10
  | **HIGH** | Should fix before merge. Significant performance issue, major regression risk, or violation of key requirements. | Missing index on hot query, non-singular requirement, missing error states. |
11
- | **MEDIUM** | Consider addressing. Minor technical debt, sub-optimal pattern, or readability issues. | Magic strings, DRY violations, lack of docstrings, magic numbers. |
11
+ | **MEDIUM** | Consider addressing. Minor technical debt, sub-optimal pattern, or readability issues. | Magic strings, DRY violations, lack of docstrings, missing or stale file-header Purpose (see `file-headers`), magic numbers. |
12
12
  | **LOW** | Nice to have. Stylistic improvements, minor metadata gaps, or typos in non-critical comments. | Minor formatting, redundant comments, small consistency improvements. |
13
13
 
14
14
  ## Convergence Criteria
@@ -47,4 +47,5 @@ Use these criteria to categorize findings and determine when the review process
47
47
  ### Stage 5: EXCELLENCE
48
48
  - Performance optimization?
49
49
  - Documentation polish?
50
+ - File headers: every touched source file's Purpose is present, one-sentence-accurate, and not stale; Rationale reflects the current design (see `file-headers`)?
50
51
  - Style consistency?
@@ -31,11 +31,12 @@ Pick the entry level from the request:
31
31
  - Before gathering evidence for any map (and again before rendering), read `references/zoom-levels.md` — per-level evidence collection commands and text rendering formats.
32
32
  - Before any health check or when the user asks about "health", "smells", or refactoring targets, read `references/smell-signatures.md` — anti-pattern proxies, evidence requirements, severity ratings.
33
33
  - Before writing the final output, read `references/report-template.md` — output structure per mode.
34
- - When the user asks for an HTML export or a shareable version of the report, read the "Optional HTML Export" section at the end of `references/report-template.md`.
34
+ - When the user asks for an HTML export or a shareable version of the report, read the "Optional HTML Export" section at the end of `references/report-template.md`; when the request spans multiple reports (batch), also read its "Batch export" section.
35
35
 
36
36
  ## Zoom Discipline
37
37
 
38
- - Offer adjacent levels as follow-ups; never dump all three maps unrequested.
38
+ - Offer adjacent levels as follow-ups; never dump all three maps unrequested. An explicit batch request ("all reports", "map every module") is a user request — the offer-don't-dump rule applies to unprompted follow-ups only (batch procedure in `references/report-template.md`, "Batch export" section).
39
+ - Re-verify every embedded count and fan-in/fan-out number against a fresh command run immediately before writing each report (one consolidated pass per batch is fine) — counts gathered early in a long session drift.
39
40
  - Every claim carries a file reference (`path`, or `path:line` for specific symbols).
40
41
  - State dependency direction explicitly (A → B); never "related to".
41
42
  - Distinguish observed evidence from inference; label inference explicitly.
@@ -48,4 +49,4 @@ Pick the entry level from the request:
48
49
  - Prefer structural facts over narrative: dependency direction, counts, boundaries.
49
50
  - Health-check findings follow the evidence format in `references/smell-signatures.md` (pattern, evidence, quantity, severity) — never unanchored opinions.
50
51
  - Maps are diff-able artifacts: tables and Mermaid, not prose walls.
51
- - HTML export is derived output, produced only on request; the markdown report remains the artifact of record.
52
+ - HTML export is derived output, produced only on request; the markdown report remains the artifact of record. Exports live in `docs/cartography/` as a self-contained directory (index + shared assets); see the "Optional HTML Export" section of `references/report-template.md`.
@@ -12,10 +12,11 @@ Structure the final output by mode. All modes share the closing sections. Keep m
12
12
 
13
13
  ## Mode: macro
14
14
 
15
- 1. **Module inventory** — table (module, path, responsibility, deps out, fan-in)
15
+ 1. **Module inventory** — table (module, path, responsibility, weight bar, deps out, fan-in)
16
16
  2. **Dependency matrix** — text DSM with ↑ marks for layer violations
17
17
  3. **Module graph** — Mermaid, edges labeled with counts
18
- 4. Structural observations
18
+ 4. **Composition** — disk-reality breakdown by file kind (source / test / generated / vendored / config), excluded code included; distinct from the inventory weight column (analysis code, exclusions applied)
19
+ 5. Structural observations
19
20
 
20
21
  ## Mode: meso
21
22
 
@@ -60,16 +61,67 @@ One finding block per pattern (format in `smell-signatures.md`), ordered by seve
60
61
 
61
62
  **Adjacent levels offered** — one line each, e.g. "meso map of ledger available on request".
62
63
 
64
+ ## Batch export
65
+
66
+ An explicit batch request ("generate all the reports", "map every module") is a user request — Zoom Discipline's offer-don't-dump rule applies to unprompted follow-ups only.
67
+
68
+ - Enumerate targets from the module inventory. Confirm the list once when it exceeds 3 targets or the scope is ambiguous; proceed unless corrected.
69
+ - One markdown per target in `docs/cartography/` — each the artifact of record for its target. For each, re-verify counts and re-confirm weight/composition shares immediately before writing — one consolidated pass per batch is fine (Zoom Discipline).
70
+ - Include a health report only if the batch request names health/smells.
71
+ - A target too large for one pass: skip it, mark it as "offered — too large for one pass" in the final summary and, when HTML export is part of the batch, in `index.html`. Do not stop the batch to ask.
72
+ - Superseded artifacts from older exports (old-format HTML pages, render scripts): regenerate in place, recommend deleting the superseded script/pages, and never index stale-format files.
73
+ - When HTML export is part of the batch request or separately requested, HTML pages and `index.html` follow the Optional HTML Export section (regenerate the index once at the end, covering all reports).
74
+
63
75
  ## Optional HTML Export
64
76
 
65
- Produce only on request ("export as HTML", "shareable report"). The markdown report is the source of truth; the HTML file is a derived, regenerable view — never hand-edit it, regenerate it from the markdown.
77
+ Produce only on request ("export as HTML", "shareable report"). The markdown report is the source of truth; the HTML files are a derived, regenerable view — never hand-edit them, regenerate them from the markdown.
78
+
79
+ The export is a **self-contained directory**: all pages plus shared assets under one folder, opening correctly via `file://`, offline, with no server, CDN at view time, or build step. JavaScript is permitted only as a local vendored asset (see Diagrams).
80
+
81
+ ### Output directory
82
+
83
+ - All exports live in `docs/cartography/` (create directories as needed). If `docs/` does not already exist in the repo, confirm once with the user before creating it.
84
+ - Pages reference assets with relative paths (`assets/...`), never absolute or remote URLs.
85
+
86
+ ### Files
87
+
88
+ - One page per report: `cartography-<level>-<target>.html` (e.g. `cartography-meso-payments-billing.html`; slugify the target with hyphens, no dots or spaces). The zoom level in the name prevents exports of different levels overwriting each other. Re-exporting the same level+target overwrites the previous file — intended; there is no history.
89
+ - `index.html` — regenerated on every export; never hand-maintained.
90
+ - `assets/mermaid.min.js` — vendored Mermaid v9.4.3 IIFE build, shared by all pages.
91
+
92
+ ### Index
93
+
94
+ Regenerate `index.html` on every export from what is on disk plus what is known this session:
95
+
96
+ - Scan `docs/cartography/*.html` (excluding `index.html`), group entries by zoom level (macro / meso / micro / health), sorted alphabetically.
97
+ - Each entry links to the page and shows its target plus a one-line scope taken from the report header.
98
+ - Also list markdown reports known to this session (the artifact of record), linked with a repo-relative path from the HTML location. Do not invent paths for reports you cannot locate.
99
+ - The template must handle N=1 (a single entry) without looking broken.
100
+ - Deterministic: sorted, no timestamps, no generator metadata.
101
+
102
+ ### Navigation
103
+
104
+ - Every page (including `index.html`) has a plain nav header: `← Index` plus links to parent-context and adjacent-level pages when they exist (meso → its macro page; micro → its macro/meso parent). Relative links only.
105
+ - Static links only — no interactivity. Do not evolve the export into an application — no servers, frameworks, or interactive controls. If live interaction is requested, note it is out of scope for this skill.
106
+
107
+ ### Diagrams
108
+
109
+ - Render Mermaid client-side with the vendored local asset: `<script src="assets/mermaid.min.js"></script>` plus `<pre class="mermaid">` blocks. Use only the v9.x IIFE build (global `mermaid`); v10+ is ESM-only and is blocked by CORS under `file://`.
110
+ - Asset acquisition: on the first export, download `mermaid.min.js` v9.4.3 into `assets/` if absent (e.g. from jsDelivr); reuse thereafter. If the download fails (offline machine), still emit all pages — diagrams degrade to their source in a styled `<pre>` and the report footer notes "diagrams show source; rerun the export with network access to enable rendering". Never fail the whole export because of assets.
111
+ - Every diagram keeps its Mermaid source in `<details><pre class="mermaid-source">` as the no-JS fallback, so nothing is ever blank.
112
+ - Prose stays pre-rendered HTML — do not client-render markdown. The markdown report remains the artifact of record.
113
+
114
+ ### Handoff
115
+
116
+ - Final step of any export (including the first): tell the user to open `docs/cartography/index.html` directly in a browser — `file://` works with no server; diagram rendering is guaranteed by the Diagrams section.
117
+ - Never start a server for static reports unless the user explicitly asks.
66
118
 
67
- Produce ONE self-contained file, `cartography-<level>-<target>.html` (e.g. `cartography-meso-payments-billing.html`; slugify the target with hyphens), next to the markdown report — or, if no report file was written this session, ask the user where to save it (default `docs/`). The zoom level in the name prevents exports of different levels overwriting each other.
119
+ ### Invariants
68
120
 
69
- - **Self-contained:** one inline `<style>` block. No CDN, no external CSS/JS/fonts, no build step, no server. Must open correctly offline.
70
- - **No JavaScript:** diagrams render as styled `<pre>` blocks (text diagrams) or inline SVG producible without new dependencies. Keep the Mermaid source in the file (e.g. `<pre class="mermaid-source">`) so the diagram stays manipulable.
121
+ - **Write HTML directly:** no render scripts, build pipelines, or new dependencies (pandoc etc.) — even in batch mode. The regeneration path is re-running this skill, not a committed pipeline; exception only on explicit user request (note the dependency caveat in the reply).
71
122
  - **Mirror, don't redesign:** same sections, same order, same content as the markdown report. The HTML adds presentation only (readable typography; `prefers-color-scheme` support optional).
72
123
  - **Deterministic:** stable section order, no timestamps, no generator metadata.
73
124
  - **Size guard:** render large reports as-is; never paginate, collapse, or add interactivity.
125
+ - **Commit-able:** reports and `assets/` are self-contained and offline-safe; suggest committing them, never silently gitignore.
74
126
 
75
- Do not evolve the export into an application — no servers, frameworks, or interactive controls. If live interaction is requested, note it is out of scope for this skill.
127
+ Decision record: diagrams use a vendored local Mermaid v9.4.3 IIFE; prose is pre-rendered. Rationale: offline rendering, `file://` compatibility, no ESM/CORS issues. Render scripts and build pipelines are banned because agent-regeneration keeps the navigation/diagram/index guarantees that build scripts historically dropped (wai cartography batch, 2026-09-01: a pandoc pipeline produced 12 pages with zero cross-links and unrendered diagrams).
@@ -13,13 +13,19 @@ Adapt import syntax to the language (see language rule below).
13
13
  2. Inter-module imports: scan import statements crossing module boundaries. Quoting-safe scan (works in POSIX shells), e.g. JS/TS: `rg 'from ["'"'"']' --type js --type ts` or simply `rg 'import|require'`; then filter by path.
14
14
  3. Count edges per pair of modules to get a weighted dependency list.
15
15
  4. Determine layering for violation flags: use the repo's declared layering (README/ARCHITECTURE/docs) if present; otherwise infer it from the majority dependency direction and label that inference in the report.
16
+ 5. **Weight & composition:** size each module by LOC (default) or file count (mixed-language repos, where LOC is not comparable across languages). Tool: `tokei` (apply the step-1 globs via `tokei -e ...`, or `cloc`); fallback: `rg --files -0 <exclusion globs> | xargs -0 wc -l`, summed per module. Two distinct metrics:
17
+ - **Weight** (inventory column) — analysis code only, same exclusions as all counts (step 1).
18
+ - **Composition** (report block) — disk reality: all code grouped by kind (source / test / generated / vendored / config), excluded code included. Classify by path/name conventions (`tests/`, `test_*.py`, `*_test.go`, `*.spec.ts` → test; step-1 exclusion-glob hits → generated/vendored; lockfiles, manifests, dotfiles → config). Works without modules too (flat/script repos): group by top-level directory or language.
19
+ If neither tool nor fallback works, degrade to file-count-only weight and note it in the report.
16
20
 
17
21
  **Render:**
18
22
 
19
23
  Module inventory table:
20
24
 
21
- | Module | Path | Responsibility (one line, from evidence) | Deps out → | Fan-in |
22
- | :---- | :---- | :---- | :---- | :---- |
25
+ | Module | Path | Responsibility (one line, from evidence) | Weight | Deps out → | Fan-in |
26
+ | :---- | :---- | :---- | :---- | :---- | :---- |
27
+
28
+ Weight bar: 10-cell `▓/░` bar proportional to the module's share of total weight, rounded to nearest cell, minimum 1 filled cell when weight > 0, followed by an integer percentage — e.g. `▓▓▓▓▓▓▓░░░ 67%`. Weight flags candidate targets for deeper levels; size ≠ complexity (a big cohesive module can be cheaper to map than a small hotspot).
23
29
 
24
30
  Text dependency matrix (DSM-style). Rows depend on columns; mark `↑` for a dependency that skips a layer or points "backward" against the declared — or inferred (see collect step 4) — layering:
25
31
 
@@ -39,7 +45,7 @@ graph TD
39
45
  jobs --> core
40
46
  ```
41
47
 
42
- **Facts to surface:** layering violations (↑ marks), cycles, hub modules (highest fan-in/out), orphan modules (zero fan-in).
48
+ **Facts to surface:** layering violations (↑ marks), cycles, hub modules (highest fan-in/out), orphan modules (zero fan-in), bulk distribution (largest modules by weight; share of total).
43
49
 
44
50
  ## Meso — Module / Feature Wiring
45
51
 
@@ -97,3 +103,5 @@ RefundRequest{invoiceId, amount} → validated Amount → gateway response → L
97
103
  ```
98
104
 
99
105
  **Facts to surface:** where purity ends (first I/O hop), total hops, state mutated, error paths encountered (report; do not evaluate their quality).
106
+
107
+ Decision record: macro maps encode scale as a proportional weight bar in the inventory table (treemap area-encoding, phronemophobic "Treemaps are awesome!") plus a Composition block, not as literal treemap graphics — the vendored Mermaid v9.4.3 has no treemap diagram (v11.5+ is ESM-only, CORS-blocked under `file://`) and an ASCII treemap is less diff-able than the bar column. (treemap evaluation, 2026-09-05)
@@ -12,9 +12,10 @@ You are the Gatekeeper of the Architecture. Before generating any code, always r
12
12
  **Directives**:
13
13
  1. FORBIDDEN: writing raw logic if a higher-level abstraction exists (no raw fetch() if useApi() exists, no inline error handling if handleError() exists, no raw CSS if a design system exists)
14
14
  2. Add `// Reusing: [Name] — avoids duplicating [what]` comments when using existing abstractions
15
- 3. Refusal Protocol: if asked to violate architecture — STOP, explain the rule being violated, propose the resonant alternative instead
15
+ 3. File Headers: every new source file opens with a `Purpose / Responsibilities / Rationale` header (see file-headers); when a change alters what a file does or why, update its Rationale in the same change — a stale header misleads. If the Purpose can't be stated in one sentence, the file mixes concerns: flag it for splitting instead of writing a vague header
16
+ 4. Refusal Protocol: if asked to violate architecture — STOP, explain the rule being violated, propose the resonant alternative instead
16
17
 
17
18
  **Output structure for every response**:
18
19
  1. Reuse Plan: "I will build X using [existing abstractions]. I need new code for [only what's new]."
19
20
  2. Code (with Reusing comments)
20
- 3. Verification checklist: all abstractions reused? no raw logic where abstraction exists? style conventions followed?
21
+ 3. Verification checklist: all abstractions reused? no raw logic where abstraction exists? style conventions followed? file headers present (new files) and current (changed files)?
@@ -1,4 +1,4 @@
1
- <!-- skill: create-issues, version: 1.3.0, status: verified -->
1
+ <!-- skill: create-issues, version: 1.4.0, status: verified -->
2
2
  # Tracer-Bullet Issue Creation from Plan
3
3
 
4
4
  Break a reviewed plan into independently grabbable issues using tracer-bullet vertical slices.
@@ -45,6 +45,7 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
45
45
  - end-to-end behavior description
46
46
  - concrete file paths or subsystems when knowable
47
47
  - binary acceptance criteria
48
+ - a **file-header criterion** when the slice creates source files or changes a file's contract: new files open with `Purpose / Responsibilities / Rationale`; contract-changing edits update Rationale (see `file-headers`)
48
49
  - a **Verifiable Value Claim** where measurable: quantified **Must** gate (unit + number, no adjectives), a runnable **Meter** command, the measured **Baseline**, and the **regression suite** that must keep passing
49
50
  - **anti-goals** whenever the ticket touches tests, lockfiles, or public interfaces (prohibit test-assertion edits, dependency additions, API breaks)
50
51
  - explicit blocked-by field
@@ -83,6 +84,7 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
83
84
  - **Workflow integrity:** TDD and Tidy First language is mandatory in every implementation issue.
84
85
  - **No guessed IDs:** capture identifiers from actual command output.
85
86
  - **Quantify the gate:** every measurable acceptance criterion is a number with a unit, backed by a runnable Meter command.
87
+ - **Self-describing files:** tickets that create source files or change a file's contract carry the file-header criterion (see `file-headers`).
86
88
  - **Name the cheats:** add anti-goals wherever the gate could be gamed (test edits, new deps, API breaks).
87
89
  - **Anchor staleness:** always record `base_commit` metadata at creation; never publish a ticket anchored to nothing.
88
90
  - **Stop and ask:** if the plan only supports horizontal decomposition, propose a vertical rewrite before publishing.
@@ -43,6 +43,7 @@ Ref: [Link to plan/spec file and section]
43
43
  - [ ] [Binary, observable criterion 1]
44
44
  - [ ] [Binary, observable criterion 2]
45
45
  - [ ] [Automated tests cover the slice end-to-end]
46
+ - [ ] [When the slice creates source files or changes a file's contract: file-header criterion — new files carry Purpose/Responsibilities/Rationale; changed files update Rationale (see `file-headers`)]
46
47
 
47
48
  ## Blocked by
48
49
 
@@ -0,0 +1,26 @@
1
+ <!-- Full version: content/prompt-system-file-headers.md -->
2
+ You enforce file-header documentation on source code. Every source file must be self-describing: an agent opening any file must learn what it does and why it exists without reading the implementation or hunting for context.
3
+
4
+ **HEADER FORMAT** (adapt the comment syntax to the language — `#`, `//`, `--`, `"""docstring"""`, or a top doc comment):
5
+
6
+ ```
7
+ # Purpose: <one sentence — what this file does and for whom>
8
+ # Responsibilities:
9
+ # - <bullet 1 — the cohesion contract; one concern per bullet>
10
+ # - <bullet N>
11
+ # Rationale: <latest design decision and why, with issue/PR link>
12
+ # <earlier rationale entries belong in the issue tracker / git history>
13
+ ```
14
+
15
+ **Rules:**
16
+ 1. Every NEW source file opens with a complete header before any logic.
17
+ 2. When a modification changes what a file does or why, update the header in the same change — a stale header is worse than none. Do not touch the header for behavior-preserving edits.
18
+ 3. Purpose is one sentence. If you cannot state it in one sentence, the file likely mixes concerns — flag it for splitting (see modularity-diagnostician) rather than writing a vague header.
19
+ 4. Rationale keeps only the latest entry. History lives in the issue tracker and git, not the file.
20
+ 5. Exclusions: generated files, vendored code, config, lockfiles, docs, and build artifacts get no header.
21
+
22
+ **Scope — "source file" means:** files containing logic or defining structure written by this project (modules, classes, scripts, routes, components, tests). Not applicable to READMEs, org notes, or one-liner re-exports.
23
+
24
+ **Audit:** to find missing headers: `grep -rLE "(Purpose:|@purpose)" --include=<source-extensions> .` excluding vendored/generated paths. Every hit is a gap.
25
+
26
+ **Output:** when adding or updating headers, show file → header block. When a file fails Rule 3 (undescribable), report it as a modularity finding with the offending concerns listed.
@@ -11,6 +11,7 @@ Implement an approved plan using Red, Green, Refactor.
11
11
  - Implement the minimum code to pass.
12
12
  - Refactor while keeping tests green.
13
13
  - Run the success criteria checks.
14
+ - Check file headers: new source files open with Purpose/Responsibilities/Rationale; files whose contract changed have a current Rationale (see `file-headers`).
14
15
  - Update the plan with progress.
15
16
  4. Use `references/verification-template.md` when reporting phase completion.
16
17
  5. Use `references/common-situations.md` when the plan and reality diverge.
@@ -19,5 +20,6 @@ Implement an approved plan using Red, Green, Refactor.
19
20
 
20
21
  - Never skip the red phase.
21
22
  - Complete one phase at a time.
23
+ - Review file headers before declaring a phase complete: new files must carry them, and contract-changing edits must leave the Rationale current (see `file-headers`).
22
24
  - Do not blindly follow an outdated plan if the codebase contradicts it.
23
25
  - Wait for user confirmation before proceeding to the next phase.
@@ -5,6 +5,7 @@ Automated verification:
5
5
  - [x] All tests pass
6
6
  - [x] Type checking passes
7
7
  - [x] Build succeeds
8
+ - [x] File headers current: new files carry Purpose/Responsibilities/Rationale; changed files updated Rationale (see `file-headers`)
8
9
 
9
10
  Manual verification needed:
10
11
  - [ ] [Manual step 1]
@@ -28,6 +28,7 @@ Treat the best issue sets as:
28
28
  - minimal but sufficient dependency graphs
29
29
  - explicit about AFK vs HITL work
30
30
  - traceable back to stories, plans, or specs
31
+ - self-describing: tickets that create or reshape source files carry the file-header criterion (see `file-headers`) — undocumented files force agents to re-derive intent
31
32
  - machine-verifiable value claims: quantified Must gate, runnable Meter, explicit anti-goals, and a `base_commit` anchor that reveals staleness
32
33
 
33
34
  ## Rules
@@ -4,6 +4,7 @@ Focus on:
4
4
  - Can another developer or agent pick this up immediately?
5
5
  - Are verification steps concrete and end-to-end?
6
6
  - Is there a machine-checkable Must gate (quantified, unit + number) backed by a runnable Meter command?
7
+ - Are touched code files self-describing — Purpose/Responsibilities/Rationale header present and current (see `file-headers`)?
7
8
  - Are priorities and labels sensible?
8
9
  - Are HITL handoff points explicit?
9
10
  - Is it clear what demo, test, or observable behavior proves completion?
@@ -15,6 +16,7 @@ Watch for:
15
16
  - Qualitative acceptance criteria with no unit or threshold ("fast", "robust", "clean") — a Scale/Meter is missing
16
17
  - A Meter command that cannot run at the ticket's `base_commit` (stale claim) or that no fresh agent could execute verbatim
17
18
  - Missing anti-goals on tickets touching tests, lockfiles, or public interfaces (reward-hacking surface: nothing stops gaming the gate)
19
+ - Tickets that create or reshape source files with no file-header acceptance criterion — undocumented files force every implementing agent to re-derive intent
18
20
  - No regression suite named (pass-to-pass coverage unspecified)
19
21
  - HITL work masquerading as AFK
20
22
  - Tickets that cannot be closed without information from another issue not listed as a blocker
@@ -23,6 +23,7 @@ Step 1 — Detect Modularity Signals: Read all files. Identify:
23
23
  - High Afferent Coupling (Medium): module depended upon by many consumers — alterations trigger widespread ripple effects
24
24
  - Temporal Coupling (Medium): files co-changing in commits despite no static dependency — reveals hidden dependencies (skip if no git/co-change data provided)
25
25
  - Missing Boundary (Medium): related functionality spread across modules with no clear owning package
26
+ - Undescribable Module (Medium): a file's purpose cannot be stated in one sentence — the file-header Purpose is missing, stale, or forced to be vague (see `file-headers`). The header is the cohesion contract; needing three sentences means the module is doing three jobs
26
27
  Note file, line range, and description for each.
27
28
 
28
29
  Step 2 — Classify Modularity Scope: For each signal, assess:
@@ -41,5 +41,6 @@ Self-correction: on failure, attempt fix up to 3 times. If all 3 fail: run `git
41
41
  - Run linter on modified files
42
42
  - Run full test suite
43
43
  - Add docstring to new abstraction: what it does, why it exists, parameters
44
+ - File headers: every touched source file has a `Purpose / Responsibilities / Rationale` header (see `file-headers`); contract-changing edits update the Rationale with this refactor's reason and issue link
44
45
 
45
- **Completion Report**: files modified, verification pass/fail, linter pass/fail, tests pass/fail, abstraction documented, recommended next step.
46
+ **Completion Report**: files modified, verification pass/fail, linter pass/fail, tests pass/fail, abstraction documented, file headers updated, recommended next step.
@@ -1,4 +1,4 @@
1
- <!-- skill: tdd, version: 1.1.0, status: verified -->
1
+ <!-- skill: tdd, version: 1.2.0, status: verified -->
2
2
  # Plan-Implement-Verify (TDD)
3
3
 
4
4
  Implement features or fixes using a disciplined, phase-based Test-Driven Development (TDD) workflow to ensure correctness, testability, and incremental progress.
@@ -19,7 +19,7 @@ You are a TDD Practitioner. Your goal is to ensure that no code is written witho
19
19
  * **Step 1: Write Failing Test (RED):** Write a test that describes the desired behavior. Run it and **confirm it fails** for the expected reason.
20
20
  * **Step 2: Implement Minimal Code (GREEN):** Write the simplest code possible to make the test pass. Run tests to confirm they are green.
21
21
  * **Step 3: Refactor If Needed:** Clean up the implementation while keeping tests green.
22
- * **Step 4: Verify Phase Completion:** Run full automated suites (tests, type-check, lint) and perform manual verification.
22
+ * **Step 4: Verify Phase Completion:** Run full automated suites (tests, type-check, lint), perform manual verification, and confirm every new source file opens with a Purpose/Responsibilities/Rationale header and every file whose contract changed has a current Rationale (see `file-headers`).
23
23
  * **Step 5: Inform User:** Present a summary of phase completion and wait for verification.
24
24
 
25
25
  3. **Verification (CRITICAL):**
@@ -32,6 +32,7 @@ You are a TDD Practitioner. Your goal is to ensure that no code is written witho
32
32
  - **One Phase at a Time:** Complete and verify a phase before starting the next.
33
33
  - **Keep Tests Green:** Never leave the codebase in a failing state at the end of a turn.
34
34
  - **Update Plan:** Mark phases as complete as you progress.
35
+ - **Self-Describing Files:** A phase is not complete if new files lack headers or contract-changing edits left headers stale (see `file-headers`).
35
36
 
36
37
  ## References
37
38
  - **Templates:** Use `references/templates.md` for plans and phase completion summaries.
@@ -16,6 +16,7 @@ Use these criteria to evaluate the quality of a TDD session.
16
16
  - [ ] Automated tests (unit, integration) cover new logic.
17
17
  - [ ] No regressions introduced in existing functionality.
18
18
  - [ ] Type-checking and linting are passing globally.
19
+ - [ ] New source files carry Purpose/Responsibilities/Rationale headers; changed files have current Rationale (see `file-headers`).
19
20
  - [ ] Plan is updated to reflect current progress.
20
21
 
21
22
  ## When to Stop & Ask
@@ -1,97 +1,61 @@
1
1
  ---
2
2
  name: whisper
3
- description: "Manage the ~/.whisper/ knowledge workspace: init, check, status, link plan to beads, decommission, and knowledge routing. Trigger when the user says '/whisper', '/w', 'init workspace', 'check workspace', 'workspace status', 'link plan', or 'decommission worktree'."
3
+ description: "Deterministic knowledge workspace management: init, check, status, link plan, decommission, and knowledge routing. Delegates the mechanical steps to the turu CLI (whisper-vibes) when installed; manual fallbacks otherwise. Trigger when the user says '/whisper', '/w', 'init workspace', 'check workspace', 'workspace status', 'link plan', or 'decommission'."
4
4
  tools: Read, Write, Edit, Bash
5
5
  ---
6
6
 
7
- # Whisper — Accumulated Operational Knowledge
7
+ # Whisper — Deterministic Operational Knowledge
8
8
 
9
- Manage `~/.whisper/` — a global, tiered knowledge directory that accumulates operational knowledge and planning context across all your work. Works with or without beads issue tracking.
9
+ > **This skill is a thin pointer.** The canonical, versioned copy ships with
10
+ > the `turu` CLI ([charly-vibes/whisper](https://github.com/charly-vibes/whisper),
11
+ > `cargo install whisper-vibes`) — install it with `turu skill install`.
12
+ > This file stays so agents without the binary have fallbacks.
10
13
 
11
- ## Directory Layout
14
+ The `turu` CLI owns every mechanical step: canonical repo keys, branch slugs,
15
+ worktree slots, and scope routing. Same inputs, same outputs — no more
16
+ hand-rolled shell pipelines.
12
17
 
13
- ```
14
- ~/.whisper/
15
- rules.md ← Global agent behavior rules (bd remember equiv)
18
+ ## Decision procedure
16
19
 
17
- repos/
18
- github.com/user/repo/
19
- env.md ← Repo-wide: deploy commands, infra facts, auth quirks
20
- branches/
21
- branch-slug/ ← One slot per branch (/ in name → -- in slug)
22
- context.md ← Branch anchor: repo, branch, beads epic ID, status
23
- plan.md ← Narrative implementation plan
24
- notes.md ← Free-form scratch and findings
25
- agents/ ← Optional sub-agent files when work is split across agents
26
- worktrees/
27
- worktree-name/ ← One slot per worktree (basename of worktree path)
28
- env.md ← Worktree-specific: ports, venvs, credentials, local-only setup
29
- ```
20
+ 1. **Is `turu` available?** Run `turu key --json`.
21
+ 2. **If yes** — everything mechanical is a turu command:
30
22
 
31
- **Branch slug rule:** `git rev-parse --abbrev-ref HEAD | sed 's|/|--|g'`
32
-
33
- **Worktree slot rule:** `basename $(git rev-parse --git-common-dir 2>/dev/null)` (the `.git` worktree dir name), or `basename $(pwd)` when not in a worktree.
34
-
35
- **Canonical repo key rule — derive it, never invent it:**
36
-
37
- ```bash
38
- repo_url=$(git remote get-url origin 2>/dev/null | sed 's|https://||;s|http://||;s|ssh://||;s|git@||;s|:|/|g;s|\.git$||')
39
- [ -z "$repo_url" ] && repo_url="local/$(basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")"
40
- ```
41
-
42
- `git@cv:org/repo.git` → `cv/org/repo`; `https://github.com/u/r` → `github.com/u/r`; no remote → `local/<repo-name>`. Colons always become slashes (keeps keys path-safe). The same key must come out of the same repo on every machine.
43
-
44
- If a directory keyed some other way already exists for this repo (bare name like `genesis/`, owner-only like `charly-vibes/`, alias host with a colon like `cv:charly-vibes/`), do **not** add a fourth variant — route new knowledge into the canonical key and offer `/w consolidate` to migrate the legacy one.
45
-
46
- ## Knowledge Routing
47
-
48
- When a session learns something worth keeping, route it by scope:
49
-
50
- | Scope | Test | Destination |
51
- |---|---|---|
52
- | **Global** | True for every repo and every project | `~/.whisper/rules.md` — append, don't overwrite |
53
- | **Repo-wide infra** | True regardless of which branch or feature you're on (deploy behavior, gateway/timeout limits, log retention, auth quirks) | `~/.whisper/repos/<host>/<repo>/env.md` — create or extend |
54
- | **Branch-specific** | Only matters for the work on *this* epic/branch | `~/.whisper/repos/<host>/<repo>/branches/<slug>/notes.md`, or `bd note <epic-id>` if beads is available |
55
- | **Worktree setup** | Credentials, service IDs, ports, venv/docker specifics for *this checkout* | `~/.whisper/repos/<host>/<repo>/worktrees/<name>/env.md` |
56
- | **Universal agent rule** | A standing instruction for how the agent should behave, independent of any branch or repo | `bd remember` if available, else `~/.whisper/rules.md` |
57
-
58
- **Rules:**
59
- - **No secrets anywhere.** Never write tokens, keys, passwords, or PII into `~/.whisper/`.
60
- - **Extend, don't duplicate.** Append to or correct an existing note rather than creating a new one that says the same thing.
61
- - **One repo, one key.** If more than one `repos/` directory belongs to the same repo, write into the canonical key and propose `/w consolidate` — never create a new variant.
62
- - **Search first.** Before creating a new entry, check if one already exists for the same topic.
63
- - If `bd` is not available, everything falls back to `~/.whisper/` files — there's no beads-backed alternative.
64
-
65
- ## Modes
66
-
67
- Determine mode from how the skill is triggered:
68
-
69
- | Trigger | Mode |
23
+ | Intent | Command |
70
24
  |---|---|
71
- | `/w init` or `~/.whisper/` does not exist | **init** |
72
- | `/w` or `/w status` | **status** |
73
- | `/w check` or called by `renew` | **check** |
74
- | `/w link [<path>]` or "link plan" | **link** |
75
- | `/w decommission` | **decommission** |
76
- | `/w consolidate` or "dedupe whisper repos" | **consolidate** |
77
-
78
- See each reference file for the full procedure:
25
+ | Derive repo key / branch slug / worktree slot | `turu key --json` |
26
+ | Find the write destination for a scope | `turu resolve <scope> --json` |
27
+ | Record knowledge (extend, don't duplicate) | `turu append <scope> --text "..."` |
28
+ | Create the workspace layout | `turu init --json` |
29
+ | Inspect paths and existence | `turu status --json` |
30
+ | Validate / detect legacy keys | `turu check --json` · `turu doctor --json` |
31
+ | Refresh the AGENTS.md routing block | `turu sync --json` |
32
+
33
+ Scopes: `global` (rules.md), `repo` (env.md), `branch` (notes.md),
34
+ `worktree` (env.md), `group` (shared workspace for a set of repos).
35
+ If a `<!-- TURU:START -->` block exists in `AGENTS.md`, read the routing
36
+ map from there instead of re-deriving paths.
37
+
38
+ 3. **If no** — use the manual fallbacks in `references/` (they remain the
39
+ source of truth for the shell-snippet procedures) and suggest
40
+ `cargo install whisper-vibes`.
41
+
42
+ ## Invariants (with or without the binary)
43
+
44
+ - **No secrets anywhere.** Never write tokens, keys, passwords, or PII into
45
+ the workspace.
46
+ - **Extend, don't duplicate.** Append to or correct an existing note rather
47
+ than creating a new one that says the same thing.
48
+ - **One repo, one key.** The canonical key is a pure function of the remote
49
+ URL; never invent a variant.
50
+ - **Search first.** Before creating a new entry, check if one exists.
79
51
 
80
- - `references/init.md`
81
- - `references/check.md`
82
- - `references/status.md`
83
- - `references/link.md`
84
- - `references/decommission.md`
85
- - `references/consolidate.md`
52
+ ## Modes
86
53
 
87
- ## Rules
54
+ `/w init` → `turu init` · `/w` or `/w status` → `turu status` ·
55
+ `/w check` → `turu check` · `/w link` → `subs/link-manual` (no CLI verb yet)
56
+ · `/w decommission` → `subs/decommission-manual` · `/w consolidate` →
57
+ `subs/consolidate-manual` (detection ships via `turu doctor`).
88
58
 
89
- - Never run `git worktree remove` automatically — always print the command for the user to execute.
90
- - Never close beads issues during decommission — only defer. Closing is intentional.
91
- - **One epic per branch, children via `--parent`, not flat siblings.**
92
- - **`env.md` is shared and immutable across branch switches.** Never overwrite it during init or check — only create if absent.
93
- - **Branch slug sanitization is mandatory.** Always run `sed 's|/|--|g'` on the branch name before using it as a directory path.
94
- - **Worktree reuse across branches is normal, not an edge case.** Expect multiple slots to accumulate in `branches/` over time.
95
- - **Legacy layout is still the common case.** Most worktrees never needed multiple branch slots — only migrate when a mismatch is detected.
96
- - This skill is self-contained. Do not rely on `create-plan`, `park`, or `create-handoff` having `~/.whisper/` awareness.
97
- - If `bd` is not initialized in the repo, skip beads steps gracefully and note what was skipped.
59
+ Manual procedures for each mode: `references/init.md`, `references/check.md`,
60
+ `references/status.md`, `references/link.md`, `references/decommission.md`,
61
+ `references/consolidate.md`.