incitaciones 0.4.0 → 0.5.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.
- package/content/distilled/codebase-cartography/SKILL.md +49 -0
- package/content/distilled/codebase-cartography/references/report-template.md +61 -0
- package/content/distilled/codebase-cartography/references/smell-signatures.md +58 -0
- package/content/distilled/codebase-cartography/references/zoom-levels.md +99 -0
- package/content/distilled/create-issues/SKILL.md +18 -8
- package/content/distilled/create-issues/references/criteria.md +5 -0
- package/content/distilled/create-issues/references/templates.md +13 -0
- package/content/distilled/issue-review/SKILL.md +1 -0
- package/content/distilled/issue-review/references/pass-0-preflight.md +34 -0
- package/content/distilled/issue-review/references/pass-5-executability.md +5 -0
- package/content/manifest.json +132 -1
- package/package.json +1 -1
- package/pi-package/prompts/codebase-cartography.md +10 -0
- package/pi-package/skills/codebase-cartography/SKILL.md +55 -0
- package/pi-package/skills/codebase-cartography/references/report-template.md +61 -0
- package/pi-package/skills/codebase-cartography/references/smell-signatures.md +58 -0
- package/pi-package/skills/codebase-cartography/references/zoom-levels.md +99 -0
- package/pi-package/skills/create-issues/SKILL.md +18 -8
- package/pi-package/skills/create-issues/references/criteria.md +5 -0
- package/pi-package/skills/create-issues/references/templates.md +13 -0
- package/pi-package/skills/issue-review/SKILL.md +1 -0
- package/pi-package/skills/issue-review/references/pass-0-preflight.md +34 -0
- package/pi-package/skills/issue-review/references/pass-5-executability.md +5 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Codebase Cartography
|
|
2
|
+
|
|
3
|
+
Map a codebase's structure as text-based architecture diagrams at three zoom levels, with optional structural-health triage.
|
|
4
|
+
|
|
5
|
+
You are a cartographer, not a critic: you document topology, dependencies, and boundaries as they exist. You do not recommend changes unless an explicit diagnostic pass was requested.
|
|
6
|
+
|
|
7
|
+
## Zoom Levels
|
|
8
|
+
|
|
9
|
+
- **macro** — whole-system topology: modules/domains, dependency direction, layering.
|
|
10
|
+
- **meso** — one module or feature: internal components, wiring, integration contracts.
|
|
11
|
+
- **micro** — one functionality: call chain, data flow, state mutation, I/O boundaries.
|
|
12
|
+
|
|
13
|
+
Pick the entry level from the request:
|
|
14
|
+
|
|
15
|
+
| Request shape | Entry level | Typical ask |
|
|
16
|
+
| :---- | :---- | :---- |
|
|
17
|
+
| "map this repo", onboarding | macro | lay of the land |
|
|
18
|
+
| "how does <module> work", wiring | meso | structure of one district |
|
|
19
|
+
| "trace <functionality>", "where does X happen" | micro | end-to-end path |
|
|
20
|
+
|
|
21
|
+
## Procedure
|
|
22
|
+
|
|
23
|
+
1. Clarify the target if ambiguous. State the entry zoom level explicitly in the output.
|
|
24
|
+
2. Gather evidence by searching — imports, entry points, directory layout, call sites. Never infer structure from names alone.
|
|
25
|
+
3. Render the entry-level map plus one adjacent level for context (parent overview when starting micro/meso; child detail when starting macro).
|
|
26
|
+
4. Run the health check only if requested.
|
|
27
|
+
5. Produce the report using the template.
|
|
28
|
+
|
|
29
|
+
**Reference loading protocol — read on demand:**
|
|
30
|
+
|
|
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
|
+
- 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
|
+
- Before writing the final output, read `references/report-template.md` — output structure per mode.
|
|
34
|
+
|
|
35
|
+
## Zoom Discipline
|
|
36
|
+
|
|
37
|
+
- Offer adjacent levels as follow-ups; never dump all three maps unrequested.
|
|
38
|
+
- Every claim carries a file reference (`path`, or `path:line` for specific symbols).
|
|
39
|
+
- State dependency direction explicitly (A → B); never "related to".
|
|
40
|
+
- Distinguish observed evidence from inference; label inference explicitly.
|
|
41
|
+
- If the target is too large for one pass, map boundaries first and ask which module or area to enter.
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
|
|
45
|
+
- Describe structure as it exists; no refactor advice outside an explicit diagnostic request.
|
|
46
|
+
- Cycles, hotspots, and boundary violations are facts to report, not flaws to fix.
|
|
47
|
+
- Prefer structural facts over narrative: dependency direction, counts, boundaries.
|
|
48
|
+
- Health-check findings follow the evidence format in `references/smell-signatures.md` (pattern, evidence, quantity, severity) — never unanchored opinions.
|
|
49
|
+
- Maps are diff-able artifacts: tables and Mermaid, not prose walls.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Report Template
|
|
2
|
+
|
|
3
|
+
Structure the final output by mode. All modes share the closing sections. Keep maps as tables/Mermaid — diff-able artifacts.
|
|
4
|
+
|
|
5
|
+
## Header (all modes)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
## Cartography — <target>
|
|
9
|
+
**Entry zoom level:** macro | meso | micro
|
|
10
|
+
**Scope covered:** <paths examined>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Mode: macro
|
|
14
|
+
|
|
15
|
+
1. **Module inventory** — table (module, path, responsibility, deps out, fan-in)
|
|
16
|
+
2. **Dependency matrix** — text DSM with ↑ marks for layer violations
|
|
17
|
+
3. **Module graph** — Mermaid, edges labeled with counts
|
|
18
|
+
4. Structural observations
|
|
19
|
+
|
|
20
|
+
## Mode: meso
|
|
21
|
+
|
|
22
|
+
1. **Parent context** — 2-3 lines: where this module sits in the macro map
|
|
23
|
+
2. **Component table** — components, paths, roles, internal links, external ports
|
|
24
|
+
3. **Wiring graph** — Mermaid with mechanism-labeled edges
|
|
25
|
+
4. Structural observations
|
|
26
|
+
|
|
27
|
+
## Mode: micro
|
|
28
|
+
|
|
29
|
+
1. **Entry point** — symbol and file:line
|
|
30
|
+
2. **Call chain** — numbered hops with file:line and purity/I-O markers
|
|
31
|
+
3. **Data flow** — transformation list from input to outputs/side effects
|
|
32
|
+
4. Structural observations
|
|
33
|
+
|
|
34
|
+
## Mode: health check (additive to any level)
|
|
35
|
+
|
|
36
|
+
One finding block per pattern (format in `smell-signatures.md`), ordered by severity. If nothing found, state the patterns checked and the evidence gathered — absence of findings without evidence of search is not a result.
|
|
37
|
+
|
|
38
|
+
## Closing sections (all modes)
|
|
39
|
+
|
|
40
|
+
**Key Relationships** — top 3-5 dependencies that explain the structure:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
- web → api (all requests funnel here; 34 call sites)
|
|
44
|
+
- ledger ← webhooks (cycle with billing; see observations)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Structural Observations** — facts only, no fixes:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
- Cycle: billing → webhooks → ledger → billing (3 modules)
|
|
51
|
+
- Hotspot: core/ledger.ts imported by 14 modules
|
|
52
|
+
- Layer skip: web/cli imports infra/db directly (5 files)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Open Questions** — what the cartographer could not resolve, for human follow-up:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
- Is the billing → ledger edge intentional or legacy? (no test covers it)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Adjacent levels offered** — one line each, e.g. "meso map of ledger available on request".
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Anti-Pattern Signatures — Agent-Computable Proxies
|
|
2
|
+
|
|
3
|
+
Structural health check. Each anti-pattern from the visual framework is reduced to evidence an agent can gather by search and counting. Report findings; do not propose fixes unless explicitly asked.
|
|
4
|
+
|
|
5
|
+
## Report Format (per finding)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
[PATTERN] severity: high|medium|low
|
|
9
|
+
Evidence: file:line list or matrix marks
|
|
10
|
+
Quantity: loop members / fan-out count / depth / ratio
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Severity scales with blast radius: fan-out count, number of affected modules, loop size.
|
|
14
|
+
|
|
15
|
+
## Signature Catalog
|
|
16
|
+
|
|
17
|
+
### Circular Dependencies
|
|
18
|
+
|
|
19
|
+
- **Proxy:** closed loops in the module or component graph. Build the dependency list (see `zoom-levels.md` macro), then trace: if A → B → … → A exists, report the full loop.
|
|
20
|
+
- **Quick scan:** mutual imports between two files (`rg` for A importing B, then B importing A); module-pair matrix marks both ways.
|
|
21
|
+
- **Severity:** loop spanning multiple top-level modules > intra-module pair.
|
|
22
|
+
|
|
23
|
+
### God Object
|
|
24
|
+
|
|
25
|
+
- **Proxy:** one file/class with extreme fan-in AND fan-out, plus size. Check: file length (`wc -l`), count of exported methods/attributes, count of distinct importers (`rg -l "from .*<module>" | wc -l`), count of its own imports.
|
|
26
|
+
- **Thresholds:** relative to the repo baseline — flag when a file is ~3× the median size AND importers are ~3× the median. State the baseline numbers used. In tiny repos (< ~10 files of the same kind), the median is meaningless — fall back to absolute judgment (e.g., one file dominating all coupling) and label the weak baseline.
|
|
27
|
+
- **Severity:** grows with importer count (every change touches all of them).
|
|
28
|
+
|
|
29
|
+
### Shotgun Surgery
|
|
30
|
+
|
|
31
|
+
- **Proxy:** one concept scattered across many modules. Pick a domain concept from the target question (e.g., "invoice", "permissions") and count modules containing references to it: `rg -l "<concept>" | cut -d/ -f1-2 | sort -u | wc -l`.
|
|
32
|
+
- **Severity:** grows with module count and with coupling between the scattered sites (do they import each other or duplicate?).
|
|
33
|
+
|
|
34
|
+
### Feature Envy
|
|
35
|
+
|
|
36
|
+
- **Proxy:** a module imports another module far more than its own internals. Count both sides and compare — imports of the foreign module: `rg -c "from .*<moduleX>" moduleA/`; imports resolving inside moduleA (relative `./` imports): `rg -c "from '\./" moduleA/`. Flag when the foreign count exceeds the local count by ~2× or more.
|
|
37
|
+
- **Severity:** medium when it is one direction; high when the envying module is otherwise nearly disconnected from its own parent.
|
|
38
|
+
|
|
39
|
+
### Deep Inheritance
|
|
40
|
+
|
|
41
|
+
- **Proxy:** chains of `extends`/subclassing beyond ~3 levels: `rg "extends "` then follow each chain. Report max depth and the chain.
|
|
42
|
+
- **Severity:** medium; flag deepest chain only, not every chain.
|
|
43
|
+
|
|
44
|
+
### Pure/Impure Entanglement (functional codebases)
|
|
45
|
+
|
|
46
|
+
- **Proxy:** business-logic functions directly performing I/O (network, DB, filesystem, clock, randomness) instead of receiving results as parameters. Verify by reading the call chain at micro level: mark the first impure hop and whether logic continues after it.
|
|
47
|
+
- **Severity:** high when the same file mixes domain rules and I/O calls repeatedly (report count).
|
|
48
|
+
|
|
49
|
+
### Broken Composition (layer-skipping)
|
|
50
|
+
|
|
51
|
+
- **Proxy:** dependencies that bypass an architectural interface layer — e.g., web module importing infra directly instead of going through the api/service layer. Visible as ↑ marks in the macro matrix (a dependency pointing against the repo's declared or evident layering).
|
|
52
|
+
- **Severity:** scales with how many files take the shortcut.
|
|
53
|
+
|
|
54
|
+
## Interpretation Rules
|
|
55
|
+
|
|
56
|
+
- One finding per pattern per target; list all instances under Evidence.
|
|
57
|
+
- If the pattern is suspected but evidence is thin, say "suspected, evidence: <what's missing>" instead of asserting.
|
|
58
|
+
- Findings are facts about structure. The user decides what to do with them.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Zoom Levels — Evidence Collection & Rendering
|
|
2
|
+
|
|
3
|
+
Per-level collection strategy and text rendering formats. Match the rendering to what the level must show; the paradigm-scale principle applies: module-level relations read best as matrices/graphs, functionality reads best as ordered chains.
|
|
4
|
+
|
|
5
|
+
## Macro — System Topology
|
|
6
|
+
|
|
7
|
+
**Collect:**
|
|
8
|
+
|
|
9
|
+
Adapt import syntax to the language (see language rule below).
|
|
10
|
+
|
|
11
|
+
0. **Language rule:** use the repo's import syntax for scans. JS/TS: `from './x'`; Python: `import x` / `from x import`; Rust: `use x::`; Go: `go list -deps`; Java: `import x.y;`. If the repo is multi-language, run the scan per language.
|
|
12
|
+
1. Top-level directory layout (`ls`, tree to depth 1–2). Identify likely module boundaries (packages, workspaces, domains). Exclude vendored/generated code (`node_modules`, `dist`, `target`, `vendor`, generated committed sources) from all counts — `rg` respects `.gitignore` by default, but generated-but-committed code must be excluded with explicit globs (`-g '!dist'`).
|
|
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
|
+
3. Count edges per pair of modules to get a weighted dependency list.
|
|
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
|
+
|
|
17
|
+
**Render:**
|
|
18
|
+
|
|
19
|
+
Module inventory table:
|
|
20
|
+
|
|
21
|
+
| Module | Path | Responsibility (one line, from evidence) | Deps out → | Fan-in |
|
|
22
|
+
| :---- | :---- | :---- | :---- | :---- |
|
|
23
|
+
|
|
24
|
+
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
|
+
|
|
26
|
+
| | core | api | web | jobs |
|
|
27
|
+
| :---- | :---- | :---- | :---- | :---- |
|
|
28
|
+
| core | — | | | |
|
|
29
|
+
| api | ✦ | — | | |
|
|
30
|
+
| web | ✦ | ✦ | — | |
|
|
31
|
+
| jobs | ✦ | | ↑ | — |
|
|
32
|
+
|
|
33
|
+
Module graph (Mermaid), one node per module, edges labeled with edge counts:
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
graph TD
|
|
37
|
+
web --> api
|
|
38
|
+
api --> core
|
|
39
|
+
jobs --> core
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Facts to surface:** layering violations (↑ marks), cycles, hub modules (highest fan-in/out), orphan modules (zero fan-in).
|
|
43
|
+
|
|
44
|
+
## Meso — Module / Feature Wiring
|
|
45
|
+
|
|
46
|
+
**Collect:**
|
|
47
|
+
|
|
48
|
+
1. Entry points of the module: exported symbols, route registrations, message handlers, CLI commands.
|
|
49
|
+
2. Internal components: classes/functions by responsibility; group by subdirectory.
|
|
50
|
+
3. Integration contracts: interfaces implemented, events published/consumed, external clients (HTTP, DB, queues).
|
|
51
|
+
4. Which other modules call in, and which the module calls out to.
|
|
52
|
+
|
|
53
|
+
**Render:**
|
|
54
|
+
|
|
55
|
+
Component table:
|
|
56
|
+
|
|
57
|
+
| Component | Path | Role | Talks to (internal) | External ports |
|
|
58
|
+
| :---- | :---- | :---- | :---- | :---- |
|
|
59
|
+
|
|
60
|
+
Wiring graph (Mermaid). Show direction and label edges with the mechanism (calls, publishes, reads):
|
|
61
|
+
|
|
62
|
+
```mermaid
|
|
63
|
+
graph LR
|
|
64
|
+
routes --> service
|
|
65
|
+
service --> repo
|
|
66
|
+
service -- "publishes InvoicePaid" --> bus
|
|
67
|
+
repo -- SQL --> [(db)]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Facts to surface:** single points of fan-in, components with no callers, cross-boundary calls that bypass the module's public interface.
|
|
71
|
+
|
|
72
|
+
## Micro — Functionality Trace
|
|
73
|
+
|
|
74
|
+
**Collect:**
|
|
75
|
+
|
|
76
|
+
1. Locate the entry symbol (`rg "symbolName"`); read it fully.
|
|
77
|
+
2. Follow the call chain depth-first through the request's relevant path. Record each hop: `caller → callee (path:line)`.
|
|
78
|
+
3. Mark at each hop: pure logic, state mutation, I/O side effect (network, disk, DB, clock, randomness).
|
|
79
|
+
|
|
80
|
+
**Render:**
|
|
81
|
+
|
|
82
|
+
Ordered call chain:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
1. POST /refunds routes/payments.ts:42
|
|
86
|
+
2. refundInvoice() services/refund.ts:17 [pure until step 4]
|
|
87
|
+
3. validateAmount() domain/money.ts:88 [pure]
|
|
88
|
+
4. gateway.refund() infra/stripe.ts:120 [I/O: network]
|
|
89
|
+
5. ledger.record() infra/ledger.ts:55 [I/O: DB write]
|
|
90
|
+
6. bus.publish() infra/events.ts:30 [I/O: queue]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Data flow list — what enters, how it transforms, what leaves:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
RefundRequest{invoiceId, amount} → validated Amount → gateway response → LedgerEntry → InvoicePaid event
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Facts to surface:** where purity ends (first I/O hop), total hops, state mutated, error paths encountered (report; do not evaluate their quality).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- skill: create-issues, version: 1.
|
|
1
|
+
<!-- skill: create-issues, version: 1.3.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,8 @@ 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 **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
|
+
- **anti-goals** whenever the ticket touches tests, lockfiles, or public interfaces (prohibit test-assertion edits, dependency additions, API breaks)
|
|
48
50
|
- explicit blocked-by field
|
|
49
51
|
- TDD and Tidy First mandate
|
|
50
52
|
|
|
@@ -55,15 +57,20 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
|
|
|
55
57
|
- Wire dependencies using actual captured identifiers or explicit body references.
|
|
56
58
|
- Verify each creation step succeeded before continuing.
|
|
57
59
|
- **After each successful creation**, extract the `**Files / Systems:**` bullet list from
|
|
58
|
-
the issue description and store it as structured metadata
|
|
60
|
+
the issue description and store it as structured metadata together with a **base
|
|
61
|
+
commit anchor** for staleness detection:
|
|
59
62
|
```bash
|
|
60
|
-
|
|
63
|
+
base_sha=$(git rev-parse HEAD)
|
|
64
|
+
bd update <id> --metadata "{\"files\": [\"path/to/file1.py\", \"path/to/file2.py\"], \"base_commit\": \"$base_sha\"}"
|
|
61
65
|
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
`base_commit` is HEAD at ticket-creation time. Reviewers and claiming agents diff
|
|
67
|
+
`base_commit..HEAD` against the ticket's `files` to detect out-of-date tickets (see
|
|
68
|
+
`issue-review` skill, Pass 0 PRE-003, and `renew` skill **Claiming work** section).
|
|
69
|
+
This enables automated file-conflict detection by concurrent agents. If the
|
|
70
|
+
Files/Systems section is empty or contains only subsystem names without concrete
|
|
71
|
+
paths, **stop and ask the user for specific file paths before publishing the ticket**
|
|
72
|
+
— a ticket without concrete paths cannot participate in conflict detection and is
|
|
73
|
+
incomplete.
|
|
67
74
|
|
|
68
75
|
7. **Final report:**
|
|
69
76
|
- Summarize the approved slice set, created issues, labels, and dependency links.
|
|
@@ -75,6 +82,9 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
|
|
|
75
82
|
- **Traceable:** reference the exact plan/spec section or story.
|
|
76
83
|
- **Workflow integrity:** TDD and Tidy First language is mandatory in every implementation issue.
|
|
77
84
|
- **No guessed IDs:** capture identifiers from actual command output.
|
|
85
|
+
- **Quantify the gate:** every measurable acceptance criterion is a number with a unit, backed by a runnable Meter command.
|
|
86
|
+
- **Name the cheats:** add anti-goals wherever the gate could be gamed (test edits, new deps, API breaks).
|
|
87
|
+
- **Anchor staleness:** always record `base_commit` metadata at creation; never publish a ticket anchored to nothing.
|
|
78
88
|
- **Stop and ask:** if the plan only supports horizontal decomposition, propose a vertical rewrite before publishing.
|
|
79
89
|
|
|
80
90
|
## References
|
|
@@ -12,6 +12,10 @@ Use these criteria to evaluate whether a plan has been translated into strong tr
|
|
|
12
12
|
| **Actionable Title** | Short, specific, and domain-oriented. Prefer behavior over component names. |
|
|
13
13
|
| **Traceability** | Contains a direct reference to the source plan/spec section or story. |
|
|
14
14
|
| **Verifiability** | Acceptance criteria are binary and observable. |
|
|
15
|
+
| **Quantified Must gate** | Hard acceptance criterion carries a unit and number (Planguage Must), never an adjective. |
|
|
16
|
+
| **Machine-checkable Meter** | An exact runnable command (Meter) whose exit code decides the gate; verifiable at the ticket's `base_commit`. |
|
|
17
|
+
| **Anti-goals** | Negative constraints name prohibited behaviors (test edits, dependency additions, API breaks) so agents can't cheat the gate. |
|
|
18
|
+
| **Baseline anchored** | Measurable claims record the pre-work value and the HEAD SHA as `base_commit` metadata for staleness detection. |
|
|
15
19
|
| **Dependency hygiene** | Only real blockers are encoded; parallel work is not serialized without reason. |
|
|
16
20
|
| **Workflow Mandate** | Includes the mandatory TDD and Tidy First block. |
|
|
17
21
|
| **Execution mode** | Slice is explicitly marked AFK or HITL. |
|
|
@@ -23,6 +27,7 @@ Use these checks before publishing:
|
|
|
23
27
|
- [ ] Does this issue deliver a narrow but complete path through relevant layers?
|
|
24
28
|
- [ ] Could someone demo or verify this slice without waiting for a later ticket?
|
|
25
29
|
- [ ] Is this a user-visible or system-verifiable outcome rather than plumbing-only work?
|
|
30
|
+
- [ ] Could a fresh agent verify the Must gate by running the Meter command verbatim?
|
|
26
31
|
- [ ] If the ticket is preparatory, is that preparatory work itself independently valuable?
|
|
27
32
|
- [ ] Would splitting by backend/frontend/schema create worse horizontal tickets than the current slice?
|
|
28
33
|
|
|
@@ -31,6 +31,13 @@ Ref: [Link to plan/spec file and section]
|
|
|
31
31
|
- `path/to/file2`
|
|
32
32
|
- `[subsystem or surface area if exact files are not yet known]`
|
|
33
33
|
|
|
34
|
+
## Verifiable Value Claim
|
|
35
|
+
|
|
36
|
+
**Must (hard gate):** [Quantified threshold defining done, with unit and number — e.g. "P95 latency ≤ 250 ms at 100 req/sec"; never "fast" or "robust"]
|
|
37
|
+
**Meter:** [Exact runnable command that verifies the Must gate — e.g. `pytest tests/val_claims/test_issue_NNN.py -q`; exit 0 = pass]
|
|
38
|
+
**Baseline:** [Measured value before work starts — e.g. "P95 = 450 ms"; omit if not measurable]
|
|
39
|
+
**Regression suite:** [Existing tests that must keep passing — e.g. `pytest tests/core/`]
|
|
40
|
+
|
|
34
41
|
## Acceptance Criteria
|
|
35
42
|
|
|
36
43
|
- [ ] [Binary, observable criterion 1]
|
|
@@ -47,6 +54,11 @@ Or: `None - can start immediately`
|
|
|
47
54
|
**CRITICAL: Follow Test Driven Development and Tidy First workflows.**
|
|
48
55
|
- Write tests *before* writing implementation code.
|
|
49
56
|
- Clean up related code *before* adding new functionality.
|
|
57
|
+
|
|
58
|
+
**Anti-goals (do NOT):**
|
|
59
|
+
- [Prohibited behavior with obvious reward-hacking payoff — e.g. "modify, disable, or delete tests in `tests/core/`"]
|
|
60
|
+
- [e.g. "add new dependencies or modify lockfiles"]
|
|
61
|
+
- [e.g. "break public API / exported interfaces"]
|
|
50
62
|
```
|
|
51
63
|
|
|
52
64
|
## Issue Creation Summary Template
|
|
@@ -65,6 +77,7 @@ Or: `None - can start immediately`
|
|
|
65
77
|
- **Total Issues Created:** [count]
|
|
66
78
|
- **Dependencies Defined:** [count]
|
|
67
79
|
- **Labels Applied:** [e.g., needs-triage]
|
|
80
|
+
- **Base Commit Anchored:** [git SHA recorded in `base_commit` metadata]
|
|
68
81
|
|
|
69
82
|
### Created Issues
|
|
70
83
|
1. **[ID] [Title]** - [Link/Reference]
|
|
@@ -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
|
+
- machine-verifiable value claims: quantified Must gate, runnable Meter, explicit anti-goals, and a `base_commit` anchor that reveals staleness
|
|
31
32
|
|
|
32
33
|
## Rules
|
|
33
34
|
|
|
@@ -34,4 +34,38 @@ Recommendation: consider a decomposition ticket to split `<file>` before these
|
|
|
34
34
|
tickets run (see navari-a3cv pattern). If not decomposing now, add a
|
|
35
35
|
co-modification note to all affected tickets.
|
|
36
36
|
|
|
37
|
+
**Check 3 — stale base commit (freshness):**
|
|
38
|
+
```bash
|
|
39
|
+
bd list --format json | python3 -c "
|
|
40
|
+
import json, subprocess, sys
|
|
41
|
+
issues = json.load(sys.stdin)
|
|
42
|
+
head = subprocess.run(['git','rev-parse','HEAD'], capture_output=True, text=True).stdout.strip()
|
|
43
|
+
for i in issues:
|
|
44
|
+
meta = i.get('metadata') or {}
|
|
45
|
+
base = meta.get('base_commit')
|
|
46
|
+
if not base or base == head:
|
|
47
|
+
continue
|
|
48
|
+
files = meta.get('files') or []
|
|
49
|
+
changed = []
|
|
50
|
+
if files:
|
|
51
|
+
changed = subprocess.run(
|
|
52
|
+
['git','diff','--name-only', f'{base}..HEAD', '--'] + files,
|
|
53
|
+
capture_output=True, text=True).stdout.split()
|
|
54
|
+
if changed:
|
|
55
|
+
print(i['id'], 'STALE-TOUCHED', changed)
|
|
56
|
+
else:
|
|
57
|
+
print(i['id'], 'BEHIND-HEAD')
|
|
58
|
+
"
|
|
59
|
+
```
|
|
60
|
+
Flag `[PRE-003] HIGH` for STALE-TOUCHED: files in the ticket's scope changed since
|
|
61
|
+
`base_commit` — the description, acceptance criteria, or Meter may no longer apply.
|
|
62
|
+
Flag `[PRE-004] LOW` for BEHIND-HEAD: repo moved but ticket files untouched —
|
|
63
|
+
likely still valid, only re-anchor.
|
|
64
|
+
Fix: re-validate the ticket content against the current tree, then re-anchor:
|
|
65
|
+
```bash
|
|
66
|
+
sha=$(git rev-parse HEAD)
|
|
67
|
+
bd update <id> --metadata "{\"base_commit\": \"$sha\"}"
|
|
68
|
+
```
|
|
69
|
+
Tickets missing `base_commit` entirely: flag as part of PRE-001 remediation.
|
|
70
|
+
|
|
37
71
|
**Prefix:** PRE-001, PRE-002, etc.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Focus on:
|
|
4
4
|
- Can another developer or agent pick this up immediately?
|
|
5
5
|
- Are verification steps concrete and end-to-end?
|
|
6
|
+
- Is there a machine-checkable Must gate (quantified, unit + number) backed by a runnable Meter command?
|
|
6
7
|
- Are priorities and labels sensible?
|
|
7
8
|
- Are HITL handoff points explicit?
|
|
8
9
|
- Is it clear what demo, test, or observable behavior proves completion?
|
|
@@ -11,6 +12,10 @@ Watch for:
|
|
|
11
12
|
- Hidden conversational context
|
|
12
13
|
- "You know what to do"
|
|
13
14
|
- Missing verification commands or test references
|
|
15
|
+
- Qualitative acceptance criteria with no unit or threshold ("fast", "robust", "clean") — a Scale/Meter is missing
|
|
16
|
+
- A Meter command that cannot run at the ticket's `base_commit` (stale claim) or that no fresh agent could execute verbatim
|
|
17
|
+
- Missing anti-goals on tickets touching tests, lockfiles, or public interfaces (reward-hacking surface: nothing stops gaming the gate)
|
|
18
|
+
- No regression suite named (pass-to-pass coverage unspecified)
|
|
14
19
|
- HITL work masquerading as AFK
|
|
15
20
|
- Tickets that cannot be closed without information from another issue not listed as a blocker
|
|
16
21
|
|
package/content/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2026-
|
|
2
|
+
"version": "2026-09-01",
|
|
3
3
|
"schema_version": "1.1",
|
|
4
4
|
"prompts": [
|
|
5
5
|
{
|
|
@@ -3756,6 +3756,137 @@
|
|
|
3756
3756
|
}
|
|
3757
3757
|
]
|
|
3758
3758
|
}
|
|
3759
|
+
},
|
|
3760
|
+
{
|
|
3761
|
+
"name": "codebase-cartography",
|
|
3762
|
+
"type": "task",
|
|
3763
|
+
"title": "Codebase Cartography",
|
|
3764
|
+
"description": "Navigate and understand a codebase by mapping its structure as text-based architecture diagrams at three zoom levels (macro/meso/micro), with optional structural-health triage using anti-pattern signatures",
|
|
3765
|
+
"source": "content/prompt-task-codebase-cartography.md",
|
|
3766
|
+
"distilled": "content/distilled/codebase-cartography/SKILL.md",
|
|
3767
|
+
"skill_format": "progressive-disclosure",
|
|
3768
|
+
"tags": [
|
|
3769
|
+
"architecture",
|
|
3770
|
+
"navigation",
|
|
3771
|
+
"visualization",
|
|
3772
|
+
"codebase",
|
|
3773
|
+
"dependency-analysis",
|
|
3774
|
+
"diagnostician"
|
|
3775
|
+
],
|
|
3776
|
+
"bundles": [
|
|
3777
|
+
"essentials"
|
|
3778
|
+
],
|
|
3779
|
+
"eval": {
|
|
3780
|
+
"task_types": [
|
|
3781
|
+
"research",
|
|
3782
|
+
"architecture",
|
|
3783
|
+
"navigation"
|
|
3784
|
+
],
|
|
3785
|
+
"success_signals": [
|
|
3786
|
+
"entry_zoom_level_stated_explicitly",
|
|
3787
|
+
"file_references_present_for_claims",
|
|
3788
|
+
"dependency_directions_stated",
|
|
3789
|
+
"maps_rendered_as_tables_or_mermaid",
|
|
3790
|
+
"inference_labeled_as_inference",
|
|
3791
|
+
"structural_observations_separated_from_advice"
|
|
3792
|
+
],
|
|
3793
|
+
"failure_signals": [
|
|
3794
|
+
"all_three_levels_dumped_without_request",
|
|
3795
|
+
"refactor_advice_without_diagnostic_request",
|
|
3796
|
+
"dependency_relations_without_direction",
|
|
3797
|
+
"structure_assumed_without_search_evidence",
|
|
3798
|
+
"findings_without_file_references"
|
|
3799
|
+
],
|
|
3800
|
+
"stages": [
|
|
3801
|
+
{
|
|
3802
|
+
"name": "scope",
|
|
3803
|
+
"hints": [
|
|
3804
|
+
"target",
|
|
3805
|
+
"zoom level",
|
|
3806
|
+
"clarify",
|
|
3807
|
+
"entry level"
|
|
3808
|
+
]
|
|
3809
|
+
},
|
|
3810
|
+
{
|
|
3811
|
+
"name": "collect",
|
|
3812
|
+
"hints": [
|
|
3813
|
+
"references/zoom-levels.md",
|
|
3814
|
+
"imports",
|
|
3815
|
+
"entry points",
|
|
3816
|
+
"search evidence"
|
|
3817
|
+
]
|
|
3818
|
+
},
|
|
3819
|
+
{
|
|
3820
|
+
"name": "render",
|
|
3821
|
+
"hints": [
|
|
3822
|
+
"references/zoom-levels.md",
|
|
3823
|
+
"matrix",
|
|
3824
|
+
"mermaid",
|
|
3825
|
+
"call chain",
|
|
3826
|
+
"tables"
|
|
3827
|
+
]
|
|
3828
|
+
},
|
|
3829
|
+
{
|
|
3830
|
+
"name": "health-check",
|
|
3831
|
+
"hints": [
|
|
3832
|
+
"references/smell-signatures.md",
|
|
3833
|
+
"cycles",
|
|
3834
|
+
"god object",
|
|
3835
|
+
"fan-out",
|
|
3836
|
+
"severity"
|
|
3837
|
+
]
|
|
3838
|
+
},
|
|
3839
|
+
{
|
|
3840
|
+
"name": "report",
|
|
3841
|
+
"hints": [
|
|
3842
|
+
"references/report-template.md",
|
|
3843
|
+
"key relationships",
|
|
3844
|
+
"observations",
|
|
3845
|
+
"open questions"
|
|
3846
|
+
]
|
|
3847
|
+
}
|
|
3848
|
+
],
|
|
3849
|
+
"references": [
|
|
3850
|
+
{
|
|
3851
|
+
"id": "zoom-levels",
|
|
3852
|
+
"path": "content/distilled/codebase-cartography/references/zoom-levels.md",
|
|
3853
|
+
"purpose": "collection-and-rendering-guide",
|
|
3854
|
+
"stage": "collect",
|
|
3855
|
+
"optional": false,
|
|
3856
|
+
"aliases": [
|
|
3857
|
+
"references/zoom-levels.md",
|
|
3858
|
+
"zoom-levels.md",
|
|
3859
|
+
"zoom levels",
|
|
3860
|
+
"levels"
|
|
3861
|
+
]
|
|
3862
|
+
},
|
|
3863
|
+
{
|
|
3864
|
+
"id": "smell-signatures",
|
|
3865
|
+
"path": "content/distilled/codebase-cartography/references/smell-signatures.md",
|
|
3866
|
+
"purpose": "diagnostic-rubric",
|
|
3867
|
+
"stage": "health-check",
|
|
3868
|
+
"optional": true,
|
|
3869
|
+
"aliases": [
|
|
3870
|
+
"references/smell-signatures.md",
|
|
3871
|
+
"smell-signatures.md",
|
|
3872
|
+
"smells",
|
|
3873
|
+
"health check"
|
|
3874
|
+
]
|
|
3875
|
+
},
|
|
3876
|
+
{
|
|
3877
|
+
"id": "report-template",
|
|
3878
|
+
"path": "content/distilled/codebase-cartography/references/report-template.md",
|
|
3879
|
+
"purpose": "output-template",
|
|
3880
|
+
"stage": "report",
|
|
3881
|
+
"optional": false,
|
|
3882
|
+
"aliases": [
|
|
3883
|
+
"references/report-template.md",
|
|
3884
|
+
"report-template.md",
|
|
3885
|
+
"report template"
|
|
3886
|
+
]
|
|
3887
|
+
}
|
|
3888
|
+
]
|
|
3889
|
+
}
|
|
3759
3890
|
}
|
|
3760
3891
|
],
|
|
3761
3892
|
"bundles": {
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Shortcut for the codebase-cartography skill. Navigate and understand a codebase by mapping its structure as text-based architecture diagrams at three zoom levels (macro/meso/micro), with optional structural-health triage using anti-pattern signatures"
|
|
3
|
+
---
|
|
4
|
+
<!-- installed-from: incitaciones -->
|
|
5
|
+
|
|
6
|
+
Use the installed `codebase-cartography` skill for this task.
|
|
7
|
+
|
|
8
|
+
If the skill is not automatically loaded, invoke `/skill:codebase-cartography` and follow it.
|
|
9
|
+
|
|
10
|
+
User context: $@
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebase-cartography
|
|
3
|
+
description: "Navigate and understand a codebase by mapping its structure as text-based architecture diagrams at three zoom levels (macro/meso/micro), with optional structural-health triage using anti-pattern signatures"
|
|
4
|
+
metadata:
|
|
5
|
+
installed-from: "incitaciones"
|
|
6
|
+
---
|
|
7
|
+
# Codebase Cartography
|
|
8
|
+
|
|
9
|
+
Map a codebase's structure as text-based architecture diagrams at three zoom levels, with optional structural-health triage.
|
|
10
|
+
|
|
11
|
+
You are a cartographer, not a critic: you document topology, dependencies, and boundaries as they exist. You do not recommend changes unless an explicit diagnostic pass was requested.
|
|
12
|
+
|
|
13
|
+
## Zoom Levels
|
|
14
|
+
|
|
15
|
+
- **macro** — whole-system topology: modules/domains, dependency direction, layering.
|
|
16
|
+
- **meso** — one module or feature: internal components, wiring, integration contracts.
|
|
17
|
+
- **micro** — one functionality: call chain, data flow, state mutation, I/O boundaries.
|
|
18
|
+
|
|
19
|
+
Pick the entry level from the request:
|
|
20
|
+
|
|
21
|
+
| Request shape | Entry level | Typical ask |
|
|
22
|
+
| :---- | :---- | :---- |
|
|
23
|
+
| "map this repo", onboarding | macro | lay of the land |
|
|
24
|
+
| "how does <module> work", wiring | meso | structure of one district |
|
|
25
|
+
| "trace <functionality>", "where does X happen" | micro | end-to-end path |
|
|
26
|
+
|
|
27
|
+
## Procedure
|
|
28
|
+
|
|
29
|
+
1. Clarify the target if ambiguous. State the entry zoom level explicitly in the output.
|
|
30
|
+
2. Gather evidence by searching — imports, entry points, directory layout, call sites. Never infer structure from names alone.
|
|
31
|
+
3. Render the entry-level map plus one adjacent level for context (parent overview when starting micro/meso; child detail when starting macro).
|
|
32
|
+
4. Run the health check only if requested.
|
|
33
|
+
5. Produce the report using the template.
|
|
34
|
+
|
|
35
|
+
**Reference loading protocol — read on demand:**
|
|
36
|
+
|
|
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
|
+
- 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
|
+
- Before writing the final output, read `references/report-template.md` — output structure per mode.
|
|
40
|
+
|
|
41
|
+
## Zoom Discipline
|
|
42
|
+
|
|
43
|
+
- Offer adjacent levels as follow-ups; never dump all three maps unrequested.
|
|
44
|
+
- Every claim carries a file reference (`path`, or `path:line` for specific symbols).
|
|
45
|
+
- State dependency direction explicitly (A → B); never "related to".
|
|
46
|
+
- Distinguish observed evidence from inference; label inference explicitly.
|
|
47
|
+
- If the target is too large for one pass, map boundaries first and ask which module or area to enter.
|
|
48
|
+
|
|
49
|
+
## Rules
|
|
50
|
+
|
|
51
|
+
- Describe structure as it exists; no refactor advice outside an explicit diagnostic request.
|
|
52
|
+
- Cycles, hotspots, and boundary violations are facts to report, not flaws to fix.
|
|
53
|
+
- Prefer structural facts over narrative: dependency direction, counts, boundaries.
|
|
54
|
+
- Health-check findings follow the evidence format in `references/smell-signatures.md` (pattern, evidence, quantity, severity) — never unanchored opinions.
|
|
55
|
+
- Maps are diff-able artifacts: tables and Mermaid, not prose walls.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Report Template
|
|
2
|
+
|
|
3
|
+
Structure the final output by mode. All modes share the closing sections. Keep maps as tables/Mermaid — diff-able artifacts.
|
|
4
|
+
|
|
5
|
+
## Header (all modes)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
## Cartography — <target>
|
|
9
|
+
**Entry zoom level:** macro | meso | micro
|
|
10
|
+
**Scope covered:** <paths examined>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Mode: macro
|
|
14
|
+
|
|
15
|
+
1. **Module inventory** — table (module, path, responsibility, deps out, fan-in)
|
|
16
|
+
2. **Dependency matrix** — text DSM with ↑ marks for layer violations
|
|
17
|
+
3. **Module graph** — Mermaid, edges labeled with counts
|
|
18
|
+
4. Structural observations
|
|
19
|
+
|
|
20
|
+
## Mode: meso
|
|
21
|
+
|
|
22
|
+
1. **Parent context** — 2-3 lines: where this module sits in the macro map
|
|
23
|
+
2. **Component table** — components, paths, roles, internal links, external ports
|
|
24
|
+
3. **Wiring graph** — Mermaid with mechanism-labeled edges
|
|
25
|
+
4. Structural observations
|
|
26
|
+
|
|
27
|
+
## Mode: micro
|
|
28
|
+
|
|
29
|
+
1. **Entry point** — symbol and file:line
|
|
30
|
+
2. **Call chain** — numbered hops with file:line and purity/I-O markers
|
|
31
|
+
3. **Data flow** — transformation list from input to outputs/side effects
|
|
32
|
+
4. Structural observations
|
|
33
|
+
|
|
34
|
+
## Mode: health check (additive to any level)
|
|
35
|
+
|
|
36
|
+
One finding block per pattern (format in `smell-signatures.md`), ordered by severity. If nothing found, state the patterns checked and the evidence gathered — absence of findings without evidence of search is not a result.
|
|
37
|
+
|
|
38
|
+
## Closing sections (all modes)
|
|
39
|
+
|
|
40
|
+
**Key Relationships** — top 3-5 dependencies that explain the structure:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
- web → api (all requests funnel here; 34 call sites)
|
|
44
|
+
- ledger ← webhooks (cycle with billing; see observations)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Structural Observations** — facts only, no fixes:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
- Cycle: billing → webhooks → ledger → billing (3 modules)
|
|
51
|
+
- Hotspot: core/ledger.ts imported by 14 modules
|
|
52
|
+
- Layer skip: web/cli imports infra/db directly (5 files)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Open Questions** — what the cartographer could not resolve, for human follow-up:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
- Is the billing → ledger edge intentional or legacy? (no test covers it)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Adjacent levels offered** — one line each, e.g. "meso map of ledger available on request".
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Anti-Pattern Signatures — Agent-Computable Proxies
|
|
2
|
+
|
|
3
|
+
Structural health check. Each anti-pattern from the visual framework is reduced to evidence an agent can gather by search and counting. Report findings; do not propose fixes unless explicitly asked.
|
|
4
|
+
|
|
5
|
+
## Report Format (per finding)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
[PATTERN] severity: high|medium|low
|
|
9
|
+
Evidence: file:line list or matrix marks
|
|
10
|
+
Quantity: loop members / fan-out count / depth / ratio
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Severity scales with blast radius: fan-out count, number of affected modules, loop size.
|
|
14
|
+
|
|
15
|
+
## Signature Catalog
|
|
16
|
+
|
|
17
|
+
### Circular Dependencies
|
|
18
|
+
|
|
19
|
+
- **Proxy:** closed loops in the module or component graph. Build the dependency list (see `zoom-levels.md` macro), then trace: if A → B → … → A exists, report the full loop.
|
|
20
|
+
- **Quick scan:** mutual imports between two files (`rg` for A importing B, then B importing A); module-pair matrix marks both ways.
|
|
21
|
+
- **Severity:** loop spanning multiple top-level modules > intra-module pair.
|
|
22
|
+
|
|
23
|
+
### God Object
|
|
24
|
+
|
|
25
|
+
- **Proxy:** one file/class with extreme fan-in AND fan-out, plus size. Check: file length (`wc -l`), count of exported methods/attributes, count of distinct importers (`rg -l "from .*<module>" | wc -l`), count of its own imports.
|
|
26
|
+
- **Thresholds:** relative to the repo baseline — flag when a file is ~3× the median size AND importers are ~3× the median. State the baseline numbers used. In tiny repos (< ~10 files of the same kind), the median is meaningless — fall back to absolute judgment (e.g., one file dominating all coupling) and label the weak baseline.
|
|
27
|
+
- **Severity:** grows with importer count (every change touches all of them).
|
|
28
|
+
|
|
29
|
+
### Shotgun Surgery
|
|
30
|
+
|
|
31
|
+
- **Proxy:** one concept scattered across many modules. Pick a domain concept from the target question (e.g., "invoice", "permissions") and count modules containing references to it: `rg -l "<concept>" | cut -d/ -f1-2 | sort -u | wc -l`.
|
|
32
|
+
- **Severity:** grows with module count and with coupling between the scattered sites (do they import each other or duplicate?).
|
|
33
|
+
|
|
34
|
+
### Feature Envy
|
|
35
|
+
|
|
36
|
+
- **Proxy:** a module imports another module far more than its own internals. Count both sides and compare — imports of the foreign module: `rg -c "from .*<moduleX>" moduleA/`; imports resolving inside moduleA (relative `./` imports): `rg -c "from '\./" moduleA/`. Flag when the foreign count exceeds the local count by ~2× or more.
|
|
37
|
+
- **Severity:** medium when it is one direction; high when the envying module is otherwise nearly disconnected from its own parent.
|
|
38
|
+
|
|
39
|
+
### Deep Inheritance
|
|
40
|
+
|
|
41
|
+
- **Proxy:** chains of `extends`/subclassing beyond ~3 levels: `rg "extends "` then follow each chain. Report max depth and the chain.
|
|
42
|
+
- **Severity:** medium; flag deepest chain only, not every chain.
|
|
43
|
+
|
|
44
|
+
### Pure/Impure Entanglement (functional codebases)
|
|
45
|
+
|
|
46
|
+
- **Proxy:** business-logic functions directly performing I/O (network, DB, filesystem, clock, randomness) instead of receiving results as parameters. Verify by reading the call chain at micro level: mark the first impure hop and whether logic continues after it.
|
|
47
|
+
- **Severity:** high when the same file mixes domain rules and I/O calls repeatedly (report count).
|
|
48
|
+
|
|
49
|
+
### Broken Composition (layer-skipping)
|
|
50
|
+
|
|
51
|
+
- **Proxy:** dependencies that bypass an architectural interface layer — e.g., web module importing infra directly instead of going through the api/service layer. Visible as ↑ marks in the macro matrix (a dependency pointing against the repo's declared or evident layering).
|
|
52
|
+
- **Severity:** scales with how many files take the shortcut.
|
|
53
|
+
|
|
54
|
+
## Interpretation Rules
|
|
55
|
+
|
|
56
|
+
- One finding per pattern per target; list all instances under Evidence.
|
|
57
|
+
- If the pattern is suspected but evidence is thin, say "suspected, evidence: <what's missing>" instead of asserting.
|
|
58
|
+
- Findings are facts about structure. The user decides what to do with them.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Zoom Levels — Evidence Collection & Rendering
|
|
2
|
+
|
|
3
|
+
Per-level collection strategy and text rendering formats. Match the rendering to what the level must show; the paradigm-scale principle applies: module-level relations read best as matrices/graphs, functionality reads best as ordered chains.
|
|
4
|
+
|
|
5
|
+
## Macro — System Topology
|
|
6
|
+
|
|
7
|
+
**Collect:**
|
|
8
|
+
|
|
9
|
+
Adapt import syntax to the language (see language rule below).
|
|
10
|
+
|
|
11
|
+
0. **Language rule:** use the repo's import syntax for scans. JS/TS: `from './x'`; Python: `import x` / `from x import`; Rust: `use x::`; Go: `go list -deps`; Java: `import x.y;`. If the repo is multi-language, run the scan per language.
|
|
12
|
+
1. Top-level directory layout (`ls`, tree to depth 1–2). Identify likely module boundaries (packages, workspaces, domains). Exclude vendored/generated code (`node_modules`, `dist`, `target`, `vendor`, generated committed sources) from all counts — `rg` respects `.gitignore` by default, but generated-but-committed code must be excluded with explicit globs (`-g '!dist'`).
|
|
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
|
+
3. Count edges per pair of modules to get a weighted dependency list.
|
|
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
|
+
|
|
17
|
+
**Render:**
|
|
18
|
+
|
|
19
|
+
Module inventory table:
|
|
20
|
+
|
|
21
|
+
| Module | Path | Responsibility (one line, from evidence) | Deps out → | Fan-in |
|
|
22
|
+
| :---- | :---- | :---- | :---- | :---- |
|
|
23
|
+
|
|
24
|
+
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
|
+
|
|
26
|
+
| | core | api | web | jobs |
|
|
27
|
+
| :---- | :---- | :---- | :---- | :---- |
|
|
28
|
+
| core | — | | | |
|
|
29
|
+
| api | ✦ | — | | |
|
|
30
|
+
| web | ✦ | ✦ | — | |
|
|
31
|
+
| jobs | ✦ | | ↑ | — |
|
|
32
|
+
|
|
33
|
+
Module graph (Mermaid), one node per module, edges labeled with edge counts:
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
graph TD
|
|
37
|
+
web --> api
|
|
38
|
+
api --> core
|
|
39
|
+
jobs --> core
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Facts to surface:** layering violations (↑ marks), cycles, hub modules (highest fan-in/out), orphan modules (zero fan-in).
|
|
43
|
+
|
|
44
|
+
## Meso — Module / Feature Wiring
|
|
45
|
+
|
|
46
|
+
**Collect:**
|
|
47
|
+
|
|
48
|
+
1. Entry points of the module: exported symbols, route registrations, message handlers, CLI commands.
|
|
49
|
+
2. Internal components: classes/functions by responsibility; group by subdirectory.
|
|
50
|
+
3. Integration contracts: interfaces implemented, events published/consumed, external clients (HTTP, DB, queues).
|
|
51
|
+
4. Which other modules call in, and which the module calls out to.
|
|
52
|
+
|
|
53
|
+
**Render:**
|
|
54
|
+
|
|
55
|
+
Component table:
|
|
56
|
+
|
|
57
|
+
| Component | Path | Role | Talks to (internal) | External ports |
|
|
58
|
+
| :---- | :---- | :---- | :---- | :---- |
|
|
59
|
+
|
|
60
|
+
Wiring graph (Mermaid). Show direction and label edges with the mechanism (calls, publishes, reads):
|
|
61
|
+
|
|
62
|
+
```mermaid
|
|
63
|
+
graph LR
|
|
64
|
+
routes --> service
|
|
65
|
+
service --> repo
|
|
66
|
+
service -- "publishes InvoicePaid" --> bus
|
|
67
|
+
repo -- SQL --> [(db)]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Facts to surface:** single points of fan-in, components with no callers, cross-boundary calls that bypass the module's public interface.
|
|
71
|
+
|
|
72
|
+
## Micro — Functionality Trace
|
|
73
|
+
|
|
74
|
+
**Collect:**
|
|
75
|
+
|
|
76
|
+
1. Locate the entry symbol (`rg "symbolName"`); read it fully.
|
|
77
|
+
2. Follow the call chain depth-first through the request's relevant path. Record each hop: `caller → callee (path:line)`.
|
|
78
|
+
3. Mark at each hop: pure logic, state mutation, I/O side effect (network, disk, DB, clock, randomness).
|
|
79
|
+
|
|
80
|
+
**Render:**
|
|
81
|
+
|
|
82
|
+
Ordered call chain:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
1. POST /refunds routes/payments.ts:42
|
|
86
|
+
2. refundInvoice() services/refund.ts:17 [pure until step 4]
|
|
87
|
+
3. validateAmount() domain/money.ts:88 [pure]
|
|
88
|
+
4. gateway.refund() infra/stripe.ts:120 [I/O: network]
|
|
89
|
+
5. ledger.record() infra/ledger.ts:55 [I/O: DB write]
|
|
90
|
+
6. bus.publish() infra/events.ts:30 [I/O: queue]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Data flow list — what enters, how it transforms, what leaves:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
RefundRequest{invoiceId, amount} → validated Amount → gateway response → LedgerEntry → InvoicePaid event
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Facts to surface:** where purity ends (first I/O hop), total hops, state mutated, error paths encountered (report; do not evaluate their quality).
|
|
@@ -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.
|
|
7
|
+
<!-- skill: create-issues, version: 1.3.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,8 @@ 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 **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
|
+
- **anti-goals** whenever the ticket touches tests, lockfiles, or public interfaces (prohibit test-assertion edits, dependency additions, API breaks)
|
|
54
56
|
- explicit blocked-by field
|
|
55
57
|
- TDD and Tidy First mandate
|
|
56
58
|
|
|
@@ -61,15 +63,20 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
|
|
|
61
63
|
- Wire dependencies using actual captured identifiers or explicit body references.
|
|
62
64
|
- Verify each creation step succeeded before continuing.
|
|
63
65
|
- **After each successful creation**, extract the `**Files / Systems:**` bullet list from
|
|
64
|
-
the issue description and store it as structured metadata
|
|
66
|
+
the issue description and store it as structured metadata together with a **base
|
|
67
|
+
commit anchor** for staleness detection:
|
|
65
68
|
```bash
|
|
66
|
-
|
|
69
|
+
base_sha=$(git rev-parse HEAD)
|
|
70
|
+
bd update <id> --metadata "{\"files\": [\"path/to/file1.py\", \"path/to/file2.py\"], \"base_commit\": \"$base_sha\"}"
|
|
67
71
|
```
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
`base_commit` is HEAD at ticket-creation time. Reviewers and claiming agents diff
|
|
73
|
+
`base_commit..HEAD` against the ticket's `files` to detect out-of-date tickets (see
|
|
74
|
+
`issue-review` skill, Pass 0 PRE-003, and `renew` skill **Claiming work** section).
|
|
75
|
+
This enables automated file-conflict detection by concurrent agents. If the
|
|
76
|
+
Files/Systems section is empty or contains only subsystem names without concrete
|
|
77
|
+
paths, **stop and ask the user for specific file paths before publishing the ticket**
|
|
78
|
+
— a ticket without concrete paths cannot participate in conflict detection and is
|
|
79
|
+
incomplete.
|
|
73
80
|
|
|
74
81
|
7. **Final report:**
|
|
75
82
|
- Summarize the approved slice set, created issues, labels, and dependency links.
|
|
@@ -81,6 +88,9 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
|
|
|
81
88
|
- **Traceable:** reference the exact plan/spec section or story.
|
|
82
89
|
- **Workflow integrity:** TDD and Tidy First language is mandatory in every implementation issue.
|
|
83
90
|
- **No guessed IDs:** capture identifiers from actual command output.
|
|
91
|
+
- **Quantify the gate:** every measurable acceptance criterion is a number with a unit, backed by a runnable Meter command.
|
|
92
|
+
- **Name the cheats:** add anti-goals wherever the gate could be gamed (test edits, new deps, API breaks).
|
|
93
|
+
- **Anchor staleness:** always record `base_commit` metadata at creation; never publish a ticket anchored to nothing.
|
|
84
94
|
- **Stop and ask:** if the plan only supports horizontal decomposition, propose a vertical rewrite before publishing.
|
|
85
95
|
|
|
86
96
|
## References
|
|
@@ -12,6 +12,10 @@ Use these criteria to evaluate whether a plan has been translated into strong tr
|
|
|
12
12
|
| **Actionable Title** | Short, specific, and domain-oriented. Prefer behavior over component names. |
|
|
13
13
|
| **Traceability** | Contains a direct reference to the source plan/spec section or story. |
|
|
14
14
|
| **Verifiability** | Acceptance criteria are binary and observable. |
|
|
15
|
+
| **Quantified Must gate** | Hard acceptance criterion carries a unit and number (Planguage Must), never an adjective. |
|
|
16
|
+
| **Machine-checkable Meter** | An exact runnable command (Meter) whose exit code decides the gate; verifiable at the ticket's `base_commit`. |
|
|
17
|
+
| **Anti-goals** | Negative constraints name prohibited behaviors (test edits, dependency additions, API breaks) so agents can't cheat the gate. |
|
|
18
|
+
| **Baseline anchored** | Measurable claims record the pre-work value and the HEAD SHA as `base_commit` metadata for staleness detection. |
|
|
15
19
|
| **Dependency hygiene** | Only real blockers are encoded; parallel work is not serialized without reason. |
|
|
16
20
|
| **Workflow Mandate** | Includes the mandatory TDD and Tidy First block. |
|
|
17
21
|
| **Execution mode** | Slice is explicitly marked AFK or HITL. |
|
|
@@ -23,6 +27,7 @@ Use these checks before publishing:
|
|
|
23
27
|
- [ ] Does this issue deliver a narrow but complete path through relevant layers?
|
|
24
28
|
- [ ] Could someone demo or verify this slice without waiting for a later ticket?
|
|
25
29
|
- [ ] Is this a user-visible or system-verifiable outcome rather than plumbing-only work?
|
|
30
|
+
- [ ] Could a fresh agent verify the Must gate by running the Meter command verbatim?
|
|
26
31
|
- [ ] If the ticket is preparatory, is that preparatory work itself independently valuable?
|
|
27
32
|
- [ ] Would splitting by backend/frontend/schema create worse horizontal tickets than the current slice?
|
|
28
33
|
|
|
@@ -31,6 +31,13 @@ Ref: [Link to plan/spec file and section]
|
|
|
31
31
|
- `path/to/file2`
|
|
32
32
|
- `[subsystem or surface area if exact files are not yet known]`
|
|
33
33
|
|
|
34
|
+
## Verifiable Value Claim
|
|
35
|
+
|
|
36
|
+
**Must (hard gate):** [Quantified threshold defining done, with unit and number — e.g. "P95 latency ≤ 250 ms at 100 req/sec"; never "fast" or "robust"]
|
|
37
|
+
**Meter:** [Exact runnable command that verifies the Must gate — e.g. `pytest tests/val_claims/test_issue_NNN.py -q`; exit 0 = pass]
|
|
38
|
+
**Baseline:** [Measured value before work starts — e.g. "P95 = 450 ms"; omit if not measurable]
|
|
39
|
+
**Regression suite:** [Existing tests that must keep passing — e.g. `pytest tests/core/`]
|
|
40
|
+
|
|
34
41
|
## Acceptance Criteria
|
|
35
42
|
|
|
36
43
|
- [ ] [Binary, observable criterion 1]
|
|
@@ -47,6 +54,11 @@ Or: `None - can start immediately`
|
|
|
47
54
|
**CRITICAL: Follow Test Driven Development and Tidy First workflows.**
|
|
48
55
|
- Write tests *before* writing implementation code.
|
|
49
56
|
- Clean up related code *before* adding new functionality.
|
|
57
|
+
|
|
58
|
+
**Anti-goals (do NOT):**
|
|
59
|
+
- [Prohibited behavior with obvious reward-hacking payoff — e.g. "modify, disable, or delete tests in `tests/core/`"]
|
|
60
|
+
- [e.g. "add new dependencies or modify lockfiles"]
|
|
61
|
+
- [e.g. "break public API / exported interfaces"]
|
|
50
62
|
```
|
|
51
63
|
|
|
52
64
|
## Issue Creation Summary Template
|
|
@@ -65,6 +77,7 @@ Or: `None - can start immediately`
|
|
|
65
77
|
- **Total Issues Created:** [count]
|
|
66
78
|
- **Dependencies Defined:** [count]
|
|
67
79
|
- **Labels Applied:** [e.g., needs-triage]
|
|
80
|
+
- **Base Commit Anchored:** [git SHA recorded in `base_commit` metadata]
|
|
68
81
|
|
|
69
82
|
### Created Issues
|
|
70
83
|
1. **[ID] [Title]** - [Link/Reference]
|
|
@@ -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
|
+
- machine-verifiable value claims: quantified Must gate, runnable Meter, explicit anti-goals, and a `base_commit` anchor that reveals staleness
|
|
37
38
|
|
|
38
39
|
## Rules
|
|
39
40
|
|
|
@@ -34,4 +34,38 @@ Recommendation: consider a decomposition ticket to split `<file>` before these
|
|
|
34
34
|
tickets run (see navari-a3cv pattern). If not decomposing now, add a
|
|
35
35
|
co-modification note to all affected tickets.
|
|
36
36
|
|
|
37
|
+
**Check 3 — stale base commit (freshness):**
|
|
38
|
+
```bash
|
|
39
|
+
bd list --format json | python3 -c "
|
|
40
|
+
import json, subprocess, sys
|
|
41
|
+
issues = json.load(sys.stdin)
|
|
42
|
+
head = subprocess.run(['git','rev-parse','HEAD'], capture_output=True, text=True).stdout.strip()
|
|
43
|
+
for i in issues:
|
|
44
|
+
meta = i.get('metadata') or {}
|
|
45
|
+
base = meta.get('base_commit')
|
|
46
|
+
if not base or base == head:
|
|
47
|
+
continue
|
|
48
|
+
files = meta.get('files') or []
|
|
49
|
+
changed = []
|
|
50
|
+
if files:
|
|
51
|
+
changed = subprocess.run(
|
|
52
|
+
['git','diff','--name-only', f'{base}..HEAD', '--'] + files,
|
|
53
|
+
capture_output=True, text=True).stdout.split()
|
|
54
|
+
if changed:
|
|
55
|
+
print(i['id'], 'STALE-TOUCHED', changed)
|
|
56
|
+
else:
|
|
57
|
+
print(i['id'], 'BEHIND-HEAD')
|
|
58
|
+
"
|
|
59
|
+
```
|
|
60
|
+
Flag `[PRE-003] HIGH` for STALE-TOUCHED: files in the ticket's scope changed since
|
|
61
|
+
`base_commit` — the description, acceptance criteria, or Meter may no longer apply.
|
|
62
|
+
Flag `[PRE-004] LOW` for BEHIND-HEAD: repo moved but ticket files untouched —
|
|
63
|
+
likely still valid, only re-anchor.
|
|
64
|
+
Fix: re-validate the ticket content against the current tree, then re-anchor:
|
|
65
|
+
```bash
|
|
66
|
+
sha=$(git rev-parse HEAD)
|
|
67
|
+
bd update <id> --metadata "{\"base_commit\": \"$sha\"}"
|
|
68
|
+
```
|
|
69
|
+
Tickets missing `base_commit` entirely: flag as part of PRE-001 remediation.
|
|
70
|
+
|
|
37
71
|
**Prefix:** PRE-001, PRE-002, etc.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Focus on:
|
|
4
4
|
- Can another developer or agent pick this up immediately?
|
|
5
5
|
- Are verification steps concrete and end-to-end?
|
|
6
|
+
- Is there a machine-checkable Must gate (quantified, unit + number) backed by a runnable Meter command?
|
|
6
7
|
- Are priorities and labels sensible?
|
|
7
8
|
- Are HITL handoff points explicit?
|
|
8
9
|
- Is it clear what demo, test, or observable behavior proves completion?
|
|
@@ -11,6 +12,10 @@ Watch for:
|
|
|
11
12
|
- Hidden conversational context
|
|
12
13
|
- "You know what to do"
|
|
13
14
|
- Missing verification commands or test references
|
|
15
|
+
- Qualitative acceptance criteria with no unit or threshold ("fast", "robust", "clean") — a Scale/Meter is missing
|
|
16
|
+
- A Meter command that cannot run at the ticket's `base_commit` (stale claim) or that no fresh agent could execute verbatim
|
|
17
|
+
- Missing anti-goals on tickets touching tests, lockfiles, or public interfaces (reward-hacking surface: nothing stops gaming the gate)
|
|
18
|
+
- No regression suite named (pass-to-pass coverage unspecified)
|
|
14
19
|
- HITL work masquerading as AFK
|
|
15
20
|
- Tickets that cannot be closed without information from another issue not listed as a blocker
|
|
16
21
|
|