spec-template
Use this skill to convert a specific implementation spec into a reusable template
that can guide future implementations of the same pattern.
Good fits:
- A concrete plugin spec should become a generic plugin implementation spec.
- A channel-specific approval spec should become a generic channel approval template.
- A PR or milestone spec should become a reusable recipe for similar future work.
Workflow
Resolve the source and destination.
- Identify the existing concrete spec, PR, report, or implementation notes to generalize.
- If the destination is durable knowledge, invoke
../mem/SKILL.md before choosing the output path.
- If the user names a concrete path, use it.
- If no output path is clear, ask one concise question.
Read the concrete source and its anchors.
- Read the spec first.
- Read only the source code, docs, tests, PR text, screenshots, or proof artifacts needed to understand which parts are invariant.
- Capture the source spec path and example implementation name; the final template should point back to them as a worked example when appropriate.
Separate invariant pattern from instance details.
- Invariant: contracts, required integration points, state transitions, verification shape, rollout gates, safety checks, and failure modes.
- Instance detail: product names, specific channel/plugin/provider names, IDs, file paths, config keys, phone numbers, screenshots, PR numbers, and one-off migration notes.
- Keep concrete details only when they are useful as examples. Mark them explicitly as examples, not required template content.
Draft the generic template.
- Replace concrete nouns with clear slots such as
<channel>, <plugin>, <capability>, <provider>, <config key>, <approval action>, or <proof artifact>.
- Preserve implementation order where it matters.
- Include a short "How to adapt this template" section when the source spec has many replaceable details.
- Include verification requirements that prove the generic behavior, not just the original implementation.
Add example linkage.
- Include a "Worked Example" or "Reference Implementation" section if the user asks for the source spec/PR to be cited.
- Link to the original spec, report, PR, or proof artifact with relative links when possible.
- Make clear which example facts must not be copied blindly into new implementations.
Review for template quality.
- The template should be reusable without knowing the original conversation.
- The template should still be concrete enough to implement from.
- Remove stale source-specific TODOs, personal notes, secrets, phone numbers, and live credentials.
- Preserve any
## Manual Notes section in an existing destination document exactly.
Output Shape
Prefer this structure unless the destination has an existing spec format:
# <Generic Capability> Spec Template
## Purpose
What this template helps implement.
## When To Use
Signals that this template applies.
## Inputs
- `<source spec>`:
- `<target implementation>`:
- `<owner surface>`:
## Required Contracts
The invariant API, config, runtime, state, and ownership contracts.
## Implementation Template
Step-by-step generic implementation plan with replaceable slots.
## Verification Template
Required automated, manual, integration, and proof checks.
## Rollout And Safety
Config gates, compatibility, privacy/security, failure modes, and rollback.
## Worked Example
Concrete source spec or PR used to derive this template.
## Manual Notes
[keep this for the user to add notes. do not change between edits]
## Changelog
- [YYYY-MM-DD HH:MM]: Created template from `<source>`. ([agent session id] - (current git sha))
Prompt Pattern
When asked to create a generic template from a specific spec, use this internal
prompt shape:
Read the concrete spec and any minimal supporting source/proof needed. Create a
generic spec template for implementing the same kind of capability in another
surface. Extract invariant contracts and required verification from the source,
replace implementation-specific details with named slots, keep the original as a
worked example, and call out details that should not be copied blindly.
Quality Bar
- Generic, but not vague: every required implementation decision should have a slot, rule, or checklist item.
- Example-backed: readers can trace the template back to the concrete source when needed.
- Safe to reuse: no credentials, live phone numbers, one-off IDs, or source-only config copied into the reusable template.
- Implementation-ready: an engineer should be able to start from the template without rediscovering the original spec's main contracts.
1---2name: spec-template3description: Turn an existing concrete spec into a reusable generic spec template. Use when asked to create a generic spec, template spec, reusable implementation template, or generalized version of a spec from a specific implementation such as one plugin, channel, integration, feature, or PR.4---56# spec-template78Use this skill to convert a specific implementation spec into a reusable template9that can guide future implementations of the same pattern.1011Good fits:1213- A concrete plugin spec should become a generic plugin implementation spec.14- A channel-specific approval spec should become a generic channel approval template.15- A PR or milestone spec should become a reusable recipe for similar future work.1617## Workflow18191. Resolve the source and destination.20 - Identify the existing concrete spec, PR, report, or implementation notes to generalize.21 - If the destination is durable knowledge, invoke `../mem/SKILL.md` before choosing the output path.22 - If the user names a concrete path, use it.23 - If no output path is clear, ask one concise question.24252. Read the concrete source and its anchors.26 - Read the spec first.27 - Read only the source code, docs, tests, PR text, screenshots, or proof artifacts needed to understand which parts are invariant.28 - Capture the source spec path and example implementation name; the final template should point back to them as a worked example when appropriate.29303. Separate invariant pattern from instance details.31 - Invariant: contracts, required integration points, state transitions, verification shape, rollout gates, safety checks, and failure modes.32 - Instance detail: product names, specific channel/plugin/provider names, IDs, file paths, config keys, phone numbers, screenshots, PR numbers, and one-off migration notes.33 - Keep concrete details only when they are useful as examples. Mark them explicitly as examples, not required template content.34354. Draft the generic template.36 - Replace concrete nouns with clear slots such as `<channel>`, `<plugin>`, `<capability>`, `<provider>`, `<config key>`, `<approval action>`, or `<proof artifact>`.37 - Preserve implementation order where it matters.38 - Include a short "How to adapt this template" section when the source spec has many replaceable details.39 - Include verification requirements that prove the generic behavior, not just the original implementation.40415. Add example linkage.42 - Include a "Worked Example" or "Reference Implementation" section if the user asks for the source spec/PR to be cited.43 - Link to the original spec, report, PR, or proof artifact with relative links when possible.44 - Make clear which example facts must not be copied blindly into new implementations.45466. Review for template quality.47 - The template should be reusable without knowing the original conversation.48 - The template should still be concrete enough to implement from.49 - Remove stale source-specific TODOs, personal notes, secrets, phone numbers, and live credentials.50 - Preserve any `## Manual Notes` section in an existing destination document exactly.5152## Output Shape5354Prefer this structure unless the destination has an existing spec format:5556```markdown57# <Generic Capability> Spec Template5859## Purpose60What this template helps implement.6162## When To Use63Signals that this template applies.6465## Inputs66- `<source spec>`:67- `<target implementation>`:68- `<owner surface>`:6970## Required Contracts71The invariant API, config, runtime, state, and ownership contracts.7273## Implementation Template74Step-by-step generic implementation plan with replaceable slots.7576## Verification Template77Required automated, manual, integration, and proof checks.7879## Rollout And Safety80Config gates, compatibility, privacy/security, failure modes, and rollback.8182## Worked Example83Concrete source spec or PR used to derive this template.8485## Manual Notes8687[keep this for the user to add notes. do not change between edits]8889## Changelog90- [YYYY-MM-DD HH:MM]: Created template from `<source>`. ([agent session id] - (current git sha))91```9293## Prompt Pattern9495When asked to create a generic template from a specific spec, use this internal96prompt shape:9798```markdown99Read the concrete spec and any minimal supporting source/proof needed. Create a100generic spec template for implementing the same kind of capability in another101surface. Extract invariant contracts and required verification from the source,102replace implementation-specific details with named slots, keep the original as a103worked example, and call out details that should not be copied blindly.104```105106## Quality Bar107108- Generic, but not vague: every required implementation decision should have a slot, rule, or checklist item.109- Example-backed: readers can trace the template back to the concrete source when needed.110- Safe to reuse: no credentials, live phone numbers, one-off IDs, or source-only config copied into the reusable template.111- Implementation-ready: an engineer should be able to start from the template without rediscovering the original spec's main contracts.