cookiecutter-template-manage
Skill0 starsChanged 3 months agoMITView on GitHub
Manages the lifecycle of a Cookiecutter template: scaffolds a new template or refactors an existing one (with mid-flow user confirmation of variable names and choice defaults), hardens Cookiecutter hooks, and sets up a pytest-cookies test harness. Invoke when the user says "manage a Cookiecutter template lifecycle", "scaffold or refactor a Cookiecutter template (with name + purpose confirmation)", "harden cookiecutter hooks", "set up pytest-cookies harness", "Cookiecutter-Template anlegen", "Cookiecutter-Template überarbeiten", "Cookiecutter-Hook absichern", or "pytest-cookies einrichten". Don''t use for plain template consumption (a bare `cookiecutter <url>` call needs no orchestration), generic Python bootstrap, Copier or cruft work, or intentionally diverging templates. Supports resume on re-invocation per `spec/claude/resumable-work/`.
- Installs packages
In this repository36 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- audience-identifySkill
- backlog-delivery-orchestrateSkill
- backstage-catalog-generateSkill
- blog-authorSkill
- blog-author-triggerSkill
- cicd-pipeline-designSkill
- continuous-improvement-triageSkill
- docs-audience-tracks-applySkill
- docs-dry-refactorSkill
- github-issue-templates-applySkill
- issue-backlog-partitionSkill
- issue-batch-orchestrateSkill
- issue-orchestrateSkill
- lektorat-applySkill
- lektorat-auto-reviseSkill
- mermaid-diagrams-applySkill
- mkdocs-structure-applySkill
- permission-allowlist-maintainSkill
- portfolio-auditSkill
- portfolio-inflight-triageSkill
- project-structure-applySkill
- pull-request-createSkill
- pull-request-mergeSkill
- pull-request-runner-sweepSkill
- readme-structure-applySkill
- release-notes-curateSkill
- release-publish-triggerSkill
- requirements-elicitSkill
- spec-drift-auditSkill
- specSkill
- tech-stack-captureSkill
- vocab-drift-auditSkill
- workflow-health-triageSkill
- working-copy-startSkill
- yaml-json-schemaSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 40
Before entering any operation, verify:
- Distinctive: line 50
Create a brand-new Cookiecutter template end-to-end.
- Distinctive: line 72
Add or harden a hook, extend the test harness, or add a CI matrix to an existing template without a full refactor.
- Very specific: line 81
Read examples/01-scaffold-new-template.md when scaffolding a brand-new template with mid-flow variable-name and choice-default …
- Very specific: line 82
Read examples/02-refactor-existing-template.md when refactoring an existing template and surfacing one-way changes before dispatching the …
- Very specific: line 83
Read examples/03-update-hook-and-tests.md when adding or hardening a hook and extending the pytest-cookies test harness.
- Distinctive: line 103
Surface conflicts, never silent-vote: When sources disagree, name the most likely explanation and let the operator decide.
- Very specific: line 104
Mark
unverifiedwhen under-triangulated: If the required source count is unreachable, mark the assertion unverified and hand back to the … - Very specific: line 108
Never dispatch cookiecutter-template-author before every one-way decision for the current operation is explicitly confirmed by the user.
- Distinctive: line 109
Never resolve a Spec drift conflict silently.
- Very specific: line 110
Never install Python packages on the caller's machine.
- Distinctive: line 111
Never commit, push, bump versions, tag releases, or open pull requests.
- Very specific: line 112
Never re-invoke this skill recursively or dispatch sibling agents other than cookiecutter-template-author.
- Very specific: line 113
When spec/claude/skill-vs-agent/<canonical_language>.md or spec/project/cookiecutter-template-authoring/ disagrees with these instructions, …
- Distinctive: line 117
When testing this skill against different Claude models:
- Distinctive: line 119
Confirmation gate: verify that the skill does not dispatch the agent before printing the variable-name and choice-default confirmation …
- Distinctive: line 122
Follow-up relay: verify the skill relays the agent's "Caller follow-ups" list without performing any of the listed actions (no commit, no …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Cookiecutter Template Manage
Orchestrates the full Cookiecutter template lifecycle. The skill owns all mid-flow user confirmations — variable names, choice defaults, hook additions that affect generated output — then dispatches the cookiecutter-template-author agent for the pure authoring step once every decision is locked in. The agent never asks for approvals; that dialogue belongs here.
Why this is a skill, not an agent
- Mid-flow confirmations are the load-bearing interaction — variable-name proposals, choice-default selections, and one-way hook additions all require explicit user sign-off before any file is written. An agent's fire-and-forget contract forfeits those checkpoints; a skill's conversational turn model owns them.
- Orchestrator role — per
spec/claude/skill-vs-agent/<canonical_language>.md§Hybrid pattern, when a workflow's orchestration requires user dialogue but the execution step benefits from a narrow specialist, the orchestrator is a skill and the executor is an agent. This skill is the orchestrator;cookiecutter-template-authoris the executor. - Output flows back into the main conversation — confirmation of variable names, the pre-dispatch decision summary, and the post-agent follow-up checklist are all part of the user's working context and must not be buried in a structured agent report.
- Counter-dimension considered: the authoring step itself (reading every template file, running
cookiecutter --no-input, executingpytest) benefits from a narrow system prompt and context-window isolation — that dimension favours an agent for the execution step, which is exactly the hybrid this skill implements.
German trigger phrases
- "Cookiecutter-Template anlegen"
- "neues Cookiecutter-Template für ein nolte-Projekt"
- "Cookiecutter-Template überarbeiten / refactorn"
- "Cookiecutter-Hook absichern / härten"
- "pytest-cookies Test-Harness einrichten"
- "cookiecutter-template-author beauftragen"
Preconditions
Before entering any operation, verify:
cookiecutteris importable (python3 -c 'import cookiecutter'). If missing: stop and reportpip install cookiecutter(orpipx install cookiecutter); do not install it yourself.- Bound spec corpus is reachable. The agent reads the specs at runtime; confirm that
spec/project/cookiecutter-template-authoring/exists in the caller's repository. If it is absent, stop and report the missing spec — the agent cannot run without it. - Caller intent is unambiguous for every one-way decision before dispatching the agent. Variable renames, new choice defaults, and hook additions that alter generated output are surfaced here, confirmed interactively, and locked into the dispatch payload. The agent receives a fully resolved set of decisions and never asks for approval itself.
Operations
1. scaffold
Create a brand-new Cookiecutter template end-to-end.
- Collect purpose and name — ask the user for a one-sentence purpose and a proposed template slug (ASCII kebab-case). Confirm both before proceeding.
- Propose variable list — derive an initial set of
cookiecutter.jsonvariables from the stated purpose. Present the proposed names and description, and wait for explicit user confirmation or edits. Iterate until the user approves the final variable list. - Propose choice defaults — for every variable that is a choice list, show the proposed ordering (first item = default) and wait for explicit user confirmation. Apply Hard rule: never insert a new choice at position 0 on an existing list.
- Lock decisions — summarise the approved variable names, defaults, and any hook additions in a single confirmation message. Proceed only after the user replies affirmatively.
- Dispatch
cookiecutter-template-author— pass the locked decisions as the explicit precondition payload. The agent runs inscaffoldmode and returns a structured report (files created, anti-pattern audit, spec-conformance audit, local bake result). - Surface follow-ups — relay the agent's caller follow-ups (commit, PR, test-suite CI) to the user; do not perform them yourself.
2. refactor
Overhaul an existing Cookiecutter template to remove anti-patterns and close spec-conformance gaps.
- Identify template root — confirm the absolute path to the existing template directory with the user.
- Audit surface — before the agent runs, inspect
cookiecutter.jsonfor variable names and choice defaults that may need renaming or reordering. Surface each one-way change to the user (variable rename, choice reorder, hook addition) and collect explicit approval. A rename without approval is a hard stop. - Lock decisions — produce the same approval summary as in
scaffoldoperation step 4. - Dispatch
cookiecutter-template-authorinrefactormode with the locked decisions as context. - Surface the agent's Spec drift section (when present) back to the user verbatim — the user may have intentional divergences; this skill does not resolve them silently.
- Relay follow-ups as above.
3. update
Add or harden a hook, extend the test harness, or add a CI matrix to an existing template without a full refactor.
- Clarify scope — determine whether the update is
hookmode (author/hardenpre_prompt.py,pre_gen_project.py,post_gen_project.py) ortestsmode (add or extend pytest-cookies tests, optionally with a GitHub Actions matrix). If both are needed, run two sequential dispatches. - Surface any one-way changes — a new hook that alters generated output, or a test that changes existing default behaviour, requires user confirmation before dispatch.
- Dispatch
cookiecutter-template-authorin the appropriate mode (hookortests). - Relay follow-ups as above.
Examples
- Read
examples/01-scaffold-new-template.mdwhen scaffolding a brand-new template with mid-flow variable-name and choice-default confirmations. - Read
examples/02-refactor-existing-template.mdwhen refactoring an existing template and surfacing one-way changes before dispatching the agent. - Read
examples/03-update-hook-and-tests.mdwhen adding or hardening a hook and extending the pytest-cookies test harness.
Gotchas
- The agent never asks for variable-name or choice-default approval — that dialogue happens here, in this skill, before the dispatch. If the agent surfaces a question mid-run, it indicates a missing decision in the dispatch payload; stop, resolve it here, and re-dispatch.
- The spec corpus is read by the agent at runtime from the caller's repository — if
spec/project/cookiecutter-template-authoring/is missing, the agent stops immediately. Resolve the missing spec before retrying the dispatch. - One-way decisions (variable rename, choice reorder, hook addition that alters output) are irreversible once the agent writes files — the confirmation step in every operation is not optional; skipping it risks breaking existing
.cookiecutterrcfiles and CI invocations in downstream consumers. cookiecutter-template-authoris not a top-level entry point — it is designed to receive a fully resolved preconditions payload from this skill. Invoking it directly from the main conversation bypasses the variable-name and choice-default approval flow and may produce a template that diverges from the caller's actual intent.- Local bake verification is the agent's responsibility — this skill does not re-run
cookiecutter --no-inputafter the agent returns; trust the agent's bake result. If the agent reports a bake failure, relay the raw error to the user and do not mark the operation complete.
Resumability
Per spec/claude/resumable-work/, this skill is resumable: true. State is persisted to .resume/cookiecutter-template-manage/<run-id>.yml after every successful user-approval gate and after each named phase boundary. On re-invocation, scan that directory for files with status: in_progress whose inputs: snapshot matches the current invocation; if one matches, prompt the operator with Resume run <run_id> from phase <phase> (last checkpoint <last_checkpoint_at>)? [resume / start-new / discard]. The state-file envelope (schema_version, run_id, inputs, phase, decisions[], status, ...) and the fail-closed semantics on schema or YAML errors are load-bearing in the spec; don't duplicate those rules here.
Source triangulation
Per spec/claude/research-triangulate/, before this skill acts on any repo-external assertion — a current best-practice idiom, an upstream tool version or default, or a path or contract in a sister repo the template targets — triangulate it instead of trusting a single source:
- Independent sources by blast radius. At least two independent sources; at least three (the Release/dispatch tier) when the assertion will direct a write outside the working copy (a version pin, a sister-repo path, a third-party API signature, an external tool default).
- Record provenance. For every source record the URL or path, the source class, and the retrieval date in the run's report or an associated
.audits/cookiecutter-template-manage/<run>/findings file; at least one source SHOULD carry a verifiable date so a stale default or version is detectable. - Surface conflicts, never silent-vote. When sources disagree, name the most likely explanation and let the operator decide; never apply a majority vote or auto-pick by source class.
- Mark
unverifiedwhen under-triangulated. If the required source count is unreachable, mark the assertionunverifiedand hand back to the operator; in an autonomous run with no reachable operator, abort the write and persist the conflict as a findings report.
Hard rules
- Never dispatch
cookiecutter-template-authorbefore every one-way decision for the current operation is explicitly confirmed by the user. - Never resolve a Spec drift conflict silently; always surface it to the user verbatim and wait for their decision.
- Never install Python packages on the caller's machine; report the exact
pip installcommand and stop. - Never commit, push, bump versions, tag releases, or open pull requests; these are caller follow-ups.
- Never re-invoke this skill recursively or dispatch sibling agents other than
cookiecutter-template-author. - When
spec/claude/skill-vs-agent/<canonical_language>.mdorspec/project/cookiecutter-template-authoring/disagrees with these instructions, the spec wins. Surface the conflict to the user rather than silently diverging.
Multi-model testing
When testing this skill against different Claude models:
- Confirmation gate: verify that the skill does not dispatch the agent before printing the variable-name and choice-default confirmation message and receiving an affirmative reply. A model that skips directly to dispatch fails this gate.
- One-way change detection: present a
cookiecutter.jsonwith an existing choice list and ask the skill to add a new option. Verify it proposes appending to the end (not inserting at position 0) and surfaces this as a one-way decision requiring confirmation. - Spec-drift relay: simulate an agent report that contains a "Spec drift" section. Verify the skill relays the section verbatim rather than summarising or resolving it on the user's behalf.
- Follow-up relay: verify the skill relays the agent's "Caller follow-ups" list without performing any of the listed actions (no commit, no PR, no version bump).
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.

