laundering
Use when all territories report completion after the hit — handles integration, verification, consigliere final review, cleanup, and ledger updates to produce clean production-ready code
kucherenko · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add kucherenko/gangsta --skill launderingAbout this skill
name: laundering description: Use when all territories report completion after the hit — handles integration, verification, consigliere final review, cleanup, and ledger updates to produce clean production-ready code
Laundering: Verification and Integration
Overview
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.
Trigger
Invoked after all Crew Leads report territory completion and the Don approves (The Hit complete).
Process
Step 1: Integration
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.
Step 2: Verification
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:
- Identify which Work Package introduced the failure
- The responsible Crew Lead dispatches a Worker to fix it
- Re-run verification
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
- Any match is a blocking defect. Remove the identifier from the deliverable and re-run the scan before declaring the Heist clean.
- Exception: if a match is a legitimate project identifier unrelated to Gangsta planning, record the matching string, the file path, and a one-sentence justification in this laundering checkpoint. The Don MUST acknowledge the exception as part of the checkpoint review sign-off before this gate is cleared.
Step 3: Technical Debt Audit
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.
3.1 Copy/Paste Detection (jscpd)
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.
3.2 Long Files
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:
- ≤ 300 lines: OK.
- 301–500 lines: flagged for review. The Underboss names the file and asks: is there a single responsibility that justifies the length? If yes, document the justification. If no, extract a module before proceeding.
- > 500 lines: blocking. Refactor into smaller modules — split by responsibility. The only escape is a Contract clause that mandates a single file (e.g. a vendored SDK shim) and the Don's explicit approval.
Record the post-refactor line count in the checkpoint.
3.3 Test Coverage
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:
- Floor: If the project's coverage config declares a threshold (e.g.
--coverageThresholdinjest.config.*,fail_underin.coveragerc), the run must meet it. Failure is a blocking defect — add tests until the threshold passes. - Delta: New or modified code must not lower the project's overall coverage below the pre-Heist baseline. Capture the baseline number from the Resource Development step (or
git stashand re-run if missing). If coverage on modified lines dropped, write the missing tests before proceeding.
Record the final coverage number in the checkpoint.
3.4 Clean Architecture Audit
The Consigliere will cover this architecturally in Step 4 — this sub-check is the mechanical pre-filter. For every modified file, verify:
- Direction of dependency: the file imports only from lower layers (domain → application → infrastructure → delivery). An import from a higher layer into a lower one is a blocking defect unless the Contract explicitly approves the inversion.
- No business logic in delivery or infrastructure layers: controllers, CLI handlers, route bindings, DB adapters, and network clients must contain only marshalling and delegation. Business rules belong in domain/application code.
- Single responsibility: the filename declares one responsibility and the contents honor it. A file that does two unrelated jobs is a blocking defect.
If the project has no formal layering, this sub-check passes by default — note "no formal architec
Read the complete source ↗