К основному содержанию
скилл CX Codex

organize · sethgammon — скилл для Claude Code: структура репозитория

Скилл organize для аудита и исправления структуры проекта: проверяет, где лежат файлы, переносит их по конвенции и обновляет импорты. Код внутри файлов не трогает.

MIT ★ 937 обновлён 2026-10-29

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add SethGammon/Citadel
/plugin install citadel@citadel-local
Открыть на GitHub

Что делает organize

Detect определяет конвенцию проекта (layer-based, feature-based, hybrid или flat), сканируя директории через Glob tool. Audit проверяет каждый файл на соответствие правилам размещения и именования, строит план переноса и ждёт подтверждения. Apply переносит файлы, обновляет все импорты в зависимых модулях и барреле, затем запускает typecheck — новые ошибки запрещены.

Конфигурация хранится в .claude/harness.json под ключом organization; там же записывается флаг locked, который включает блокирующий хук. Монорепо сканируется по каждому корню пакета отдельно. Если файл надо разделить или извлечь функцию, скилл отложит это для /refactor — сам он только перемещает и переименовывает, оставляя содержимое нетронутым.

Какие задачи решает

  • проверить соответствие файлов конвенции проекта
  • переместить файлы по правилам размещения с обновлением импортов
  • определить, куда положить новый модуль
  • записать конвенцию структуры в конфиг

Примеры запросов агенту

  • Проверь структуру проекта и предложи план переноса файлов
  • Где должен лежать файл UserProfile.tsx?
  • Включи блокирующий режим для правил размещения — /organize --lock

Как установить organize

1Через маркетплейс плагинов

/plugin marketplace add SethGammon/Citadel
/plugin install citadel@citadel-local

Команда ставит плагин citadel целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

npx skills add SethGammon/Citadel --skill organize -a claude-code

3Вручную: положить файлы

~/.claude/skills/organize/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/organize/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об organize

Как установить organize в Claude Code?

Выполни /plugin marketplace add SethGammon/Citadel, затем /plugin install citadel@citadel-local. Для других платформ используй npx skills add SethGammon/Citadel --skill organize -a claude-code или npx skills add SethGammon/Citadel --skill organize -a codex.

Что делает organize?

Определяет конвенцию структуры репозитория, проверяет соответствие файлов правилам размещения, строит план переноса и выполняет его с обновлением импортов. Код внутри файлов не меняет, кроме путей в import.

Чем organize отличается от /refactor?

organize переносит и переименовывает файлы, не трогая их содержимое. Рефакторинг внутри файлов — извлечение функций, переименование символов, разделение компонентов — делает /refactor.

Исходный текст

SKILL.md · MIT
---
name: organize
license: MIT
description: >-
  Repository structure only: directory layout, file placement, naming
  conventions, and where-does-this-belong decisions. Detects the project's
  convention, audits files against it, and executes move plans with
  import-path updates. Never changes code inside files beyond the import
  updates a move forces; in-file restructuring is /refactor.
user-invocable: true
auto-trigger: false
trigger_keywords:
  - organize
  - directory structure
  - folder structure
  - project structure
  - file organization
  - organize directories
  - organize files
  - cleanup directories
  - directory convention
  - where should this go
  - messy project
last-updated: 2026-06-11
---

# /organize -- Repository Structure

## Orientation

**Use when:** Deciding where a file belongs, auditing file placement against the project's conventions, running a naming-convention sweep, or moving files so the tree matches the declared layout.

**Don't use when:** You want a structural map of code relationships (use `/map`), you want to change code inside files (use `/refactor`), you need disk or artifact cleanup (use `/houseclean`), or you need a single known move executed (use `/refactor move`).

## Boundary with /refactor

/organize changes where files live and what they are named. Changing code structure within files (extract, inline, split functions or components, rename symbols) is /refactor. The only in-file edits /organize makes are import-path updates forced by a move or rename. If an audit reveals a file that should be split or merged, recommend /refactor; do not do it here.

## Commands

