---
name: deploy
description: >
  Multi-phase orchestrator for landing the operating-model kit into a fresh environment and
  for re-running the orchestration when rescaffold triggers fire. Five phases - bootstrap
  (load brief, orient), discovery (extensive recursive questioning via architect-discovery
  skill), scaffold (render templates against gathered context), operate (the deployed
  instance runs), rescaffold (revisit affected scope on trigger via architect-rescaffold
  skill). Triggered when the operator says: deploy this kit, land the operating model here,
  set up a new instance, bootstrap the architecture, run the deployment, drop the kit.
  Refuses to skip the discovery phase even when the operator wants speed; defaults inform
  but never silently skip; honest unknowns are first-class and produce rescaffold triggers.
  Pairs with architect-discovery (Phase 2), architect-rescaffold (Phase 5), validate (final
  audit before any phase declares complete).
---

# deploy

Multi-phase orchestrator. Five phases (bootstrap, discovery, scaffold, operate, rescaffold). The first scaffold runs Phases 1-3 + initial validate; operate is the steady state; rescaffold runs Phases 2-3 again on affected scope when triggered.

## When to invoke

- Operator drops the deployment kit into a fresh environment (run all phases through to declared first-scaffold complete)
- Operator says: "deploy this kit", "land the operating model here", "bootstrap a new instance", "set up the architecture", "run the deployment", "drop the kit"
- A fresh Cowork / Claude Desktop / Claude Code session with the kit unpacked, no prior instance state
- Periodic re-deploy after kit version bump (the deployed instance mirrors the new kit)

For rescaffold-only invocations (operating-mode session that needs to rescaffold a specific layer), invoke `skills/architect-rescaffold/SKILL.md` directly rather than going through this skill.

## The five phases

### Phase 1: Bootstrap

Load the operating-model standard. Orient the operator on what the kit is, what the deployment will produce, what time commitment to expect.

1. Confirm kit contents intact (per Step 0 below)
2. Read BOOTSTRAP-BRIEF.md in full
3. State to the operator: "Loading operating-model standard from BOOTSTRAP-BRIEF.md. This is the constitution every deployed instance operates by. The first scaffold takes 30 to 90 minutes typically. Subsequent rescaffolds are lighter and triggered by specific events. Honest unknowns are first-class; we capture and revisit them. Beginning discovery."

### Phase 2: Discovery

Invoke `skills/architect-discovery/SKILL.md` (Mode A: first-scaffold discovery) for a recursive question-asking conversation. Discovery asks the orientation base set (~10 questions covering the eight layers + governance + function-mode adaptation) plus follow-ups freely as gaps surface. Discovery captures answers to LOCALIZATION-ANSWERS.md, surfaces honest unknowns as rescaffold triggers, and ends with a confirmed rescaffold trigger queue.

Refuse to skip Phase 2 even when the operator wants speed. The hard discipline carries forward from V1; the altitude is just different (recursive, not fixed).

### Phase 3: Scaffold

Render templates against gathered context. Per `templates/README.md` rendering order:

1. L0-strategy.md -> `{instance_root}/policies/strategy.md`
2. L1-brand-posture.md -> `{instance_root}/policies/brand-posture.md` (mark N/A explicit if Q1 type internal)
3. L2-philosophy.md -> `{instance_root}/policies/philosophy.md`
4. L3-framework-contract.md -> `{instance_root}/policies/framework-contract.md`
5. L4-platform-kit.md -> `{instance_root}/kit/PLATFORM-KIT.md` (select Q6-posture branch)
6. L7-cross-platform-glue.md -> `{instance_root}/cross-platform/L7-glue.md`
7. L5-instance-dossier.md -> `{instance_root}/platforms/{platform}/dossier.md` (one per Q7 instance)
8. inbox-topology.md -> `{instance_root}/inbox-topology.md`
9. handoff-template.md -> `{instance_root}/HANDOFF.md`
10. OPERATING-MODEL-template.md -> `{instance_root}/OPERATING-MODEL.md`
11. ADR-template, session-log-template, MATURITY-SCORECARD-template copied as canonical shapes

Plus: scaffold the supporting structure (CLAUDE.md, BACKLOG.md, inbox/SCHEMA.md, outbox/, runbooks/, decisions/).

If Q6 posture is `greenfield`: scaffold the L4 kit subtree per the L4 template's Branch A.

If Q6 indicates an org-local skill repository exists: invoke `skills/architect-kit-mirror/SKILL.md` to perform recursive skill population from the org-local repo, with org-local taking precedence over kit-bundled equivalents.

If Q1 indicates function-mode is `operating` or `deciding` or `creating`: weight the rendered templates accordingly (lighter L4 for non-builders; heavier ADR practice for `deciding`; etc.).

If Q10 names organizational rhythms: align the deployed instance's Doc Lifecycle cadences to those rhythms.

After rendering, run `skills/validate/SKILL.md` for the initial audit. Validate produces the first MATURITY-SCORECARD.md plus any rescaffold triggers it detects.

### Phase 4: Operate

The deployed instance runs. The operator and any other actors operate by BOOTSTRAP-BRIEF discipline. Sessions log per `architect-handoff` skill. Decisions land via `architect-adr` skill. Inbox-outbox pairs drain per cadence via `architect-inbox-flow` skill. Eval baselines + reproducibility + guardrails operate per their respective skills.

