/code-practices:surface-assumptionsfrom code-practices
Identify and validate hidden assumptions before they become bugs. Use before implementing features or when reviewing generated code.
Ships in code-practices. Installing the plugin adds it to Claude Code.
Use before implementing a feature, or when reviewing generated code. Critical for catching the #1 LLM coding mistake.
Karpathy: "The most common category [of LLM errors] is that the models make wrong assumptions on your behalf and just run along with them without checking."
LLMs don't ask clarifying questions. They pick an interpretation and commit to it. This skill forces assumptions to be explicit.
Before or during implementation, explicitly list what the code assumes:
Input Assumptions:
State Assumptions:
Environment Assumptions:
Business Logic Assumptions:
| Assumption | Confidence | Impact if Wrong | Action Needed |
|---|---|---|---|
| User is authenticated | High | Security breach | Add auth check |
| Dates are ISO format | Medium | Parse errors | Validate format |
| Max items is 100 | Low | Performance issues | Clarify with user |
STOP and ask the user. Don't guess. Present the assumption and alternatives:
I'm assuming the date format is ISO 8601 (YYYY-MM-DD).
Should I also support:
1. US format (MM/DD/YYYY)
2. EU format (DD/MM/YYYY)
3. Unix timestamps
For each assumption, either:
When surfacing assumptions:
## Assumptions Made
### Validated in Code
- [x] User ID is a valid UUID (validated at line 45)
- [x] Amount is non-negative (validated at line 52)
### Documented
- [x] Dates are in UTC timezone (see comment at line 30)
### Needs Clarification
- [ ] Should deleted users still appear in reports?
- [ ] What happens if payment fails mid-transaction?
- [ ] Is the 100-item limit a hard requirement?
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub rahulsub/code-practices-plugin --plugin code-practicesOther plugins' commands for the same job
13 commands in this plugin
/cleanupSystematic code cleanup after completing features. Use after refactoring or periodically to remove dead code, console statements, TODOs, and tech debt./code-reviewReview code like a skeptical senior engineer. Use when reviewing PRs, after generating significant code, or before merging changes./context-managementManage Claude Code sessions effectively. Use during long sessions, multi-step tasks, or when responses start degrading. Covers /clear, checklists, and subagents.