Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

file-categorization

БесплатноБез исполняемых скриптовНе проверен

Reusable logic for categorizing files as Command, Agent, Skill, or Documentation based on structure and content analysis

enunoот enuno★ 17 звёзд на GitHub14 установок в других каталогах

Об этом скилле

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.md or *command.md
  • Located in .claude/commands/ directory
  • Filename uses verb-noun pattern (e.g., integration-scan.md)

Agents:

  • Filename matches *-agent.md or *agent.md
  • Located in agents-templates/ directory
  • Contains role-based names (architect, builder, validator, etc.)

Skills:

  • Filename is SKILL.md or *-SKILL.md or *-skill.md
  • Located in skills/*/ directories
  • Contains workflow automation content

Documentation:

  • Standard .md files
  • 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-tools restrictions
  • 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
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить file-categorization с