From foundry
Post-mill micro-domain deep audit. After the mill can't find anything else, churn zooms into tiny areas — individual functions, single pages, specific flows — and asks extremely specific questions about whether they actually work. Finds issues that broad audits miss.
How this skill is triggered — by the user, by Claude, or both
Slash command
/foundry:temperopusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Foundry Integration:** This skill's methodology is used as the TEMPER phase (Phase F5) in `/foundry --temper`. Renamed concepts: churn domains → temper domains, SOLID/CRACKED → HARDENED/BRITTLE, CH-N findings → T-N findings. When invoked by Foundry, domains and probe results go to `foundry/temper/`.
Foundry Integration: This skill's methodology is used as the TEMPER phase (Phase F5) in
/foundry --temper. Renamed concepts: churn domains → temper domains, SOLID/CRACKED → HARDENED/BRITTLE, CH-N findings → T-N findings. When invoked by Foundry, domains and probe results go tofoundry/temper/.
Churn activates after the mill terminates with zero OPEN findings. Broad audits miss things because they look at too much at once. Churn zooms into the smallest units of functionality and proves they work — or proves they don't.
Your job is to FIND what's broken. Assume every function has a bug until you prove otherwise by reading the body line by line. If you finish with zero findings, you failed — re-read the 5 most complex functions and run the checklist again.
THIS PHASE IS SPEC-BLIND. Do NOT read the spec, sub-spec, or mill findings yet. Domain discovery is driven entirely by the filesystem. This prevents anchoring on spec-related code and ensures the ENTIRE codebase is covered.
A micro-domain is the smallest unit of functionality that can be independently verified.
Mechanically enumerate the codebase — exhaustive, not creative:
src/, pkg/, internal/, cmd/, lib/, app/, etc.)Group the inventory into micro-domains. Categories:
For each micro-domain, generate 3-5 extremely specific questions about function bodies. Include both functional probes (does it do what it should?) and code quality probes (errors, validation, resources, security).
Each domain entry includes:
Example:
Domain: login-form-submit
Entry: src/components/LoginForm.tsx:handleSubmit
Chain: handleSubmit → authApi.login() → POST /api/auth/login → authHandler.Login() → authService.Authenticate() → userRepo.FindByEmail()
Probes:
1. Does handleSubmit() call authApi.login() with email and password from form state?
2. Does authApi.login() make a POST to /api/auth/login with credentials in the body?
3. Does authHandler.Login() return the token in the response (not empty body)?
4. Does authService.Authenticate() hash-compare (not plaintext compare)?
5. After success, does the frontend store the token and redirect?
Coverage requirements:
Only after domains are finalized, read quality_reports/mill-sub-spec.md. Tag
domains that overlap with known findings (probe deeper) and domains with no spec
overlap (extra scrutiny — the mill never examined these).
For each micro-domain:
rules/audit-reference.md) on every function bodyrules/audit-reference.md for the full protocol.rules/audit-reference.md). SOLID means "I would bet money this works."CH-{domain}-{probe_number} (e.g., CH-login-3)While probing, look for improvement opportunities: missing loading/error/empty states, missing validation, missing confirmations for destructive actions, accessibility gaps, missing retry/timeout handling, UX improvements.
For each suggestion:
quality_reports/suggestion-backlog.md)Create quality_reports/churn-{timestamp}.md. Required sections:
CH-N ID, description, file:line, fix directionAlso update quality_reports/mill-sub-spec.md with domain verdicts and new findings.
MCP (optional): If the codsworth MCP server is available, call register_artifact
to move the churn report into the structured run directory, and validate_report with
schema_name: "churn" to validate the JSON block.
Churn is NOT a single pass. It cycles: probe → fix → re-probe → SOLID or STUCK.
Mechanics:
source: "churn", CH- IDs
b. Route fixes through the foundry fix loop (DO NOT fix directly)
c. After fixes, re-probe the same domain
d. If still not SOLID after 3 attempts → mark STUCK, move onLimits:
--max-mill)Domain tracker: quality_reports/churn-domains.md — tracks each domain's status,
entry point, probe count, pass count, findings fixed, and suggestions. Updated after
every probe pass.
After all domains are SOLID or STUCK, churn transitions to file-by-file sweeping. This catches bugs BETWEEN domains and in files that didn't fit any domain.
Walk every source file (not just domain entry points). For each file:
rules/audit-reference.md) on every functionCS-THIN-{N} finding for each unsatisfied OT. These
get escalated to full implementation items in the fix queue, not patches.quality_reports/churn-sweep-{pass}.mdFile ordering: Pass 1 starts from entry points outward. Pass 2+ prioritizes files changed by fixes, complex files, dependencies of fixed files, then uncovered files.
Only runs with --mill-ui <url>. Exploratory, not spec-based.
After each sweep pass, sync to ledger with source: "churn-sweep" and CS- IDs,
create fix queue via the foundry defect tools, execute through the foundry fix loop,
then start the next sweep pass focusing on changed files.
There is no iteration cap on sweep mode. Churn continues until /marathon stop or
session end. After a pass with zero new issues: read more carefully, try different
scenarios, check for regressions from previous fixes, read files not yet covered.
Churn never declares itself done.
Recommended effort: max (Opus only). Micro-domain probing requires maximum reasoning
depth to catch subtle bugs in individual function bodies. When building API requests, use
effort: "max". On Sonnet, fall back to effort: "high".
churn-done with CRACKED domains that never got fix attempts. Every non-SOLID
domain must get 3 fix attempts before being marked STUCK. The orchestrator rejects
completion if CRACKED domains exist without fix attempts or STUCK status.Prerequisites: API key with batch access, large number of independent micro-domains
Churn probes are inherently independent — each domain is probed in isolation. When the Batch API is available, submit all domain probes as a single batch for 50% cost reduction:
When to use: Large codebases with 20+ micro-domains where interactive probing would take hours. Not suitable when fix-probe turnaround speed matters more than cost.
npx claudepluginhub alphabravocompany/codsworth-marketplace --plugin foundryAudit codebases systematically for quality, consistency, and broken patterns. Guides defining scope, creating checklists, and documenting findings for pre-release or tech debt review.
Runs a structured 14-dimension bug hunt using Draft context (architecture, tech-stack, product) to eliminate false positives. Generates severity-ranked reports with code evidence, data flow traces, and optional regression tests.
Reviews code for quality issues: architecture conformance, anti-patterns, performance, maintainability. Read-only analysis, never modifies code.