Operating-mode sessions can produce rescaffold triggers; these append to the queue for Phase 5 to address.

This phase has no fixed runtime; it is the steady state.

### Phase 5: Rescaffold

When a rescaffold trigger fires (validate finding, session-log evidence, calendar cadence, kit version bump, or any of the triggers in BOOTSTRAP-BRIEF Section XVII), invoke `skills/architect-rescaffold/SKILL.md` to drive the cycle.

Rescaffold runs Phase 2 (discovery in Mode C: targeted question-asking) and Phase 3 (scaffold of affected scope only) on the surfaces the trigger affected. Then Phase 4 resumes.

Rescaffolds are typically lighter than the first scaffold (10-30 min vs. 30-90 min). The kit gets stronger across rescaffolds because each one incorporates context that did not exist at prior scaffold time.

## Step 0: Confirm kit contents intact

Verify the kit has these load-bearing artifacts present and readable:

- `BOOTSTRAP-BRIEF.md`
- `QUESTIONS.md`
- `KICKOFF.md`
- `TERMS.md`
- `PHILOSOPHY.md`
- `templates/` (15+ files including README)
- `examples/martech-mature-instance/`
- `decisions/` (ADR-0001 through ADR-0006)
- `skills/architect-discovery/`, `skills/architect-rescaffold/`, `skills/validate/`, `skills/architect-kit-mirror/` (and the rest of the kit-native skills)

If any are missing, refuse to proceed; report the gap.

## Step-by-step (first deployment)

The full first-deployment sequence orchestrating Phases 1, 2, 3:

1. **Phase 1 (bootstrap):** Confirm contents; read BOOTSTRAP-BRIEF; state intent to operator
2. **Phase 2 (discovery):** Invoke `architect-discovery` Mode A; capture answers + follow-ups; close with confirmed rescaffold trigger queue
3. **Phase 3 (scaffold):** Render templates per dependency order; scaffold supporting structure; if applicable, invoke `architect-kit-mirror` for org-local-skill recursive population; align cadences to org rhythms; weight templates by function-mode
4. **Initial validate:** Run validate; produce first MATURITY-SCORECARD; capture findings + rescaffold triggers
5. **Declare first-scaffold complete:** Per BOOTSTRAP-BRIEF Section XVI five-step test (read brief; engaged recursive question gate; produced initial scaffold with eight layers classified, honest unknowns named, rescaffold trigger queue confirmed; refuses to declare any layer "complete" without evidence; begins operating)

A first-scaffold landing that produces an initial scaffold with `partial` or `stubbed` layers is a successful landing, not a failed one. Maturity arrives through operation and rescaffold cycles, not at landing.

## Refusal conditions

- Refuse to skip Phase 1 even when the operator wants to "just answer the questions"
- Refuse to skip Phase 2 even when the operator wants to "use defaults for everything"
- Refuse to skip Phase 3 validate even when the operator wants to "go straight to operating"
- Refuse to declare first-scaffold complete without all five Section XVI steps passing
- Refuse to ignore the rescaffold trigger queue at Phase 5 boundary
- Refuse to render templates without the function-mode answer (Q1 extension)
- Refuse to mark Q6 org-local-skill-repository answer as decided without confirming with the operator whether org-local takes precedence

## Behaviors during deployment

- **Self-update at start of every invocation.** Re-read BOOTSTRAP-BRIEF.md even if cached. The brief evolves; cached behavior drifts.
- **Explain progressively.** Phase 1's bootstrap message + Phase 2 discovery's per-question framing make the kit's purpose clear as it operates.
- **Trace learning.** Every rescaffold archives the prior MATURITY-SCORECARD; the deployed instance can read its own history.
- **Defer rather than guess.** Honest unknowns at any phase are first-class.

## Cross-references inside the kit

- `BOOTSTRAP-BRIEF.md` - the standard
- `QUESTIONS.md` - orientation base set + recursive follow-up patterns
- `KICKOFF.md` - the paste-and-run prompt for Cowork
- `TERMS.md` - vocabulary
- `PHILOSOPHY.md` - the three cardinal insights and continuous-rescaffolding rationale
- `templates/README.md` - rendering order + question-to-template maps
- `templates/` - the layer + governance templates this skill renders
- `examples/martech-mature-instance/` - the reference for "what good looks like"
- `decisions/ADR-0001-polymorphic-single-kit.md` - V1 architecture decision
- `decisions/ADR-0002-self-contained-export.md` - the self-containment constraint
- `decisions/ADR-0004-recursive-question-discipline.md` - V1.1 question discipline (supersedes ADR-0003)
- `decisions/ADR-0005-continuous-rescaffolding.md` - V1.1 architecture (multi-phase orchestrator)
- `decisions/ADR-0006-function-adaptation.md` - function-mode adaptation + org-local-skill-population + rhythm-alignment
- `skills/architect-discovery/SKILL.md` - invoked in Phase 2
- `skills/architect-rescaffold/SKILL.md` - invoked in Phase 5
- `skills/validate/SKILL.md` - invoked in Phase 3 final audit
- `skills/architect-kit-mirror/SKILL.md` - invoked for org-local-skill-population in Phase 3
- `skills/architect-adr/SKILL.md` - used to scaffold initial ADR stubs based on Q1, Q4, Q6
- `skills/architect-lifecycle/SKILL.md` - used to add Doc Lifecycle frontmatter to scaffolded artifacts
