From agent-atelier
Candidate pipeline lifecycle — enqueue work items as a candidate set for validation, activate the next queued set into the exclusive validation slot, or clear the active set after completion or demotion. Supports single and batch candidates with fate-sharing semantics. Use when a builder finishes implementation, when the orchestrator needs to start validation, or when validation passes or fails. Triggers on 'candidate', 'enqueue candidate', 'activate candidate', 'clear candidate', 'promote to candidate', 'candidate queue', 'next candidate', 'demote candidate', 'candidate ready', 'submit for validation', or 'validation slot'.
npx claudepluginhub ether-moon/agent-atelier --plugin agent-atelierThis skill uses the workspace's default tool permissions.
Candidates bridge implementation and validation. When a builder finishes work items, they are enqueued as a **candidate set** — one or more WIs sharing a branch and commit. The orchestrator activates the next set into the exclusive validation slot (one at a time). After validation, the set is cleared as completed or demoted (fate-sharing: all WIs succeed or all return to rework).
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.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
Candidates bridge implementation and validation. When a builder finishes work items, they are enqueued as a candidate set — one or more WIs sharing a branch and commit. The orchestrator activates the next set into the exclusive validation slot (one at a time). After validation, the set is cleared as completed or demoted (fate-sharing: all WIs succeed or all return to rework).
{
"id": "CS-001",
"work_item_ids": ["WI-018", "WI-019"],
"branch": "feat/phase-2",
"commit": "abc1234",
"type": "batch",
"activated_at": null
}
id: CS-NNN, auto-generated on enqueuework_item_ids: always an array, even for single WIstype: "single" (1 WI) or "batch" (2+ WIs)activated_at: set on activation; null while queuedLoop-state stores active_candidate_set (one set or null) and candidate_queue (FIFO array).
enqueue: all specified WIs must be in implementing statusactivate: active_candidate_set must be null; candidate_queue must be non-emptyclear: active_candidate_set must be non-nullAll writes go through a single state-commit transaction. Every subcommand follows:
loop-state.json and work-items.json. Note both revisions.state-commit.stale_revision, re-read and retry.echo '<transaction-json>' | <plugin-root>/scripts/state-commit --root <repo-root>
For detailed step-by-step procedures, see reference/subcommands.md.
enqueue <WI-ID>[,WI-ID,...] --branch <name> --commit <sha>Enqueues WIs as a candidate set. Transitions each WI from implementing to candidate_queued, sets promotion metadata, clears lease fields, and appends the set to candidate_queue.
activatePops the first set from candidate_queue into active_candidate_set (FIFO). Transitions each WI from candidate_queued to candidate_validating. No arguments.
clear [--reason completed|demoted]Clears the active set. --reason completed verifies all WIs are done and clears the slot. --reason demoted (default) resets all WIs to ready, clears promotion metadata, and syncs native tasks back to pending.
Enqueue a single WI after implementation:
/candidate enqueue WI-014 --branch candidate/WI-014 --commit abc1234
Enqueue a batch of WIs from the same branch:
/candidate enqueue WI-018,WI-019,WI-020 --branch feat/phase-2 --commit def5678
Activate the next queued set for validation:
/candidate activate
Clear after all WIs pass validation:
/candidate clear --reason completed
Clear after validation failure (demote all WIs):
/candidate clear --reason demoted
All timestamps are UTC ISO-8601 with Z suffix: 2026-04-08T12:00:00Z
| Code | Meaning |
|---|---|
0 | Success |
1 | Usage or validation error (missing required fields) |
2 | Precondition failed (wrong status, slot occupied, queue empty, stale revision) |
3 | Work item not found |
4 | Runtime or environment failure |
--json '<inline-json>' or --input <path> for payload--request-id <id> required on all mutating operations (idempotency tracking)expected_revision per artifact in the transaction (do not reuse a single value for both files)All subcommands return JSON to stdout:
{
"request_id": "REQ-201",
"accepted": true,
"committed_revision": 43,
"changed": true,
"candidate_set_id": "CS-003",
"artifacts": [
".agent-atelier/loop-state.json",
".agent-atelier/work-items.json"
]
}
clear --reason completed and idempotent clear --reason demoted may include only loop-state.json in artifacts. Diagnostics go to stderr.
request_id + same payload → return previous result with "changed": false, "replayed": truerequest_id + different payload → reject with exit code 12| Condition | Exit | Action |
|---|---|---|
| WI not found | 3 | Report missing IDs, list available |
WI not implementing (enqueue) | 2 | Report which WIs have wrong status |
| Slot already occupied (activate) | 2 | Report active set ID and activated_at, suggest clearing first |
| Queue empty (activate) | 2 | Report empty queue, suggest enqueue first |
| Slot is null (clear) | 2 | Report nothing to clear |
| WI already in queue (enqueue) | 2 | Report duplicate and which set contains it |
| WI in active set (enqueue) | 2 | Report WI is under validation |
Not all WIs done (clear completed) | 2 | Report which WIs are not done, suggest demoted |
| Stale revision | 2 | Report current vs expected, ask caller to re-read |
candidate_queue is strictly FIFO. No priority reordering.references/wi-schema.md for normalization rules on all work item writes.