/gangsta:launderingfrom gangsta
Integrates territory branches, runs verification suite, scans for spec identifiers, audits technical debt, and produces clean production-ready code after all crew leads report completion.
Ships in gangsta. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A successful Heist is only complete when the "loot" is refined into its final, legitimate form. Laundering handles integration, verification, cleanup, and institutional memory updates.
Invoked after all Crew Leads report territory completion and the Don approves (The Hit complete).
Merge all territory branches/worktrees into the Heist branch:
# If using worktrees per territory
git merge territory/<name> --no-ff
Resolve any conflicts. If conflicts are non-trivial, escalate to the Underboss for a mini-Grilling.
Run the full verification suite:
# Run all tests
<project test command>
# Run linter
<project lint command>
# Run type checker (if applicable)
<project type check command>
All checks must pass. If any fail:
Use gangsta:sweep-verification — every claim of passing must be backed by fresh command output.
Identifier Scan (Blocking Gate): Scan all project files outside docs/gangsta/ for Gangsta-internal spec identifiers using the pattern \b(FR|NFR|WP)-\d+\b (matches FR-001, NFR-042, WP-007, FR-1, etc.).
grep -rn --include="*.md" --include="*.ts" --include="*.js" --include="*.py" --include="*.go" --include="*.rb" --include="*.java" --include="*.txt" -E "\b(FR|NFR|WP)-[0-9]+" . --exclude-dir=docs/gangsta
A blocking gate. Five sub-checks. Every violation MUST be fixed or, with the Don's explicit approval, recorded as a documented exception (source: file, line, rationale) — same exception protocol as the Identifier Scan.
Run them BEFORE the Consigliere's architectural review so the Consigliere sees the cleaned code, not the raw hit output.
If jscpd is installed, run it against the modified files. If not installed, run an equivalent token-based duplication scan or skip with a note in the checkpoint that this sub-check was not run.
npx jscpd <modified file paths> --format "all" --ignore "**/*.md,**/*.json,**/docs/gangsta/**" --reporters json,console --threshold 0
Defaults (override with the project's .jscpd.json if present):
min-lines: 5min-tokens: 35threshold: 0 (zero duplication above the minimum block size)Any clone cluster above the minimum is a blocking defect. Fix by extracting shared code, parameterizing the variation, or removing the dead duplicate. If the duplication is structurally unavoidable (e.g. two genuinely distinct types with the same shape), record the file paths, the clone cluster ID, and a one-sentence justification, and surface it to the Don for exception sign-off.
For every file created or modified during the Hit, count the source lines (excluding blank lines and comments):
for f in <modified files>; do wc -l "$f"; done
Thresholds:
Record the post-refactor line count in the checkpoint.
Run the project's coverage command. If the project has no coverage tooling, skip with a note — do not invent one.
<project coverage command — e.g. npm run test:coverage, pytest --cov, go test -cover>
Two checks:
--coverageThreshold in jest.config.*, fail_under in .coveragerc), the run must meet it. Failure is a blocking defect — add tests until the threshold passes.git stash and re-run if missing). If coverage on modified lines dropped, write the missing tests before proceeding.Record the final coverage number in the checkpoint.
The Consigliere will cover this architecturally in Step 4 — this sub-check is the mechanical pre-filter. For every modified file, verify:
If the project has no formal layering, this sub-check passes by default — note "no formal architecture layers in this project" in the checkpoint.
Run the project's linter with auto-fix disabled first; review the violations:
<project lint command — no auto-fix>
Beyond the linter, scan the modified files for these mechanical clean-code violations:
if/for/while/try) is a blocking defect. Flatten with early returns, guard clauses, or extracted helpers.setTimeout(fn, 0)) is exempt.Any violation is a blocking defect unless the Contract explicitly accepts it. Surface the violation list, the fix (or the documented exception), and the post-fix lint output in the checkpoint.
## Technical Debt Audit
| Sub-check | Result | Details |
|-----------|--------|---------|
| Copy/Paste (jscpd) | PASS / N clone clusters fixed / SKIPPED (tool unavailable) | <details> |
| Long Files | PASS / N refactored / N documented | <files, before → after line counts> |
| Test Coverage | PASS / N threshold failures fixed | <baseline → final coverage %> |
| Clean Architecture | PASS / N violations fixed / No formal layers | <details> |
| Clean Code | PASS / N violations fixed | <lint output, before → after> |
### Documented Exceptions
- <file>:<line> — <sub-check> — <rationale> — [Don acknowledged: YES/NO]
Invoke gangsta:the-consigliere for an architectural audit of the integrated code:
If the Consigliere raises CRITICAL concerns: fix before proceeding. If CONCERNS: present to Don for decision. If APPROVE: proceed.
For an independent code-level review alongside the Consigliere's architectural assessment, dispatch gangsta:audit-review.
Remove operational artifacts:
Do NOT remove:
docs/gangsta/<heist-name>/specs/YYYY-MM-DD-contract.md)docs/gangsta/<heist-name>/plans/YYYY-MM-DD-execution-plan.md)docs/gangsta/<heist-name>/recon/YYYY-MM-DD-recon-dossier.md)Invoke gangsta:the-ledger to record the Heist's lessons:
Insights — For each notable solution or pattern discovered:
docs/gangsta/insights/YYYY-MM-DD-<topic>.mdFails — For each failure, regression, or mistake encountered:
docs/gangsta/fails/YYYY-MM-DD-<topic>.mdAsk the Don:
"The Heist is nearly complete. Were there any insights or failures you want to record in the Ledger?"
Present to the Don:
"Laundering complete for Heist ''.
- All tests pass
- Coverage: <baseline → final>
- Technical Debt Audit: <list of fixed violations; documented exceptions if any>
- Consigliere verdict: [verdict]
- Ledger updated: [N] insights, [N] fails
- Code is clean and ready for production
Do you declare this Heist complete?"
The Don may:
status: completed), move the Heist to the Vault (Step 9), final commit, optional merge to main.status: killed and move the Heist to the Boneyard (Step 9) on the base branch.While the Don has not decided, the latest checkpoint stays status: pending-don-approval. Never write status: completed before the Don declares the Heist complete — that status closes the Heist.
Move the closed Heist out of the top level of docs/gangsta/:
git mv docs/gangsta/<heist-name> docs/gangsta/vault/<heist-name> # completed
git mv docs/gangsta/<heist-name> docs/gangsta/boneyard/<heist-name> # killed
Then replace docs/gangsta/<heist-name>/ with the new path in docs/gangsta/ files that reference it (Insights, Fails, the Heist's own checkpoints), and include the move in the final commit. If this step is skipped, the session-start hook moves the Heist at the next session and stages the change for the Don.
---
heist: <heist-name>
phase: laundering
status: completed | killed
timestamp: <ISO 8601>
next-action: Heist complete. Moved to docs/gangsta/vault/<heist-name>/ (completed) or docs/gangsta/boneyard/<heist-name>/ (killed).
artifacts:
- docs/gangsta/<heist-name>/specs/YYYY-MM-DD-contract.md
- docs/gangsta/<heist-name>/plans/YYYY-MM-DD-execution-plan.md
- docs/gangsta/<heist-name>/recon/YYYY-MM-DD-recon-dossier.md
- <all code files created/modified>
technical-debt-audit:
copy-paste: PASS | N-fixed | SKIPPED <reason>
long-files: PASS | N-refactored <files>
test-coverage: <baseline% → final%>
clean-architecture: PASS | N-fixed | no-formal-layers
clean-code: PASS | N-fixed
documented-exceptions: <file:line — sub-check — rationale>
---
vault/ (completed) or boneyard/ (killed), references updatedWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
integration, verification, code-cleanup, technical-debt, git-merge
npx claudepluginhub kucherenko/gangsta --plugin gangsta19 skills in this plugin
/audit-reviewUse when completing tasks, implementing major features, or before merging — dispatches the-inspector to audit the books before the job is closed/drill-tddUse when implementing any feature or bugfix — enforces the Red-Green-Refactor drill with no production code allowed without a failing test first/exit-strategyUse when implementation is complete and all tests pass — guides the clean exit from a development branch with structured options for merge, PR, or cleanup/interrogation-debuggingUse when encountering any bug, test failure, or unexpected behavior — finds the rat in the code through systematic root-cause interrogation before any fix attempts/omertaUse when enforcing governance guardrails during any gangsta operation — referenced as cross-cutting concern by all skills for anti-hallucination, authorization, state durability, resource management, and spec supremacy rules/receiving-ordersUse when receiving code review feedback — processes orders with technical rigor, not blind obedience or performative agreementOther plugins' skills for the same job