devlyn-cli 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/bin/devlyn.js +3 -0
- package/optional-skills/better-auth-setup/SKILL.md +450 -0
- package/optional-skills/better-auth-setup/references/api-keys.md +236 -0
- package/optional-skills/better-auth-setup/references/config-and-entry.md +239 -0
- package/optional-skills/better-auth-setup/references/middleware.md +409 -0
- package/optional-skills/better-auth-setup/references/schema.md +224 -0
- package/optional-skills/better-auth-setup/references/testing.md +241 -0
- package/optional-skills/generate-skill/CHECKLIST.md +60 -0
- package/optional-skills/generate-skill/PROMPT-PATTERNS.md +370 -0
- package/optional-skills/generate-skill/REFERENCE.md +195 -0
- package/optional-skills/generate-skill/SKILL.md +178 -0
- package/package.json +1 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# Frontmatter Field Reference
|
|
2
|
+
|
|
3
|
+
Complete catalog of YAML frontmatter fields for Claude Code skill files (`SKILL.md`).
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Required Fields](#required-fields)
|
|
8
|
+
- [Optional Fields](#optional-fields)
|
|
9
|
+
- [String Substitutions](#string-substitutions)
|
|
10
|
+
- [Tool Presets](#tool-presets)
|
|
11
|
+
- [Naming Rules](#naming-rules)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Required Fields
|
|
16
|
+
|
|
17
|
+
| Field | Type | Max Length | Description |
|
|
18
|
+
|---|---|---|---|
|
|
19
|
+
| `name` | string | 64 chars | Unique skill identifier. Lowercase, hyphens, digits only. |
|
|
20
|
+
| `description` | string | 1024 chars | What the skill does and when to trigger it. Third-person voice. |
|
|
21
|
+
|
|
22
|
+
### `name` Validation
|
|
23
|
+
|
|
24
|
+
- Lowercase letters, hyphens, and digits only: `[a-z0-9-]+`
|
|
25
|
+
- Max 64 characters
|
|
26
|
+
- Must NOT contain: `anthropic`, `claude`, `official`
|
|
27
|
+
- Must NOT start or end with a hyphen
|
|
28
|
+
- Must be unique within the project's skill directory
|
|
29
|
+
|
|
30
|
+
### `description` Best Practices
|
|
31
|
+
|
|
32
|
+
- Write in **third-person**: "Validates PR descriptions..." not "I validate..."
|
|
33
|
+
- Include **trigger phrases** so Claude knows when to activate:
|
|
34
|
+
- Good: `Use when user says "check PR", "validate PR", "review description".`
|
|
35
|
+
- Bad: `A helpful skill for PRs.`
|
|
36
|
+
- No XML tags in the description (they break YAML parsing)
|
|
37
|
+
- First sentence = what it does. Second sentence = when to use it.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Optional Fields
|
|
42
|
+
|
|
43
|
+
| Field | Type | Default | Description |
|
|
44
|
+
|---|---|---|---|
|
|
45
|
+
| `allowed-tools` | string (CSV) | all tools | Comma-separated list of tools the skill can use |
|
|
46
|
+
| `argument-hint` | string | none | Placeholder shown to user (e.g., `"[file path]"`) |
|
|
47
|
+
| `user-invocable` | boolean | `true` | Whether users can trigger via `/skill-name` |
|
|
48
|
+
| `disable-model-invocation` | boolean | `false` | If `true`, Claude cannot proactively trigger the skill |
|
|
49
|
+
| `context` | list | none | Files to inject into context when skill activates |
|
|
50
|
+
| `agent` | object | none | Run skill as a subagent with its own context |
|
|
51
|
+
| `model` | string | inherited | Override model (`opus`, `sonnet`, `haiku`) |
|
|
52
|
+
| `hooks` | object | none | Shell commands to run on skill lifecycle events |
|
|
53
|
+
|
|
54
|
+
### `allowed-tools` Details
|
|
55
|
+
|
|
56
|
+
Specify the minimal set of tools needed. Format: comma-separated tool names.
|
|
57
|
+
|
|
58
|
+
For Bash, use glob patterns to restrict commands:
|
|
59
|
+
```yaml
|
|
60
|
+
allowed-tools: Read, Bash(npm test *), Bash(npx *)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Wildcard `*` matches any arguments. Without a glob, Bash runs any command.
|
|
64
|
+
|
|
65
|
+
### `context` Field
|
|
66
|
+
|
|
67
|
+
Inject files into the skill's context automatically:
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
context:
|
|
71
|
+
- type: file
|
|
72
|
+
path: ${CLAUDE_SKILL_DIR}/PATTERNS.md
|
|
73
|
+
- type: file
|
|
74
|
+
path: ./CLAUDE.md
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Use `${CLAUDE_SKILL_DIR}` for paths relative to the skill directory.
|
|
78
|
+
|
|
79
|
+
### `agent` Field
|
|
80
|
+
|
|
81
|
+
Run the skill as an isolated subagent:
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
agent:
|
|
85
|
+
type: general-purpose
|
|
86
|
+
model: sonnet
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Agent types: `general-purpose`, `Explore`, `Plan`, `haiku`.
|
|
90
|
+
|
|
91
|
+
### `hooks` Field
|
|
92
|
+
|
|
93
|
+
Run shell commands on skill events:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
hooks:
|
|
97
|
+
pre-invoke: "echo 'Starting skill...'"
|
|
98
|
+
post-invoke: "echo 'Skill complete.'"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## String Substitutions
|
|
104
|
+
|
|
105
|
+
These placeholders are replaced at runtime:
|
|
106
|
+
|
|
107
|
+
| Placeholder | Replaced With |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `$ARGUMENTS` | Full argument string passed to the skill |
|
|
110
|
+
| `$1`, `$2`, ... `$N` | Positional arguments (space-separated) |
|
|
111
|
+
| `${CLAUDE_SESSION_ID}` | Current session identifier |
|
|
112
|
+
| `${CLAUDE_SKILL_DIR}` | Absolute path to the skill's directory |
|
|
113
|
+
|
|
114
|
+
### Usage Examples
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
Parse `$ARGUMENTS` for the file path.
|
|
118
|
+
If `$1` is empty, ask the user for a target file.
|
|
119
|
+
Read the config from `${CLAUDE_SKILL_DIR}/config.yaml`.
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Tool Presets
|
|
125
|
+
|
|
126
|
+
Common tool combinations by skill type:
|
|
127
|
+
|
|
128
|
+
### Read-Only (analysis, scanning, review)
|
|
129
|
+
```yaml
|
|
130
|
+
allowed-tools: Read, Grep, Glob
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Read-Only + LSP (code intelligence)
|
|
134
|
+
```yaml
|
|
135
|
+
allowed-tools: Read, Grep, Glob, LSP
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Code Modification (generation, refactoring)
|
|
139
|
+
```yaml
|
|
140
|
+
allowed-tools: Read, Grep, Glob, Edit, Write
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Full Access (build, test, deploy)
|
|
144
|
+
```yaml
|
|
145
|
+
allowed-tools: Read, Grep, Glob, Edit, Write, Bash
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Web Access (API calls, fetching docs)
|
|
149
|
+
```yaml
|
|
150
|
+
allowed-tools: Read, Grep, Glob, WebFetch, WebSearch
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Restricted Bash (specific commands only)
|
|
154
|
+
```yaml
|
|
155
|
+
allowed-tools: Read, Grep, Glob, Bash(npm test *), Bash(npx prettier *)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Agent-Spawning (team coordination)
|
|
159
|
+
```yaml
|
|
160
|
+
allowed-tools: Read, Grep, Glob, Edit, Write, Bash, Agent
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Naming Rules
|
|
166
|
+
|
|
167
|
+
### Skill Name (`name` field)
|
|
168
|
+
|
|
169
|
+
| Rule | Good | Bad |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| Lowercase + hyphens | `validate-pr` | `ValidatePR`, `validate_pr` |
|
|
172
|
+
| Descriptive action | `generate-tests` | `tests`, `t` |
|
|
173
|
+
| No reserved words | `code-review` | `claude-review`, `anthropic-scan` |
|
|
174
|
+
| Max 64 chars | `validate-pr-description` | (anything over 64 chars) |
|
|
175
|
+
|
|
176
|
+
### File Naming
|
|
177
|
+
|
|
178
|
+
| File | Convention |
|
|
179
|
+
|---|---|
|
|
180
|
+
| Main skill file | Always `SKILL.md` |
|
|
181
|
+
| Reference files | `UPPERCASE-WORDS.md` (e.g., `PATTERNS.md`, `REFERENCE.md`) |
|
|
182
|
+
| Skill directory | Same as `name` field (e.g., `validate-pr/`) |
|
|
183
|
+
|
|
184
|
+
### Description Formatting
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
# Good — third person, trigger phrases, clear purpose
|
|
188
|
+
description: >
|
|
189
|
+
Validate pull request descriptions against a project template.
|
|
190
|
+
Checks for required sections and formatting completeness.
|
|
191
|
+
Use when reviewing PRs or when user says "check PR", "validate PR".
|
|
192
|
+
|
|
193
|
+
# Bad — first person, no triggers, vague
|
|
194
|
+
description: "I help with PRs"
|
|
195
|
+
```
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generate-skill
|
|
3
|
+
description: >
|
|
4
|
+
Create well-structured Claude Code skills following Anthropic best practices.
|
|
5
|
+
Generates SKILL.md files with proper frontmatter, workflow structure, and
|
|
6
|
+
prompt engineering patterns for Claude 4.6. Use when building new skills,
|
|
7
|
+
refactoring existing ones, or when user says "create a skill", "new skill",
|
|
8
|
+
"generate skill", "make a command".
|
|
9
|
+
allowed-tools: Read, Grep, Glob, Edit, Write, Bash
|
|
10
|
+
argument-hint: "[skill description or name]"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Generate Skill — Claude Code Skill Authoring
|
|
14
|
+
|
|
15
|
+
Create production-quality Claude Code skills with correct frontmatter, structured workflows, and Claude 4.6 prompt patterns.
|
|
16
|
+
|
|
17
|
+
Reference files in this skill directory:
|
|
18
|
+
- `REFERENCE.md` — Complete frontmatter field catalog and validation rules
|
|
19
|
+
- `PROMPT-PATTERNS.md` — Claude 4.6 prompt engineering patterns for skill bodies
|
|
20
|
+
- `CHECKLIST.md` — Quality verification checklist
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
### Step 1: Gather Requirements
|
|
25
|
+
|
|
26
|
+
Parse `$ARGUMENTS` for the skill description or name.
|
|
27
|
+
|
|
28
|
+
If `$ARGUMENTS` is empty or vague, ask the user:
|
|
29
|
+
|
|
30
|
+
> What skill do you want to create? Describe:
|
|
31
|
+
> 1. **What problem** does it solve?
|
|
32
|
+
> 2. **When** should it trigger? (user command, proactive, or both)
|
|
33
|
+
> 3. **What tools** does it need? (read-only, code modification, web access, etc.)
|
|
34
|
+
|
|
35
|
+
Determine the **degree of freedom**:
|
|
36
|
+
- **High** — Skill makes decisions autonomously (e.g., code generation, refactoring)
|
|
37
|
+
- **Medium** — Skill follows a workflow but adapts to context (e.g., review, analysis)
|
|
38
|
+
- **Low** — Skill executes a fixed procedure (e.g., scan, validate, format)
|
|
39
|
+
|
|
40
|
+
### Step 2: Choose Structure
|
|
41
|
+
|
|
42
|
+
Estimate the total line count for the skill content:
|
|
43
|
+
|
|
44
|
+
| Estimated Lines | Structure |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Under 200 | Single `SKILL.md` file |
|
|
47
|
+
| 200–500 | `SKILL.md` + reference files (e.g., `REFERENCE.md`, `PATTERNS.md`) |
|
|
48
|
+
| Over 500 | Split into multiple separate skills |
|
|
49
|
+
|
|
50
|
+
Rules for reference files:
|
|
51
|
+
- One level deep only (no nested references)
|
|
52
|
+
- Add a table of contents if a reference file exceeds 100 lines
|
|
53
|
+
- Reference files use `${CLAUDE_SKILL_DIR}/FILENAME.md` for paths
|
|
54
|
+
|
|
55
|
+
### Step 3: Write Frontmatter
|
|
56
|
+
|
|
57
|
+
Read `${CLAUDE_SKILL_DIR}/REFERENCE.md` for the complete field catalog.
|
|
58
|
+
|
|
59
|
+
Apply these rules:
|
|
60
|
+
- `name`: lowercase, hyphens only, max 64 chars, no "anthropic" or "claude"
|
|
61
|
+
- `description`: third-person, max 1024 chars, include trigger phrases, no XML tags
|
|
62
|
+
- `allowed-tools`: minimal set needed — see tool presets in REFERENCE.md
|
|
63
|
+
- `argument-hint`: brief placeholder showing expected input format
|
|
64
|
+
|
|
65
|
+
### Step 4: Write Skill Body
|
|
66
|
+
|
|
67
|
+
Read `${CLAUDE_SKILL_DIR}/PROMPT-PATTERNS.md` for Claude 4.6 patterns.
|
|
68
|
+
|
|
69
|
+
Structure the body in this order:
|
|
70
|
+
1. **Title and purpose** — One-line summary of what the skill does and why
|
|
71
|
+
2. **Reference file links** — If multi-file, list reference files with descriptions
|
|
72
|
+
3. **Workflow** — Numbered steps with clear entry/exit criteria per step
|
|
73
|
+
4. **Output format** — What the skill produces (files, messages, reports)
|
|
74
|
+
|
|
75
|
+
Writing rules:
|
|
76
|
+
- Lead each step with an **action verb** (Parse, Read, Generate, Validate)
|
|
77
|
+
- Use `$ARGUMENTS` and `$N` for user input substitution
|
|
78
|
+
- Use XML tags (`<example>`, `<rules>`, `<output-format>`) for complex structure
|
|
79
|
+
- Include concrete examples — Claude treats examples as specifications
|
|
80
|
+
- Write "consider" or "evaluate" instead of "think" (for when thinking is disabled)
|
|
81
|
+
|
|
82
|
+
### Step 5: Add Behavioral Rules
|
|
83
|
+
|
|
84
|
+
Every skill needs explicit behavioral boundaries:
|
|
85
|
+
|
|
86
|
+
**Error handling** (mandatory — project convention):
|
|
87
|
+
```
|
|
88
|
+
When an error occurs, display the error clearly to the user with actionable guidance.
|
|
89
|
+
Do NOT silently fall back to defaults or placeholder data.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Guardrails** based on degree of freedom:
|
|
93
|
+
- **High freedom**: Add constraints on what the skill should NOT do. Be specific.
|
|
94
|
+
- **Medium freedom**: Define decision criteria for branching logic.
|
|
95
|
+
- **Low freedom**: Specify exact expected inputs/outputs and validation.
|
|
96
|
+
|
|
97
|
+
**Common rules to consider**:
|
|
98
|
+
- What happens when `$ARGUMENTS` is empty?
|
|
99
|
+
- What happens when required files don't exist?
|
|
100
|
+
- What are the skill's boundaries? (what it explicitly does NOT do)
|
|
101
|
+
- Should it ask for confirmation before destructive actions?
|
|
102
|
+
|
|
103
|
+
### Step 6: Write Reference Files (if needed)
|
|
104
|
+
|
|
105
|
+
For multi-file skills, create reference files:
|
|
106
|
+
|
|
107
|
+
- Each file covers one topic (patterns, field catalog, examples, etc.)
|
|
108
|
+
- Start with a heading and brief description of the file's purpose
|
|
109
|
+
- Add a table of contents if the file exceeds 100 lines
|
|
110
|
+
- Use consistent formatting (tables for catalogs, code blocks for examples)
|
|
111
|
+
|
|
112
|
+
### Step 7: Validate
|
|
113
|
+
|
|
114
|
+
Read `${CLAUDE_SKILL_DIR}/CHECKLIST.md` and verify the generated skill against every item.
|
|
115
|
+
|
|
116
|
+
Fix any issues before presenting the final output.
|
|
117
|
+
|
|
118
|
+
## Output
|
|
119
|
+
|
|
120
|
+
After generating the skill, present:
|
|
121
|
+
|
|
122
|
+
1. **File listing** — All files created with line counts
|
|
123
|
+
2. **Installation path** — `.claude/skills/<skill-name>/`
|
|
124
|
+
3. **Test invocation** — Example command to test the skill
|
|
125
|
+
|
|
126
|
+
Offer to:
|
|
127
|
+
- Run `/devlyn.review` on the generated skill for quality assurance
|
|
128
|
+
- Run `pyx-scan` if the skill will be published
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Examples
|
|
133
|
+
|
|
134
|
+
<example>
|
|
135
|
+
**Input**: `/generate-skill A skill that validates PR descriptions against a template`
|
|
136
|
+
|
|
137
|
+
**Output structure** (single file):
|
|
138
|
+
```
|
|
139
|
+
.claude/skills/validate-pr/
|
|
140
|
+
└── SKILL.md (~120 lines)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Frontmatter:
|
|
144
|
+
```yaml
|
|
145
|
+
name: validate-pr
|
|
146
|
+
description: >
|
|
147
|
+
Validate pull request descriptions against a project template.
|
|
148
|
+
Checks for required sections, formatting, and completeness.
|
|
149
|
+
Use when reviewing PRs or when user says "check PR", "validate PR description".
|
|
150
|
+
allowed-tools: Read, Grep, Glob, Bash(gh pr view *)
|
|
151
|
+
argument-hint: "[PR number or URL]"
|
|
152
|
+
```
|
|
153
|
+
</example>
|
|
154
|
+
|
|
155
|
+
<example>
|
|
156
|
+
**Input**: `/generate-skill A comprehensive code review skill with security, performance, and accessibility checks`
|
|
157
|
+
|
|
158
|
+
**Output structure** (multi-file):
|
|
159
|
+
```
|
|
160
|
+
.claude/skills/code-review/
|
|
161
|
+
├── SKILL.md (~200 lines) Main workflow
|
|
162
|
+
├── SECURITY.md (~150 lines) Security check patterns
|
|
163
|
+
├── PERFORMANCE.md (~120 lines) Performance anti-patterns
|
|
164
|
+
└── ACCESSIBILITY.md (~100 lines) A11y checklist
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Frontmatter:
|
|
168
|
+
```yaml
|
|
169
|
+
name: code-review
|
|
170
|
+
description: >
|
|
171
|
+
Comprehensive code review covering security vulnerabilities, performance
|
|
172
|
+
anti-patterns, and accessibility compliance. Produces a structured report
|
|
173
|
+
with severity ratings. Use when reviewing code, PRs, or when user says
|
|
174
|
+
"review code", "security check", "audit this".
|
|
175
|
+
allowed-tools: Read, Grep, Glob, LSP
|
|
176
|
+
argument-hint: "[file path, directory, or PR number]"
|
|
177
|
+
```
|
|
178
|
+
</example>
|