armelhbobdad/oh-my-skills / .claude/skills/skf-create-stack-skill
skf-create-stack-skill
VerifiedConsolidated project stack skill with integration patterns — code-mode (analyzes manifests) or compose-mode (synthesizes from existing skills + architecture doc). Use when the user requests to "create a stack skill", "forge a stack", or "stack this project".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.8 KB |
| assets/metadata-contract.md | markdown | 2.0 KB |
| assets/provenance-map-schema.md | markdown | 5.7 KB |
| assets/stack-skill-template.md | markdown | 5.8 KB |
| customize.toml | config | 2.9 KB |
| references/compile-stack.md | markdown | 8.8 KB |
| references/compose-mode-rules.md | markdown | 4.9 KB |
| references/detect-integrations.md | markdown | 20.2 KB |
| references/detect-manifests.md | markdown | 9.0 KB |
| references/generate-output.md | markdown | 20.9 KB |
| references/health-check.md | markdown | 884 B |
| references/init.md | markdown | 13.7 KB |
| references/integration-patterns.md | markdown | 2.1 KB |
| references/invocation-contract.md | markdown | 6.2 KB |
| references/manifest-patterns.md | markdown | 6.6 KB |
| references/parallel-extract.md | markdown | 17.8 KB |
| references/rank-and-confirm.md | markdown | 8.8 KB |
| references/report.md | markdown | 9.1 KB |
| references/validate.md | markdown | 13.6 KB |
references/invocation-contract.md
View on GitHub# Invocation Contract
The headless contract of Stack Skill: its inputs, gates and outputs, the exit code and `halt_reason` of every HARD HALT, and the result envelope. A halting step names its exit code, `halt_reason` and phase and shows the emit command, so it needs nothing else from this file.
| Aspect | Detail |
|--------|--------|
| **Inputs** | All optional; step 1 binds and checks each one, and halts with `input-invalid` on a value it cannot use. `project_path`: the folder code mode scans (default: the project root; an interactive run asks once when the manifests sit in several folders). `skills`: the libraries to rank, or the constituent skills in compose mode. `stack_name`: the stack's skill name (default `{project_name}-stack`). `scope_overrides`: step 3 scope overrides. `architecture_doc_path`: the document compose mode reads. `mode`: `code` or `compose` (default: step 1 detects it) |
| **Gates** | step 1: compose suggestion [accept] and scan scope [A] (each asked only in an interactive run; headless takes the default and records it); step 2: no manifest found (headless: HALT `no-manifests`, exit 2); step 3: scope gate [C]; step 6: review gate [C] |
| **Outputs** | SKILL.md (stack), context-snippet.md, metadata.json; `provenance-map.json` and `evidence-report.md` in `{forge_version}`; the result contract, `create-stack-skill-result-{YYYYMMDD-HHmmss}.json` and its `create-stack-skill-result-latest.json` copy in `{forge_version}`, with the `-latest` copy also at the stack group root `{forge_data_folder}/{stack_name}/`; a run folder under `{project-root}/_bmad-output/.skf-run/`, deleted when the run finishes or the user cancels and kept after any other HALT |
| **Headless** | All gates auto-resolve with their default action when `{headless_mode}` is true, and each records its decision in the run sink, so the envelope's `headless_decisions` lists every one. A caller reads the run's own `SKF_STACK_RESULT_JSON` line. A run that printed no envelope line has no result to read, whatever the process exit code: it was cut off, or could not write its result, and each `create-stack-skill-result-latest.json` copy may then describe an earlier run, so neither is read in its place. |
| **Exit codes** | See "Exit Codes" below |
## Exit Codes
Every HARD HALT in this workflow exits with a stable code so headless automators can branch on the failure class without grepping message text:
| Code | Meaning | Raised by (halt_reason) |
| ---- | -------------------- | ------------------------------------------------------------------------------------------ |
| 0 | success | step 10 (terminal handoff to shared health-check) |
| 2 | input / precondition invalid | step 1 §0 `config.yaml` missing/malformed (`config-missing`); step 1 §0 or §3 an input it cannot use (`input-invalid`); step 2 §2 headless with no manifests (`no-manifests`, S2); step 4 §3 all extractions failed (`all-extractions-failed`, B7); step 5 §2 a feasibility report of another `schemaVersion` (`schema-version-mismatch`) or with a verdict token outside the schema's set (`unknown-verdict-token`) |
| 3 | resolution-failure | step 1 §1 `forge-tier.yaml` missing (`forge-tier-missing`); a shared helper that resolves to no path (`helper-missing`): `skf-emit-result-envelope.py` (step 1 pre-flight), `skf-validate-frontmatter.py` (step 1 §0), `skf-scan-manifests.py` or `skf-enumerate-stack-skills.py` (step 1 §3, step 2 §0 and §2, step 4 §0), `skf-count-imports.py` (step 3 §1), `skf-render-stack-metadata.py` (step 4 §3a, step 5 §3, step 6 §1, step 7 §6), `skf-pair-intersect.py` (step 5 §1), `skf-comention-pairs.py` (step 5 §2), `skf-atomic-write.py` (step 7 §1); step 2 §0 compose-mode stale manifest (a manifest key whose skill folder is gone) or zero qualifying skills (S1/B4), step 4 §0 compose cycle among confirmed skills or a confirmed skill no longer an SKF package (`resolution-failure`) |
| 4 | write-failure | step 1 pre-flight: the run folder cannot be created; step 7: a stage-dir, write or commit-dir failure (the §1 rollback contract), or a group-dir collision when an existing non-stack skill occupies the target path (`write-failure`) |
| 5 | state-conflict | step 7 §1 ownership check (S3, both phases): the stack's folder in skills_output_folder, or the version folder this run writes, is not SKF output or SKF cannot check it (`not-skf-output`); an SKF stack still in the flat layout (`flat-layout`) |
| 6 | user-cancelled | step 2 §2 option 3 (no manifests, interactive); `[X]` Cancel and exit at the step 3 scope gate or the step 6 review gate (`user-cancelled`) |
## Result Contract (Headless)
The shared emitter, `skf-emit-result-envelope.py`, builds every `SKF_STACK_RESULT_JSON: {...}` line from the payload a step stages in `{run_dir}`, folds in the decisions and warnings the run recorded there, derives `exit_code` from `halt_reason`, stamps `run_id` and `result_path`, and checks the line against `shared/scripts/schemas/skf-stack-result-envelope.v1.json` (installed under `{project-root}/_bmad/skf/`), whose descriptions say what each field holds. Never type the line yourself. Every HARD HALT prints one on **stderr**, in every mode, with `status: "error"`, except the `init:emitter` halt, which has no emitter to print one; step 9 prints the success line on **stdout** and displays it when `{headless_mode}` is true, before chaining to step 10:
```
SKF_STACK_RESULT_JSON: {"status":"success|error","skill_package":"...|null","skill_name":"...","stack_libraries":["..."],"mode":"code|compose","quality_score":null,"exit_code":0,"halt_reason":null,"run_id":"...","result_path":"...|null","headless_decisions":[],"warnings":[]}
```
A halt adds `error`: its `phase`, its message as `reason`, and `path` when it names a file or folder. A success line adds `security_result`, the outcome of step 8 §9's security scan (`pass`, `warn` or `skipped`); a halt leaves it out. When the customization resolver could not run, `warnings` holds `[activation/warn] customization_resolver_unavailable: <reason>`, which step 1 records before any other warning: the run used the bundled `customize.toml` alone, without the `{project-root}/_bmad/custom/` overrides.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |