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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026-09-01",
2
+ "version": "2026-09-15",
3
3
  "schema_version": "1.1",
4
4
  "prompts": [
5
5
  {
@@ -3013,6 +3013,26 @@
3013
3013
  "reviews"
3014
3014
  ]
3015
3015
  },
3016
+ {
3017
+ "name": "file-headers",
3018
+ "type": "system",
3019
+ "title": "File Headers (Self-Describing Source Files)",
3020
+ "description": "Convention enforcing a Purpose/Responsibilities/Rationale header on every source file, so agents learn intent without reverse-engineering and undescribable files expose cohesion violations",
3021
+ "source": "content/prompt-system-file-headers.md",
3022
+ "distilled": "content/distilled/file-headers.md",
3023
+ "tags": [
3024
+ "documentation",
3025
+ "architecture",
3026
+ "modularity",
3027
+ "code-quality",
3028
+ "system-prompt",
3029
+ "rationale"
3030
+ ],
3031
+ "bundles": [
3032
+ "refactoring",
3033
+ "documentation"
3034
+ ]
3035
+ },
3016
3036
  {
3017
3037
  "name": "edge-case-discovery",
3018
3038
  "type": "task",
@@ -3579,7 +3599,7 @@
3579
3599
  "name": "whisper",
3580
3600
  "type": "workflow",
3581
3601
  "title": "Whisper — Accumulated Operational Knowledge",
3582
- "description": "Manage the ~/.whisper/ knowledge workspace: init, check, status, link plan, decommission, and knowledge routing",
3602
+ "description": "Deterministic knowledge workspace management: init, check, status, link plan, decommission, and knowledge routing. Thin pointer — delegates to the turu CLI (whisper-vibes) when installed, manual fallbacks otherwise",
3583
3603
  "source": "content/prompt-workflow-whisper.md",
3584
3604
  "distilled": "content/distilled/whisper/SKILL.md",
3585
3605
  "skill_format": "progressive-disclosure",
@@ -3893,16 +3913,16 @@
3893
3913
  ],
3894
3914
  "bundles": {
3895
3915
  "essentials": {
3896
- "description": "Core prompts for everyday development",
3916
+ "description": "Daily-driver skills, selected by measured usage: the top 8 of the pi session skill-usage analysis (621 sessions, 43 repos, 2026-04..07) — commit, rule-of-5-universal, tdd, issue-review, debug, create-issues, create-handoff, grill-me",
3897
3917
  "prompts": [
3898
3918
  "commit",
3919
+ "rule-of-5-universal",
3920
+ "tdd",
3921
+ "issue-review",
3899
3922
  "debug",
3900
- "describe-pr",
3901
- "code-review",
3902
- "research-codebase",
3923
+ "create-issues",
3903
3924
  "create-handoff",
3904
- "resume-handoff",
3905
- "whisper"
3925
+ "grill-me"
3906
3926
  ]
3907
3927
  },
3908
3928
  "planning": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incitaciones",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Reusable prompts and skills for CLI LLM tools, with native pi package support.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: "Shortcut for the file-headers skill. Convention enforcing a Purpose/Responsibilities/Rationale header on every source file, so agents learn intent without reverse-engineering and undescribable files expose cohesion violations"
3
+ ---
4
+ <!-- installed-from: incitaciones -->
5
+
6
+ Use the installed `file-headers` skill for this task.
7
+
8
+ If the skill is not automatically loaded, invoke `/skill:file-headers` and follow it.
9
+
10
+ User context: $@
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Shortcut for the whisper skill. Manage the ~/.whisper/ knowledge workspace: init, check, status, link plan, decommission, and knowledge routing"
2
+ description: "Shortcut for the whisper skill. Deterministic knowledge workspace management: init, check, status, link plan, decommission, and knowledge routing. Thin pointer — delegates to the turu CLI (whisper-vibes) when installed, manual fallbacks otherwise"
3
3
  ---
4
4
  <!-- installed-from: incitaciones -->
5
5
 
@@ -14,14 +14,22 @@ tools: Read, Write, Edit, Glob, Bash
14
14
 
15
15
  End the current session: log what was done, update tasks, route durable knowledge to `~/.whisper/`, commit and push, clear context.
16
16
 
17
- 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).
17
+ 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).
18
18
 