| Command | Behavior |
|---|---|
| `/organize` | Detect convention, audit placement, propose and execute a move plan |
| `/organize --audit` | Check current files against the manifest, report violations only |
| `/organize --show` | Display the current organization manifest |
| `/organize --lock` | Set `locked: true` so the enforcement hook blocks violations |
| `/organize --unlock` | Set `locked: false` so enforcement is advisory |
| `/organize where does {file} go` | Single placement decision, no full audit |

## Protocol

### Step 1: CHECK

Read `.claude/harness.json`, Citadel's shared config path for all runtimes including Codex. If an `organization` key exists, use its convention and placement rules; on bare `/organize`, ask whether to audit, adjust the rules, or reconfigure. If no key exists, continue to Step 2.

### Step 2: DETECT

Use the **Glob tool** (not `find` or `Get-ChildItem`) to discover directories. Filter out `node_modules`, `.git`, `.planning`, `.citadel`, `.claude`, `dist`, `build`, `__pycache__`, `.next`, `target`, `.venv`, `venv`. Cap at 200 directories; if larger, scan only the top 3 levels.

Convention signals:
- `src/components/`, `src/hooks/`, `src/utils/` -> **layer-based**
- `src/features/auth/`, `src/features/dashboard/` -> **feature-based**
- `src/auth/components/`, `src/auth/hooks/` -> **hybrid**
- Flat `src/` with no subdirectories -> **flat**
- Mixed signals -> **custom** (ask the user which convention to adopt)

Record: convention, confidence (high/medium/low), roots with purposes, anomalies.

### Step 3: AUDIT

Check every source file against the placement rules (manifest if present, detected convention otherwise). Also check naming: files or directories that break the dominant casing or suffix pattern of their siblings.

```
=== Structure Audit: {project} ===
Convention: {convention} ({confidence})
Compliant: {N}/{M} source files
Violations:
  {current_path} -> {expected_path} ({rule broken})
Naming:
  {path}: {issue}
```

### Step 4: PLAN

For each violation, build a move plan before touching anything: source path -> destination path, every importer whose import path must change, and barrel/index files that need re-exports updated. Moves and renames only; never delete files with content. Present the plan and wait for confirmation.

### Step 5: APPLY

Execute confirmed moves, update all import paths referencing moved files, update barrels, then run the project's typecheck command (from harness.json). Zero new errors allowed. If a move fails typecheck for reasons beyond import paths, revert that single move and flag the file instead of editing its code.

### Step 6: CONFIGURE

On first run or reconfigure, write the `organization` key to harness.json. Read-modify-write: preserve all other keys, and preserve any existing `dynamic`/`cleanupPolicy` entries this skill no longer manages.

```json
{
  "organization": {
    "convention": "layer",
    "roots": { "src": { "purpose": "application source" } },
    "placement": [
      { "glob": "*.test.{ts,tsx}", "rule": "colocated", "target": null, "reason": "tests live next to source" }
    ],
    "locked": false
  }
}
```

Rule types: `colocated`, `sibling-dir`, `root-dir`, `within-root`. Set `locked: false` initially; `/organize --lock` turns on blocking enforcement via the organize-enforce hook.

## Fringe Cases

- **No directories found / empty project:** suggest flat convention; nothing to audit.
- **Monorepo (multiple package.json):** scan each package root separately; ask whether rules are per-package or repo-wide.
- **harness.json missing:** audit in advisory mode from the detected convention; offer to create the manifest.
- **User changes convention:** warn with the number of files that would move. Never mass-move without explicit confirmation.
- **Conflict with `protectedFiles`:** if protected files conflict with placement rules, warn and ask which takes precedence.

## Contextual Gates

**Disclosure:** "Auditing repository structure. Moves execute only after you confirm the plan."
**Reversibility:** amber -- file moves and import-path updates; undo with `git checkout -- .` before commit or `git revert` after.
**Trust gates:** Any: detect and audit. Familiar (5+ sessions): confirmed move plans execute autonomously.

## Quality Gates

- [ ] Convention detected or read from the manifest before any audit verdicts
- [ ] Every violation lists current path, expected path, and the rule it breaks
- [ ] Move plan presented and confirmed before any file moves
- [ ] No in-file code edits beyond import-path updates; split/extract needs are deferred to /refactor
- [ ] Typecheck clean after moves (zero new errors)
- [ ] harness.json write preserves all keys outside `organization`

