一键导入
agent-template-generator
Generates new agent profiles with consistent structure, automatic validation pattern injection, and test-driven protocols
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generates new agent profiles with consistent structure, automatic validation pattern injection, and test-driven protocols
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | agent-template-generator |
| description | Generates new agent profiles with consistent structure, automatic validation pattern injection, and test-driven protocols |
| category | development |
| version | 1.0.0 |
| dependencies | ["bash","json-validation"] |
Purpose: Creates new agent profiles with enforced consistency, automatic validation pattern inclusion, and test-driven development protocols.
Benefits:
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "api-security-specialist" \
--type "specialist" \
--description "MUST BE USED for API security audits, penetration testing, and vulnerability assessment"
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "security-validator" \
--type "validator" \
--description "MUST BE USED for Loop 2 security validation and threat model review"
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "custom-agent" \
--type "specialist" \
--description "Agent description here" \
--model "haiku" \
--provider "anthropic" \
--provider-model "claude-3-haiku-20240307" \
--tools "[Read, Write, Bash, TodoWrite]"
| Argument | Description | Example |
|---|---|---|
--name | Agent name (lowercase-with-hyphens) | api-security-specialist |
--description | Agent description (MUST BE USED pattern) | MUST BE USED for API security audits |
| Argument | Description | Default |
|---|---|---|
--type | Agent type (specialist|validator|coordinator|utility) | specialist |
--tools | Tool list (JSON array) | [Read, Write, Edit, Bash, Grep, Glob, TodoWrite] |
--model | Claude model (sonnet|opus|haiku) | sonnet |
--acl-level | Access control level (1-3) | 1 |
--output-dir | Output directory (overrides type-based default) | Auto-determined |
--provider | AI provider (zai|kimi|openrouter|anthropic) | zai |
--provider-model | Provider-specific model | glm-4.6 |
| Type | Description | Default Output Directory |
|---|---|---|
specialist | Domain-specific implementation (Loop 3) | .claude/agents/cfn-dev-team/developers/ |
validator | Code review and validation (Loop 2) | .claude/agents/cfn-dev-team/reviewers/quality/ |
coordinator | Multi-agent orchestration | .claude/agents/cfn-dev-team/coordinators/ |
utility | Supporting tools and helpers | .claude/agents/cfn-dev-team/utility/ |
---
name: agent-name
description: MUST BE USED description
tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
model: sonnet
type: specialist
acl_level: 1
validation_hooks:
- agent-template-validator
- test-coverage-validator
---
<!-- PROVIDER_PARAMETERS
provider: zai
model: glm-4.6
-->
Automatically includes:
source .claude/skills/json-validation/validate-success-criteria.sh
validate_success_criteria || exit 1
Automatically includes:
Automatically includes:
Generated template includes placeholders for:
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "graphql-security-specialist" \
--type "specialist" \
--description "MUST BE USED for GraphQL schema security audits and injection prevention"
Output:
✅ Agent template created: .claude/agents/cfn-dev-team/developers/graphql-security-specialist.md
Next steps:
1. Customize the [DOMAIN EXPERTISE] placeholder
2. Fill in Core Responsibilities
3. Customize Domain-Specific Guidelines
4. Define Success Metrics
5. Add Example Workflows
6. Document Integration Points
7. Add relevant references
Validation Pattern: ✅ Automatically included
Test-Driven Protocol: ✅ Automatically included
Provider Configuration: ✅ Set to zai (glm-4.6)
Open generated file and replace placeholders:
# Edit the generated file
code .claude/agents/cfn-dev-team/developers/graphql-security-specialist.md
Customize:
[DOMAIN EXPERTISE - TO BE CUSTOMIZED] with specific domain# Verify frontmatter is valid YAML
head -20 .claude/agents/cfn-dev-team/developers/graphql-security-specialist.md
# Verify validation skill is sourced
grep -A 5 "source .claude/skills/json-validation" .claude/agents/cfn-dev-team/developers/graphql-security-specialist.md
# Test with sample criteria
AGENT_SUCCESS_CRITERIA='{"test_suites":[{"name":"security-tests","command":"npm run test:security","pass_threshold":0.95}]}' \
cfn-spawn agent graphql-security-specialist \
--task "Test validation integration"
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "api-security-specialist" \
--type "specialist" \
--description "MUST BE USED for API security audits, penetration testing, and vulnerability assessment. Use PROACTIVELY for OAuth2 security, rate limiting, input validation. Keywords - API security, OWASP, penetration testing, vulnerability assessment"
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "performance-validator" \
--type "validator" \
--description "MUST BE USED for Loop 2 performance validation, load testing review, and bottleneck identification"
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "sprint-coordinator" \
--type "coordinator" \
--description "MUST BE USED for multi-sprint orchestration and epic decomposition" \
--model "haiku" \
--acl-level "3"
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "custom-specialist" \
--type "specialist" \
--description "Custom agent" \
--output-dir ".claude/agents/cfn-dev-team/custom"
All generated agents automatically include:
Centralized Validation Skill:
source .claude/skills/json-validation/validate-success-criteria.sh
validate_success_criteria || exit 1
Test-Driven Protocol:
Completion Protocol:
Generator prevents:
| Aspect | Manual Creation | Template Generator |
|---|---|---|
| Time | 60 minutes | 5 minutes (setup) + 10 minutes (customization) |
| Validation Pattern | Must remember to include | ✅ Automatic injection |
| Test-Driven Protocol | Must copy from existing agent | ✅ Automatic injection |
| Structure Consistency | Prone to variation | ✅ Enforced consistency |
| Security | May forget validation | ✅ Always includes CVSS 8.2 protection |
| Provider Config | May forget to add | ✅ Always included |
Time Savings: ~75% reduction in agent creation time
# Test basic generation
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "test-agent" \
--type "specialist" \
--description "Test agent for validation"
# Verify output file
ls -la .claude/agents/cfn-dev-team/developers/test-agent.md
# Cleanup
rm .claude/agents/cfn-dev-team/developers/test-agent.md
# Generate agent
./.claude/skills/agent-template-generator/generate-agent.sh \
--name "test-validator" \
--type "validator" \
--description "Test"
# Verify validation skill is sourced
grep "source .claude/skills/json-validation/validate-success-criteria.sh" \
.claude/agents/cfn-dev-team/reviewers/quality/test-validator.md
# Cleanup
rm .claude/agents/cfn-dev-team/reviewers/quality/test-validator.md
Dependency: All generated agents automatically source json-validation skill.
Integration:
source .claude/skills/json-validation/validate-success-criteria.sh
validate_success_criteria || exit 1
Integration Point: Generated agents include test execution pattern using parse-test-results.sh.
Pattern:
RESULTS=$(./.claude/skills/cfn-loop-orchestration/helpers/parse-test-results.sh \
"jest" "$TEST_OUTPUT")
Cause: Attempting to generate agent that already exists.
Solution:
# Remove existing file or choose different name
rm .claude/agents/cfn-dev-team/developers/existing-agent.md
# Or use different name
--name "existing-agent-v2"
Cause: Using invalid agent type.
Valid types:
specialistvalidatorcoordinatorutilityExpected Behavior: All generated agents include [CUSTOMIZE] and [TO BE CUSTOMIZED] markers.
Solution: Replace all placeholders with domain-specific content.
Status: Production-ready (v1.0.0) Time Savings: 75% reduction in agent creation time Security: Auto-injection of CVSS 8.2 validation protection Consistency: 100% structure enforcement across all new agents
Tiered planning orchestrator. Runs the full SPARC+ pipeline (research, spec, decide, pseudo, data, arch, ux, design, test, ops) as a parallel DAG, scaled by build stage (mvp/beta/enterprise) via inclusion profiles. Enforces two gates: every success criterion is executable (verifiable-done) and every step is unambiguous (haiku-executable). Use as the entry point for any non-trivial build instead of cfn-spa-plan.
Post-planning completeness review. Extracts assumptions, traces dependencies, analyzes blast radius, checks alpha-readiness, surfaces gaps before implementation. Use after writing any plan that touches data, APIs, or shared state.
SPARC Specification phase. Make testable acceptance criteria, edge cases, pre/post conditions, invariants BEFORE planning implementation. Use when starting any non-trivial task to lock intent, surface ambiguity early.
Test-strategy phase of cfn-megaplan. Designs test depth properly: fixtures/test-data, the unit/integration/contract/e2e/load split, mocking strategy, and non-functional tests, instead of lumping everything into a vague red phase. Feeds Bar A (verifiable-done): every acceptance criterion becomes a concrete runnable check. Use after cfn-spec, cfn-arch, and (if frontend) cfn-ux.
Pre-edit backup + post-edit validation for safe file edits. Use to capture file state before edits, validate changes after edits, revert files to prior state, or ensure edit safety via auto backup/validation hooks.
Extract complete Redis coordination data from completed CFN Loop tasks and structure into comprehensive JSON analysis files