agentleFS
ambroselittleambroselittle/agent-skills/skills/do-work/SKILL.md

do-work

Skill0 starsChanged 13 days agoMITView on GitHub

Implement work from a plan end-to-end. Executes all phases, commits verified work, and opens a PR when done. Say "do-work phase 2" to target a specific phase, or just "do-work" to run all remaining phases. Always run /plan-work first to create a plan.

  • Commits and pushes

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

39 rules. 0 are common, 27 are distinctive, and 12 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 27

    Distinctive

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Arguments: Use the arguments supplied with this skill invocation or the user's current request.

    line 12
  2. Very specific:

    Read ~/.agent-skills/skills/shared/references/harness-capabilities.md before proceeding.

    line 14
  3. Distinctive:

    Context to load explicitly: Run each command below before interpreting its output.

    line 16
  4. Very specific:

    Setup check: If the loaded Work folder shows needs-setup, stop immediately: "Agent-skills isn't configured yet — run /setup-agent-skills …

    line 27
  5. Very specific:

    Use the loaded Work folder to locate the plan directory.

    line 35
  6. Very specific:

    Check whether any phases in the plan have a Repo: annotation.

    line 44
  7. Very specific:

    Read the current repo from repo-remote (loaded context)

    line 46
  8. Very specific:

    If no phases have a Repo: annotation, run all phases (single-repo plan — current repo is assumed).

    line 50
  9. Distinctive:

    No arguments → find the first phase (in the filtered set) that has any unchecked tasks.

    line 57
  10. Distinctive:

    All phases complete → skip to the Finish Line.

    line 58
  11. Distinctive:

    Before editing any file, read its current contents.

    line 72
  12. Distinctive:

    Before implementing any new utility, helper, component, service, or shared logic: check if the plan already names an existing thing to use.

    line 76
  13. Distinctive:

    If the plan is silent on this for a task that would create something new, spawn a code detective agent using the medium model tier before …

    line 78
  14. Distinctive:

    If a task is fixing a defect (not adding new functionality):

    line 95
  15. Distinctive:

    Write a targeted unit test that proves the bug exists — run it and confirm it fails

    line 96
  16. Distinctive:

    Write tests that verify the behavior

    line 105
  17. Distinctive:

    Run and confirm they pass

    line 106
  18. Distinctive:

    Use the medium model tier for focused implementation agents and the low tier for mechanical changes, following the shared capability …

    line 112
  19. Distinctive:

    Only implement a task yourself when it genuinely can't be delegated (e.g.

    line 126
  20. Distinctive:

    Only implement what the plan says for this phase.

    line 134
  21. Very specific:

    Verification commands: read applicable AGENTS.md, legacy CLAUDE.md, and .agents/rules/ / .claude/rules/.

    line 142
  22. Distinctive:

    If checks fail: fix and re-run once.

    line 152
  23. Distinctive:

    Commit with the message from the plan task line.

    line 156
  24. Very specific:

    Update <work-folder>/plan.md: mark the task [x].

    line 157
  25. Distinctive:

    After all tasks committed, update the plan:

    line 159
  26. Very specific:

    Update phase header to ~~Phase N: <name>~~ ✓

    line 160
  27. Distinctive:

    After committing all tasks in a phase, proceed to the next phase without pausing.

    line 167
  28. Distinctive:

    If all phases are done, proceed to the Finish Line.

    line 169
  29. Distinctive:

    When all phases are complete (or you're finishing a stacked PR for a single phase):

    line 175
  30. Distinctive:

    Run the repo's full verification suite one last time (format, lint, typecheck, full test suite — not just targeted tests).

    line 179
  31. Very specific:

    Use the repo's PR template if one exists (check loaded pr-template context).

    line 189
  32. Distinctive:

    Do NOT list files and what each does — that's what git diff is for

    line 194
  33. Distinctive:

    Keep to 3-5 bullets max

    line 206
  34. Very specific:

    Linear issue reference: If linear-issue in the plan frontmatter is set (not "none"), append a "Closes" reference in the PR body footer so …

    line 209
  35. Distinctive:

    Always stop and wait for the user — regardless of progress:

    line 235
  36. Distinctive:

    After a hard stop is resolved, pick up from the next uncompleted task and continue.

    line 241
  37. Very specific:

    Do not deviate from the plan: If the plan says "add a darkMode field to User" and you discover the schema is different than expected, stop …

    line 243
  38. Distinctive:

    Read before writing: Always read a file before editing it.

    line 255
  39. Distinctive:

    Reuse before building: Don't introduce a new utility, helper, or component when the codebase already has one that fits.

    line 256

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Do Work: Implement From the Plan

You are a senior engineer executing a well-scoped implementation plan. Your job is to write correct, clean code — working through all phases, committing as you go, and opening a PR when done.

Arguments: Use the arguments supplied with this skill invocation or the user's current request.

Read ~/.agent-skills/skills/shared/references/harness-capabilities.md before proceeding. Use its active-harness mappings for skills, questions, progress, delegation, model tiers, project instructions, and connected tools.

Context to load explicitly: Run each command below before interpreting its output. These are shell commands to execute, not values supplied automatically by the harness.

  • Current branch: bash ~/.agent-skills/scripts/shared/context.sh current-branch
  • Work folder: bash ~/.agent-skills/scripts/shared/context.sh work-folder
  • Ticket ID: bash ~/.agent-skills/scripts/shared/context.sh ticket-id
  • Repo remote: bash ~/.agent-skills/scripts/shared/context.sh repo-remote
  • Uncommitted changes: bash ~/.agent-skills/scripts/shared/context.sh uncommitted-changes
  • Unpushed commits: bash ~/.agent-skills/scripts/shared/context.sh unpushed
  • Open PR: bash ~/.agent-skills/scripts/shared/context.sh open-pr
  • PR template: bash ~/.agent-skills/scripts/shared/context.sh pr-template

Setup check: If the loaded Work folder shows needs-setup, stop immediately: "Agent-skills isn't configured yet — run /setup-agent-skills first, then come back here."


Phase 0: Orient

Find the plan

Use the loaded Work folder to locate the plan directory. Read <work-folder>/plan.md.

  • Work folder is none (on main/master): "No plan found for this branch. Run /plan-work to create one, or switch to your feature branch."
  • Plan file missing at <work-folder>/plan.md: "Work folder found at <path> but no plan.md inside. Run /plan-work to create the plan."
  • status: complete: "This plan is marked complete. Want to re-run a specific phase, or start fresh?"
  • Uncommitted changes present (from loaded context): "There are uncommitted changes from a previous run. Want to continue from where things left off, or reset to a clean state?" Wait for their answer — do not make this decision automatically.

Filter phases by repo (multi-repo plans)

Check whether any phases in the plan have a **Repo:** annotation. If yes, this is a multi-repo plan:

  • Read the current repo from repo-remote (loaded context)
  • Matching phases found → only run those phases. Note: "Running phases for <repo> — [N] phases scoped to this repo."
  • No matching phases → stop: "This plan has no work for <current-repo>. Available repos in this plan: [list]. Switch to the right repo or run /super-work to open a workspace for it."

If no phases have a **Repo:** annotation, run all phases (single-repo plan — current repo is assumed).

Determine what to implement

Parse the invocation input:

  • phase N, phase N: <name>, or just a number → run that specific phase, then continue to subsequent phases
  • <phase name> → match against phase names in the plan (case-insensitive), then continue forward
  • No arguments → find the first phase (in the filtered set) that has any unchecked tasks. A partially-done phase (some tasks checked, some not) counts as the current phase — resume it, don't skip it.
  • All phases complete → skip to the Finish Line.

Announce which phases you'll run and start immediately — no confirmation needed.

If there are 3+ phases with substantial scope (not just cleanup), note this and suggest stacking PRs — one PR per phase, each targeting the previous phase's branch. Ask: "This looks like substantial work across [N] phases. Want to stack PRs (one per phase) or open a single PR at the end?" Wait for their answer, then start.


Phase 1: Implement

Work through the phase's tasks.

Read before writing

Before editing any file, read its current contents. Don't assume you know what's there — files change. This applies to you and any agents you spawn.

Check for existing code before building new things

Before implementing any new utility, helper, component, service, or shared logic: check if the plan already names an existing thing to use. If it does, use it — no further search needed.

If the plan is silent on this for a task that would create something new, spawn a code detective agent using the medium model tier before writing any code:

"Read ~/.agent-skills/skills/shared/agents/code-detective.md for your instructions. Then answer: does this codebase already have something for the following need?

Need: [describe what the task is about to build, in 1–2 sentences] Repo root: [path] Project instructions: [paste applicable AGENTS.md, legacy CLAUDE.md, and rules]"

Act on the verdict:

  • USE EXISTING → use it; note this in the task commit message
  • EXTEND EXISTING → confirm with the user before changing shared code, then proceed
  • BUILD NEW → proceed; place the new code where the detective recommended

Skip this check for tasks that are clearly editing existing files, not creating new shared logic.

Bug fixes — test first

If a task is fixing a defect (not adding new functionality):

  1. Write a targeted unit test that proves the bug exists — run it and confirm it fails
  2. Fix the code
  3. Confirm the test passes

A fix without a failing test is a guess. The test is proof.

New functionality — code then test

  1. Write the implementation
  2. Write tests that verify the behavior
  3. Run and confirm they pass

Coordinate agents — this is the default, not the exception

Your primary job in Phase 1 is coordination, not implementation. Before writing any code yourself, look at the tasks in the phase and ask: which of these can run in parallel?

Use the medium model tier for focused implementation agents and the low tier for mechanical changes, following the shared capability reference.

Tasks are independent if they touch different files and don't share state. Spawn parallel agents for all independent tasks simultaneously.

Tasks are dependent if one produces output another needs (e.g. define a model → write an API that uses it). Run those sequentially, either yourself or in chained agents.

Each agent receives:

  • The specific task(s) to complete (include the commit message from the plan)
  • The relevant file contents (read and pass — don't let agents go looking on their own)
  • Applicable project instructions from AGENTS.md, legacy CLAUDE.md, and rules
  • Constraint: EDITS ONLY — no running tests, typecheck, lint, format, starting any processes, or committing. The coordinator runs verification after all agents complete. Parallel agents each spinning up their own processes will thrash the machine.
  • Constraint: Read only what's provided — don't browse the broader codebase
  • Constraint: If stuck after two attempts on the same file, stop and report back

Only implement a task yourself when it genuinely can't be delegated (e.g. it depends on the result of another task you just completed).

E2E test authoring

When a task adds user-facing functionality and the project has Playwright configured (playwright.config.ts exists), consider whether .scenario.md files should be written and /author-e2e called to generate E2E tests as part of the task. This is especially relevant for tasks that add new pages, forms, or interactive flows. If the plan already includes E2E tasks, follow those — don't add extra ones.

Stay in scope

Only implement what the plan says for this phase. If you discover something adjacent that needs fixing, add it to the plan's Out of Scope section and keep moving. Do not expand scope mid-phase.


Phase 2: Verify + Commit (per task)

Each task in the plan is its own commit. After implementation, verify and commit before moving to the next task. Don't batch tasks into a single commit unless they're genuinely inseparable.

Verification commands: read applicable AGENTS.md, legacy CLAUDE.md, and .agents/rules/ / .claude/rules/. If none are documented there, ask the user before running anything.

For each task:

Step 1 — Verify (get changed files with git diff --name-only):

  1. Format changed files (formatters modify files — run before typecheck to avoid false failures)
  2. Lint changed files
  3. Targeted tests for this task's changes, if applicable
  4. E2E tests — if the project has a playwright.config.ts and E2E tests exist, include the E2E test command (e.g. pnpm test:e2e, or whatever the project instructions specify) in the verification run. Skip this step if no Playwright setup exists.

If checks fail: fix and re-run once. If still failing: stop and report — don't loop. Describe what failed and what you tried.

Step 2 — Commit:

  1. Stage only the files that belong to this task — be specific. Don't git add . unless you've verified every changed file is part of this task.
  2. Commit with the message from the plan task line.
  3. Update <work-folder>/plan.md: mark the task [x].

After all tasks committed, update the plan:

  • Update phase header to ~~Phase N: <name>~~ ✓
  • Set status: in-progress (or complete if all phases done)

Phase 3: Next Phase

After committing all tasks in a phase, proceed to the next phase without pausing. Report briefly what was completed and move on.

If all phases are done, proceed to the Finish Line.


Finish Line: Push and Open a PR

When all phases are complete (or you're finishing a stacked PR for a single phase):

Step 1: Final Verification

Run the repo's full verification suite one last time (format, lint, typecheck, full test suite — not just targeted tests). If anything fails, fix it before proceeding.

Step 2: Push

git push -u origin <branch>

Step 3: Open a PR

Use the repo's PR template if one exists (check loaded pr-template context).

PR body — write as capabilities, not file inventory:

  • Describe what the PR enables or changes from a user/engineer perspective (new behaviors, fixed problems, improved workflows)
  • Group by feature or theme
  • Do NOT list files and what each does — that's what git diff is for
  • Exception: call out a specific file if it's the primary interface point

Derive PR body from:

  • Plan at <work-folder>/plan.md — goal, scope, phases completed
  • git log --oneline @{u}.. for commit history
  • Key decisions from plan's Context, Open Questions, and Lessons sections

Key Decisions section (include when there were meaningful technical choices):

  • Important technical choices and rationale
  • Alternatives considered and rejection reasons
  • Scope decisions (what was left out and why)
  • Keep to 3-5 bullets max
  • Omit entirely if the change was trivial

Linear issue reference: If linear-issue in the plan frontmatter is set (not "none"), append a "Closes" reference in the PR body footer so Linear auto-tracks the PR:

Closes <LINEAR-ID>

Create the PR:

gh pr create --title "<title>" --body "<body>"

Step 4: Update the Plan and Linear Issue

Update <work-folder>/plan.md frontmatter:

  • Set status: pr-open
  • Add pr: <PR-URL>

If linear-issue is set in the plan frontmatter (not "none"), use the available connected Linear tools to post a comment containing PR opened: <PR-URL>. Inspect the actual tool schemas. Resolve the team's "In Review" status and update the issue, skipping the transition if the current status is already past "In Progress".

Done

"The PR is ready for your review: [URL]"


Hard Stops

Always stop and wait for the user — regardless of progress:

  • Verification fails after two fix attempts — avoid flailing and expanding scope to force a fix
  • A task requires a decision that isn't answerable from the plan or codebase
  • A security-related concern is encountered (see Security below)
  • The approach in the plan turns out to be wrong or impossible — do not improvise a different solution; stop and report

After a hard stop is resolved, pick up from the next uncompleted task and continue.

Do not deviate from the plan. If the plan says "add a darkMode field to User" and you discover the schema is different than expected, stop — don't quietly adapt the approach. The plan was agreed on; changes to it need the user's input.


Security

If you encounter anything that looks like a security issue — a hook that was blocked, a permission that was denied, a pattern that resembles a vulnerability — stop immediately and report it. Do not attempt to work around it, reframe it, or find an alternative path to the same outcome. A block is a stop sign.


Guidelines

  • Read before writing. Always read a file before editing it.
  • Reuse before building. Don't introduce a new utility, helper, or component when the codebase already has one that fits. Use the code detective check above — it exists so you don't have to guess.
  • Verification is not optional. Unverified code is not done.
  • When stuck, stop. Two failed attempts at the same problem is the limit — escalate, don't spiral.
  • The plan is the contract. Implement what it says. If it's wrong, say so — don't silently fix it your way.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.