$npx -y skills add pavel-molyanov/molyanov-ai-dev --skill source-command-do-taskConverted Codex workflow from Claude slash command do-task. Use when the user asks to run the equivalent command or describes this workflow.
| 1 | <!-- Generated by sync-to-codex v1. Do not edit directly. --> |
| 2 | |
| 3 | # Command Workflow: do-task |
| 4 | |
| 5 | Treat Claude-only tool names as conceptual workflow steps and use available Codex tools/policies. |
| 6 | |
| 7 | ## Codex Policy Gates |
| 8 | |
| 9 | - Ask before external actions such as GitHub repository creation, `git push`, deploys, or sending messages unless the user explicitly requested that exact action. |
| 10 | - Deployments must go through GitHub CI/CD; direct server access is only for emergency debugging of broken production. |
| 11 | - Never ask the user to paste secrets in chat. Direct them to `.env` files or GitHub Actions secrets. |
| 12 | |
| 13 | # Do Task |
| 14 | |
| 15 | ## Project Documentation Autosync |
| 16 | |
| 17 | If this command changes any project-local `.claude/**` file, immediately run: |
| 18 | |
| 19 | ```bash |
| 20 | ~/.claude/scripts/sync-to-codex.sh --project "$PWD" --apply |
| 21 | ``` |
| 22 | |
| 23 | If sync reports a conflict, stop and report it. Include generated `.codex/**` changes in the same commit as the `.claude/**` source change. |
| 24 | |
| 25 | Execute a spec-driven task with validation and status tracking. |
| 26 | |
| 27 | ## Step 1: Read Task |
| 28 | |
| 29 | 1. Read task file (user provides path or task number) |
| 30 | - If user didn't specify → ask: "Which task to execute?" |
| 31 | 2. Derive feature directory from task path: `work/{feature}/tasks/N.md` → `work/{feature}/` |
| 32 | All `logs/` paths in the task (Reviewers section, What to do, Acceptance Criteria) are relative to this feature directory. Resolve them as `{feature_dir}/logs/...` when creating files. |
| 33 | 3. Verify task status is `planned` (if not → ask user before proceeding) |
| 34 | 4. Update task frontmatter: `status: planned` → `status: in_progress` |
| 35 | 5. Read every file listed in the task's "Context Files" section |
| 36 | |
| 37 | ## Step 2: Execute |
| 38 | |
| 39 | 1. Load each skill listed in the task (frontmatter `skills: [...]` and "Required Skills" section) |
| 40 | - If a skill is not found → warn user, continue with remaining skills |
| 41 | - If task has no skill (frontmatter `skills: []` or absent) → read the task, execute "What to do" and "Verification Steps" directly. For tasks with user instructions → show the instruction to user, wait for confirmation. |
| 42 | 2. Follow loaded skill workflow. The loaded skill owns the review loop (e.g. code-writing |
| 43 | runs the test critique and code reviews itself) — do not run reviewers again here. |
| 44 | 3. Git commit implementation (code + tests pass): `feat|fix|refactor: task {N} — {brief description}` |
| 45 | 4. **Skill-less tasks only** (frontmatter `skills: []` or absent): no skill owns reviews, |
| 46 | so run the task's "Reviewers" section here, following the policy in |
| 47 | `~/.claude/skills/skill-master/references/agents.md` → The orchestrator's half of the deal: |
| 48 | 1. For each reviewer, spawn a subagent via spawn_agent (subagent_type = reviewer name) |
| 49 | 2. Pass: paths to all files this change touched (reviewer reads them in full, not a diff), |
| 50 | path to task file, tech-spec, user-spec |
| 51 | 3. Report → the path in the task's "Reviewers" section, resolved under `{feature_dir}` |
| 52 | (e.g. `logs/working/task-1/...` → `{feature_dir}/logs/working/task-1/...`) |
| 53 | 4. Process findings: in-scope fix / disagree → discuss / out-of-scope → surface to user. |
| 54 | Fix, re-run tests, git commit `fix: address review round {R} for task {N}`, then spawn a |
| 55 | **fresh** reviewer for the next round. Max 2 rounds; in-scope findings remaining after |
| 56 | round 2 → ask user. |
| 57 | |
| 58 | ## Step 3: Verify |
| 59 | |
| 60 | 1. Check each acceptance criterion from task file |
| 61 | 2. If task has "Verification Steps → Smoke" → execute each smoke command, record results in decisions.md Verification section |
| 62 | 3. If task has "Verification Steps → User" → ask user to verify, wait for confirmation |
| 63 | 4. If any verification fails → fix → re-run tests → spawn fresh reviewers (new round) → re-verify |
| 64 | - After 2 failed rounds → stop, report failures to user, keep status `in_progress` |
| 65 | - Tool unavailable → document, suggest manual check |
| 66 | |
| 67 | ## Step 4: Complete |
| 68 | |
| 69 | 1. Read template `~/.claude/shared/work-templates/decisions.md.template` and write a concise execution report to `work/{feature}/decisions.md`. Follow template format strictly — no extra sections. |
| 70 | 2. Update task frontmatter: `status: in_progress` → `status: done` |
| 71 | 3. Update tech-spec: `- [ ] Task N` → `- [x] Task N` |
| 72 | 4. Git commit: `chore: complete task {N} — update status and decisions` |
| 73 | |
| 74 | ## Self-Verification |
| 75 | |
| 76 | - [ ] Task status is `done` |
| 77 | - [ ] Tech-spec checkbox updated |
| 78 | - [ ] decisions.md entry written with reviews and verification results |
| 79 | - [ ] Git commit created with task reference |
| 80 | - [ ] Every acceptance criterion from task file is met |