19
19
  ## Steps
20
20
 
21
21
  1. Pull the journal repo:
22
22
  ```bash
23
- JOURNAL="${JOURNAL_PATH:-$HOME/dev/status}"
24
- LOG_SUBDIR="${JOURNAL_LOG_SUBDIR:-log}"
23
+ # Non-interactive shells never source .bashrc, so $JOURNAL_PATH etc. are
24
+ # usually unset here. Source the config in a throwaway shell — bash itself
25
+ # handles comments, quotes, and nested vars ($JORNAL) — then fall back.
26
+ shellval() { bash -c 'source ~/.bashrc >/dev/null 2>&1; printf "%s\n" "${'"'$1'"'}"' 2>/dev/null; }
27
+ JOURNAL="${JOURNAL_PATH:-$(shellval JOURNAL_PATH)}"
28
+ [ -n "$JOURNAL" ] || JOURNAL="$(shellval JORNAL)"
29
+ [ -n "$JOURNAL" ] || JOURNAL="$HOME/para/areas/jornal" # JORNAL convention
30
+ [ -d "$JOURNAL/.git" ] || JOURNAL="$HOME/dev/status" # legacy clone; flag this fallback in the reply
31
+ LOG_SUBDIR="${JOURNAL_LOG_SUBDIR:-$(shellval JOURNAL_LOG_SUBDIR)}"
32
+ [ -n "$LOG_SUBDIR" ] || LOG_SUBDIR="areas/log"
25
33
  cd "$JOURNAL" && git pull
26
34
  ```
27
35
 
@@ -4,7 +4,7 @@ description: "Multi-pass code review using Rule of 5 principle"
4
4
  metadata:
5
5
  installed-from: "incitaciones"
6
6
  ---
7
- <!-- skill: code-review, version: 1.2.0, status: verified -->
7
+ <!-- skill: code-review, version: 1.3.0, status: verified -->
8
8
  # Iterative Code Review (Rule of 5)
9
9
 
10
10
  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?
@@ -37,11 +37,12 @@ Pick the entry level from the request:
37
37
  - Before gathering evidence for any map (and again before rendering), read `references/zoom-levels.md` — per-level evidence collection commands and text rendering formats.
38
38
  - 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.
39
39
  - Before writing the final output, read `references/report-template.md` — output structure per mode.
40
- - 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`.
40
+ - 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.
41
41
 
42
42
  ## Zoom Discipline
43
43
 
44
- - Offer adjacent levels as follow-ups; never dump all three maps unrequested.
44
+ - 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).
45
+ - 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.
45
46
  - Every claim carries a file reference (`path`, or `path:line` for specific symbols).
46
47
  - State dependency direction explicitly (A → B); never "related to".
47
48
  - Distinguish observed evidence from inference; label inference explicitly.
@@ -54,4 +55,4 @@ Pick the entry level from the request:
54
55
  - Prefer structural facts over narrative: dependency direction, counts, boundaries.
55
56
  - Health-check findings follow the evidence format in `references/smell-signatures.md` (pattern, evidence, quantity, severity) — never unanchored opinions.
56
57
  - Maps are diff-able artifacts: tables and Mermaid, not prose walls.
57
- - HTML export is derived output, produced only on request; the markdown report remains the artifact of record.
58
+ - 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)
@@ -18,9 +18,10 @@ You are the Gatekeeper of the Architecture. Before generating any code, always r
18
18
  **Directives**:
19
19
  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)
20
20
  2. Add `// Reusing: [Name] — avoids duplicating [what]` comments when using existing abstractions
21
- 3. Refusal Protocol: if asked to violate architecture — STOP, explain the rule being violated, propose the resonant alternative instead
21
+ 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
22
+ 4. Refusal Protocol: if asked to violate architecture — STOP, explain the rule being violated, propose the resonant alternative instead
22
23
 
