Skill: Build
Quick Start
- Sync the worktree to
origin/mainbefore loading any context. - Invoke
orient-agentto load baseline context. - Select the target issue or bundle (auto or explicit) and fail fast on blockers.
- Claim every member.
- Invoke
deepen-contextwith hints and theGoverning specs:floor from the issue(s). - Implement and self-check, validate, have a fresh subagent review the branch,
open one PR closing every member, archive.
Workflow
Phase 0 — Sync
Move the worktree HEAD to origin/main before loading any context. Do not
use git checkout main — that branch may be checked out in another worktree.
git fetch origin main && git checkout --detach origin/main
Detach rather than git reset --hard: a reset moves whatever branch is
checked out, which may be another session's, and discards uncommitted work.
A detached checkout moves no branch and refuses to overwrite local changes.
If this fails, stop and investigate before proceeding. On success, orient-agent
reads fresh specs and notes, and the task branch created by claim-issue.sh in
Phase 2 will be rooted at the latest origin/main commit.
Phase 1 — Orient
Invoke the orient-agent skill.
Phase 2 — Select, Gate, and Claim
- Determine the target issue mode:
- If the user passed multiple issue numbers (for example
build 123 456),
that is a bundle: implement all of them in one PR that closes every
member. Follow .agents/skills/shared/bundling.md § "Executing a bundle".
Do not ask whether to take only the first, and do not drop members —
bundling exists to get more than one issue done in a PR.
- If the user passed one explicit issue number, use that issue.
--epic-run <Epic>means this build is part of that Epic's epic run
(work-epic-tasks always passes it). Keep it for the hold gate in step 5
and the claim in step 7.
- If no explicit issue was passed, auto-select from the top-priority
unblocked Now-Epic flow below.
- List open Now-Epics:
```bash
bash .agents/skills/shared/query-now-epics.sh
```
The top-priority group is the first Epic with at least one unblocked
open leaf sub-issue.
- Query leaf Issues of that Epic and apply eligibility and fit:
```bash
bash .agents/skills/shared/query-epic-subissues.sh <EPIC_NUMBER> \
| PYTHONPATH= uv run bundle-fit --workflow build
```
Eligibility alone (state=OPEN, no assignees, no stale-claim, all
blockedBy CLOSED, subIssues.totalCount==0) is not sufficient: an
Idea or Concern leaf clears every one of those gates and still must not
be built — it belongs to plan-issue, and a Bug belongs to bugfix.
bundle-fit enforces that routing, orders candidates by the authoritative
Project #24 Schedule tier rather than sub-issue list order (PAD-03-001,
PAD-15-014), and respects the size budget. See bundling.md for the rule table.
- Take the tool's proposed bundle. Auto-selection may return several members;
confirm they share one design idea in a single sentence (bundling.md
§ "Selecting a bundle") and drop any member that needs a different one.
- Empty-Epic gate — applies to both auto-selected and explicit issues:
Query the selected issue's type and sub-issue count:
```bash
bash .agents/skills/shared/query-issue-type.sh <ISSUE_NUMBER>
```
If issueType.name == "Epic" and subIssues.totalCount == 0:
1. Leave labels alone: the epic-needs-planning workflow keeps
needs-planning on an Epic with no sub-issues.
2. Post an actionable comment on the Epic:
```bash
gh issue comment <ISSUE_NUMBER> --repo CERTCC/Vultron \
--body "No implementable sub-issues found. Run \/plan-issue <ISSUE_NUMBER>\ to decompose this Epic into Tasks before building."
```
3. Tell the user: "Epic #N has no sub-issues and cannot be built yet. Run
/plan-issue N to decompose it into Tasks first."
4. Stop. Do not claim, branch, or proceed.
- Fail-fast blocker gate on every selected issue (auto-selected or explicit),
and, for an explicit bundle, a homogeneity gate:
- Query
blockedByfor each issue and filter tostate=OPEN. - If any OPEN blockers exist, print blocker numbers/titles and stop.
- Do not claim, branch, or deepen context when blocked.
- Query each member's
issueType. If a member is not aTaskorFeature,
stop and name the skill it belongs to (bugfix for a Bug; plan-issue
for an Idea, Concern, or Epic). Do not silently work or drop it.
- Epic-run hold (PAD-19-003). For each member, run
bash .agents/skills/shared/epic-hold.sh <N> [<EPIC_RUN>]. Exit 3 means
its Epic is claimed by an epic run, which owns its Tasks and Features
even in a later wave. Stop and ask the user before working it. The run
itself passes --epic-run <Epic>, which clears the hold for that Epic
only. Auto-selection never reaches this case: bundle-fit already holds
those candidates back as "not workable yet".
- Unconfirmed decision. A member whose body opens with a
Decision:
line and has no comment from the user confirming or overriding it: ask
that decision now, with the recommended answer as the recommended option
(issue-creation-requirements.md). Record the answer as an issue
comment and proceed with it. Unattended, or on silence: stop, with the
decision stated.
- Pre-claim AC verification gate — fetch the issue body and verify
each acceptance criterion against origin/main HEAD before claiming:
For each - [ ] AC-N: <text> item in the issue body, grep
origin/main for concrete evidence the AC is already satisfied (e.g.,
the described file exists with the required content, the named function
or class is present, the referenced behavior is implemented).
If no - [ ] AC-N: items are found in the issue body (prose-format
or free-form ACs), the gate cannot run mechanically — and that is where
already-delivered work slips through. Read the prose, list its concrete
claims, and check each against origin/main by hand as above. Only then
proceed to step 7 (or close per the rules below) (#1907, #3036).
If all ACs are confirmed satisfied on origin/main:
1. Post a reference comment on the issue citing the PR(s) that
delivered the work:
```bash
gh issue comment <N> --repo CERTCC/Vultron --body "$(cat <<'EOF'
All acceptance criteria are already satisfied on origin/main (delivered
by #<PR>). Closing without further work.
EOF
)"
```
2. Close the issue:
```bash
gh issue close <N> --repo CERTCC/Vultron
```
3. Stop. Do not claim, branch, or deepen context.
If any AC is unconfirmed, proceed to step 7 and claim normally.
- Claim the Issue — or every bundle member, onto one branch named for the
first member:
```bash
bash .agents/skills/shared/claim-issue.sh [--epic-run <Epic>] <N> task <slug> [<OTHER_MEMBERS>...]
```
GitHub creates the branch, linked to the issue, and that branch is the
lock (PAD-04-001). A build that is a non-final part of a split (its PR
says Part of #N) keeps that claim and works on an unlinked sibling
branch instead, because a PR from the linked branch closes #N
(PAD-04-008; shared/bundling.md § "Split PRs"). The script then assigns
you, comments, and sets Status = In Progress. Abort immediately if it
exits non-zero: exit 1 means already claimed or failed, and exit 3 means
held by an epic run (step 5).
- Fetch each issue's body and comments (including any comments not yet
loaded in step 6). Use the full content as implementation context
throughout Phases 3–5.
Phase 3 — Deepen Context
Invoke deepen-context with focus hints derived from the issue body
(e.g., "wire layer", "BT integration", "embargo lifecycle"), and pass
as the spec floor every spec ID in each member's Governing specs: line
plus any other spec IDs the issue body or comments cite. If an issue has no
Governing specs: line, say so and pass the cited IDs you found (or an
explicitly empty floor).
deepen-context returns a Spec manifest. Keep it: it goes into the PR
body (Phase 8), and reviewers use it as their spec floor.
Then, before the first commit, write the build context file that the pre-push
reviewer and the pr-ship phases reuse instead of loading context again
(.agents/skills/shared/build-context.md § "Writing it", PAD-07-015). Save the
manifest to /tmp/spec-manifest-<N>.txt and run build-context write with the
focus hints, notes and glossary sections deepen-context read.
Phase 4 — Verify Before Coding
- Compose-before-create gate (all domain types — blocking):
Load .agents/skills/shared/compose-before-create.md and apply the
per-subsystem search patterns for every subsystem the task touches (use
cases, wire handlers, adapters, demo helpers). Do not write any new code
until this search is complete. If an existing artifact covers the
requirement, compose or subclass it — do not re-implement.
- Search
vultron/andtest/to confirm the current state. - Do not assume missing functionality; verify in code.
- A missing prerequisite is part of the task. When the work needs
something that does not exist yet (most often a test or check, such as the
verification: check that a split of a requirement with no
verification_debt: marker needs, MS-10-016), the task becomes "build the
prerequisite, then do the task". A person given the task would do the
backfill, and nobody else in the workflow will. Take the first tier that
fits:
1. Small enough to build in this PR: build it. This is the default.
Do not file it, and do not stop.
2. Too big for this PR, but its test can be written now: ask first.
Present the deferral through Gate 1 (completeness-doctrine.md
§ "Gate 1"): what remains, measured, in plain language. This is the one
first-order item Gate 1 accepts (§ "Depth"). On approval, file the
follow-up issue through create-issue (type Task, reason
opened-as deferred, a size: from its AC count, a Governing specs:
line, the approval cited in its body, and no blocks: the task is done
anyway). Then do the task, and write a strict xfail test, with
@pytest.mark.spec("<ID>"), that states the missing behavior and cites
that issue (reason="<ID>: <what>. Tracked by #N.";
notes/spec-authoring-rules.md § "Use a Strict xfail for
Not-Yet-Implemented Specs"). The gap is held by a test that fails
loudly once the work lands, not by a note. Unattended, or on silence,
this tier is unavailable: build it, or hold the PR as a draft with the
missing piece stated.
3. No test can be written yet (the behavior is outside what agents may
build, such as production key handling, ADR-0164, or it needs a design
decision first): ask the user, and when the answer settles the design,
write the test and build it (completeness-doctrine.md § "Ask, Then
Finish"; as a sub-agent, return the Question: block it describes).
If a separate issue is the answer, file it
through create-issue (type Task, reason opened-as separate-defect,
a size: from its AC count, blocks the current issue, the current
issue's Epic as the suggested parent, a Governing specs: line), and
stop. Unattended, or on silence: stop, with the open question stated
on the current issue.
Never stop at "can't do X until someone writes the test". Writing the test
is the move that unblocks it. A learning file is not a substitute for any
tier (upward-reflection.md).
Phase 5 — Implement
See .claude/skills/shared/completeness-doctrine.md for the project standard
on what "done" means — loaded by orient-agent in Phase 1.
- Implement the full intent of the selected task, not just the happy path.
Edge cases, error handling, and type correctness are part of the task, not
optional add-ons.
- Follow project conventions. "Keep the change focused" means do not expand
into adjacent unscoped work — it does not mean implement less than the task
requires.
- Add or update tests for every new or changed behavior. A behavior with no
test is not done.
- Reuse existing helpers and keep the implementation DRY.
**If this task creates or modifies a BT node (required — BTC-01-001,
BTND-07-005):**
a. Node inventory: grep vultron/core/behaviors/ for existing node
classes whose protocol state, domain, or semantic action overlaps with
what you are about to implement. Search for the target state value, the
action name, and the affected domain (e.g. "RM.CLOSED",
"EM.EXITED", "active_embargo = None", "add_participant_status").
If a matching node exists, compose or delegate from it — do not
re-implement.
b. Base-class check (BTND-07-009, BTND-07-010): for any emit, send,
or state-transition node, check vultron/core/behaviors/ for an
existing base class whose update() frame covers the same
guard+emit+outbox or guard+transition+log pattern. Consult the domain
base-class table in