mirror of
https://github.com/github/spec-kit.git
synced 2026-03-19 11:53:08 +00:00
feat(templates): add pluggable template system with packs, catalog, resolver, and CLI commands
Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com>
This commit is contained in:
49
templates/template/README.md
Normal file
49
templates/template/README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# My Template Pack
|
||||
|
||||
A custom template pack for Spec Kit.
|
||||
|
||||
## Overview
|
||||
|
||||
This template pack provides customized artifact templates for your development workflow.
|
||||
|
||||
## Templates Included
|
||||
|
||||
| Template | Type | Description |
|
||||
|----------|------|-------------|
|
||||
| `spec-template` | artifact | Custom feature specification template |
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Install from local directory (during development)
|
||||
specify template add --dev /path/to/this/directory
|
||||
|
||||
# Install from catalog (after publishing)
|
||||
specify template add my-template-pack
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Once installed, templates are automatically resolved by the Spec Kit scripts.
|
||||
When you run `specify specify` or create a new feature, your custom templates
|
||||
will be used instead of the core defaults.
|
||||
|
||||
## Template Types
|
||||
|
||||
- **artifact** — Document scaffolds (spec.md, plan.md, tasks.md, etc.)
|
||||
- **command** — AI agent prompts (the files in `.claude/commands/`, etc.)
|
||||
- **script** — Custom scripts that replace core scripts
|
||||
|
||||
## Development
|
||||
|
||||
1. Edit templates in the `templates/` directory
|
||||
2. Test with: `specify template add --dev .`
|
||||
3. Verify with: `specify template resolve spec-template`
|
||||
|
||||
## Publishing
|
||||
|
||||
See the [Template Publishing Guide](../../docs/TEMPLATE-PUBLISHING-GUIDE.md) for details.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
66
templates/template/template-pack.yml
Normal file
66
templates/template/template-pack.yml
Normal file
@@ -0,0 +1,66 @@
|
||||
schema_version: "1.0"
|
||||
|
||||
template_pack:
|
||||
# CUSTOMIZE: Change 'my-template-pack' to your template pack ID (lowercase, hyphen-separated)
|
||||
id: "my-template-pack"
|
||||
|
||||
# CUSTOMIZE: Human-readable name for your template pack
|
||||
name: "My Template Pack"
|
||||
|
||||
# CUSTOMIZE: Update version when releasing (semantic versioning: X.Y.Z)
|
||||
version: "1.0.0"
|
||||
|
||||
# CUSTOMIZE: Brief description (under 200 characters)
|
||||
description: "Brief description of what your template pack provides"
|
||||
|
||||
# CUSTOMIZE: Your name or organization name
|
||||
author: "Your Name"
|
||||
|
||||
# CUSTOMIZE: GitHub repository URL (create before publishing)
|
||||
repository: "https://github.com/your-org/spec-kit-templates-my-pack"
|
||||
|
||||
# REVIEW: License (MIT is recommended for open source)
|
||||
license: "MIT"
|
||||
|
||||
# Requirements for this template pack
|
||||
requires:
|
||||
# CUSTOMIZE: Minimum spec-kit version required
|
||||
speckit_version: ">=0.1.0"
|
||||
|
||||
# Templates provided by this pack
|
||||
provides:
|
||||
templates:
|
||||
# CUSTOMIZE: Define your artifact templates
|
||||
# Artifact templates are document scaffolds (spec.md, plan.md, etc.)
|
||||
- type: "artifact"
|
||||
name: "spec-template"
|
||||
file: "templates/spec-template.md"
|
||||
description: "Custom feature specification template"
|
||||
replaces: "spec-template" # Which core template this overrides (optional)
|
||||
|
||||
# ADD MORE TEMPLATES: Copy this block for each template
|
||||
# - type: "artifact"
|
||||
# name: "plan-template"
|
||||
# file: "templates/plan-template.md"
|
||||
# description: "Custom plan template"
|
||||
# replaces: "plan-template"
|
||||
|
||||
# Command templates (AI agent prompts)
|
||||
# - type: "command"
|
||||
# name: "specify"
|
||||
# file: "commands/specify.md"
|
||||
# description: "Custom specification command"
|
||||
# replaces: "specify"
|
||||
|
||||
# Script templates
|
||||
# - type: "script"
|
||||
# name: "create-new-feature"
|
||||
# file: "scripts/bash/create-new-feature.sh"
|
||||
# description: "Custom feature creation script"
|
||||
# replaces: "create-new-feature"
|
||||
|
||||
# CUSTOMIZE: Add relevant tags (2-5 recommended)
|
||||
# Used for discovery in catalog
|
||||
tags:
|
||||
- "example"
|
||||
- "template"
|
||||
21
templates/template/templates/spec-template.md
Normal file
21
templates/template/templates/spec-template.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Feature Specification
|
||||
|
||||
> Replace this with your actual specification content.
|
||||
|
||||
## Overview
|
||||
|
||||
Brief description of the feature.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Requirement 1
|
||||
- Requirement 2
|
||||
|
||||
## Design
|
||||
|
||||
Describe the design approach.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] Criterion 1
|
||||
- [ ] Criterion 2
|
||||
Reference in New Issue
Block a user