gabe-debt — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited gabe-debt (Agent Skill) and scored it 45/100 (orange). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 1 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
A base64 string of 128+ characters appears in a documentation file. Encoded prompt injection hides the hostile instruction in base64 — invisible to keyword filters — and relies on the agent's ability to decode it at runtime. There is no normal authoring reason to embed a multi-hundred-byte base64 blob in skill docs.
*.sig, SIGNATURES) outside the documentation.Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Catch complexity gravity wells before they deepen. Every project accumulates decisions that were never made explicitly ("we'll figure out state ownership later"), or decisions that contradict each other silently (SCOPE says multi-agent topology; PLAN phase 4 binds roles per-request; code assumes one user). These are the traps that crushed BoletApp's Epic 14c (reverted after 3 days), kept Gastify's legacy refresh-never-fires bug open for months, and keep cross-role visibility vulnerabilities latent until the first auditor asks.
This skill scans for them using evidence-anchored patterns (see ~/.claude/templates/gabe/debt-patterns/ — P1 through P11 distilled from actual Gastify + BoletApp incidents, not generic imagination), plus project-local rules if the project already captured lessons (Gastify docs/rebuild/LESSONS.md, BoletApp docs/sprint-artifacts/**/*retro*.md, .kdbp/RULES.md). Findings can also cite the advisory architecture principles (AP1-AP13) from architecture-principles.md when the finding evidence directly touches one of those principles.
Every finding carries: severity (tier-adjusted), confidence (triangulated across docs/code/commits), blast radius (phases + REQs + files affected), and status (missing / implicit / contradictory / violating-existing-rule). Triage promotes each finding to the appropriate target:
Rendering note. Output templates wrapped in bare triple-backtick fences are spec-meta delimiters — render contents as plain markdown at runtime so findings tables display as tables. Tagged fences (``bash,`diff, etc.) stay fenced at runtime. Seegabe-docs/SKILL.md` § "Runtime output rendering convention".
gabe-teach uses "gravity wells" to mean architectural sections / learning anchors stored in .kdbp/KNOWLEDGE.md (soft cap 7, Miller's number). Those are where the architecture lives.
gabe-debt detects decision debt — unmade or contradictory decisions that turn a gravity well into a complexity trap. The two coexist: gabe-teach's wells are the domains; gabe-debt finds the debt accumulating in each. Keep the vocabularies distinct in output.
Use when:
extract-rules mines it into R-NN entriesDon't use when:
/gabe-review)/gabe-roast [perspective])/gabe-assess)/gabe-align)Default target: the whole project's .kdbp/ + code + commit history since the last SCOPE.md Change Log anchor.
| Input form | Effect |
|---|---|
| No target | Full scan (all patterns, all inputs) |
pattern=P<n> | Single-pattern scan (e.g. pattern=P3 for async-listener races) |
since=<git-ref> | Limit commit-history pass to commits since the ref (default: last SCOPE §15 Change Log entry) |
[file or folder] | Restrict code + commit sweep to this path; docs pass still runs globally |
| Mode | Behavior |
|---|---|
| (default) | Full scan + interactive triage + writes |
brief | Findings table + severity + counts; no writes, no triage |
dry-run | Full scan + show proposed DECISIONS / SCOPE §14 / RULES / PENDING diffs; no writes |
audit-rules | Read-only: check current code/scope against existing RULES.md + LESSONS.md; report violations only |
extract-rules | Read-only: mine retrospective files and propose new R-NN candidates; interactive y/n per candidate |
strict | Non-zero exit if any CRITICAL unresolved finding (pre-commit hook form) |
Modes compose: brief pattern=P3, dry-run since=HEAD~20, etc.
.kdbp/BEHAVIOR.md)| Maturity | Surfaces |
|---|---|
| MVP | CRITICAL only |
| Enterprise | CRITICAL + HIGH |
| Scale | CRITICAL + HIGH + MEDIUM |
--full flag overrides tier gate (surfaces all findings regardless of maturity).
Patterns are data files at:
.kdbp/debt-patterns/P<n>-<handle>.md (project-local, highest priority; overrides global)~/.claude/templates/gabe/debt-patterns/P<n>-<handle>.md (global, shipped with this skill)~/.agents/templates/gabe/debt-patterns/ (Codex home equivalent)See ~/.claude/templates/gabe/debt-patterns/README.md for the pattern file format. v1 ships 11 patterns:
| ID | Handle | Source evidence |
|---|---|---|
| P1 | dual-state-machines | Gastify LESSONS §1.1 / R1 |
| P2 | cross-feature-direct-mutation | Gastify LESSONS §1.2 / R2 |
| P3 | async-listener-race | Gastify LESSONS §2 Seam A / R5 |
| P4 | schema-drift-across-boundaries | Gastify LESSONS §2 Seam C / R4, R6 |
| P5 | god-class-growth | Gastify LESSONS §1.3 / R3 |
| P6 | deletion-detection-in-sync | BoletApp epic-14c-retro §1 |
| P7 | multi-op-state-staleness | BoletApp epic-14c-retro §2 |
| P8 | silent-fallback-changes-bigO | BoletApp epic-14c-retro §3 |
| P9 | cross-product-infra-coupling | BoletApp CLAUDE.md INC-001 |
| P10 | cost-model-absent-before-deploy | BoletApp epic-14c-retro §3 |
| P11 | multi-op-test-gap | BoletApp epic-14c-retro §2 |
Parsing a pattern file: sections are fixed headings (## Evidence source, ## Red-line questions, ## Detection — doc pass, ## Detection — code pass, ## Detection — commit pass, ## Tier impact, ## Severity default, ## ADR stub template, ## Open Question template, ## Rule template). Missing section → use defaults. Unknown heading → pass-through (project may add custom sections).
The AP catalog is loaded from the first available path:
templates/architecture-principles.md (project-local Gabe Suite source)~/.claude/templates/gabe/architecture-principles.md~/.agents/templates/gabe/architecture-principles.mdAP principles are explanatory citations, not independent debt patterns. Do not emit a debt finding because "AP6 coupling might apply" in the abstract. First find concrete debt through a pattern, rule, doc contradiction, code hit, or commit hit; then attach AP IDs whose advisory tests are evidenced by that same finding.
/gabe-init first. /gabe-debt requires a scoped project." Exit.maturity: frontmatter field. If absent, prompt the user for tier; default to MVP if unanswered..kdbp/DECISIONS.md — parse row IDs (D1, D2, …) + stable-ID map (if present).kdbp/SCOPE.md — parse §14 OQ-NN IDs; §15 Change Log tail; §10 Architecture Posture; REQ-NN list.kdbp/RULES.md — parse R-NN entries if file exists; fall back to docs/rebuild/LESSONS.md or docs/**/RULES*.md if present.kdbp/PENDING.md — parse existing deferred entries to avoid re-raising.kdbp/debt-ignore.md — parse dismissal list (created on first (s) during triage; see Step 5).kdbp/PLAN.md <!-- status: active --> frontmatter. Record phase number, types: [] list (binds to tier-sections)..kdbp/debt-patterns/*.md first, then layer global ~/.claude/templates/gabe/debt-patterns/*.md. Project-local overrides by ID.audit-rules: skip the catalog-scan parts of Step 2, only check existing rules.Index all rule sources into a single rules_index:
.kdbp/RULES.md — R-NN entries (canonical)docs/rebuild/LESSONS.md — Gastify-shape; R-NN entries (imported as rules)docs/**/*retro*.md — BoletApp-shape retros; extract §Root cause rules as lower-confidence rulesPOSTMORTEM*, DEBRIEF*, LESSONS*, RETRO*, PAIN* at repo root or docs/Each rule entry records: id, description, source-path, applies-to, detection-signature, severity, confidence. Same-ID collisions: canonical RULES.md wins.
For each pattern in the catalog:
#### 2.1 Doc pass (structured inputs)
Walk .kdbp/SCOPE.md, .kdbp/DECISIONS.md, .kdbp/PLAN.md, .kdbp/ROADMAP.md, .kdbp/KNOWLEDGE.md, .kdbp/ENTITIES.md, .kdbp/PENDING.md, templates/tier-sections/ index (if any bound via active phase's types: []). Apply the pattern's ## Detection — doc pass heuristics. Classify each red-line question:
Missing + contradictory → finding candidate. Implicit without commit/code evidence → finding candidate at weak-signal confidence.
#### 2.2 Code pass (grep / AST heuristics)
Apply the pattern's ## Detection — code pass. Scope:
.kdbp/STRUCTURE.md for declared entry-point dirs and scan those; otherwise scan src/ apps/ packages/ app/ functions/ services/ (exclude node_modules/ dist/ build/ .next/).Attach every hit as evidence: file:line — <matched line>. Cap at 20 hits per pattern (summarize the rest).
#### 2.3 Commit pass
Range: since=<ref> (default: latest | <date> | init | … or | <date> | addition | … or | <date> | pivot | … entry in SCOPE.md §15; if none, last 90 days).
For each commit in range:
## Detection — commit pass markers.<short-sha> <date> — <subject> as evidence.revert commits — these often seed rule candidates even if no pattern-specific marker hits (route through extract-rules on user request).#### 2.4 Rule-violation cross-check
For each rule in rules_index:
detection-signature matches anything scanned in 2.1–2.3, emit a finding with status=violating-existing-rule and severity at least HIGH (auto-elevated to CRITICAL if the rule is tagged "load-bearing" in its source).Each finding gets four scores:
Severity (from pattern's ## Severity default, adjusted by tier):
Confidence (three-bucket):
Weak-signal findings are included in output but demoted one severity level and labelled explicitly.
Blast radius (scalar):
.kdbp/PLAN.md types matching pattern's applies-to)Status (exclusive):
missing — no decision signal foundimplicit — decision inferable but not formalizedcontradictory — multiple conflicting signalsviolating-existing-rule — code/scope violates a known R-ruleArchitecture principle citations (advisory, optional):
Architecture principles: AP6 coupling, AP12 documented decisions.Drop findings below the tier threshold (see table under Required Inputs §3). Always keep violating-existing-rule findings regardless of tier.
Within-tier ordering: CRITICAL first, then HIGH, then MEDIUM. Within each severity, order by confidence (confident first) then by blast radius (desc).
brief, dry-run, audit-rules, extract-rules, strict)Present each finding one at a time:
[#<N>] <SEVERITY> · <confidence> · <pattern-id> · <status>
Pattern: <pattern handle> (applies to: <phases / REQs>)
Blast: <radius score> | Tier: <mvp|enterprise|scale>
Evidence:
- <source>: <content>
- <source>: <content>
Architecture principles:
- <APn handle> — <why the cited evidence touches it>
Consequence: <pattern's what-we-lose statement, customized to this project>
Action:
(d) Promote → DECISIONS.md ADR (stub seeded from pattern template)
(o) Open question → SCOPE.md §14 OQ-NN (stub seeded)
(r) Codify rule → RULES.md R-NN (stub seeded from pattern's rule template)
(p) Defer → PENDING.md
(s) Skip (recorded to .kdbp/debt-ignore.md — won't re-raise)
(m) Multi — pick two or more targets (e.g., r+d for rule + ADR crossref)
(e) Edit the stub before promoting
(q) Quit triage (writes nothing so far this session if --transaction mode)Key behaviors:
(e) opens an editable preview of the stub. User can revise description, alternatives, detection, then pick d/o/r/p.(m) chains promotions: e.g., m then r+d creates an R-NN in RULES.md AND a D-N in DECISIONS.md that cross-references the R-NN.(s) appends <pattern-id>:<stable-id>:<YYYY-MM-DD>:<reason> to .kdbp/debt-ignore.md. Re-running the scan reads this file and suppresses matching findings.(q) discards the session's triage decisions. Writes that already landed in this session via (d)/(o)/(r)/(p) stay — quit is for remaining findings only.Writes happen only after at least one (d)/(o)/(r)/(p)/(m) action has been confirmed AND a final summary prompt confirms:
Proposed writes:
DECISIONS.md: +<N> ADR stub(s) [D<N>..D<M>]
SCOPE.md §14: +<N> OQ-NN(s) [OQ-<n>..OQ-<m>]
RULES.md: +<N> R-NN(s) [R<n>..R<m>]
PENDING.md: +<N> entry/entries
SCOPE.md §15: +1 Change Log entry (type: debt-scan)
Proceed? (y) apply (n) cancel (p) print diff firstOn (p): print a unified diff for each target (including the SCOPE §15 entry). Re-prompt.
Idempotency (crucial):
sha1(pattern-id + project-name + active-phase-number + red-line-question-hash)[:8]. Record as an HTML comment: <!-- gabe-debt-stable-id: <8-char-hash> --> on the entry.Where writes land:
| Target | Insert location | Change Log line |
|---|---|---|
| DECISIONS.md | append new row to the ADR table | — |
| SCOPE.md §14 | append new ### OQ-NN block | SCOPE §15 debt-scan entry lists OQ-NN created |
| RULES.md | append new ### R-NN block under §1; extend §2 Phase cross-reference matrix | RULES §4 Change Log entry |
| PENDING.md | append row to deferred-items table | — |
SCOPE.md §15 Change Log entry format:
| <YYYY-MM-DD> | debt-scan | Added <N> OQ-NN(s) + <M> R-NN(s) + <K> ADR stub(s) via /gabe-debt. Patterns: P<x>, P<y>. |Never commit. Writes land as dirty working-tree changes. User reviews via git diff .kdbp/ and commits via /gabe-commit.
Print:
/gabe-review <those files>"extract-rules mode (retrospective mining)Activated by extract-rules mode. Does not scan code/docs for patterns; instead mines retrospective files for rule candidates.
docs/rebuild/LESSONS.mddocs/sprint-artifacts/**/*retro*.mddocs/sprint-artifacts/**/POSTMORTEM*.mddocs/**/DEBRIEF*.md / docs/**/PAIN*.mdLESSONS.md, POSTMORTEM.md, RETRO.md Candidate rule #<N>:
Source: docs/sprint-artifacts/epic-14c-retro-2026-01-20.md §1 "Deletion Detection"
Proposed R-NN entry:
**Evidence:** epic-14c-retro §1 (multi-user sync lost untag events)
**Rule:** Every syncable entity has a `deleted_at` tombstone field; delta sync carries tombstones.
**Detection:** entity schema audit + CI integration test per synced entity.
**Applies to:** <phases that bind multi-user sync>
**Status:** active
**Sources:** gabe-debt extract-rules <date>
Action: (y) accept (n) reject (e) edit before accepting (q) quittype: debt-scan, summary: "Extracted N rule(s) from <retro file>".brief modeGABE DEBT — <project name>
Tier: <mvp|enterprise|scale>
Scanned: <doc-paths, code-paths, commits-since-ref>
Findings: <N total> · <X CRITICAL / Y HIGH / Z MEDIUM> · <confident A | uncertain B | weak C>
┌─────┬────────────┬──────────────────────────────────┬───────────────┬──────────┬──────────────────────────┐
│ # │ Severity │ Pattern │ Status │Confidence│ Primary evidence │
├─────┼────────────┼──────────────────────────────────┼───────────────┼──────────┼──────────────────────────┤
│ 1 │ CRITICAL │ P3 async-listener-race │ missing │ confident│ src/hooks/useTxn.ts:84 │
│ 2 │ HIGH │ P6 deletion-detection-in-sync │ implicit │ weak │ entities.ts, no tombstone│
│ … │ … │ … │ … │ … │ … │
└─────┴────────────┴──────────────────────────────────┴───────────────┴──────────┴──────────────────────────┘
Rule-violation findings: <N>
→ <rule> R<m> (LESSONS.md): <what's violating>
Suggested next steps:
→ /gabe-debt (full triage)
→ /gabe-debt dry-run (preview writes)
→ /gabe-debt pattern=P3 (drill into one pattern)audit-rules modeGABE DEBT — Rule audit — <project name>
Rules loaded:
RULES.md : R1..R<N> (<date of last update>)
LESSONS.md (ref) : R1..R<M> (<project-local, imported>)
Violations:
R3 (file-size limit, LESSONS.md §4 R3)
src/App.tsx: 845 LOC (> 800 hard block)
→ /gabe-review src/App.tsx for split guidance
R5 (SSE + pull fallback, LESSONS.md §4 R5)
src/hooks/useTxnStream.ts:84 — no pull fallback
→ Open ADR or check R5 detection guidance
Compliance:
R1, R2, R4, R6..R<N> — no violations detected in scanned paths.
No new rules extracted (use `extract-rules` mode).dry-run modeShows proposed writes as unified diffs without applying them. Example excerpt:
--- .kdbp/DECISIONS.md
+++ .kdbp/DECISIONS.md (proposed)
@@ -12,3 +12,4 @@
| D3 | 2026-04-20 | … | … | … | active | … |
+| D4 | 2026-04-24 | Async result delivery uses dual paths (SSE + pull fallback) | Gastify LESSONS R5: push-only delivery fails under listener races | Push-only with reconnect (rejected); pull-only with interval (rejected) | proposed | Revisit when we have >10k connected users |
<!-- gabe-debt-stable-id: a3f9b1c7 -->
--- .kdbp/RULES.md
+++ .kdbp/RULES.md (proposed)
@@ -14,1 +14,20 @@
+### R2 — async-listener-race-dual-delivery {#r2}
+**Evidence:** Gastify LESSONS §4 R5; src/hooks/useTxnStream.ts:84 (opens listener after server-write await)
+**Rule:** Every server-pushed async result has a pull-fallback endpoint. UI triggers pull on: initial subscription, reconnect, tab visibility regain.
+**Detection:** integration test that disables push and asserts UI still sees result via pull.
+**Applies to:** B4, I3
+**Status:** active
+**Sources:** gabe-debt extract-rules 2026-04-24
+<!-- gabe-debt-stable-id: a3f9b1c7 -->
--- .kdbp/SCOPE.md
+++ .kdbp/SCOPE.md (proposed)
@@ -167,2 +167,4 @@
| <YYYY-MM-DD> | init | Initial scope authored via `/gabe-scope`. |
+| 2026-04-24 | debt-scan | Added 1 OQ-NN + 2 R-NN + 1 ADR stub via /gabe-debt. Patterns: P3, P8. |
No changes written. Re-run without `dry-run` to apply..kdbp/RULES.md as severity-escalation input. A review finding on a file/line that violates an R-rule auto-escalates to CRITICAL with citation ("violates R3 from RULES.md"). Cross-reference added to gabe-review/SKILL.md Step 2 (finding severity rubric).audit-rules pass runs as part of the alignment check: unresolved CRITICAL rule-violations block a pre-commit alignment (in strict mode) or emit CONCERN in standard mode./gabe-debt audit-rules to verify the phase doesn't violate existing rules./gabe-debt to surface new CRITICAL gaps introduced by the change./gabe-debt (d) action can cross-link to gabe-arch concept IDs in the Alternatives field.Reads maturity: from .kdbp/BEHAVIOR.md:
| Maturity | Scan depth | Severity floor |
|---|---|---|
| MVP | Surfaces CRITICAL only. Load-bearing patterns (P3, P6, P9) always run. | CRITICAL |
| Enterprise | CRITICAL + HIGH. All patterns run. Triangulation required for non-rule-violation findings. | HIGH |
| Scale | CRITICAL + HIGH + MEDIUM. All patterns run. Weak-signal findings included. | MEDIUM |
Load-bearing rules (from RULES.md / LESSONS.md) always surface regardless of tier. Rule-violation status overrides tier filtering.
Override: --full flag surfaces all findings regardless of tier. Useful for quarterly audits or milestone retrospectives.
(s).audit-rules mode for this pattern once a rule is codified.gabe-debt compare <project>; out of v1 scope).~/.claude/plans/peppy-drifting-flame.md/home/khujta/projects/apps/gastify/docs/rebuild/LESSONS.md/home/khujta/projects/bmad/boletapp/docs/sprint-artifacts/epic-14c-retro-2026-01-20.md~/.claude/templates/gabe/debt-patterns/~/.claude/commands/gabe-debt.md~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.