## Exit Protocol

```
---HANDOFF---
- Structure: {convention}; {compliant}/{total} files compliant after changes
- Moves: {N} files moved, {M} import paths updated, 0 in-file refactors
- Deferred to /refactor: {split/extract recommendations, or "none"}
- Enforcement: {"advisory (unlocked)" | "blocking (locked)"}
- Reversibility: amber -- undo moves with git checkout/revert
---
```

© SethGammon · MIT · SethGammon/Citadel

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

Все скиллы по теме «Код-ревью и рефакторинг» →

Сначала — organize от других авторов.

organize ghaida Скилл organize проектирует информационную архитектуру: категории, навигацию и таксономию продукта. Помогает, когда пользователи блуждают по разделам. CX Codex +1 3 400установок code-refactor-master diet103 Субагент code-refactor-master для Claude Code перестраивает структуру проекта, отслеживает импорты и разбивает крупные компоненты. Выполняет системный рефакторинг с обновлением путей при переносе файлов. CX Codex ★ 10 055звёзд репо repo-skillopt objectivlabs Скилл repo-skillopt для Claude Code разбирает устройство репозитория и собирает спецификацию с опорой на файлы, конфиги и тесты. Активируется при просьбах объяснить кодовую базу, описать архитектуру, внести изменения или оценить риски. CX Codex +1 598установок import-organizer rohitg00 Плагин import-organizer автоматически организует, сортирует и очищает импорты в коде. Экономит время на ручной рефакторинг и делает импорты консистентными. ★ 2 858звёзд репо konsistent-fix-violations vercel-labs Скилл konsistent-fix-violations для Claude Code запускает konsistent, находит и помогает исправить нарушения структурных соглашений в коде. Помогает привести код к установленным правилам или пересмотреть сами правила. CX Codex +1 134установок explore rohitg00 Плагин explore для Claude Code строит карту зависимостей и анализирует структуру проекта. Запускается по запросу агенту. ★ 2 858звёзд репо File Organizer claude-office-skills Скилл File Organizer для Claude Code раскладывает файлы по папкам и переименовывает их по содержимому и метаданным. Разбирает папку загрузок, превратившуюся в свалку. CX Codex +1 5 700установок

Из того же набора55

Весь набор →
cost Скилл cost показывает расход токенов и стоимость сессий, кампаний и периодов. Помогает понять, куда уходит бюджет и как меняется темп расходов. CX Codex +1 ★ 937звёзд репо merge-review Скилл merge-review проверяет очередь слияний от fleet-агентов, находит пересечения файлов между ветками и предлагает безопасный порядок merge перед тем, как принимать изменения в main. CX Codex +1 ★ 937звёзд репо deploy-steward Скилл deploy-steward для Claude Code по очереди вливает готовые PR в main, проверяет CI, запускает деплой и создаёт задачи на починку при сбоях. CX Codex +1 ★ 937звёзд репо prd Собирает PRD по описанию приложения: задаёт вопросы, определяет объём и технические решения. Документ можно передать Archon для разбиения на кампанию. CX Codex +1 ★ 937звёзд репо create-app Скилл create-app для Claude Code и Codex автоматизирует создание приложений по текстовому описанию. Он делит задачу на пять уровней и ведёт разработку через PRD, архитектуру и верификацию. CX Codex +1 ★ 937звёзд репо postmortem Скилл postmortem разбирает завершённую кампанию или инцидент по файлам проекта, телеметрии и истории Git. Помогает выяснить, что сломалось и что поймали защитные проверки. CX Codex +1 ★ 937звёзд репо map Скилл map строит компактный JSON-индекс кодовой базы с файлами, экспортами, импортами и графом зависимостей, чтобы агент находил нужные файлы без лишних Glob и Grep. CX Codex +1 ★ 937звёзд репо phase-validator Субагент phase-validator сверяет отчёт о завершении этапа с условиями выхода и выносит вердикт pass или fail. Помогает контролировать автоматические конвейеры разработки. CX Codex ★ 937звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой