@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.
Files changed (99) hide show
  1. package/config/mcp-defaults.json +62 -0
  2. package/dist/index.js +57 -4
  3. package/dist/index.js.map +1 -1
  4. package/dist/mcp-entry.mjs +16984 -0
  5. package/dist/mcp-entry.mjs.map +1 -0
  6. package/package.json +14 -5
  7. package/templates/agents/gitflow/start.md +5 -4
  8. package/templates/agents/mcp-healthcheck.md +15 -13
  9. package/templates/mcp-scaffolding/component.tsx.hbs +298 -0
  10. package/templates/mcp-scaffolding/controller.cs.hbs +184 -0
  11. package/templates/mcp-scaffolding/entity-extension.cs.hbs +231 -0
  12. package/templates/mcp-scaffolding/frontend/api-client.ts.hbs +116 -0
  13. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +133 -0
  14. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +134 -0
  15. package/templates/mcp-scaffolding/migrations/seed-roles.cs.hbs +261 -0
  16. package/templates/mcp-scaffolding/service-extension.cs.hbs +53 -0
  17. package/templates/mcp-scaffolding/tests/controller.test.cs.hbs +413 -0
  18. package/templates/mcp-scaffolding/tests/entity.test.cs.hbs +239 -0
  19. package/templates/mcp-scaffolding/tests/repository.test.cs.hbs +441 -0
  20. package/templates/mcp-scaffolding/tests/security.test.cs.hbs +442 -0
  21. package/templates/mcp-scaffolding/tests/service.test.cs.hbs +390 -0
  22. package/templates/mcp-scaffolding/tests/validator.test.cs.hbs +428 -0
  23. package/templates/ralph/README.md +3 -3
  24. package/templates/ralph/ralph.config.yaml +2 -2
  25. package/templates/skills/admin/SKILL.md +42 -0
  26. package/templates/skills/business-analyse/_shared.md +24 -1
  27. package/templates/skills/business-analyse/questionnaire/01-context.md +4 -4
  28. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +3 -3
  29. package/templates/skills/business-analyse/questionnaire/03-scope.md +4 -4
  30. package/templates/skills/business-analyse/questionnaire/04-data.md +7 -7
  31. package/templates/skills/business-analyse/questionnaire/05-integrations.md +1 -1
  32. package/templates/skills/business-analyse/questionnaire/06-security.md +3 -3
  33. package/templates/skills/business-analyse/questionnaire/07-ui.md +1 -1
  34. package/templates/skills/business-analyse/questionnaire/08-performance.md +3 -3
  35. package/templates/skills/business-analyse/questionnaire/09-constraints.md +4 -4
  36. package/templates/skills/business-analyse/questionnaire/10-documentation.md +2 -2
  37. package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +2 -2
  38. package/templates/skills/business-analyse/questionnaire/12-migration.md +1 -1
  39. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +2 -2
  40. package/templates/skills/business-analyse/steps/step-01-discover.md +50 -25
  41. package/templates/skills/business-analyse/steps/step-05-handoff.md +133 -34
  42. package/templates/skills/cc-agent/SKILL.md +129 -0
  43. package/templates/skills/cc-agent/references/agent-frontmatter.md +213 -0
  44. package/templates/skills/cc-agent/references/permission-modes.md +102 -0
  45. package/templates/skills/cc-agent/references/tools-reference.md +144 -0
  46. package/templates/skills/cc-agent/steps/step-00-init.md +134 -0
  47. package/templates/skills/cc-agent/steps/step-01-design.md +186 -0
  48. package/templates/skills/cc-agent/steps/step-02-generate.md +204 -0
  49. package/templates/skills/cc-agent/steps/step-03-validate.md +130 -0
  50. package/templates/skills/cc-agent/templates/agent-categorized.md +67 -0
  51. package/templates/skills/cc-agent/templates/agent-standalone.md +56 -0
  52. package/templates/skills/cc-agent/templates/agent-with-skills.md +94 -0
  53. package/templates/skills/cc-audit/SKILL.md +108 -0
  54. package/templates/skills/cc-audit/references/agent-checklist.md +91 -0
  55. package/templates/skills/cc-audit/references/hook-checklist.md +110 -0
  56. package/templates/skills/cc-audit/references/skill-checklist.md +70 -0
  57. package/templates/skills/cc-audit/steps/step-00-init.md +98 -0
  58. package/templates/skills/cc-audit/steps/step-01-scan.md +142 -0
  59. package/templates/skills/cc-audit/steps/step-02-analyze.md +158 -0
  60. package/templates/skills/cc-audit/steps/step-03-report.md +142 -0
  61. package/templates/skills/cc-skill/SKILL.md +134 -0
  62. package/templates/skills/cc-skill/references/best-practices.md +167 -0
  63. package/templates/skills/cc-skill/references/frontmatter-reference.md +182 -0
  64. package/templates/skills/cc-skill/references/skill-patterns.md +199 -0
  65. package/templates/skills/cc-skill/steps/step-00-init.md +119 -0
  66. package/templates/skills/cc-skill/steps/step-01-design.md +199 -0
  67. package/templates/skills/cc-skill/steps/step-02-generate.md +145 -0
  68. package/templates/skills/cc-skill/steps/step-03-steps.md +151 -0
  69. package/templates/skills/cc-skill/steps/step-04-validate.md +124 -0
  70. package/templates/skills/cc-skill/templates/skill-forked.md +85 -0
  71. package/templates/skills/cc-skill/templates/skill-progressive.md +102 -0
  72. package/templates/skills/cc-skill/templates/skill-simple.md +75 -0
  73. package/templates/skills/cc-skill/templates/step-template.md +82 -0
  74. package/templates/skills/check-version/SKILL.md +6 -0
  75. package/templates/skills/debug/SKILL.md +4 -0
  76. package/templates/skills/documentation/SKILL.md +1 -0
  77. package/templates/skills/efcore/SKILL.md +5 -0
  78. package/templates/skills/efcore/steps/db/step-deploy.md +26 -5
  79. package/templates/skills/efcore/steps/shared/step-00-init.md +21 -7
  80. package/templates/skills/explore/SKILL.md +28 -32
  81. package/templates/skills/feature-full/SKILL.md +1 -0
  82. package/templates/skills/gitflow/SKILL.md +8 -0
  83. package/templates/skills/gitflow/steps/step-start.md +45 -10
  84. package/templates/skills/mcp/SKILL.md +38 -18
  85. package/templates/skills/quick-search/SKILL.md +8 -1
  86. package/templates/skills/ralph-loop/SKILL.md +1 -1
  87. package/templates/skills/ralph-loop/steps/step-00-init.md +8 -68
  88. package/templates/skills/ralph-loop/steps/step-04-check.md +1 -1
  89. package/templates/skills/refactor/SKILL.md +1 -0
  90. package/templates/skills/review-code/SKILL.md +7 -1
  91. package/templates/skills/ui-components/SKILL.md +31 -438
  92. package/templates/skills/ui-components/accessibility.md +170 -0
  93. package/templates/skills/ui-components/patterns/data-table.md +39 -0
  94. package/templates/skills/ui-components/patterns/entity-card.md +77 -0
  95. package/templates/skills/ui-components/patterns/grid-layout.md +91 -0
  96. package/templates/skills/ui-components/patterns/kanban.md +43 -0
  97. package/templates/skills/ui-components/style-guide.md +86 -0
  98. package/templates/skills/utils/SKILL.md +1 -0
  99. package/templates/skills/validate/SKILL.md +1 -0
