一键导入
openspec-bootstrap-opsx
Bootstrap OPSX architecture map from existing codebase using a structured five-phase workflow (init → scan → map → review → promote).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Bootstrap OPSX architecture map from existing codebase using a structured five-phase workflow (init → scan → map → review → promote).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a completed change after implementation is complete.
Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.
Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
Manage version sync, release commits, tags, pushes, and post-release verification for the cc-switch fork. Use when the user asks to bump or align versions, cut a new release, create or push a tag, verify GitHub Actions or Releases, or troubleshoot why a build artifact did not appear in the release for this repository.
| name | openspec-bootstrap-opsx |
| description | Bootstrap OPSX architecture map from existing codebase using a structured five-phase workflow (init → scan → map → review → promote). |
| license | MIT |
| compatibility | Requires openspec CLI. |
| metadata | {"author":"openspec","version":"2.0","generatedBy":"1.2.0-cpyu.9"} |
Bootstrap the OPSX architecture map from the existing codebase.
This is a structured, multi-phase workflow. Each phase produces intermediate artifacts in openspec/bootstrap/ before writing formal OPSX files.
Treat openspec/config.yaml as the source of truth for authoring policy, but consume its compiled projection semantics: prose-bearing bootstrap artifacts follow the projected documentation language policy, while canonical headings, IDs, schema keys, paths, and commands stay unchanged.
Input: No argument required. Scope hints (folders, domain names) are passed to init.
Steps
Determine current phase
openspec bootstrap status --json
openspec bootstrap init --mode refresh --restartExecute the current phase
Get phase-specific instructions:
openspec bootstrap instructions [phase] --json
Phase: init
openspec bootstrap init --mode full
Creates workspace at openspec/bootstrap/ with scope configuration.
Supported upgrade paths:
specs-based -> fullraw -> fullraw -> opsx-firstformal-opsx -> refresh
Use opsx-first only for raw repositories when you want the formal OPSX bundle plus a README-only specs starter now, and full behavior specs later.
Use refresh only for repositories that already have the formal OPSX bundle and need a delta-first refresh that merges reviewed changes back into the existing formal files.
Use --restart only when a completed retained workspace already exists and you want a fresh run; it snapshots the old openspec/bootstrap/ into openspec/bootstrap-history/ first.Phase: scan
package.json, README, OpenSpec config, openspec/specs/openspec/bootstrap/evidence.yaml with candidate domains:
domains:
- id: dom.cli
confidence: high
sources: [code:src/cli/, spec:openspec/specs/cli/]
intent: CLI entry point and command routing
- Run `openspec bootstrap validate` to verify gates
- In `refresh`, treat the current formal OPSX bundle as the baseline and use git diff only to narrow scan scope when a stored anchor commit is still reachable
**Phase: map**
- For each domain in evidence.yaml, create `openspec/bootstrap/domain-map/<domain-id>.yaml`:
```yaml
domain:
id: dom.cli
type: domain
intent: CLI entry point and command routing
status: active
capabilities:
- id: cap.cli.init
type: capability
intent: Initialize OpenSpec in a project
status: active
relations:
- from: cap.cli.init
to: dom.cli
type: contains
code_refs:
- id: cap.cli.init
refs:
- path: src/core/init.ts
line_start: 1
openspec bootstrap status to track per-domain progressopenspec bootstrap validate after all domains mappedPhase: review
evidence.yaml and domain-map/*.yamlrefresh, review the delta summary against the current formal OPSX baseline instead of re-approving the whole modelPhase: promote
openspec bootstrap promote -y
Re-validates all upstream gates before writing.
opsx-first: writes the formal OPSX three-file bundle plus only openspec/specs/README.mdfull on raw: writes the formal OPSX bundle plus one validated spec per mapped capabilityfull on specs-based: preserves existing specs, adds only missing capability specs, and fails fast on target-path conflictsrefresh on formal-opsx: merges the reviewed delta into the existing formal OPSX bundle, preserves existing specs, adds only missing specs for newly added capabilities, and fails fast on conflicts
Retains the bootstrap workspace on success for audit history.
Start the next refresh run with openspec bootstrap init --mode refresh --restart, which snapshots the retained workspace into openspec/bootstrap-history/.After each phase action
openspec bootstrap validate to verify gate conditionsopenspec bootstrap status to confirm phase advancementEvidence Guidelines
Mapping Guidelines
cap.<domain>.<action> conventionGuardrails