From plastic
Autonomous intent delivery — agent takes over How and Exec. Use when user says "auto", "take it from here", "deliver this", or when brainstorming-grill-me concludes and user confirms autonomous execution. Requires an active intent in INDEX.md.
How this skill is triggered — by the user, by Claude, or both
Slash command
/plastic:autoThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Announce: "Taking over intent [ID] — [name] for autonomous delivery."
Announce: "Taking over intent [ID] — [name] for autonomous delivery."
An active intent MUST exist in INDEX.md. If none exists, refuse: "No active intent found. Create one first with /plastic-creating-intent."
If multiple active intents exist, ask the user which one to deliver (this is the only question auto asks).
Picking work when no intent is specified. If the user says "auto" without naming an intent and none is active, consult the dashboard's machine-readable queue to choose the next dispatchable intent:
ruby ~/.plastic/scripts/dashboard.rb all --json
Work dispatchable_queue in rank order (these are defer/research dispositions —
safe to deliver autonomously). Leave human_only and next_big_thing for the user — those
are drive/triage items the human should lead. See the plastic-dashboard skill.
QMD-first (when available): when the user describes the work to deliver rather than naming an
intent, before scanning the store with grep/Read run
ruby ~/.plastic/scripts/qmd-sync search "<terms>" to surface candidate, prior, or duplicate
intents, then open the authoritative intent file for the hit you take over. The command is a no-op
when QMD is absent, so fall back to the existing INDEX.md / file scan. (This is discovery; the
reindex step under Completion is separate.)
Immediately after selecting the intent — before any other work — arm auto mode. This writes the session bridge that makes the code-edit gate live, so project code cannot be edited before the plan exists (the gate applies to YOU, the orchestrator):
ruby -r ~/.plastic/scripts/lib/bridge -e \
'Bridge.arm_auto(ENV["CLAUDE_CODE_SESSION_ID"], intent_id: "<ID>", intent_dir: "<STORE>/<dir>", store: "<STORE>", name: "<name>")'
Replace <ID>, <STORE> (e.g. ~/.plastic/projects/<slug>/store or ~/.plastic/store),
<dir> (the ID--slug directory), and <name>. The first argument is the session id you
want the bridge keyed by: pass the hook stdin session_id when you have it, otherwise
ENV["CLAUDE_CODE_SESSION_ID"], otherwise nil. arm_auto calls resolve_session, which
picks the first non-empty of: the explicit id you pass -> CLAUDE_SESSION_ID ->
CLAUDE_CODE_SESSION_ID -> a deterministic derived key (a hash of the store and intent id).
It never returns nil, so the gate engages even when every session env var is empty; the call
never needs a non-empty CLAUDE_SESSION_ID to function. Arming prints a one-line notice to
stderr when it falls through to the derived key.
Hard rule for the rest of this run: do NOT edit project code (anything outside the
intent directory / ~/.plastic/) until plan.md AND checklist.md exist for the intent.
Honor the cycle: What → Why (spec.md) → How (plan.md + actions/ + checklist.md) → Exec.
--skip-permissions — bypass hard stops on destructive actions on existing projects. Full trust mode. Default: off.Auto mode spins up exactly ONE enforcer-led team per intent. The plastic-enforcer IS this orchestrator (you), not a separately dispatched agent, which avoids the who-gates-the-gater regress.
Roster (one role per cycle stage):
## Context + ### Decisionsspec.md)plan.md + actions/ + checklist.md)## Insights)Dispatch rule: sequential, one specialist per stage on one branch (the deliverables share files). Gate each deliverable against the stage's exit criteria before handing off. The How and Exec phases below default to Plastic's native dispatch (plastic-executing-plan) and delegate to the superpowers skills only when they are available or the user asks; do not restate the phase mechanics here.
Spawn preamble (live-state injection): before dispatching any specialist, run scripts/spawn-preamble <intent_dir> --role <role> and PREPEND its output to that specialist's prompt. The preamble is a deterministic, filesystem-only snapshot of the active intent (id, intent line, current stage) plus the honoring instruction, so every spawned agent boots with accurate live state instead of guessing. This is the authoritative L2 mechanism for harnesses whose sub-agents do not inherit a top-level session event (see docs/reference/harness-adapters.md).
Completion report (require-then-synthesize): every dispatched specialist MUST end with a structured completion report as its final message. The preamble's REPORT_CONTRACT injects this and the role prompts carry the per-role format (see references/agent-report-contract.md). Because child-agent honor is best-effort across harnesses, this is decision-shaping, not a hard block. When a specialist returns no usable report (it went idle, emitted only a bare ping, or its message was lost to a mid-run interjection), run scripts/agent-report <intent_dir> --role <role> to synthesize a deterministic filesystem-derived report so the handoff account always exists. Use the agent-authored report when present, the synthesized one otherwise.
Final-gate review: dispatch an independent reviewer subagent at the final gate only, not as a standing role.
Headless manual gate: when running headless or in the background, still enforce gates manually rather than relying on hooks alone. The PostToolUse gate hook reads session_id from hook stdin, and the savepoint ledger write is decoupled from the bridge (derived from the file path, so it fires even with no session id) - these do NOT no-op. What can degrade is the bridge-keyed stage enforcement: if no session id reaches the bridge and no matching bridge is discovered, the stage-gate enforcement step exits without acting, so verify state yourself. The bridge still resolves arming via CLAUDE_CODE_SESSION_ID or the derived-key fallback (see the arm-gate note above).
Solo fallback: if the harness has no subagent dispatch, fall back to a single agent walking the full What, Why, How, Exec cycle yourself. This preserves current behavior.
Read the active intent's savepoint.md FIRST (intent 81): the last line classifies the stage,
and you then verify only that line's artifact before entering. Fall back to the filesystem probe
below only when the ledger is missing (then rebuild it with Bridge.rebuild_savepoint).
| Ledger last line | Enter |
|---|---|
What {id}--{slug}.md (born) or no spec | Start / complete Why (write spec.md) |
Why spec.md created | Enter How |
How plan.md created / How checklist.md created / Exec started | Enter Exec (verify plan + checklist) |
Exec outcome.md created | Exec done; complete the intent |
| `Done delivered | abandoned` |
Filesystem fallback (ledger missing only):
| Check (in order) | Stage |
|---|---|
checklist.md exists with some items checked | Resume Exec from last unchecked item |
plan.md + checklist.md exist (no items checked) | Enter Exec |
spec.md exists, no plan.md | Enter How |
## Context has content in intent file, no spec.md | Complete Why (fill gaps, write spec.md) |
Only ## Intent exists | Start Why from scratch |
Announce which stage you're entering and why.
When entering at Why stage:
## Context and ### Decisions from the intent file## Links), web search if needed. NO questions to human.## Context > ### Decisions with rationale## Insights with (autonomous) marker: "Decision: chose X because Y (autonomous)"spec.md — consolidated specificationThen proceed to How.
superpowers:writing-plans is available as a skill, delegate plan creation to it. Tell it the plan saves to the active intent's directory (not docs/superpowers/plans/).plan.md directly — implementation plan with numbered tasksactions/ directory with ACTION_N.md files (one per task, self-contained)checklist.md — execution registry with checkboxes covering all actionsThen proceed to Exec.
If the plan calls for creating a new project (the intent is an implementation intent that needs a new codebase):
~/.plastic/config.yml project_roots or from intent context"Creating project
<slug>at<path>. Confirm path, or provide alternative."
plastic-creating-project skillsuperpowers:subagent-driven-development or superpowers:executing-plans is available, delegate execution to itplastic-executing-planchecklist.md as completed## Insights with (autonomous) markerThe agent MUST prefer non-destructive routes:
| Instead of... | Do this... |
|---|---|
| Drop table | Rename to _deprecated_<table>, flag for cleanup |
| Delete files | Move to .archive/ or backup branch |
| Alter column | Additive migration — new column + backfill |
| Remove feature | Feature flag off, code stays until human confirms |
| Database migration | Backup before migration, keep rollback path |
--skip-permissions)When a genuinely destructive action on an existing project has NO safe alternative:
## InsightsWith --skip-permissions, the agent logs the action in Insights but proceeds without stopping.
During initial project creation, all decisions are non-destructive by definition (there's nothing to destroy). The agent has full autonomy for greenfield choices — DB engine, framework, gems, architecture.
Verify all checklist items are checked
Write outcome.md with detailed results
Write ## Outcome summary in the intent file (1-2 sentences)
Release (if configured)
~/.plastic/projects.yml to find the project slug. If no match, skip to step 5 (default commit-only behavior).~/.plastic/projects/{slug}/project.yml. If the file doesn't exist or has no release key, skip to step 5.release.on_complete:
commit — git add + commit (same as default, proceed to step 5)commit_and_push — git add + commit + pushmanual — skip auto-commit, notify user: "Release configured as manual — commit when ready."release.verify is set, run the verify command (e.g. bundle exec rake test):
release.on_red:
fix_and_retry — attempt to fix the failure, re-run verify (max 2 retries)stop — write savepoint.md with current state, notify user: "Verify failed — savepoint written.", STOPmanual — notify user: "Verify failed: [summary]. Resolve manually."release.on_green has items, invoke plastic-releasing to handle them (tag, changelog, publish, etc.). Do NOT duplicate release logic — delegate entirely.Review ## Insights for observations that should spawn future intents. If any:
plastic-creating-intent conventions)chain in the current intent's frontmatterMove intent from ## Active to ## Completed in INDEX.md (with today's date). As the
closing act of the transfer, stamp the terminal ledger bookend (intent 81) so the savepoint's
last line records delivery:
ruby -r ~/.plastic/scripts/lib/bridge -e 'Bridge.append_terminal_savepoint("<intent_dir>", "delivered")'
(Use "abandoned" instead when the intent is being moved to ## Abandoned.) Idempotent.
Auto-commit: cd <store-root> && git add . && git commit -m "feat: deliver intent <ID> — <name>"
On completion, ALWAYS refresh the QMD search index for this store (no-op when QMD is absent). It runs in the background so it never blocks the turn:
ruby ~/.plastic/scripts/qmd-sync reindex --store <store-root> --async
Completion is the lifecycle event that keeps the search index fresh. <store-root> is the
store that holds this intent (the global store or the project store).
Disarm the lifecycle gate (auto delivery is finished):
ruby -r ~/.plastic/scripts/lib/bridge -e 'Bridge.disarm_auto(ENV["CLAUDE_CODE_SESSION_ID"])'
Disarming also purges stale bridge files from the temp directory automatically (it keeps the
current bridge and any live run), so no manual /tmp cleanup is needed.
Worktree cleanup (mandatory, intent 73c3). Disarming performs the worktree release:
disarm_auto calls Worktree.release, which removes both per-intent worktrees (the code
worktree under <repo>/.claude/worktrees/{id}--{slug} and the paired store worktree under
<plastic_home>/.worktrees/{id}--{slug}), prunes both repos, and clears the worktree block
from the bridge. This is the plain remove path: the disarm route does NOT merge, so use it
only when no release merges the branch (the branch survives and can be reclaimed).
When the work is being shipped through a release, do NOT rely on this plain remove. The
release path (step 4 above, via plastic-releasing) is responsible for merging the intent's
code branch (plastic/{id}--{slug}) back to the repo's default branch BEFORE the worktree is
removed, so the integrated work is not lost. It does this with Worktree.finish(bridge_data, merge: true) (merge-then-remove). Never leave an orphaned worktree, and run git worktree prune if you hit a stale reference.
Notify user: "Intent [ID] — [name] delivered. [1-2 sentence summary]. See outcome.md for details."
If the agent gets stuck (can't resolve a gap, dependency is missing, tests fail persistently):
## Insightssavepoint.md with current statereferences/agent-architecture.md for the full team model (the 5-role enforcer-led team, per-stage handoffs, gate ownership, headless note, solo fallback) and the orchestrator hierarchy (Main Orchestrator, Project Orchestrators, coordination loop) when spinning up the team or understanding autonomous delivery scopenpx claudepluginhub zalom/plastic --plugin plasticProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
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.