Skip to content

Commit b327bcf

Browse files
nhortonclaude
andcommitted
Apply best practices to skill jinja templates
- Streamline template structure with critical guidance upfront - Simplify descriptions to be concise and search-friendly - Add explicit step-by-step instructions with clear goals - Improve section organization (Prerequisites, Inputs, Outputs, Completion) - Add platform-specific notes (Claude: Skill tool, Gemini: manual invocation) - Clarify description guidelines in best practices rule file Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6fbeb61 commit b327bcf

6 files changed

Lines changed: 295 additions & 262 deletions

File tree

.claude/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"permissions": {
33
"allow": [
4+
"WebFetch(domain:code.claude.com)",
5+
"WebFetch(domain:www.anthropic.com)",
6+
"WebFetch(domain:anthropic.com)",
7+
"WebFetch(domain:platform.claude.com)",
8+
"WebFetch(domain:docs.anthropic.com)",
49
"Bash(ls:*)",
510
"Bash(grep:*)",
611
"Bash(find:*)",
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Skill Template Best Practices
3+
trigger: src/deepwork/templates/**/skill-job*.jinja
4+
compare_to: prompt
5+
---
6+
Skill template files are being modified. Ensure the generated skills follow these best practices:
7+
8+
## Description Guidelines
9+
10+
The description appears in skill search results and helps users find the right skill. Keep it search-friendly and scannable.
11+
12+
1. **Be specific** - Name exact capabilities/actions the skill performs
13+
2. **Keep concise** - One sentence, max ~100 chars; describes WHAT it does, not HOW
14+
3. **Avoid vagueness** - "Extract text from PDFs, fill forms" is good; "Helps with documents" is bad
15+
4. **Avoid meta-language** - Don't include "Trigger:", "Keywords:", or similar prefixes. Let the description itself be searchable.
16+
17+
## Instruction Writing
18+
19+
1. **Keep focused** - Core instructions should be under 500 lines; use supporting files for details
20+
2. **Use progressive disclosure** - Essential info in main content, detailed reference in linked files
21+
3. **Be explicit** - Provide clear, step-by-step guidance rather than relying on inference
22+
4. **Structure clearly** - Use headers, numbered lists for sequential steps, bullets for options
23+
24+
## Prompt Structure
25+
26+
1. **Specificity first** - Detailed directions upfront prevent course corrections later
27+
2. **Plan before action** - Ask agent to analyze/plan before implementing
28+
3. **Reference concrete files** - Use specific paths, not general descriptions
29+
4. **Include context** - Mention edge cases, preferred patterns, and expected outcomes
30+
31+
## Quality Criteria
32+
33+
1. **Make measurable** - Criteria should be verifiable, not subjective
34+
2. **Focus on outcomes** - What the output should achieve, not process steps
35+
3. **Keep actionable** - Agent should be able to self-evaluate against criteria
36+
37+
## Platform Considerations
38+
39+
- **Claude**: Supports hooks for automated validation; use Skill tool for step invocation
40+
- **Gemini**: No hook support; instructions must guide manual verification
41+
42+
## Reference Documentation
43+
44+
When unsure about best practices, consult:
45+
- https://code.claude.com/docs/en/skills - Official skills documentation
46+
- https://www.anthropic.com/engineering/claude-code-best-practices - Prompting best practices

src/deepwork/templates/claude/skill-job-meta.md.jinja

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,68 @@
1+
{#
2+
Template: skill-job-meta.md.jinja
3+
Purpose: Generates the job overview skill file for Claude Code
4+
5+
Template Variables:
6+
- job_name: string - Job identifier (e.g., "competitive_research")
7+
- job_summary: string - Short one-line summary of the job
8+
- job_description: string|null - Full description (optional)
9+
- total_steps: int - Number of steps in the job
10+
- steps: list - Array of step objects:
11+
- id: string - Step identifier
12+
- name: string - Human-readable step name
13+
- description: string - What the step does
14+
- command_name: string - Slash command (e.g., "job_name.step_id")
15+
- dependencies: list[string]|null - Required prior steps
16+
#}
117
---
2-
description: {{ job_summary }}
18+
description: "{{ job_summary }}"
319
---
420

521
# {{ job_name }}
622

7-
You are executing the **{{ job_name }}** job. {{ job_summary }}
23+
**Multi-step workflow**: {{ job_summary }}
24+
25+
> **CRITICAL**: Always invoke steps using the Skill tool. Never copy/paste step instructions directly.
826

927
{% if job_description %}
1028
{{ job_description }}
1129
{% endif %}
1230

1331
## Available Steps
1432

15-
This job has {{ total_steps }} step(s):
16-
1733
{% for step in steps %}
18-
### {{ step.id }}
19-
**{{ step.name }}**: {{ step.description }}
20-
- Command: `{{ step.command_name }}`
21-
{% if step.dependencies %}
22-
- Requires: {{ step.dependencies | join(', ') }}
23-
{% endif %}
24-
{% endfor %}
34+
{{ loop.index }}. **{{ step.id }}** - {{ step.description }}{% if step.dependencies %} (requires: {{ step.dependencies | join(', ') }}){% endif %}
2535

26-
## Instructions
36+
{% endfor %}
2737

28-
This is a **multi-step workflow**. Determine the starting point and run through the steps in sequence.
38+
## Execution Instructions
2939

30-
1. **Analyze user intent** from the text that follows `/{{ job_name }}`
40+
### Step 1: Analyze Intent
3141

32-
2. **Identify the starting step** based on intent:
42+
Parse any text following `/{{ job_name }}` to determine user intent:
3343
{% for step in steps %}
34-
- {{ step.id }}: {{ step.description }}
44+
- "{{ step.id }}" or related terms → start at `{{ step.command_name }}`
3545
{% endfor %}
3646

37-
3. **Run the workflow** starting from the identified step:
38-
- Invoke the starting step using the Skill tool
39-
- When that step completes, **automatically continue** to the next step in the workflow
40-
- Continue until the workflow is complete or the user intervenes
47+
### Step 2: Invoke Starting Step
48+
49+
Use the Skill tool to invoke the identified starting step:
50+
```
51+
Skill tool: {{ steps[0].command_name }}
52+
```
53+
54+
### Step 3: Continue Workflow Automatically
55+
56+
After each step completes:
57+
1. Check if there's a next step in the sequence
58+
2. Invoke the next step using the Skill tool
59+
3. Repeat until workflow is complete or user intervenes
4160

42-
4. **If intent is ambiguous**, ask the user which step to start from:
43-
- Present the available steps as numbered options
44-
- Use AskUserQuestion to let them choose
61+
### Handling Ambiguous Intent
4562

46-
**Critical**:
47-
- You MUST invoke each step using the Skill tool. Do not copy/paste step instructions.
48-
- After each step completes, check if there's a next step and invoke it automatically.
49-
- The workflow continues until all dependent steps are complete.
63+
If user intent is unclear, use AskUserQuestion to clarify:
64+
- Present available steps as numbered options
65+
- Let user select the starting point
5066

5167
## Context Files
5268

0 commit comments

Comments
 (0)