AgentSkillsCN

structure-enforcement

根据规范结构规则验证文件放置,并自动修复违规。在提交前或验证项目结构时使用。

SKILL.md
--- frontmatter
name: structure-enforcement
description: Validate file placement against canonical structure rules and auto-fix violations. Use before committing or when validating project structure.
allowed-tools:
  - Read
  - Bash

Structure Enforcement

Validation

bash
# Check structure
python .claude/scripts/structure_validator.py

# Auto-fix violations (dry-run first)
python .claude/scripts/auto_fix.py --dry-run
python .claude/scripts/auto_fix.py --apply

Rules (canonical-structure.yaml)

yaml
file_types:
  - name: "completion_reports"
    patterns:
      - "*-COMPLETE*.md"
    canonical_location: ".claude/archive/completion-reports/"

Pre-Commit Hook

Files automatically validated before commit. Violations block commit.

Common Violations

code
❌ Completion reports in root
✅ Move to .claude/archive/completion-reports/

❌ Memory files in wrong location
✅ Move to .claude/memory/