| name | phase2-5-autonomous |
| description | Phase 2-5 autonomous execution guidance - Activate when Claude needs to decide technical choices during implementation/testing/review/release phases |
| version | 1.0.0 |
| trigger | phase2|phase3|phase4|phase5|implementation|testing|review|release |
Phase 2-5 Autonomous Execution Skill
šÆ Skill Purpose
This skill provides detailed guidance for Claude to operate fully autonomously during Phase 2-5 (Implementation, Testing, Review, Release) without asking the user for technical decisions or implementation choices.
š When to Activate
Automatically activate when:
- Current phase is Phase 2, 3, 4, or 5
- Requirements have been clarified (Phase 1 complete)
- AUTO_MODE_ACTIVE flag exists
- Claude is about to ask a technical question
Keywords that trigger this skill:
- "Should I use..."
- "Do you want me to..."
- "Is this implementation OK?"
- "Need to optimize?"
- "Fix this bug?"
š« Absolutely Forbidden Questions
Technical Choices
ā "Use A library or B library?"
ā "Implement with pattern X or Y?"
ā "Need async/await or promises?"
ā "Use TypeScript or JavaScript?"
Correct behavior: Choose based on:
- Project existing stack
- Performance requirements
- Maintainability
- Community best practices
Implementation Details
ā "Is this implementation correct?"
ā "Should I refactor this?"
ā "Add more comments?"
ā "Extract this to a function?"
Correct behavior: Apply code quality standards:
- Functions < 150 lines
- Cyclomatic complexity < 15
- Test coverage ā„ 70%
- Follow existing project patterns
Quality Issues
ā "Found a bug, fix it?"
ā "Warning detected, handle it?"
ā "Performance issue, optimize?"
ā "Code complexity high, simplify?"
Correct behavior: Fix immediately:
- Bug ā Fix + test
- Warning ā Handle + verify
- Performance ā Benchmark + optimize
- Complexity ā Refactor + validate
Workflow Progress
ā "Phase X complete, continue to Phase Y?"
ā "Finished implementation, run tests now?"
ā "All tests pass, proceed to review?"
Correct behavior: Auto-advance based on:
- Phase completion criteria (CLAUDE.md)
- Quality gate results
- Checklist completion
ā Decision-Making Framework
1. Business Requirements ā Check Documentation
Question: "What should the error message say?"
Decision Process:
1. Check .workflow/REQUIREMENTS_DIALOGUE.md
2. Check .workflow/CHECKLIST.md
3. Check docs/P1_DISCOVERY.md
4. If specified ā Use that
5. If not specified ā Use professional default
2. Technical Implementation ā Apply Standards
Question: "Which testing framework?"
Decision Process:
1. Check existing tests (grep -r "describe\|it\|test")
2. If found ā Use same framework
3. If none ā Choose industry standard:
- JavaScript: Jest/Vitest
- Python: pytest
- Bash: bats-core
- Go: testing package
3. Code Quality ā Enforce Thresholds
Question: "Function is 200 lines, refactor?"
Decision Process:
1. Check threshold: >150 lines = must refactor
2. Identify logical sections
3. Extract to smaller functions
4. Verify tests still pass
5. Report: "Refactored XX from 200ā80 lines"
4. Performance ā Benchmark & Optimize
Question: "Script takes 3 seconds, optimize?"
Decision Process:
1. Check requirement: hooks must be <2s
2. Profile: identify bottleneck
3. Optimize: apply fix
4. Benchmark: measure improvement
5. Report: "Optimized XX from 3sā0.8s"
š Phase-Specific Guidelines
Phase 2: Implementation
Autonomous Actions:
- Choose libraries (prefer: standard > popular > custom)
- Design architecture (pattern: existing > proven > new)
- Write code (style: project standard > language idiom)
- Create scripts (location: scripts/ > tools/)
- Configure hooks (register in: .git/hooks/ + .claude/hooks/)
Quality Standards:
- All functions have docstrings
- No hardcoded values (use config)
- Error handling on all external calls
- Logging for all state changes
Output Format:
ā
Implemented XX feature
- Added YY module (using ZZ library - industry standard)
- Created AA script (follows project pattern)
- Configured BB hook (registered in settings.json)
Technical choices made:
- ZZ library: most maintained, 50k+ stars, TypeScript support
- AA pattern: matches existing scripts/workflow_*.sh
- BB hook timing: PreToolUse (needs to intercept before write)
Phase 3: Testing
Autonomous Actions:
- Design test cases (coverage: critical path 100%)
- Write unit tests (framework: match existing)
- Write integration tests (scope: end-to-end flows)
- Run static checks (
bash scripts/static_checks.sh) - Fix all failures (iterate until green)
Quality Gates:
- All syntax errors fixed
- Shellcheck warnings < 5
- Code complexity < 15
- Hook performance < 2s
- Test coverage ā„ 70%
Output Format:
ā
Testing complete
Coverage: 78% (target: 70%) ā
- Unit tests: 25 passed
- Integration tests: 8 passed
- Static checks: all passed
Issues found and fixed:
1. Syntax error in line 45 - fixed
2. Shellcheck SC2086 - quoted variable
3. Function XX complexity 18ā12 - refactored
Performance:
- Hook execution: 0.8s (target: <2s) ā
Phase 4: Review
Autonomous Actions:
- Run pre-merge audit (
bash scripts/pre_merge_audit.sh) - Fix all critical issues
- Verify version consistency (6 files match)
- Check Phase 1 checklist (ā„90% complete)
- Generate REVIEW.md (>100 lines)
Critical Checks:
- No TODO/FIXME in production code
- Root directory docs ā¤7 files
- All hooks registered
- All tests passing
- Version 100% consistent
Output Format:
ā
Code review complete
Pre-merge audit: PASSED ā
- Critical issues: 0
- Warnings: 2 (all addressed)
- Version consistency: 6/6 files ā
- Phase 1 checklist: 95% complete ā
Review findings:
1. Optimized XX function (150ā85 lines)
2. Standardized error handling (3 locations)
3. Added missing test for YY edge case
REVIEW.md generated: 145 lines
Phase 5: Release
Autonomous Actions:
- Update CHANGELOG.md (add version entry)
- Update README.md (update version, add features)
- Create git tag (format: v{VERSION})
- Configure health checks (add to observability/)
- Configure SLO (add to observability/slo/)
Release Checklist:
- CHANGELOG.md updated
- README.md version bumped
- Tag created (vX.Y.Z)
- Health check configured
- SLO thresholds defined
- Root docs ā¤7 files
Output Format:
ā
Release prepared
Version: 8.1.0
- CHANGELOG.md: added v8.1.0 entry
- README.md: updated version + features
- Git tag: v8.1.0 created
Monitoring configured:
- Health check: /api/health endpoint
- SLO: 99.9% uptime, <200ms p95 latency
Documentation:
- Root docs: 7 files ā
- Phase 1 checklist: 100% complete ā
šÆ Decision Principles
1. Simplicity > Complexity
Choose: Standard library > Popular library > Custom code
Choose: Existing pattern > New pattern
Choose: Fewer dependencies > More dependencies
2. Consistency > Perfection
Match: Existing code style
Match: Project naming conventions
Match: Established patterns
3. Automation > Manual
Automate: Testing
Automate: Quality checks
Automate: Documentation generation
4. Evidence > Assumption
Benchmark before optimizing
Profile before refactoring
Test before claiming "fixed"
šØ Red Flags - When to Stop
Only interrupt autonomous mode if:
Contradictory requirements (rare, should be caught in Phase 1)
Requirement A: "Must support 10k concurrent users" Requirement B: "Run on Raspberry Pi" ā These contradict, need clarificationMissing critical information (rare, should be in requirements)
Need: Database connection string Found: Not in requirements, not in .env, not in config ā Cannot proceed without thisBlocker outside Claude's control
Error: API key invalid Error: Network unreachable ā Need user intervention
How to report blockers:
šØ BLOCKER DETECTED
Issue: XX requires YY but ZZ
Impact: Cannot complete Phase N
Attempted: [list what you tried]
Need: [specific user action required]
Options:
A. User provides YY
B. Skip XX feature (remove from checklist)
C. Use alternative approach (explain pros/cons)
š Reference Materials
Project Standards
- Code quality: CLAUDE.md "蓨éäæéä½ē³»"
- Testing: ā„70% coverage, critical path 100%
- Performance: Hooks <2s, APIs <200ms p95
- Documentation: Root ā¤7 files, .temp/ for temporary
Decision Sources (in order)
- Requirements (.workflow/REQUIREMENTS_DIALOGUE.md)
- Acceptance Criteria (.workflow/CHECKLIST.md)
- Technical Plan (docs/PLAN.md)
- Project Standards (CLAUDE.md)
- Existing Code (grep, read files)
- Industry Best Practices (language idioms, frameworks)
š” Examples
Example 1: Bug Found During Testing
ā Wrong:
"I found a null pointer bug in login.js line 45. Should I fix it?"
ā Correct:
"Fixed null pointer bug in login.js:45
Issue: userName could be null when OAuth fails
Fix: Added null check + fallback to 'Anonymous'
Test: Added unit test for OAuth failure scenario
Verified: All 28 tests passing ā
Example 2: Performance Issue
ā Wrong:
"The workflow_validator.sh takes 5 seconds. Want me to optimize it?"
ā Correct:
"Optimized workflow_validator.sh performance
Before: 5.2s (failed <2s requirement)
After: 1.8s (meets requirement ā)
Changes:
- Replaced 15 find commands with 2 glob patterns
- Cached git branch lookup (was called 20 times)
- Parallelized independent checks
Benchmark: Ran 10 times, average 1.8s, stddev 0.1s
Example 3: Library Choice
ā Wrong:
"For date formatting, should I use moment.js or date-fns?"
ā Correct:
"Implemented date formatting with date-fns
Choice: date-fns over moment.js
Reasons:
- Smaller bundle size (2kb vs 67kb)
- Better tree-shaking
- Active maintenance (updated 2 weeks ago)
- Already used in 3 existing modules
Implementation: Centralized in utils/date.js for consistency
š Learning from Past Mistakes
PR #40 Experience:
- Issue: AI asked "ē»§ē»åļ¼" multiple times during Phase 2-5
- Root cause: No explicit autonomous guidance
- Fix: This skill + hook combination
- Prevention: Skill activates automatically, provides decision framework
Key Takeaway:
User trust = Bypass permissions enabled
Your job = Use that trust wisely
How = Make good decisions, report clearly, deliver quality
ā Success Metrics
You're doing it right when:
- Zero questions asked during Phase 2-5 ā
- All decisions have clear rationale ā
- Quality gates pass on first try ā
- User says "wow, that was smooth" ā
You're doing it wrong when:
- Asking "is this OK?" ā
- Waiting for approval mid-phase ā
- User has to "nudge" you to continue ā
- Decisions seem arbitrary (no reasoning) ā
š Activation Confirmation
When this skill activates, you should think:
ā
Phase 2-5 autonomous mode activated
ā
Requirements clarified in Phase 1
ā
I have bypass permissions
ā
I have decision framework
ā
I have quality standards
ā
I have project context
ā Execute with full autonomy
ā Make professional decisions
ā Report clearly
ā Deliver quality
NO questions. Just excellence.