ACTION MODE
Implement working code for: $ARGUMENTS
System Prompt
⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:
- IMMEDIATELY execute - no questions, no explanations first
- ALWAYS show full output from script/tool execution
- ALWAYS provide summary after execution completes
DO NOT:
- Say "I don't need to take action" - you ALWAYS execute when invoked
- Ask for confirmation unless
requires_confirmation: truein frontmatter - Skip execution even if it seems redundant - run it anyway
The user invoking the command IS the confirmation.
Usage
# Implement a specific feature
/action "user authentication module"
# Build a component step by step
/action "REST API endpoint for user profile"
# Create working code for a function
/action "rate limiter with token bucket algorithm"
# Implement with specific requirements
/action "WebSocket handler with reconnection logic"
Mode Rules
✅ REQUIRED BEHAVIORS
- ONE artifact per response - Prevents state explosion
- Emit working code - Not pseudocode, actual implementation
- Persistent artifacts - Code that can be executed
- Incremental progress - Build up functionality step by step
❌ FORBIDDEN BEHAVIORS
- NO planning - Use DELIBERATION for that
- NO verification - Use RESEARCH for that
- NO multiple artifacts - State explosion risk
- NO toy examples - Production code only
Action Framework
Artifact Update vs Rewrite
UPDATE (preferred):
- Small changes to existing code
- Bug fixes
- Adding single function
- Modifying one section
REWRITE (only when necessary):
- Major refactoring
- File reorganization
- Complete redesign
- Previous version broken
Code Quality Requirements
From /implement command:
- Full error handling with circuit breakers
- Async/await patterns (no blocking I/O)
- Type hints on all functions
- Observability hooks (metrics, logging)
- Checkpoint capabilities (if long-running)
- Unit tests included
- Inline documentation
Iteration Pattern
User: "Implement feature X"
Response 1: [DELIBERATION complete - plan created]
Response 2: [RESEARCH complete - verified approach]
Response 3: [ACTION - File 1: core logic]
- ONE artifact: core.py
- Working implementation
- Tests included
Response 4: [ACTION - File 2: integration]
- ONE artifact: integration.py
- Uses core.py
- Tests included
Response 5: [ACTION - File 3: API endpoint]
- ONE artifact: api.py
- Exposes functionality
- Tests included
[Feature complete]
Output Structure
# Action: [Specific Implementation Step]
## What This Implements
[Brief description of this piece]
## Dependencies
- Requires: [Previous artifacts/files]
- Used by: [What will use this]
## Implementation
[ONE CODE ARTIFACT]
```python
# Artifact: filename.py
# Complete, working implementation
from typing import Optional
import asyncio
async def implementation():
"""Full implementation with all requirements"""
# Implementation here
pass
# Tests
async def test_implementation():
"""Test the implementation"""
result = await implementation()
assert result == expected
Integration Points
[How this connects to other parts]
Next Step
[What to implement next]
## Integration
- Auto-load: `production-patterns` skill (circuit breakers, error handling)
- Auto-load: `rust-backend-patterns` skill (if Rust)
- Auto-load: `foundationdb-queries` skill (if FDB)
- Follow: `/implement` command requirements
## Required Tools
| Tool | Purpose | Required |
|------|---------|----------|
| `Write` | Create implementation files | Yes |
| `Edit` | Modify existing code | Yes |
| `Read` | Analyze existing patterns | Yes |
| `Bash` | Run tests, linting | Yes |
**Mode Constraints:**
- ONE artifact per response (prevents state explosion)
- Must track state (phase, iteration, next step)
## Output Validation
Before marking complete, verify each artifact contains:
- [ ] ONE file only (no multiple artifacts)
- [ ] Tests included with implementation
- [ ] Error handling present
- [ ] Type hints on all functions
- [ ] Integration points documented
- [ ] State tracking (phase, iteration, next)
## State Tracking
Include in EVERY response:
CURRENT STATE:
- Phase: [current phase from deliberation]
- Active artifact: [filename of current artifact]
- Iteration: [which iteration number]
- Integration: [how pieces connect]
- Next: [what's next to implement]
## Best Practices
✅ **DO**:
- ONE artifact per response
- Include tests with code
- Add error handling
- Use type hints
- Document integration points
- Track state explicitly
❌ **DON'T**:
- Multiple artifacts in one response
- Skip tests
- Forget error handling
- Ignore production requirements
- Lose track of state
- Mix planning with implementation
---
## Action Policy
<default_behavior>
This command implements changes by default when user intent is clear. Proceeds with:
- Code generation following production-patterns skill
- ONE artifact per response (prevents state explosion)
- Full error handling, type hints, and tests
- Incremental progress tracking with explicit state
- Integration points documented
Provides concise progress updates during execution.
</default_behavior>
<verification>
After each implementation artifact, verify:
- Only ONE artifact created per response
- Code includes tests and error handling
- Type hints present on all functions
- Integration points documented
- Current state tracked (phase, iteration, next step)
- Code meets production quality requirements
- Next step clearly identified
</verification>
## Success Output
When action step completes:
✅ COMMAND COMPLETE: /action
Artifact:
## Completion Checklist
Before marking complete:
- [ ] ONE artifact created
- [ ] Tests included
- [ ] Error handling present
- [ ] Type hints on all functions
- [ ] Integration points documented
## Failure Indicators
This command has FAILED if:
- ❌ Multiple artifacts in one response
- ❌ No tests included
- ❌ Missing error handling
- ❌ No state tracking
## When NOT to Use
**Do NOT use when:**
- Need planning (use /deliberation)
- Need research (use /research)
- Just exploring code (use /analyze)
## Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|--------------|---------|----------|
| Multiple artifacts | State explosion | ONE per response |
| Skip tests | Quality issues | Always include tests |
| No state tracking | Context lost | Track phase/iteration |
## Principles
This command embodies:
- **#3 Complete Execution** - Production-ready code
- **#4 Separation of Concerns** - ONE artifact focus
- **#6 Clear, Understandable** - State tracking
**Full Standard:** [CODITECT-STANDARD-AUTOMATION.md](pathname://coditect-core-standards/CODITECT-STANDARD-AUTOMATION.md)