Init Workspace
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.
Turn contract — verify before ending the turn
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).
When to use
- Setting up a repo to use these skills and you want the documentation substrate
(
AGENTS.md + docs/ map + templates) adapted to the project, not just copied.
- Prefer this over a static
npx degit gtrabanco/agentic-workflow/template when you
want the gate commands, architecture, and doc domains filled in by interview.
Consent — mandatory, never defaulted
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 scripts/needs-input.mjs <unit-dir>, 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.md in a mktemp directory, 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.
Step 0 — Discover the project (always first)
Inspect the target dir ([target-dir], default cwd) before touching anything:
- An existing agent guide (
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.
- Detect the stack from manifests (
package.json, pyproject.toml, go.mod,
Cargo.toml, Gemfile, …) to propose gate commands and naming conventions.
- Note the git state (is it a repo, what's the default branch, and the remote
URL → forge: github.com → GitHub/
gh, gitlab → GitLab/glab, else ask).
Progressive loading — bootstrap or upgrade, never both
The reference allowlist is exactly the six 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.
- Bare/foreign repository: read
bootstrap discovery, complete its
interview — the charter round first: the identity layer is blocking, the
domain layer is open-with-defaults (§Charter below) — then read
bootstrap write.
Both the discovery and write routes load
SERENA language servers for stack detection.
- Existing agentic-workflow scaffold: read upgrade
only. Its additive-only rule is absolute; do not replay bootstrap.
The upgrade route loads SERENA language servers
for the additive provisioning step.
- Provisioning Engram on a host with no pi package: read
Engram provisioning — detect, ask, register or
instruct, report. Loaded by the bootstrap write route only (the pi package
provisions itself, feature 66).
- No named adapter exists for the detected runtime platform: add
portability only for that fallback. Claude Code,
Cursor, Copilot, and OpenCode are named supported adapters; a missing adapter
file is repaired by upgrade and does not trigger portability.
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.
Charter — what the project is, asked before the substrate
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:
- Identity layer — blocking, never guessed (project kind, users,
deployment, license, ceremony-profile seed): an unanswered identity question
is not a default — it halts through the same
open-questions@1 flow §Consent
uses.
- Domain layer — open-with-defaults (tests/gate, dependency, docs, tooling,
data/PII, i18n): unanswered items are recorded as dated assumptions,
surfaced by the first unit that needs them, never re-asked, never silent
defaults.
- Content rule + landing: decisions, policies and commands — never
derivable-from-code description — in the agent guide's
## Project charter
section plus the registered criteria catalogue; coverage computed by
audit-docs (check 16), never policed here.
Guardrails
- Seam hooks are consent-gated and opt-in per seam (issue #413). The pi
extension runs project-declared commands at workflow seams only after two
gates, both explicit: init-workspace's consent marker, and the per-seam
"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 — agentic-workflow.json and
pi-agentic-workflow.json; ~/.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.
- The session-log fragment carrier is opt-in, off by default (issue #405).
The template ships the documentation (
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 naming
grammar has one owner (journal-fragment-grammar@1 in
@gtrabanco/agentic-workflow's README); this skill never restates it.
- The docs-site format is a declared choice. The
Docs site block's
format slot (markdown/md, mdx/starlight/docusaurus, html,
latex/tex) decides what bun scripts/docs-generate.mjs 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.
- Never overwrite an existing agent guide (
AGENTS.md, or a legacy
CLAUDE.md) or docs/ without explicit consent.
- One guide, one name.
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.
- Additive-only, never clobber (upgrade mode). Upgrade mode only adds
blocks the project lacks and fills raw placeholders — it never rewrites or
deletes a block the project already tailored, even if the current template
changed that block too. A genuine re-tailor is a separate, explicitly
requested bootstrap adapt-in-place run, never something upgrade mode does
on its own. The urgency label seeding is additive-only the same way:
create a missing
urgent/fix-next label, never touch one that already
exists (name, color, or description a project already customized).
- Serena convention — tool and config, one consent question.
.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 provisioning is ask-first, never assumed (feature 66). Detect the
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.
- Retrieval index scaffold and git hooks are consent-gated (AC22). The
index surface — the committed
.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).
- Unified config is offered, never hand-written (issue #427). One consented
question offers the project config; a yes runs
bunx @gtrabanco/agentic-workflow 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.
- Never redefine the urgency label vocabulary here.
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.
- Docs-only scaffolding; no app code, no dependencies installed unprompted.
- Architecture-agnostic: record the project's pattern, don't impose one.
- Honest placeholders over invented specifics; flag what's left to fill.
- Honor the project's Workflow conventions once present; on an existing repo,
don't work on its default branch and never commit/push unless asked.
Unit document conventions (the adaptive lane)
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:
- Triage: the lane conductor (
/unit-lane / workflow-status) returns a
deterministic ordered list of steps (research, design, plan, implement,
tests, evidence, review, docs, release).
- Guards:
scripts/diff-guard.mjs measures git diff --stat at boundaries;
overflow → mandatory re-triage. Anti-gaming: "NEVER shrink a diff by deleting
comments, blank lines, docs or tests."
- Evidence rows: one per AC — what was run, exit/digest, output (≤2 lines),
verified-by. Verified, not claimed.
- Progress log: dated entries (
YYYY-MM-DD HH:MM) per step taken.
- Commit format:
type(scope): description (conventional commits).
- Roadmap status:
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.
Normalized Repository State
Seed docs/workflow/REPOSITORY_STATE.md from the template. Explain that
discovery freezes evidence before planning and only the resolver updates facts.
Architectural invariants
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.
Portability
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.
Relationship to other skills
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.
- After init:
discover-repository-state → workflow-status (to see what's
startable) → /unit-lane (the lane conductor); run audit-docs to confirm
the scaffold is coherent.
Done when
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), 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.
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
1---2name: init-workspace3user-invocable: true4version: 4.10.05argument-hint: <target-dir>6author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"7license: MIT8description: >9 Adapt the workflow scaffold to a new repository or add only missing substrate10 blocks to an existing install. Every install, hook, and overwrite needs11 explicit consent. Triggers: "init-workspace", "set up agentic workflow",12 "upgrade workflow scaffold".13metadata:14 source: https://skillmd.com/skills/gtrabanco/init-workspace15---1617# Init Workspace1819Turn an empty or existing repo into one that works with the agentic workflow:20copy the generic scaffold, then **tailor it to this project** instead of leaving21raw placeholders.2223## Turn contract — verify before ending the turn2425Load and verify the **canonical** [Turn contract](../orchestration-envelope/references/TURN_CONTRACT.md) (11 boxes) before ending every turn. Skill-specific additions (the docs-language and `→ Next:` boxes are canonical-owned and not restated here):2627```28✓ Required user inputs were answered concretely (not defaulted). Consent for29 every install, hook, and overwrite is explicit; a consent gap runs the30 three-tier dispatch and stops with the dispatcher's `open-questions@1` block31 — against a scratch unit folder when no unit exists yet (§Consent).32✓ The project charter's identity layer was asked and answered before any33 substrate byte was copied — never guessed; an unanswered identity question34 halts through the same `open-questions@1` flow (§Charter).35✓ The adapted scaffold and repository-state ledger are written (or the merge/abort decision was asked) and remaining placeholders are listed36✓ Nothing was installed, registered (MCP) or overwritten — including the global37 Serena config — without an explicit yes38```3940About to end the turn with any box unchecked? The turn is NOT done — complete41the missing box first (weak models drop end-of-document duties; this list is42first on purpose).4344## When to use4546- Setting up a repo to use these skills and you want the documentation substrate47 (`AGENTS.md` + `docs/` map + templates) adapted to the project, not just copied.48- Prefer this over a static `npx degit gtrabanco/agentic-workflow/template` when you49 want the gate commands, architecture, and doc domains filled in by interview.5051## Consent — mandatory, never defaulted5253Installing a tool, wiring a hook, or overwriting an existing file each need an54explicit yes; context never supplies one, and an ambiguous repository state55(partially scaffolding) is not a route to guess. A consent gap is an open56question: **(0) provenance** (search the repo's own docs and record where) →57**(1) research** (concrete options) → **(2) halt**: run `bun58scripts/needs-input.mjs <unit-dir>`, paste the `open-questions@1` block verbatim,59stop with the questions carried in it. The dispatcher needs a unit folder, and60consent gaps usually precede any unit — so the run first writes a scratch one61(`SPEC.md` + `decisions.md` in a `mktemp` directory, deleted after the paste)62and runs the dispatcher against that. Grammar and exit codes:63`orchestration-envelope`'s `references/TURN_CONTRACT.md` §Open questions.64`[target-dir]` is optional — absent means the current directory, recorded.6566## Step 0 — Discover the project (always first)6768Inspect the target dir (`[target-dir]`, default cwd) before touching anything:6970- An existing **agent guide** (`AGENTS.md`, or a legacy `CLAUDE.md`), `docs/`,71 `.github/`? If so, **do not clobber** — check first whether it's an72 **agentic-workflow scaffold** (marker: an agent guide present *and* either73 `docs/ROADMAP.md` — or the pre-319 `docs/features/ROADMAP.md` — or a74 `docs/workflow/` dir). If both markers are75 present, offer **upgrade** as the default action, alongside merge /76 adapt-in-place / abort — see **Upgrade mode** below. If an agent guide or77 `docs/` exists but the markers are absent (a foreign scaffold), stay in78 bootstrap and ask merge / adapt in place / abort as before.79- Detect the stack from manifests (`package.json`, `pyproject.toml`, `go.mod`,80 `Cargo.toml`, `Gemfile`, …) to *propose* gate commands and naming conventions.81- Note the git state (is it a repo, what's the default branch, and the **remote82 URL → forge**: github.com → GitHub/`gh`, gitlab → GitLab/`glab`, else ask).838485## Progressive loading — bootstrap or upgrade, never both8687The reference allowlist is exactly the six linked paths below. Never invent or88read another `references/` path. Step 0 selects exactly one route:8990**Hard rule for an existing Claude Code, Cursor, Copilot, or OpenCode91scaffold:** LOAD exactly `references/UPGRADE.md`. A missing committed safety92adapter is upgrade work, not a missing vendor primitive. Do not load bootstrap93or portability unless the runtime platform has no named adapter at all.9495- Bare/foreign repository: read96 [bootstrap discovery](references/BOOTSTRAP_DISCOVERY.md), complete its97 interview — **the charter round first: the identity layer is blocking, the98 domain layer is open-with-defaults (§Charter below)** — then read99 [bootstrap write](references/BOOTSTRAP_WRITE.md).100 Both the discovery and write routes load101 [SERENA language servers](references/SERENA.md) for stack detection.102- Existing agentic-workflow scaffold: read [upgrade](references/UPGRADE.md)103 only. Its additive-only rule is absolute; do not replay bootstrap.104 The upgrade route loads [SERENA language servers](references/SERENA.md)105 for the additive provisioning step.106- Provisioning Engram on a host with no pi package: read107 [Engram provisioning](references/ENGRAM.md) — detect, ask, register or108 instruct, report. Loaded by the bootstrap write route only (the pi package109 provisions itself, feature 66).110- No named adapter exists for the detected runtime platform: add111 [portability](references/PORTABILITY.md) only for that fallback. Claude Code,112 Cursor, Copilot, and OpenCode are named supported adapters; a missing adapter113 file is repaired by upgrade and does not trigger portability.114115All resources are one hop from this file. Existing files, hook consent,116installation consent, and residual reporting are fixed contracts. Missing117template/migration evidence is reported by the selected route, never filled by118guessing. An existing OpenCode scaffold with only its safety adapter missing119loads exactly upgrade and skips bootstrap plus portability.120121## Charter — what the project is, asked before the substrate122123The consent gates protect **bytes**; the charter captures **what the bytes are124for**. Before the scaffold is adapted, run the two-layer owner interrogation125owned by [bootstrap discovery](references/BOOTSTRAP_DISCOVERY.md) §Charter126interview and written per [bootstrap write](references/BOOTSTRAP_WRITE.md)127step 4:128129- **Identity layer — blocking, never guessed** (project kind, users,130 deployment, license, ceremony-profile seed): an unanswered identity question131 is not a default — it halts through the same `open-questions@1` flow §Consent132 uses.133- **Domain layer — open-with-defaults** (tests/gate, dependency, docs, tooling,134 data/PII, i18n): unanswered items are recorded as **dated assumptions**,135 surfaced by the first unit that needs them, never re-asked, never silent136 defaults.137- **Content rule + landing:** decisions, policies and commands — never138 derivable-from-code description — in the agent guide's `## Project charter`139 section plus the registered criteria catalogue; coverage computed by140 `audit-docs` (check 16), never policed here.141142## Guardrails143144- **Seam hooks are consent-gated and opt-in per seam (issue #413).** The pi145 extension runs project-declared commands at workflow seams only after two146 gates, both explicit: init-workspace's consent marker, and the per-seam147 `"enabled": true` flag in the project's own `.pi/hooks.json`. On an explicit148 yes to "enable workflow seam hooks for this project?", write the consent149 entry into the global store the extension reads —150 `<agentDir>/seam-hooks-consent.json`, a `projects` map keyed by the151 project's absolute path, `{ "consented": true, "consentedAt": <ISO date> }`152 — and create nothing else. `<agentDir>` is pi's global agent directory:153 `getAgentDir()` in the extension, `~/.pi/agent` on a default install (the154 directory holding the unified config files — `agentic-workflow.json` and155 `pi-agentic-workflow.json`; `~/.claude` is not it). Never write or edit `.pi/hooks.json` (the156 developer's declarations, not this skill's), never add the consent entry157 without the project's absolute path, and a no writes nothing. The158 dispatcher's own contract — config form, seam vocabulary, refusal grammar —159 is owned by `@gtrabanco/pi-agentic-workflow`'s README; this skill never160 restates it.161- **The session-log fragment carrier is opt-in, off by default (issue #405).**162 The template ships the documentation (`template/.agentic-workflow/journal.md`)163 and the CI example (`*.yml.example`) — never the carrier directory itself, so164 a wholesale scaffold copy opts nobody in. Offer it as one consented question165 (bootstrap or upgrade): a yes creates `.agentic-workflow/journal/` and166 installs one merge wiring; a no writes nothing — no directory, no workflow,167 no config — and the project keeps today's direct-append journal. The naming168 grammar has one owner (`journal-fragment-grammar@1` in169 `@gtrabanco/agentic-workflow`'s README); this skill never restates it.170- **The docs-site format is a declared choice.** The `Docs site` block's171 `format` slot (`markdown`/`md`, `mdx`/`starlight`/`docusaurus`, `html`,172 `latex`/`tex`) decides what `bun scripts/docs-generate.mjs` renders, so a new173 project is asked for it and an existing one is offered it additively, with174 consent, in upgrade mode. Declining writes nothing; no format means markdown175 with the degradation reported, never a silent default.176- **Never overwrite an existing agent guide (`AGENTS.md`, or a legacy177 `CLAUDE.md`) or `docs/` without explicit consent.**178- **One guide, one name.** `AGENTS.md` is the guide; a legacy `CLAUDE.md` is179 retired only in upgrade mode, only with an explicit yes, and only after any180 content unique to it is folded into `AGENTS.md` first. A user whose Claude181 Code release predates `AGENTS.md` support may keep it — that choice is182 reported as a residual, never treated as drift to repair.183- **Additive-only, never clobber (upgrade mode).** Upgrade mode only adds184 blocks the project lacks and fills raw placeholders — it never rewrites or185 deletes a block the project already tailored, even if the current template186 changed that block too. A genuine re-tailor is a separate, explicitly187 requested bootstrap adapt-in-place run, never something upgrade mode does188 on its own. **The urgency label seeding is additive-only the same way:**189 create a missing `urgent`/`fix-next` label, never touch one that already190 exists (name, color, or description a project already customized).191- **Serena convention — tool and config, one consent question.** `.serena/project.yml`192 is committed; `project.local.yml` and `cache` stay local. Never write193 `.serena/` config, install the tool, register an MCP server or touch the194 global `serena_config.yml` (`trusted_project_path_patterns`) without an195 explicit yes — [SERENA](references/SERENA.md) owns the single question and196 the fixed provisioning report. LSP never verifies documents — false positives197 happen when a file type's server is not listed (markdown/yaml/json are never198 auto-detected), a listed server that fails to start must be removed (one199 failure disables every server in the project), and LSP evidence stays200 TypeScript/JavaScript-only. Document verification is a script's job.201- **Engram provisioning is ask-first, never assumed (feature 66).** Detect the202 `engram` binary, ask before writing any host MCP config, write the absolute203 path with the exact `mcp --tools=agent` argv, and report exactly what was204 written. An existing `engram` declaration is never overwritten, and an absent205 binary is a recorded residual — the documented install route is206 `pi install npm:gentle-engram@latest`, never the CLI's own setup subcommand,207 which keeps serving whatever version ran it until it is re-run.208- **Retrieval index scaffold and git hooks are consent-gated (AC22).** The209 index surface — the committed `.agentic-workflow/index.json` config plus the210 three freshness hooks (`post-merge`, `post-checkout`, `post-rewrite`, all211 `index-sync.sh` installed into `.git/hooks/`) — is installed **only after an212 explicit yes** to the question "install the doc retrieval index scaffold and213 its git hooks?". Without consent: install nothing, record it as a residual214 (the entry point still runs and builds its index on first query — the hooks215 are only a freshness fast path), and never write `.git/hooks/` or the config216 on a later visit without a fresh yes. The hooks are best-effort by contract217 (`doc --sync --quiet`, always exit 0 — a fast path never breaks git).218- **Unified config is offered, never hand-written (issue #427).** One consented219 question offers the project config; a yes runs220 `bunx @gtrabanco/agentic-workflow config init --scope project` (which refuses221 to overwrite), a no writes nothing and records the residual. The two files,222 their scopes, the resolution order and the new-feature policy are owned by223 [CONFIG](references/CONFIG.md); this skill never restates a schema or edits a224 package's extension file.225- **Never redefine the urgency label vocabulary here.** `skills/triage-issue226 /SKILL.md` is the sole owner of the `urgent`/`fix-next` names, colors, and227 apply rules — this skill only seeds those two labels into the repo; it never228 invents a third label or changes what the two mean.229- Docs-only scaffolding; no app code, no dependencies installed unprompted.230- Architecture-agnostic: record the project's pattern, don't impose one.231- Honest placeholders over invented specifics; flag what's left to fill.232- Honor the project's **Workflow conventions** once present; on an existing repo,233 don't work on its default branch and never commit/push unless asked.234235## Unit document conventions (the adaptive lane)236237The adaptive lane replaces the fixed pipeline with a single-unit-document model.238Every NEW unit produces one `SPEC.md` under `docs/features/<NN>-<slug>/`, cut in239the **`spec-by-reference`** shape the template ships: `Specs` (numbered `S#`, each240quoting the requester's words verbatim), Impact, Non-goals, Future cost,241Applicable tests, Known pre-existing issues, `Tasks` (each bullet linked to the242`S#` it delivers), `Findings` (OPEN rows only), `Log` (append-only; `L1` is the243request verbatim), Next, References. A unit opened before this shape keeps the244legacy 14-section shape — Objective, Why, User outcome, Acceptance criteria,245Impact, Non-goals, Future cost, Applicable tests, Known pre-existing issues,246Tasks, Evidence, Progress log, Next, References — and is never rewritten to247migrate.248249Conventions written into the project's AGENTS.md:250251- **Triage**: the lane conductor (`/unit-lane` / `workflow-status`) returns a252 deterministic ordered list of steps (research, design, plan, implement,253 tests, evidence, review, docs, release).254- **Guards**: `scripts/diff-guard.mjs` measures `git diff --stat` at boundaries;255 overflow → mandatory re-triage. Anti-gaming: "NEVER shrink a diff by deleting256 comments, blank lines, docs or tests."257- **Evidence rows**: one per AC — what was run, exit/digest, output (≤2 lines),258 verified-by. Verified, not claimed.259- **Progress log**: dated entries (`YYYY-MM-DD HH:MM`) per step taken.260- **Commit format**: `type(scope): description` (conventional commits).261- **Roadmap status**: `idea → defined → planned → in-progress → done`.262263These are written by bootstrap (fresh) and upgrade mode (additive-only for pre-264lane installs). A pre-lane project gets only: the lane conventions section in265AGENTS.md, the unit doc templates under `docs/features/_TEMPLATE/` and266`docs/fix/_TEMPLATE/`, and the docs-map rows for them.267268## Normalized Repository State269270Seed `docs/workflow/REPOSITORY_STATE.md` from the template. Explain that271discovery freezes evidence before planning and only the resolver updates facts.272273## Architectural invariants274275Offer `docs/architecture/ARCHITECTURAL_INVARIANTS.md` as an optional project276contract for long-lived architectural rules. Its entries must name a stable ID,277repository evidence, and the authority that can change the rule. Do not infer a278rule from the implementation or a feature SPEC. A project without this document279remains compatible; record `n/a: no project invariants declared` in later280workflow artifacts rather than creating one silently.281282283## Portability284285The scaffold is vendor-neutral; only hook activation differs. When the detected286agent has no named adapter, follow [portability](references/PORTABILITY.md) and287keep it as an explicit residual. A supported Claude Code, Cursor, Copilot, or288OpenCode adapter does not load this fallback.289290## Relationship to other skills291292- `npx degit gtrabanco/agentic-workflow/template` — the static copy this skill293 adapts. Use that when you want the raw scaffold and will fill it yourself.294- `docs/workflow/PORTABLE_PROMPT.md` — regenerates the **skills** adapted to a295 project (behavior). This skill adapts the **substrate** (docs). Complementary.296- After init: `discover-repository-state` → `workflow-status` (to see what's297 startable) → `/unit-lane` (the lane conductor); run `audit-docs` to confirm298 the scaffold is coherent.299300## Done when301302- A tailored `AGENTS.md` + `docs/` scaffold + `.github/` templates exist in the303 target, unused folders pruned, residual placeholders flagged, the platform's304 companion review skills are recorded (and offered), and the `urgent`/305 `fix-next` labels are seeded (scaffold) or additively reconciled (upgrade),306 and every accepted safety adapter is active and fixture-tested — or explicitly307 listed as a residual when its hook API/dependency was unavailable.308 The adaptive lane conventions (unit document, triage, catalog steps, guards,309 evidence, commit formats) are written into AGENTS.md.310- Serena is provisioned and reported: the one consent question was asked, the311 project config written (or skipped with its reason), the tool installed and its312 MCP server registered for the detected platform — or each refused/absent item313 recorded as a residual with its reason — and the fixed provisioning report314 states the health check per listed server and the index result. The run315 completes either way.316- **The closing `→ Next:` block is printed** (plus the offer to install the skills):317318 ```319 → Next: /discover-repository-state — freeze repository evidence before planning320 · raw idea → /workflow-status → /unit-lane (the lane conductor)321 · next roadmap entry → /unit-lane (tridirection decides catalog steps)322 · confirm the scaffold is coherent → /audit-docs323 ```