skf-create-stack-skill
Skill7 starsChanged 7 days agoApache-2.0View on GitHub
Consolidated 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".
In this repository38 other files it gives its agents.
- _skf-learn/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- bmad-advanced-elicitationSkill
- bmad-brainstormingSkill
- bmad-cis-agent-brainstorming-coachSkill
- bmad-cis-agent-creative-problem-solverSkill
- bmad-cis-agent-design-thinking-coachSkill
- bmad-cis-agent-innovation-strategistSkill
- bmad-cis-agent-presentation-masterSkill
- bmad-cis-agent-storytellerSkill
- bmad-cis-design-thinkingSkill
- bmad-cis-innovation-strategySkill
- bmad-cis-problem-solvingSkill
- bmad-cis-storytellingSkill
- bmad-distillatorSkill
- bmad-editorial-review-proseSkill
- bmad-editorial-review-structureSkill
- bmad-helpSkill
- bmad-index-docsSkill
- bmad-party-modeSkill
- bmad-review-adversarial-generalSkill
- bmad-review-edge-case-hunterSkill
- bmad-shard-docSkill
- skf-analyze-sourceSkill
- skf-audit-skillSkill
- skf-brief-skillSkill
- skf-campaignSkill
- skf-create-skillSkill
- skf-drop-skillSkill
- skf-export-skillSkill
- skf-forgerSkill
- skf-quick-skillSkill
- skf-refine-architectureSkill
- skf-rename-skillSkill
- skf-setupSkill
- skf-test-skillSkill
- skf-update-skillSkill
- skf-verify-stackSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Only load one step file at a time — never preload future steps
- Distinctive: line 34
Never write into a skill folder SKF did not generate — generate-output §1 runs the inventory's write check before any prior metadata is …
- Very specific: line 35
Always communicate in {communication_language}
- Very specific: line 36
If {headless_mode} is true, auto-proceed through confirmation gates with their default action, and record each auto-decision in the run …
- Very specific: line 37
Every HARD HALT names its exit code, halt_reason and phase, and prints its envelope through the shared emitter with the command its step …
- Very specific: line 79
Explicit disable wins: If --headless=false or --no-headless was passed, {headless_mode} is false regardless of any preference.
- Very specific: line 80
Explicit enable next: If --headless or -H was passed (without =false), {headless_mode} is true.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Stack Skill
Overview
Produces a consolidated stack skill documenting how libraries connect. Code-mode analyzes dependency manifests and co-import patterns from actual source code. Compose-mode synthesizes from pre-generated individual skills and architecture documents when no codebase exists yet. Every finding must trace to actual code with file:line citations; in compose-mode, inferred integrations are permitted but must be labeled [inferred from shared domain].
Conventions
- Bare paths (e.g.
references/<name>.md) resolve from the skill root, inside areferences/file too: only a stage's frontmatternextStepFilenames a file beside it. - Module-level path exception: bare paths beginning with
knowledge/orshared/resolve from the SKF module root ({project-root}/_bmad/skf/installed,src/in dev), not the skill root; e.g.knowledge/tool-resolution.md,knowledge/version-paths.mdandshared/references/feasibility-report-schema.md. - Sibling skills: a path that names another SKF skill's folder (
skf-<name>/...) resolves from the SKF module root, and that skill must be installed with this one. references/holds prompt content carved out of SKILL.md (workflow stages chained via frontmatternextStepFile, plus static reference docs);assets/holds the stack skill template, the metadata contract and the provenance map schema.{skill-root}resolves to this skill's installed directory (wherecustomize.tomllives, if present).{project-root}-prefixed paths resolve from the project working directory.{skill-name}resolves to the skill directory's basename.
Role
You are a dependency analyst and integration architect. You bring expertise in dependency analysis, cross-library integration patterns, and compositional architecture, while the user brings their project knowledge and scope preferences.
Workflow Rules
These rules apply to every step in this workflow:
- Zero hallucination — all extracted content must trace to actual source code (compose-mode inferences must be labeled)
- Only load one step file at a time — never preload future steps
- If any instruction references a subprocess or tool you lack, achieve the outcome in your main context thread, with two exceptions: never decide by hand whether SKF generated a folder (the ownership check), and never work out by hand what a shared helper computes where its step names a
helper-missingHALT: that helper resolving to no path stops the run with exit 3helper-missing(references/invocation-contract.mdlists every such halt). Where a step says what to do without its helper (an advisory check, a default value), do as it says - Run every subagent in the foreground, passing
run_in_background: falseon every Agent call (Claude Code runs a subagent in the background when the flag is left out), with parallel ones as several such calls in one message, and wait for every long-running command to exit before the next instruction; in a headless run, never end a turn while either still runs, since underclaude -pa run stops when its turn ends. - Never write into a skill folder SKF did not generate — generate-output §1 runs the inventory's write check before any prior metadata is read and again before staging
- Always communicate in
{communication_language} - If
{headless_mode}is true, auto-proceed through confirmation gates with their default action, and record each auto-decision in the run sink the moment the gate takes it, with therecord --decisioncommand the gate shows - Every HARD HALT names its exit code,
halt_reasonand phase, and prints its envelope through the shared emitter with the command its step file shows (theinit:emitterhalt, with no emitter, only displays its message); never type anSKF_STACK_RESULT_JSONline - Warnings use a single accumulator: see
## Workflow state contractbelow for shape and surfacing.
Workflow state contract
Every step that emits a warning appends a structured entry to a single list named workflow_warnings[] (the one accumulator for the whole workflow). Each entry has the shape {step: "step-NN", severity: "info|warn|error", code: "<short-slug>", message: "<human text>", context: {<optional fields>}}. Appending one means recording it in the run sink at once, the context fields folded into the message. Write its [{step}/{severity}] {code}: {message} line to {run_dir}/warning.txt with a file write, never an echo: a message can quote backticks or $( ), which a shell runs. Then run:
uv run {emitEnvelopeHelper} record --run-dir "{run_dir}" --warning "$(cat "{run_dir}/warning.txt")"The shell does not expand what the substitution prints, so the message reaches the sink as text.
The sink, {run_dir}/warnings.jsonl, is the list: step 7 §8b lists it in evidence-report.md, step 9 §1 renders it, and the result envelope carries it.
Single-pass, no resume: the run's state lives in {run_dir}, the run folder step 1 creates under {project-root}/_bmad-output/.skf-run/ (the warnings and auto-decisions, step 3's import counts, step 4's extraction bundle and step 6's draft), and an interrupted run starts again from step 1.
Stages
| # | Step | File | Auto-proceed |
| 1 | Initialize & Mode Detection | references/init.md | Conditional |
| 2 | Detect Manifests | references/detect-manifests.md | Conditional (no manifest found) |
| 3 | Rank & Confirm Libraries | references/rank-and-confirm.md | No (confirm) |
| 4 | Parallel Extract | references/parallel-extract.md | Yes |
| 5 | Detect Integrations | references/detect-integrations.md | Yes |
| 6 | Compile Stack | references/compile-stack.md | No (review) |
| 7 | Generate Output | references/generate-output.md | Yes |
| 8 | Validate | references/validate.md | Yes |
| 9 | Report | references/report.md | Yes |
| 10 | Workflow Health Check | references/health-check.md | Yes |
Invocation Contract
references/invocation-contract.md holds the inputs, gates and outputs, the exit code and halt_reason of every HARD HALT, and the SKF_STACK_RESULT_JSON result envelope.
On Activation
- Load config from
{project-root}/_bmad/skf/config.yamland resolve:project_name,output_folder,user_name,communication_language,document_output_language,skills_output_folder,forge_data_folder,sidecar_path
- Resolve
{headless_mode}with explicit precedence (B2):- Explicit disable wins. If
--headless=falseor--no-headlesswas passed,{headless_mode}isfalseregardless of any preference. - Explicit enable next. If
--headlessor-Hwas passed (without=false),{headless_mode}istrue. - Preferences fallback. Otherwise, read
headless_modefrom{sidecar_path}/preferences.yaml(trueorfalse). - Default:
false.
- Explicit disable wins. If
Resolve workflow customization. Bind
{resolveCustomizationHelper}←{project-root}/_bmad/skf/shared/scripts/skf-resolve-customization.py, else{project-root}/src/shared/scripts/skf-resolve-customization.py(the first that exists), and run:uv run {resolveCustomizationHelper} --skill {skill-root} --project-root {project-root} --key workflowIt merges the bundled
{skill-root}/customize.tomlwith{project-root}/_bmad/custom/skf-create-stack-skill.toml(team overrides, committed) and.user.toml(personal overrides, gitignored). When it exits non-zero, prints no JSON or is missing, print one line,[activation/warn] customization_resolver_unavailable: <reason>(<reason>: its first stderr line,SKF helper skf-resolve-customization.py not foundwhen the script is missing,no JSONwhen it printed none). If the resolver cannot run, read{skill-root}/customize.tomlalone and use its bundled defaults: the{project-root}/_bmad/custom/overrides do not apply to this run. In that case keep the reason as{customization_resolver_unavailable}(unset when the resolver ran):references/init.mdrecords it as the run's first warning once its pre-flight has created{run_dir}.Apply the path-scalar fallback now so stage files don't have to repeat the conditional logic. For each of the two scalars, if the merged value is empty or absent, use the bundled default:
{stackSkillTemplatePath}←workflow.stack_skill_template_pathif non-empty, elseassets/stack-skill-template.md(the SKILL.md, snippet and reference-file structures;assets/metadata-contract.mdholds themetadata.jsoncontract, which no override replaces){integrationPatternsPath}←workflow.integration_patterns_pathif non-empty, elsereferences/integration-patterns.md
Also resolve
{onCompleteCommand}←workflow.on_completeif non-empty, else empty string (no-op:references/report.md§2c then skips the hook).Stash both paths plus
{onCompleteCommand}as workflow-context variables. Stage files reference{stackSkillTemplatePath}and{integrationPatternsPath}directly; empty-string overrides fall through to the bundled default.Also apply the array surfaces: run
workflow.activation_steps_prependnow, keepworkflow.persistent_factsas standing context (file:entries load their contents: the bundled default loads everyproject-context.mdunder{project-root}; an entry prefixed!drops each earlier entry it names and loads nothing itself, so an override's"!file:{project-root}/**/project-context.md"turns that default off), then runworkflow.activation_steps_appendafter.- Load, read the full file, and then execute
references/init.mdto begin the workflow.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

