/greenfield:greenfield [optional: project path]from Greenfield
Installs a planning and guardrail harness for agentic coding projects. Guides users through setting up decision-complete tickets, success criteria bound to red oracles, hook-enforced gates, definitions of done/bug, adversarial review, and runtime proof.
Ships in Greenfield. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Install the planning and guardrail harness that keeps an agentic coding project correct and resumable, into a target repo — empty (init) or existing (audit). Lead with the principles; derive the concrete artifacts at runtime to fit the project's stack.
On invocation, go straight to Process step 1: print the fixed summary below verbatim as
plain text, then ask init vs audit and begin the interview. Do not inspect the working
directory to guess the mode — ask the user. Running /greenfield is the instruction — do
not wait for further direction.
Premise under everything: agent-written code is first-class. It meets the same bar as hand-written code, so the project needs guardrails that keep agent work correct, verifiable, resumable, and consistent — not a lighter standard because "an agent wrote it."
Two rules govern this skill:
./supplements/exemplars/ are reference realizations to adapt to the project's stack,
not templates to copy verbatim. This skill carries every format it needs and depends on
no other skill.These hold across stacks — a data pipeline, a mobile app, an editor plugin — and only their
form varies. Each: the principle → the guardrail that secures it → the failure it prevents.
Depth and per-stack variation live in ./supplements/success-factors.md.
file:line; counts come
from tools; each change is proven — matches <file:line>, novel — validated via <url>,
or novel — driven via <probe + output>; recall is not a fourth tag. → research step +
citation field + a fact-checker agent. Prevents hallucinated specifics shipping as fact.
Continuation form: the proof of done is a rerunnable command + its actual output (an
## Evidence block), not a citation alone — a command a human re-runs cannot be fabricated
after the fact.scenario → expected written as test stubs before implementation.
→ a Verification ticket section + a testing rule. Prevents the agent rationalizing
whatever it produced as correct. Continuation form: confirm each oracle fails first
(red) before implementing, and write it from the acceptance criterion, not the produced
code (the oracle-overfitting guard).tickets/ + WORK-ITEMS.md + docs/adr/. Survives
context loss, compaction, and session boundaries.docs/adr/ +
ADR template. Stops future agents relitigating or silently breaking settled
invariants.verify gate + a
commit-time hook. The faster the gate, the more often it runs. The gate is one condition
of done, not the whole definition (see factors 1, 2, 8, 16 and adr-003)./work phases. A differently-prompted second
set of eyes catches what the author's context cannot. Continuation form: one seat tries
to break the ticket before it is built — re-runs its commands, re-opens its citations,
cross-checks Plan against Verification, drives the plan in a scratch worktree — and returns
BREAKS (evidence) | BREAKS (plan) | SURVIVES; at least one post-code reviewer executes —
runs the tests, reproduces the defect, refutes by running — and pastes the output. Consensus
is not verification; execution is. Reviewers are isolated by the tool grant (Read, Grep, Glob + Bash for the one that executes; never Write/Edit), and the diff is frozen (a
commit) before any reviewer spawns./work Phase 0 + merge gate. Keeps main
releasable and changes reversible..claude/rules/*.md; orchestrator-only coordination in the
/work skill (not inherited); task-specific constraints in the subagent that runs the task.
→ layered CLAUDE.md + rules + correct skill/agent placement, audited by the context-scoping
sub-audit. A flat wall inherited by every agent decays and taxes the whole fleet; scoped
instructions stay salient./work Phase 1 approach pass (planned) + Phase 8 stop-and-ask
(surprises). Too many asks waste the human; too few risk unapproved drift. Anti-looping
form: a broken design (BREAKS (plan)) gets a step-back to 2–4 approaches and one
human-authorized retry; a second break parks the ticket with its evidence — two broken
designs mean the problem is not understood, and a third pass will not understand it either.model: frontmatter. Match spend to the judgment
required./work retrospective phase. The harness is a living
system; surfaced friction compounds when fixed. Escaped-defect form: a bug that passed
a green gate is a harness defect — the retrospective lands the fixture, rule, gate, or
harness step that catches the class, or writes the test and deletes the story.Load-bearing once the project accumulates bugs and leans on AI-written tests. Universal in
presence; the form scales from a lightweight convention on a throwaway to full tooling on a
mature repo. Depth in ./supplements/continuation.md.
Bug ticket carrying
three fields before a fix is written: the named consequence, a reproduction, and a red
regression test that fails first. → a Bug ticket type + a defect rule. Prevents ad-hoc
fixes that leave the class undetected and recurring.--negative-control and determinism --twice proofs; built at /work discretion by the
first ticket whose claim needs it, else a recorded deferral in adr-002) + a /work Phase 8
step that runs it before a behavior change lands. Prevents the green-suite escape: fixtures
written from the same model of the system as the code share its blind spot, so a suite stays
green while the real system loses data. → ./supplements/exemplars/rules/evidence.md,
./supplements/exemplars/runtime-harness.md.The artifact is required only where the project has the surface it defends; the principle (name the surface, decide) is universal. Scored present-or-justified-N/A, not forced.
Every factor maps to an artifact; the form varies. The interview fills the right column.
| # | Factor | Securing artifact | Varies by stack as… |
|---|---|---|---|
| 1 | Decision-completeness | tickets/TEMPLATE.md (acceptance criteria + oracles) + ticket-planner agent | ticket sections drop domain-specific rows |
| 2 | Evidence over recall | Research + proven/novel/driven field + ## Evidence block + fact-checker | citation targets (docs/repos) |
| 3 | Specify-first | Verification section (red oracles) + testing rule | test framework + assertion style |
| 4 | Externalized memory | tickets/ + WORK-ITEMS.md + docs/adr/ | none (portable) |
| 5 | Decision provenance | docs/adr/ + ADR template (adr-001 architecture, adr-002 quality gates, adr-003 definition of done) | none (portable) |
| 6 | Fast deterministic gate | a single verify command + commit hook | make verify / npm run check / swift test… |
| 7 | Executable architecture | fitness-function tool or rule+reviewer | import-linter / dependency-cruiser / SPM+lint |
| 8 | Independent review | .claude/agents/* roster incl. ticket-adversary (pre-code) and an executing correctness-reviewer; read-only by tool grant | which lenses; domain reviewers added |
| 9 | Isolated / green main | /work Phase 0 + merge gate | worktree+ff-only (local) / branch+PR (remote) |
| 10 | Progressive disclosure & context scoping | layered CLAUDE.md + .claude/rules/* + skill/agent placement | which path globs; the CLAUDE.md/skill/agent split |
| 11 | Human-in-the-loop | /work Phase 1 approach pass + Phase 8 triggers + the plan-break pivot protocol | merge approval vs auto-merge |
| 12 | Effort tiering | per-agent model: | available model tiers |
| 13 | Self-improving harness | /work retrospective phase + escaped-defect clause | none (portable) |
| 14 | Test-strength | mutation/revert check on changed files (separate gate) | Stryker / mutmut / cargo-mutants / muter / gremlins |
| 15 | Defect intake | Bug ticket type + defect rule (consequence + repro + red test) | none (portable) |
| 16 | Runtime proof | .claude/rules/evidence.md (always-on) + a runtime harness (qa//e2e/) or a recorded deferral in adr-002 + the /work Phase 8 runtime step | which real system is driven and how (./supplements/ecosystem-profiles.md § runtime drivers) |
| 17 | Performance measure (present-when-applicable) | benchmark + threshold (separate step) + profiler on escalation | Lighthouse/k6 · pgbench · pytest-benchmark · Vitest bench · XCTest measure · Criterion · testing.B+benchstat; N/A if no perf surface |
Install the refined realizations as the default: parallel review, hook-enforced gate, auto-merge on green, retrospective + next-ticket phases, path-scoped rules, per-module CLAUDE.md. These are the strongest forms of each factor; scale them down for a small project by reducing sizing (fewer ADRs, a trimmed roster), never by dropping a factor — except factor 17, which is present only where the project has a perf-sensitive surface (else a justified N/A).
On a project with a phased roadmap, add one cadence the per-ticket loop does not cover: a
phase-gate audit. At the end of each roadmap phase — not each ticket — seed a ticket that runs a deep, multi-agent audit (an
"ultracode" pass: many reviewer subagents fanned out in parallel) across architecture, code
correctness, security, and performance, with every finding adversarially verified. The per-ticket
gate and reviewers each see one diff at a time, so cross-cutting drift slips through; the phase
boundary is the cheapest place to catch it before it compounds. Fold the audit's findings back in
as the next phase's tickets. Template: ./supplements/exemplars/TEMPLATE-phase-audit.md.
Run these steps. Load supplements as each step needs them.
Your first output on invocation — before the mode question and before anything else — is this summary, so the user knows what they are getting. Emit it verbatim and identical every time, as plain text (not a quote, blockquote, or code block), with the bullet list intact:
greenfield installs a planning-and-guardrail harness so agent-written code stays correct and resumable. It secures all 17 success factors with concrete artifacts:
verify command (lint + types + tests +
architecture) runs at commit time.Bug ticket carries its consequence, a reproduction, and a red
regression test before any fix is written./work step that runs it before a behavior change lands..claude/rules/* deliver
each constraint only to the agents that need it./work command — ties tickets, the gate, reviewers, and a retrospective together.I'll ask a few questions, then either scaffold a new project (init) or audit this repo and install what's missing (audit).
Then ask the mode outright with one AskUserQuestion — init (scaffold a new project) vs
audit (review this repo and install what's missing). Do not inspect the working
directory or guess the mode from a path argument; ask the user. The target path is not
resolved here — it is the interview's first question (Batch A), so a path passed as
/greenfield <path> only seeds that question's default, it never preselects the mode.
Audit needs the path before profiling. When the user picks audit, take the target path as the interview's first question, then profile the stack there (manifests, build/test/lint config, git remote, source layout) so the remaining questions confirm inferences instead of asking them.
Ask the interview's Batch A first (target path and stack via AskUserQuestion, purpose as a free-text prompt) so you know the project shape to research. That shape — "a Rust CLI", "a SwiftUI to-do app", "a FastAPI service" — is usually one you have not set up before, and recall is not enough to constrain it well. Then, before the architecture questions, fan out a round of research and let primary sources drive the recommendations. Run several searches in parallel (and fetch the sources behind the hits):
./supplements/ecosystem-profiles.md and extend or correct it from what you find.Prefer primary sources; corroborate a secondary claim with a second source. Synthesize into
2-4 candidate architectures, each a named style with its tradeoff and its source — this is the
input the interview's architecture question presents. Shorten this only when you can already
constrain the stack from primary knowledge and the user confirms. If research is unavailable
(offline, no web tools), take the tooling from ./supplements/ecosystem-profiles.md, cite the
profile as the source, and mark adr-001's sources for re-verification on the first Component
ticket — never present recall as a researched recommendation.
Resolve the runtime details with ./supplements/interview.md. Infer what you can (in audit,
from the profile); ask only the rest, and ask every question through AskUserQuestion — never a
free-form prose prompt — except purpose, which is a single free-text question. Open-ended
answers like path and stack still go through AskUserQuestion: offer inferred candidate options
and let the user type a custom value in the "Other" field. It resolves: identity, stack,
architecture + the boundary to enforce, gate command, git posture, reviewer roster + model tiers,
rules, the continuation discipline (defect intake, test-strength, the real system and its driver),
the performance surface or its N/A, and scale knobs. Present each technical choice as researched
options: mark the staff-engineer pick (recommended) with a one-line why and its source, and
name the architecture style and cite the sources that will constrain the project so the user
can accept it or offer their own. Reach decision-completeness before generating — no "TBD".
Author each artifact at runtime, adapted to the project. Use ./supplements/exemplars/* as
references to adapt, not stamp — each carries the format it needs, so no other skill is required.
First emit the would-generate manifest (the files and their one-line purpose) and get the
user's go-ahead; write only what is approved. Declining the manifest writes nothing — that is
the no-write preview, in either mode.
./supplements/checklist.md top to bottom; for each factor, create its
securing artifact. Seed adr-001 with the architecture decision — its named style, the
sources behind it, and the boundary the arch-enforcement guards; adr-002 with the gates
(the fast gate, the separate test-strength and performance steps, and the runtime harness or
its recorded deferral with the runbook fallback); adr-003 with the definition of done — the
definition of a bug and a per-dimension "done means" table.check/test script becomes the gate). Migrate inline decisions into
ADRs and backlog/scratch notes into tickets. Run the context-scoping sub-audit (checklist
10a–10c): where CLAUDE.md carries orchestrator-only or task-specific content, or the workflow
leans on a global skill/agent, move it to the correct layer
(./supplements/exemplars/instruction-placement.md) rather than clobbering — a relocation, not a
rewrite.For factors 2/3/8/14/15/16, install the continuation-grade forms (rerunnable proof, red oracles
per criterion, an executing reviewer and a pre-code ticket-adversary, a mutation/revert gate kept
separate from the fast gate, a Bug ticket type, the always-on evidence rule, and the runtime
harness or its recorded deferral) per ./supplements/continuation.md.
For factors 6, 7, 16, and 17, map the gate, the boundary check, the runtime driver, and the
performance benchmark to the stack with ./supplements/ecosystem-profiles.md (Python, Node/TS,
Swift, Rust, Go, and a generic fallback). Factor 17 installs only where the project has a
perf-sensitive surface — else record a justified N/A in adr-001; wire the benchmark+threshold as
a separate pre-merge/scheduled step (never the fast gate) and document the profiler for triage.
verify gate once — it must pass green on the seeded project./work skill's agent references all resolve — and that
each resolves to a repo-scoped agent/skill (or a declared dependency), not a silent global../supplements/checklist.md — every factor present (17 present-or-justified-N/A), and the
context-scoping sub-audit (10a–10c) passes: CLAUDE.md carries only durable cross-agent standards./work it).WORK-ITEMS.md empty and write
tickets/TEMPLATE.md, but do not author a first ticket — recommend it as the next action
(step 5) for the user to /work; write adr-001 (architecture), adr-002 (quality gates), and
adr-003 (definition of done); then, in this order: initialize git, install hooks
(install-hooks.sh, wired to the install step), then prove the gate green on the empty scaffold. Do not build the runtime harness at init — record the deferral in adr-002; the
first ticket whose claim is about the running system builds it as part of its scope.| If the step is… | Read |
|---|---|
| Understanding/teaching the factors | ./supplements/success-factors.md |
| Applying the continuation / debugging-cycle discipline (factors 2/3/8/14/15/16) | ./supplements/continuation.md |
| Auditing a repo or building the to-do | ./supplements/checklist.md |
| Running the interview | ./supplements/interview.md |
| Choosing gate / arch-enforcement / test / runtime-driver / benchmark tooling | ./supplements/ecosystem-profiles.md |
| Deciding where an instruction lives (CLAUDE.md / skill / agent / rule) | ./supplements/exemplars/instruction-placement.md |
| Building or auditing the runtime harness (factor 16) | ./supplements/exemplars/runtime-harness.md |
| Authoring a specific artifact | ./supplements/exemplars/<artifact>.md |
./supplements/success-factors.mdWhat: the 17 factors elaborated — mechanism, failure mode, per-stack form. When to read: explaining a factor, or deciding how to realize one for an unusual stack.
./supplements/continuation.mdWhat: the debugging-cycle depth — provable outcome, red-before-green, review that executes, the pre-code adversary, mutation test-strength, the definition of a bug, runtime proof — each with its source and its exemplar. When to read: installing or auditing factors 2/3/8/14/15/16; any project past initial scaffold.
./supplements/checklist.mdWhat: factor × securing artifact × present/partial/absent, plus the context-scoping sub-audit (10a–10c). The single spine for both modes. When to read: every run — it is the build to-do (init) and the gap audit (audit).
./supplements/interview.mdWhat: the question script; infer-vs-ask guidance; AskUserQuestion groupings; how to present
researched options with a (recommended) pick and cited architecture.
When to read: step 3, every run.
./supplements/ecosystem-profiles.mdWhat: concrete gate / arch-enforcement / test / mutation / runtime-driver / performance-benchmark mappings for Python, Node/TS, Swift/iOS, Rust, Go, and a generic fallback. When to read: resolving factors 6, 7, 14, 16, and 17 for the project's stack.
./supplements/exemplars/What: "adapt, do not copy" reference realizations — ticket-template.md (acceptance criteria,
the Bug variant, the Irreversible sink row), work-items.md, work-skill.md (the /work
pipeline incl. the plan-break pivot protocol), adr-template.md (incl. the adr-003 seed),
agent-roster.md (incl. § reviewer isolation, § the adversary seat, § domain-knowledge preload),
rules.md (+ rules/evidence.md, rules/coverage-derives-its-domain.md, rules/symbol-deletion.md),
hooks.md (incl. verify-hooks-live.sh; test-strength is not a hook), runtime-harness.md (the
factor-16 harness — layout, the two proofs, anti-vacuity assertions, destructive interlocks),
findings-bar.md (the review-finding bar — TAG/LENS/CONSEQUENCE), TEMPLATE-phase-audit.md (the
phase-exit audit ticket), instruction-placement.md (CLAUDE.md / skill / agent / rule placement).
When to read: authoring that artifact in step 4.
A run is correct when: the target's verify gate passes green; the commit hook is
installed and fires; every .claude/agents/* referenced by the generated /work resolves
repo-locally (not from a silent global); tickets/TEMPLATE.md carries ## Acceptance criteria
and .claude/rules/evidence.md exists; docs/adr/ holds adr-001–adr-003;
./supplements/checklist.md shows factors 1–16 present, factor 17 present-or-justified-N/A, and
the context-scoping sub-audit (10a–10c) passing — CLAUDE.md holding only durable cross-agent
standards; and (audit) git status shows only intended additions.
supplements/checklist.md (opens in a new tab)supplements/continuation.md (opens in a new tab)supplements/ecosystem-profiles.md (opens in a new tab)supplements/exemplars/TEMPLATE-phase-audit.md (opens in a new tab)supplements/exemplars/adr-template.md (opens in a new tab)supplements/exemplars/agent-roster.md (opens in a new tab)supplements/exemplars/findings-bar.md (opens in a new tab)supplements/exemplars/hooks.md (opens in a new tab)supplements/exemplars/instruction-placement.md (opens in a new tab)supplements/exemplars/rules.md (opens in a new tab)supplements/exemplars/rules/coverage-derives-its-domain.md (opens in a new tab)supplements/exemplars/rules/evidence.md (opens in a new tab)supplements/exemplars/rules/symbol-deletion.md (opens in a new tab)supplements/exemplars/runtime-harness.md (opens in a new tab)supplements/exemplars/ticket-template.md (opens in a new tab)supplements/exemplars/work-items.md (opens in a new tab)supplements/exemplars/work-skill.md (opens in a new tab)supplements/interview.md (opens in a new tab)supplements/success-factors.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
agent-workflow, project-harness, guardrails, planning, code-review
Generated from the plugin's indexed repository (davidegreenwald/claude-greenfield) — no native marketplace selected
npx claudepluginhub p/davidegreenwald-greenfieldOther plugins' skills for the same job