/agentic-workflow:init-workspace <target-dir>from agentic-workflow
Scaffolds or upgrades a repository with the agentic workflow substrate: copies templates, adapts docs, and interviews for project identity. Every install, hook, and overwrite requires explicit consent.
Ships in agentic-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Runner commands below are
runner <subcommand> [args…]— the launcher, its order and the pin are owned by references/RUNNER.md: read it before the first command, then keep it for the whole unit — nowhere else spells either.
Turn an empty or existing repo into one that works with the agentic workflow: copy the generic scaffold, then tailor it to this project instead of leaving raw placeholders.
Load and verify the canonical Turn contract (11 boxes) before ending every turn. Skill-specific additions (the docs-language and → Next: boxes are canonical-owned and not restated here):
✓ Required user inputs were answered concretely (not defaulted). Consent for
every install, hook, and overwrite is explicit; a consent gap runs the
three-tier dispatch and stops with the dispatcher's `open-questions@1` block
— against a scratch unit folder when no unit exists yet (§Consent).
✓ The project charter's identity layer was asked and answered before any
substrate byte was copied — never guessed; an unanswered identity question
halts through the same `open-questions@1` flow (§Charter).
✓ The adapted scaffold and repository-state ledger are written (or the merge/abort decision was asked) and remaining placeholders are listed
✓ Nothing was installed, registered (MCP) or overwritten — including the global
Serena config — without an explicit yes
About to end the turn with any box unchecked? The turn is NOT done — complete the missing box first (weak models drop end-of-document duties; this list is first on purpose).
AGENTS.md + docs/ map + templates) adapted to the project, not just copied.npx degit gtrabanco/agentic-workflow/template when you
want the gate commands, architecture, and doc domains filled in by interview.Installing a tool, wiring a hook, or overwriting an existing file each need an
explicit yes; context never supplies one, and an ambiguous repository state
(partially scaffolding) is not a route to guess. A consent gap is an open
question: (0) provenance (search the repo's own docs and record where) →
(1) research (concrete options) → (2) halt: run bun runner needs-input , paste the open-questions@1 block verbatim, stop with the questions carried in it. The dispatcher needs a unit folder, and consent gaps usually precede any unit — so the run first writes a scratch one (SPEC.md+decisions.mdin amktempdirectory, deleted after the paste) and runs the dispatcher against that. Grammar and exit codes:orchestration-envelope's references/TURN_CONTRACT.md§Open questions.[target-dir]` is optional — absent means the current directory, recorded.
Identity hardening (#514) — the pre-commit git-identity-check.sh hook and an
empty gitIdentity block — is offered once; a no installs nothing.
Document retention (#651) is offered the same way: a section whose shipped
default is keep-all (detection only). Saying yes writes
"docRetention": { "mode": "archive" }, which lets a merged unit's process
artifacts settle into the gitignored archive; the offer also adds the archive
directory to .gitignore, because doc archive refuses an archive git does not
ignore. A no installs nothing and the sensor keeps reporting the debt
(docs/workflow/RETENTION.md).
Inspect the target dir ([target-dir], default cwd) before touching anything:
AGENTS.md, or a legacy CLAUDE.md), docs/,
.github/? If so, do not clobber — check first whether it's an
agentic-workflow scaffold (marker: an agent guide present and either
docs/ROADMAP.md — or the pre-319 docs/features/ROADMAP.md — or a
docs/workflow/ dir). If both markers are
present, offer upgrade as the default action, alongside merge /
adapt-in-place / abort — see Upgrade mode below. If an agent guide or
docs/ exists but the markers are absent (a foreign scaffold), stay in
bootstrap and ask merge / adapt in place / abort as before.package.json, pyproject.toml, go.mod,
Cargo.toml, Gemfile, …) to propose gate commands and naming conventions.gh, gitlab → GitLab/glab, else ask).runner doctor --json prints one row per documented tool with its real evidence and
a move — take the rows as the tool facts instead of re-deriving a path, a
version or a hook by hand. An instruct-only row is the exact command to
print, an ask-consent-write row is the project's own installer and still
needs this skill's consent, and a residual row names what another owner
decides. The row contract is the crate README's tool-inventory@1 block. The
relay row is the one answer to "can this workspace chain Relay legs" — read
it (runner doctor --check relay) instead of probing the session marker or a
package path by hand.The reference allowlist is exactly the nine linked paths below. Never invent or
read another references/ path. Step 0 selects exactly one route:
Hard rule for an existing Claude Code, Cursor, Copilot, or OpenCode
scaffold: LOAD exactly references/UPGRADE.md. A missing committed safety
adapter is upgrade work, not a missing vendor primitive. Do not load bootstrap
or portability unless the runtime platform has no named adapter at all.
prose-only answer still owes.
Both the discovery and write routes load
SERENA language servers for stack detection.All resources are one hop from this file. Existing files, hook consent, installation consent, and residual reporting are fixed contracts. Missing template/migration evidence is reported by the selected route, never filled by guessing. An existing OpenCode scaffold with only its safety adapter missing loads exactly upgrade and skips bootstrap plus portability.
The consent gates protect bytes; the charter captures what the bytes are for. Before the scaffold is adapted, run the two-layer owner interrogation owned by bootstrap discovery §Charter interview and written per bootstrap write step 4:
open-questions@1 flow §Consent
uses.## Project charter
section plus the registered criteria catalogue; coverage computed by
audit-docs (check 16), never policed here.runner charter state
before asking, charter land to write (a slot the project already
filled is kept, never overwritten; an unanswered slot with a bank default
lands as assumed <YYYY-MM-DD> — <value>, while a none — <why> default is
never stamped and stays an open question), and charter check validates the
bank, including that every declared boundary records machine: <mechanism>
or prose-only.prose-only boundary the interview records is an item the write step
settles as a scaffolded rule, a filed target-forge issue, or a recorded
decline — one consent question each, and a no writes nothing and leaves a
residual. The feature map (docs/workflow/FEATURE_MAP.md) is seeded from the
discovery evidence, and the Evidence driver answer is what an artifact
criterion records its digest with. Owner of the round:
materialization; the check that keeps it true
is runner materialize check, run by audit-docs check 17.Asking the interview is not the deliverable; the answer must exist as a written
scaffold section. One deterministic gate says so:
runner substrate check --workspace <dir> prints one row per substrate class —
architecture (the architecture document), decision-records and api-posture
(the charter's slots) and documentation-map (the guide's table) — each
present, declined or absent, and exits 0 only when nothing is absent.
Bootstrap: the gate runs before the closing → Next: block. An absent
class is a refused install: write the section, or record an explicit decline —
ask first, one question per class, and a yes writes nothing but a dated row in
the guide's substrate-declines@1 block. A silent skip is the defect.
Upgrade: the same gate names the classes a workspace lacks, and each one is offered additively (never written unasked) beside the other missing blocks — one offer per class, resolved as written, declined, or left as a residual.
The census above asks whether a section exists; this asks whether the unit-doc
templates still carry the shape the installed release requires, where a drifted
one makes every unit the lane cuts reject at audit. runner scaffold-contract check --workspace <dir> prints one SURFACE <path> — MATCH|MISMATCH|ABSENT row per
exported template and one MISMATCH line per disagreement, exiting 0 only when
every present template matches; a workspace with none answers SCAFFOLD ABSENT,
never a pass it did not measure.
Upgrade: check runs in step 2 beside the census and again after the
additive writes — a drifted template is a named repair block, and parity stays
idempotent (a tailored template is a residual).
Authoring: runner scaffold-contract authoring <unit-doc> --workspace <dir>
runs the same comparison on a staged unit doc — wrong heading level, missing or
duplicated section, an ac-hash the section cannot re-derive — so the defect
surfaces at emission; run it before the unit doc's first commit.
"enabled": true flag in the project's own .pi/hooks.json. On an explicit
yes to "enable workflow seam hooks for this project?", write the consent
entry into the global store the extension reads —
<agentDir>/seam-hooks-consent.json, a projects map keyed by the
project's absolute path, { "consented": true, "consentedAt": <ISO date> }
— and create nothing else. <agentDir> is pi's global agent directory:
getAgentDir() in the extension, ~/.pi/agent on a default install (the
directory holding the unified config files — the agentic-workflow and
pi-agentic-workflow stems (.json/.jsonc/.json5); ~/.claude is not it). Never write or edit .pi/hooks.json (the
developer's declarations, not this skill's), never add the consent entry
without the project's absolute path, and a no writes nothing. The
dispatcher's own contract — config form, seam vocabulary, refusal grammar —
is owned by @gtrabanco/pi-agentic-workflow's README; this skill never
restates it.template/.agentic-workflow/journal.md)
and the CI example (*.yml.example) — never the carrier directory itself, so
a wholesale scaffold copy opts nobody in. Offer it as one consented question
(bootstrap or upgrade): a yes creates .agentic-workflow/journal/ and
installs one merge wiring; a no writes nothing — no directory, no workflow,
no config — and the project keeps today's direct-append journal. The same
question names the headless half (issue #471): an opted-in project whose CI
agents land pull requests can add the distributable action's step
(gtrabanco/agentic-workflow/journal@<tag>) to its run, and the carrier
document it already received explains that step — installing it is editing
the project's own workflow, so it is offered as text, never written for it.
The naming grammar has one owner (journal-fragment-grammar@1 in
@gtrabanco/agentic-workflow's README); this skill never restates it.@gotgenes/pi-permission-system,
installed by the operator, never by this skill on its own initiative: a yes runs
the package's installer, a no writes nothing and records the residual, and the
project's policy file is created through runner provision permissions
only when it does not exist (an existing one is the operator's). The offer, the
authoring section a project declares its own guards in, and the verification
checklist are
the permission reference; the enforcement contract
is that package's own documentation and this skill never restates it.Docs site block's
format slot (markdown/md, mdx/starlight/docusaurus, html,
latex/tex) decides what runner docs-generate renders, so a new
project is asked for it and an existing one is offered it additively, with
consent, in upgrade mode. Declining writes nothing; no format means markdown
with the degradation reported, never a silent default.docs/workflow/SKILL_AUTHORING.md
§"The target project's guide": essentials in the always-loaded guide,
everything else one hop away through a documentation map, and a
## Inviolable rules section where every rule ends with enforced by:,
soft-by-design: or open:. Offer that section as one consented question
(bootstrap or upgrade) — a project that answers no keeps the section as
declared placeholders rather than losing it, and a project whose guide already
carries its own laws keeps them: upgrade mode adds the missing state cells, it
never rewrites a rule the project wrote.AGENTS.md, or a legacy
CLAUDE.md) or docs/ without explicit consent.AGENTS.md is the guide; a legacy CLAUDE.md is
retired only in upgrade mode, only with an explicit yes, and only after any
content unique to it is folded into AGENTS.md first. A user whose Claude
Code release predates AGENTS.md support may keep it — that choice is
reported as a residual, never treated as drift to repair.urgent/fix-next label, never touch one that already
exists (name, color, or description a project already customized)..serena/project.yml
is committed; project.local.yml and cache stay local. Never write
.serena/ config, install the tool, register an MCP server or touch the
global serena_config.yml (trusted_project_path_patterns) without an
explicit yes — SERENA owns the single question and
the fixed provisioning report. LSP never verifies documents — false positives
happen when a file type's server is not listed (markdown/yaml/json are never
auto-detected), a listed server that fails to start must be removed (one
failure disables every server in the project), and LSP evidence stays
TypeScript/JavaScript-only. Document verification is a script's job.engram binary, ask before writing any host MCP config, write the absolute
path with the exact mcp --tools=agent argv, and report exactly what was
written. An existing engram declaration is never overwritten, and an absent
binary is a recorded residual — the documented install route is
pi install npm:gentle-engram@latest, never the CLI's own setup subcommand,
which keeps serving whatever version ran it until it is re-run..agentic-workflow/index.json config plus the
three freshness hooks (post-merge, post-checkout, post-rewrite, all
index-sync.sh installed into .git/hooks/) — is installed only after an
explicit yes to the question "install the doc retrieval index scaffold and
its git hooks?". Without consent: install nothing, record it as a residual
(the entry point still runs and builds its index on first query — the hooks
are only a freshness fast path), and never write .git/hooks/ or the config
on a later visit without a fresh yes. The hooks are best-effort by contract
(doc --sync --quiet, always exit 0 — a fast path never breaks git).
Record the runner the install resolved (issue #718): with the same yes,
run runner resolve --json doc --sync --quiet and write the answer's argv
to .agentic-workflow/hooks/runner.local, one token per line, adding that
path to the project's .gitignore — it names this machine's absolute paths,
so it is local by construction. The hook executes that argv verbatim before
falling back to command -v, which is what makes it work on a host where the
crate is not on PATH (a bunx install). A resolver refusal writes nothing
and is reported as a residual: the hook stays its documented silent no-op
(resolution order and degradation: .agentic-workflow/hooks/README.md).
Never hand-write the config's provider block (issue #541): when an
installed provider preset ships a doc-index embedding profile, the block is
materialized by /agentic-workflow-settings → Doc index embedding profile,
which shows each value's origin, asks before writing, and fills only the keys
the project leaves absent. That action is the only writer this skill may
name — its precedence rule (a value the project wrote always wins) is what
keeps a re-run safe, and the runner crate validates the block, so a value
invented here would be refused rather than applied.pre-push
hook?" — joins the hook consents, and a yes chains
.agentic-workflow/hooks/secret-scan.sh "$@" into .git/hooks/pre-push
(additively, never over a customized hook) and runs
bash .agentic-workflow/hooks/tests/test-secret-scan.sh; a no installs
nothing and records the residual, with the hooks README's manual invocation as
the documented route. It needs only bun or node and refuses the push by
name without either — a scanner that cannot look never reports nothing to see.runner config init --scope project (which refuses
to overwrite), a no writes nothing and records the residual. The two files,
their scopes, the resolution order and the new-feature policy are owned by
CONFIG; this skill never restates a schema or edits a
package's extension file.skills/triage-issue /SKILL.md is the sole owner of the urgent/fix-next names, colors, and
apply rules — this skill only seeds those two labels into the repo; it never
invents a third label or changes what the two mean.The adaptive lane replaces the fixed pipeline with a single-unit-document model.
Every NEW unit produces one SPEC.md under docs/features/<NN>-<slug>/, cut in
the spec-by-reference shape the template ships: Specs (numbered S#, each
quoting the requester's words verbatim), Impact, Non-goals, Future cost,
Applicable tests, Known pre-existing issues, Tasks (each bullet linked to the
S# it delivers), Findings (OPEN rows only), Log (append-only; L1 is the
request verbatim), Next, References. A unit opened before this shape keeps the
legacy 14-section shape — Objective, Why, User outcome, Acceptance criteria,
Impact, Non-goals, Future cost, Applicable tests, Known pre-existing issues,
Tasks, Evidence, Progress log, Next, References — and is never rewritten to
migrate.
Conventions written into the project's AGENTS.md:
/unit-lane / workflow-status) returns a
deterministic ordered list of steps (research, design, plan, implement,
tests, evidence, review, docs, release).runner diff-guard measures git diff --stat at boundaries;
overflow → mandatory re-triage. Anti-gaming: "NEVER shrink a diff by deleting
comments, blank lines, docs or tests."YYYY-MM-DD HH:MM) per step taken.type(scope): description (conventional commits).idea → defined → planned → in-progress → done.These are written by bootstrap (fresh) and upgrade mode (additive-only for pre-
lane installs). A pre-lane project gets only: the lane conventions section in
AGENTS.md, the unit doc templates under docs/features/_TEMPLATE/ and
docs/fix/_TEMPLATE/, and the docs-map rows for them.
Seed docs/workflow/REPOSITORY_STATE.md from the template. Explain that
discovery freezes evidence before planning and only the resolver updates facts.
Offer docs/architecture/ARCHITECTURAL_INVARIANTS.md as an optional project
contract for long-lived architectural rules. Its entries must name a stable ID,
repository evidence, and the authority that can change the rule. Do not infer a
rule from the implementation or a feature SPEC. A project without this document
remains compatible; record n/a: no project invariants declared in later
workflow artifacts rather than creating one silently.
The scaffold is vendor-neutral; only hook activation differs. When the detected agent has no named adapter, follow portability and keep it as an explicit residual. A supported Claude Code, Cursor, Copilot, or OpenCode adapter does not load this fallback.
npx degit gtrabanco/agentic-workflow/template — the static copy this skill
adapts. Use that when you want the raw scaffold and will fill it yourself.docs/workflow/PORTABLE_PROMPT.md — regenerates the skills adapted to a
project (behavior). This skill adapts the substrate (docs). Complementary.discover-repository-state → workflow-status (to see what's
startable) → /unit-lane (the lane conductor); run audit-docs to confirm
the scaffold is coherent.A tailored AGENTS.md + docs/ scaffold + .github/ templates exist in the
target, unused folders pruned, residual placeholders flagged, the platform's
companion review skills are recorded (and offered), the skill-discovery route
was offered after the charter round — and either every installed extra is
registered in the guide's review-extras@1 note with its source, pin, install
date and axis, or nothing was installed and the tree is byte-identical — and
the urgent/fix-next labels are seeded (scaffold) or additively reconciled
(upgrade),
and every accepted safety adapter is active and fixture-tested — or explicitly
listed as a residual when its hook API/dependency was unavailable,
and runner substrate check --workspace <dir> reports Verdict: complete (or
every absent class carries a recorded decline).
The adaptive lane conventions (unit document, triage, catalog steps, guards,
evidence, commit formats) are written into AGENTS.md.
Serena is provisioned and reported: the one consent question was asked, the project config written (or skipped with its reason), the tool installed and its MCP server registered for the detected platform — or each refused/absent item recorded as a residual with its reason — and the fixed provisioning report states the health check per listed server and the index result. The run completes either way.
The closing → Next: block is printed (plus the offer to install the skills):
→ Next: /discover-repository-state — freeze repository evidence before planning
· raw idea → /workflow-status → /unit-lane (the lane conductor)
· next roadmap entry → /unit-lane (tridirection decides catalog steps)
· confirm the scaffold is coherent → /audit-docs
references/BOOTSTRAP_DISCOVERY.md (opens in a new tab)references/BOOTSTRAP_WRITE.md (opens in a new tab)references/CONFIG.md (opens in a new tab)references/ENGINEERING_INTERVIEW.md (opens in a new tab)references/ENGRAM.md (opens in a new tab)references/MATERIALIZATION.md (opens in a new tab)references/PERMISSIONS.md (opens in a new tab)references/PORTABILITY.md (opens in a new tab)references/SERENA.md (opens in a new tab)references/UPGRADE.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gtrabanco/agentic-workflow --plugin agentic-workflow33 skills in this plugin
/agentic-workflow-doctorUser-initiated batch ceremony-failure triage: mine this project's own journal and unit docs for its accumulated ceremony failures, apply a fixed discard/report rubric, render one anonymized bundle, and route it upstream to an existing or new agentic-workflow issue — with consent. Read-only; the user starts it. Triggers: "agentic-workflow-doctor", "aw-doctor", "why do my reviews keep blocking", "triage my ceremony failures", "report a workflow bug upstream".
/audit-docsAudit cross-document coherence: docs ↔ READMEs ↔ roadmap ↔ code ↔ fix index ↔ issues. Finds drift — features in docs/ not in the roadmap (or vice versa), fix-index entries already merged/closed, broken documentation-map links, dependency cycles, artifacts in the wrong language, naming-convention violations, project-charter coverage — and reports them ranked by severity, fixing only low-risk items on request. Model-agnostic: the skill inherits whatever model and effort your agent session is already using. Triggers: "check doc consistency", "are the docs in sync", "audit the docs", "doc coherence review", "did the docs drift", "validate the roadmap".
/audit-prAudit a whole PR against the delivery contract and return MERGE-READY or evidenced blockers with the full URL. Consumes the current review-change REVIEW-PASS receipt instead of re-running review axes; posts a SHA-bound ready comment; never edits or merges. Triggers: "audit-pr", "is this PR ready", "merge gate".
Other plugins' skills for the same job