$npx -y skills add pavel-molyanov/molyanov-ai-dev --skill feature-executionOrchestrate feature delivery as team lead: spawn agents by wave, manage review cycles (max 2 rounds), commit per wave. Use when: "выполни фичу", "do feature", "execute feature", "запусти фичу", "выполни все задачи", "execute all tasks
| 1 | <!-- Generated by sync-to-codex v1. Do not edit directly. --> |
| 2 | |
| 3 | # Feature Execution |
| 4 | |
| 5 | ## Role Boundary |
| 6 | |
| 7 | You are a dispatcher, not a doer. Your job: spawn agents, wait for results, update status, commit orchestration changes, communicate with user. |
| 8 | |
| 9 | Allowed actions: |
| 10 | - Read specs and task frontmatter (for planning) |
| 11 | - Spawn teammates and reviewers (Agent tool) |
| 12 | - Send/receive messages (SendMessage) |
| 13 | - Update frontmatter status fields and checkpoint.yml (Edit) |
| 14 | - Write execution-plan.md (Write) |
| 15 | - Git commits for status/orchestration changes (Bash) |
| 16 | |
| 17 | Forbidden actions: |
| 18 | - Writing or editing source code, tests, configs, prompts |
| 19 | - Running tests, builds, linters, deploys |
| 20 | - Calling MCP tools for task work (Telegram, browsers, APIs) |
| 21 | - Debugging errors or "quickly fixing" anything |
| 22 | - Reading full task content during execution (frontmatter only) |
| 23 | |
| 24 | Reason: when the lead does task work, it pollutes context with implementation details, loses orchestration state, and breaks the parallel execution model. Every task — no matter how trivial — gets a spawned teammate. |
| 25 | |
| 26 | ## Phase 1: Initialization |
| 27 | |
| 28 | 0. Check `work/{feature}/logs/checkpoint.yml`: |
| 29 | - `last_completed_wave > 0` → this is a resume after context compaction. |
| 30 | Read checkpoint, then read `work/{feature}/decisions.md` to confirm what was actually completed. |
| 31 | For tasks in the resumed wave: if a task has a decisions.md entry, it completed — update its |
| 32 | frontmatter to `done` and skip it. Only re-execute tasks without a decisions.md entry. |
| 33 | Check if `~/.claude/teams/{team_name}/config.json` exists: if yes, team is alive; if no, |
| 34 | recreate via spawn_agent worker/explorer orchestration. Skip to Phase 2 starting from `next_wave`. |
| 35 | Report to user: "Resuming from wave {N}. Waves 1-{N-1} completed." |
| 36 | - `last_completed_wave: 0` → fresh start, proceed below. |
| 37 | |
| 38 | 1. Read `work/{feature}/tech-spec.md` and `work/{feature}/user-spec.md` |
| 39 | 2. Read frontmatter of all task files in `work/{feature}/tasks/` — extract fields: |
| 40 | |
| 41 | | Field | Purpose | |
| 42 | |-------|---------| |
| 43 | | `status` | planned → in_progress → done | |
| 44 | | `wave` | Parallel execution group number | |
| 45 | | `depends_on` | Task numbers that must be done first | |
| 46 | | `skills` | Skills the teammate loads | |
| 47 | | `reviewers` | Reviewer agents to spawn (source of truth) | |
| 48 | | `teammate_name` | Agent name for team spawning (optional) | |
| 49 | | `verify` | Verification types: [smoke], [user], [smoke, user], or [] (optional) | |
| 50 | |
| 51 | Build waves: group tasks by `wave` field. Within a wave, all tasks run in parallel. |
| 52 | |
| 53 | 3. Build execution plan following template at `~/.claude/shared/work-templates/execution-plan.md.template` |
| 54 | 4. Save to `work/{feature}/logs/execution-plan.md` |
| 55 | 5. Show plan to user, wait for approval |
| 56 | 6. Create team via spawn_agent worker/explorer orchestration |
| 57 | 7. Update `work/{feature}/logs/checkpoint.yml`: set `total_waves` from the execution plan. |
| 58 | |
| 59 | **Checkpoint:** execution plan approved, team created, checkpoint initialized. |
| 60 | |
| 61 | ## Phase 2: Execute Wave |
| 62 | |
| 63 | 1. Find tasks for current wave: `status: planned`, all `depends_on` tasks are `done` |
| 64 | 2. Update frontmatter: `status: planned` → `status: in_progress`. Read only frontmatter (`limit=15`), then Edit the status field. Do not read full task content. |
| 65 | 3. For each task, spawn a **teammate**. Reviewers are not pre-spawned — the lead spawns a |
| 66 | fresh reviewer instance each round on the teammate's signal (see reviewers_block below), |
| 67 | so every round gets a critic that re-reads the files from scratch. |
| 68 | |
| 69 | Use `teammate_name` from task frontmatter as the agent name. If not set — pick a descriptive name based on the task. |
| 70 | |
| 71 | **Teammate** — `subagent_type: "general-purpose"`, `model: "opus"`, `team_name: "{team}"` |
| 72 | |
| 73 | Prompt template: |
| 74 | |
| 75 | ``` |
| 76 | You are "{name}" executing task {N}. |
| 77 | |
| 78 | Read task: {feature_dir}/tasks/{N}.md |
| 79 | Load skills listed in task frontmatter. If skills listed — follow the loaded skill workflow. |
| 80 | If no skills listed — follow the task instructions directly (the task file contains detailed steps). |
| 81 | |
| 82 | If the task requires user actions — send the instruction to team lead via SendMessage. |
| 83 | Team lead will forward to user and return confirmation. |
| 84 | |
| 85 | {reviewers_block} |
| 86 | |
| 87 | After task complete: |
| 88 | - Write entry to {feature_dir}/decisions.md (follow template at ~/.claude/shared/work-templates/decisions.md.template). |
| 89 | Summary: 1-3 sentences describing what was done and key decisions. Link JSON reports for review details. |
| 90 | - Message team lead: "Task {N} complete. decisions.md updated." |
| 91 | |
| 92 | Feature dir: {feature_dir} |
| 93 | ``` |
| 94 | |
| 95 | **{reviewers_block}** — include only when task has reviewers (not `reviewers: none`): |
| 96 | |
| 97 | ``` |
| 98 | Your reviewers: {reviewer_names}. You do not spawn them |