From dev-workflow
Autonomous implementation workflow. Discovers the next unblocked Linear task, claims it atomically, works in an isolated git worktree, implements it following CLAUDE.md rules, runs QA, creates a PR, monitors CI, iterates on review feedback, updates Linear state, and hands off for human review. Supports parallel execution — multiple sessions can run simultaneously without collisions, and interrupted sessions are automatically resumed. Triggers on: 'execute task', 'pick up next task', 'work on the next Linear issue', 'run the build agent', 'implement this task'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-workflow:execute-taskThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Implement a Linear task end-to-end: build it, QA it, ship a PR, pass CI, and hand off for review.
Implement a Linear task end-to-end: build it, QA it, ship a PR, pass CI, and hand off for review.
This skill supports parallel execution — multiple Claude sessions can each run /execute-task simultaneously. Each session works in an isolated git worktree and claims tasks atomically in Linear to avoid collisions. If a session is interrupted, a new session will automatically resume the incomplete work.
Throughout execution, you may notice things that need to be done but are out of scope for the current task — missing pages, broken links, inconsistencies, TODO comments, accessibility gaps, etc. Do not fix these inline. Instead, keep a running list of discovered items (a mental note is fine — you'll surface them in Phase 6). Each item needs: a short title, a 1-2 sentence description, and which task it was discovered during.
If a task ID, title, and description were provided in your prompt:
EnterWorktree with name: "task-main-XXX"
echo '{"linear":"<TASK-ID>","linear_url":"https://linear.app/<workspace>/issue/<TASK-ID>"}' > /tmp/claude-session-meta-$PPID
MAIN-123) using /rename.If no task was specified — read references/task-discovery.md and follow it. It handles task discovery, atomic claiming, worktree entry, branch setup, and the status line update. Then return here for Step 1.
Read the task description and acceptance criteria. Classify the scope:
Trivial — Single file, < ~10 lines of changes. Examples: adding a config entry, fixing a typo, updating a meta tag, changing a URL. → Stay on this page. Follow Phase 1 (Gather Context) then Phase 2 (Implement) below, doing the work directly.
Substantial — New page, multi-file changes, new feature with JS/CSS/HTML coordination, or any task with 3+ discrete work items.
→ Read references/parallel-workflow.md for the full parallel orchestration workflow. That file covers research agents, task decomposition, parallel subagent execution, and integration. After completing its phases, return here for Phase 3 (QA) onward.
Follow the task description's requirements and acceptance criteria precisely. Respect every rule in CLAUDE.md. Use any available skills that are appropriate for the work.
Check if testing infrastructure is set up (look for tests/ directory and test deps in package.json):
If no testing infrastructure exists yet, skip this.
Run the project's build and lint commands (see CLAUDE.md for the exact commands). These are blocking requirements. If any fail:
Invoke the /simplify skill to review the implementation for clarity, consistency, and maintainability. Review its changes — accept improvements that preserve behavior, revert anything that changes functionality.
Re-read the task's acceptance criteria section. Go through each criterion explicitly and verify it's met. If any isn't met, fix it before proceeding.
Invoke the /commit-commands:commit skill to stage and commit. The commit body should reference the Linear issue (e.g., "Implements MAIN-XXX: task title").
The draft PR was already created during task discovery (Step 6) with the correct base branch. Do NOT create a new PR — update the existing one.
git push origin <branch-name>
Update the PR title and body with the final implementation details:
gh pr edit <pr-number> \
--title "<MAIN-XXX>: <concise title>" \
--body "$(cat <<'EOF'
## Summary
<2-3 bullet points of what was implemented>
Closes <MAIN-XXX>
## Changes
<list of files added/modified and why>
## Test plan
- [ ] Build and lint checks pass
- [ ] <task-specific acceptance criteria as checklist items>
Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Mark the PR as ready for review:
gh pr ready <pr-number>
Update the status line with the PR URL:
echo '{"linear":"<TASK-ID>","linear_url":"https://linear.app/<workspace>/issue/<TASK-ID>","pr":"<pr-url>"}' > /tmp/claude-session-meta-$PPID
Poll for CI status (timeout after 10 minutes):
gh pr checks <pr-number> --json name,state,bucket
Check every 30 seconds. Wait until all checks have a bucket of pass or fail (not pending). If still pending after 10 minutes, add a PR comment noting the timeout and proceed.
If any check fails, invoke the /pr-fix-ci skill to diagnose and fix the failures.
IMPORTANT: Use ONLY the /playwright-cli skill for all browser QA. Do NOT use mcp__claude-in-chrome__* tools, mcp__claude-in-chrome__navigate, or any other Chrome/browser MCP tools. Playwright CLI runs headless and works reliably in automated workflows. Chrome MCP tools require an active browser session and are not appropriate here.
Once CI passes, check if a deploy preview is available (e.g., Netlify, Vercel):
DEPLOY_URL=$(gh api repos/{owner}/{repo}/statuses/$(gh pr view <pr-number> --json headRefOid --jq '.headRefOid') \
--jq '[.[] | select(.target_url | test("deploy-preview"))] | first | .target_url // empty')
If a deploy preview URL is available, run browser QA using the /playwright-cli skill:
Open the preview and verify it loads:
playwright-cli open "$DEPLOY_URL"
playwright-cli snapshot --filename=deploy-preview-check.yml
Check for console errors:
playwright-cli console error
Take a screenshot for visual reference:
playwright-cli screenshot --filename=deploy-preview-screenshot.png
Clean up:
playwright-cli close
If browser QA finds issues (max 2 fix rounds):
fix: address browser QA issue — <description>After 2 failed fix rounds, add a PR comment describing the issue and proceed.
If no deploy preview is available, skip browser QA.
Request Copilot review:
gh pr edit <pr-number> --add-reviewer @copilot
Poll every 30 seconds (timeout after 10 minutes):
gh api repos/{owner}/{repo}/pulls/<pr-number>/reviews \
--jq '[.[] | select(.user.login == "copilot-pull-request-reviewer[bot]")] | last | .state'
Wait until the review state is COMMENTED, CHANGES_REQUESTED, or APPROVED. If still pending after 10 minutes, proceed to handoff.
If Copilot leaves comments, invoke the /pr-fix-comments skill to triage and address them.
After the last push, re-verify CI passes before proceeding to handoff.
Move the task to In Review and link the PR. Use the Linear agent name from CLAUDE.md:
linear issue update <TASK-ID> --agent <agent-name> --state "In Review"
linear comment add <TASK-ID> --agent <agent-name> --body "Implementation complete. PR: <pr-url>"
Request review from the reviewer specified in CLAUDE.md:
gh pr edit <pr-number> --add-reviewer <reviewer-username>
If gh errors on the username, add a PR comment instead requesting review.
If you noted any out-of-scope items during execution, present them now. For each item, use AskUserQuestion to ask whether to create a Linear issue for it. Batch up to 4 items per question (the tool's limit), using multiSelect so the user can approve several at once.
Example:
AskUserQuestion:
question: "I found these out-of-scope items during MAIN-XXX. Create Linear issues for any of them?"
header: "New tasks"
multiSelect: true
options:
- label: "<short title>"
description: "<1-2 sentence description of what needs doing>"
- label: "<short title>"
description: "<description>"
...
For each approved item, create a Linear issue in the same project (get project name and agent from CLAUDE.md):
linear issue create --agent <agent-name> \
--title "<title>" \
--description "<description>\n\nDiscovered during: MAIN-XXX" \
--project "<project-name>" \
--team "<team-name>" \
--state "Backlog"
If no items were discovered, skip this step.
Do NOT exit the worktree. The session remains in the worktree so follow-up skills (/pr-fix-comments, /pr-fix-ci) can operate on the same branch without re-checking it out or losing worktree isolation. The worktree will be cleaned up by a future /execute-task session once the PR is merged and the Linear issue is Done (see Step 0 in task-discovery.md).
Task: MAIN-XXX — <title>
Branch: <branch-name>
PR: <pr-url>
Worktree: <worktree-path> (kept for follow-up)
Discovered tasks created: <N>
Status: Ready for human review — session is available for /pr-fix-comments or /pr-fix-ci
If an unrecoverable error occurs:
linear comment add <TASK-ID> --agent <agent-name> --body "Agent encountered an error: <brief description>. Task left In Progress for retry."
/execute-task session will detect the In Progress task assigned to build-agent, find the existing worktree, and resume it automatically.git add -A — always stage specific files..env files, no webhook tokens.linear commands./playwright-cli only — never use mcp__claude-in-chrome__* or other Chrome MCP tools for browser testing.Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
npx claudepluginhub magic-co/claude-plugins --plugin dev-workflow