fix-issues-critically/SKILL.md
--- name: fix-issues-critically description: Fix known code issues (bugs, lint errors, test failures, bad patterns) by critically evaluating multiple approaches before applying the best solution. Use after a code review, test run, or lint check has identified issues. Triggers on: "fix the issues", "resolve these findings", "fix the failures", "fix what was found", "fix these problems". Do NOT use for code review itself — use only when issues are already identified. license: CC-BY-4.0 metadata:
npx skillsauth add anahelenasilva/skills fix-issues-criticallyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Autonomously fix known code issues by analyzing root causes, evaluating multiple approaches, and applying the best solution with documented rationale.
Extract all issues from the current context. Sources include:
List each issue with its location (file:line) and description.
Order issues by:
For each issue in priority order:
Read enough surrounding code to understand the full context. Never fix based on just the error line — understand the function, its callers, and its dependencies.
Distinguish symptom from cause. A test failure is a symptom; the bug that causes the wrong behavior is the cause. Fix the cause.
Generate at least 2 possible fixes. For non-trivial issues, aim for 3. Consider:
Rate each approach against these criteria:
| Criterion | Question | |-----------|----------| | Correctness | Does this fully fix the root cause, or just the symptom? | | Security | Does this introduce any vulnerability? | | Performance | Does this degrade performance in any scenario? | | Maintainability | Is this easy to understand and maintain? | | Blast radius | What else could break from this change? |
Select the approach that scores best across all criteria. The "simplest fix" is not always the right choice if it leaves the root cause partially addressed.
After all fixes are applied, provide a concise report. For each fix:
#### [Issue description]
**Root cause:** [what was actually wrong]
**Approach chosen:** [description of the fix]
**Why:** [why this approach was selected over alternatives]
**Alternatives rejected:**
- [Alternative 1]: [reason for rejection]
- [Alternative 2]: [reason for rejection]
**Verified:** [how verification was done]
User says: "fix the issues from the review" Context: Code review found 3 issues — a potential null pointer, an unhandled promise rejection, and a missing edge case in validation.
Actions:
Result: All 3 issues fixed, report explains why each approach was chosen
User says: "fix the failing tests"
Context: pnpm test shows 2 test failures.
Actions:
Result: Tests pass, report clarifies whether tests or code were fixed and why
User says: "resolve these lint errors" Context: ESLint reports 5 errors across 3 files.
Actions:
Result: Lint clean, report notes any intentional suppressions with justification
The symptom is visible but the cause is unclear:
Two issues require contradictory changes:
Multiple approaches score similarly on evaluation:
tools
Merges a specified branch into the current branch using pnpm-based verification (typecheck + tests), resolves conflicts, and optionally closes a GitHub issue via gh CLI. Use when the user mentions "Sandcastle", asks to merge a branch and close an issue, or references the Sandcastle merge protocol.
tools
Autonomously implements open GitHub issues labeled "Sandcastle" one at a time using the RALPH workflow (explore, plan, RGR test-first, verify, commit, close). Use when the user says "implement next Sandcastle issue", "process open issues", "run RALPH", or asks to work through the Sandcastle backlog. Assumes pnpm, gh CLI, and git are configured in the current repo.
development
Reviews and refines code on a branch for the Sandcastle project. Use when asked to "review", "clean up", "refine", or "code review" on a branch. Call as `/sandcastle-code-review` to review the current branch, or `/sandcastle-code-review [branch-name]` to review a specific branch. Makes improvements in place — reads the diff, fixes issues, runs tests, commits. Do NOT use for general code questions or reviews outside the Sandcastle project.
development
Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.