flow-scaffolding
Template system for scaffolding Claude Code plugin components. Provides ready-to-use templates for agents, commands, skills, and hooks following project conventions. Used by the /create-flow command.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-29
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- flow-scaffolding
- description
- Template system for scaffolding Claude Code plugin components. Provides ready-to-use templates for agents, commands, skills, and hooks following project conventions. Used by the /create-flow command.
03 SKILL.md 正文
Flow Scaffolding Templates
Standardized templates for creating new Claude Code plugin components. Each template includes required frontmatter, section structure, and placeholder content that follows project conventions.
When to Apply
Reference these templates when:
- Creating new agents, commands, skills, or hooks via
/create-flow - Manually scaffolding components and need the correct structure
- Validating existing components against standard structure
Component Templates
1. Command Template
File: templates/command.md
Creates a command in commands/{name}.md with:
- YAML frontmatter (name, description, category, complexity, mcp-servers, personas)
- Standard sections: Triggers, Usage, Behavioral Flow, Tool Coordination, Examples, Boundaries
- Optional AI collaboration section
2. Agent Template
File: templates/agent.md
Creates an agent in agents/{name}.md with:
- YAML frontmatter (name, description, tools)
- Standard sections: Role, Analysis Workflow, Decision Matrices, Output Format, Boundaries
- Step-by-step workflow with Glob/Grep patterns
3. Skill Template
File: templates/skill.md
Creates a skill directory skills/{name}/ with:
- SKILL.md with frontmatter (name, description)
- Standard sections: When to Apply, Domain Content, How to Use, References
- Optional references/ and templates/ directories
4. Hook Template
File: templates/hook.json
Creates a hook entry for claude/settings.json with:
- Matcher expression for tool/condition filtering (tool-name regex only)
- Hook command (Node.js script)
The matcher group takes only matcher and hooks — an off-schema key such as description is
ignored and warned at every session start (HK-004). Document the hook in its script header comment.
5. Plugin Template
File: templates/plugin.json
Creates a plugin manifest in .claude-plugin/plugin.json with:
- Plugin metadata (name, description, version, author)
- Directory structure for bundled skills, agents, hooks, MCP servers
6. Team Agent Template
File: templates/team-agent.md
Creates a team-aware agent in agents/{name}.md with:
- YAML frontmatter (name, description, tools, team, teamRole, reportsTo,
modelchosen per task tier with a reason comment — no blanket opus) - Standard sections: Role, Team Communication Protocol (heading kept; v2 content), Analysis Workflow, Output Format, Boundaries
- Named
SendMessage({to:"<name>"})targets (no broadcast), shared task list (TaskCreate/TaskUpdate), first-report tool list, handoff format, escalation rules
7. Orchestrator Skill Template
File: templates/orchestrator-skill.md
Creates an orchestrator skill in skills/{team-name}-orchestrator/SKILL.md with:
- YAML frontmatter (name, description)
**실행 모드:**declaration (A workflow / B persistent agents / C subagents; per phase when mixed) and**Pattern:**- Standard sections: When to Apply, Team Members, Data Transfer, Workflow Phases, Completion Criteria, Error Handling, Re-run Support, 테스트 시나리오
## Team Memberstable (Name | Agent | Role | Skills | Output) — this table is the team definition; there is no separate team config file- Numbered workflow phases with assigned members, inputs, and outputs
- Re-run via
_workspace/state check andWorkflowresumeFromRunId(mode A)
8. Loop Stop-Hook Template (루프 엔진)
Files: templates/loop-stop-hook.sh, templates/loop-hooks.json
루프 하네스의 세션 내 자율 루프 엔진. Stop 훅이 종료를 가로채(exit 2) 정지 조건 충족까지 작업을 재주입한다.
- 정지 조건 3결합: 결정론적 게이트(
LOOP_TEST_CMD) + completion promise(LOOP_PROMISE) + max iterations(LOOP_MAX_ITER) - 가드레일: max iter · no-progress 감지(동일 실패 시그니처) · 상태는
.planning/loop-state.json - 환경변수 4개만 설정하면 동작. 설계 가이드: team-harness
references/loop-harness-guide.md
Template Complexity Levels
| Level | Description | Sections | Use Case |
|---|---|---|---|
minimal |
Core structure only | Required sections with minimal content | Quick prototyping |
standard |
Complete structure | All required + common optional sections | Most components |
advanced |
Full-featured | All sections + AI collaboration + references + plugin manifest | Complex workflows |
Naming Conventions
| Component | File Pattern | Name Format |
|---|---|---|
| Command | commands/{name}.md |
kebab-case verb-noun (e.g., deploy-check) |
| Agent | agents/{name}.md |
kebab-case role-noun (e.g., security-scanner) |
| Skill | skills/{name}/SKILL.md |
kebab-case domain-noun (e.g., redis-best-practices) |
| Hook | Entry in settings.json + hooks/{name}.{js,sh} |
matcher = tool-name regex, script kebab-case |
| Plugin | .claude-plugin/plugin.json |
kebab-case (e.g., my-plugin) |
Frontmatter Field Reference
Command Fields (Legacy)
As of Claude Code v2.1.3, commands and skills are unified. New components should use skill format. Command format is maintained for backward compatibility.
| Field | Required | Type | Example |
|---|---|---|---|
name |
Yes | string | "deploy-check" |
description |
Yes | string | "Pre-deployment validation..." |
category |
Yes | string | "utility" / "review" / "workflow" |
complexity |
Yes | string | "basic" / "advanced" |
mcp-servers |
Yes | array | [] or ["grafana"] |
personas |
Yes | array | [] or ["arch-reviewer"] |
Skill Fields
| Field | Required | Type | Example |
|---|---|---|---|
name |
No* | string | "redis-best-practices" |
description |
Recommended | string (multiline) | "Redis optimization guide..." |
argument-hint |
No | string | "[issue-number]" |
disable-model-invocation |
No | boolean | true |
user-invocable |
No | boolean | false |
allowed-tools |
No | array | ["Read", "Grep"] |
model |
No | string | "fable" / "opus" / "sonnet" / "haiku" |
context |
No | string | "fork" |
agent |
No | string | "Explore" / "Plan" |
hooks |
No | object | {PreToolUse: [...]} |
effort |
No | string | "low" / "medium" / "high" / "max" |
paths |
No | array | ["src/**/*.ts"] |
shell |
No | string | "bash" / "powershell" |
*Defaults to directory name if omitted.
Agent Skills Open Standard Fields (Optional)
| Field | Type | Example |
|---|---|---|
license |
string | "MIT" |
compatibility |
array | ["claude-code", "cursor", "gemini-cli"] |
metadata |
object | {version: "1.0", category: "review"} |
Agent Fields
| Field | Required | Type | Example |
|---|---|---|---|
name |
Yes | string | "security-scanner" |
description |
Yes | string | "Security analysis specialist..." |
tools |
No | array | ["Read", "Grep", "Glob", "Bash"] |
disallowedTools |
No | array | ["Write", "Edit"] |
model |
No | string | "fable" / "opus" / "sonnet" / "haiku" / "inherit" — per task tier, reason as comment |
permissionMode |
No | string | "acceptEdits" / "auto" / "plan" |
maxTurns |
No | number | 50 |
skills |
No | array | ["my-skill"] |
mcpServers |
No | array | ["server-name"] or inline config |
hooks |
No | object | {PreToolUse: [...]} |
memory |
No | string | "user" / "project" / "local" |
background |
No | boolean | true |
isolation |
No | string | "worktree" |
effort |
No | string | "low" / "medium" / "high" / "max" |
initialPrompt |
No | string | "Start analysis of..." |
color |
No | string | "blue" / "green" / "purple" etc. |
team |
No | string | "code-review-team" |
teamRole |
No | string | "leader" / "member" / "specialist" / "checker" |
reportsTo |
No | string | "orchestrator-agent-name" |
Plugin Fields (plugin.json)
| Field | Required | Type | Example |
|---|---|---|---|
name |
Yes | string | "my-plugin" |
description |
Yes | string | "Plugin description..." |
version |
Yes | string | "1.0.0" |
author |
No | object | {"name": "Author Name"} |
homepage |
No | string | URL |
repository |
No | string | Git URL |
license |
No | string | "MIT" |
String Substitution Variables
Available in skill body content:
| Variable | Description |
|---|---|
$ARGUMENTS |
All arguments passed to the skill |
$ARGUMENTS[N] / $N |
Specific argument by 0-based index |
${CLAUDE_SESSION_ID} |
Current session ID |
${CLAUDE_SKILL_DIR} |
Directory containing the skill's SKILL.md |
Dynamic context injection via shell:
!`command` # Output replaces placeholder before Claude sees content
Skill Loading Priority
| Priority | Location | Scope |
|---|---|---|
| 1 | Enterprise (managed settings) | Organization-wide |
| 2 | Personal (~/.claude/skills/) |
All projects |
| 3 | Project (.claude/skills/) |
Current project |
| 4 | Plugin (<plugin>/skills/) |
Namespaced |
Section Content Guidelines
Triggers
- Use concrete action phrases, not vague descriptions
- List 4-6 specific scenarios
- Each trigger should be independently sufficient to activate the component
Behavioral Flow
- Number each phase sequentially
- Use bold phase names: Phase 1: Discovery
- Include sub-steps with tool-specific instructions
- Decision matrices for branching logic
Examples
- Minimum 2 examples per command
- Include both simple and complex usage
- Show expected output or behavior in comments
- Cover edge cases in advanced examples
Boundaries
- Will: 5-8 specific capabilities
- Will Not: 3-5 explicit limitations
- Use active voice, be specific about what is in/out of scope
04 同仓库更多 Skills
sync-claude-md
커밋·푸시·PR/MR 직전에 이번 변경이 프로젝트 CLAUDE.md 를 낡게 만드는지 검토하고, 필요할 때만 갱신 diff 를 제안한다 — 아키텍처·디렉터리 구조, 새 통합/MCP, 컨벤션, 빌드·CI·도구, 주요 의존성 변화가 대상. 해당 없으면 한 줄로 끝낸다. Reviews whether pending changes make the project CLAUDE.md stale (architecture, integrations, conventions, build/CI/tooling, major dependencies) and proposes a minimal update diff only when needed. Use when: "CLAUDE.md 갱신 필요해?", "CLAUDE.md 동기화", 커밋/푸시/MR 전에 구조·도구가 바뀐 변경을 정리할 때, sync CLAUDE.md, check CLAUDE.md before commit or PR.
spec-driven-dev
새 기능·프로젝트·큰 변경을 코드보다 스펙 먼저로 진행하는 게이트 워크플로(SPECIFY → PLAN → TASKS → IMPLEMENT) — 가정 명시, 측정 가능한 성공 기준, Always/Ask/Never 경계, 단계별 사람 검토로 범위 이탈과 재작업을 줄인다. Spec-before-code gated workflow for new features or significant changes: explicit assumptions, measurable success criteria, boundaries, and a human review between stages. Use when: "스펙 먼저", "기능 명세", "요구사항 정리", starting a new feature or project, a significant change with vague requirements. 단순 버그 수정·1~2줄 변경엔 불필요.
shipping-guide
프로덕션 배포 전후 가이드 — 배포 전 체크리스트, 피처 플래그 수명주기, 단계적 롤아웃과 진행/보류/롤백 임계값, 롤백 계획 템플릿, 배포 후 모니터링. Production shipping guide: pre-launch checklist, feature-flag lifecycle, staged rollout with go/hold/rollback thresholds, rollback plan template, post-launch monitoring. Use when: "배포 준비", "릴리즈 전 점검", "롤아웃 계획", "롤백 계획", preparing a production deploy, staged rollout, feature flags.
retro
세션 회고·교훈 컴파운딩 — 이번 세션의 교정·실수·발견을 추출해 품질 기준(재현·일반화·판정 가능성)으로 거르고, 컨벤션 변화는 sync-claude-md 위임, 반복 실수는 tasks/lessons.md(#가드-훅-후보 태그), 스킬 지식 갱신은 수정 제안으로 나눈다. 모든 적용은 승인 후. Session retrospective that turns corrections, mistakes, and discoveries into vetted lessons routed to CLAUDE.md sync, tasks/lessons.md, or skill-edit proposals, with user approval before any write. Use when: "회고", "레트로", "교훈 정리", "같은 실수 반복", "재발 방지 규칙", retrospective, lessons learned, wrapping up a task, review, or loop. 여러 실행에 걸친 하네스 개선은 harness:evolve.
project-rules
현재 프로젝트의 스택(빌드 파일 버전, 마이그레이션 도구, ORM 유무, ES 사용, git 호스트)을 감지해 프로젝트 루트 AGENTS.md 의 마커 블록(스택 사실 + 항상 적용되는 스페셜리스트 핵심 ≤15줄 — Claude Code·Codex·Antigravity 공통)과 CLAUDE.md 의 `@AGENTS.md` 연결, Claude 전용 경로 한정 .claude/rules/<stack>-specialist.md(해당 버전에 실제로 맞는 상세 함정)를 diff 로 제안하고, 스택 플러그인을 런타임별로 프로젝트 범위에서 켜는 법을 안내한다. 이전 버전 출력(CLAUDE.md 블록·specialist-core.md)은 AGENTS.md 로 이전을 제안. --check 는 버전 불일치·사라진 ID·크기 한도·연결 누락을 점검. Detects the project's stack and proposes a cross-runtime AGENTS.md block (stack facts + always-on specialist core) linked from CLAUDE.md via @AGENTS.md, plus Claude-only path-scoped specialist rules; migrates the older CLAUDE.md-block layout; --check audits drift. Use when: "이 프로젝트 세팅", "프로젝트 규칙 생성", "AGENTS.md/CLAUDE.md 점검", project setup, generate project rules, audit AGENTS.md or CLAUDE.md drift.
post-merge
MR 머지 완료 후 Plane 이슈 종료와 Outline 문서 업데이트를 자동으로 처리하는 오케스트레이터 스킬입니다. issue-tracker와 document-latest 스킬을 연계 실행하여 머지 후 후속 작업을 일괄 처리합니다. Orchestrates post-merge follow-up after an MR is merged: chains the issue-tracker and document-latest skills to close the Plane issue and update Outline wiki docs in a single batch. Use when: an MR was just merged, closing tickets and syncing documentation after a merge, post-merge cleanup.