23
24
  **Output structure for every response**:
24
25
  1. Reuse Plan: "I will build X using [existing abstractions]. I need new code for [only what's new]."
25
26
  2. Code (with Reusing comments)
26
- 3. Verification checklist: all abstractions reused? no raw logic where abstraction exists? style conventions followed?
27
+ 3. Verification checklist: all abstractions reused? no raw logic where abstraction exists? style conventions followed? file headers present (new files) and current (changed files)?
@@ -4,7 +4,7 @@ description: "Generate trackable issues from implementation plans"
4
4
  metadata:
5
5
  installed-from: "incitaciones"
6
6
  ---
7
- <!-- skill: create-issues, version: 1.3.0, status: verified -->
7
+ <!-- skill: create-issues, version: 1.4.0, status: verified -->
8
8
  # Tracer-Bullet Issue Creation from Plan
9
9
 
10
10
  Break a reviewed plan into independently grabbable issues using tracer-bullet vertical slices.
@@ -51,6 +51,7 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
51
51
  - end-to-end behavior description
52
52
  - concrete file paths or subsystems when knowable
53
53
  - binary acceptance criteria
54
+ - 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`)
54
55
  - 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
55
56
  - **anti-goals** whenever the ticket touches tests, lockfiles, or public interfaces (prohibit test-assertion edits, dependency additions, API breaks)
56
57
  - explicit blocked-by field
@@ -89,6 +90,7 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
89
90
  - **Workflow integrity:** TDD and Tidy First language is mandatory in every implementation issue.
90
91
  - **No guessed IDs:** capture identifiers from actual command output.
91
92
  - **Quantify the gate:** every measurable acceptance criterion is a number with a unit, backed by a runnable Meter command.
93
+ - **Self-describing files:** tickets that create source files or change a file's contract carry the file-header criterion (see `file-headers`).
92
94
  - **Name the cheats:** add anti-goals wherever the gate could be gamed (test edits, new deps, API breaks).
93
95
  - **Anchor staleness:** always record `base_commit` metadata at creation; never publish a ticket anchored to nothing.
94
96
  - **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,32 @@
1
+ ---
2
+ name: file-headers
3
+ description: "Convention enforcing a Purpose/Responsibilities/Rationale header on every source file, so agents learn intent without reverse-engineering and undescribable files expose cohesion violations"
4
+ metadata:
5
+ installed-from: "incitaciones"
6
+ ---
7
+ <!-- Full version: content/prompt-system-file-headers.md -->
8
+ 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.
9
+
10
+ **HEADER FORMAT** (adapt the comment syntax to the language — `#`, `//`, `--`, `"""docstring"""`, or a top doc comment):
11
+
12
+ ```
13
+ # Purpose: <one sentence — what this file does and for whom>
14
+ # Responsibilities:
15
+ # - <bullet 1 — the cohesion contract; one concern per bullet>
16
+ # - <bullet N>
17
+ # Rationale: <latest design decision and why, with issue/PR link>
18
+ # <earlier rationale entries belong in the issue tracker / git history>
19
+ ```
20
+
21
+ **Rules:**
22
+ 1. Every NEW source file opens with a complete header before any logic.
23
+ 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.
24
+ 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.
25
+ 4. Rationale keeps only the latest entry. History lives in the issue tracker and git, not the file.
26
+ 5. Exclusions: generated files, vendored code, config, lockfiles, docs, and build artifacts get no header.
27
+
28
+ **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.
29
+
30
+ **Audit:** to find missing headers: `grep -rLE "(Purpose:|@purpose)" --include=<source-extensions> .` excluding vendored/generated paths. Every hit is a gap.
31
+
32
+ **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.
@@ -17,6 +17,7 @@ Implement an approved plan using Red, Green, Refactor.
17
17
  - Implement the minimum code to pass.
18
18
  - Refactor while keeping tests green.
19
19
  - Run the success criteria checks.
20
+ - Check file headers: new source files open with Purpose/Responsibilities/Rationale; files whose contract changed have a current Rationale (see `file-headers`).
20
21
  - Update the plan with progress.
