file-categorization
БесплатноБез исполняемых скриптовНе проверенReusable logic for categorizing files as Command, Agent, Skill, or Documentation based on structure and content analysis
Об этом скилле
File Categorization Skill
When to Use This Skill
- Processing files in integration pipelines
- Scanning directories for file organization
- Auto-routing files to appropriate locations
- Generating file inventory reports
- Validating repository structure
What This Skill Does
Analyzes file structure and content to accurately categorize files into:
- Commands - Slash command definitions
- Agents - Agent configuration files
- Skills - Reusable workflow automation
- Documentation - General markdown documentation
- Other - Uncategorized files requiring manual review
Categorization Logic
Step 1: Filename Pattern Matching
Commands:
- Filename matches
*-command.mdor*command.md - Located in
.claude/commands/directory - Filename uses verb-noun pattern (e.g.,
integration-scan.md)
Agents:
- Filename matches
*-agent.mdor*agent.md - Located in
agents-templates/directory - Contains role-based names (architect, builder, validator, etc.)
Skills:
- Filename is
SKILL.mdor*-SKILL.mdor*-skill.md - Located in
skills/*/directories - Contains workflow automation content
Documentation:
- Standard
.mdfiles - Located in
docs/directory - Contains reference or tutorial content
Step 2: Frontmatter Analysis
Read the YAML frontmatter (if present) to identify:
Command Indicators:
---
description: "..."
allowed-tools: [...]
author: "..."
version: "X.Y"
---
Skill Indicators:
---
name: skill-name
description: "..."
---
Agent Indicators (less structured, more prose):
## Agent Identity
**Role**: [Agent Role]
**Version**: X.Y.Z
**Purpose**: [Purpose description]
Step 3: Content Structure Analysis
Commands have:
- Workflow sections with numbered steps
- Bash command examples (prefixed with
!) allowed-toolsrestrictions- Usage examples
Agents have:
- Core Responsibilities section
- Allowed Tools and Permissions section
- Workflow Patterns section
- Context Management section
Skills have:
- "When to Use" section
- "What This Skill Does" section
- Step-by-step process descriptions
- Examples with real data
Documentation has:
- Standard markdown structure
- Tutorial or reference content
- No executable workflows
- Educational purpose
Step 4: Keyword Detection
Scan content for category-specific keywords:
Command Keywords:
!bash,!git,!npm, etc. (shell commands)- "allowed-tools"
- "Usage:", "Workflow:", "Steps:"
- Command-line patterns
Agent Keywords:
- "Core Responsibilities"
- "Workflow Patterns"
- "Context Management"
- "Orchestrator", "Sub-Agent"
- "Handoff", "Delegation"
Skill Keywords:
- "When to Use"
- "What This Skill Does"
- "Skill" in self-references
- Reusable workflow language
Documentation Keywords:
- "Introduction", "Overview", "Guide"
- "Tutorial", "Reference", "Best Practices"
- Educational/explanatory language
Categorization Algorithm
function categorizeFile(filePath, content):
// Phase 1: Filename and location
if filename matches command patterns OR in .claude/commands/:
category = "Command"
confidence = "High"
else if filename == "SKILL.md" OR in skills/*/:
category = "Skill"
confidence = "High"
else if in agents-templates/:
category = "Agent"
confidence = "High"
else if in docs/:
category = "Documentation"
confidence = "Medium"
// Phase 2: Frontmatter analysis (refine)
frontmatter = extractYAML(content)
if frontmatter contains "allowed-tools" AND "version":
category = "Command"
confidence = "High"
else if frontmatter contains "name" (no allowed-tools):
category = "Skill"
confidence = "High"
// Phase 3: Content structure (if still uncertain)
if confidence != "High":
if content contains "## Agent Identity":
category = "Agent"
confidence = "High"
else if content contains "## When to Use":
category = "Skill"
confidence = "Medium"
else if content contains "!bash" OR "!git":
category = "Command"
confidence = "Medium"
// Phase 4: Fallback
if category == null:
category = "Other"
confidence = "Low"
reason = "Unable to determine category, manual review needed"
return {category, confidence, reasoning}
Output Format
For each categorized file, return:
### [Filename]
- **Category**: [Command|Agent|Skill|Documentation|Other]
- **Confidence**: [High|Medium|Low]
- **Reasoning**: [Why this category was assigned]
- **Frontmatter**: [✅ Valid | ⚠️ Malformed | ❌ Missing]
- **Required Fields**: [List of found/missing fields]
- **Recommended Location**: [Target directory path]
Example Usage
Example 1: Categorizing Integration File
Input:
File: USING-GIT-WORKTREES-SKILL.md
Content:
---
name: using-git-worktrees
description: Creates isolated git worktrees...
---
# Using Git Worktrees
## When to Use
...
Output:
### US
Установить file-categorization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл file-categorization?
Reusable logic for categorizing files as Command, Agent, Skill, or Documentation based on structure and content analysis
Как установить скилл file-categorization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл file-categorization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic