AGENT SKILL

feature-build

Builds a feature's PLAN.md task by task: a builder subagent implements, a reviewer subagent gates, and each task commits only on pass. Use once feature-plan has an ordered task list and it's time to write code.

License 许可
MIT
最近更新
2026-11-12
Stars
★ 3
Forks
1

01 前言 Front Matter

name
feature-build
description
Builds a feature's PLAN.md task by task: a builder subagent implements, a reviewer subagent gates, and each task commits only on pass. Use once feature-plan has an ordered task list and it's time to write code.
argument-hint
[feature slug or plan folder path, optional]
user-invocable
true

02 资源文件 1

03 SKILL.md 正文

feature-build

🎯 Design for change. Each task's diff should be small, local, and behind a stable seam. The reviewer fails work that couples modules or bloats blast radius; the builder should pre-empt that.

Execute the task checklist in a feature's plan folder, one task at a time. You are the orchestrator. You do not write or review feature code yourself. You dispatch to the builder and reviewer subagents and gate on their verdicts.

On the gate granularity: review runs before every commit, not once at the end, so a bad task is caught before it compounds into the next. This is the default, not optional. It doesn't replace the whole-feature review (see "Finish"); the two catch different things.

Scope

  • IN: build each unchecked task, get it through review, commit it.
  • OUT: planning, writing the task list, authoring specs — this consumes a plan, it doesn't author one.

