skill-generator
A meta-skill that generates new Claude Code skills with configurable execution modes (sequential or autonomous). It creates complete directory structures, phase files, specifications, and templates based on user requirements. The skill follows established design patterns and includes quality control mechanisms.
Unlock Deep Analysis
Use AI to visualize the workflow and generate a realistic output preview for this skill.
Powered by Fastest LLM
Target Audience
Claude Code developers creating new skills, workflow designers, and teams establishing standardized development practices
Low security risk, safe to use
Skill Generator
Meta-skill for creating new Claude Code skills with configurable execution modes.
Architecture Overview
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Skill Generator Architecture โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ Phase 1: Requirements โ skill-config.json โ
โ Discovery (name, type, mode, agents) โ
โ โ โ
โ Phase 2: Structure โ ็ฎๅฝ็ปๆ + ๆ ธๅฟๆไปถ้ชจๆถ โ
โ Generation โ
โ โ โ
โ Phase 3: Phase โ phases/*.md (ๆ นๆฎ mode ็ๆ) โ
โ Generation Sequential | Autonomous โ
โ โ โ
โ Phase 4: Specs & โ specs/*.md + templates/*.md โ
โ Templates โ
โ โ โ
โ Phase 5: Validation โ ้ช่ฏๅฎๆดๆง + ็ๆไฝฟ็จ่ฏดๆ โ
โ & Documentation โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Execution Modes
Mode 1: Sequential (ๅบๅฎ้กบๅบ)
ไผ ็ป็บฟๆงๆง่กๆจกๅผ๏ผ้ถๆฎตๆๆฐๅญๅ็ผ้กบๅบๆง่กใ
Phase 01 โ Phase 02 โ Phase 03 โ ... โ Phase N
้็จๅบๆฏ:
- ๆตๆฐด็บฟๅผไปปๅก๏ผๆถ้ โ ๅๆ โ ็ๆ๏ผ
- ้ถๆฎต้ดๆๅผบไพ่ตๅ ณ็ณป
- ่พๅบ็ปๆๅบๅฎ
็คบไพ: software-manual, copyright-docs
Mode 2: Autonomous (ๆ ็ถๆ่ชไธป้ๆฉ)
ๆบ่ฝ่ทฏ็ฑๆจกๅผ๏ผๆ นๆฎไธไธๆๅจๆ้ๆฉๆง่ก่ทฏๅพใ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Orchestrator Agent โ
โ (่ฏปๅ็ถๆ โ ้ๆฉ Phase โ ๆง่ก โ ๆดๆฐ) โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโผโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโ โโโโโโโโโ โโโโโโโโโ
โPhase Aโ โPhase Bโ โPhase Cโ
โ(็ฌ็ซ) โ โ(็ฌ็ซ) โ โ(็ฌ็ซ) โ
โโโโโโโโโ โโโโโโโโโ โโโโโโโโโ
้็จๅบๆฏ:
- ไบคไบๅผไปปๅก๏ผๅฏน่ฏใ้ฎ็ญ๏ผ
- ้ถๆฎต้ดๆ ๅผบไพ่ต
- ้่ฆๅจๆๅๅบ็จๆทๆๅพ
็คบไพ: issue-manage, workflow-debug
Key Design Principles
- ๆจกๅผๆ็ฅ: ๆ นๆฎไปปๅก็นๆง่ชๅจๆจ่ๆง่กๆจกๅผ
- ้ชจๆถ็ๆ: ็ๆๅฎๆด็ฎๅฝ็ปๆๅๆไปถ้ชจๆถ
- ่ง่้ตๅพช: ไธฅๆ ผ้ตๅพช
_shared/SKILL-DESIGN-SPEC.md - ๅฏๆฉๅฑๆง: ็ๆ็ Skill ๆไบๆฉๅฑๅไฟฎๆน
Execution Flow
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Phase 1: Requirements Discovery โ
โ โ AskUserQuestion: Skill ๅ็งฐใ็ฎๆ ใๆง่กๆจกๅผ โ
โ โ Output: skill-config.json โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Phase 2: Structure Generation โ
โ โ ๅๅปบ็ฎๅฝ็ปๆ: phases/, specs/, templates/, scripts/ โ
โ โ ็ๆ SKILL.md ๅ
ฅๅฃๆไปถ โ
โ โ Output: ๅฎๆด็ฎๅฝ็ปๆ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Phase 3: Phase Generation โ
โ โ Sequential: ็ๆ 01-xx.md, 02-xx.md, ... โ
โ โ Autonomous: ็ๆ orchestrator.md + actions/*.md โ
โ โ Output: phases/*.md โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Phase 4: Specs & Templates โ
โ โ ็ๆ้ขๅ่ง่: specs/{domain}-requirements.md โ
โ โ ็ๆ่ดจ้ๆ ๅ: specs/quality-standards.md โ
โ โ ็ๆๆจกๆฟ: templates/agent-base.md โ
โ โ Output: specs/*.md, templates/*.md โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Phase 5: Validation & Documentation โ
โ โ ้ช่ฏๆไปถๅฎๆดๆง โ
โ โ ็ๆ README.md ไฝฟ็จ่ฏดๆ โ
โ โ Output: ้ช่ฏๆฅๅ + README.md โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Directory Setup
const skillName = config.skill_name;
const skillDir = `.claude/skills/${skillName}`;
// ๅๅปบ็ฎๅฝ็ปๆ
Bash(`mkdir -p "${skillDir}/phases"`);
Bash(`mkdir -p "${skillDir}/specs"`);
Bash(`mkdir -p "${skillDir}/templates"`);
// Autonomous ๆจกๅผ้ขๅค็ฎๅฝ
if (config.execution_mode === 'autonomous') {
Bash(`mkdir -p "${skillDir}/phases/actions"`);
}
Output Structure
Sequential Mode
.claude/skills/{skill-name}/
โโโ SKILL.md
โโโ phases/
โ โโโ 01-{step-one}.md
โ โโโ 02-{step-two}.md
โ โโโ 03-{step-three}.md
โโโ specs/
โ โโโ {domain}-requirements.md
โ โโโ quality-standards.md
โโโ templates/
โโโ agent-base.md
Autonomous Mode
.claude/skills/{skill-name}/
โโโ SKILL.md
โโโ phases/
โ โโโ orchestrator.md # ็ผๆๅจ๏ผ่ฏปๅ็ถๆ โ ้ๆฉๅจไฝ
โ โโโ state-schema.md # ็ถๆ็ปๆๅฎไน
โ โโโ actions/ # ็ฌ็ซๅจไฝ๏ผๆ ้กบๅบ๏ผ
โ โโโ action-{a}.md
โ โโโ action-{b}.md
โ โโโ action-{c}.md
โโโ specs/
โ โโโ {domain}-requirements.md
โ โโโ action-catalog.md # ๅจไฝ็ฎๅฝ๏ผๆ่ฟฐใๅ็ฝฎๆกไปถใๆๆ๏ผ
โ โโโ quality-standards.md
โโโ templates/
โโโ orchestrator-base.md # ็ผๆๅจๆจกๆฟ
โโโ action-base.md # ๅจไฝๆจกๆฟ
Reference Documents
| Document | Purpose |
|---|---|
| phases/01-requirements-discovery.md | ๆถ้ Skill ้ๆฑ |
| phases/02-structure-generation.md | ็ๆ็ฎๅฝ็ปๆ |
| phases/03-phase-generation.md | ็ๆ Phase ๆไปถ |
| phases/04-specs-templates.md | ็ๆ่ง่ๅๆจกๆฟ |
| phases/05-validation.md | ้ช่ฏๅๆๆกฃ |
| specs/execution-modes.md | ๆง่กๆจกๅผ่ง่ |
| specs/skill-requirements.md | Skill ้ๆฑ่ง่ |
| templates/skill-md.md | SKILL.md ๆจกๆฟ |
| templates/sequential-phase.md | Sequential Phase ๆจกๆฟ |
| templates/autonomous-orchestrator.md | Autonomous ็ผๆๅจๆจกๆฟ |
| templates/autonomous-action.md | Autonomous Action ๆจกๆฟ |
| ../_shared/SKILL-DESIGN-SPEC.md | ้็จ่ฎพ่ฎก่ง่ |
Referenced Files
The following files are referenced in this skill and included for context.
phases/01-requirements-discovery.md
# Phase 1: Requirements Discovery
ๆถ้ๆฐ Skill ็้ๆฑไฟกๆฏ๏ผ็ๆ้
็ฝฎๆไปถใ
## Objective
- ๆถ้ Skill ๅบๆฌไฟกๆฏ๏ผๅ็งฐใๆ่ฟฐใ่งฆๅ่ฏ๏ผ
- ็กฎๅฎๆง่กๆจกๅผ๏ผSequential / Autonomous๏ผ
- ๅฎไน้ถๆฎต/ๅจไฝ
- ้
็ฝฎๅทฅๅ
ทไพ่ตๅ่พๅบๆ ผๅผ
## Execution Steps
### Step 1: ๅบๆฌไฟกๆฏๆถ้
```javascript
const basicInfo = await AskUserQuestion({
questions: [
{
question: "ๆฐ Skill ็ๅ็งฐๆฏไปไน๏ผ๏ผ่ฑๆ๏ผๅฐๅ-่ฟๅญ็ฌฆๆ ผๅผ๏ผๅฆ 'api-docs'๏ผ",
header: "Skill ๅ็งฐ",
multiSelect: false,
options: [
{ label: "่ชๅจ็ๆ", description: "ๆ นๆฎๅ็ปญๆ่ฟฐ่ชๅจ็ๆๅ็งฐ" },
{ label: "ๆๅจ่พๅ
ฅ", description: "็ฐๅจ่พๅ
ฅ่ชๅฎไนๅ็งฐ" }
]
},
{
question: "Skill ็ไธป่ฆ็จ้ๆฏไปไน๏ผ",
header: "็จ้็ฑปๅ",
multiSelect: false,
options: [
{ label: "ๆๆกฃ็ๆ", description: "็ๆ Markdown/HTML ๆๆกฃ๏ผๅฆๆๅใๆฅๅ๏ผ" },
{ label: "ไปฃ็ ๅๆ", description: "ๅๆไปฃ็ ็ปๆใ่ดจ้ใๅฎๅ
จๆง" },
{ label: "ไบคไบ็ฎก็", description: "็ฎก็ Issueใไปปๅกใๅทฅไฝๆต๏ผCRUD ๆไฝ๏ผ" },
{ label: "ๆฐๆฎๅค็", description: "ETLใๆ ผๅผ่ฝฌๆขใๆฅๅ็ๆ" }
]
}
]
});
// ๅฆๆ้ๆฉๆๅจ่พๅ
ฅ๏ผ่ฟไธๆญฅ่ฏข้ฎ
if (basicInfo["Skill ๅ็งฐ"] === "ๆๅจ่พๅ
ฅ") {
// ็จๆทไผๅจ "Other" ไธญ่พๅ
ฅ
}
// ๆ นๆฎ็จ้็ฑปๅๆจๆญๆ่ฟฐๆจกๆฟ
const purposeTemplates = {
"ๆๆกฃ็ๆ": "Generate {type} documents from {source}",
"ไปฃ็ ๅๆ": "Analyze {target} for {purpose}",
"ไบคไบ็ฎก็": "Manage {entity} with interactive operations",
"ๆฐๆฎๅค็": "Process {data} and generate {output}"
};
Step 2: ๆง่กๆจกๅผ้ๆฉ
const modeInfo = await AskUserQuestion({
questions: [
{
question: "้ๆฉๆง่กๆจกๅผ๏ผ",
header: "ๆง่กๆจกๅผ",
multiSelect: false,
options: [
{
label: "Sequential (้กบๅบๆจกๅผ)",
description: "้ถๆฎตๆๅบๅฎ้กบๅบๆง่ก๏ผๆถ้โๅๆโ็ๆ๏ผ๏ผ้ๅๆตๆฐด็บฟไปปๅก๏ผๆจ่๏ผ"
},
{
label: "Autonomous (่ชไธปๆจกๅผ)",
description: "ๅจๆ้ๆฉๆง่ก่ทฏๅพ๏ผ้ๅไบคไบๅผไปปๅก๏ผๅฆ Issue ็ฎก็๏ผ"
},
{
label: "Hybrid (ๆททๅๆจกๅผ)",
description: "ๅๅงๅๅๆถๅฐพๅบๅฎ๏ผไธญ้ดไบคไบ็ตๆดป"
}
]
}
]
});
const executionMode = modeInfo["ๆง่กๆจกๅผ"].includes("Sequential") ? "sequential" :
modeInfo["ๆง่กๆจกๅผ"].includes("Autonomous") ? "autonomous" : "hybrid";
Step 3: ้ถๆฎต/ๅจไฝๅฎไน
Sequential ๆจกๅผ
if (executionMode === "sequential") {
const phaseInfo = await AskUserQuestion({
questions: [
{
question: "้่ฆๅคๅฐไธชๆง่ก้ถๆฎต๏ผ",
header: "้ถๆฎตๆฐ้",
multiSelect: false,
options: [
{ label: "3 ้ถๆฎต๏ผ็ฎๅ๏ผ", description: "ๆถ้ โ ๅค็ โ ่พๅบ" },
{ label: "5 ้ถๆฎต๏ผๆ ๅ๏ผ", description: "ๆถ้ โ ๆข็ดข โ ๅๆ โ ็ป่ฃ
โ ้ช่ฏ" },
{ label: "7 ้ถๆฎต๏ผๅฎๆด๏ผ", description: "ๅซๅนถ่กๅค็ใๆฑๆปใ่ฟญไปฃไผๅ" }
]
}
]
});
// ๆ นๆฎ้ๆฉ็ๆ้ถๆฎตๅฎไน
const phaseTemplates = {
"3 ้ถๆฎต": [
{ id: "01-collection", name: "Data Collection" },
{ id: "02-processing", name: "Processing" },
{ id: "03-output", name: "Output Generation" }
],
"5 ้ถๆฎต": [
{ id: "01-collection", name: "Requirements Collection" },
{ id: "02-exploration", name: "Project Exploration" },
{ id: "03-analysis", name: "Deep Analysis" },
{ id: "04-assembly", name: "Document Assembly" },
{ id: "05-validation", name: "Validation" }
],
"7 ้ถๆฎต": [
{ id: "01-collection", name: "Requirements Collection" },
{ id: "02-exploration", name: "Project Exploration" },
{ id: "03-parallel", name: "Parallel Analysis" },
{ id: "03.5-consolidation", name: "Consolidation" },
{ id: "04-assembly", name: "Document Assembly" },
{ id: "05-refinement", name: "Iterative Refinement" },
{ id: "06-output", name: "Final Output" }
]
};
}
Autonomous ๆจกๅผ
if (executionMode === "autonomous") {
const actionInfo = await AskUserQuestion({
questions: [
{
question: "ๆ ธๅฟๅจไฝๆๅชไบ๏ผ๏ผๅฏๅค้๏ผ",
header: "ๅจไฝๅฎไน",
multiSelect: true,
options: [
{ label: "ๅๅงๅ (init)", description: "่ฎพ็ฝฎๅๅง็ถๆ" },
{ label: "ๅ่กจ (list)", description: "ๆพ็คบๅฝๅ้กน็ฎๅ่กจ" },
{ label: "ๅๅปบ (create)", description: "ๅๅปบๆฐ้กน็ฎ" },
{ label: "็ผ่พ (edit)", description: "ไฟฎๆน็ฐๆ้กน็ฎ" },
{ label: "ๅ ้ค (delete)", description: "ๅ ้ค้กน็ฎ" },
{ label: "ๆ็ดข (search)", description: "ๆ็ดข/่ฟๆปค้กน็ฎ" }
]
}
]
});
}
Step 4: ๅทฅๅ ทๅ่พๅบ้ ็ฝฎ
const toolsInfo = await AskUserQuestion({
questions: [
{
question: "้่ฆๅชไบ็นๆฎๅทฅๅ
ท๏ผ๏ผๅบ็กๅทฅๅ
ทๅทฒ้ป่ฎคๅ
ๅซ๏ผ",
header: "ๅทฅๅ
ท้ๆฉ",
multiSelect: true,
options: [
{ label: "็จๆทไบคไบ (AskUserQuestion)", description: "้่ฆไธ็จๆทๅฏน่ฏ" },
{ label: "Chrome ๆชๅพ (mcp__chrome__*)", description: "้่ฆ็ฝ้กตๆชๅพ" },
{ label: "ๅค้จๆ็ดข (mcp__exa__search)", description: "้่ฆๆ็ดขๅค้จไฟกๆฏ" },
{ label: "ๆ ็นๆฎ้ๆฑ", description: "ไป
ไฝฟ็จๅบ็กๅทฅๅ
ท" }
]
},
{
question: "่พๅบๆ ผๅผๆฏไปไน๏ผ",
header: "่พๅบๆ ผๅผ",
multiSelect: false,
options: [
{ label: "Markdown", description: "้ๅๆๆกฃๅๆฅๅ" },
{ label: "HTML", description: "้ๅไบคไบๅผๆๆกฃ" },
{ label: "JSON", description: "้ๅๆฐๆฎๅ้
็ฝฎ" }
]
}
]
});
Step 5: ็ๆ้ ็ฝฎๆไปถ
const config = {
skill_name: skillName,
display_name: displayName,
description: description,
triggers: triggers,
execution_mode: executionMode,
// ๆจกๅผ็นๅฎ้
็ฝฎ
...(executionMode === "sequential" ? {
sequential_config: { phases: phases }
} : {
autonomous_config: {
state_schema: stateSchema,
actions: actions,
termination_conditions: ["user_exit", "error_limit", "task_completed"]
}
}),
allowed_tools: [
"Task", "Read", "Write", "Glob", "Grep", "Bash",
...selectedTools
],
output: {
format: outputFormat.toLowerCase(),
location: `.workflow/.scratchpad/${skillName}-{timestamp}`,
filename_pattern: `{name}-output.${outputFormat === "HTML" ? "html" : outputFormat === "JSON" ? "json" : "md"}`
},
created_at: new Date().toISOString(),
version: "1.0.0"
};
// ๅๅ
ฅ้
็ฝฎๆไปถ
const workDir = `.workflow/.scratchpad/skill-gen-${timestamp}`;
Bash(`mkdir -p "${workDir}"`);
Write(`${workDir}/skill-config.json`, JSON.stringify(config, null, 2));
Output
- File:
skill-config.json - Location:
.workflow/.scratchpad/skill-gen-{timestamp}/ - Format: JSON
Next Phase
โ Phase 2: Structure Generation
### phases/02-structure-generation.md
```markdown
# Phase 2: Structure Generation
ๆ นๆฎ้
็ฝฎๅๅปบ Skill ็ฎๅฝ็ปๆๅๅ
ฅๅฃๆไปถใ
## Objective
- ๅๅปบๆ ๅ็ฎๅฝ็ปๆ
- ็ๆ SKILL.md ๅ
ฅๅฃๆไปถ
- ๆ นๆฎๆง่กๆจกๅผๅๅปบๅฏนๅบ็ๅญ็ฎๅฝ
## Input
- ไพ่ต: `skill-config.json` (Phase 1 ไบงๅบ)
## Execution Steps
### Step 1: ่ฏปๅ้
็ฝฎ
```javascript
const config = JSON.parse(Read(`${workDir}/skill-config.json`));
const skillDir = `.claude/skills/${config.skill_name}`;
Step 2: ๅๅปบ็ฎๅฝ็ปๆ
// ๅบ็ก็ฎๅฝ
Bash(`mkdir -p "${skillDir}/phases"`);
Bash(`mkdir -p "${skillDir}/specs"`);
Bash(`mkdir -p "${skillDir}/templates"`);
// Autonomous ๆจกๅผ้ขๅค็ฎๅฝ
if (config.execution_mode === 'autonomous' || config.execution_mode === 'hybrid') {
Bash(`mkdir -p "${skillDir}/phases/actions"`);
}
// ๅฏ้: scripts ็ฎๅฝ
if (config.needs_scripts) {
Bash(`mkdir -p "${skillDir}/scripts"`);
}
Step 3: ็ๆ SKILL.md
const skillMdTemplate = `---
name: ${config.skill_name}
description: ${config.description}. Triggers on ${config.triggers.map(t => `"${t}"`).join(", ")}.
allowed-tools: ${config.allowed_tools.join(", ")}
---
# ${config.display_name}
${config.description}
## Architecture Overview
\`\`\`
${generateArchitectureDiagram(config)}
\`\`\`
## Key Design Principles
${generateDesignPrinciples(config)}
## Execution Flow
${generateExecutionFlow(config)}
## Directory Setup
\`\`\`javascript
const timestamp = new Date().toISOString().slice(0,19).replace(/[-:T]/g, '');
const workDir = \`${config.output.location.replace('{timestamp}', '${timestamp}')}\`;
Bash(\`mkdir -p "\${workDir}"\`);
${config.execution_mode === 'sequential' ?
`Bash(\`mkdir -p "\${workDir}/sections"\`);` :
`Bash(\`mkdir -p "\${workDir}/state"\`);`}
\`\`\`
## Output Structure
\`\`\`
${generateOutputStructure(config)}
\`\`\`
## Reference Documents
${generateReferenceTable(config)}
`;
Write(`${skillDir}/SKILL.md`, skillMdTemplate);
Step 4: ๆถๆๅพ็ๆๅฝๆฐ
function generateArchitectureDiagram(config) {
if (config.execution_mode === 'sequential') {
return config.sequential_config.phases.map((p, i) =>
`โ Phase ${i+1}: ${p.name.padEnd(15)} โ ${p.output || 'output-' + (i+1) + '.json'}${' '.repeat(10)}โ`
).join('\nโ โ' + ' '.repeat(45) + 'โ\n');
} else {
return `
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Orchestrator (็ถๆ้ฉฑๅจๅณ็ญ) โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโผโโโโโโโโโโโโ
โ โ โ
${config.autonomous_config.actions.slice(0, 3).map(a =>
`โโโโโโโโโโโ `).join('')}
${config.autonomous_config.actions.slice(0, 3).map(a =>
`โ${a.name.slice(0, 7).padEnd(7)}โ `).join('')}
${config.autonomous_config.actions.slice(0, 3).map(a =>
`โโโโโโโโโโโ `).join('')}`;
}
}
function generateDesignPrinciples(config) {
const common = [
"1. **่ง่้ตๅพช**: ไธฅๆ ผ้ตๅพช `_shared/SKILL-DESIGN-SPEC.md`",
"2. **็ฎ่ฆ่ฟๅ**: Agent ่ฟๅ่ทฏๅพ+ๆ่ฆ๏ผ้ฟๅ
ไธไธๆๆบขๅบ"
];
if (config.execution_mode === 'sequential') {
return [...common,
"3. **้ถๆฎต้็ฆป**: ๆฏไธช้ถๆฎต็ฌ็ซๅฏๆต",
"4. **้พๅผ่พๅบ**: ้ถๆฎตไบงๅบไฝไธบไธ้ถๆฎต่พๅ
ฅ"
].join('\n');
} else {
return [...common,
"3. **็ถๆ้ฉฑๅจ**: ๆพๅผ็ถๆ็ฎก็๏ผๅจๆๅณ็ญ",
"4. **ๅจไฝ็ฌ็ซ**: ๆฏไธชๅจไฝๆ ๅฏไฝ็จไพ่ต"
].join('\n');
}
}
function generateExecutionFlow(config) {
if (config.execution_mode === 'sequential') {
return '```\n' + config.sequential_config.phases.map((p, i) =>
`โโ Phase ${i+1}: ${p.name}\nโ โ Output: ${p.output || 'output.json'}`
).join('\n') + '\n```';
} else {
return `\`\`\`
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Orchestrator Loop โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ Read โโโโโโถโ Select โโโโโโถโ Execute โ โ
โ โ State โ โ Action โ โ Action โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โฒ โ โ
โ โโโโโโโโโโโโโ Update State โโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
\`\`\``;
}
}
function generateOutputStructure(config) {
const base = `${config.output.location}/
โโโ ${config.execution_mode === 'sequential' ? 'sections/' : 'state.json'}`;
if (config.execution_mode === 'sequential') {
return base + '\n' + config.sequential_config.phases.map(p =>
`โ โโโ ${p.output || 'section-' + p.id + '.md'}`
).join('\n') + `\nโโโ ${config.output.filename_pattern}`;
} else {
return base + `
โโโ actions-log.json
โโโ ${config.output.filename_pattern}`;
}
}
function generateReferenceTable(config) {
const rows = [];
if (config.execution_mode === 'sequential') {
config.sequential_config.phases.forEach(p => {
rows.push(`| [phases/${p.id}.md](phases/${p.id}.md) | ${p.name} |`);
});
} else {
rows.push(`| [phases/orchestrator.md](phases/orchestrator.md) | ็ผๆๅจ |`);
rows.push(`| [phases/state-schema.md](phases/state-schema.md) | ็ถๆๅฎไน |`);
config.autonomous_config.actions.forEach(a => {
rows.push(`| [phases/actions/${a.id}.md](phases/actions/${a.id}.md) | ${a.name} |`);
});
}
rows.push(`| [specs/${config.skill_name}-requirements.md](specs/${config.skill_name}-requirements.md) | ้ขๅ่ง่ |`);
rows.push(`| [specs/quality-standards.md](specs/quality-standards.md) | ่ดจ้ๆ ๅ |`);
return `| Document | Purpose |\n|----------|---------||\n` + rows.join('\n');
}
Output
- Directory:
.claude/skills/{skill-name}/ - Files:
SKILL.md(ๅ ฅๅฃๆไปถ)phases/(็ฉบ็ฎๅฝ)specs/(็ฉบ็ฎๅฝ)templates/(็ฉบ็ฎๅฝ)
Next Phase
### phases/03-phase-generation.md
```markdown
# Phase 3: Phase Generation
ๆ นๆฎๆง่กๆจกๅผ็ๆ Phase ๆไปถ๏ผๅ
ๅซๅฃฐๆๅผๅทฅไฝๆต็ผๆๅไธไธๆ็ญ็ฅๆฏๆใ
## Objective
- Sequential ๆจกๅผ๏ผ็ๆ้กบๅบ Phase ๆไปถ + **ๅฃฐๆๅผ็ผๆๅจ**
- Autonomous ๆจกๅผ๏ผ็ๆ็ผๆๅจๅๅจไฝๆไปถ
- ๆฏๆ **ๆไปถไธไธๆ** ๅ **ๅ
ๅญไธไธๆ** ไธค็ง็ญ็ฅ
## Input
- ไพ่ต: `skill-config.json`, SKILL.md (Phase 1-2 ไบงๅบ)
- ๆจกๆฟ: `templates/sequential-phase.md`, `templates/autonomous-*.md`
## ไธไธๆ็ญ็ฅ (P0 ๅขๅผบ)
ๆ นๆฎ `config.context_strategy` ็ๆไธๅ็ไธไธๆ็ฎก็ไปฃ็ ๏ผ
| ็ญ็ฅ | ้็จๅบๆฏ | ไผ็น | ็ผบ็น |
|------|----------|------|------|
| `file` | ๅคๆๅค้ถๆฎตไปปๅก | ๆไน
ๅใๅฏ่ฐ่ฏใๅฏๆขๅค | IO ๅผ้ |
| `memory` | ็ฎๅ็บฟๆงไปปๅก | ้ๅบฆๅฟซ | ๆ ๆณๆขๅคใ่ฐ่ฏๅฐ้พ |
```javascript
const CONTEXT_STRATEGIES = {
file: {
read: (key) => `JSON.parse(Read(\`\${workDir}/context/${key}.json\`))`,
write: (key, data) => `Write(\`\${workDir}/context/${key}.json\`, JSON.stringify(${data}, null, 2))`,
init: `Bash(\`mkdir -p "\${workDir}/context"\`)`
},
memory: {
read: (key) => `state.context.${key}`,
write: (key, data) => `state.context.${key} = ${data}`,
init: `state.context = {}`
}
};
Execution Steps
Step 1: ่ฏปๅ้ ็ฝฎๅๆจกๆฟ
const config = JSON.parse(Read(`${workDir}/skill-config.json`));
const skillDir = `.claude/skills/${config.skill_name}`;
const contextStrategy = config.context_strategy || 'file'; // ้ป่ฎคๆไปถ็ญ็ฅ
// ่ฏปๅๆจกๆฟ
const skillRoot = '.claude/skills/skill-generator';
Step 2: Sequential ๆจกๅผ - ็ๆ้ถๆฎตๆไปถ + ๅฃฐๆๅผ็ผๆๅจ
if (config.execution_mode === 'sequential') {
const phases = config.sequential_config.phases;
// ========== P0 ๅขๅผบ: ็ๆๅฃฐๆๅผ็ผๆๅจ ==========
const workflowOrchestrator = generateSequentialOrchestrator(config, phases);
Write(`${skillDir}/phases/_orchestrator.md`, workflowOrchestrator);
// ========== P0 ๅขๅผบ: ็ๆๅทฅไฝๆตๅฎไน ==========
const workflowDef = generateWorkflowDefinition(config, phases);
Write(`${skillDir}/workflow.json`, JSON.stringify(workflowDef, null, 2));
// ็ๆๅ้ถๆฎตๆไปถ
for (let i = 0; i < phases.length; i++) {
const phase = phases[i];
const prevPhase = i > 0 ? phases[i-1] : null;
const nextPhase = i < phases.length - 1 ? phases[i+1] : null;
const content = generateSequentialPhase({
phaseNumber: i + 1,
phaseId: phase.id,
phaseName: phase.name,
phaseDescription: phase.description || `Execute ${phase.name}`,
input: prevPhase ? prevPhase.output : "user input",
output: phase.output,
nextPhase: nextPhase ? nextPhase.id : null,
config: config,
contextStrategy: contextStrategy
});
Write(`${skillDir}/phases/${phase.id}.md`, content);
}
}
// ========== P0 ๅขๅผบ: ๅฃฐๆๅผๅทฅไฝๆตๅฎไน ==========
function generateWorkflowDefinition(config, phases) {
return {
skill_name: config.skill_name,
version: "1.0.0",
execution_mode: "sequential",
context_strategy: config.context_strategy || "file",
// ๅฃฐๆๅผ้ถๆฎตๅ่กจ (็ฑปไผผ software-manual ็ agents_to_run)
phases_to_run: phases.map(p => p.id),
// ้ถๆฎต้
็ฝฎ
phases: phases.map((p, i) => ({
id: p.id,
name: p.name,
order: i + 1,
input: i > 0 ? phases[i-1].output : null,
output: p.output,
// ๅฏ้็ๅนถ่ก้
็ฝฎ
parallel: p.parallel || false,
// ๅฏ้็ๆกไปถๆง่ก
condition: p.condition || null,
// Agent ้
็ฝฎ
agent: p.agent || {
type: "universal-executor",
run_in_background: false
}
})),
// ็ปๆญขๆกไปถ
termination: {
on_success: "all_phases_completed",
on_error: "stop_and_report",
max_retries: 3
}
};
}
// ========== P0 ๅขๅผบ: ๅฃฐๆๅผ็ผๆๅจ ==========
function generateSequentialOrchestrator(config, phases) {
return `# Sequential Orchestrator
ๅฃฐๆๅผๅทฅไฝๆต็ผๆๅจ๏ผๆ \`workflow.json\` ๅฎไน้กบๅบๆง่ก้ถๆฎตใ
## ๅทฅไฝๆตๅฎไน
\`\`\`javascript
const workflow = JSON.parse(Read(\`\${skillDir}/workflow.json\`));
\`\`\`
## ็ผๆ้ป่พ
\`\`\`javascript
async function runSequentialWorkflow(workDir) {
const workflow = JSON.parse(Read(\`\${skillDir}/workflow.json\`));
const contextStrategy = workflow.context_strategy;
// ๅๅงๅไธไธๆ
${config.context_strategy === 'file' ?
`Bash(\`mkdir -p "\${workDir}/context"\`);` :
`const state = { context: {} };`}
// ๆง่ก็ถๆ่ฟฝ่ธช
const execution = {
started_at: new Date().toISOString(),
phases_completed: [],
current_phase: null,
errors: []
};
Write(\`\${workDir}/execution-state.json\`, JSON.stringify(execution, null, 2));
// ๆๅฃฐๆ้กบๅบๆง่ก้ถๆฎต
for (const phaseId of workflow.phases_to_run) {
const phaseConfig = workflow.phases.find(p => p.id === phaseId);
// ๆดๆฐๆง่ก็ถๆ
execution.current_phase = phaseId;
Write(\`\${workDir}/execution-state.json\`, JSON.stringify(execution, null, 2));
console.log(\`[Orchestrator] Executing: \${phaseId}\`);
try {
// ๆฃๆฅๆกไปถๆง่ก
if (phaseConfig.condition) {
const shouldRun = evaluateCondition(phaseConfig.condition, execution);
if (!shouldRun) {
console.log(\`[Orchestrator] Skipping \${phaseId} (condition not met)\`);
continue;
}
}
// ๆง่ก้ถๆฎต
const result = await executePhase(phaseId, phaseConfig, workDir);
// ่ฎฐๅฝๅฎๆ
execution.phases_completed.push({
id: phaseId,
completed_at: new Date().toISOString(),
output: phaseConfig.output
});
} catch (error) {
execution.errors.push({
phase: phaseId,
message: error.message,
timestamp: new Date().toISOString()
});
// ้่ฏฏๅค็็ญ็ฅ
if (workflow.termination.on_error === 'stop_and_report') {
console.error(\`[Orchestrator] Failed at \${phaseId}: \${error.message}\`);
break;
}
}
Write(\`\${workDir}/execution-state.json\`, JSON.stringify(execution, null, 2));
}
// ๅฎๆ
execution.current_phase = null;
execution.completed_at = new Date().toISOString();
Write(\`\${workDir}/execution-state.json\`, JSON.stringify(execution, null, 2));
return execution;
}
async function executePhase(phaseId, phaseConfig, workDir) {
const phasePrompt = Read(\`\${skillDir}/phases/\${phaseId}.md\`);
// ไฝฟ็จ Task ่ฐ็จ Agent
const result = await Task({
subagent_type: phaseConfig.agent?.type || 'universal-executor',
run_in_background: phaseConfig.agent?.run_in_background || false,
prompt: \`
[PHASE] \${phaseId}
[WORK_DIR] \${workDir}
[INPUT] \${phaseConfig.input ? \`\${workDir}/\${phaseConfig.input}\` : 'None'}
[OUTPUT] \${workDir}/\${phaseConfig.output}
\${phasePrompt}
\`
});
return JSON.parse(result);
}
\`\`\`
## ้ถๆฎตๆง่ก่ฎกๅ
| Order | Phase | Input | Output | Agent |
|-------|-------|-------|--------|-------|
${phases.map((p, i) =>
`| ${i+1} | ${p.id} | ${i > 0 ? phases[i-1].output : '-'} | ${p.output} | ${p.agent?.type || 'universal-executor'} |`
).join('\n')}
## ้่ฏฏๆขๅค
\`\`\`javascript
// ไปๆๅฎ้ถๆฎตๆขๅคๆง่ก
async function resumeFromPhase(phaseId, workDir) {
const workflow = JSON.parse(Read(\`\${skillDir}/workflow.json\`));
const startIndex = workflow.phases_to_run.indexOf(phaseId);
if (startIndex === -1) {
throw new Error(\`Phase not found: \${phaseId}\`);
}
// ไปๆๅฎ้ถๆฎตๅผๅงๆง่ก
const remainingPhases = workflow.phases_to_run.slice(startIndex);
// ...็ปง็ปญๆง่ก
}
\`\`\`
`;
}
// ็ๆ้ถๆฎตๆไปถ๏ผๅขๅผบไธไธๆ็ญ็ฅๆฏๆ๏ผ
function generateSequentialPhase(params) {
const contextCode = params.contextStrategy === 'file' ? {
readPrev: `const prevOutput = JSON.parse(Read(\`\${workDir}/${params.input}\`));`,
writeResult: `Write(\`\${workDir}/${params.output}\`, JSON.stringify(result, null, 2));`,
readContext: (key) => `JSON.parse(Read(\`\${workDir}/context/${key}.json\`))`,
writeContext: (key) => `Write(\`\${workDir}/context/${key}.json\`, JSON.stringify(data, null, 2))`
} : {
readPrev: `const prevOutput = state.context.prevPhaseOutput;`,
writeResult: `state.context.${params.phaseId.replace(/-/g, '_')}_output = result;`,
readContext: (key) => `state.context.${key}`,
writeContext: (key) => `state.context.${key} = data`
};
return `# Phase ${params.phaseNumber}: ${params.phaseName}
${params.phaseDescription}
## Objective
- ไธป่ฆ็ฎๆ ๆ่ฟฐ
- ๅ
ทไฝไปปๅกๅ่กจ
## Input
- ไพ่ต: \`${params.input}\`
- ้
็ฝฎ: \`{workDir}/skill-config.json\`
- ไธไธๆ็ญ็ฅ: \`${params.contextStrategy}\`
## Execution Steps
### Step 1: ่ฏปๅ่พๅ
ฅ
\`\`\`javascript
// ไธไธๆ็ญ็ฅ: ${params.contextStrategy}
${params.phaseNumber > 1 ? contextCode.readPrev : '// ้ฆ้ถๆฎต๏ผ็ดๆฅไป้
็ฝฎๅผๅง'}
\`\`\`
### Step 2: ๆ ธๅฟๅค็
\`\`\`javascript
// TODO: ๅฎ็ฐๆ ธๅฟ้ป่พ
const result = {
status: 'completed',
data: {
// ๅค็็ปๆ
},
metadata: {
phase: '${params.phaseId}',
timestamp: new Date().toISOString()
}
};
\`\`\`
### Step 3: ่พๅบ็ปๆ
\`\`\`javascript
// ๅๅ
ฅ้ถๆฎตไบงๅบ (ไธไธๆ็ญ็ฅ: ${params.contextStrategy})
${contextCode.writeResult}
// ่ฟๅ็ฎ่ฆไฟกๆฏ็ป็ผๆๅจ
return {
status: 'completed',
output_file: '${params.output}',
summary: '้ถๆฎต ${params.phaseNumber} ๅฎๆ'
};
\`\`\`
## Output
- **File**: \`${params.output}\`
- **Format**: ${params.output.endsWith('.json') ? 'JSON' : 'Markdown'}
- **Context Strategy**: ${params.contextStrategy}
## Quality Checklist
- [ ] ่พๅ
ฅๆฐๆฎ้ช่ฏ้่ฟ
- [ ] ๆ ธๅฟ้ป่พๆง่กๆๅ
- [ ] ่พๅบๆ ผๅผๆญฃ็กฎ
- [ ] ไธไธๆๆญฃ็กฎไฟๅญ
${params.nextPhase ?
`## Next Phase\n\nโ [Phase ${params.phaseNumber + 1}: ${params.nextPhase}](${params.nextPhase}.md)` :
`## Completion\n\nๆญคไธบๆๅ้ถๆฎต๏ผ่พๅบๆ็ปไบง็ฉใ`}
`;
}
Step 3: Autonomous ๆจกๅผ - ็ๆ็ผๆๅจ (ๅขๅผบ็)
if (config.execution_mode === 'autonomous' || config.execution_mode === 'hybrid') {
const contextStrategy = config.context_strategy || 'file';
// ็ๆ็ถๆ Schema (ๅขๅผบๆไปถ็ญ็ฅๆฏๆ)
const stateSchema = generateStateSchema(config, contextStrategy);
Write(`${skillDir}/phases/state-schema.md`, stateSchema);
// ็ๆ็ผๆๅจ (ๅขๅผบ็)
const orchestrator = generateEnhancedOrchestrator(config, contextStrategy);
Write(`${skillDir}/phases/orchestrator.md`, orchestrator);
// ็ๆๅจไฝ็ฎๅฝ
const actionCatalog = generateActionCatalog(config);
Write(`${skillDir}/specs/action-catalog.md`, actionCatalog);
// ็ๆๅจไฝๆไปถ
for (const action of config.autonomous_config.actions) {
const actionContent = generateEnhancedAction(action, config, contextStrategy);
Write(`${skillDir}/phases/actions/${action.id}.md`, actionContent);
}
}
// ๅขๅผบ็็ผๆๅจ็ๆ
function generateEnhancedOrchestrator(config, contextStrategy) {
const actions = config.autonomous_config.actions;
return `# Orchestrator (Enhanced)
ๅขๅผบ็็ผๆๅจ๏ผๆฏๆๅฃฐๆๅผๅจไฝ่ฐๅบฆๅๆไปถไธไธๆ็ญ็ฅใ
## ้
็ฝฎ
- **ไธไธๆ็ญ็ฅ**: ${contextStrategy}
- **็ปๆญขๆกไปถ**: ${config.autonomous_config.termination_conditions?.join(', ') || 'task_completed'}
## ๅฃฐๆๅผๅจไฝ็ฎๅฝ
\`\`\`javascript
const ACTION_CATALOG = ${JSON.stringify(actions.map(a => ({
id: a.id,
name: a.name,
preconditions: a.preconditions || [],
effects: a.effects || [],
priority: a.priority || 0
})), null, 2)};
\`\`\`
## ไธไธๆ็ฎก็ (${contextStrategy} ็ญ็ฅ)
\`\`\`javascript
const ContextManager = {
${contextStrategy === 'file' ? `
// ๆไปถ็ญ็ฅ: ๆไน
ๅๅฐ .scratchpad
init: (workDir) => {
Bash(\`mkdir -p "\${workDir}/context"\`);
Write(\`\${workDir}/state.json\`, JSON.stringify(initialState, null, 2));
},
readState: (workDir) => JSON.parse(Read(\`\${workDir}/state.json\`)),
writeState: (workDir, state) => {
state.updated_at = new Date().toISOString();
Write(\`\${workDir}/state.json\`, JSON.stringify(state, null, 2));
},
readContext: (workDir, key) => {
try {
return JSON.parse(Read(\`\${workDir}/context/\${key}.json\`));
} catch { return null; }
},
writeContext: (workDir, key, data) => {
Write(\`\${workDir}/context/\${key}.json\`, JSON.stringify(data, null, 2));
}` : `
// ๅ
ๅญ็ญ็ฅ: ไป
ๅจ่ฟ่กๆถไฟๆ
state: null,
context: {},
init: (workDir) => {
ContextManager.state = { ...initialState };
ContextManager.context = {};
},
readState: () => ContextManager.state,
writeState: (workDir, state) => {
state.updated_at = new Date().toISOString();
ContextManager.state = state;
},
readContext: (workDir, key) => ContextManager.context[key],
writeContext: (workDir, key, data) => {
ContextManager.context[key] = data;
}`}
};
\`\`\`
## ๅณ็ญ้ป่พ
\`\`\`javascript
function selectNextAction(state) {
// 1. ็ปๆญขๆกไปถๆฃๆฅ
${config.autonomous_config.termination_conditions?.map(c =>
` if (${getTerminationCheck(c)}) return null;`
).join('\n') || ' if (state.status === "completed") return null;'}
// 2. ้่ฏฏ้ๅถๆฃๆฅ
if (state.error_count >= 3) return 'action-abort';
// 3. ๆไผๅ
็บง้ๆฉๆปก่ถณๅ็ฝฎๆกไปถ็ๅจไฝ
const availableActions = ACTION_CATALOG
.filter(a => checkPreconditions(a.preconditions, state))
.filter(a => !state.completed_actions.includes(a.id))
.sort((a, b) => b.priority - a.priority);
if (availableActions.length > 0) {
return availableActions[0].id;
}
// 4. ้ป่ฎคๅฎๆ
return 'action-complete';
}
function checkPreconditions(conditions, state) {
if (!conditions || conditions.length === 0) return true;
return conditions.every(cond => {
// ๆฏๆๅค็งๆกไปถๆ ผๅผ
if (cond.includes('===')) {
const [left, right] = cond.split('===').map(s => s.trim());
return eval(\`state.\${left}\`) === eval(right);
}
return state[cond] === true;
});
}
\`\`\`
## ๆง่กๅพช็ฏ (ๅขๅผบ็)
\`\`\`javascript
async function runOrchestrator(workDir) {
console.log('=== Orchestrator Started ===');
console.log(\`Context Strategy: ${contextStrategy}\`);
// ๅๅงๅ
ContextManager.init(workDir);
let iteration = 0;
const MAX_ITERATIONS = 100;
while (iteration < MAX_ITERATIONS) {
iteration++;
// 1. ่ฏปๅ็ถๆ
const state = ContextManager.readState(workDir);
console.log(\`[Iteration \${iteration}] Status: \${state.status}, Completed: \${state.completed_actions.length}\`);
// 2. ้ๆฉๅจไฝ
const actionId = selectNextAction(state);
if (!actionId) {
console.log('=== All actions completed ===');
state.status = 'completed';
ContextManager.writeState(workDir, state);
break;
}
console.log(\`[Iteration \${iteration}] Executing: \${actionId}\`);
// 3. ๆดๆฐๅฝๅๅจไฝ
state.current_action = actionId;
ContextManager.writeState(workDir, state);
// 4. ๆง่กๅจไฝ
try {
const actionPrompt = Read(\`\${skillDir}/phases/actions/\${actionId}.md\`);
const result = await Task({
subagent_type: 'universal-executor',
run_in_background: false,
prompt: \`
[STATE]
\${JSON.stringify(state, null, 2)}
[WORK_DIR]
\${workDir}
[CONTEXT_STRATEGY]
${contextStrategy}
[ACTION]
\${actionPrompt}
[RETURN FORMAT]
Return JSON: { "status": "completed"|"failed", "stateUpdates": {...}, "summary": "..." }
\`
});
const actionResult = JSON.parse(result);
// 5. ๆดๆฐ็ถๆ
state.completed_actions.push(actionId);
state.current_action = null;
Object.assign(state, actionResult.stateUpdates || {});
console.log(\`[Iteration \${iteration}] Completed: \${actionResult.summary || actionId}\`);
} catch (error) {
console.error(\`[Iteration \${iteration}] Error: \${error.message}\`);
state.errors.push({
action: actionId,
message: error.message,
timestamp: new Date().toISOString()
});
state.error_count++;
state.current_action = null;
}
ContextManager.writeState(workDir, state);
}
console.log('=== Orchestrator Finished ===');
return ContextManager.readState(workDir);
}
\`\`\`
## ๅจไฝ็ฎๅฝ
| Action | Priority | Preconditions | Effects |
|--------|----------|---------------|---------|
${actions.map(a =>
`| [${a.id}](actions/${a.id}.md) | ${a.priority || 0} | ${a.preconditions?.join(', ') || '-'} | ${a.effects?.join(', ') || '-'} |`
).join('\n')}
## ่ฐ่ฏไธๆขๅค
\`\`\`javascript
// ไป็นๅฎ็ถๆๆขๅค
async function resumeFromState(workDir) {
const state = ContextManager.readState(workDir);
console.log(\`Resuming from: \${state.current_action || 'start'}\`);
console.log(\`Completed actions: \${state.completed_actions.join(', ')}\`);
return runOrchestrator(workDir);
}
// ้่ฏๅคฑ่ดฅ็ๅจไฝ
async function retryFailedAction(workDir) {
const state = ContextManager.readState(workDir);
if (state.errors.length > 0) {
const lastError = state.errors[state.errors.length - 1];
console.log(\`Retrying: \${lastError.action}\`);
state.error_count = Math.max(0, state.error_count - 1);
ContextManager.writeState(workDir, state);
return runOrchestrator(workDir);
}
}
\`\`\`
`;
}
// ๅขๅผบ็ๅจไฝ็ๆ
function generateEnhancedAction(action, config, contextStrategy) {
return `# Action: ${action.name}
${action.description || 'ๆง่ก ' + action.name + ' ๆไฝ'}
## Purpose
${action.description || 'TODO: ๆ่ฟฐๆญคๅจไฝ็็ฎ็'}
## Preconditions
${action.preconditions?.map(p => `- [ ] \`${p}\``).join('\n') || '- [ ] ๆ ็นๆฎๅ็ฝฎๆกไปถ'}
## Context Access (${contextStrategy} ็ญ็ฅ)
\`\`\`javascript
// ่ฏปๅๅ
ฑไบซไธไธๆ
${contextStrategy === 'file' ?
`const sharedData = JSON.parse(Read(\`\${workDir}/context/shared.json\`));` :
`const sharedData = state.context.shared || {};`}
// ๅๅ
ฅๅ
ฑไบซไธไธๆ
${contextStrategy === 'file' ?
`Write(\`\${workDir}/context/shared.json\`, JSON.stringify(updatedData, null, 2));` :
`state.context.shared = updatedData;`}
\`\`\`
## Execution
\`\`\`javascript
async function execute(state, workDir) {
// 1. ่ฏปๅๅฟ
่ฆๆฐๆฎ
${contextStrategy === 'file' ?
`const input = JSON.parse(Read(\`\${workDir}/context/input.json\`));` :
`const input = state.context.input || {};`}
// 2. ๆง่กๆ ธๅฟ้ป่พ
// TODO: ๅฎ็ฐๅจไฝ้ป่พ
const result = {
// ๅค็็ปๆ
};
// 3. ไฟๅญ็ปๆ (${contextStrategy} ็ญ็ฅ)
${contextStrategy === 'file' ?
`Write(\`\${workDir}/context/${action.id.replace(/-/g, '_')}_result.json\`, JSON.stringify(result, null, 2));` :
`// ็ปๆ้่ฟ stateUpdates ่ฟๅ`}
// 4. ่ฟๅ็ถๆๆดๆฐ
return {
status: 'completed',
stateUpdates: {
completed_actions: [...state.completed_actions, '${action.id}'],
${contextStrategy === 'memory' ? `context: { ...state.context, ${action.id.replace(/-/g, '_')}_result: result }` : '// ๆไปถ็ญ็ฅ๏ผ็ปๆๅทฒไฟๅญๅฐๆไปถ'}
},
summary: '${action.name} ๅฎๆ'
};
}
\`\`\`
## State Updates
\`\`\`javascript
return {
status: 'completed',
stateUpdates: {
completed_actions: [...state.completed_actions, '${action.id}'],
${action.effects?.map(e => ` // Effect: ${e}`).join('\n') || ' // ๆ ้ขๅคๆๆ'}
}
};
\`\`\`
## Error Handling
| ้่ฏฏ็ฑปๅ | ๅค็ๆนๅผ |
|----------|----------|
| ๆฐๆฎ้ช่ฏๅคฑ่ดฅ | ่ฟๅ้่ฏฏ๏ผไธๆดๆฐ็ถๆ |
| ๆง่กๅผๅธธ | ่ฎฐๅฝ้่ฏฏ๏ผๅขๅ error_count |
| ไธไธๆ่ฏปๅๅคฑ่ดฅ | ไฝฟ็จ้ป่ฎคๅผๆ่ทณ่ฟ |
## Next Actions (Hints)
- ๆๅ: ็ฑ็ผๆๅจๆ นๆฎ \`ACTION_CATALOG\` ไผๅ
็บงๅณๅฎ
- ๅคฑ่ดฅ: ้่ฏๆ \`action-abort\`
`;
}
// ็ๆๅจไฝ็ฎๅฝ
function generateActionCatalog(config) {
const actions = config.autonomous_config.actions;
return `# Action Catalog
${config.display_name} ็ๅฏ็จๅจไฝ็ฎๅฝ๏ผๅฃฐๆๅผ๏ผใ
## ๅจไฝๅฎไน
\`\`\`json
${JSON.stringify(actions.map(a => ({
id: a.id,
name: a.name,
description: a.description,
preconditions: a.preconditions || [],
effects: a.effects || [],
priority: a.priority || 0
})), null, 2)}
\`\`\`
## ๅจไฝไพ่ตๅพ
\`\`\`mermaid
graph TD
${actions.map((a, i) => {
const deps = a.preconditions?.filter(p => p.startsWith('completed_actions.includes'))
.map(p => p.match(/'([^']+)'/)?.[1])
.filter(Boolean) || [];
if (deps.length === 0 && i === 0) {
return ` START((Start)) --> ${a.id.replace(/-/g, '_')}[${a.name}]`;
} else if (deps.length > 0) {
return deps.map(d => ` ${d.replace(/-/g, '_')} --> ${a.id.replace(/-/g, '_')}[${a.name}]`).join('\n');
}
return '';
}).filter(Boolean).join('\n')}
${actions[actions.length-1]?.id.replace(/-/g, '_') || 'last'} --> END((End))
\`\`\`
## ้ๆฉไผๅ
็บง
| Priority | Action | Description |
|----------|--------|-------------|
${actions.sort((a, b) => (b.priority || 0) - (a.priority || 0)).map(a =>
`| ${a.priority || 0} | ${a.id} | ${a.description || a.name} |`
).join('\n')}
`;
}
Step 4: ่พ ๅฉๅฝๆฐ
function toPascalCase(str) {
return str.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('');
}
function getDefaultValue(type) {
if (type.endsWith('[]')) return '[]';
if (type === 'number') return '0';
if (type === 'boolean') return 'false';
if (type === 'string') return '""';
return '{}';
}
function getTerminationCheck(condition) {
const checks = {
'user_exit': 'state.status === "user_exit"',
'error_limit': 'state.error_count >= 3',
'task_completed': 'state.status === "completed"',
'max_iterations': 'iteration >= MAX_ITERATIONS'
};
return checks[condition] || `state.${condition}`;
}
function getPreconditionCheck(action) {
if (!action.preconditions?.length) return 'true';
return action.preconditions.map(p => `state.${p}`).join(' && ');
}
Output
Sequential ๆจกๅผ
phases/_orchestrator.md(ๅฃฐๆๅผ็ผๆๅจ)workflow.json(ๅทฅไฝๆตๅฎไน)phases/01-{step}.md,02-{step}.md, ...
Autonomous ๆจกๅผ
phases/orchestrator.md(ๅขๅผบ็็ผๆๅจ)phases/state-schema.mdspecs/action-catalog.md(ๅฃฐๆๅผๅจไฝ็ฎๅฝ)phases/actions/action-{name}.md(ๅคไธช)
Next Phase
โ Phase 4: Specs & Templates
### phases/04-specs-templates.md
```markdown
# Phase 4: Specs & Templates Generation
็ๆ่ง่ๆไปถๅๆจกๆฟๆไปถใ
## Objective
- ็ๆ้ขๅ่ง่ (`specs/{domain}-requirements.md`)
- ็ๆ่ดจ้ๆ ๅ (`specs/quality-standards.md`)
- ็ๆ Agent ๆจกๆฟ (`templates/agent-base.md`)
- Autonomous ๆจกๅผ้ขๅค็ๆๅจไฝ็ฎๅฝ (`specs/action-catalog.md`)
## Input
- ไพ่ต: `skill-config.json`, SKILL.md, phases/*.md
## Execution Steps
### Step 1: ็ๆ้ขๅ่ง่
```javascript
const config = JSON.parse(Read(`${workDir}/skill-config.json`));
const skillDir = `.claude/skills/${config.skill_name}`;
const domainRequirements = `# ${config.display_name} Requirements
${config.description}
## When to Use
| Phase | Usage | Reference |
|-------|-------|-----------|
${config.execution_mode === 'sequential' ?
config.sequential_config.phases.map((p, i) =>
`| Phase ${i+1} | ${p.name} | ${p.id}.md |`
).join('\n') :
`| Orchestrator | ๅจไฝ้ๆฉ | orchestrator.md |
| Actions | ๅจไฝๆง่ก | actions/*.md |`}
---
## Domain Requirements
### ๅ่ฝ่ฆๆฑ
- [ ] ่ฆๆฑ1: TODO
- [ ] ่ฆๆฑ2: TODO
- [ ] ่ฆๆฑ3: TODO
### ่พๅบ่ฆๆฑ
- [ ] ๆ ผๅผ: ${config.output.format}
- [ ] ไฝ็ฝฎ: ${config.output.location}
- [ ] ๅฝๅ: ${config.output.filename_pattern}
### ่ดจ้่ฆๆฑ
- [ ] ๅฎๆดๆง: ๆๆๅฟ
้ๅ
ๅฎนๅญๅจ
- [ ] ไธ่ดๆง: ๆฏ่ฏญๅๆ ผๅผ็ปไธ
- [ ] ๅ็กฎๆง: ๅ
ๅฎนๅบไบๅฎ้
ๅๆ
## Validation Function
\`\`\`javascript
function validate${toPascalCase(config.skill_name)}(output) {
const checks = [
// TODO: ๆทปๅ ้ช่ฏ่งๅ
{ name: "ๆ ผๅผๆญฃ็กฎ", pass: output.format === "${config.output.format}" },
{ name: "ๅ
ๅฎนๅฎๆด", pass: output.content?.length > 0 }
];
return {
passed: checks.filter(c => c.pass).length,
total: checks.length,
details: checks
};
}
\`\`\`
## Error Handling
| Error | Recovery |
|-------|----------|
| ่พๅ
ฅๆฐๆฎ็ผบๅคฑ | ่ฟๅๆ็กฎ้่ฏฏไฟกๆฏ |
| ๅค็่ถ
ๆถ | ็ผฉๅฐ่ๅด๏ผ้่ฏ |
| ่พๅบ้ช่ฏๅคฑ่ดฅ | ่ฎฐๅฝ้ฎ้ข๏ผไบบๅทฅๅฎกๆ ธ |
`;
Write(`${skillDir}/specs/${config.skill_name}-requirements.md`, domainRequirements);
Step 2: ็ๆ่ดจ้ๆ ๅ
const qualityStandards = `# Quality Standards
${config.display_name} ็่ดจ้่ฏไผฐๆ ๅใ
## Quality Dimensions
### 1. Completeness (ๅฎๆดๆง) - 25%
| ่ฆๆฑ | ๆ้ | ๆฃๆฅๆนๅผ |
|------|------|----------|
| ๆๆๅฟ
้่พๅบๅญๅจ | 10 | ๆไปถๆฃๆฅ |
| ๅ
ๅฎน่ฆ็ๅฎๆด | 10 | ๅ
ๅฎนๅๆ |
| ๆ ๅ ไฝ็ฌฆๆฎ็ | 5 | ๆๆฌๆ็ดข |
### 2. Consistency (ไธ่ดๆง) - 25%
| ๆน้ข | ๆฃๆฅ |
|------|------|
| ๆฏ่ฏญ | ๅไธๆฆๅฟตไฝฟ็จ็ธๅๆฏ่ฏญ |
| ๆ ผๅผ | ๆ ้ขๅฑ็บงใไปฃ็ ๅๆ ผๅผไธ่ด |
| ้ฃๆ ผ | ่ฏญๆฐๅ่กจ่พพๆนๅผ็ปไธ |
### 3. Accuracy (ๅ็กฎๆง) - 25%
| ่ฆๆฑ | ่ฏดๆ |
|------|------|
| ๆฐๆฎๆญฃ็กฎ | ๅผ็จๅๆฐๆฎๆ ้่ฏฏ |
| ้ป่พๆญฃ็กฎ | ๆต็จๅๅ
ณ็ณปๆ่ฟฐๅ็กฎ |
| ไปฃ็ ๆญฃ็กฎ | ไปฃ็ ็คบไพๅฏ่ฟ่ก |
### 4. Usability (ๅฏ็จๆง) - 25%
| ๆๆ | ็ฎๆ |
|------|------|
| ๅฏ่ฏปๆง | ็ปๆๆธ
ๆฐ๏ผๆไบ็่งฃ |
| ๅฏๅฏผ่ช | ็ฎๅฝๅ้พๆฅๆญฃ็กฎ |
| ๅฏๆไฝ | ๆญฅ้ชคๆ็กฎ๏ผๅฏๆง่ก |
## Quality Gates
| Gate | Threshold | Action |
|------|-----------|--------|
| Pass | โฅ 80% | ่พๅบๆ็ปไบง็ฉ |
| Review | 60-79% | ๅค็่ญฆๅๅ็ปง็ปญ |
| Fail | < 60% | ๅฟ
้กปไฟฎๅค |
## Issue Classification
### Errors (Must Fix)
- ๅฟ
้่พๅบ็ผบๅคฑ
- ๆฐๆฎ้่ฏฏ
- ไปฃ็ ไธๅฏ่ฟ่ก
### Warnings (Should Fix)
- ๆ ผๅผไธไธ่ด
- ๅ
ๅฎนๆทฑๅบฆไธ่ถณ
- ็ผบๅฐ็คบไพ
### Info (Nice to Have)
- ไผๅๅปบ่ฎฎ
- ๅขๅผบๆบไผ
## Automated Checks
\`\`\`javascript
function runQualityChecks(workDir) {
const results = {
completeness: checkCompleteness(workDir),
consistency: checkConsistency(workDir),
accuracy: checkAccuracy(workDir),
usability: checkUsability(workDir)
};
results.overall = (
results.completeness * 0.25 +
results.consistency * 0.25 +
results.accuracy * 0.25 +
results.usability * 0.25
);
return {
score: results.overall,
gate: results.overall >= 80 ? 'pass' :
results.overall >= 60 ? 'review' : 'fail',
details: results
};
}
\`\`\`
`;
Write(`${skillDir}/specs/quality-standards.md`, qualityStandards);
Step 3: ็ๆ Agent ๆจกๆฟ
const agentBase = `# Agent Base Template
${config.display_name} ็ Agent ๅบ็กๆจกๆฟใ
## ้็จ Prompt ็ปๆ
\`\`\`
[ROLE] ไฝ ๆฏ{่ง่ฒ}๏ผไธๆณจไบ{่่ดฃ}ใ
[PROJECT CONTEXT]
Skill: ${config.skill_name}
็ฎๆ : ${config.description}
[TASK]
{ไปปๅกๆ่ฟฐ}
- ่พๅบ: {output_path}
- ๆ ผๅผ: ${config.output.format}
[CONSTRAINTS]
- ็บฆๆ1
- ็บฆๆ2
[OUTPUT_FORMAT]
1. ๆง่กไปปๅก
2. ่ฟๅ JSON ็ฎ่ฆไฟกๆฏ
[QUALITY_CHECKLIST]
- [ ] ่พๅบๆ ผๅผๆญฃ็กฎ
- [ ] ๅ
ๅฎนๅฎๆดๆ ้ๆผ
- [ ] ๆ ๅ ไฝ็ฌฆๆฎ็
\`\`\`
## ๅ้่ฏดๆ
| ๅ้ | ๆฅๆบ | ็คบไพ |
|------|------|------|
| {workDir} | ่ฟ่กๆถ | .workflow/.scratchpad/${config.skill_name}-xxx |
| {output_path} | ้
็ฝฎ | ${config.output.location}/${config.output.filename_pattern} |
## ่ฟๅๆ ผๅผ
\`\`\`typescript
interface AgentReturn {
status: "completed" | "partial" | "failed";
output_file: string;
summary: string; // Max 50 chars
stats?: {
items_processed?: number;
errors?: number;
};
}
\`\`\`
## ่ง่ฒๅฎไนๅ่
${config.execution_mode === 'sequential' ?
config.sequential_config.phases.map((p, i) =>
`- **Phase ${i+1} Agent**: ${p.name} ไธๅฎถ`
).join('\n') :
config.autonomous_config.actions.map(a =>
`- **${a.name} Agent**: ${a.description || a.name + ' ๆง่ก่
'}`
).join('\n')}
`;
Write(`${skillDir}/templates/agent-base.md`, agentBase);
Step 4: Autonomous ๆจกๅผ - ๅจไฝ็ฎๅฝ
if (config.execution_mode === 'autonomous' || config.execution_mode === 'hybrid') {
const actionCatalog = `# Action Catalog
${config.display_name} ็ๅฏ็จๅจไฝ็ฎๅฝใ
## Available Actions
| Action | Purpose | Preconditions | Effects |
|--------|---------|---------------|---------|
${config.autonomous_config.actions.map(a =>
`| [${a.id}](../phases/actions/${a.id}.md) | ${a.description || a.name} | ${a.preconditions?.join(', ') || '-'} | ${a.effects?.join(', ') || '-'} |`
).join('\n')}
## Action Dependencies
\`\`\`mermaid
graph TD
${config.autonomous_config.actions.map((a, i, arr) => {
if (i === 0) return ` ${a.id.replace(/-/g, '_')}[${a.name}]`;
const prev = arr[i-1];
return ` ${prev.id.replace(/-/g, '_')} --> ${a.id.replace(/-/g, '_')}[${a.name}]`;
}).join('\n')}
\`\`\`
## State Transitions
| From State | Action | To State |
|------------|--------|----------|
| pending | action-init | running |
${config.autonomous_config.actions.slice(1).map(a =>
`| running | ${a.id} | running |`
).join('\n')}
| running | action-complete | completed |
| running | action-abort | failed |
## Selection Priority
ๅฝๅคไธชๅจไฝ็ๅ็ฝฎๆกไปถ้ฝๆปก่ถณๆถ๏ผๆไปฅไธไผๅ
็บง้ๆฉ๏ผ
${config.autonomous_config.actions.map((a, i) =>
`${i + 1}. \`${a.id}\` - ${a.name}`
).join('\n')}
`;
Write(`${skillDir}/specs/action-catalog.md`, actionCatalog);
}
Step 5: ่พ ๅฉๅฝๆฐ
function toPascalCase(str) {
return str.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('');
}
Output
specs/{skill-name}-requirements.md- ้ขๅ่ง่specs/quality-standards.md- ่ดจ้ๆ ๅspecs/action-catalog.md- ๅจไฝ็ฎๅฝ (Autonomous ๆจกๅผ)templates/agent-base.md- Agent ๆจกๆฟ
Next Phase
### phases/05-validation.md
```markdown
# Phase 5: Validation & Documentation
้ช่ฏ็ๆ็ Skill ๅฎๆดๆงๅนถ็ๆไฝฟ็จ่ฏดๆใ
## Objective
- ้ช่ฏๆๆๅฟ
้ๆไปถๅญๅจ
- ๆฃๆฅๆไปถๅ
ๅฎนๅฎๆดๆง
- ็ๆ README.md ไฝฟ็จ่ฏดๆ
- ่พๅบ้ช่ฏๆฅๅ
## Input
- ไพ่ต: ๆๆๅๅบ้ถๆฎตไบงๅบ
- ็ๆ็ Skill ็ฎๅฝ
## Execution Steps
### Step 1: ๆไปถๅฎๆดๆงๆฃๆฅ
```javascript
const config = JSON.parse(Read(`${workDir}/skill-config.json`));
const skillDir = `.claude/skills/${config.skill_name}`;
const requiredFiles = {
common: [
'SKILL.md',
`specs/${config.skill_name}-requirements.md`,
'specs/quality-standards.md',
'templates/agent-base.md'
],
sequential: config.sequential_config?.phases?.map(p => `phases/${p.id}.md`) || [],
autonomous: [
'phases/orchestrator.md',
'phases/state-schema.md',
'specs/action-catalog.md',
...(config.autonomous_config?.actions?.map(a => `phases/actions/${a.id}.md`) || [])
]
};
const filesToCheck = [
...requiredFiles.common,
...(config.execution_mode === 'sequential' ? requiredFiles.sequential : requiredFiles.autonomous)
];
const fileCheckResults = filesToCheck.map(file => {
const fullPath = `${skillDir}/${file}`;
try {
const content = Read(fullPath);
return {
file: file,
exists: true,
size: content.length,
hasContent: content.length > 100,
hasTodo: content.includes('TODO')
};
} catch (e) {
return {
file: file,
exists: false,
size: 0,
hasContent: false,
hasTodo: false
};
}
});
Step 2: ๅ ๅฎน่ดจ้ๆฃๆฅ
const contentChecks = [];
// ๆฃๆฅ SKILL.md
const skillMd = Read(`${skillDir}/SKILL.md`);
contentChecks.push({
file: 'SKILL.md',
checks: [
{ name: 'Front Matter', pass: skillMd.startsWith('---') },
{ name: 'Architecture', pass: skillMd.includes('## Architecture') },
{ name: 'Execution Flow', pass: skillMd.includes('## Execution Flow') },
{ name: 'References', pass: skillMd.includes('## Reference Documents') }
]
});
// ๆฃๆฅ Phase ๆไปถ
const phaseFiles = Glob(`${skillDir}/phases/*.md`);
for (const phaseFile of phaseFiles) {
if (phaseFile.includes('/actions/')) continue; // ๅ็ฌๆฃๆฅ
const content = Read(phaseFile);
contentChecks.push({
file: phaseFile.replace(skillDir + '/', ''),
checks: [
{ name: 'Objective', pass: content.includes('## Objective') },
{ name: 'Execution', pass: content.includes('## Execution') || content.includes('## Execution Steps') },
{ name: 'Output', pass: content.includes('## Output') },
{ name: 'Code Blocks', pass: content.includes('```') }
]
});
}
// ๆฃๆฅ Specs ๆไปถ
const specFiles = Glob(`${skillDir}/specs/*.md`);
for (const specFile of specFiles) {
const content = Read(specFile);
contentChecks.push({
file: specFile.replace(skillDir + '/', ''),
checks: [
{ name: 'Has Content', pass: content.length > 200 },
{ name: 'Has Structure', pass: content.includes('##') },
{ name: 'No Empty Sections', pass: !content.match(/##[^#]+\n\n##/) }
]
});
}
Step 3: ็ๆ้ช่ฏๆฅๅ
const report = {
skill_name: config.skill_name,
execution_mode: config.execution_mode,
generated_at: new Date().toISOString(),
file_checks: {
total: fileCheckResults.length,
existing: fileCheckResults.filter(f => f.exists).length,
with_content: fileCheckResults.filter(f => f.hasContent).length,
with_todos: fileCheckResults.filter(f => f.hasTodo).length,
details: fileCheckResults
},
content_checks: {
files_checked: contentChecks.length,
all_passed: contentChecks.every(c => c.checks.every(ch => ch.pass)),
details: contentChecks
},
summary: {
status: calculateOverallStatus(fileCheckResults, contentChecks),
issues: collectIssues(fileCheckResults, contentChecks),
recommendations: generateRecommendations(fileCheckResults, contentChecks)
}
};
Write(`${workDir}/validation-report.json`, JSON.stringify(report, null, 2));
function calculateOverallStatus(fileResults, contentResults) {
const allFilesExist = fileResults.every(f => f.exists);
const allContentPassed = contentResults.every(c => c.checks.every(ch => ch.pass));
if (allFilesExist && allContentPassed) return 'PASS';
if (allFilesExist) return 'REVIEW';
return 'FAIL';
}
function collectIssues(fileResults, contentResults) {
const issues = [];
fileResults.filter(f => !f.exists).forEach(f => {
issues.push({ type: 'ERROR', message: `ๆไปถ็ผบๅคฑ: ${f.file}` });
});
fileResults.filter(f => f.hasTodo).forEach(f => {
issues.push({ type: 'WARNING', message: `ๅ
ๅซ TODO: ${f.file}` });
});
contentResults.forEach(c => {
c.checks.filter(ch => !ch.pass).forEach(ch => {
issues.push({ type: 'WARNING', message: `${c.file}: ็ผบๅฐ ${ch.name}` });
});
});
return issues;
}
function generateRecommendations(fileResults, contentResults) {
const recommendations = [];
if (fileResults.some(f => f.hasTodo)) {
recommendations.push('ๆฟๆขๆๆ TODO ๅ ไฝ็ฌฆไธบๅฎ้
ๅ
ๅฎน');
}
contentResults.forEach(c => {
if (c.checks.some(ch => !ch.pass)) {
recommendations.push(`ๅฎๅ ${c.file} ็็ปๆ`);
}
});
return recommendations;
}
Step 4: ็ๆ README.md
const readme = `# ${config.display_name}
${config.description}
## Quick Start
### ่งฆๅ่ฏ
${config.triggers.map(t => `- "${t}"`).join('\n')}
### ๆง่กๆจกๅผ
**${config.execution_mode === 'sequential' ? 'Sequential (้กบๅบ)' : 'Autonomous (่ชไธป)'}**
${config.execution_mode === 'sequential' ?
`้ถๆฎตๆๅบๅฎ้กบๅบๆง่ก๏ผ\n${config.sequential_config.phases.map((p, i) =>
`${i + 1}. ${p.name}`
).join('\n')}` :
`ๅจไฝ็ฑ็ผๆๅจๅจๆ้ๆฉ๏ผ\n${config.autonomous_config.actions.map(a =>
`- ${a.name}: ${a.description || ''}`
).join('\n')}`}
## Usage
\`\`\`
# ็ดๆฅ่งฆๅ
็จๆท: ${config.triggers[0]}
# ๆไฝฟ็จ Skill ๅ็งฐ
็จๆท: /skill ${config.skill_name}
\`\`\`
## Output
- **ๆ ผๅผ**: ${config.output.format}
- **ไฝ็ฝฎ**: \`${config.output.location}\`
- **ๆไปถๅ**: \`${config.output.filename_pattern}\`
## Directory Structure
\`\`\`
.claude/skills/${config.skill_name}/
โโโ SKILL.md # ๅ
ฅๅฃๆไปถ
โโโ phases/ # ๆง่ก้ถๆฎต
${config.execution_mode === 'sequential' ?
config.sequential_config.phases.map(p => `โ โโโ ${p.id}.md`).join('\n') :
`โ โโโ orchestrator.md
โ โโโ state-schema.md
โ โโโ actions/
${config.autonomous_config.actions.map(a => `โ โโโ ${a.id}.md`).join('\n')}`}
โโโ specs/ # ่ง่ๆไปถ
โ โโโ ${config.skill_name}-requirements.md
โ โโโ quality-standards.md
${config.execution_mode === 'autonomous' ? 'โ โโโ action-catalog.md' : ''}
โโโ templates/ # ๆจกๆฟๆไปถ
โโโ agent-base.md
\`\`\`
## Customization
### ไฟฎๆนๆง่ก้ป่พ
็ผ่พ \`phases/\` ็ฎๅฝไธ็้ถๆฎตๆไปถใ
### ่ฐๆด่ดจ้ๆ ๅ
็ผ่พ \`specs/quality-standards.md\`ใ
### ๆทปๅ ๆฐ${config.execution_mode === 'sequential' ? '้ถๆฎต' : 'ๅจไฝ'}
${config.execution_mode === 'sequential' ?
`1. ๅจ \`phases/\` ๅๅปบๆฐ็้ถๆฎตๆไปถ (ๅฆ \`03.5-new-step.md\`)
2. ๆดๆฐ SKILL.md ็ๆง่กๆต็จ` :
`1. ๅจ \`phases/actions/\` ๅๅปบๆฐ็ๅจไฝๆไปถ
2. ๆดๆฐ \`specs/action-catalog.md\`
3. ๅจ \`phases/orchestrator.md\` ๆทปๅ ้ๆฉ้ป่พ`}
## Related Documents
- [่ฎพ่ฎก่ง่](../_shared/SKILL-DESIGN-SPEC.md)
- [ๆง่กๆจกๅผ่ง่](specs/../../../skill-generator/specs/execution-modes.md)
---
*Generated by skill-generator v1.0*
`;
Write(`${skillDir}/README.md`, readme);
Step 5: ่พๅบๆ็ป็ปๆ
const finalResult = {
skill_name: config.skill_name,
skill_path: skillDir,
execution_mode: config.execution_mode,
generated_files: [
'SKILL.md',
'README.md',
...filesToCheck
],
validation: report.summary,
next_steps: [
'1. ๅฎก้
็ๆ็ๆไปถ็ปๆ',
'2. ๆฟๆข TODO ๅ ไฝ็ฌฆ',
'3. ๆ นๆฎๅฎ้
้ๆฑ่ฐๆด้ถๆฎต้ป่พ',
'4. ๆต่ฏ Skill ๆง่กๆต็จ',
'5. ๆดๆฐ่งฆๅ่ฏๅๆ่ฟฐ'
]
};
console.log('=== Skill ็ๆๅฎๆ ===');
console.log(`่ทฏๅพ: ${skillDir}`);
console.log(`ๆจกๅผ: ${config.execution_mode}`);
console.log(`็ถๆ: ${report.summary.status}`);
console.log('');
console.log('ไธไธๆญฅ:');
finalResult.next_steps.forEach(s => console.log(s));
Output
{workDir}/validation-report.json- ้ช่ฏๆฅๅ{skillDir}/README.md- ไฝฟ็จ่ฏดๆ
Completion
Skill ็ๆๆต็จๅฎๆใ็จๆทๅฏไปฅ๏ผ
- ๆฅ็็ๆ็ Skill ็ฎๅฝ
- ๆ นๆฎ้ช่ฏๆฅๅไฟฎๅค้ฎ้ข
- ่ชๅฎไนๆง่ก้ป่พ
- ๆต่ฏ Skill ๅ่ฝ
### specs/execution-modes.md
```markdown
# Execution Modes Specification
ไธค็ง Skill ๆง่กๆจกๅผ็่ฏฆ็ป่ง่ๅฎไนใ
---
## ๆจกๅผๆฆ่ง
| ็นๆง | Sequential (้กบๅบ) | Autonomous (่ชไธป) |
|------|-------------------|-------------------|
| ๆง่ก้กบๅบ | ๅบๅฎ๏ผๆฐๅญๅ็ผ๏ผ | ๅจๆ๏ผ็ผๆๅจๅณ็ญ๏ผ |
| ้ถๆฎตไพ่ต | ๅผบไพ่ต | ๅผฑไพ่ต/ๆ ไพ่ต |
| ็ถๆ็ฎก็ | ้ๅผ๏ผ้ถๆฎตไบงๅบ๏ผ | ๆพๅผ๏ผ็ถๆๆไปถ๏ผ |
| ้็จๅบๆฏ | ๆตๆฐด็บฟไปปๅก | ไบคไบๅผไปปๅก |
| ๅคๆๅบฆ | ไฝ | ไธญ-้ซ |
| ๅฏๆฉๅฑๆง | ๆๅ
ฅๅญ้ถๆฎต | ๆทปๅ ๆฐๅจไฝ |
---
## Mode 1: Sequential (้กบๅบๆจกๅผ)
### ๅฎไน
้ถๆฎตๆๅบๅฎ้กบๅบ็บฟๆงๆง่ก๏ผๆฏไธช้ถๆฎต็่พๅบไฝไธบไธไธ้ถๆฎต็่พๅ
ฅใ
### ็ฎๅฝ็ปๆ
phases/ โโโ 01-{first-step}.md โโโ 02-{second-step}.md โโโ 02.5-{sub-step}.md # ๅฏ้๏ผๅญ้ถๆฎต โโโ 03-{third-step}.md โโโ ...
### ๆง่กๆต็จ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โPhase 01 โโโโโโถโPhase 02 โโโโโโถโPhase 03 โโโโโโถ ... โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ โ โ โผ โผ โผ output1.json output2.md output3.md
### Phase ๆไปถ่ง่
```markdown
# Phase N: {้ถๆฎตๅ็งฐ}
{ไธๅฅ่ฏๆ่ฟฐ}
## Objective
{่ฏฆ็ป็ฎๆ }
## Input
- ไพ่ต: {ไธไธ้ถๆฎตไบงๅบ}
- ้
็ฝฎ: {้
็ฝฎๆไปถ}
## Execution Steps
### Step 1: {ๆญฅ้ชค}
{ๆง่กไปฃ็ ๆ่ฏดๆ}
### Step 2: {ๆญฅ้ชค}
{ๆง่กไปฃ็ ๆ่ฏดๆ}
## Output
- **File**: `{่พๅบๆไปถ}`
- **Format**: {JSON/Markdown}
## Next Phase
โ [Phase N+1: xxx](0N+1-xxx.md)
้็จๅบๆฏ
- ๆๆกฃ็ๆ: ๆถ้ โ ๅๆ โ ็ป่ฃ โ ไผๅ
- ไปฃ็ ๅๆ: ๆซๆ โ ่งฃๆ โ ๆฅๅ
- ๆฐๆฎๅค็: ๆๅ โ ่ฝฌๆข โ ๅ ่ฝฝ
ไผ็น
- ้ป่พๆธ ๆฐ๏ผๆไบ็่งฃ
- ่ฐ่ฏ็ฎๅ๏ผๅฏ้้ถๆฎต้ช่ฏ
- ่พๅบๅฏ้ขๆต
็ผบ็น
- ็ตๆดปๆงไฝ
- ้พไปฅๅค็ๅๆฏ้ป่พ
- ็จๆทไบคไบๅ้
Mode 2: Autonomous (่ชไธปๆจกๅผ)
ๅฎไน
ๆ ๅบๅฎๆง่ก้กบๅบ๏ผ็ฑ็ผๆๅจ (Orchestrator) ๆ นๆฎๅฝๅ็ถๆๅจๆ้ๆฉไธไธไธชๅจไฝใ
็ฎๅฝ็ปๆ
phases/
โโโ orchestrator.md # ็ผๆๅจ๏ผๆ ธๅฟๅณ็ญ้ป่พ
โโโ state-schema.md # ็ถๆ็ปๆๅฎไน
โโโ actions/ # ็ฌ็ซๅจไฝ๏ผๆ ้กบๅบ๏ผ
โโโ action-{a}.md
โโโ action-{b}.md
โโโ action-{c}.md
โโโ ...
ๆ ธๅฟ็ปไปถ
1. Orchestrator (็ผๆๅจ)
# Orchestrator
## Role
ๆ นๆฎๅฝๅ็ถๆ้ๆฉๅนถๆง่กไธไธไธชๅจไฝใ
## State Reading
่ฏปๅ็ถๆๆไปถ: `{workDir}/state.json`
## Decision Logic
```javascript
function selectNextAction(state) {
// 1. ๆฃๆฅ็ปๆญขๆกไปถ
if (state.status === 'completed') return null;
if (state.error_count > MAX_RETRIES) return 'action-abort';
// 2. ๆ นๆฎ็ถๆ้ๆฉๅจไฝ
if (!state.initialized) return 'action-init';
if (state.pending_items.length > 0) return 'action-process';
if (state.needs_review) return 'action-review';
// 3. ้ป่ฎคๅจไฝ
return 'action-complete';
}
Execution Loop
while (true) {
state = readState();
action = selectNextAction(state);
if (!action) break;
result = executeAction(action, state);
updateState(result);
}
#### 2. State Schema (็ถๆ็ปๆ)
```markdown
# State Schema
## ็ถๆๆไปถ
ไฝ็ฝฎ: `{workDir}/state.json`
## ็ปๆๅฎไน
```typescript
interface SkillState {
// ๅ
ไฟกๆฏ
skill_name: string;
started_at: string;
updated_at: string;
// ๆง่ก็ถๆ
status: 'pending' | 'running' | 'completed' | 'failed';
current_action: string | null;
completed_actions: string[];
// ไธๅกๆฐๆฎ
context: Record<string, any>;
pending_items: any[];
results: Record<string, any>;
// ้่ฏฏ่ฟฝ่ธช
errors: Array<{
action: string;
message: string;
timestamp: string;
}>;
error_count: number;
}
ๅๅง็ถๆ
{
"skill_name": "{skill-name}",
"started_at": "{ISO8601}",
"updated_at": "{ISO8601}",
"status": "pending",
"current_action": null,
"completed_actions": [],
"context": {},
"pending_items": [],
"results": {},
"errors": [],
"error_count": 0
}
#### 3. Action (ๅจไฝ)
```markdown
# Action: {action-name}
## Purpose
{ๅจไฝ็ฎ็}
## Preconditions
- [ ] ๆกไปถ1
- [ ] ๆกไปถ2
## Execution
{ๆง่ก้ป่พ}
## State Updates
```javascript
return {
completed_actions: [...state.completed_actions, 'action-name'],
results: {
...state.results,
action_name: { /* ็ปๆ */ }
},
// ๅ
ถไป็ถๆๆดๆฐ
};
Next Actions (Hints)
- ๆๅๆถ:
action-{next} - ๅคฑ่ดฅๆถ:
action-retryๆaction-abort
### ๆง่กๆต็จ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Orchestrator Loop โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โ โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ โ โ โ Read โโโโโโถโ Select โโโโโโถโ Execute โ โ โ โ โ โ State โ โ Action โ โ Action โ โ โ โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ โ โ โฒ โ โ โ โ โ โ โผ โ โ โ โ โ โโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโ Update โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ State โ โ โ โ โโโโโโโโโโโโ โ โ โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โ โผ โ โ โโโโโโโโโโโโโโโโโโโโ โ โ โ Termination? โ โ โ โ - completed โ โ โ โ - max_retries โ โ โ โ - user_abort โ โ โ โโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
### ๅจไฝ็ฎๅฝ (Action Catalog)
ๅจ `specs/action-catalog.md` ไธญๅฎไน๏ผ
```markdown
# Action Catalog
## Available Actions
| Action | Purpose | Preconditions | Effects |
|--------|---------|---------------|---------|
| action-init | ๅๅงๅ็ถๆ | status=pending | status=running |
| action-process | ๅค็ๅพ
ๅ้กน | pending_items.length>0 | pending_items-- |
| action-review | ็จๆทๅฎกๆ ธ | needs_review=true | needs_review=false |
| action-complete | ๅฎๆไปปๅก | pending_items.length=0 | status=completed |
| action-abort | ไธญๆญขไปปๅก | error_count>MAX | status=failed |
## Action Dependencies Graph
```mermaid
graph TD
INIT[action-init] --> PROCESS[action-process]
PROCESS --> PROCESS
PROCESS --> REVIEW[action-review]
REVIEW --> PROCESS
REVIEW --> COMPLETE[action-complete]
PROCESS --> ABORT[action-abort]
### ้็จๅบๆฏ
- **ไบคไบๅผไปปๅก**: ้ฎ็ญใๅฏน่ฏใ่กจๅๅกซๅ
- **็ถๆๆบไปปๅก**: Issue ็ฎก็ใๅทฅไฝๆตๅฎกๆน
- **ๆข็ดขๅผไปปๅก**: ่ฐ่ฏใ่ฏๆญใๆ็ดข
### ไผ็น
- ้ซๅบฆ็ตๆดป๏ผ้ๅบๅจๆ้ๆฑ
- ๆฏๆๅคๆๅๆฏ้ป่พ
- ๆไบๆฉๅฑๆฐๅจไฝ
### ็ผบ็น
- ๅคๆๅบฆ้ซ
- ็ถๆ็ฎก็ๅผ้
- ่ฐ่ฏ้พๅบฆๅคง
---
## ๆจกๅผ้ๆฉๆๅ
### ๅณ็ญๆต็จ
็จๆท้ๆฑๅๆ โ โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ ้ถๆฎต้ดๆฏๅฆๆๅผบไพ่ตๅ ณ็ณป๏ผ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโ ๆฏ โ Sequential โ โโโ ๅฆ โ ็ปง็ปญๅคๆญ โ โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ ๆฏๅฆ้่ฆๅจๆๅๅบ็จๆทๆๅพ๏ผ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโ ๆฏ โ Autonomous โ โโโ ๅฆ โ Sequential
### ๅฟซ้ๅคๆญ่กจ
| ้ฎ้ข | Sequential | Autonomous |
|------|------------|------------|
| ่พๅบ็ปๆๆฏๅฆๅบๅฎ๏ผ | โ | โ |
| ๆฏๅฆ้่ฆ็จๆทๅค่ฝฎไบคไบ๏ผ | โ | โ |
| ้ถๆฎตๆฏๅฆๅฏไปฅ่ทณ่ฟ/้ๅค๏ผ | โ | โ |
| ๆฏๅฆๆๅคๆๅๆฏ้ป่พ๏ผ | โ | โ |
| ่ฐ่ฏๆฏๅฆ้่ฆ็ฎๅ๏ผ | โ | โ |
---
## ๆททๅๆจกๅผ
ๆไบๅคๆ Skill ๅฏ่ฝ้่ฆๆททๅไฝฟ็จไธค็งๆจกๅผ๏ผ
phases/ โโโ 01-init.md # Sequential: ๅๅงๅ โโโ 02-orchestrator.md # Autonomous: ๆ ธๅฟไบคไบๅพช็ฏ โ โโโ actions/ โ โโโ action-a.md โ โโโ action-b.md โโโ 03-finalize.md # Sequential: ๆถๅฐพ
**้็จๅบๆฏ**:
- ๅๅงๅๅๆถๅฐพๅบๅฎ๏ผไธญ้ดไบคไบ็ตๆดป
- ๅค้ถๆฎตไปปๅก๏ผๆ้ถๆฎต้่ฆๅจๆๅณ็ญ
specs/skill-requirements.md
# Skill Requirements Specification
ๆฐ Skill ๅๅปบ็้ๆฑๆถ้่ง่ใ
---
## ๅฟ
้ไฟกๆฏ
### 1. ๅบๆฌไฟกๆฏ
| ๅญๆฎต | ็ฑปๅ | ๅฟ
้ | ่ฏดๆ |
|------|------|------|------|
| `skill_name` | string | โ | Skill ๆ ่ฏ็ฌฆ๏ผๅฐๅ-่ฟๅญ็ฌฆ๏ผ |
| `display_name` | string | โ | ๆพ็คบๅ็งฐ |
| `description` | string | โ | ไธๅฅ่ฏๆ่ฟฐ |
| `triggers` | string[] | โ | ่งฆๅๅ
ณ้ฎ่ฏๅ่กจ |
### 2. ๆง่กๆจกๅผ
| ๅญๆฎต | ็ฑปๅ | ๅฟ
้ | ่ฏดๆ |
|------|------|------|------|
| `execution_mode` | enum | โ | `sequential` \| `autonomous` \| `hybrid` |
| `phase_count` | number | ๆกไปถ | Sequential ๆจกๅผไธ็้ถๆฎตๆฐ |
| `action_count` | number | ๆกไปถ | Autonomous ๆจกๅผไธ็ๅจไฝๆฐ |
### 2.5 ไธไธๆ็ญ็ฅ (P0 ๅขๅผบ)
| ๅญๆฎต | ็ฑปๅ | ๅฟ
้ | ่ฏดๆ |
|------|------|------|------|
| `context_strategy` | enum | โ | `file` \| `memory` |
**็ญ็ฅๅฏนๆฏ**:
| ็ญ็ฅ | ๆไน
ๅ | ๅฏ่ฐ่ฏ | ๅฏๆขๅค | ้็จๅบๆฏ |
|------|--------|--------|--------|----------|
| `file` | โ | โ | โ | ๅคๆๅค้ถๆฎตไปปๅก๏ผๆจ่๏ผ |
| `memory` | โ | โ | โ | ็ฎๅ็บฟๆงไปปๅก |
### 2.6 LLM ้ๆ้
็ฝฎ (P1 ๅขๅผบ)
| ๅญๆฎต | ็ฑปๅ | ๅฟ
้ | ่ฏดๆ |
|------|------|------|------|
| `llm_integration` | object | ๅฏ้ | LLM ่ฐ็จ้
็ฝฎ |
| `llm_integration.enabled` | boolean | - | ๆฏๅฆๅฏ็จ LLM ่ฐ็จ |
| `llm_integration.default_tool` | enum | - | `gemini` \| `qwen` \| `codex` |
| `llm_integration.fallback_chain` | string[] | - | ๅคฑ่ดฅๆถ็ๅค้ๅทฅๅ
ท้พ |
### 3. ๅทฅๅ
ทไพ่ต
| ๅญๆฎต | ็ฑปๅ | ๅฟ
้ | ่ฏดๆ |
|------|------|------|------|
| `allowed_tools` | string[] | โ | ๅ
่ฎธไฝฟ็จ็ๅทฅๅ
ทๅ่กจ |
| `mcp_tools` | string[] | ๅฏ้ | ้่ฆ็ MCP ๅทฅๅ
ท |
### 4. ่พๅบ้
็ฝฎ
| ๅญๆฎต | ็ฑปๅ | ๅฟ
้ | ่ฏดๆ |
|------|------|------|------|
| `output_format` | enum | โ | `markdown` \| `html` \| `json` |
| `output_location` | string | โ | ่พๅบ็ฎๅฝๆจกๅผ |
---
## ้
็ฝฎๆไปถ็ปๆ
```typescript
interface SkillConfig {
// ๅบๆฌไฟกๆฏ
skill_name: string; // "my-skill"
display_name: string; // "My Skill"
description: string; // "ไธๅฅ่ฏๆ่ฟฐ"
triggers: string[]; // ["keyword1", "keyword2"]
// ๆง่กๆจกๅผ
execution_mode: 'sequential' | 'autonomous' | 'hybrid';
// ไธไธๆ็ญ็ฅ (P0 ๅขๅผบ)
context_strategy: 'file' | 'memory'; // ้ป่ฎค: 'file'
// LLM ้ๆ้
็ฝฎ (P1 ๅขๅผบ)
llm_integration?: {
enabled: boolean; // ๆฏๅฆๅฏ็จ LLM ่ฐ็จ
default_tool: 'gemini' | 'qwen' | 'codex';
fallback_chain: string[]; // ['gemini', 'qwen', 'codex']
mode: 'analysis' | 'write'; // ้ป่ฎค mode
};
// Sequential ๆจกๅผ้
็ฝฎ
sequential_config?: {
phases: Array<{
id: string; // "01-init"
name: string; // "Initialization"
description: string; // "ๆถ้ๅๅง้
็ฝฎ"
input: string[]; // ่พๅ
ฅไพ่ต
output: string; // ่พๅบๆไปถ
}>;
};
// Autonomous ๆจกๅผ้
็ฝฎ
autonomous_config?: {
state_schema: {
fields: Array<{
name: string;
type: string;
description: string;
}>;
};
actions: Array<{
id: string; // "action-init"
name: string; // "Initialize"
description: string; // "ๅๅงๅ็ถๆ"
preconditions: string[]; // ๅ็ฝฎๆกไปถ
effects: string[]; // ๆง่กๆๆ
}>;
termination_conditions: string[];
};
// ๅทฅๅ
ทไพ่ต
allowed_tools: string[]; // ["Task", "Read", "Write", ...]
mcp_tools?: string[]; // ["mcp__chrome__*"]
// ่พๅบ้
็ฝฎ
output: {
format: 'markdown' | 'html' | 'json';
location: string; // ".workflow/.scratchpad/{skill}-{timestamp}"
filename_pattern: string; // "{name}-output.{ext}"
};
// ่ดจ้้
็ฝฎ
quality?: {
dimensions: string[]; // ["completeness", "consistency", ...]
pass_threshold: number; // 80
};
// ๅ
ๆฐๆฎ
created_at: string;
version: string;
}
้ๆฑๆถ้้ฎ้ข
Phase 1: ๅบๆฌไฟกๆฏ
AskUserQuestion({
questions: [
{
question: "Skill ็ๅ็งฐๆฏไปไน๏ผ๏ผ่ฑๆ๏ผๅฐๅ-่ฟๅญ็ฌฆๆ ผๅผ๏ผ",
header: "Skill ๅ็งฐ",
multiSelect: false,
options: [
{ label: "่ชๅจ็ๆ", description: "ๆ นๆฎๆ่ฟฐ่ชๅจ็ๆๅ็งฐ" },
{ label: "ๆๅจ่พๅ
ฅ", description: "่พๅ
ฅ่ชๅฎไนๅ็งฐ" }
]
},
{
question: "Skill ็ไธป่ฆ็จ้ๆฏไปไน๏ผ",
header: "็จ้็ฑปๅ",
multiSelect: false,
options: [
{ label: "ๆๆกฃ็ๆ", description: "็ๆ Markdown/HTML ๆๆกฃ" },
{ label: "ไปฃ็ ๅๆ", description: "ๅๆไปฃ็ ็ปๆใ่ดจ้ใๅฎๅ
จ" },
{ label: "ไบคไบ็ฎก็", description: "็ฎก็ Issueใไปปๅกใๅทฅไฝๆต" },
{ label: "ๆฐๆฎๅค็", description: "ETLใ่ฝฌๆขใๆฅๅ็ๆ" },
{ label: "่ชๅฎไน", description: "ๅ
ถไป็จ้" }
]
}
]
});
Phase 2: ๆง่กๆจกๅผ
AskUserQuestion({
questions: [
{
question: "้ๆฉๆง่กๆจกๅผ๏ผ",
header: "ๆง่กๆจกๅผ",
multiSelect: false,
options: [
{
label: "Sequential (้กบๅบ)",
description: "้ถๆฎตๆๅบๅฎ้กบๅบๆง่ก๏ผ้ๅๆตๆฐด็บฟไปปๅก๏ผๆจ่๏ผ"
},
{
label: "Autonomous (่ชไธป)",
description: "ๅจๆ้ๆฉๆง่ก่ทฏๅพ๏ผ้ๅไบคไบๅผไปปๅก"
},
{
label: "Hybrid (ๆททๅ)",
description: "ๅๅงๅๅๆถๅฐพๅบๅฎ๏ผไธญ้ดไบคไบ็ตๆดป"
}
]
}
]
});
Phase 3: ้ถๆฎต/ๅจไฝๅฎไน
Sequential ๆจกๅผ
AskUserQuestion({
questions: [
{
question: "้่ฆๅคๅฐไธชๆง่ก้ถๆฎต๏ผ",
header: "้ถๆฎตๆฐ้",
multiSelect: false,
options: [
{ label: "3 ้ถๆฎต", description: "็ฎๅ: ๆถ้ โ ๅค็ โ ่พๅบ" },
{ label: "5 ้ถๆฎต", description: "ๆ ๅ: ๆถ้ โ ๆข็ดข โ ๅๆ โ ็ป่ฃ
โ ้ช่ฏ" },
{ label: "7 ้ถๆฎต", description: "ๅฎๆด: ๅ
ๅซๅนถ่กๅค็ๅ่ฟญไปฃไผๅ" },
{ label: "่ชๅฎไน", description: "ๆๅจๆๅฎ้ถๆฎต" }
]
}
]
});
Autonomous ๆจกๅผ
AskUserQuestion({
questions: [
{
question: "ๆ ธๅฟๅจไฝๆๅชไบ๏ผ",
header: "ๅจไฝๅฎไน",
multiSelect: true,
options: [
{ label: "ๅๅงๅ (init)", description: "่ฎพ็ฝฎๅๅง็ถๆ" },
{ label: "ๅ่กจ (list)", description: "ๆพ็คบๅฝๅ้กน็ฎ" },
{ label: "ๅๅปบ (create)", description: "ๅๅปบๆฐ้กน็ฎ" },
{ label: "็ผ่พ (edit)", description: "ไฟฎๆน็ฐๆ้กน็ฎ" },
{ label: "ๅ ้ค (delete)", description: "ๅ ้ค้กน็ฎ" },
{ label: "ๅฎๆ (complete)", description: "ๅฎๆไปปๅก" }
]
}
]
});
Phase 4: ไธไธๆ็ญ็ฅ (P0 ๅขๅผบ)
AskUserQuestion({
questions: [
{
question: "้ๆฉไธไธๆ็ฎก็็ญ็ฅ๏ผ",
header: "ไธไธๆ็ญ็ฅ",
multiSelect: false,
options: [
{
label: "ๆไปถ็ญ็ฅ (file)",
description: "ๆไน
ๅๅฐ .scratchpad๏ผๆฏๆ่ฐ่ฏๅๆขๅค๏ผๆจ่๏ผ"
},
{
label: "ๅ
ๅญ็ญ็ฅ (memory)",
description: "ไป
ๅจ่ฟ่กๆถไฟๆ๏ผ้ๅบฆๅฟซไฝๆ ๆณๆขๅค"
}
]
}
]
});
Phase 5: LLM ้ๆ (P1 ๅขๅผบ)
AskUserQuestion({
questions: [
{
question: "ๆฏๅฆ้่ฆ LLM ่ฐ็จ่ฝๅ๏ผ",
header: "LLM ้ๆ",
multiSelect: false,
options: [
{
label: "ๅฏ็จ LLM ่ฐ็จ",
description: "ไฝฟ็จ gemini/qwen/codex ่ฟ่กๅๆๆ็ๆ"
},
{
label: "ไธ้่ฆ",
description: "ไป
ไฝฟ็จๆฌๅฐๅทฅๅ
ท"
}
]
}
]
});
// ๅฆๆๅฏ็จ LLM
if (llmEnabled) {
AskUserQuestion({
questions: [
{
question: "้ๆฉ้ป่ฎค LLM ๅทฅๅ
ท๏ผ",
header: "LLM ๅทฅๅ
ท",
multiSelect: false,
options: [
{ label: "Gemini", description: "ๅคงไธไธๆ๏ผ้ๅๅๆไปปๅก๏ผๆจ่๏ผ" },
{ label: "Qwen", description: "ไปฃ็ ็ๆ่ฝๅๅผบ" },
{ label: "Codex", description: "่ชไธปๆง่ก่ฝๅๅผบ๏ผ้ๅๅฎ็ฐไปปๅก" }
]
}
]
});
}
Phase 6: ๅทฅๅ ทไพ่ต
AskUserQuestion({
questions: [
{
question: "้่ฆๅชไบๅทฅๅ
ท๏ผ",
header: "ๅทฅๅ
ท้ๆฉ",
multiSelect: true,
options: [
{ label: "ๅบ็กๅทฅๅ
ท", description: "Task, Read, Write, Glob, Grep, Bash" },
{ label: "็จๆทไบคไบ", description: "AskUserQuestion" },
{ label: "Chrome ๆชๅพ", description: "mcp__chrome__*" },
{ label: "ๅค้จๆ็ดข", description: "mcp__exa__search" },
{ label: "CCW CLI ่ฐ็จ", description: "ccw cli (gemini/qwen/codex)" }
]
}
]
});
้ช่ฏ่งๅ
ๅ็งฐ้ช่ฏ
function validateSkillName(name) {
const rules = [
{ test: /^[a-z][a-z0-9-]*$/, msg: "ๅฟ
้กปไปฅๅฐๅๅญๆฏๅผๅคด๏ผๅชๅ
ๅซๅฐๅๅญๆฏใๆฐๅญใ่ฟๅญ็ฌฆ" },
{ test: /^.{3,30}$/, msg: "้ฟๅบฆ 3-30 ๅญ็ฌฆ" },
{ test: /^(?!.*--)/, msg: "ไธ่ฝๆ่ฟ็ปญ่ฟๅญ็ฌฆ" },
{ test: /[^-]$/, msg: "ไธ่ฝไปฅ่ฟๅญ็ฌฆ็ปๅฐพ" }
];
for (const rule of rules) {
if (!rule.test.test(name)) {
return { valid: false, error: rule.msg };
}
}
return { valid: true };
}
้ ็ฝฎ้ช่ฏ
function validateSkillConfig(config) {
const errors = [];
// ๅฟ
้ๅญๆฎต
if (!config.skill_name) errors.push("็ผบๅฐ skill_name");
if (!config.description) errors.push("็ผบๅฐ description");
if (!config.execution_mode) errors.push("็ผบๅฐ execution_mode");
// ๆจกๅผ็นๅฎ้ช่ฏ
if (config.execution_mode === 'sequential') {
if (!config.sequential_config?.phases?.length) {
errors.push("Sequential ๆจกๅผ้่ฆๅฎไน phases");
}
} else if (config.execution_mode === 'autonomous') {
if (!config.autonomous_config?.actions?.length) {
errors.push("Autonomous ๆจกๅผ้่ฆๅฎไน actions");
}
}
return { valid: errors.length === 0, errors };
}
็คบไพ้ ็ฝฎ
Sequential ๆจกๅผ็คบไพ (ๅขๅผบ็)
{
"skill_name": "api-docs-generator",
"display_name": "API Docs Generator",
"description": "Generate API documentation from source code",
"triggers": ["generate api docs", "api documentation"],
"execution_mode": "sequential",
"context_strategy": "file",
"llm_integration": {
"enabled": true,
"default_tool": "gemini",
"fallback_chain": ["gemini", "qwen"],
"mode": "analysis"
},
"sequential_config": {
"phases": [
{
"id": "01-scan",
"name": "Code Scanning",
"output": "endpoints.json",
"agent": { "type": "universal-executor", "run_in_background": false }
},
{
"id": "02-analyze",
"name": "LLM Analysis",
"output": "analysis.json",
"agent": { "type": "llm", "tool": "gemini", "mode": "analysis" }
},
{
"id": "03-generate",
"name": "Doc Generation",
"output": "api-docs.md",
"agent": { "type": "universal-executor", "run_in_background": false }
}
]
},
"allowed_tools": ["Task", "Read", "Write", "Glob", "Grep", "Bash"],
"output": {
"format": "markdown",
"location": ".workflow/.scratchpad/api-docs-{timestamp}",
"filename_pattern": "{name}-api-docs.md"
}
}
Autonomous ๆจกๅผ็คบไพ
{
"skill_name": "task-manager",
"display_name": "Task Manager",
"description": "Interactive task management with CRUD operations",
"triggers": ["manage tasks", "task list", "create task"],
"execution_mode": "autonomous",
"autonomous_config": {
"state_schema": {
"fields": [
{ "name": "tasks", "type": "Task[]", "description": "ไปปๅกๅ่กจ" },
{ "name": "current_view", "type": "string", "description": "ๅฝๅ่งๅพ" }
]
},
"actions": [
{ "id": "action-list", "name": "List Tasks", "preconditions": [], "effects": ["ๆพ็คบไปปๅกๅ่กจ"] },
{ "id": "action-create", "name": "Create Task", "preconditions": [], "effects": ["ๆทปๅ ๆฐไปปๅก"] },
{ "id": "action-edit", "name": "Edit Task", "preconditions": ["task_selected"], "effects": ["ๆดๆฐไปปๅก"] },
{ "id": "action-delete", "name": "Delete Task", "preconditions": ["task_selected"], "effects": ["ๅ ้คไปปๅก"] }
],
"termination_conditions": ["user_exit", "error_limit"]
},
"allowed_tools": ["Task", "AskUserQuestion", "Read", "Write"],
"output": {
"format": "json",
"location": ".workflow/.scratchpad/tasks",
"filename_pattern": "tasks.json"
}
}
### templates/skill-md.md
```markdown
# SKILL.md Template
็จไบ็ๆๆฐ Skill ๅ
ฅๅฃๆไปถ็ๆจกๆฟใ
## โ ๏ธ ้่ฆ๏ผYAML Front Matter ่ง่
> **CRITICAL**: SKILL.md ๆไปถๅฟ
้กปไปฅ YAML front matter ๅผๅคด๏ผๅณไปฅ `---` ไฝไธบๆไปถ็ฌฌไธ่กใ
>
> **็ฆๆญข**ไฝฟ็จไปฅไธๆ ผๅผ๏ผ
> - `# Title` ็ถๅ `## Metadata` + yaml ไปฃ็ ๅ โ
> - ไปปไฝๅจ `---` ไนๅ็ๅ
ๅฎน โ
>
> **ๆญฃ็กฎๆ ผๅผ**๏ผๆไปถ็ฌฌไธ่กๅฟ
้กปๆฏ `---`
## ๅฏ็ดๆฅๅบ็จ็ๆจกๆฟ
ไปฅไธๆฏๅฎๆด็ SKILL.md ๆจกๆฟใ็ๆๆถ**็ดๆฅๅคๅถๅบ็จ**๏ผๅฐ `{{ๅ้}}` ๆฟๆขไธบๅฎ้
ๅผ๏ผ
---
name: {{skill_name}}
description: {{description}}. Triggers on {{triggers}}.
allowed-tools: {{allowed_tools}}
---
# {{display_name}}
{{description}}
## Architecture Overview
\`\`\`
{{architecture_diagram}}
\`\`\`
## Key Design Principles
{{design_principles}}
## Execution Flow
{{execution_flow}}
## Directory Setup
\`\`\`javascript
const timestamp = new Date().toISOString().slice(0,19).replace(/[-:T]/g, '');
const workDir = \`{{output_location}}\`;
Bash(\`mkdir -p "\${workDir}"\`);
{{additional_dirs}}
\`\`\`
## Output Structure
\`\`\`
{{output_structure}}
\`\`\`
## Reference Documents
{{reference_table}}
---
## ๅ้่ฏดๆ
| ๅ้ | ็ฑปๅ | ๆฅๆบ |
|------|------|------|
| `{{skill_name}}` | string | config.skill_name |
| `{{display_name}}` | string | config.display_name |
| `{{description}}` | string | config.description |
| `{{triggers}}` | string | config.triggers.join(", ") |
| `{{allowed_tools}}` | string | config.allowed_tools.join(", ") |
| `{{architecture_diagram}}` | string | ๆ นๆฎ execution_mode ็ๆ |
| `{{design_principles}}` | string | ๆ นๆฎ execution_mode ็ๆ |
| `{{execution_flow}}` | string | ๆ นๆฎ phases/actions ็ๆ |
| `{{output_location}}` | string | config.output.location |
| `{{additional_dirs}}` | string | ๆ นๆฎ execution_mode ็ๆ |
| `{{output_structure}}` | string | ๆ นๆฎ้
็ฝฎ็ๆ |
| `{{reference_table}}` | string | ๆ นๆฎๆไปถๅ่กจ็ๆ |
## ็ๆๅฝๆฐ
```javascript
function generateSkillMd(config) {
const template = Read('templates/skill-md.md');
return template
.replace(/\{\{skill_name\}\}/g, config.skill_name)
.replace(/\{\{display_name\}\}/g, config.display_name)
.replace(/\{\{description\}\}/g, config.description)
.replace(/\{\{triggers\}\}/g, config.triggers.map(t => `"${t}"`).join(", "))
.replace(/\{\{allowed_tools\}\}/g, config.allowed_tools.join(", "))
.replace(/\{\{architecture_diagram\}\}/g, generateArchitecture(config))
.replace(/\{\{design_principles\}\}/g, generatePrinciples(config))
.replace(/\{\{execution_flow\}\}/g, generateFlow(config))
.replace(/\{\{output_location\}\}/g, config.output.location)
.replace(/\{\{additional_dirs\}\}/g, generateAdditionalDirs(config))
.replace(/\{\{output_structure\}\}/g, generateOutputStructure(config))
.replace(/\{\{reference_table\}\}/g, generateReferenceTable(config));
}
Sequential ๆจกๅผ็คบไพ
---
name: api-docs-generator
description: Generate API documentation from source code. Triggers on "generate api docs", "api documentation".
allowed-tools: Task, Read, Write, Glob, Grep, Bash
---
# API Docs Generator
Generate API documentation from source code.
## Architecture Overview
\`\`\`
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Phase 1: Scanning โ endpoints.json โ
โ โ โ
โ Phase 2: Parsing โ schemas.json โ
โ โ โ
โ Phase 3: Generation โ api-docs.md โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
\`\`\`
Autonomous ๆจกๅผ็คบไพ
---
name: task-manager
description: Interactive task management with CRUD operations. Triggers on "manage tasks", "task list".
allowed-tools: Task, AskUserQuestion, Read, Write
---
# Task Manager
Interactive task management with CRUD operations.
## Architecture Overview
\`\`\`
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Orchestrator (็ถๆ้ฉฑๅจๅณ็ญ) โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโผโโโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ โ โ
โโโโโโโโโ โโโโโโโโโ โโโโโโโโโ โโโโโโโโโ
โ List โ โCreate โ โ Edit โ โDelete โ
โโโโโโโโโ โโโโโโโโโ โโโโโโโโโ โโโโโโโโโ
\`\`\`
### templates/sequential-phase.md
```markdown
# Sequential Phase Template
้กบๅบๆจกๅผ Phase ๆไปถ็ๆจกๆฟใ
## ๆจกๆฟ็ปๆ
```markdown
# Phase {{phase_number}}: {{phase_name}}
{{phase_description}}
## Objective
{{objectives}}
## Input
- ไพ่ต: `{{input_dependency}}`
- ้
็ฝฎ: `{workDir}/skill-config.json`
## Execution Steps
### Step 1: {{step_1_name}}
\`\`\`javascript
{{step_1_code}}
\`\`\`
### Step 2: {{step_2_name}}
\`\`\`javascript
{{step_2_code}}
\`\`\`
### Step 3: {{step_3_name}}
\`\`\`javascript
{{step_3_code}}
\`\`\`
## Output
- **File**: `{{output_file}}`
- **Format**: {{output_format}}
## Quality Checklist
{{quality_checklist}}
## Next Phase
{{next_phase_link}}
ๅ้่ฏดๆ
| ๅ้ | ่ฏดๆ |
|---|---|
{{phase_number}} | ้ถๆฎตๅบๅท (1, 2, 3...) |
{{phase_name}} | ้ถๆฎตๅ็งฐ |
{{phase_description}} | ไธๅฅ่ฏๆ่ฟฐ |
{{objectives}} | ็ฎๆ ๅ่กจ |
{{input_dependency}} | ่พๅ ฅไพ่ตๆไปถ |
{{step_N_name}} | ๆญฅ้ชคๅ็งฐ |
{{step_N_code}} | ๆญฅ้ชคไปฃ็ |
{{output_file}} | ่พๅบๆไปถๅ |
{{output_format}} | ่พๅบๆ ผๅผ |
{{quality_checklist}} | ่ดจ้ๆฃๆฅ้กน |
{{next_phase_link}} | ไธไธ้ถๆฎต้พๆฅ |
Phase ็ฑปๅๆจกๆฟ
1. ๆถ้ๅ Phase (Collection)
# Phase 1: Requirements Collection
ๆถ้็จๆท้ๆฑๅ้กน็ฎ้
็ฝฎใ
## Objective
- ๆถ้็จๆท่พๅ
ฅ
- ่ชๅจๆฃๆต้กน็ฎไฟกๆฏ
- ็ๆ้
็ฝฎๆไปถ
## Execution Steps
### Step 1: ็จๆทไบคไบ
\`\`\`javascript
const userInput = await AskUserQuestion({
questions: [
{
question: "่ฏท้ๆฉ...",
header: "้้กน",
multiSelect: false,
options: [
{ label: "้้กนA", description: "..." },
{ label: "้้กนB", description: "..." }
]
}
]
});
\`\`\`
### Step 2: ่ชๅจๆฃๆต
\`\`\`javascript
// ๆฃๆต้กน็ฎไฟกๆฏ
const packageJson = JSON.parse(Read('package.json'));
const projectName = packageJson.name;
\`\`\`
### Step 3: ็ๆ้
็ฝฎ
\`\`\`javascript
const config = {
name: projectName,
userChoice: userInput["้้กน"],
// ...
};
Write(`${workDir}/config.json`, JSON.stringify(config, null, 2));
\`\`\`
## Output
- **File**: `config.json`
- **Format**: JSON
2. ๅๆๅ Phase (Analysis)
# Phase 2: Deep Analysis
ๆทฑๅบฆๅๆไปฃ็ ็ปๆใ
## Objective
- ๆซๆไปฃ็ ๆไปถ
- ๆๅๅ
ณ้ฎไฟกๆฏ
- ็ๆๅๆๆฅๅ
## Execution Steps
### Step 1: ๆไปถๆซๆ
\`\`\`javascript
const files = Glob('src/**/*.ts');
\`\`\`
### Step 2: ๅ
ๅฎนๅๆ
\`\`\`javascript
const analysisResults = [];
for (const file of files) {
const content = Read(file);
// ๅๆ้ป่พ
analysisResults.push({ file, /* ๅๆ็ปๆ */ });
}
\`\`\`
### Step 3: ็ๆๆฅๅ
\`\`\`javascript
Write(`${workDir}/analysis.json`, JSON.stringify(analysisResults, null, 2));
\`\`\`
## Output
- **File**: `analysis.json`
- **Format**: JSON
3. ๅนถ่กๅ Phase (Parallel)
# Phase 3: Parallel Processing
ๅนถ่กๅค็ๅคไธชๅญไปปๅกใ
## Objective
- ๅฏๅจๅคไธช Agent ๅนถ่กๆง่ก
- ๆถ้ๅ Agent ็ปๆ
- ๅๅนถ่พๅบ
## Execution Steps
### Step 1: ๅๅคไปปๅก
\`\`\`javascript
const tasks = [
{ id: 'task-a', prompt: '...' },
{ id: 'task-b', prompt: '...' },
{ id: 'task-c', prompt: '...' }
];
\`\`\`
### Step 2: ๅนถ่กๆง่ก
\`\`\`javascript
const results = await Promise.all(
tasks.map(task =>
Task({
subagent_type: 'universal-executor',
run_in_background: false,
prompt: task.prompt
})
)
);
\`\`\`
### Step 3: ๅๅนถ็ปๆ
\`\`\`javascript
const merged = results.map((r, i) => ({
task_id: tasks[i].id,
result: JSON.parse(r)
}));
Write(`${workDir}/parallel-results.json`, JSON.stringify(merged, null, 2));
\`\`\`
## Output
- **File**: `parallel-results.json`
- **Format**: JSON
4. ็ป่ฃ ๅ Phase (Assembly)
# Phase 4: Document Assembly
็ป่ฃ
ๆ็ป่พๅบๆๆกฃใ
## Objective
- ่ฏปๅๅ้ถๆฎตไบงๅบ
- ๅๅนถๅ
ๅฎน
- ็ๆๆ็ปๆๆกฃ
## Execution Steps
### Step 1: ่ฏปๅไบงๅบ
\`\`\`javascript
const config = JSON.parse(Read(`${workDir}/config.json`));
const analysis = JSON.parse(Read(`${workDir}/analysis.json`));
const sections = Glob(`${workDir}/sections/*.md`).map(f => Read(f));
\`\`\`
### Step 2: ็ป่ฃ
ๅ
ๅฎน
\`\`\`javascript
const document = \`
# \${config.name}
## ๆฆ่ฟฐ
\${config.description}
## ่ฏฆ็ปๅ
ๅฎน
\${sections.join('\\n\\n')}
\`;
\`\`\`
### Step 3: ๅๅ
ฅๆไปถ
\`\`\`javascript
Write(`${workDir}/${config.name}-output.md`, document);
\`\`\`
## Output
- **File**: `{name}-output.md`
- **Format**: Markdown
5. ้ช่ฏๅ Phase (Validation)
# Phase 5: Validation
้ช่ฏ่พๅบ่ดจ้ใ
## Objective
- ๆฃๆฅ่พๅบๅฎๆดๆง
- ้ช่ฏๅ
ๅฎน่ดจ้
- ็ๆ้ช่ฏๆฅๅ
## Execution Steps
### Step 1: ๅฎๆดๆงๆฃๆฅ
\`\`\`javascript
const outputFile = `${workDir}/${config.name}-output.md`;
const content = Read(outputFile);
const completeness = {
hasTitle: content.includes('# '),
hasSections: content.match(/## /g)?.length >= 3,
hasContent: content.length > 500
};
\`\`\`
### Step 2: ่ดจ้่ฏไผฐ
\`\`\`javascript
const quality = {
completeness: Object.values(completeness).filter(v => v).length / 3 * 100,
// ๅ
ถไป็ปดๅบฆ...
};
\`\`\`
### Step 3: ็ๆๆฅๅ
\`\`\`javascript
const report = {
status: quality.completeness >= 80 ? 'PASS' : 'REVIEW',
scores: quality,
issues: []
};
Write(`${workDir}/validation-report.json`, JSON.stringify(report, null, 2));
\`\`\`
## Output
- **File**: `validation-report.json`
- **Format**: JSON
็ๆๅฝๆฐ
function generateSequentialPhase(phaseConfig, index, phases, skillConfig) {
const prevPhase = index > 0 ? phases[index - 1] : null;
const nextPhase = index < phases.length - 1 ? phases[index + 1] : null;
return `# Phase ${index + 1}: ${phaseConfig.name}
${phaseConfig.description || `ๆง่ก ${phaseConfig.name}`}
## Objective
- ${phaseConfig.objectives?.join('\n- ') || 'TODO: ๅฎไน็ฎๆ '}
## Input
- ไพ่ต: \`${prevPhase ? prevPhase.output : 'user input'}\`
- ้
็ฝฎ: \`{workDir}/skill-config.json\`
## Execution Steps
### Step 1: ๅๅค
\`\`\`javascript
${prevPhase ?
`const prevOutput = JSON.parse(Read(\`\${workDir}/${prevPhase.output}\`));` :
'// ้ฆ้ถๆฎต๏ผไป้
็ฝฎๅผๅง'}
\`\`\`
### Step 2: ๅค็
\`\`\`javascript
// TODO: ๅฎ็ฐๆ ธๅฟ้ป่พ
\`\`\`
### Step 3: ่พๅบ
\`\`\`javascript
Write(\`\${workDir}/${phaseConfig.output}\`, JSON.stringify(result, null, 2));
\`\`\`
## Output
- **File**: \`${phaseConfig.output}\`
- **Format**: ${phaseConfig.output.endsWith('.json') ? 'JSON' : 'Markdown'}
## Quality Checklist
- [ ] ่พๅ
ฅ้ช่ฏ้่ฟ
- [ ] ๆ ธๅฟ้ป่พๆง่กๆๅ
- [ ] ่พๅบๆ ผๅผๆญฃ็กฎ
${nextPhase ?
`## Next Phase\n\nโ [Phase ${index + 2}: ${nextPhase.name}](${nextPhase.id}.md)` :
'## Completion\n\nๆญคไธบๆๅ้ถๆฎตใ'}
`;
}
### templates/autonomous-orchestrator.md
```markdown
# Autonomous Orchestrator Template
่ชไธปๆจกๅผ็ผๆๅจ็ๆจกๆฟใ
## ๆจกๆฟ็ปๆ
```markdown
# Orchestrator
## Role
ๆ นๆฎๅฝๅ็ถๆ้ๆฉๅนถๆง่กไธไธไธชๅจไฝใ
## State Management
### ่ฏปๅ็ถๆ
\`\`\`javascript
const state = JSON.parse(Read(`${workDir}/state.json`));
\`\`\`
### ๆดๆฐ็ถๆ
\`\`\`javascript
function updateState(updates) {
const state = JSON.parse(Read(`${workDir}/state.json`));
const newState = {
...state,
...updates,
updated_at: new Date().toISOString()
};
Write(`${workDir}/state.json`, JSON.stringify(newState, null, 2));
return newState;
}
\`\`\`
## Decision Logic
\`\`\`javascript
function selectNextAction(state) {
// 1. ็ปๆญขๆกไปถๆฃๆฅ
{{termination_checks}}
// 2. ้่ฏฏ้ๅถๆฃๆฅ
if (state.error_count >= 3) {
return 'action-abort';
}
// 3. ๅจไฝ้ๆฉ้ป่พ
{{action_selection_logic}}
// 4. ้ป่ฎคๅฎๆ
return 'action-complete';
}
\`\`\`
## Execution Loop
\`\`\`javascript
async function runOrchestrator() {
console.log('=== Orchestrator Started ===');
let iteration = 0;
const MAX_ITERATIONS = 100;
while (iteration < MAX_ITERATIONS) {
iteration++;
// 1. ่ฏปๅๅฝๅ็ถๆ
const state = JSON.parse(Read(`${workDir}/state.json`));
console.log(`[Iteration ${iteration}] Status: ${state.status}`);
// 2. ้ๆฉไธไธไธชๅจไฝ
const actionId = selectNextAction(state);
if (!actionId) {
console.log('No action selected, terminating.');
break;
}
console.log(`[Iteration ${iteration}] Executing: ${actionId}`);
// 3. ๆดๆฐ็ถๆ๏ผๅฝๅๅจไฝ
updateState({ current_action: actionId });
// 4. ๆง่กๅจไฝ
try {
const actionPrompt = Read(`phases/actions/${actionId}.md`);
const result = await Task({
subagent_type: 'universal-executor',
run_in_background: false,
prompt: \`
[STATE]
\${JSON.stringify(state, null, 2)}
[ACTION]
\${actionPrompt}
[RETURN]
Return JSON with stateUpdates field.
\`
});
const actionResult = JSON.parse(result);
// 5. ๆดๆฐ็ถๆ๏ผๅจไฝๅฎๆ
updateState({
current_action: null,
completed_actions: [...state.completed_actions, actionId],
...actionResult.stateUpdates
});
} catch (error) {
// ้่ฏฏๅค็
updateState({
current_action: null,
errors: [...state.errors, {
action: actionId,
message: error.message,
timestamp: new Date().toISOString()
}],
error_count: state.error_count + 1
});
}
}
console.log('=== Orchestrator Finished ===');
}
\`\`\`
## Action Catalog
| Action | Purpose | Preconditions |
|--------|---------|---------------|
{{action_catalog_table}}
## Termination Conditions
{{termination_conditions_list}}
## Error Recovery
| Error Type | Recovery Strategy |
|------------|-------------------|
| ๅจไฝๆง่กๅคฑ่ดฅ | ้่ฏๆๅค 3 ๆฌก |
| ็ถๆไธไธ่ด | ๅๆปๅฐไธไธไธช็จณๅฎ็ถๆ |
| ็จๆทไธญๆญข | ไฟๅญๅฝๅ็ถๆ๏ผๅ
่ฎธๆขๅค |
ๅ้่ฏดๆ
| ๅ้ | ่ฏดๆ |
|---|---|
{{termination_checks}} | ็ปๆญขๆกไปถๆฃๆฅไปฃ็ |
{{action_selection_logic}} | ๅจไฝ้ๆฉ้ป่พไปฃ็ |
{{action_catalog_table}} | ๅจไฝ็ฎๅฝ่กจๆ ผ |
{{termination_conditions_list}} | ็ปๆญขๆกไปถๅ่กจ |
็ๆๅฝๆฐ
function generateOrchestrator(config) {
const actions = config.autonomous_config.actions;
const terminations = config.autonomous_config.termination_conditions || [];
// ็ๆ็ปๆญขๆกไปถๆฃๆฅ
const terminationChecks = terminations.map(t => {
const checks = {
'user_exit': 'if (state.status === "user_exit") return null;',
'error_limit': 'if (state.error_count >= 3) return "action-abort";',
'task_completed': 'if (state.status === "completed") return null;',
'max_iterations': 'if (state.iteration_count >= 100) return "action-abort";'
};
return checks[t] || `if (state.${t}) return null;`;
}).join('\n ');
// ็ๆๅจไฝ้ๆฉ้ป่พ
const actionSelectionLogic = actions.map(action => {
if (!action.preconditions?.length) {
return `// ${action.name}: ๆ ๅ็ฝฎๆกไปถ๏ผ้่ฆๆๅจๆทปๅ ้ๆฉ้ป่พ`;
}
const conditions = action.preconditions.map(p => `state.${p}`).join(' && ');
return `if (${conditions}) return '${action.id}';`;
}).join('\n ');
// ็ๆๅจไฝ็ฎๅฝ่กจๆ ผ
const actionCatalogTable = actions.map(a =>
`| [${a.id}](actions/${a.id}.md) | ${a.description || a.name} | ${a.preconditions?.join(', ') || '-'} |`
).join('\n');
// ็ๆ็ปๆญขๆกไปถๅ่กจ
const terminationConditionsList = terminations.map(t => `- ${t}`).join('\n');
return template
.replace('{{termination_checks}}', terminationChecks)
.replace('{{action_selection_logic}}', actionSelectionLogic)
.replace('{{action_catalog_table}}', actionCatalogTable)
.replace('{{termination_conditions_list}}', terminationConditionsList);
}
็ผๆ็ญ็ฅ
1. ไผๅ ็บง็ญ็ฅ
ๆ้ขๅฎไนไผๅ ็บง้ๆฉๅจไฝ๏ผ
const PRIORITY = ['action-init', 'action-process', 'action-review', 'action-complete'];
function selectByPriority(state, availableActions) {
for (const actionId of PRIORITY) {
if (availableActions.includes(actionId) && checkPreconditions(actionId, state)) {
return actionId;
}
}
return null;
}
2. ็จๆท้ฉฑๅจ็ญ็ฅ
่ฏข้ฎ็จๆท้ๆฉไธไธไธชๅจไฝ๏ผ
async function selectByUser(state, availableActions) {
const response = await AskUserQuestion({
questions: [{
question: "้ๆฉไธไธไธชๆไฝ๏ผ",
header: "ๆไฝ",
multiSelect: false,
options: availableActions.map(a => ({
label: a.name,
description: a.description
}))
}]
});
return availableActions.find(a => a.name === response["ๆไฝ"])?.id;
}
3. ็ถๆ้ฉฑๅจ็ญ็ฅ
ๅฎๅ จๅบไบ็ถๆ่ชๅจๅณ็ญ๏ผ
function selectByState(state) {
// ๅๅงๅ
if (state.status === 'pending') return 'action-init';
// ๆๅพ
ๅค็้กน
if (state.pending_items?.length > 0) return 'action-process';
// ้่ฆๅฎกๆ ธ
if (state.needs_review) return 'action-review';
// ๅฎๆ
return 'action-complete';
}
็ถๆๆบ็คบไพ
stateDiagram-v2
[*] --> pending
pending --> running: action-init
running --> running: action-process
running --> running: action-review
running --> completed: action-complete
running --> failed: action-abort
completed --> [*]
failed --> [*]
### templates/autonomous-action.md
```markdown
# Autonomous Action Template
่ชไธปๆจกๅผๅจไฝๆไปถ็ๆจกๆฟใ
## ๆจกๆฟ็ปๆ
```markdown
# Action: {{action_name}}
{{action_description}}
## Purpose
{{purpose}}
## Preconditions
{{preconditions_list}}
## Execution
\`\`\`javascript
async function execute(state) {
{{execution_code}}
}
\`\`\`
## State Updates
\`\`\`javascript
return {
stateUpdates: {
{{state_updates}}
}
};
\`\`\`
## Error Handling
| Error Type | Recovery |
|------------|----------|
{{error_handling_table}}
## Next Actions (Hints)
{{next_actions_hints}}
ๅ้่ฏดๆ
| ๅ้ | ่ฏดๆ |
|---|---|
{{action_name}} | ๅจไฝๅ็งฐ |
{{action_description}} | ๅจไฝๆ่ฟฐ |
{{purpose}} | ่ฏฆ็ป็ฎ็ |
{{preconditions_list}} | ๅ็ฝฎๆกไปถๅ่กจ |
{{execution_code}} | ๆง่กไปฃ็ |
{{state_updates}} | ็ถๆๆดๆฐ |
{{error_handling_table}} | ้่ฏฏๅค็่กจๆ ผ |
{{next_actions_hints}} | ๅ็ปญๅจไฝๆ็คบ |
ๅจไฝ็ฑปๅๆจกๆฟ
1. ๅๅงๅๅจไฝ (Init)
# Action: Initialize
ๅๅงๅ Skill ๆง่ก็ถๆใ
## Purpose
่ฎพ็ฝฎๅๅง็ถๆ๏ผๅๅคๆง่ก็ฏๅขใ
## Preconditions
- [ ] state.status === 'pending'
## Execution
\`\`\`javascript
async function execute(state) {
// 1. ๅๅปบๅทฅไฝ็ฎๅฝ
Bash(\`mkdir -p "\${workDir}"\`);
// 2. ๅๅงๅๆฐๆฎ
const initialData = {
items: [],
metadata: {}
};
// 3. ่ฟๅ็ถๆๆดๆฐ
return {
stateUpdates: {
status: 'running',
context: initialData
}
};
}
\`\`\`
## State Updates
\`\`\`javascript
return {
stateUpdates: {
status: 'running',
started_at: new Date().toISOString(),
context: { /* ๅๅงๆฐๆฎ */ }
}
};
\`\`\`
## Next Actions
- ๆๅ: ่ฟๅ
ฅไธปๅค็ๅพช็ฏ
- ๅคฑ่ดฅ: action-abort
2. ๅ่กจๅจไฝ (List)
# Action: List Items
ๆพ็คบๅฝๅ้กน็ฎๅ่กจใ
## Purpose
ๅฑ็คบๆๆ้กน็ฎไพ็จๆทๆฅ็ๅ้ๆฉใ
## Preconditions
- [ ] state.status === 'running'
## Execution
\`\`\`javascript
async function execute(state) {
const items = state.context.items || [];
if (items.length === 0) {
console.log('ๆๆ ้กน็ฎ');
} else {
console.log('้กน็ฎๅ่กจ:');
items.forEach((item, i) => {
console.log(\`\${i + 1}. \${item.name} - \${item.status}\`);
});
}
return {
stateUpdates: {
last_action: 'list',
current_view: 'list'
}
};
}
\`\`\`
## State Updates
\`\`\`javascript
return {
stateUpdates: {
current_view: 'list',
last_viewed_at: new Date().toISOString()
}
};
\`\`\`
## Next Actions
- ็จๆท้ๆฉๅๅปบ: action-create
- ็จๆท้ๆฉ็ผ่พ: action-edit
- ็จๆท้ๅบ: action-complete
3. ๅๅปบๅจไฝ (Create)
# Action: Create Item
ๅๅปบๆฐ้กน็ฎใ
## Purpose
ๅผๅฏผ็จๆทๅๅปบๆฐ้กน็ฎใ
## Preconditions
- [ ] state.status === 'running'
## Execution
\`\`\`javascript
async function execute(state) {
// 1. ๆถ้ไฟกๆฏ
const input = await AskUserQuestion({
questions: [{
question: "่ฏท่พๅ
ฅ้กน็ฎๅ็งฐ๏ผ",
header: "ๅ็งฐ",
multiSelect: false,
options: [
{ label: "ๆๅจ่พๅ
ฅ", description: "่พๅ
ฅ่ชๅฎไนๅ็งฐ" }
]
}]
});
// 2. ๅๅปบ้กน็ฎ
const newItem = {
id: Date.now().toString(),
name: input["ๅ็งฐ"],
status: 'pending',
created_at: new Date().toISOString()
};
// 3. ่ฟๅ็ถๆๆดๆฐ
return {
stateUpdates: {
context: {
...state.context,
items: [...(state.context.items || []), newItem]
},
last_created_id: newItem.id
}
};
}
\`\`\`
## State Updates
\`\`\`javascript
return {
stateUpdates: {
'context.items': [...items, newItem],
last_action: 'create',
last_created_id: newItem.id
}
};
\`\`\`
## Next Actions
- ็ปง็ปญๅๅปบ: action-create
- ่ฟๅๅ่กจ: action-list
4. ็ผ่พๅจไฝ (Edit)
# Action: Edit Item
็ผ่พ็ฐๆ้กน็ฎใ
## Purpose
ไฟฎๆนๅทฒๅญๅจ็้กน็ฎใ
## Preconditions
- [ ] state.status === 'running'
- [ ] state.selected_item_id !== null
## Execution
\`\`\`javascript
async function execute(state) {
const itemId = state.selected_item_id;
const items = state.context.items || [];
const item = items.find(i => i.id === itemId);
if (!item) {
throw new Error(\`Item not found: \${itemId}\`);
}
// 1. ๆพ็คบๅฝๅๅผ
console.log(\`ๅฝๅๅ็งฐ: \${item.name}\`);
// 2. ๆถ้ๆฐๅผ
const input = await AskUserQuestion({
questions: [{
question: "่ฏท่พๅ
ฅๆฐๅ็งฐ๏ผ็็ฉบไฟๆไธๅ๏ผ๏ผ",
header: "ๆฐๅ็งฐ",
multiSelect: false,
options: [
{ label: "ไฟๆไธๅ", description: \`ๅฝๅ: \${item.name}\` },
{ label: "ๆๅจ่พๅ
ฅ", description: "่พๅ
ฅๆฐๅ็งฐ" }
]
}]
});
// 3. ๆดๆฐ้กน็ฎ
const updatedItems = items.map(i =>
i.id === itemId
? { ...i, name: input["ๆฐๅ็งฐ"] || i.name, updated_at: new Date().toISOString() }
: i
);
return {
stateUpdates: {
context: { ...state.context, items: updatedItems },
selected_item_id: null
}
};
}
\`\`\`
## State Updates
\`\`\`javascript
return {
stateUpdates: {
'context.items': updatedItems,
selected_item_id: null,
last_action: 'edit'
}
};
\`\`\`
## Next Actions
- ่ฟๅๅ่กจ: action-list
5. ๅ ้คๅจไฝ (Delete)
# Action: Delete Item
ๅ ้ค้กน็ฎใ
## Purpose
ไปๅ่กจไธญ็งป้ค้กน็ฎใ
## Preconditions
- [ ] state.status === 'running'
- [ ] state.selected_item_id !== null
## Execution
\`\`\`javascript
async function execute(state) {
const itemId = state.selected_item_id;
const items = state.context.items || [];
// 1. ็กฎ่ฎคๅ ้ค
const confirm = await AskUserQuestion({
questions: [{
question: "็กฎ่ฎคๅ ้คๆญค้กน็ฎ๏ผ",
header: "็กฎ่ฎค",
multiSelect: false,
options: [
{ label: "็กฎ่ฎคๅ ้ค", description: "ไธๅฏๆขๅค" },
{ label: "ๅๆถ", description: "่ฟๅๅ่กจ" }
]
}]
});
if (confirm["็กฎ่ฎค"] === "ๅๆถ") {
return { stateUpdates: { selected_item_id: null } };
}
// 2. ๆง่กๅ ้ค
const updatedItems = items.filter(i => i.id !== itemId);
return {
stateUpdates: {
context: { ...state.context, items: updatedItems },
selected_item_id: null
}
};
}
\`\`\`
## State Updates
\`\`\`javascript
return {
stateUpdates: {
'context.items': filteredItems,
selected_item_id: null,
last_action: 'delete'
}
};
\`\`\`
## Next Actions
- ่ฟๅๅ่กจ: action-list
6. ๅฎๆๅจไฝ (Complete)
# Action: Complete
ๅฎๆไปปๅกๅนถ้ๅบใ
## Purpose
ไฟๅญๆ็ป็ถๆ๏ผ็ปๆ Skill ๆง่กใ
## Preconditions
- [ ] state.status === 'running'
## Execution
\`\`\`javascript
async function execute(state) {
// 1. ไฟๅญๆ็ปๆฐๆฎ
Write(\`\${workDir}/final-output.json\`, JSON.stringify(state.context, null, 2));
// 2. ็ๆๆ่ฆ
const summary = {
total_items: state.context.items?.length || 0,
duration: Date.now() - new Date(state.started_at).getTime(),
actions_executed: state.completed_actions.length
};
console.log('ไปปๅกๅฎๆ๏ผ');
console.log(\`ๅค็้กน็ฎ: \${summary.total_items}\`);
console.log(\`ๆง่กๅจไฝ: \${summary.actions_executed}\`);
return {
stateUpdates: {
status: 'completed',
summary: summary
}
};
}
\`\`\`
## State Updates
\`\`\`javascript
return {
stateUpdates: {
status: 'completed',
completed_at: new Date().toISOString(),
summary: { /* ็ป่ฎกไฟกๆฏ */ }
}
};
\`\`\`
## Next Actions
- ๆ ๏ผ็ปๆญข็ถๆ๏ผ
็ๆๅฝๆฐ
function generateAction(actionConfig, skillConfig) {
return `# Action: ${actionConfig.name}
${actionConfig.description || `ๆง่ก ${actionConfig.name} ๆไฝ`}
## Purpose
${actionConfig.purpose || 'TODO: ๆ่ฟฐๆญคๅจไฝ็่ฏฆ็ป็ฎ็'}
## Preconditions
${actionConfig.preconditions?.map(p => `- [ ] ${p}`).join('\n') || '- [ ] ๆ ็นๆฎๅ็ฝฎๆกไปถ'}
## Execution
\`\`\`javascript
async function execute(state) {
// TODO: ๅฎ็ฐๅจไฝ้ป่พ
return {
stateUpdates: {
completed_actions: [...state.completed_actions, '${actionConfig.id}']
}
};
}
\`\`\`
## State Updates
\`\`\`javascript
return {
stateUpdates: {
// TODO: ๅฎไน็ถๆๆดๆฐ
${actionConfig.effects?.map(e => ` // Effect: ${e}`).join('\n') || ''}
}
};
\`\`\`
## Error Handling
| Error Type | Recovery |
|------------|----------|
| ๆฐๆฎ้ช่ฏๅคฑ่ดฅ | ่ฟๅ้่ฏฏ๏ผไธๆดๆฐ็ถๆ |
| ๆง่กๅผๅธธ | ่ฎฐๅฝ้่ฏฏ๏ผๅขๅ error_count |
## Next Actions (Hints)
- ๆๅ: ็ฑ็ผๆๅจๆ นๆฎ็ถๆๅณๅฎ
- ๅคฑ่ดฅ: ้่ฏๆ action-abort
`;
}
### ../_shared/SKILL-DESIGN-SPEC.md
```markdown
# Skill ่ฎพ่ฎก่ง่ v1.0
> ๅบไบ `software-manual` ๅ `copyright-docs` ไธคไธชๆ็ Skill ็่ฎพ่ฎกๆจกๅผๆ็ผ
---
## ็ฎๅฝ
1. [่ฎพ่ฎก็ๅฟต](#1-่ฎพ่ฎก็ๅฟต)
2. [็ฎๅฝ็ปๆ่ง่](#2-็ฎๅฝ็ปๆ่ง่)
3. [ๆ ธๅฟ็ปไปถๅฎไน](#3-ๆ ธๅฟ็ปไปถๅฎไน)
4. [SKILL.md ๅ
ฅๅฃ่ง่](#4-skillmd-ๅ
ฅๅฃ่ง่)
5. [Phase ้ถๆฎต่ฎพ่ฎก่ง่](#5-phase-้ถๆฎต่ฎพ่ฎก่ง่)
6. [Specs ่ง่ๆไปถ่ฎพ่ฎก](#6-specs-่ง่ๆไปถ่ฎพ่ฎก)
7. [Templates ๆจกๆฟ่ฎพ่ฎก](#7-templates-ๆจกๆฟ่ฎพ่ฎก)
8. [Scripts ่ๆฌ่ง่](#8-scripts-่ๆฌ่ง่)
9. [Prompt ๅทฅ็จ่ง่](#9-prompt-ๅทฅ็จ่ง่)
10. [่ดจ้ๆงๅถ่ง่](#10-่ดจ้ๆงๅถ่ง่)
11. [ๆไฝณๅฎ่ทตๆธ
ๅ](#11-ๆไฝณๅฎ่ทตๆธ
ๅ)
12. [็คบไพๆจกๆฟ](#12-็คบไพๆจกๆฟ)
---
## 1. ่ฎพ่ฎก็ๅฟต
### 1.1 ๆ ธๅฟๅๅ
| ๅๅ | ่ฏดๆ | ๅฎ่ทต |
|------|------|------|
| **้ถๆฎตๅๆง่ก** | ๅคๆไปปๅกๅ่งฃไธบๆๅบ้ถๆฎต | ไฝฟ็จ `phases/` ็ฎๅฝ๏ผๆฐๅญๅ็ผๆงๅถ้กบๅบ |
| **ๅ
ณๆณจ็นๅ็ฆป** | ้ป่พใ้
็ฝฎใ่งๅพๅ็ฆป | `phases/`(้ป่พ) + `specs/`(้
็ฝฎ) + `templates/`(่งๅพ) |
| **็ฎ่ฆ่ฟๅ** | Agent ่ฟๅ่ทฏๅพ+ๆ่ฆ๏ผ้ฟๅ
ไธไธๆๆบขๅบ | ่ฟๅ JSON ็ฎ่ฆไฟกๆฏ๏ผๆไปถๅญๅจๅฎๆดๅ
ๅฎน |
| **้
็ฝฎ้ฉฑๅจ** | ่ง่ไฝไธบ"้
็ฝฎๆไปถ"๏ผๆไบ่ฐๆด่กไธบ | ไฟฎๆน `specs/` ๆ ้่งฆๅ `phases/` |
| **ๆจกๆฟๅค็จ** | ๆๅ้็จ็ๆฎต๏ผ็กฎไฟไธ่ดๆง | `templates/` ๅญๆพๅฏๅค็จๅ
ๅฎน |
### 1.2 ๆถๆๆจกๅผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Context-Optimized Architecture โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ โ โ SKILL.md (ๅ ฅๅฃ) โ ๆ่ฟฐ็ฎๆ ใๅฎไน้ถๆฎตใ้พๆฅ่ตๆบ โ โ โ โ โ Phase 1: ๆถ้ โ ็จๆท่พๅ ฅ + ่ชๅจๆฃๆต โ config.json โ โ โ โ โ Phase 2: ๅๆ โ ๅนถ่ก Agent โ sections/*.md โ โ โ โ โ Phase N: ๆฑๆป โ ไบคๅๆฃๆฅ โ summary.md โ โ โ โ โ Phase N+1: ็ป่ฃ โ ๅๅนถๆไปถ โ ๆ็ปไบง็ฉ โ โ โ โ โ Phase N+2: ่ฟญไปฃ โ ็จๆทๅ้ฆ โ ไผๅ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
---
## 2. ็ฎๅฝ็ปๆ่ง่
### 2.1 ๆ ๅ็ฎๅฝ็ปๆ
[skill-name]/ โโโ SKILL.md # ใๅฟ ้ใๆ่ฝๅ ฅๅฃ๏ผๅ ๆฐๆฎ + ๆถๆ + ๆง่กๆต็จ โโโ phases/ # ใๅฟ ้ใๆง่ก้ถๆฎต Prompt โ โโโ 01-{first-step}.md # ๆฐๅญๅ็ผๅฎไน้กบๅบ โ โโโ 02-{second-step}.md โ โโโ 02.5-{sub-step}.md # ๅฐๆฐ็น็จไบๆๅ ฅๅญๆญฅ้ชค โ โโโ ... โโโ specs/ # ใๅฟ ้ใ่ง่ไธ็บฆๆ โ โโโ {domain}-requirements.md # ้ขๅ็นๅฎ่ฆๆฑ โ โโโ quality-standards.md # ่ดจ้ๆ ๅ โ โโโ writing-style.md # ๅไฝ้ฃๆ ผ๏ผๅฆ้็จ๏ผ โโโ templates/ # ใๆจ่ใๅฏๅค็จๆจกๆฟ โ โโโ agent-base.md # Agent ๅบ็ก Prompt ๆจกๆฟ โ โโโ output-shell.{ext} # ่พๅบๅคๅฃณๆจกๆฟ๏ผhtml/md๏ผ โ โโโ css/ # ๆ ทๅผๆไปถ๏ผๅฆ้็จ๏ผ โโโ scripts/ # ใๅฏ้ใ่พ ๅฉ่ๆฌ โ โโโ {tool}.py # Python ่ๆฌ โ โโโ {tool}-runner.md # ่ๆฌไฝฟ็จ่ฏดๆ โโโ outputs/ # ใ่ฟ่กๆถใๆง่กไบง็ฉ๏ผไธ็บณๅ ฅ็ๆฌๆงๅถ๏ผ
### 2.2 ๅฝๅ็บฆๅฎ
| ็ฑปๅ | ่งๅ | ็คบไพ |
|------|------|------|
| Skill ็ฎๅฝ | ๅฐๅ-่ฟๅญ็ฌฆ | `software-manual`, `copyright-docs` |
| Phase ๆไปถ | `NN-{ๅจไฝ}.md` | `01-metadata-collection.md` |
| Spec ๆไปถ | `{้ขๅ}-{็ฑปๅ}.md` | `cpcc-requirements.md` |
| Template ๆไปถ | `{็จ้}-{็ฑปๅ}.{ext}` | `agent-base.md`, `tiddlywiki-shell.html` |
| ่พๅบๆไปถ | `section-{N}-{ๅ็งฐ}.md` | `section-2-architecture.md` |
---
## 3. ๆ ธๅฟ็ปไปถๅฎไน
### 3.1 ็ปไปถ่่ดฃ็ฉ้ต
| ็ปไปถ | ่่ดฃ | ๅ
ๅฎน็ฑปๅ | ไฟฎๆน้ข็ |
|------|------|----------|----------|
| `SKILL.md` | ๅ
ฅๅฃ + ็ผๆ | ๅ
ๆฐๆฎใๆถๆๅพใๆง่กๆต็จ | ไฝ๏ผ็ปๆ็จณๅฎ๏ผ |
| `phases/*.md` | ๆง่ก้ป่พ | ๆญฅ้ชค่ฏดๆใPromptใไปฃ็ ็คบไพ | ไธญ๏ผไผๅ่ฟญไปฃ๏ผ |
| `specs/*.md` | ็บฆๆ้
็ฝฎ | ่งๅใๆ ๅใๆฃๆฅๆธ
ๅ | ไธญ๏ผ้ๆฑๅๆด๏ผ |
| `templates/*` | ๅฏๅค็จ็ๆฎต | Prompt ๆจกๆฟใ่พๅบๆ ผๅผ | ไฝ๏ผ้็จ็จณๅฎ๏ผ |
| `scripts/*` | ่ชๅจๅ | Python/JS ่ๆฌ | ้ซ๏ผๅ่ฝๅขๅผบ๏ผ |
### 3.2 ็ปไปถไพ่ตๅ
ณ็ณป
```mermaid
graph TD
SKILL[SKILL.md] --> P1[phases/01-*]
P1 --> P2[phases/02-*]
P2 --> PN[phases/N-*]
P1 -.->|ๅผ็จ| SPEC[specs/*]
P2 -.->|ๅผ็จ| SPEC
PN -.->|ๅผ็จ| SPEC
P1 -.->|ไฝฟ็จ| TPL[templates/*]
PN -.->|ไฝฟ็จ| TPL
P2 -->|่ฐ็จ| SCR[scripts/*]
style SKILL fill:#e1f5fe
style SPEC fill:#fff3e0
style TPL fill:#e8f5e9
style SCR fill:#fce4ec
4. SKILL.md ๅ ฅๅฃ่ง่
4.1 ๅฟ ้็ปๆ
---
name: {skill-name}
description: {ไธๅฅ่ฏๆ่ฟฐ}. {่งฆๅๅ
ณ้ฎ่ฏ}. Triggers on "{ๅ
ณ้ฎ่ฏ1}", "{ๅ
ณ้ฎ่ฏ2}".
allowed-tools: Task, AskUserQuestion, Read, Bash, Glob, Grep, Write, {ๅ
ถไปMCPๅทฅๅ
ท}
---
# {Skill ๆ ้ข}
{ไธๆฎต่ฏๆ่ฟฐ Skill ็็จ้ๅไบงๅบ}
## Architecture Overview
{ASCII ๆ Mermaid ๆถๆๅพ}
## Key Design Principles
1. **ๅๅ1**: ่ฏดๆ
2. **ๅๅ2**: ่ฏดๆ
...
## Execution Flow
{้ถๆฎตๆง่กๆต็จๅพ}
## Agent Configuration (ๅฆ้็จ)
| Agent | Role | Output File | Focus Areas |
|-------|------|-------------|-------------|
| ... | ... | ... | ... |
## Directory Setup
{ๅทฅไฝ็ฎๅฝๅๅปบไปฃ็ }
## Output Structure
{่พๅบ็ฎๅฝ็ปๆ}
## Reference Documents
| Document | Purpose |
|----------|---------|
| [phases/01-xxx.md](phases/01-xxx.md) | ... |
| ... | ... |
4.2 Front Matter ่ง่
---
name: skill-name # ๅฟ
้๏ผSkill ๅฏไธๆ ่ฏ
description: | # ๅฟ
้๏ผๆ่ฟฐ + ่งฆๅ่ฏ
Generate XXX documents.
Triggers on "keyword1", "keyword2".
allowed-tools: | # ๅฟ
้๏ผๅ
่ฎธไฝฟ็จ็ๅทฅๅ
ท
Task, AskUserQuestion, Read, Bash,
Glob, Grep, Write, mcp__chrome__*
---
5. Phase ้ถๆฎต่ฎพ่ฎก่ง่
5.1 Phase ๆไปถ็ปๆ
# Phase N: {้ถๆฎตๅ็งฐ}
{ไธๅฅ่ฏๆ่ฟฐๆญค้ถๆฎต็ฎๆ }
## Objective
{่ฏฆ็ป็ฎๆ ่ฏดๆ}
- ็ฎๆ 1
- ็ฎๆ 2
## Execution Steps
### Step 1: {ๆญฅ้ชคๅ็งฐ}
{ไปฃ็ ๆ่ฏดๆ}
### Step 2: {ๆญฅ้ชคๅ็งฐ}
{ไปฃ็ ๆ่ฏดๆ}
## Output
- **File**: `{่พๅบๆไปถๅ}`
- **Location**: `{่พๅบ่ทฏๅพ}`
- **Format**: {JSON/Markdown/HTML}
## Next Phase
Proceed to [Phase N+1: xxx](0N+1-xxx.md) with the generated {ไบงๅบ}.
5.2 Phase ็ฑปๅ
| ็ฑปๅ | ็น็น | ็คบไพ |
|---|---|---|
| ๆถ้ๅ | ็จๆทไบคไบ + ่ชๅจๆฃๆต | 01-requirements-discovery.md |
| ๆข็ดขๅ | ไปฃ็ ๅๆ + ็ปๆ่ฏๅซ | 02-project-exploration.md |
| ๅนถ่กๅ | ๅค Agent ๅนถ่กๆง่ก | 03-parallel-analysis.md |
| ๆฑๆปๅ | ไบคๅๆฃๆฅ + ่ดจ้้ช่ฏ | 03.5-consolidation.md |
| ็ป่ฃ ๅ | ๅๅนถไบงๅบ + ๆ ผๅผๅ | 04-document-assembly.md |
| ่ฟญไปฃๅ | ็จๆทๅ้ฆ + ไผๅ | 05-iterative-refinement.md |
5.3 Phase ็ผๅท่งๅ
01-xxx.md # ไธป้ถๆฎต
02-xxx.md # ไธป้ถๆฎต
02.5-xxx.md # ๅญ้ถๆฎต๏ผๆๅ
ฅ 02 ๅ 03 ไน้ด๏ผ
03-xxx.md # ไธป้ถๆฎต
6. Specs ่ง่ๆไปถ่ฎพ่ฎก
6.1 Specs ็ฑปๅ
| ็ฑปๅ | ็จ้ | ็คบไพ |
|---|---|---|
| ้ขๅ่ฆๆฑ | ้ขๅ็นๅฎๅ่งๆง | cpcc-requirements.md |
| ่ดจ้ๆ ๅ | ่พๅบ่ดจ้่ฏไผฐ | quality-standards.md |
| ๅไฝ้ฃๆ ผ | ๅ ๅฎน้ฃๆ ผๆๅ | writing-style.md |
| ๆจกๆฟ่ง่ | ่พๅบๆ ผๅผๅฎไน | html-template.md |
6.2 Specs ็ปๆๆจกๆฟ
# {่ง่ๅ็งฐ}
{่ง่็จ้่ฏดๆ}
## When to Use
| Phase | Usage | Section |
|-------|-------|---------|
| Phase N | {ไฝฟ็จๅบๆฏ} | {ๅผ็จ็ซ ่} |
| ... | ... | ... |
---
## Requirements
### Category 1
- [ ] ๆฃๆฅ้กน1
- [ ] ๆฃๆฅ้กน2
### Category 2
| ้กน็ฎ | ่ฆๆฑ | ๆฃๆฅๆนๅผ |
|------|------|----------|
| ... | ... | ... |
## Validation Function
{้ช่ฏๅฝๆฐไปฃ็ }
## Error Handling
| Error | Recovery |
|-------|----------|
| ... | ... |
6.3 ่ดจ้ๆ ๅ็คบไพ็ปๆ
# Quality Standards
## Quality Dimensions
### 1. Completeness (25%)
{่ฏๅๆ ๅ}
### 2. Consistency (25%)
{่ฏๅๆ ๅ}
### 3. Depth (25%)
{่ฏๅๆ ๅ}
### 4. Readability (25%)
{่ฏๅๆ ๅ}
## Quality Gates
| Gate | Threshold | Action |
|------|-----------|--------|
| Pass | โฅ 80% | ็ปง็ปญๆง่ก |
| Review | 60-79% | ๅค็่ญฆๅๅ็ปง็ปญ |
| Fail | < 60% | ๅฟ
้กปไฟฎๅค |
## Issue Classification
### Errors (Must Fix)
- ...
### Warnings (Should Fix)
- ...
### Info (Nice to Have)
- ...
7. Templates ๆจกๆฟ่ฎพ่ฎก
7.1 Agent ๅบ็กๆจกๆฟ
# Agent Base Template
## ้็จๆ็คบ่ฏ็ปๆ
[ROLE] ไฝ ๆฏ{่ง่ฒ}๏ผไธๆณจไบ{่่ดฃ}ใ
[TASK]
{ไปปๅกๆ่ฟฐ}
- ่พๅบ: {output_path}
- ๆ ผๅผ: {format}
- ่ๅด: {scope}
[CONSTRAINTS]
- ็บฆๆ1
- ็บฆๆ2
[OUTPUT_FORMAT]
1. ็ดๆฅๅๅ
ฅๆไปถ
2. ่ฟๅ JSON ็ฎ่ฆไฟกๆฏ
[QUALITY_CHECKLIST]
- [ ] ๆฃๆฅ้กน1
- [ ] ๆฃๆฅ้กน2
## ๅ้่ฏดๆ
| ๅ้ | ๆฅๆบ | ็คบไพ |
|------|------|------|
| {output_dir} | Phase 1 | .workflow/.scratchpad/xxx |
| ... | ... | ... |
## Agent ้
็ฝฎๆ ๅฐ
{AGENT_ROLES, AGENT_SECTIONS, AGENT_FILES, AGENT_FOCUS}
7.2 ่พๅบๆจกๆฟ่ง่
<!-- output-shell.html ็คบไพ -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{{title}}</title>
<style>
/* ๅ
ๅต CSS */
{{styles}}
</style>
</head>
<body>
<div id="app">
{{content}}
</div>
<script>
/* ๅ
ๅต JS */
{{scripts}}
</script>
</body>
</html>
7.3 ๅ ไฝ็ฌฆ่ง่
| ๅ ไฝ็ฌฆๆ ผๅผ | ็จ้ | ็คบไพ |
|---|---|---|
{{variable}} | ็ฎๅๅ้ๆฟๆข | {{title}} |
${variable} | JavaScript ๆจกๆฟๅญ็ฌฆไธฒ | ${workDir} |
{placeholder} | Prompt ๅ ไฝ | {intro}, {diagram} |
8. Scripts ่ๆฌ่ง่
8.1 ่ๆฌ็ฑปๅ
| ็ฑปๅ | ็จ้ | ๅฝๅ |
|---|---|---|
| ๆๅๅจ | ไปไปฃ็ ๆๅไฟกๆฏ | extract_*.py |
| ็ป่ฃ ๅจ | ๅๅนถ/่ฝฌๆขๆไปถ | assemble_*.py |
| ้ช่ฏๅจ | ๆฃๆฅๅ่งๆง | validate_*.py |
| ่พ ๅฉๅจ | ๅทฅๅ ทๅฝๆฐ | *_helper.py |
8.2 ่ๆฌไฝฟ็จ่ฏดๆๆไปถ
ๆฏไธช่ๆฌๅบๆๅฏนๅบ็ .md ่ฏดๆๆไปถ๏ผ
# {Script Name} Runner
## Purpose
{่ๆฌ็จ้}
## Usage
{ๅฝไปค่กไฝฟ็จๆนๅผ}
## Parameters
| ๅๆฐ | ่ฏดๆ | ้ป่ฎคๅผ |
|------|------|--------|
| ... | ... | ... |
## Output
{่พๅบ่ฏดๆ}
## Example
{ไฝฟ็จ็คบไพ}
9. Prompt ๅทฅ็จ่ง่
9.1 Prompt ็ปๆๆ ๅ
[ROLE] {่ง่ฒๅฎไน}
[PROJECT CONTEXT]
้กน็ฎ็ฑปๅ: {type}
่ฏญ่จ: {language}
ๅ็งฐ: {name}
[TASK]
{ไปปๅกๆ่ฟฐ}
่พๅบ: {output_path}
[INPUT]
- ้
็ฝฎ: {config_path}
- ๆซๆ่ทฏๅพ: {scan_paths}
[CONTENT REQUIREMENTS]
- ๆ ้ขๅฑ็บง: # ## ### (ๆๅค3็บง)
- ไปฃ็ ๅ: ```language ... ``` (ๅฟ
้กปๆ ๆณจ่ฏญ่จ)
- ่กจๆ ผ: | col1 | col2 | ๆ ผๅผ
- ๅ่กจ: ๆๅบ 1. 2. 3. / ๆ ๅบ - - -
[FOCUS]
{้็นๅ
ณๆณจ้กน}
[OUTPUT FORMAT]
{่พๅบๆ ผๅผ่ฏดๆ}
[RETURN JSON]
{่ฟๅ็ปๆ}
9.2 ๆ็ไผๅๅๅ
| ๅๅ | Before (ๅไฝ) | After (็ฒพ็ฎ) |
|---|---|---|
| ่ง่ฒ็ฎๅ | "ไฝ ๆฏไธไธชไธไธ็็ณป็ปๆถๆๅธ๏ผๅ ทๆไธฐๅฏ็่ฝฏไปถ่ฎพ่ฎก็ป้ช..." | [ROLE] ็ณป็ปๆถๆๅธ๏ผไธๆณจไบๅๅฑ่ฎพ่ฎกๅๆจกๅไพ่ต |
| ๆจกๆฟ้ฉฑๅจ | "่ฏทๆ็ งไปฅไธๆ ผๅผ่พๅบ: ้ฆๅ ๅไธไธชไบ็บงๆ ้ข..." | [TEMPLATE] ## 2. ๆ ้ข {content} |
| ็ฆ็นๆ็กฎ | "ๅๆ้กน็ฎ็ๅไธชๆน้ข๏ผๅ ๆฌๆถๆใๆจกๅใไพ่ต็ญ" | [FOCUS] 1. ๅๅฑ 2. ๆจกๅ 3. ไพ่ต 4. ๆฐๆฎๆต |
| ่ฟๅ็ฎๆด | "่ฏท่ฟๅ่ฏฆ็ป็ๅๆ็ปๆ๏ผๅ ๆฌๆๆๅ็ฐ็้ฎ้ข..." | [RETURN] {"status":"completed","output_file":"xxx.md","summary":"<50ๅญ"} |
9.3 Agent ่ฟๅๆ ผๅผๆ ๅ
interface AgentReturn {
status: "completed" | "partial" | "failed";
output_file: string; // ่พๅบๆไปถ่ทฏๅพ
summary: string; // ๆๅค 50 ๅญๆ่ฆ
cross_module_notes?: string[]; // ่ทจๆจกๅๅคๆณจ
stats?: { // ็ป่ฎกไฟกๆฏ
diagrams?: number;
words?: number;
};
screenshots_needed?: Array<{ // ๆชๅพ้ๆฑ๏ผๅฆ้็จ๏ผ
id: string;
url: string;
description: string;
}>;
}
10. ่ดจ้ๆงๅถ่ง่
10.1 ่ดจ้็ปดๅบฆ
| ็ปดๅบฆ | ๆ้ | ๆฃๆฅ้กน |
|---|---|---|
| ๅฎๆดๆง | 25% | ๆๆๅฟ ้็ซ ่ๅญๅจไธๆๅฎ่ดจๅ ๅฎน |
| ไธ่ดๆง | 25% | ๆฏ่ฏญใๆ ผๅผใ้ฃๆ ผ็ปไธ |
| ๆทฑๅบฆ | 25% | ๅ ๅฎน่ฏฆๅฐฝใ็คบไพๅ ๅ |
| ๅฏ่ฏปๆง | 25% | ็ปๆๆธ ๆฐใ่ฏญ่จ็ฎๆด |
10.2 ่ดจ้้จๆง
const QUALITY_GATES = {
pass: { threshold: 80, action: "็ปง็ปญๆง่ก" },
review: { threshold: 60, action: "ๅค็่ญฆๅๅ็ปง็ปญ" },
fail: { threshold: 0, action: "ๅฟ
้กปไฟฎๅคๅ้่ฏ" }
};
10.3 ้ฎ้ขๅ็ฑป
| ็บงๅซ | ๅ็ผ | ๅซไน | ๅค็ๆนๅผ |
|---|---|---|---|
| Error | E | ้ปๅกๆง้ฎ้ข | ๅฟ ้กปไฟฎๅค |
| Warning | W | ๅฝฑๅ่ดจ้ | ๅปบ่ฎฎไฟฎๅค |
| Info | I | ๅฏๆน่ฟ้กน | ๅฏ้ไฟฎๅค |
10.4 ่ชๅจๅๆฃๆฅๅฝๆฐๆจกๆฟ
function runQualityChecks(workDir) {
const results = {
completeness: checkCompleteness(workDir),
consistency: checkConsistency(workDir),
depth: checkDepth(workDir),
readability: checkReadability(workDir)
};
results.overall = Object.values(results).reduce((a, b) => a + b) / 4;
return {
score: results.overall,
gate: results.overall >= 80 ? 'pass' :
results.overall >= 60 ? 'review' : 'fail',
details: results
};
}
11. ๆไฝณๅฎ่ทตๆธ ๅ
11.1 Skill ่ฎพ่ฎก
- ๅไธ่่ดฃ: ๆฏไธช Skill ไธๆณจไธไธช้ขๅ
- ๆธ ๆฐๅ ฅๅฃ: SKILL.md ๅฎๆดๆ่ฟฐ็ฎๆ ๅๆต็จ
- ้ถๆฎตๅ่งฃ: ๅคๆไปปๅกๆๅไธบ 3-7 ไธช้ถๆฎต
- ้กบๅบๅฝๅ: ไฝฟ็จๆฐๅญๅ็ผๆงๅถๆง่ก้กบๅบ
11.2 Phase ่ฎพ่ฎก
- ๆ็กฎ็ฎๆ : ๆฏไธช Phase ๆๆธ ๆฐ็่พๅ ฅ่พๅบ
- ็ฌ็ซๅฏๆต: ๆฏไธช Phase ๅฏๅ็ฌ่ฐ่ฏ
- ้พๆฅไธไธๆญฅ: ๆ็กฎ่ฏดๆๅ็ปญ้ถๆฎต
11.3 Prompt ่ฎพ่ฎก
- ่ง่ฒๆ็กฎ: ไฝฟ็จ
[ROLE]ๅฎไน Agent ่บซไปฝ - ไปปๅกๅ
ทไฝ: ไฝฟ็จ
[TASK]ๆ็กฎๆง่ก็ฎๆ - ็บฆๆๆธ
ๆฐ: ไฝฟ็จ
[CONSTRAINTS]ๅฎไน่พน็ - ่ฟๅ็ฎๆด: Agent ่ฟๅ่ทฏๅพ+ๆ่ฆ๏ผ้ๅฎๆดๅ ๅฎน
11.4 ่ดจ้ๆงๅถ
- ่ง่้ฉฑๅจ: ไฝฟ็จ
specs/ๅฎไนๅฏ้ช่ฏ็ๆ ๅ - ๆฑๆปๆฃๆฅ: ่ฎพ็ฝฎ Consolidation ้ถๆฎตไบคๅ้ช่ฏ
- ้ฎ้ขๅ็บง: ๅบๅ Error/Warning/Info
- ่ฟญไปฃไผๅ: ๆฏๆ็จๆทๅ้ฆๅพช็ฏ
12. ็คบไพๆจกๆฟ
12.1 ๆฐ Skill ๅฟซ้ๅฏๅจๆจกๆฟ
# ๅๅปบ Skill ็ฎๅฝ็ปๆ
mkdir -p my-skill/{phases,specs,templates,scripts}
# ๅๅปบๆ ธๅฟๆไปถ
touch my-skill/SKILL.md
touch my-skill/phases/{01-collection,02-analysis,03-assembly}.md
touch my-skill/specs/{requirements,quality-standards}.md
touch my-skill/templates/agent-base.md
12.2 SKILL.md ๆๅฐๆจกๆฟ
---
name: my-skill
description: Generate XXX. Triggers on "keyword1", "keyword2".
allowed-tools: Task, AskUserQuestion, Read, Bash, Glob, Grep, Write
---
# My Skill
Generate XXX through multi-phase analysis.
## Execution Flow
1. Phase 1: Collection โ config.json
2. Phase 2: Analysis โ sections/*.md
3. Phase 3: Assembly โ output.md
## Reference Documents
| Document | Purpose |
|----------|---------|
| [phases/01-collection.md](phases/01-collection.md) | ไฟกๆฏๆถ้ |
| [phases/02-analysis.md](phases/02-analysis.md) | ไปฃ็ ๅๆ |
| [phases/03-assembly.md](phases/03-assembly.md) | ๆๆกฃ็ป่ฃ
|
้ๅฝ A: ่ฎพ่ฎกๅฏนๆฏ
| ่ฎพ่ฎก็น | software-manual | copyright-docs |
|---|---|---|
| ้ถๆฎตๆฐ | 6 | 5 |
| ๅนถ่ก Agent | 6 | 6 |
| ่พๅบๆ ผๅผ | HTML | Markdown |
| ่ดจ้ๆฃๆฅ | 4 ็ปดๅบฆ่ฏๅ | CPCC ๅ่งๆฃๆฅ |
| ๆชๅพๆฏๆ | Chrome MCP | ๆ |
| ่ฟญไปฃไผๅ | ็จๆทๅ้ฆๅพช็ฏ | ๅ่ง้ช่ฏๅพช็ฏ |
้ๅฝ B: ๅทฅๅ ทไพ่ต
| ๅทฅๅ ท | ็จ้ | ้็จ Skill |
|---|---|---|
Task | ๅฏๅจๅญ Agent | ๆๆ |
AskUserQuestion | ็จๆทไบคไบ | ๆๆ |
Read/Write/Glob/Grep | ๆไปถๆไฝ | ๆๆ |
Bash | ่ๆฌๆง่ก | ้่ฆ่ชๅจๅ |
mcp__chrome__* | ๆต่งๅจๆชๅพ | UI ็ธๅ ณ |
่ง่็ๆฌ: 1.0
ๅบไบ: software-manual, copyright-docs
ๆๅๆดๆฐ: 2026-01-03
Source: https://github.com/catlog22/Claude-Code-Workflow#.claude~skills~skill-generator
Content curated from original sources, copyright belongs to authors
User Rating
USER RATING
WORKS WITH