Skip to content
Development
Command

/organize

Intelligent project organization orchestrator with language-specific conventions and parallel analysis

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/organize

Context preview

What this command does when you run it.

Intelligent project organization orchestrator with language-specific conventions and parallel analysis

Command definition

organize.md
allowed-tools: Task, Read, Write, Edit, MultiEdit, Bash(fd:*), Bash(rg:*), Bash(eza:*), Bash(bat:*), Bash(jq:*), Bash(gdate:*), Bash(git:*), Bash(mv:*), Bash(mkdir:*), Bash(rmdir:*)
name: "Organize"
description: "Intelligent project organization orchestrator with language-specific conventions and parallel analysis"
author: "wcygan"
tags: ["workflow","manage"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N 2>/dev/null || date +%s%N 2>/dev/null || echo "$(date +%s)$(jot -r 1 100000 999999 2>/dev/null || shuf -i 100000-999999 -n 1 2>/dev/null || echo $RANDOM$RANDOM)"`
  • Target directory: $ARGUMENTS
  • Current working directory: !`pwd`
  • Git repository status: !`git status --porcelain 2>/dev/null | wc -l | tr -d ' '` uncommitted changes
  • Project build files: !`fd "(package\.json|Cargo\.toml|go\.mod|deno\.json|pom\.xml|build\.gradle|Makefile|CMakeLists\.txt)" "$ARGUMENTS" -d 3 | head -10 || echo "No build files detected"`
  • Directory structure: !`eza -la --tree --level=2 "$ARGUMENTS" 2>/dev/null | head -15 || fd . -t d "$ARGUMENTS" -d 2 | head -10`
  • File count by type: !`fd "\.(js|ts|jsx|tsx|rs|go|java|py|rb|php|c|cpp|h|hpp|cs|kt|swift|scala)" "$ARGUMENTS" | wc -l | tr -d ' '` source files
  • Configuration files: !`fd "\.(json|yaml|yml|toml|ini|conf|config)" "$ARGUMENTS" | head -10 || echo "No config files found"`

Your Task

STEP 1: Initialize organization session and analyze project architecture

  • CREATE session state file: `/tmp/organize-session-$SESSION_ID.json`
  • ANALYZE project structure and technology stack from Context section
  • DETECT primary and secondary languages/frameworks from build files
  • ASSESS current organization level and identify improvement opportunities
# Initialize organization session state
echo '{
  "sessionId": "'$SESSION_ID'",
  "targetDirectory": "'$ARGUMENTS'",
  "detectedTechnologies": [],
  "organizationStrategy": "auto-detect",
  "backupCreated": false,
  "changesApplied": []
}' > /tmp/organize-session-$SESSION_ID.json

STEP 2: Comprehensive project analysis with parallel sub-agent coordination

TRY:

IF project_complexity == "multi-language" OR directory_structure == "disorganized":

LAUNCH parallel sub-agents for comprehensive project analysis:

  • **Agent 1: Technology Stack Discovery**: Analyze all build files, dependencies, and frameworks
  • Focus: Package managers, language versions, framework detection, toolchain analysis
  • Tools: fd for build file discovery, rg for dependency searches, bat for file inspection
  • Output: Technology manifest with detected languages and their conventions
  • **Agent 2: Directory Structure Assessment**: Evaluate current organization vs. best practices
  • Focus: Source directories, test locations, config placement, build artifacts
  • Tools: eza for directory analysis, fd for pattern matching, structure comparison
  • Output: Organization gap analysis and improvement recommendations
  • **Agent 3: File Classification & Sorting**: Categorize files by purpose and detect misplacements
  • Focus: Source code, tests, documentation, configuration, build artifacts
  • Tools: rg for content analysis, fd for extension-based classification
  • Output: File classification matrix and relocation suggestions
  • **Agent 4: Dependency & Import Analysis**: Analyze import patterns and dependency organization
  • Focus: Import statements, module structure, dependency graphs, unused imports
  • Tools: rg for import pattern analysis, language-specific dependency tools
  • Output: Dependency cleanup recommendations and import organization

ELSE:

EXECUTE streamlined single-language organization workflow:

# Single-language organization workflow
echo "๐Ÿ” Analyzing single-language project organization..."

STEP 3: Safety checkpoint and backup creation

**CRITICAL SAFETY MEASURES:**

# Create git commit before major reorganization
if git rev-parse --git-dir >/dev/null 2>&1; then
  echo "๐Ÿ“ฆ Creating safety commit before reorganization..."
  git add -A
  git commit -m "backup: pre-organization snapshot for session $SESSION_ID" || echo "No changes to commit"
  
  # Update session state
  jq '.backupCreated = true' /tmp/organize-session-$SESSION_ID.json > /tmp/organize-session-$SESSION_ID.tmp && 
  mv /tmp/organize-session-$SESSION_ID.tmp /tmp/organize-session-$SESSION_ID.json
else
  echo "โš ๏ธ Not a git repository - manual backup recommended"
fi

STEP 4: Language-specific organization implementation

CASE detected_primary_language: WHEN "rust":

**Rust Project Organization:**

# Ensure Cargo.toml and Cargo.lock are in project root
if [ -f "$ARGUMENTS/Cargo.toml" ]; then
  echo "๐Ÿฆ€ Organizing Rust project structure..."
  
  # Create standard Rust directories
  mkdir -p "$ARGUMENTS/src"
  mkdir -p "$ARGUMENTS/tests"
  mkdir -p "$ARGUMENTS/benches"
  mkdir -p "$ARGUMENTS/examples"
  
  # Move source files to src/ if not already there
  fd "\.rs$" "$ARGUMENTS" -E "src/*" -E "tests/*" -E "benches/*" -E "examples/*" | \
    xargs -I {} sh -c 'echo "Moving {} to src/"'
  
  # Verify lib.rs vs main.rs structure
  if [ -f "$ARGUMENTS/src/main.rs" ] && [ -f "$ARGUMENTS/src/lib.rs" ]; then
    echo "๐Ÿ“š Both lib.rs and main.rs detected - binary with library structure"
  fi
fi

WHEN "go":

**Go Project Organization:**

# Ensure go.mod and go.sum are in module root
if [ -f "$ARGUMENTS/go.mod" ]; then
  echo "๐Ÿน Organizing Go project structure..."
  
  # Create standard Go directories
  mkdir -p "$ARGUMENTS/cmd"
  mkdir -p "$ARGUMENTS/internal"
  mkdir -p "$ARGUMENTS/pkg"
  mkdir -p "$ARGUMENTS/api"
  mkdir -p "$ARGUMENTS/web"
  
  # Organize main packages in cmd/
  fd "main\.go$" "$ARGUMENTS" -E "cmd/*" | \
    xargs -I {} sh -c 'echo "Consider moving {} to cmd/ directory"'
fi

WHEN "java":

**Java Project Organization:**

# Ensure Maven/Gradle files are in project root
if [ -f "$ARGUMENTS/pom.xml" ] || [
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin