AgentSkillsCN

component-architect

严格遵循官方 Claude Code 组件标准,在创建技能、代理、命令或钩子时使用。对现有组件进行校验,并提供修复建议。 贯彻“一个技能 = 一个专业化代理”的架构模式。

SKILL.md
--- frontmatter
name: component-architect
description: |
  Enforces official Claude Code component standards. Use when creating skills,
  agents, commands, or hooks. Validates existing components and offers remediation.
  Implements the "one skill = one specialized agent" architecture pattern.
allowed-tools: Read, Write, Edit, Grep, Glob, Bash, WebFetch
model: sonnet
context: fork
agent: component-architect-agent
user-invocable: true
hooks:
  PreToolUse:
    - matcher: "Write|Edit"
      hooks:
        - type: command
          command: "$HOME/.claude/skills/component-architect/scripts/validate-component.sh"
  PostToolUse:
    - matcher: "Write|Edit"
      hooks:
        - type: command
          command: "$HOME/.claude/skills/component-architect/scripts/log-component.sh"

Component Architect

Core Responsibilities

  1. Pre-Creation Validation: Check official docs before generating any component
  2. Existing Component Audit: Scan ~/.claude for non-compliant components
  3. Remediation Orchestration: Spawn subagents to fix non-compliant files
  4. Architecture Enforcement: Apply "one skill = one specialized agent" pattern

Official Frontmatter Reference

ComponentRequiredOptional
SKILL.mdname, descriptionallowed-tools, model, context, agent, hooks, user-invocable
Agent .mdname, descriptiontools, disallowedTools, model, permissionMode, skills, hooks
Command .md(none)description, allowed-tools, model, argument-hint
plugin.jsonname, descriptionauthor
hooks.jsonhooks objectdescription

Validation Commands

Validate All Components

bash
/component-architect validate

Validate Specific Type

bash
/component-architect validate --type skills
/component-architect validate --type agents
/component-architect validate --type hooks

Apply Architecture Pattern

bash
/component-architect apply-pattern --skill skill-name

Architecture Pattern: One Skill = One Agent

For every active skill:

  1. Set context: fork in SKILL.md
  2. Create designated agent with matching name pattern
  3. Configure agent with:
    • Intelligent model selection based on task complexity
    • Appropriate permissionMode for the workflow
    • Complementary skills that enhance the primary skill
    • Scoped hooks for lifecycle management
    • Restricted tools appropriate to the domain

Model Selection Matrix

ComplexityModelIndicators
HighopusArchitecture, debugging, multi-domain reasoning
MediumsonnetImplementation, refactoring, moderate analysis
LowhaikuSearches, simple transforms, quick lookups
InheritedinheritWhen parent context model is appropriate

Permission Mode Selection Matrix

ScenarioModeUse When
Complex multi-stepplanHigh complexity requiring human feedback before implementation
Edge case handlingacceptEditsPotential edge cases need user confirmation on edits
Routine executionbypassPermissionsClear requirements, preplanned, or promise completion
Standard workflowdefaultNormal permission checking with prompts
Deny risky opsdontAskAuto-deny prompts (explicitly allowed tools still work)

Remediation Workflow

  1. Scan component directories for non-compliant files
  2. Generate remediation plan per file
  3. Spawn parallel subagents for batch updates
  4. Verify all changes post-remediation

Integration References