Task Automation Skill
Automated task execution system for the Journey project. Manages a task manifest and executes tasks via parallel agents.
When Claude Should Use This Skill
- User says "run tasks", "execute tasks", "dev loop", "work on backlog"
- User asks about task status or pipeline health
- User wants to run multiple tasks in parallel
- User mentions the manifest or available tasks
Core Concepts
Task Manifest
Located at docs/planning/tasks/manifest.json. Contains:
- Task definitions with ID, title, priority, complexity
- Status tracking (available, claimed, in_progress, completed)
- Dependencies between tasks
- Tags for categorization (backend, frontend, etc.)
Task Lifecycle
available → claimed → in_progress → completed
↓
blocked/abandoned
Conflict Detection
Tasks conflict if they:
- Modify the same files (check task spec's "Files to Create/Modify")
- Both have
backendtag (may touch server/src/index.ts) - Both have
frontendtag AND modify shared files (App.tsx, routes)
Safe parallel pairs: one backend + one frontend task.
Workflows
Single Task Execution
- Read manifest, find highest priority available task
- Claim task (update manifest status)
- Read task file from
docs/planning/tasks/<file> - Execute task (create/modify files per spec)
- Run build verification (
npm run build) - Update manifest to completed
Parallel Execution (--parallel N)
- Acquire manifest lock before reading
- Read manifest, find N non-conflicting available tasks
- Pre-claim all tasks in manifest (prevents race conditions)
- Release manifest lock after claiming
- Spawn N background agents via Task tool
- Each agent works independently on its task
- Monitor agent outputs for completion
- Acquire lock, update manifest for completed tasks, release lock
- Verify all builds pass
Manifest Locking Protocol
To prevent race conditions when multiple agents access the manifest:
# Acquire lock (waits up to 10s if held by another agent)
npx ts-node scripts/manifest-lock.ts acquire <agent-id>
# Release lock when done
npx ts-node scripts/manifest-lock.ts release <agent-id>
# Check lock status
npx ts-node scripts/manifest-lock.ts status
# Force release stale lock (use with caution)
npx ts-node scripts/manifest-lock.ts force-release
Lock Rules:
- Always acquire lock before reading/modifying manifest
- Release lock immediately after changes are written
- Locks auto-expire after 60 seconds (stale lock protection)
- Lock file:
docs/planning/tasks/manifest.lock(gitignored)
Pipeline Check
- Read manifest
- Count by status: available, completed, blocked
- Check if ideation needed (available < threshold)
- Report pipeline health
Debt Sweep Integration
Triggered every N cycles (default: 5) during continuous execution:
- Check cycle counter - Track cycles since last debt sweep
- Pause execution when counter hits debt-interval threshold
- Run debt sweep - Scan codebase for new technical debt
- Fix eligible items if
--debt-fixlevel is set:- Only fix items with effort = trivial or low
- Fix in severity order: critical → high → medium → low
- Stop at specified severity level
- Update manifests -
debt-manifest.jsonanddebt-report.md - Report findings - Show new debt, fixed items, remaining items
- Reset counter and resume task execution
Debt Sweep Trigger Logic:
cycleCount = cycleCount + 1
if cycleCount >= debtInterval:
cycleCount = 0
runDebtSweep()
if debtFixLevel:
for item in debtItems.sortedBySeverity():
if item.severity >= debtFixLevel and item.effort in ['trivial', 'low']:
attemptAutoFix(item)
Auto-Fixable Debt Categories:
- Security: Remove debug logging of credentials
- Types: Add explicit return types to small functions
- Complexity: Extract obvious helper functions
- Dependencies: Update patch versions
- TODOs: Complete trivial TODOs with clear solutions
Agent Output Format
All spawned agents MUST output this structured summary:
<!-- AGENT_SUMMARY_START -->
{
"taskId": "<task-id>",
"status": "completed|partial|failed|blocked",
"filesCreated": ["<paths>"],
"filesModified": ["<paths>"],
"buildStatus": "passed|failed",
"acceptanceCriteria": {"total": N, "met": N, "failed": N},
"errors": [],
"notes": "<summary>"
}
<!-- AGENT_SUMMARY_END -->
Supporting Files
- parallel-execution.md - Detailed parallel execution logic
- manifest-schema.md - Task manifest structure
- scripts/agent-status.sh - Check running agent status
Usage Examples
Run single task:
/dev-loop
Run 2 tasks in parallel:
/dev-loop --parallel 2
Continuous with debt sweep every 3 cycles:
/dev-loop --continuous --debt-interval 3
Auto-fix high+ severity debt during continuous run:
/dev-loop --continuous --debt-interval 5 --debt-fix high
Focused feature work (skip debt sweeps):
/dev-loop --continuous --no-debt-sweep
Check status:
/task-status
Natural language (auto-detected):
- "Let's knock out some tasks"
- "Run the dev loop"
- "What tasks are available?"
- "Execute P1 tasks in parallel"
- "Run tasks and clean up debt along the way"
- "Do a debt sweep every 3 tasks"
微信扫一扫