Preflight

  1. Resolve the plan folder: the path or feature slug given in the argument; else, if the current branch/worktree name matches a plan folder under the project's convention (see CLAUDE.md's "Finding the current feature's plan folder" rule; the normal case when resuming), use that match; else stop and ask. Don't guess. Its name is the feature slug used below for the branch/worktree.
  2. Read PLAN.md. It must be a checklist (- [ ] / - [x]). If it has no checkboxes, stop and send the user to feature-plan.
  3. Resuming or first run? If any task in PLAN.md is already - [x], or BUILD-LOG.md has entries, an earlier run already cut the branch/worktree: skip to step 5. Otherwise continue to step 4.
  4. Cut the feature's branch/worktree. The one point in the pipeline that touches git before feature code exists (see git-workflow's "Branch/worktree per feature" section). In order:
    1. Confirm the working tree is clean except for the plan folder and any new or refreshed mockup starters in docs/mockups/starters/ (feature-explore/feature-design/feature-plan never commit them). Any other uncommitted change is unrelated work; stop and report.
    2. Confirm you're on the project's trunk branch (see CLAUDE.md's Feature workflow section). If not, stop and ask. Don't guess which branch to fork from.
    3. Ask the user to confirm before running any of this. It commits to trunk, which the "always ask before touching main" rule covers however small the change. First check the plan folder for unresolved review comments (markdown-preview's "Comments before moving on"), and put any that are waiting on the user into this same question, so a plan with an open question isn't committed and built without them knowing.
    4. Commit the plan folder as-is, on trunk, with any changed project starters: git add <plan-folder> docs/mockups/starters && git commit -m "docs: add plan folder for <feature-slug>".
    5. Create the branch/worktree named after <feature-slug>, off that commit. Prefer Claude Code's native worktree mechanism (isolation: "worktree" on the Agent tool, or the project's WorktreeCreate hook) so the project decides the real branch name and location; else fall back to git checkout -b <feature-slug> off trunk. Never invent a separate worktree/branch mechanism.
  5. Before touching code, confirm pwd and the current branch match <feature-slug> (or whatever the project's hook named it), and that the plan-folder commit is in the new branch's history (git log --oneline -5). A WorktreeCreate hook that branches from origin/<trunk> instead of local trunk silently leaves out a commit that was never pushed. If it's missing, remove the worktree, ask the user before pushing trunk, then create it again.
  6. Check the demo/test site is worktree-safe, if one exists. Check its .csproj references Umbraco.Community.WorktreeDevPort. Without it, the site runs on a fixed port (two worktrees smoke-testing at once collide, and it looks like a broken build) or on a random :0 port nothing can find. If missing, stop and flag it and suggest re-running project-init; its "Demo site ports" step adds the package and fixes anything that finds the site by a hardcoded port. No demo/test site: this step is a no-op.

The loop

For each task still unchecked (- [ ]) in PLAN.md, in order, top to bottom:

  1. Build. If the task changes an existing screen, first dispatch a smoke-tester to capture it as screenshots/<screen>-before.png, with the screen's click path. Once the builder starts, the old screen is gone, and the PR needs before and after.

    Then dispatch a builder subagent (Agent tool, subagent_type: builder, model sonnet). Give it: the exact task text, the relevant sections of ARCHITECTURE.md and SPEC.md, the path to any mockup for a screen the task touches, the files/extension points it owns, and an instruction to invoke the project's stack skills (umbraco-extensibility, umbraco-package-conventions, ef-core-data, umbraco-backoffice-conventions, etc. as relevant) and run the existing specs before reporting back. Ask it to start its report with the skills it loaded, so a skipped one shows. If the project has e2e tests and none covers the task's path, tell the builder to add one (the smoke step runs it). Give it the pre-review check command below, to run and fix before it reports. The builder does not commit.

  2. Pre-review checks. Run node "${CLAUDE_PLUGIN_ROOT}/checks/run.mjs" in the task's worktree. It checks the uncommitted changes for slips a script can catch: a file that isn't UTF-8, a link into a plan folder, unsafeHTML with no sanitizeHTML, a new file git doesn't track. Exit 1 prints one finding per line: send them to a fresh builder as the round's findings and run the checks again, before any review. Exit 2 means the checks couldn't run: note it in BUILD-LOG.md and go on to review. A project adds its own checks as .mjs files in .claude/checks/, and turns one off by name in .claude/checks/config.json ({ "disabled": ["untracked"] }); see the header of run.mjs for the shape.

  3. Review. Dispatch a reviewer subagent (Agent tool, subagent_type: reviewer, model opus, must be ≥ builder). It invokes umbraco-security (when the diff touches security) and the relevant stack skills, reads the builder's diff, and returns PASS or FAIL with specific findings. Ask it, too, to start its report with the skills it loaded.

  4. Recurse. If FAIL: send the findings to a fresh builder for the same task, then run the pre-review checks (step 2) and review again. Nothing reaches git history before PASS. If a finding is a repeatable mistake a future builder would likely make on another task, write it to .claude/memory/ (type: gotcha) once fixed.

    • Re-review the round, not the task. Before each fix round, snapshot the tree (git add -A && git write-tree, which stages but doesn't commit). After it, give the reviewer the previous round's findings and the round's diff (git add -A && git diff --cached <tree>), so it runs its "Re-review rounds" mode. Reviewing the whole task again each round mostly finds older code, not the fix, and the loop stops converging.
    • Three rounds, then rethink. After the third FAIL on one task, don't send a fourth patch. Dispatch one fresh builder with every round's findings, told to reconsider the approach rather than patch the last finding, and review its result in full. If that fails too, stop and report the task and its findings. If the findings show the design is wrong, not the code, hand off to feature-design.
  5. Smoke the real entry point. Before commit, exercise the deployed artifact. Use the first of these the project has:

    • An end-to-end (e2e) test suite. Run the e2e test covering the task's path. If none covers it, the builder adds one as part of the task. A suite passing without touching the new code proves nothing.
    • A demo site. Drive the backoffice UI (Playwright or equivalent) through the change, or send one real request through the Management API controller for a change with no screen.
    • Neither, because you're building the host itself (like Umbraco CMS), not a package installed into one: a thorough integration test that boots the real hosting/DI pipeline (not a unit test through an internal seam) is the equivalent gate.

    Fakes for external services are fine in all three; the request must travel through the real entry point, not an internal function that bypasses it. A green unit test suite is not enough to ship.

    Dispatch a smoke-tester subagent (Agent tool, subagent_type: smoke-tester) to run it. Give it: the task text, which of the three smokes to run, the click path to each screen the task renders, the path to each screen's mockup and -before.png, the departures from the mockup the builder's report flagged as deliberate, whether the task adds or changes a migration, whether the project has a committed seed, and the full paths to this skill's references/recording-gifs.md and to pr-demo's SKILL.md (for realistic demo content). It takes, compares, crops and saves the screenshots and GIFs, so you never open an image. It returns PASS or FAIL, what it ran and on which database providers, the files it saved with their click paths, and any demo setup. Put those in the task's BUILD-LOG.md entry. On FAIL, recurse to step 4 with its findings. If it reports content a committed seed should hold, have the builder add it there as part of this task.

  6. Commit. On PASS + smoke green, have the builder commit only this task's changes with a message naming the task, following the project's commit conventions (see git-workflow). One commit per task. If the task's code makes a pending spec pass for the first time, that spec file goes in the same commit, never in a later cleanup commit.

  7. Check the box. Edit PLAN.md: - [ ] → - [x] for the completed task, and add a one-line entry to BUILD-LOG.md (commit SHA, what was verified). Commit that change, plus any screenshots/ (images and GIFs) this task saved, with the task commit or immediately after. pr-describe links screenshots by commit, so an uncommitted one is a broken image in the PR. If the builder's report named "any decision the plan left implicit that you had to make" (step 6 of its workflow), such as an assumption, spec deviation, or workaround, append a dated one-line entry to DECISION-LOG.md too. Otherwise it is lost when the task ends; decision-review depends on it being on disk. Say who decided: (feature-build, task 3, agent) for a call the builder made, (…, user) for one the user made, such as an answer to a question the task raised. The whole-feature review and decision-review treat the two differently.

  8. Next task.

Finish

When every box is checked: run the full test suite once more. If BRIEF.md has a Repro section, run it through the real entry point, as step 5 does, and see it pass; a failure goes to a fresh builder like a review finding. Then run the whole-feature review below, then report a summary (tasks completed, commits, anything still red, and the review's "Needs sign-off" list).

Whole-feature review. The per-task reviewer sees one task's diff, so it misses what builds up across tasks: duplicated logic, a class that took on a second job, a component that started calling a repository directly, drift from ARCHITECTURE.md. Dispatch one reviewer subagent in whole-feature mode with the full branch diff (git diff <base>...HEAD), ARCHITECTURE.md, SPEC.md and DECISION-LOG.md.

  • On FAIL, send the findings to a fresh builder, then review again. Repeat until PASS, with the same round diffs and three-round limit as the loop's "Recurse" step; here the round diff is the round's own refactor: commit. Commit each round as its own refactor: commit and add a BUILD-LOG.md line for it.
  • If a finding means the design itself is wrong, not just the code, stop and hand off to feature-design.

A human still reviews the PR; this pass means they aren't the first to see cross-task problems. If this feature is (or completes) a standalone package ready to publish, invoke umbraco-marketplace before tagging a release; it's not part of this loop.

Open the PR: invoke pr-describe directly (via the Skill tool). Don't write the body yourself. Claude Code's built-in gh pr create --body "$(cat <<'EOF' ... EOF)" recipe does not apply here. Per git-workflow, the PR body is always pr-describe's job, no exceptions: never --body at all. pr-describe handles branch/push via git-workflow and runs decision-review, so the assumptions, deviations, and workarounds in DECISION-LOG.md reach a human in the PR. (decision-review is also user-invocable on its own, read-only, for an earlier look.)

If this feature built inside a worktree, don't remove it here. That's post-merge cleanup (the project's WorktreeRemove hook, or git worktree remove). Archiving the plan folder is post-merge too: feature-close, once the PR is merged.

To click through the finished feature on the demo site before merging, use pr-demo.

Rules

  • Sequential, dependency-ordered. This is a pipeline, not a parallel team.
  • Builder owns code; reviewer owns the gate; this loop owns sequencing, PLAN.md checkbox state, BUILD-LOG.md, and screenshots/. Never collapse these roles. It never edits README.md: the index links BUILD-LOG.md from its footer, and PLAN.md's checkboxes show progress.
  • Keep this session small. It runs every task, so whatever it reads stays in context for every later turn, and a long build fills it. Read the plan folder's files, the agents' reports and short command output. Never open an image, a diff or a full build or test log here: the agents read those and report back. Ask each agent for a short report that points at files and lines instead of pasting code or output.
  • The orchestrator may investigate directly: read docs, call an endpoint, read a few lines of a log. Anything bigger (many files, a whole log, a browser session) goes to a general-purpose subagent that reports what it found. The moment a fix touches code, dispatch a builder, even for one line you already know. This is easiest to break mid-debugging against a live system, where each small tweak feels too small to hand off.
  • Resuming mid-task. A run can stop between a task's build and its commit. On resume, if the next unchecked task has uncommitted changes on the branch, don't rebuild it: send them to a reviewer as a fresh review of the whole task, then carry on from step 4.
  • If a gate still fails after the rethink round, stop and report the task + findings rather than committing degraded code.

04 同仓库更多 Skills

mattbrailsford
mattbrailsford/umbraco-devkit

user-stories

Writes, splits and refines user stories with Given/When/Then acceptance criteria in STORIES.md, feeding bdd-specs. Use when turning a feature request or a vague ask into a testable backlog entry.

★ 3
mattbrailsford
mattbrailsford/umbraco-devkit

umbraco-security

What Umbraco provides for keeping a package secure, on the server and in the backoffice: Management API authorization and policies, settings that hold secrets, endpoints outside the Management API, sanitizeHTML and escapeHTML, DOMPurify rules for custom elements, and umbHttpClient instead of handling tokens in the browser. Use when writing or reviewing a Management API controller, a secret setting, a custom endpoint, a backoffice template that uses unsafeHTML, or frontend code that calls an API.

★ 3
mattbrailsford
mattbrailsford/umbraco-devkit

umbraco-performance

Keeping a package fast on the sites that install it: the published cache over the services layer, tree traversal, caching lookups and clearing them, data type config and converter cache levels, output cache eviction, light hot paths, and backoffice screens that don't over-fetch. Use when writing, changing or reviewing code that runs per request, per save, per indexed item or at startup (property value converters, notification handlers, indexing), code that loops over every content item (a full rebuild, an import, a sync), or a list or search screen. Not for a site's own templates.

★ 3
mattbrailsford
mattbrailsford/umbraco-devkit

umbraco-package-conventions

Backend conventions for an Umbraco package: async naming, internal by default, Attempt-based results for routine failures, public-API backwards compatibility, and where extension methods live. Use when naming a method, choosing visibility, shaping a service's result, changing a public signature (including adding a dependency to a public class's constructor), or organizing extension methods. For extension mechanisms, see `umbraco-extensibility`.

★ 3
mattbrailsford
mattbrailsford/umbraco-devkit

umbraco-marketplace

Gets a finished package listed on the Umbraco Marketplace: the NuGet tag, the dependency Marketplace reads version support from, the v14+ compatibility gotcha, and umbraco-marketplace.json. Use when a package is ready to publish, or when reviewing its packaging.

★ 3
mattbrailsford
mattbrailsford/umbraco-devkit

umbraco-extensibility

Umbraco's extension mechanisms (Composers, collection builders, notification handlers, attribute discovery) and a catalogue of backend CMS extension points: property value converters, Management API endpoints, content finders, health checks, search indexing, package migrations, background jobs, and more. Use when making a feature extensible or choosing which extension point fits. Not for property editor UI, dashboards, sections or trees, which the official Backoffice Skills plugin covers.

★ 3