@atlashub/smartstack-cli 1.37.0 → 2.0.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/config/mcp-defaults.json +62 -0
- package/dist/index.js +57 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp-entry.mjs +16984 -0
- package/dist/mcp-entry.mjs.map +1 -0
- package/package.json +14 -5
- package/templates/agents/gitflow/start.md +5 -4
- package/templates/agents/mcp-healthcheck.md +15 -13
- package/templates/mcp-scaffolding/component.tsx.hbs +298 -0
- package/templates/mcp-scaffolding/controller.cs.hbs +184 -0
- package/templates/mcp-scaffolding/entity-extension.cs.hbs +231 -0
- package/templates/mcp-scaffolding/frontend/api-client.ts.hbs +116 -0
- package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +133 -0
- package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +134 -0
- package/templates/mcp-scaffolding/migrations/seed-roles.cs.hbs +261 -0
- package/templates/mcp-scaffolding/service-extension.cs.hbs +53 -0
- package/templates/mcp-scaffolding/tests/controller.test.cs.hbs +413 -0
- package/templates/mcp-scaffolding/tests/entity.test.cs.hbs +239 -0
- package/templates/mcp-scaffolding/tests/repository.test.cs.hbs +441 -0
- package/templates/mcp-scaffolding/tests/security.test.cs.hbs +442 -0
- package/templates/mcp-scaffolding/tests/service.test.cs.hbs +390 -0
- package/templates/mcp-scaffolding/tests/validator.test.cs.hbs +428 -0
- package/templates/ralph/README.md +3 -3
- package/templates/ralph/ralph.config.yaml +2 -2
- package/templates/skills/admin/SKILL.md +42 -0
- package/templates/skills/business-analyse/_shared.md +24 -1
- package/templates/skills/business-analyse/questionnaire/01-context.md +4 -4
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +3 -3
- package/templates/skills/business-analyse/questionnaire/03-scope.md +4 -4
- package/templates/skills/business-analyse/questionnaire/04-data.md +7 -7
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +1 -1
- package/templates/skills/business-analyse/questionnaire/06-security.md +3 -3
- package/templates/skills/business-analyse/questionnaire/07-ui.md +1 -1
- package/templates/skills/business-analyse/questionnaire/08-performance.md +3 -3
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +4 -4
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +2 -2
- package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +2 -2
- package/templates/skills/business-analyse/questionnaire/12-migration.md +1 -1
- package/templates/skills/business-analyse/questionnaire/13-cross-module.md +2 -2
- package/templates/skills/business-analyse/steps/step-01-discover.md +50 -25
- package/templates/skills/business-analyse/steps/step-05-handoff.md +133 -34
- package/templates/skills/cc-agent/SKILL.md +129 -0
- package/templates/skills/cc-agent/references/agent-frontmatter.md +213 -0
- package/templates/skills/cc-agent/references/permission-modes.md +102 -0
- package/templates/skills/cc-agent/references/tools-reference.md +144 -0
- package/templates/skills/cc-agent/steps/step-00-init.md +134 -0
- package/templates/skills/cc-agent/steps/step-01-design.md +186 -0
- package/templates/skills/cc-agent/steps/step-02-generate.md +204 -0
- package/templates/skills/cc-agent/steps/step-03-validate.md +130 -0
- package/templates/skills/cc-agent/templates/agent-categorized.md +67 -0
- package/templates/skills/cc-agent/templates/agent-standalone.md +56 -0
- package/templates/skills/cc-agent/templates/agent-with-skills.md +94 -0
- package/templates/skills/cc-audit/SKILL.md +108 -0
- package/templates/skills/cc-audit/references/agent-checklist.md +91 -0
- package/templates/skills/cc-audit/references/hook-checklist.md +110 -0
- package/templates/skills/cc-audit/references/skill-checklist.md +70 -0
- package/templates/skills/cc-audit/steps/step-00-init.md +98 -0
- package/templates/skills/cc-audit/steps/step-01-scan.md +142 -0
- package/templates/skills/cc-audit/steps/step-02-analyze.md +158 -0
- package/templates/skills/cc-audit/steps/step-03-report.md +142 -0
- package/templates/skills/cc-skill/SKILL.md +134 -0
- package/templates/skills/cc-skill/references/best-practices.md +167 -0
- package/templates/skills/cc-skill/references/frontmatter-reference.md +182 -0
- package/templates/skills/cc-skill/references/skill-patterns.md +199 -0
- package/templates/skills/cc-skill/steps/step-00-init.md +119 -0
- package/templates/skills/cc-skill/steps/step-01-design.md +199 -0
- package/templates/skills/cc-skill/steps/step-02-generate.md +145 -0
- package/templates/skills/cc-skill/steps/step-03-steps.md +151 -0
- package/templates/skills/cc-skill/steps/step-04-validate.md +124 -0
- package/templates/skills/cc-skill/templates/skill-forked.md +85 -0
- package/templates/skills/cc-skill/templates/skill-progressive.md +102 -0
- package/templates/skills/cc-skill/templates/skill-simple.md +75 -0
- package/templates/skills/cc-skill/templates/step-template.md +82 -0
- package/templates/skills/check-version/SKILL.md +6 -0
- package/templates/skills/debug/SKILL.md +4 -0
- package/templates/skills/documentation/SKILL.md +1 -0
- package/templates/skills/efcore/SKILL.md +5 -0
- package/templates/skills/efcore/steps/db/step-deploy.md +26 -5
- package/templates/skills/efcore/steps/shared/step-00-init.md +21 -7
- package/templates/skills/explore/SKILL.md +28 -32
- package/templates/skills/feature-full/SKILL.md +1 -0
- package/templates/skills/gitflow/SKILL.md +8 -0
- package/templates/skills/gitflow/steps/step-start.md +45 -10
- package/templates/skills/mcp/SKILL.md +38 -18
- package/templates/skills/quick-search/SKILL.md +8 -1
- package/templates/skills/ralph-loop/SKILL.md +1 -1
- package/templates/skills/ralph-loop/steps/step-00-init.md +8 -68
- package/templates/skills/ralph-loop/steps/step-04-check.md +1 -1
- package/templates/skills/refactor/SKILL.md +1 -0
- package/templates/skills/review-code/SKILL.md +7 -1
- package/templates/skills/ui-components/SKILL.md +31 -438
- package/templates/skills/ui-components/accessibility.md +170 -0
- package/templates/skills/ui-components/patterns/data-table.md +39 -0
- package/templates/skills/ui-components/patterns/entity-card.md +77 -0
- package/templates/skills/ui-components/patterns/grid-layout.md +91 -0
- package/templates/skills/ui-components/patterns/kanban.md +43 -0
- package/templates/skills/ui-components/style-guide.md +86 -0
- package/templates/skills/utils/SKILL.md +1 -0
- package/templates/skills/validate/SKILL.md +1 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Skill Best Practices
|
|
2
|
+
|
|
3
|
+
Based on official Claude Code documentation and SmartStack conventions.
|
|
4
|
+
|
|
5
|
+
## Design Principles
|
|
6
|
+
|
|
7
|
+
### 1. Keep SKILL.md Under 500 Lines
|
|
8
|
+
- Move detailed content to `references/` directory
|
|
9
|
+
- Move code templates to `templates/` directory
|
|
10
|
+
- Use progressive step loading for complex workflows
|
|
11
|
+
- Each step file should also be focused (< 200 lines ideal)
|
|
12
|
+
|
|
13
|
+
### 2. Write Clear Descriptions
|
|
14
|
+
- Use natural language keywords Claude can match against
|
|
15
|
+
- Include "Use this skill when:" trigger list
|
|
16
|
+
- Be specific about what the skill does AND does not do
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
# Good
|
|
20
|
+
description: |
|
|
21
|
+
Generate API controllers following REST conventions.
|
|
22
|
+
Use this skill when:
|
|
23
|
+
- Creating new API endpoints
|
|
24
|
+
- Adding CRUD operations to a module
|
|
25
|
+
- Generating controller tests
|
|
26
|
+
|
|
27
|
+
# Bad
|
|
28
|
+
description: Controller generation
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3. Set Invocation Mode Correctly
|
|
32
|
+
|
|
33
|
+
| Scenario | Setting |
|
|
34
|
+
|----------|---------|
|
|
35
|
+
| Research, analysis, exploration | `disable-model-invocation: false` |
|
|
36
|
+
| Code generation, scaffolding | `disable-model-invocation: false` |
|
|
37
|
+
| Deployment, publishing | `disable-model-invocation: true` |
|
|
38
|
+
| Git operations (commit, push) | `disable-model-invocation: true` |
|
|
39
|
+
| Database operations (reset, seed) | `disable-model-invocation: true` |
|
|
40
|
+
| Destructive operations | `disable-model-invocation: true` |
|
|
41
|
+
|
|
42
|
+
**Rule of thumb:** If the skill has side effects that can't be easily undone, set `disable-model-invocation: true`.
|
|
43
|
+
|
|
44
|
+
### 4. Use Progressive Step Loading for Complex Workflows
|
|
45
|
+
- Minimizes context usage (only current step loaded)
|
|
46
|
+
- State persists across steps via conversation
|
|
47
|
+
- Each step is self-contained and testable
|
|
48
|
+
- Easier to maintain and debug
|
|
49
|
+
|
|
50
|
+
### 5. Prefer Forked Context for Research
|
|
51
|
+
- Clean context = no interference from previous conversation
|
|
52
|
+
- Ideal for exploration, search, analysis
|
|
53
|
+
- Fast agents (haiku) for simple searches
|
|
54
|
+
- Full agents (sonnet/opus) for complex reasoning
|
|
55
|
+
|
|
56
|
+
## Structural Best Practices
|
|
57
|
+
|
|
58
|
+
### Directory Organization
|
|
59
|
+
```
|
|
60
|
+
my-skill/
|
|
61
|
+
├── SKILL.md # Main definition (< 500 lines)
|
|
62
|
+
├── steps/ # Progressive step files
|
|
63
|
+
│ ├── step-00-init.md
|
|
64
|
+
│ └── step-01-*.md
|
|
65
|
+
├── templates/ # Code templates for generation
|
|
66
|
+
├── references/ # Documentation and checklists
|
|
67
|
+
├── scripts/ # Executable scripts
|
|
68
|
+
└── examples/ # Example outputs
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Step File Convention
|
|
72
|
+
- Always start with `step-00-init.md` for initialization
|
|
73
|
+
- Number sequentially: step-00, step-01, step-02, ...
|
|
74
|
+
- Use descriptive names: step-01-analyze, step-02-generate
|
|
75
|
+
- Each step defines `next_step` in frontmatter (except last)
|
|
76
|
+
- Last step handles completion summary
|
|
77
|
+
|
|
78
|
+
### Frontmatter Minimalism
|
|
79
|
+
Only include fields that differ from defaults:
|
|
80
|
+
```yaml
|
|
81
|
+
# Good - minimal, clear
|
|
82
|
+
---
|
|
83
|
+
name: my-skill
|
|
84
|
+
description: What it does
|
|
85
|
+
disable-model-invocation: true
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
# Bad - redundant defaults
|
|
89
|
+
---
|
|
90
|
+
name: my-skill
|
|
91
|
+
description: What it does
|
|
92
|
+
disable-model-invocation: true
|
|
93
|
+
user-invocable: true # This is the default
|
|
94
|
+
model: inherit # This is the default
|
|
95
|
+
context: # Empty, not needed
|
|
96
|
+
---
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Content Best Practices
|
|
100
|
+
|
|
101
|
+
### 1. Use XML Sections Consistently
|
|
102
|
+
Standard order: objective → quick_start → parameters → workflow → state_variables → entry_point → step_files → execution_rules → success_criteria
|
|
103
|
+
|
|
104
|
+
### 2. Provide Usage Examples
|
|
105
|
+
Always include `<quick_start>` with realistic examples:
|
|
106
|
+
```xml
|
|
107
|
+
<quick_start>
|
|
108
|
+
` ` `bash
|
|
109
|
+
/my-skill basic-usage
|
|
110
|
+
/my-skill --flag advanced-usage
|
|
111
|
+
/my-skill subcommand arg1 arg2
|
|
112
|
+
` ` `
|
|
113
|
+
</quick_start>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3. Document State Variables
|
|
117
|
+
For progressive skills, always document what persists:
|
|
118
|
+
```xml
|
|
119
|
+
<state_variables>
|
|
120
|
+
| Variable | Type | Description |
|
|
121
|
+
|----------|------|-------------|
|
|
122
|
+
| `{name}` | string | Required - item name |
|
|
123
|
+
| `{auto}` | boolean | Optional - skip prompts |
|
|
124
|
+
</state_variables>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 4. Define Clear Success Criteria
|
|
128
|
+
What does "done" look like?
|
|
129
|
+
```xml
|
|
130
|
+
<success_criteria>
|
|
131
|
+
- Files generated at correct paths
|
|
132
|
+
- No validation errors
|
|
133
|
+
- Build passes (if applicable)
|
|
134
|
+
- User informed of next steps
|
|
135
|
+
</success_criteria>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 5. Use Compact Output
|
|
139
|
+
Prefer tables over prose for summaries:
|
|
140
|
+
```markdown
|
|
141
|
+
| Metric | Value |
|
|
142
|
+
|--------|-------|
|
|
143
|
+
| Files created | 5 |
|
|
144
|
+
| Lines generated | 342 |
|
|
145
|
+
| Warnings | 0 |
|
|
146
|
+
| Status | Complete |
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Anti-Patterns to Avoid
|
|
150
|
+
|
|
151
|
+
| Anti-Pattern | Why | Better |
|
|
152
|
+
|-------------|-----|--------|
|
|
153
|
+
| Huge SKILL.md (> 500 lines) | Wastes context | Split into steps + references |
|
|
154
|
+
| Vague description | Claude can't auto-invoke | Use trigger keywords |
|
|
155
|
+
| Missing entry_point | Steps won't load | Always define entry_point |
|
|
156
|
+
| Circular step refs | Infinite loop | Linear step chain |
|
|
157
|
+
| Hardcoded paths | Not portable | Use relative paths |
|
|
158
|
+
| No success criteria | Unclear completion | Define measurable criteria |
|
|
159
|
+
| Skipping validation step | Quality issues | Always validate at end |
|
|
160
|
+
|
|
161
|
+
## Testing Your Skill
|
|
162
|
+
|
|
163
|
+
1. **Manual test:** Run `/my-skill` with various arguments
|
|
164
|
+
2. **Edge cases:** Test with missing args, invalid input, empty state
|
|
165
|
+
3. **Audit:** Run `/cc-audit` to validate structure
|
|
166
|
+
4. **Step chain:** Verify each step loads the next correctly
|
|
167
|
+
5. **Cross-project:** Test in different project contexts if applicable
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Skill Frontmatter Reference
|
|
2
|
+
|
|
3
|
+
Complete reference for all SKILL.md YAML frontmatter fields, based on the official Claude Code documentation.
|
|
4
|
+
|
|
5
|
+
Source: https://code.claude.com/docs/en/skills
|
|
6
|
+
|
|
7
|
+
## Required Fields
|
|
8
|
+
|
|
9
|
+
### `name`
|
|
10
|
+
- **Type:** string
|
|
11
|
+
- **Required:** YES
|
|
12
|
+
- **Constraints:** lowercase, max 64 characters, kebab-case
|
|
13
|
+
- **Purpose:** Unique identifier. Becomes the `/name` command.
|
|
14
|
+
- **Examples:**
|
|
15
|
+
```yaml
|
|
16
|
+
name: my-skill
|
|
17
|
+
name: code-review
|
|
18
|
+
name: deploy-staging
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### `description`
|
|
22
|
+
- **Type:** string (multi-line supported)
|
|
23
|
+
- **Required:** YES
|
|
24
|
+
- **Purpose:** Claude uses this to decide when to auto-invoke the skill. Include trigger keywords.
|
|
25
|
+
- **Examples:**
|
|
26
|
+
```yaml
|
|
27
|
+
description: Generate API controllers following REST conventions.
|
|
28
|
+
|
|
29
|
+
description: |
|
|
30
|
+
Deploy application to staging environment.
|
|
31
|
+
Use this skill when:
|
|
32
|
+
- User mentions "deploy", "staging", "release"
|
|
33
|
+
- User wants to push changes to staging
|
|
34
|
+
- Deployment pipeline needs to be triggered
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Optional Fields
|
|
38
|
+
|
|
39
|
+
### `disable-model-invocation`
|
|
40
|
+
- **Type:** boolean
|
|
41
|
+
- **Default:** false
|
|
42
|
+
- **Purpose:** When `true`, only the user can invoke via `/name`. Claude will never auto-invoke.
|
|
43
|
+
- **Use for:** Side-effect operations (deploy, commit, publish, delete)
|
|
44
|
+
- **Example:**
|
|
45
|
+
```yaml
|
|
46
|
+
disable-model-invocation: true
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### `user-invocable`
|
|
50
|
+
- **Type:** boolean
|
|
51
|
+
- **Default:** true
|
|
52
|
+
- **Purpose:** When `false`, skill is hidden from /menu. Used for background knowledge injection.
|
|
53
|
+
- **Example:**
|
|
54
|
+
```yaml
|
|
55
|
+
user-invocable: false
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `allowed-tools`
|
|
59
|
+
- **Type:** string (comma-separated)
|
|
60
|
+
- **Default:** (none)
|
|
61
|
+
- **Purpose:** Tools the skill can use without triggering permission prompts.
|
|
62
|
+
- **Valid tools:** Read, Write, Edit, Bash, Glob, Grep, Task, WebFetch, WebSearch, NotebookEdit, AskUserQuestion, TodoWrite, Skill, ToolSearch
|
|
63
|
+
- **Example:**
|
|
64
|
+
```yaml
|
|
65
|
+
allowed-tools: "Read, Grep, Glob, WebSearch, WebFetch"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### `model`
|
|
69
|
+
- **Type:** string
|
|
70
|
+
- **Default:** inherit
|
|
71
|
+
- **Valid values:** inherit, sonnet, opus, haiku
|
|
72
|
+
- **Purpose:** Override the model used when this skill runs.
|
|
73
|
+
- **Guidance:**
|
|
74
|
+
- `haiku` - Fast, cheap. Simple tasks.
|
|
75
|
+
- `sonnet` - Balanced. Most tasks.
|
|
76
|
+
- `opus` - Most capable. Complex reasoning.
|
|
77
|
+
- `inherit` - Use user's configured model.
|
|
78
|
+
- **Example:**
|
|
79
|
+
```yaml
|
|
80
|
+
model: haiku
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### `context`
|
|
84
|
+
- **Type:** string
|
|
85
|
+
- **Valid values:** fork
|
|
86
|
+
- **Purpose:** Run skill in an isolated subagent context. Separate conversation, clean state.
|
|
87
|
+
- **Example:**
|
|
88
|
+
```yaml
|
|
89
|
+
context: fork
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `agent`
|
|
93
|
+
- **Type:** string
|
|
94
|
+
- **Purpose:** Which subagent type to use when `context: fork`.
|
|
95
|
+
- **Valid values:** Explore, Plan, general-purpose, Bash, or any custom agent name
|
|
96
|
+
- **Example:**
|
|
97
|
+
```yaml
|
|
98
|
+
context: fork
|
|
99
|
+
agent: Explore
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### `argument-hint`
|
|
103
|
+
- **Type:** string
|
|
104
|
+
- **Purpose:** Autocomplete hint shown in the /menu.
|
|
105
|
+
- **Example:**
|
|
106
|
+
```yaml
|
|
107
|
+
argument-hint: "<command> [options]"
|
|
108
|
+
argument-hint: "[filename]"
|
|
109
|
+
argument-hint: "<create|update> [name]"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### `hooks`
|
|
113
|
+
- **Type:** object
|
|
114
|
+
- **Purpose:** Lifecycle hooks scoped to this skill.
|
|
115
|
+
- **Events:** PreToolUse, PostToolUse, Stop, SessionStart, etc.
|
|
116
|
+
- **Example:**
|
|
117
|
+
```yaml
|
|
118
|
+
hooks:
|
|
119
|
+
PreToolUse:
|
|
120
|
+
- matcher: "Bash"
|
|
121
|
+
hooks:
|
|
122
|
+
- type: command
|
|
123
|
+
command: "./scripts/validate.sh"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Dynamic Placeholders
|
|
127
|
+
|
|
128
|
+
Available in SKILL.md content (not frontmatter):
|
|
129
|
+
|
|
130
|
+
| Placeholder | Description |
|
|
131
|
+
|-------------|-------------|
|
|
132
|
+
| `$ARGUMENTS` | All arguments passed to skill |
|
|
133
|
+
| `$1`, `$2`, ... | Positional arguments |
|
|
134
|
+
| `$ARGUMENTS[0]` | Same as $1 |
|
|
135
|
+
| `${CLAUDE_SESSION_ID}` | Current session ID |
|
|
136
|
+
| `` !`command` `` | Run shell command, inject output |
|
|
137
|
+
|
|
138
|
+
## Examples
|
|
139
|
+
|
|
140
|
+
### Minimal Skill
|
|
141
|
+
```yaml
|
|
142
|
+
---
|
|
143
|
+
name: hello
|
|
144
|
+
description: Greet the user
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
Say hello to the user: $ARGUMENTS
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Side-Effect Skill
|
|
151
|
+
```yaml
|
|
152
|
+
---
|
|
153
|
+
name: deploy
|
|
154
|
+
description: Deploy to staging
|
|
155
|
+
disable-model-invocation: true
|
|
156
|
+
argument-hint: "[environment]"
|
|
157
|
+
---
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Research Skill
|
|
161
|
+
```yaml
|
|
162
|
+
---
|
|
163
|
+
name: search-code
|
|
164
|
+
description: Search codebase for patterns
|
|
165
|
+
context: fork
|
|
166
|
+
agent: Explore
|
|
167
|
+
allowed-tools: "Read, Grep, Glob"
|
|
168
|
+
argument-hint: "<query>"
|
|
169
|
+
---
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Complex Workflow
|
|
173
|
+
```yaml
|
|
174
|
+
---
|
|
175
|
+
name: generate-api
|
|
176
|
+
description: |
|
|
177
|
+
Generate API endpoints. Use when:
|
|
178
|
+
- Creating new API routes
|
|
179
|
+
- Adding CRUD operations
|
|
180
|
+
argument-hint: "<entity> [--with-tests]"
|
|
181
|
+
---
|
|
182
|
+
```
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Skill Patterns Reference
|
|
2
|
+
|
|
3
|
+
Common patterns used in Claude Code skills.
|
|
4
|
+
|
|
5
|
+
## Pattern 1: Subcommands
|
|
6
|
+
|
|
7
|
+
Route to different behaviors based on first argument. Used by: efcore, gitflow.
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
---
|
|
11
|
+
name: my-tool
|
|
12
|
+
description: Multi-command tool
|
|
13
|
+
argument-hint: "<command> [options]"
|
|
14
|
+
disable-model-invocation: true
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<quick_start>
|
|
18
|
+
` ` `bash
|
|
19
|
+
/my-tool status
|
|
20
|
+
/my-tool create
|
|
21
|
+
/my-tool deploy
|
|
22
|
+
` ` `
|
|
23
|
+
</quick_start>
|
|
24
|
+
|
|
25
|
+
<parameters>
|
|
26
|
+
<subcommands>
|
|
27
|
+
| Command | Description |
|
|
28
|
+
|---------|-------------|
|
|
29
|
+
| `status` | Show current status |
|
|
30
|
+
| `create` | Create new item |
|
|
31
|
+
| `deploy` | Deploy to environment |
|
|
32
|
+
</subcommands>
|
|
33
|
+
</parameters>
|
|
34
|
+
|
|
35
|
+
<entry_point>
|
|
36
|
+
**ROUTING LOGIC:**
|
|
37
|
+
1. Parse command from input
|
|
38
|
+
2. Route to command-specific step:
|
|
39
|
+
|
|
40
|
+
| Command | Route To |
|
|
41
|
+
|---------|----------|
|
|
42
|
+
| `status` | `steps/status/step-00-init.md` |
|
|
43
|
+
| `create` | `steps/create/step-00-init.md` |
|
|
44
|
+
| `deploy` | `steps/deploy/step-00-init.md` |
|
|
45
|
+
</entry_point>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Pattern 2: Flags (Enable/Disable)
|
|
49
|
+
|
|
50
|
+
Toggle behavior with flags. Used by: controller.
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
<parameters>
|
|
54
|
+
<flags>
|
|
55
|
+
**Enable flags (lowercase):**
|
|
56
|
+
| Short | Long | Description |
|
|
57
|
+
|-------|------|-------------|
|
|
58
|
+
| `-a` | `--auto` | Skip confirmations |
|
|
59
|
+
| `-v` | `--verbose` | Detailed output |
|
|
60
|
+
|
|
61
|
+
**Disable flags (UPPERCASE):**
|
|
62
|
+
| Short | Long | Description |
|
|
63
|
+
|-------|------|-------------|
|
|
64
|
+
| `-A` | `--no-auto` | Disable auto mode |
|
|
65
|
+
| `-V` | `--no-verbose` | Disable verbose |
|
|
66
|
+
</flags>
|
|
67
|
+
</parameters>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Parsing in step-00-init:
|
|
71
|
+
```
|
|
72
|
+
Enable flags (lowercase - turn ON):
|
|
73
|
+
-a or --auto → {auto_mode} = true
|
|
74
|
+
-v or --verbose → {verbose} = true
|
|
75
|
+
|
|
76
|
+
Disable flags (UPPERCASE - turn OFF):
|
|
77
|
+
-A or --no-auto → {auto_mode} = false
|
|
78
|
+
-V or --no-verbose → {verbose} = false
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Pattern 3: Dynamic Context Injection
|
|
82
|
+
|
|
83
|
+
Inject runtime information into skill content. Used by: efcore.
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
---
|
|
87
|
+
name: my-skill
|
|
88
|
+
description: Skill with runtime context
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Current state (auto-injected)
|
|
92
|
+
- Branch: !`git branch --show-current`
|
|
93
|
+
- Files: !`ls -la src/ | head -10`
|
|
94
|
+
- Version: !`node -p "require('./package.json').version"`
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The `` !`command` `` syntax runs the command before skill content is sent to Claude.
|
|
98
|
+
|
|
99
|
+
## Pattern 4: Argument Placeholders
|
|
100
|
+
|
|
101
|
+
Access user arguments in skill content.
|
|
102
|
+
|
|
103
|
+
```markdown
|
|
104
|
+
## Task
|
|
105
|
+
Process the following: $ARGUMENTS
|
|
106
|
+
|
|
107
|
+
## Specific arguments
|
|
108
|
+
First arg: $1
|
|
109
|
+
Second arg: $2
|
|
110
|
+
All args: $ARGUMENTS
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Pattern 5: XML-Style Sections
|
|
114
|
+
|
|
115
|
+
Structure skill content with XML tags. Standard sections:
|
|
116
|
+
|
|
117
|
+
| Section | Purpose | When to use |
|
|
118
|
+
|---------|---------|-------------|
|
|
119
|
+
| `<objective>` | One-paragraph purpose statement | Always |
|
|
120
|
+
| `<quick_start>` | Usage examples | Always |
|
|
121
|
+
| `<parameters>` | Flags, subcommands, parsing | When skill has args |
|
|
122
|
+
| `<workflow>` | High-level numbered steps | Always |
|
|
123
|
+
| `<state_variables>` | Persistent variables table | Progressive skills |
|
|
124
|
+
| `<entry_point>` | First step to load | Progressive skills |
|
|
125
|
+
| `<step_files>` | Step file mapping table | Progressive skills |
|
|
126
|
+
| `<execution_rules>` | Key constraints | Always |
|
|
127
|
+
| `<security_rules>` | Mandatory security checks | When security-critical |
|
|
128
|
+
| `<success_criteria>` | Completion conditions | Always |
|
|
129
|
+
|
|
130
|
+
## Pattern 6: State Variables
|
|
131
|
+
|
|
132
|
+
Persist data across progressive steps.
|
|
133
|
+
|
|
134
|
+
```xml
|
|
135
|
+
<state_variables>
|
|
136
|
+
| Variable | Type | Description |
|
|
137
|
+
|----------|------|-------------|
|
|
138
|
+
| `{name}` | string | Item name |
|
|
139
|
+
| `{scope}` | string | Target scope |
|
|
140
|
+
| `{auto_mode}` | boolean | Skip confirmations |
|
|
141
|
+
| `{items}` | object[] | Collected items |
|
|
142
|
+
</state_variables>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Variables are referenced as `{variable_name}` throughout steps and are maintained in conversation context.
|
|
146
|
+
|
|
147
|
+
## Pattern 7: AskUserQuestion Integration
|
|
148
|
+
|
|
149
|
+
Use AskUserQuestion for interactive choices.
|
|
150
|
+
|
|
151
|
+
```yaml
|
|
152
|
+
AskUserQuestion:
|
|
153
|
+
header: "Short Label" # Max 12 chars
|
|
154
|
+
question: "Full question?"
|
|
155
|
+
options:
|
|
156
|
+
- label: "Option A (Recommended)"
|
|
157
|
+
description: "What this option does"
|
|
158
|
+
- label: "Option B"
|
|
159
|
+
description: "What this option does"
|
|
160
|
+
multiSelect: false # true for checkboxes
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Pattern 8: Skill Chaining
|
|
164
|
+
|
|
165
|
+
Call other skills from within a skill.
|
|
166
|
+
|
|
167
|
+
```markdown
|
|
168
|
+
After completing this step:
|
|
169
|
+
1. Run `/other-skill arg1`
|
|
170
|
+
2. Continue with next step
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Or use the Skill tool:
|
|
174
|
+
```
|
|
175
|
+
Use Skill tool: skill="other-skill", args="arg1 arg2"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Pattern 9: MCP Tool Integration
|
|
179
|
+
|
|
180
|
+
Call MCP tools from skill steps.
|
|
181
|
+
|
|
182
|
+
```markdown
|
|
183
|
+
### Validate conventions
|
|
184
|
+
Call `mcp__smartstack__validate_conventions` with:
|
|
185
|
+
- target: "{entity_path}"
|
|
186
|
+
- type: "controller"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Pattern 10: Compact Output Tables
|
|
190
|
+
|
|
191
|
+
Display results in scannable tables, not prose.
|
|
192
|
+
|
|
193
|
+
```markdown
|
|
194
|
+
| Property | Value |
|
|
195
|
+
|----------|-------|
|
|
196
|
+
| Name | {name} |
|
|
197
|
+
| Status | OK |
|
|
198
|
+
| Files | 3 created |
|
|
199
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-00-init
|
|
3
|
+
description: Parse subcommand, skill name, scope, and resolve target directory
|
|
4
|
+
next_step: steps/step-01-design.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 0: Initialization
|
|
8
|
+
|
|
9
|
+
## MANDATORY EXECUTION RULES:
|
|
10
|
+
- ALWAYS parse subcommand first (create or update)
|
|
11
|
+
- ALWAYS validate skill name format
|
|
12
|
+
- ALWAYS resolve target directory before proceeding
|
|
13
|
+
- For UPDATE: verify skill exists before continuing
|
|
14
|
+
|
|
15
|
+
## YOUR TASK:
|
|
16
|
+
Parse input arguments, validate the skill name, and resolve the target directory.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## EXECUTION SEQUENCE:
|
|
21
|
+
|
|
22
|
+
### 1. Parse Input
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Arguments from $ARGUMENTS:
|
|
26
|
+
First word → {subcommand} ("create" or "update")
|
|
27
|
+
Second word → {skill_name} (lowercase, kebab-case)
|
|
28
|
+
--scope X → {scope} (default: "project")
|
|
29
|
+
--type X → {skill_type} (optional, skip type selection in step-01)
|
|
30
|
+
|
|
31
|
+
Valid subcommands: create, update
|
|
32
|
+
Valid scopes: project, global, templates
|
|
33
|
+
Valid types: simple, progressive, forked
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If {subcommand} is missing or invalid:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
AskUserQuestion:
|
|
40
|
+
header: "Action"
|
|
41
|
+
question: "What do you want to do?"
|
|
42
|
+
options:
|
|
43
|
+
- label: "Create"
|
|
44
|
+
description: "Create a new skill from scratch"
|
|
45
|
+
- label: "Update"
|
|
46
|
+
description: "Update an existing skill"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Validate Skill Name
|
|
50
|
+
|
|
51
|
+
If {skill_name} missing:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
AskUserQuestion:
|
|
55
|
+
header: "Name"
|
|
56
|
+
question: "What is the skill name? (lowercase, kebab-case, max 64 chars)"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Validation rules:
|
|
60
|
+
- Lowercase only
|
|
61
|
+
- Kebab-case (hyphens, no spaces or underscores)
|
|
62
|
+
- Max 64 characters
|
|
63
|
+
- No special characters except hyphens
|
|
64
|
+
- Must not conflict with existing built-in commands (/help, /clear, /compact, etc.)
|
|
65
|
+
|
|
66
|
+
### 3. Resolve Target Directory
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Based on {scope}:
|
|
70
|
+
|
|
71
|
+
"project" →
|
|
72
|
+
{target_dir} = "{cwd}/.claude/skills/{skill_name}/"
|
|
73
|
+
|
|
74
|
+
"global" →
|
|
75
|
+
{target_dir} = "~/.claude/skills/{skill_name}/"
|
|
76
|
+
Resolve ~ to actual home directory
|
|
77
|
+
|
|
78
|
+
"templates" →
|
|
79
|
+
{target_dir} = "{cwd}/templates/skills/{skill_name}/"
|
|
80
|
+
Verify this is a SmartStack CLI project (templates/ exists)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 4. Check Existing
|
|
84
|
+
|
|
85
|
+
**For CREATE:**
|
|
86
|
+
- Verify {target_dir} does NOT already exist
|
|
87
|
+
- If exists: warn and ask to overwrite or switch to update
|
|
88
|
+
|
|
89
|
+
**For UPDATE:**
|
|
90
|
+
- Verify {target_dir} exists and contains SKILL.md
|
|
91
|
+
- If missing: warn and ask to switch to create
|
|
92
|
+
- If exists: read SKILL.md and extract current frontmatter
|
|
93
|
+
|
|
94
|
+
### 5. Show Summary
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Skill Configuration:
|
|
98
|
+
|
|
99
|
+
| Setting | Value |
|
|
100
|
+
|---------|-------|
|
|
101
|
+
| Action | {subcommand} |
|
|
102
|
+
| Name | {skill_name} |
|
|
103
|
+
| Scope | {scope} |
|
|
104
|
+
| Target | {target_dir} |
|
|
105
|
+
| Type | {skill_type} (if pre-set) |
|
|
106
|
+
|
|
107
|
+
→ Designing skill...
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## SUCCESS METRICS:
|
|
113
|
+
- Subcommand correctly identified
|
|
114
|
+
- Skill name validated
|
|
115
|
+
- Target directory resolved and checked
|
|
116
|
+
- Summary displayed
|
|
117
|
+
|
|
118
|
+
## NEXT STEP:
|
|
119
|
+
After showing summary, proceed directly to `./step-01-design.md`
|