This skill teaches agents how to assess task complexity, enforce quality gates, and prevent wasted work on incomplete or poorly-defined tasks. Inspired by production-grade development practices, qu...
This skill teaches agents how to assess task complexity, enforce quality gates, and prevent wasted work on incomplete or poorly-defined tasks. Inspired by production-grade development practices, qu...
This skill teaches agents how to assess task complexity, enforce quality gates, and prevent wasted work on incomplete or poorly-defined tasks. Inspired by production-grade development practices, quality gates ensure agents have sufficient context before proceeding and automatically escalate when stuck or blocked.
Key Principle: Stop and clarify before proceeding with incomplete information. Better to ask questions than to waste cycles on the wrong solution.
When to Use This Skill
Auto-Activate Triggers
Receiving a new task assignment
Starting a complex feature implementation
Before allocating work in Squad mode
When requirements seem unclear or incomplete
After 3 failed attempts at the same task
When blocked by dependencies
Manual Activation
User asks for complexity assessment
Planning a multi-step project
Before committing to a timeline
When uncertain about requirements
Core Concepts
1. Complexity Scoring (1-5 Scale)
Assess every task on a 1-5 complexity scale:
Level 1: Trivial
Single file change
Simple variable rename
Documentation update
CSS styling tweak
< 50 lines of code
< 30 minutes estimated
No dependencies
No unknowns
Level 2: Simple
1-3 file changes
Basic function implementation
Simple API endpoint (CRUD)
Straightforward component
50-200 lines of code
30 minutes - 2 hours estimated
0-1 dependencies
Minimal unknowns
Level 3: Moderate
3-10 file changes
Multiple component coordination
API with validation and error handling
State management integration
Database schema changes
200-500 lines of code
2-8 hours estimated
2-3 dependencies
Some unknowns that need research
Level 4: Complex
10-25 file changes
Cross-cutting concerns
Authentication/authorization
Real-time features (WebSockets)
Payment integration
Database migrations with data
500-1500 lines of code
8-24 hours (1-3 days) estimated
4-6 dependencies
Significant unknowns
Multiple decision points
Level 5: Very Complex
25+ file changes
Architectural changes
New service/microservice
Complete feature subsystem
Third-party API integration
Performance optimization
1500+ lines of code
24+ hours (3+ days) estimated
7+ dependencies
Many unknowns
Requires research and prototyping
High risk of scope creep
2. Quality Gate Thresholds
BLOCKING Conditions (MUST resolve before proceeding):
Incomplete Requirements (>3 critical questions)
If you have more than 3 unanswered critical questions, STOP
Examples of critical questions:
"What should happen when X fails?"
"What data structure should I use?"
"What's the expected behavior for edge case Y?"
"Which API should I call?"
"What authentication method?"
Missing Dependencies (blocked by another task)
Task depends on incomplete work
Required API endpoint doesn't exist
Database schema not ready
External service not configured
Stuck Detection (3 attempts at same task)
Tried 3 different approaches, all failed
Keep encountering the same error
Can't find necessary information
Solution keeps breaking other things
Evidence Failure (tests/builds failing)
Tests fail after 2 fix attempts
Build breaks after changes
Type errors persist
Integration tests failing
Complexity Overflow (Level 4-5 tasks without breakdown)
What must I know to complete this?
- Data structures?
- Expected behaviors?
- Edge cases?
- Error handling?
- API contracts?
→ List all critical questions
→ Count unanswered questions
Check Dependencies
What does this task depend on?
- Other tasks?
- External services?
- Database changes?
- Configuration?
→ Verify dependencies ready
→ List blockers
Gate Decision
if (unansweredQuestions > 3) → BLOCK
if (missingDependencies > 0) → BLOCK
if (complexity >= 4 && !hasPlan) → BLOCK
if (complexity == 3) → WARN
else → PASS
Check:
- [ ] All subtasks are Level 1-3
- [ ] Dependencies clearly mapped
- [ ] Each subtask has clear acceptance criteria
- [ ] Sum of estimates reasonable
- [ ] No overlapping work
## Functional Requirements- [ ] **Happy path defined:** What should happen when everything works?
- [ ] **Error cases defined:** What should happen when things fail?
- [ ] **Edge cases identified:** What are the boundary conditions?
- [ ] **Input validation:** What inputs are valid/invalid?
- [ ] **Output format:** What should the output look like?
- [ ] **Success criteria:** How do we know it works?
When proceeding with warnings, document assumptions:
## Assumptions Made1.**Assumption:** API will return JSON format
**Risk:** Low - standard REST practice
**Mitigation:** Add try-catch for parsing
2.**Assumption:** User authentication already implemented
**Risk:** Medium - might not exist
**Mitigation:** Check early, escalate if missing