21
22
  4. Use `references/verification-template.md` when reporting phase completion.
22
23
  5. Use `references/common-situations.md` when the plan and reality diverge.
@@ -25,5 +26,6 @@ Implement an approved plan using Red, Green, Refactor.
25
26
 
26
27
  - Never skip the red phase.
27
28
  - Complete one phase at a time.
29
+ - 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`).
28
30
  - Do not blindly follow an outdated plan if the codebase contradicts it.
29
31
  - 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]
@@ -34,6 +34,7 @@ Treat the best issue sets as:
34
34
  - minimal but sufficient dependency graphs
35
35
  - explicit about AFK vs HITL work
36
36
  - traceable back to stories, plans, or specs
37
+ - 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
37
38
  - machine-verifiable value claims: quantified Must gate, runnable Meter, explicit anti-goals, and a `base_commit` anchor that reveals staleness
38
39
 
39
40
  ## 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
@@ -29,6 +29,7 @@ Step 1 — Detect Modularity Signals: Read all files. Identify:
29
29
  - High Afferent Coupling (Medium): module depended upon by many consumers — alterations trigger widespread ripple effects
30
30
  - Temporal Coupling (Medium): files co-changing in commits despite no static dependency — reveals hidden dependencies (skip if no git/co-change data provided)
31
31
  - Missing Boundary (Medium): related functionality spread across modules with no clear owning package
32
+ - 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
32
33
  Note file, line range, and description for each.
33
34
 
34
35
  Step 2 — Classify Modularity Scope: For each signal, assess:
@@ -47,5 +47,6 @@ Self-correction: on failure, attempt fix up to 3 times. If all 3 fail: run `git
47
47
  - Run linter on modified files
48
48
  - Run full test suite
49
49
  - Add docstring to new abstraction: what it does, why it exists, parameters
50
+ - 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
50
51
 
51
- **Completion Report**: files modified, verification pass/fail, linter pass/fail, tests pass/fail, abstraction documented, recommended next step.
52
+ **Completion Report**: files modified, verification pass/fail, linter pass/fail, tests pass/fail, abstraction documented, file headers updated, recommended next step.
@@ -4,7 +4,7 @@ description: "Test-driven development workflow"
4
4
  metadata:
5
5
  installed-from: "incitaciones"
6
6
  ---
7
- <!-- skill: tdd, version: 1.1.0, status: verified -->
7
+ <!-- skill: tdd, version: 1.2.0, status: verified -->
8
8
  # Plan-Implement-Verify (TDD)
9
9
 
10
10
  Implement features or fixes using a disciplined, phase-based Test-Driven Development (TDD) workflow to ensure correctness, testability, and incremental progress.
@@ -25,7 +25,7 @@ You are a TDD Practitioner. Your goal is to ensure that no code is written witho
25
25
  * **Step 1: Write Failing Test (RED):** Write a test that describes the desired behavior. Run it and **confirm it fails** for the expected reason.
26
26
  * **Step 2: Implement Minimal Code (GREEN):** Write the simplest code possible to make the test pass. Run tests to confirm they are green.
27
27
  * **Step 3: Refactor If Needed:** Clean up the implementation while keeping tests green.
28
- * **Step 4: Verify Phase Completion:** Run full automated suites (tests, type-check, lint) and perform manual verification.
28
+ * **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`).
29
29
  * **Step 5: Inform User:** Present a summary of phase completion and wait for verification.
30
30
 
31
31
  3. **Verification (CRITICAL):**
@@ -38,6 +38,7 @@ You are a TDD Practitioner. Your goal is to ensure that no code is written witho
38
38
  - **One Phase at a Time:** Complete and verify a phase before starting the next.
39
39
  - **Keep Tests Green:** Never leave the codebase in a failing state at the end of a turn.
40
40
  - **Update Plan:** Mark phases as complete as you progress.
41
+ - **Self-Describing Files:** A phase is not complete if new files lack headers or contract-changing edits left headers stale (see `file-headers`).
41
42
 
42
43
  ## References
43
44
  - **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