with one click
corgispec-install
// Use when installing, updating, or verifying this repo's project-local OpenSpec GitFlow assets in a target project.
// Use when installing, updating, or verifying this repo's project-local OpenSpec GitFlow assets in a target project.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | corgispec-install |
| description | Use when installing, updating, or verifying this repo's project-local OpenSpec GitFlow assets in a target project. |
| license | MIT |
| compatibility | Requires openspec CLI. |
| metadata | {"author":"openspec","version":"1.0","generatedBy":"1.3.0"} |
Install, update, or verify project-local OpenSpec GitFlow assets.
Use this skill to set up or maintain the repo-managed OpenSpec workflow files inside a target project.
This installer manages:
/corgi-* commands work in every repo)corgispec-* skills must already be installed at user level before this skill runs.
openspec initDo not use this skill to create feature artifacts, review implementation work, or archive a change.
gitlab-tracked or github-trackedcorgi-*.md dispatch files to:
~/.config/opencode/commands/corgi-*.md~/.claude/commands/corgi/*.mdopenspec/.corgi-install.jsonopenspec/.corgi-install-report.mdopenspec/.corgi-backups/<timestamp>/ when backup is neededDo not overwrite locally modified managed files — stop with a diff and let the user decide.
Why user-level commands? Without them,
/corgi-*commands only exist in repos where you've run the installer. User-level install makes them available in every repo after a single installation.
| Mode | Mutates Files | Expected Output |
|---|---|---|
| Fresh install | Yes | managed files + manifest + report |
| Managed update | Yes | updated managed files + refreshed manifest + report |
| Legacy install | Maybe | backup prompt, then manifest + report if approved |
| Verify-only | Report only | report + checks, no managed-file or config mutations |
Managed fileset (project-local):
.opencode/commands/corgi-*.md.claude/commands/corgi/*.mdopenspec/schemas/{selected-schema}/**Managed fileset (user-level):
~/.config/opencode/commands/corgi-*.md~/.claude/commands/corgi/*.mdRequired user-level skills:
~/.claude/skills/corgispec-*~/.config/opencode/skill/corgispec-*Runtime artifacts:
openspec/.corgi-install.jsonopenspec/.corgi-install-report.mdopenspec/.corgi-backups/<timestamp>/openspec/config.yaml.openspec/config.yaml:
schemaisolation.modeisolation.rootisolation.branch_prefixcorgispec-* skills as a prerequisite failure..opencode/commands/corgi-propose.md, it takes precedence over the user-level one. OpenCode and Claude resolve project-local before user-level.Before any mode runs, verify the required tools are available:
openspec --version
If the user is working with a github-tracked schema:
gh auth status
If the user is working with a gitlab-tracked schema:
glab auth status
Verify the required user-level skills are already installed:
~/.claude/skills/corgispec-*~/.config/opencode/skill/corgispec-*If any required tool is missing, unauthenticated, or the required user-level skills are absent, stop and report the failure in the report before proceeding. Tell the user to run the repo's global installer script before retrying.
Use when the target project has no managed fileset and no manifest.
Validate prerequisites
openspec --version — stop if not foundgh auth status or glab auth status depending on intended schema — stop if unauthenticated~/.claude/skills/corgispec-* and ~/.config/opencode/skill/corgispec-* exist — stop if missingopenspec/config.yaml exists in the target project — stop if missingAsk for target project path
openspec/config.yamlAsk for schema choice
gitlab-tracked or github-tracked"Ask whether to enable worktree isolation
isolation.root (default: .worktrees) and isolation.branch_prefix (default: feat/)4b. Ask whether to initialize memory structure
--no-memory flag: skip this prompt and do not initialize memoryCopy project-local managed fileset from source repo to target
Copy each of the following from the source repo (this repo) to the target project:
.opencode/commands/corgi-*.md → target .opencode/commands/corgi-*.md.claude/commands/corgi/*.md → target .claude/commands/corgi/*.mdopenspec/schemas/{selected-schema}/** → target openspec/schemas/{selected-schema}/**Create destination directories as needed. Do not delete any unmanaged files in the target.
5b. Install user-level commands (global, all repos)
Copy the same `corgi-*.md` command dispatch files to user-level directories so they are available in every repo:
- `.opencode/commands/corgi-*.md` → `~/.config/opencode/commands/corgi-*.md`
- `.claude/commands/corgi/*.md` → `~/.claude/commands/corgi/*.md`
Create destination directories as needed.
> **Why both project-local and user-level?** Project-local files let individual repos override commands. User-level files provide the default so every repo has `/corgi-*` even without running the installer.
6. Patch openspec/config.yaml
Read the existing openspec/config.yaml in the target project. Update only these keys:
schema — set to the chosen schemaisolation.mode — set to worktree or none based on user choiceisolation.root — set if worktree enabledisolation.branch_prefix — set if worktree enabledDo NOT replace the whole file. Preserve all other keys (e.g., context, rules).
Compute SHA-256 hashes for project-local files
For each file copied in step 5 (project-local only), compute its SHA-256 hash:
sha256sum <file>
User-level commands are not hashed in the manifest — they are refreshed on every update.
Write openspec/.corgi-install.json manifest
Write the manifest with all copied file paths and their hashes. See Manifest Format.
Generate openspec/.corgi-install-report.md
Write the report with mode, timestamp, source repo, target project, and per-check status. See Verification Report.
Initialize memory structure (unless opted out)
If the user chose to initialize memory in Step 4b (or did not pass --no-memory):
memory/ and wiki/ directories with template files--no-memory was specified or user declined: skip this step entirelyUse when the target project already has openspec/.corgi-install.json.
Validate prerequisites
openspec --version — stop if not foundgh auth status or glab auth status as appropriate — stop if unauthenticated~/.claude/skills/corgispec-* and ~/.config/opencode/skill/corgispec-* exist — stop if missingRead existing openspec/.corgi-install.json
For each managed file: compare current hash vs manifest hash
If ANY managed file differs from its manifest hash → abort
diff <source-file> <target-file>
openspec/.corgi-install-report.mdIf all managed files are clean → proceed with update
openspec/.corgi-install.json with new hashes and updated updatedAt timestampopenspec/.corgi-install-report.mdUse when managed files exist in the target project but no openspec/.corgi-install.json is present.
Detect legacy state
.opencode/commands/corgi-propose.md is present)openspec/.corgi-install.json does NOT existDisplay legacy classification to user
Create backup
openspec/.corgi-backups/<timestamp>/Ask user for explicit approval before migration
openspec/.corgi-backups/<timestamp>/. (yes/no)"If approved → proceed as fresh install, then write manifest
If declined → abort, write report only
openspec/.corgi-install-report.md with mode legacy-install, status aborted, and a note that the user declined migrationUse when the user wants a health check without any file mutations.
Check prerequisites
openspec --version — record PASS or FAILgh auth status or glab auth status as appropriate — record PASS, FAIL, or SKIP~/.claude/skills/corgispec-* and ~/.config/opencode/skill/corgispec-* exist — record PASS or FAILCheck project-local managed fileset presence and integrity
openspec/.corgi-install.json exists: also compare current SHA-256 hashes against manifest hashes2b. Check user-level commands presence
- Check whether ~/.config/opencode/commands/corgi-*.md and ~/.claude/commands/corgi/*.md exist
- Record PASS if all present, FAIL if any missing (WARN if user-level commands are missing but project-local ones exist — project-local will still work, but other repos won't have them)
Check openspec/config.yaml has required fields
schema field is present and set to a known valueCheck schema directory exists
openspec/schemas/{schema}/ exists and contains schema.yamlopenspec/.corgi-install-report.md with all check resultsNO managed-file mutations. NO backups. NO config changes. This mode may write the verification report only.
The report at openspec/.corgi-install-report.md uses this format:
| Check | Status | Detail | |---|---|---|---| | openspec CLI | PASS/FAIL | version or error | | gh/glab CLI | PASS/FAIL/SKIP | version or error | | User-level skills | PASS/FAIL | Claude/OpenCode skill paths checked | | User-level commands | PASS/FAIL/WARN | OpenCode/Claude command paths checked | | Schema directory | PASS/FAIL | path checked | | Config file | PASS/FAIL | fields present | | Managed files | PASS/FAIL | N/M project-local files synced |
For end-to-end validation scenarios covering fresh install, managed update, local modifications, verify-only, legacy install, and the worktree prompt, see .sisyphus/plans/corgi-install-smoke-matrix.md.
The manifest at openspec/.corgi-install.json:
{
"version": 1,
"installedAt": "ISO-8601",
"updatedAt": "ISO-8601",
"sourceRepo": "/path/to/ds-internal-skills",
"schema": "gitlab-tracked",
"isolation": { "mode": "none" },
"files": {
".opencode/commands/corgi-propose.md": { "sha256": "abc123..." },
".opencode/commands/corgi-install.md": { "sha256": "def456..." },
".claude/commands/corgi/propose.md": { "sha256": "ghi789..." },
"openspec/schemas/gitlab-tracked/schema.yaml": { "sha256": "jkl012..." }
}
}
installedAt — set on first write, never changed on updateupdatedAt — refreshed on every managed updatefiles — keyed by path relative to the target project root; value is the SHA-256 of the file as installedopenspec/config.yaml instead of patching only managed keysgh auth status or glab auth status before a write operationcorgispec-* skills are user-level prerequisites, not project-local managed files--no-memory was specified