Phase 3 of assist workflow - Generate component files using schema-based templates
Generate component files based on determined type with proper schema compliance.
1. Load schema for component type
2. Gather required fields (ask user if needed)
3. Generate files with proper structure
4. Register in marketplace.json (if applicable)
| Component | Schema Reference | Required Fields |
|---|---|---|
| Skill | skill-schema.md | name, description |
| Agent | agent-schema.md | name, description, tools |
| Command | command-schema.md | description |
| Hook | hook-schema.md | event, matcher, command |
| MCP | mcp-schema.md | name, transport |
# Create directory structure
mkdir -p skills/{name}
mkdir -p skills/{name}/references
# Generate SKILL.md
cat > skills/{name}/SKILL.md << 'EOF'
---
name: {name}
description: {description}
allowed-tools: {tools}
---
# {Title}
{overview}
## When to Use
- {trigger_1}
- {trigger_2}
## Quick Start
{quick_start}
## References
For detailed information: [references/details.md](references/details.md)
EOF
# Generate agent file
cat > agents/{name}.md << 'EOF'
---
name: {name}
description: {description}
tools: {tools}
skills: {skills}
model: {model}
---
# {Title} Agent
{overview}
## Process
1. {step_1}
2. {step_2}
3. {step_3}
## Output Format
{output_format}
EOF
# Generate command file
cat > commands/{name}.md << 'EOF'
---
description: {description}
argument-hint: "{args}"
allowed-tools: {tools}
---
# /{name} Command
{overview}
## Usage
/{name} {usage_example}
## Workflow
{workflow}
EOF
# Add to hooks/hooks.json
python3 scripts/add_hook.py \
--event {PreToolUse|PostToolUse|Stop|...} \
--matcher "{tool_pattern}" \
--command "python3 scripts/{script}.py" \
--timeout {timeout}
# Generate .mcp.json entry
python3 scripts/add_mcp.py \
--name {name} \
--transport {stdio|sse} \
--command "{command}"
When required fields are missing, ask user:
# For Skill
Missing: description
Q: "μ΄ μ€ν¬μ μ΄λ€ μν©μμ μ¬μ©νλμ? (μΈμ λ‘λλμ΄μΌ νλμ§ νΈλ¦¬κ±° ν¬ν¨)"
# For Agent
Missing: tools
Q: "μ΄ μμ΄μ νΈκ° μ¬μ©ν λꡬλ? (λΉμ°λ©΄ λͺ¨λ λꡬ μ¬μ©, MCP ν¬ν¨)"
Options:
- "[]" β No tools (pure thinking)
- "omit" β All tools including MCP
- "[Read, Write, Bash]" β Specific tools only
# For Hook
Missing: event
Q: "μ΄λ€ μ΄λ²€νΈμ μ€νλλμ?"
Options:
- PreToolUse β λꡬ μ€ν μ (μ°¨λ¨ κ°λ₯)
- PostToolUse β λꡬ μ€ν ν (κ²μ¦/λΆμμ©)
- Stop β Claude μλ΅ μλ£ μ
- UserPromptSubmit β μ¬μ©μ μ
λ ₯ μ
| Component | Convention | Example |
|---|---|---|
| Skill | kebab-case directory | skills/code-review/ |
| Agent | kebab-case file | agents/code-reviewer.md |
| Command | kebab-case file | commands/run-tests.md |
| Hook script | kebab-case | scripts/pre-commit-lint.py |
After generation:
python3 scripts/workflow_state.py add-file path/to/file1
python3 scripts/workflow_state.py add-file path/to/file2
python3 scripts/workflow_state.py update execute completed
Phase: execute
Status: completed
Result:
component_type: SKILL
generated_files:
- skills/code-review/SKILL.md
- skills/code-review/references/guidelines.md
registered: true # Added to marketplace.json
next_phase: verify
Skill("assist-plugin:phase-verify")
β Validate generated files against schema
β Check marketplace.json registration
β EXIT GATE enforcement