/egc:engineering-fix --severity <critical|high|medium|low> | --file <path> | blank for CRITICAL onlyfrom egc
Applies engineering corrections from the last audit run on an isolated branch with incremental validation. Supports --severity and --file filters.
Ships in egc. Installing the plugin adds it to Claude Code.
Input: $ARGUMENTS
Applies the remediation plan produced by /engineering-audit. Operates exclusively on an isolated branch. Never modifies files directly on the current branch. Always requires explicit user confirmation before starting.
Before running any fix:
ls .egc/audits/engineering-audit-*.md 2>/dev/null | sort | tail -1
If no audit report exists, stop: "Run /engineering-audit first."
git status --porcelain
If uncommitted changes exist, stop: "Stash or commit your changes before running engineering-fix."
Ready to apply engineering fixes.
Scope: <CRITICAL only | CRITICAL + HIGH | etc. based on $ARGUMENTS>
Branch: engineering-fix/<date>
Files to modify: N
This will:
1. Create branch engineering-fix/<date>
2. Apply each fix incrementally
3. Run lint + typecheck + tests after each file
4. Revert and stop if any check fails
Confirm? (yes / no)
Do NOT proceed without a "yes" response.
| Argument | Behavior |
|---|---|
--severity critical | Apply CRITICAL fixes only (default) |
--severity high | Apply CRITICAL + HIGH fixes |
--severity medium | Apply CRITICAL + HIGH + MEDIUM fixes |
--severity all | Apply all findings |
--file <path> | Apply fixes to one specific file only |
| blank | CRITICAL fixes only |
git checkout -b engineering-fix/$(date +%Y-%m-%d)
Read the most recent audit report:
cat .egc/audits/engineering-audit-$(ls .egc/audits/ | grep engineering-audit | sort | tail -1 | sed 's/engineering-audit-//' | sed 's/\.md//')
Extract the list of files and fixes matching the requested severity.
For each file in the plan (CRITICAL first, then HIGH, etc.):
3a. Show the planned change:
Fixing: <file>:<line>
Technique: <Extract Method | Early Return | etc.>
Before: <brief description of current code>
After: <brief description of target state>
3b. Apply the fix: modify the file using the specific refactoring technique from the plan.
3c. Validate immediately:
npm run lint -- --quiet 2>&1 | tail -5
npx tsc --noEmit 2>&1 | tail -10
npm test 2>&1 | tail -20
3d. On failure: revert and stop:
git checkout -- <file>
Report:
Fix FAILED on <file>
Check: <lint|typecheck|test>
Error: <error output>
Reverted. Stopping.
Remaining fixes not applied: N files
Run /engineering-audit to re-assess.
3e. On success: commit the file:
git add <file>
git commit -s -m "refactor(<file>): <technique> to reduce <metric>"
After all fixes applied:
npm run lint
npx tsc --noEmit
npm test
If all pass:
Engineering fix complete.
Applied: N fixes across M files
Branch: engineering-fix/<date>
All checks: lint ✓ typecheck ✓ tests ✓
Next: Review the branch and open a PR when ready.
gh pr create --title "refactor: engineering fixes <date>" --body "Automated engineering health improvements from /engineering-audit"
Append a fix summary to the audit report:
## Fix Session: <timestamp>
Applied N fixes. Branch: engineering-fix/<date>.
| File | Technique | Result |
|---|---|---|
| src/foo.ts | Extract Method | success |
| src/bar.ts | Early Return | success |
-s): DCO compliance.egc/audits//engineering-auditWhat the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub fmarzochi/egc --plugin egc77 commands in this plugin
/asideAside CommandAnswer a quick side question without interrupting or losing context from the current task. Resume work automatically after answering./autonomous-lesson-learningAutonomous Lesson Learning CommandStart an autonomous loop that recalls stored lessons before each iteration and saves or reinforces lessons on failures and wins./auto-updateAuto UpdatePull the latest EGC repo changes and reinstall the current managed targets.Other plugins' commands for the same job