@@ -0,0 +1,94 @@
1
+ # Template: Agent with Preloaded Skills
2
+
3
+ Use this template for agents that need skills injected at startup for domain knowledge.
4
+
5
+ ## Generated agent file format:
6
+
7
+ ```yaml
8
+ ---
9
+ name: {{AGENT_NAME}}
10
+ description: {{DESCRIPTION}}
11
+ {{#if MODEL}}
12
+ model: {{MODEL}}
13
+ {{/if}}
14
+ {{#if TOOLS}}
15
+ tools: "{{TOOLS}}"
16
+ {{/if}}
17
+ {{#if PERMISSION_MODE}}
18
+ permissionMode: {{PERMISSION_MODE}}
19
+ {{/if}}
20
+ skills:
21
+ {{#each SKILLS}}
22
+ - {{this}}
23
+ {{/each}}
24
+ {{#if COLOR}}
25
+ color: {{COLOR}}
26
+ {{/if}}
27
+ ---
28
+
29
+ {{SYSTEM_PROMPT}}
30
+
31
+ ## Preloaded Knowledge
32
+
33
+ This agent has the following skills preloaded for domain expertise:
34
+ {{#each SKILLS}}
35
+ - **{{this}}**: Provides knowledge about {{SKILL_PURPOSE}}
36
+ {{/each}}
37
+
38
+ ## Workflow
39
+
40
+ 1. **{{STEP_1_NAME}}**: {{STEP_1_DESC}}
41
+ 2. **{{STEP_2_NAME}}**: {{STEP_2_DESC}}
42
+ 3. **{{STEP_3_NAME}}**: {{STEP_3_DESC}}
43
+
44
+ ## Execution Rules
45
+
46
+ - {{RULE_1}}
47
+ - {{RULE_2}}
48
+ - Always reference preloaded skill knowledge when applicable
49
+ - {{RULE_3}}
50
+
51
+ ## Output Format
52
+
53
+ {{OUTPUT_FORMAT_DESCRIPTION}}
54
+ ```
55
+
56
+ ## How Skills Preloading Works:
57
+ - The `skills` field injects the FULL content of each listed skill into the agent's context at startup
58
+ - This gives the agent domain-specific knowledge without needing to search for it
59
+ - Increases initial context size but improves response quality
60
+ - Skills must exist in the same scope or a higher-priority scope
61
+
62
+ ## When to Use:
63
+ - Agent needs deep domain knowledge (e.g., code reviewer needs review-code skill)
64
+ - Agent operates in a specific framework context
65
+ - Agent needs access to conventions and patterns
66
+ - Agent should follow specific workflows defined in skills
67
+
68
+ ## Considerations:
69
+ - Each preloaded skill adds to context size
70
+ - Limit to 1-3 skills for optimal performance
71
+ - Prefer specific skills over broad ones
72
+ - Ensure skills are relevant to the agent's purpose
73
+
74
+ ## Example:
75
+ ```yaml
76
+ ---
77
+ name: smartstack-reviewer
78
+ description: Code reviewer specialized in SmartStack conventions
79
+ model: sonnet
80
+ tools: "Read, Grep, Glob"
81
+ permissionMode: plan
82
+ skills:
83
+ - review-code
84
+ - validate
85
+ ---
86
+
87
+ You are a SmartStack-aware code reviewer. Use the preloaded review-code
88
+ and validate skills to check code against SmartStack conventions.
89
+ ```
90
+
91
+ ## Notes:
92
+ - The code-reviewer agent in SmartStack uses this pattern (loads review-code skill)
93
+ - Keep the number of preloaded skills minimal (1-3)
94
+ - Agent description should mention the specialized knowledge area
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: cc-audit
3
+ description: |
4
+ Audit Claude Code components (skills, agents, hooks, settings).
5
+ Use this skill when:
6
+ - Checking component health and conventions
7
+ - Inventorying all components in a project
8
+ - Validating structure before deployment
9
+ - Verifying cross-references between components
10
+ argument-hint: "[project|global|templates]"
11
+ disable-model-invocation: true
12
+ ---
13
+
14
+ <objective>
15
+ Audit all Claude Code components (skills, agents, hooks, settings) in a given scope, validate their structure against official conventions, and generate a comprehensive report with actionable recommendations.
16
+ </objective>
17
+
18
+ <quick_start>
19
+
20
+ ```bash
21
+ /cc-audit # Audit current project (.claude/)
22
+ /cc-audit project # Audit project-level components
23
+ /cc-audit global # Audit user-level (~/.claude/)
24
+ /cc-audit templates # Audit SmartStack CLI templates/
25
+ /cc-audit all # Audit all scopes
26
+ ```
27
+
28
+ </quick_start>
29
+
30
+ <parameters>
31
+
32
+ <flags>
33
+ | Flag | Description |
34
+ |------|-------------|
35
+ | `project` | Scan `.claude/` in current working directory |
36
+ | `global` | Scan `~/.claude/` (user-level) |
37
+ | `templates` | Scan `templates/` (SmartStack CLI source) |
38
+ | `all` | Scan all scopes |
39
+ | `--fix` | Attempt auto-fix of common issues |
40
+ | `--verbose` | Show detailed validation per component |
41
+ </flags>
42
+
43
+ <examples>
44
+ ```bash
45
+ # Quick health check
46
+ /cc-audit
47
+
48
+ # Full audit with details
49
+ /cc-audit all --verbose
50
+
51
+ # Audit and fix issues
52
+ /cc-audit project --fix
53
+ ```
54
+ </examples>
55
+
56
+ </parameters>
57
+
58
+ <workflow>
59
+ 1. Parse scope and flags
60
+ 2. Scan directories for all components
61
+ 3. Validate each component against official conventions
62
+ 4. Check cross-references (skills ↔ agents, hooks ↔ scripts)
63
+ 5. Generate audit report with status and recommendations
64
+ </workflow>
65
+
66
+ <state_variables>
67
+ | Variable | Type | Description |
68
+ |----------|------|-------------|
69
+ | `{scope}` | string | project, global, templates, or all |
70
+ | `{fix_mode}` | boolean | Auto-fix common issues |
71
+ | `{verbose}` | boolean | Show detailed output |
72
+ | `{scan_paths}` | string[] | Directories to scan |
73
+ | `{skills_found}` | object[] | Skills inventory |
74
+ | `{agents_found}` | object[] | Agents inventory |
75
+ | `{hooks_found}` | object[] | Hooks inventory |
76
+ | `{issues}` | object[] | All issues found |
77
+ </state_variables>
78
+
79
+ <entry_point>
80
+
81
+ **FIRST ACTION:** Load `steps/step-00-init.md`
82
+
83
+ </entry_point>
84
+
85
+ <step_files>
86
+ | Step | File | Purpose |
87
+ |------|------|---------|
88
+ | 00 | `steps/step-00-init.md` | Parse scope, detect environment, resolve paths |
89
+ | 01 | `steps/step-01-scan.md` | Scan all components in target directories |
90
+ | 02 | `steps/step-02-analyze.md` | Validate structure, frontmatter, cross-references |
91
+ | 03 | `steps/step-03-report.md` | Generate audit report with recommendations |
92
+ </step_files>
93
+
94
+ <execution_rules>
95
+ - **Load one step at a time** - Progressive loading
96
+ - **Non-destructive** - Read-only unless --fix is set
97
+ - **Comprehensive** - Check ALL components, not just a sample
98
+ - **Actionable** - Every issue must have a clear recommendation
99
+ - **Reference official docs** - Base all checks on Claude Code documentation
100
+ </execution_rules>
101
+
102
+ <success_criteria>
103
+ - All components in scope are inventoried
104
+ - Each component validated against official conventions
105
+ - Cross-references verified (no broken links)
106
+ - Clear report with status per component
107
+ - Actionable recommendations for each issue
108
+ </success_criteria>
@@ -0,0 +1,91 @@
1
+ # Agent Validation Checklist
2
+
3
+ Based on official Claude Code documentation: https://code.claude.com/docs/en/sub-agents
4
+
5
+ ## Required
6
+
7
+ - [ ] Agent file is a `.md` file with YAML frontmatter
8
+ - [ ] Frontmatter contains `name` (unique identifier)
9
+ - [ ] Frontmatter contains `description` (when Claude should delegate to this agent)
10
+
11
+ ## Recommended
12
+
13
+ - [ ] `description` is clear enough for Claude to decide when to delegate
14
+ - [ ] `model` specified appropriately:
15
+ - `haiku` for fast, read-only tasks
16
+ - `sonnet` for balanced tasks
17
+ - `opus` for complex reasoning
18
+ - `inherit` to use parent's model
19
+ - [ ] `tools` explicitly lists needed tools (principle of least privilege)
20
+ - [ ] `permissionMode` set appropriately for the agent's task
21
+
22
+ ## Structure
23
+
24
+ - [ ] File located in correct directory:
25
+ - `.claude/agents/` for project-level
26
+ - `~/.claude/agents/` for user-level
27
+ - `.claude/agents/{category}/` for categorized agents
28
+ - [ ] Content includes clear system prompt
29
+ - [ ] Content describes workflow/steps
30
+ - [ ] Content defines execution rules
31
+ - [ ] Content specifies output format
32
+
33
+ ## Tool Access
34
+
35
+ - [ ] `tools` field only includes necessary tools
36
+ - [ ] `disallowedTools` used to explicitly block dangerous tools if needed
37
+ - [ ] MCP tools referenced correctly (mcp__{server}__{tool})
38
+
39
+ ## Permission Modes
40
+
41
+ | Mode | Use Case | Risk |
42
+ |------|----------|------|
43
+ | `default` | Standard interactive work | Low |
44
+ | `acceptEdits` | Automated file modifications | Medium |
45
+ | `dontAsk` | Background tasks that should not prompt | Medium |
46
+ | `bypassPermissions` | Full automation (trusted agents only) | HIGH |
47
+ | `plan` | Read-only exploration and research | None |
48
+
49
+ ## Skills Preloading
50
+
51
+ - [ ] `skills` field references existing skill names
52
+ - [ ] Referenced skills are relevant to agent's purpose
53
+ - [ ] Not overloading agent with too many preloaded skills
54
+
55
+ ## Hooks (if applicable)
56
+
57
+ - [ ] Hook events are valid lifecycle events
58
+ - [ ] Hook matchers use valid regex
59
+ - [ ] Hook commands reference existing scripts
60
+ - [ ] Hooks are scoped to agent's responsibilities
61
+
62
+ ## Content Quality
63
+
64
+ - [ ] System prompt is actionable (not vague)
65
+ - [ ] Workflow has numbered steps
66
+ - [ ] Execution rules define clear constraints
67
+ - [ ] Output format is specified
68
+ - [ ] Agent doesn't duplicate functionality of built-in agents
69
+
70
+ ## Built-in Agents (do not recreate)
71
+
72
+ | Agent | Purpose | Model |
73
+ |-------|---------|-------|
74
+ | Explore | Fast codebase search, read-only | haiku |
75
+ | Plan | Research and design, read-only | inherit |
76
+ | general-purpose | Complex multi-step tasks | inherit |
77
+ | Bash | Command execution in separate context | inherit |
78
+
79
+ ## Frontmatter Fields Reference
80
+
81
+ | Field | Type | Required | Default | Description |
82
+ |-------|------|----------|---------|-------------|
83
+ | `name` | string | YES | - | Unique agent identifier |
84
+ | `description` | string | YES | - | When to delegate to this agent |
85
+ | `tools` | string | no | all | CSV of available tools |
86
+ | `disallowedTools` | string | no | - | CSV of blocked tools |
87
+ | `model` | string | no | inherit | haiku/sonnet/opus/inherit |
88
+ | `permissionMode` | string | no | default | Permission handling mode |
89
+ | `skills` | list | no | - | Skills to preload |
90
+ | `hooks` | object | no | - | Agent-scoped lifecycle hooks |
91
+ | `color` | string | no | - | Visual indicator color |
@@ -0,0 +1,110 @@
1
+ # Hook Validation Checklist
2
+
3
+ Based on official Claude Code documentation: https://code.claude.com/docs/en/hooks
4
+
5
+ ## Required
6
+
7
+ - [ ] Hook configuration is valid JSON
8
+ - [ ] Event name is a valid lifecycle event
9
+ - [ ] At least one hook handler defined per event entry
10
+
11
+ ## Valid Lifecycle Events
12
+
13
+ | Event | When it fires | Matcher target |
14
+ |-------|---------------|----------------|
15
+ | `SessionStart` | Session begins/resumes | source: startup, resume, clear, compact |
16
+ | `UserPromptSubmit` | Before Claude processes prompt | - |
17
+ | `PreToolUse` | Before tool call | tool name |
18
+ | `PermissionRequest` | Permission dialog appears | tool name |
19
+ | `PostToolUse` | After successful tool call | tool name |
20
+ | `PostToolUseFailure` | After tool failure | tool name |
21
+ | `Notification` | Claude sends notification | type: permission_prompt, idle_prompt |
22
+ | `SubagentStart` | Subagent spawned | agent type name |
23
+ | `SubagentStop` | Subagent finishes | agent type name |
24
+ | `Stop` | Main agent finishes | - |
25
+ | `PreCompact` | Before context compaction | - |
26
+ | `SessionEnd` | Session ends | - |
27
+
28
+ ## Hook Handler Validation
29
+
30
+ ### Command type (`type: "command"`)
31
+ - [ ] `command` field is non-empty
32
+ - [ ] Referenced script/binary exists on filesystem
33
+ - [ ] Script is executable (Unix: chmod +x)
34
+ - [ ] Script handles JSON stdin correctly
35
+ - [ ] Exit codes are meaningful (0=continue, 2=block)
36
+ - [ ] `timeout` set if script might hang (default: varies)
37
+
38
+ ### Prompt type (`type: "prompt"`)
39
+ - [ ] `prompt` field is non-empty and descriptive
40
+ - [ ] `model` is valid if specified (haiku recommended for speed)
41
+ - [ ] `timeout` set appropriately
42
+
43
+ ### Agent type (`type: "agent"`)
44
+ - [ ] Agent configuration is valid
45
+ - [ ] Tools specified for the agent hook
46
+ - [ ] Timeout set to prevent runaway agents
47
+
48
+ ## Matcher Validation
49
+
50
+ - [ ] Matcher is a valid regex pattern
51
+ - [ ] Matcher is specific enough (avoid `.*` unless intentional)
52
+ - [ ] For tool events: matches known tool names
53
+ - [ ] For SessionStart: matches valid sources
54
+ - [ ] For Notification: matches valid types
55
+ - [ ] For Subagent events: matches valid agent types
56
+
57
+ ## Configuration Locations
58
+
59
+ | Location | Scope | Priority |
60
+ |----------|-------|----------|
61
+ | `~/.claude/settings.json` | User (all projects) | Low |
62
+ | `.claude/settings.json` | Project (shared) | Medium |
63
+ | `.claude/settings.local.json` | Personal (gitignored) | High |
64
+ | Skill frontmatter `hooks:` | Skill-scoped | Skill only |
65
+ | Agent frontmatter `hooks:` | Agent-scoped | Agent only |
66
+
67
+ ## JSON Input Format (stdin to command hooks)
68
+
69
+ ```json
70
+ {
71
+ "session_id": "string",
72
+ "transcript_path": "string",
73
+ "cwd": "string",
74
+ "permission_mode": "string",
75
+ "hook_event_name": "string",
76
+ "tool_name": "string (for tool events)",
77
+ "tool_input": { "object (for tool events)" }
78
+ }
79
+ ```
80
+
81
+ ## JSON Output Format (stdout from command hooks)
82
+
83
+ ```json
84
+ {
85
+ "continue": true,
86
+ "hookSpecificOutput": {
87
+ "hookEventName": "PreToolUse",
88
+ "permissionDecision": "allow|deny|block",
89
+ "permissionDecisionReason": "string"
90
+ }
91
+ }
92
+ ```
93
+
94
+ ## Exit Code Meanings
95
+
96
+ | Code | Meaning | Behavior |
97
+ |------|---------|----------|
98
+ | 0 | Success | Continue execution |
99
+ | 2 | Blocking error | Prevent action, show error |
100
+ | Other | Non-blocking error | Log warning, continue |
101
+
102
+ ## Best Practices
103
+
104
+ - [ ] Hooks are fast (< 5 seconds for sync hooks)
105
+ - [ ] Use `async: true` for long-running operations
106
+ - [ ] Use `once: true` for one-time setup hooks
107
+ - [ ] Use `statusMessage` for user visibility
108
+ - [ ] Quote all shell variables in scripts
109
+ - [ ] Use absolute paths or `$CLAUDE_PROJECT_DIR`
110
+ - [ ] Test hooks manually before deploying
@@ -0,0 +1,70 @@
1
+ # Skill Validation Checklist
2
+
3
+ Based on official Claude Code documentation: https://code.claude.com/docs/en/skills
4
+
5
+ ## Required
6
+
7
+ - [ ] `SKILL.md` exists in skill directory
8
+ - [ ] Frontmatter contains `name` (lowercase, max 64 chars)
9
+ - [ ] Frontmatter contains `description` (non-empty, describes when to use)
10
+
11
+ ## Recommended
12
+
13
+ - [ ] `description` uses natural language keywords for auto-detection
14
+ - [ ] `argument-hint` present if skill accepts arguments
15
+ - [ ] `disable-model-invocation: true` set for side-effect operations (deploy, commit, publish)
16
+ - [ ] `user-invocable` explicitly set (true for /commands, false for background knowledge)
17
+ - [ ] `allowed-tools` specified if skill needs tool access without permission prompts
18
+ - [ ] `model` specified if skill needs a specific model (haiku for speed, opus for quality)
19
+
20
+ ## Structure
21
+
22
+ - [ ] SKILL.md is under 500 lines
23
+ - [ ] Supporting files in appropriate directories:
24
+ - `templates/` for code templates
25
+ - `references/` for documentation
26
+ - `scripts/` for executable scripts
27
+ - `examples/` for example outputs
28
+ - `steps/` for progressive step loading
29
+
30
+ ## Progressive Step Loading (if applicable)
31
+
32
+ - [ ] `<entry_point>` section in SKILL.md points to first step
33
+ - [ ] `<step_files>` section lists all steps with purpose
34
+ - [ ] Each step file has YAML frontmatter with `name` and `description`
35
+ - [ ] Each step (except last) has `next_step` in frontmatter
36
+ - [ ] All `next_step` paths resolve to existing files
37
+ - [ ] Steps follow sequential naming: step-00-*, step-01-*, ...
38
+ - [ ] Each step has sections: YOUR TASK, EXECUTION SEQUENCE, SUCCESS METRICS, NEXT STEP
39
+ - [ ] State variables documented in `<state_variables>` section
40
+
41
+ ## Forked Context (if applicable)
42
+
43
+ - [ ] `context: fork` set in frontmatter
44
+ - [ ] `agent` field specifies valid agent (Explore, Plan, general-purpose, or custom)
45
+ - [ ] `allowed-tools` lists tools the forked context can use
46
+ - [ ] Custom agent exists if referenced
47
+
48
+ ## Content Quality
49
+
50
+ - [ ] Has `<objective>` section explaining what the skill does
51
+ - [ ] Has `<quick_start>` with usage examples
52
+ - [ ] Has `<workflow>` describing high-level flow
53
+ - [ ] Has `<execution_rules>` with key constraints
54
+ - [ ] Has `<success_criteria>` defining completion
55
+ - [ ] All file references in content point to existing files
56
+
57
+ ## Frontmatter Fields Reference
58
+
59
+ | Field | Type | Required | Default | Description |
60
+ |-------|------|----------|---------|-------------|
61
+ | `name` | string | YES | - | Lowercase identifier, max 64 chars |
62
+ | `description` | string | YES | - | When/why Claude should use this skill |
63
+ | `disable-model-invocation` | bool | no | false | true = manual /command only |
64
+ | `user-invocable` | bool | no | true | false = hidden from /menu |
65
+ | `allowed-tools` | string | no | - | CSV of tools without permission prompts |
66
+ | `model` | string | no | inherit | inherit/sonnet/opus/haiku |
67
+ | `context` | string | no | - | "fork" for isolated subagent |
68
+ | `agent` | string | no | - | Subagent type if context: fork |
69
+ | `argument-hint` | string | no | - | Autocomplete hint text |
70
+ | `hooks` | object | no | - | Lifecycle hooks (PreToolUse, etc.) |
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: step-00-init
3
+ description: Parse scope argument, detect environment, resolve scan paths
4
+ next_step: steps/step-01-scan.md
5
+ ---
6
+
7
+ # Step 0: Initialization
8
+
9
+ ## MANDATORY EXECUTION RULES:
10
+ - NEVER skip scope detection
11
+ - ALWAYS resolve actual filesystem paths before proceeding
12
+ - YOU ARE AN INITIALIZER, not a scanner
13
+
14
+ ## YOUR TASK:
15
+ Parse the scope argument, detect the environment, and resolve which directories to scan.
16
+
17
+ ---
18
+
19
+ ## EXECUTION SEQUENCE:
20
+
21
+ ### 1. Parse Input
22
+
23
+ ```
24
+ Arguments from $ARGUMENTS:
25
+ First word → {scope} (default: "project")
26
+ --fix → {fix_mode} = true (default: false)
27
+ --verbose → {verbose} = true (default: false)
28
+
29
+ Valid scopes:
30
+ "project" → .claude/ in current working directory
31
+ "global" → ~/.claude/ (user-level)
32
+ "templates" → templates/ (SmartStack CLI source only)
33
+ "all" → all of the above
34
+ ```
35
+
36
+ ### 2. Detect Environment
37
+
38
+ ```
39
+ Use Bash to determine:
40
+ - Current working directory
41
+ - Home directory (for global scope)
42
+ - Is this a SmartStack CLI project? (check for templates/ directory)
43
+ - Is this a Claude Code project? (check for .claude/ directory)
44
+ ```
45
+
46
+ ### 3. Resolve Scan Paths
47
+
48
+ ```
49
+ Based on {scope}:
50
+
51
+ "project" →
52
+ {scan_paths} = ["{cwd}/.claude/"]
53
+ Verify .claude/ exists, warn if missing
54
+
55
+ "global" →
56
+ {scan_paths} = ["~/.claude/"]
57
+ Resolve ~ to actual home directory
58
+
59
+ "templates" →
60
+ {scan_paths} = ["{cwd}/templates/"]
61
+ Only valid in SmartStack CLI project
62
+
63
+ "all" →
64
+ {scan_paths} = combination of applicable paths
65
+ ```
66
+
67
+ ### 4. Validate Paths
68
+
69
+ For each path in {scan_paths}:
70
+ - Use Bash `ls` to verify directory exists
71
+ - If missing: record as warning, skip that path
72
+ - If empty: record as info, skip that path
73
+
74
+ ### 5. Show Summary and Proceed
75
+
76
+ ```
77
+ Audit Configuration:
78
+
79
+ | Setting | Value |
80
+ |---------|-------|
81
+ | Scope | {scope} |
82
+ | Fix mode | {fix_mode} |
83
+ | Verbose | {verbose} |
84
+ | Paths to scan | {scan_paths} |
85
+
86
+ → Scanning components...
87
+ ```
88
+
89
+ ---
90
+
91
+ ## SUCCESS METRICS:
92
+ - Scope correctly parsed
93
+ - All paths resolved and validated
94
+ - Environment detected (SmartStack CLI vs generic Claude Code project)
95
+ - Summary displayed
96
+
97
+ ## NEXT STEP:
98
+ After showing initialization summary, proceed directly to `./step-01-scan.md`