This skill should be invoked when running /auto-smart command, when needing to assess task complexity, when choosing between DIRECT and ORCHESTRATED execution modes, when enforcing evidence gates, or...
Core intelligence for /auto-smart command. Handles complexity scoring, mode selection, evidence gates, and failure recovery.
/auto-smart command is invokedScore every task 1-5 based on scope:
| Score | Mode | Characteristics |
|---|---|---|
| 1-2 | DIRECT | Simple, few files, clear scope |
| 3-5 | ORCHESTRATED | Complex, many files, needs phases |
See references/complexity-rubric.md for detailed scoring criteria.
DIRECT Mode (Score 1-2):
ORCHESTRATED Mode (Score 3-5):
Every claim MUST include verification:
ā
VALID:
"Implemented feature X [VERIFIED: npm test ā 12 passing]"
"Fixed bug Y [VERIFIED: manual test confirms fix]"
"Added component Z [VERIFIED: npm run build ā success]"
ā INVALID:
"I implemented the feature" (no evidence)
"Should work now" (speculation)
"Tests probably pass" (not verified)
Red Flag Words (trigger re-verification):
See references/failure-handling.md for complete protocol.
Quick Reference:
Parse the user's request and score 1-5:
Analyze: "<user prompt>"
Factors:
- Estimated files affected: N
- Keywords detected: [list]
- Features mentioned: N
- Complexity signals: [list]
Score: X/5
Mode: DIRECT|ORCHESTRATED
Reasoning: "..."
Create .claude/smart-ralph/state.yaml:
version: "1.0"
mode: DIRECT|ORCHESTRATED
phase: ANALYZE|EXECUTE|VERIFY
complexity:
score: N
reasoning: "explanation"
mode_selected: DIRECT|ORCHESTRATED
started_at: "ISO timestamp"
prompt: "original user prompt"
orchestrated_phases: [] # only for ORCHESTRATED
failure_recovery:
pivot_count: 0
research_count: 0
last_error: null
DIRECT Mode:
ORCHESTRATED Mode:
If stuck (same error 3x, no progress):
Update state after each recovery attempt:
failure_recovery:
pivot_count: 2
research_count: 1
last_error: "description of what's failing"
Before outputting COMPLETE:
All state in .claude/smart-ralph/:
state.yaml - Machine-readable execution stateprogress.md - Human-readable progress reportstuck-report.md - Only created if STUCK (detailed context)## Smart Ralph Progress
**Task:** <original prompt>
**Mode:** DIRECT|ORCHESTRATED (Complexity: X/5)
**Started:** <timestamp>
**Status:** in_progress|complete|stuck
### Completed
- [x] Phase/Step 1: Description [VERIFIED: evidence]
### In Progress
- [ ] Phase/Step 2: Description
### Evidence Collected
- `npm test` ā 24 passing
- `npm run build` ā success
On session start, check for incomplete state:
.claude/smart-ralph/state.yamlSmart Mode reuses:
project-detector skill for tech stack detectionverification-runner skill for test/build/linttask-decomposer skill (only in ORCHESTRATED mode)| Aspect | /auto | /auto-smart |
|---|---|---|
| Approval gates | Phase 3, Phase 6 | None |
| Complexity detection | Manual classification | Automatic |
| Failure handling | Manual intervention | Auto pivot/research |
| Mode selection | Always full workflow | Adaptive |
| Resume | /auto-continue | Automatic |