AgentSkillsCN

flow-validation

为Claude Code插件组件制定验证规则与检查清单。 包含针对代理、命令、技能与钩子的结构化、内容与安全验证规则。该规则由/verify-flow命令调用。

SKILL.md
--- frontmatter
name: flow-validation
description: |
  Validation rules and checklists for Claude Code plugin components.
  Contains structural, content, and security validation rules for
  agents, commands, skills, and hooks. Used by the /verify-flow command.

Flow Validation Rules

Comprehensive validation ruleset for Claude Code plugin components. Rules are organized by component type and severity to enable systematic quality checks.

When to Apply

Reference these rules when:

  • Running /verify-flow to validate components
  • Creating new components and need to verify compliance
  • Reviewing pull requests that modify plugin components
  • Setting up CI validation for plugin repositories

Rule Categories

PrefixComponentRule Count
CMD-Commands12 rules
AGT-Agents12 rules
SKL-Skills11 rules
HK-Hooks6 rules
XRF-Cross-Reference5 rules
SEC-Security4 rules
QUA-Quality6 rules

Severity Scale

LevelImpactAuto-FixableAction
CriticalComponent brokenSomeMust fix immediately
HighConvention violationSomeFix before merge
MediumStyle deviationMostFix when convenient
LowOptimization hintAllOptional

Validation Order

Execute validation in this order for optimal dependency resolution:

  1. Structural (CMD/AGT/SKL/HK rules) - File exists, frontmatter valid, sections present
  2. Content Quality (QUA rules) - Descriptions specific, examples present, triggers concrete
  3. Security (SEC rules) - No credentials, safe scripts, no dangerous commands
  4. Cross-Reference (XRF rules) - Component references valid, no orphans

Quick Reference: Required Sections

Command Required Sections

code
---
frontmatter (6 fields)
---
# /{name} - {Title}
## Triggers (3+ items)
## Usage (code block with options)
## Behavioral Flow (phased, numbered)
## Tool Coordination (tool list)
## Examples (2+ with code blocks)
## Boundaries (Will + Will Not)

Agent Required Sections

code
---
frontmatter (3 fields)
---
Persona description paragraph
## Your Role (5+ responsibilities)
## Analysis Workflow (numbered steps)
## Output Format (report template)
## Boundaries (Will + Will Not)

Skill Required Structure

code
skills/{name}/
  SKILL.md (< 5,000 tokens)
    ---
    frontmatter (2 fields)
    ---
    # {Title}
    ## When to Apply (3+ conditions)
    ## {Domain Content}
    ## How to Use
  references/ (optional, {prefix}-{topic}.md naming)
  templates/ (optional, referenced in SKILL.md)

Reference Files

Detailed rule definitions with examples:

Token Budget Estimation

For skill SKILL.md files, estimate token count:

code
tokens ≈ word_count × 1.3
BudgetWordsStatus
< 3,500< 2,700Optimal
3,500-5,0002,700-3,850Acceptable
> 5,000> 3,850Over budget - split into references

Health Score Calculation

code
Base Score: 100

Deductions per finding:
  Critical: -20
  High:     -10
  Medium:    -3
  Low:       -1

Rating Scale:
  90-100: Excellent - Ready for production use
  75-89:  Good - Minor improvements recommended
  60-74:  Fair - Notable gaps need attention
  40-59:  Poor - Significant issues found
   0-39:  Critical - Not ready for use