| name | template |
| description | Template for creating skills with Code Before Prompts pattern Use when this capability is needed. |
| metadata | {"author":"davidmoneil"} |
Skill Template
This is the template skill demonstrating the Code Before Prompts pattern. Copy this directory when creating new skills that need deterministic tools.
Overview
| Aspect | Description |
|---|
| Purpose | Template for new skills with TypeScript tools |
| Pattern | Code Before Prompts |
| When to Use | Creating skills that need file generation, validation, or data processing |
Quick Actions
| Need | Action | Command |
|---|
| List templates | See available templates | npx tsx tools/index.ts list |
| Create document | Generate from template | npx tsx tools/index.ts create <template> "<name>" |
| Validate file | Check against schema | npx tsx tools/index.ts validate <path> |
Using Tools
This skill includes deterministic tools for common operations.
List Available Templates
cd .claude/skills/_template
npx tsx tools/index.ts list
Create from Template
npx tsx tools/index.ts create default "My Document"
npx tsx tools/index.ts create spec "API Design"
Validate a File
npx tsx tools/index.ts validate ./path/to/file.md
How to Use This Template
1. Copy the Template
cp -r .claude/skills/_template .claude/skills/my-new-skill
2. Update Configuration
Edit config.json:
- Change
name and description
- Add your skill-specific templates
- Update validation rules
3. Create Templates
Add .md files to templates/ with placeholders:
{{NAME}} - The name provided to the create command
{{DATE}} - Current date (YYYY-MM-DD)
{{SLUG}} - Name converted to lowercase-with-dashes
{{TIMESTAMP}} - Full ISO timestamp
4. Extend Tools (Optional)
Add custom commands to tools/index.ts:
case 'my-custom-command':
break;
5. Write SKILL.md
Document your skill's:
- Workflow phases
- Tool commands
- Integration points with TELOS, orchestration, etc.
Code Before Prompts Principle
Use CODE for:
- File creation and manipulation
- Template rendering
- Validation
- Data transformation
- Path resolution
Use AI for:
- Content generation
- Decision making
- Analysis and synthesis
- Creative tasks
This separation ensures:
- Repeatability: Same inputs → same outputs
- Scalability: Code handles heavy lifting
- Reliability: Fewer hallucinations in routine operations
Integration Points
| Integration | How It Works |
|---|
| TELOS | Links to Goal G-T4 (Deterministic AI Architecture) |
| Pattern | Follows code-before-prompts-pattern.md |
| Skills Index | Listed in _index.md with tools/ marker |
Tool Type Selection
Choose the right tool type for your skill:
| Scenario | Tool Type | Example |
|---|
| Complex logic, type safety needed | TypeScript (tools/) | Template rendering, validation |
| Simple CLI commands, system ops | Bash (Scripts/) | Docker checks, git operations |
| Data gathering for AI analysis | Bash returning JSON | Health checks, status gathering |
Bash scripts are preferred for:
- System operations (docker, git, ssh)
- Simple data gathering
- Operations that need to be schedulable via cron
TypeScript tools are preferred for:
- Complex transformations
- Template rendering with validation
- Operations requiring type safety
Related
Converted and distributed by TomeVault — claim your Tome and manage your conversions.