| name | build-sweep |
| model | sonnet |
| description | Produces a verified build/test status report and auto-fixed modules by sweeping all Go modules in a workspace. Use when: "run a sweep", "check all builds", "nightly sweep", "fix all failing modules", "workspace health check". |
| category | system-health |
| triggers | ["run a sweep","check all builds","nightly sweep","fix all failing modules","workspace health check"] |
| tier | 1 |
| agents | ["primary"] |
| tool_dependencies | ["file_system"] |
| inputs | [{"name":"workspace_path","type":"string","description":"Root directory containing Go modules to sweep","required":true}] |
| outputs | [{"name":"sweep_report","type":"text","format":"markdown-table","description":"Verified status table of all modules with build/test results, fixes applied, and commit hashes"}] |
Build Sweep Skill
Philosophy
A healthy workspace is one where every module compiles and every test passes. The build sweep is not a debugging session — it is a systematic sweep that treats each module as an independent unit, diagnoses failures mechanically, and applies minimal fixes. The sweep must never trust self-reports: every fix is verified by re-running the exact build and test commands that originally failed.
When to Use
- As a scheduled nightly task to catch drift across a multi-module workspace
- Before a release to verify all modules are green
- After a large refactor or dependency update that may have broken multiple modules
- When onboarding to a workspace to establish a health baseline
Workflow
Phase 1: Detect
- Find all directories containing
go.mod under the workspace path (skip vendor/, .git/, node_modules/, .claude/worktrees/)
- For each module, run
go build ./... and go test ./...
- Collect results into a table: module | build status | test status | error summary
Phase 2: Diagnose and Fix
For each failing module, dispatch a parallel agent (max 5 concurrent) to:
- Read the failing build/test output
- Read the relevant source files to diagnose the root cause
- Implement the minimal fix — do not refactor, do not add features
- Re-run that module's build and tests to confirm green
Phase 3: Verify
After ALL agents complete, independently verify each fix:
- Run the tests yourself — do NOT trust agent self-reports of completion
- Check actual file diffs with
git diff
- Confirm no duplicate imports, wrong formats, or regressions
- Run the full suite one final time to catch cross-module integration issues
Phase 4: Commit
If all fixes pass verification:
- Stage only the fixed files (not unrelated changes)
- Commit each module separately:
fix(sweep): [module] — [one-line description]
Phase 5: Report
Output a verified summary table: module | failure type | fix applied | verification status | commit hash
Output
The skill produces:
- A markdown table summarizing all module statuses
- Git commits for each fix applied (one per module)
- A final pass/fail verdict for the entire workspace