Command Execution Protocol
CRITICAL: Task-First Development
Before executing ANY command, you MUST check if a task exists for it.
Pre-Command Checklist
Before running any command:
- STOP: Is there a task for this operation?
- CHECK: Review available tasks with
task --listor check taskfile.md - USE: Use the task if it exists
- ASK: If no task exists and the command will be run multiple times, ask if a task should be created
Common Command Mappings
❌ NEVER run these raw commands:
| Raw Command | ✅ Use This Task Instead |
|---|---|
kubectl apply -k path/ | task infra:apply or similar |
kubectl delete namespace X | task infra:delete or similar |
kubectl logs -f deployment/X | task infra:logs or similar |
docker build -t image . | task infra:build or similar |
pytest or python -m pytest | task test or task metrics:test |
python script.py | task <component>:<action> |
npm test or npm run X | task <component>:test or similar |
Red Flags - Stop and Check for Tasks
If you’re about to type any of these, STOP and check for a task:
kubectl(any subcommand)docker(build, run, push, etc.)pytestorpython -m pytestpython -m(any module)npm runoryarn- Any command with multiple flags or arguments
- Any command you’ve run before in this session
When Raw Commands Are Acceptable
Raw commands are ONLY acceptable when:
- One-time exploration:
kubectl get podsto check status - Debugging: Quick inspection commands that won’t be repeated
- No task exists: AND it’s truly a one-off operation
When to Create New Tasks
Create a new task if:
- You run the same command twice
- The command has multiple flags or steps
- The command is part of a workflow
- Others might need to run this command
Task Discovery Process
- Run
task --listto see all available tasks - Check
.kiro/steering/taskfile.mdfor task descriptions - Look for patterns:
task <component>:<action> - Common patterns:
task <component>:test- Run teststask <component>:build- Build artifactstask <component>:dev- Start development servertask infra:apply- Apply infrastructure changestask infra:status- Check statustask infra:logs- View logs
Examples of Correct Behavior
❌ Wrong:
# Running raw commands
kubectl apply -k infra/kustomize/
docker build -t metrics-service .
python -m pytest tests/✅ Correct:
# Check for tasks first
task --list | grep infra
task infra:apply
task infra:build
task metrics:testEnforcement
This is a CRITICAL rule. Violating it wastes time and creates inconsistency. Always use tasks when they exist.