skills/organize/SKILL.md
Audit project structure, align layout to conventions, and archive superseded content. Use for cleaning up folders, standardizing layout, or preparing a workspace before committing.
npx skillsauth add TyrealQ/q-skills organizeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audits any project directory, aligns it to a consistent structural convention, and archives superseded content under _archive/. Detects drift between docs and disk, flags stale or orphan content, and proposes a reversible cleanup. Hands off to /commit or /ship.
shutil.copytree + retry for folder moves on cloud-synced paths (Dropbox, OneDrive, iCloud); never os.rename / mv./commit or /ship handles commit and push.These are the structural conventions the skill enforces. They are project-agnostic and can be adapted to any type of work (research, content production, software, data pipelines).
Each project root has a flat top level with these roles, as needed:
| Folder | Purpose |
|---|---|
| data/ or source/ | Canonical raw inputs (often gitignored when large) |
| scripts/ | Code or automation |
| output/ or results/ | Generated artifacts (often gitignored when large) |
| refs/ | Reference material, source documents, citations |
| assets/ | Media, images, logos |
| docs/ or manuscript/ | Written deliverables, reports |
| _archive/ | Superseded content at any level (see below) |
Not every project needs every folder. Create folders only when at least two items belong there.
| Element | Convention | Examples |
|---|---|---|
| Folder names (asset / content subfolders) | lowercase, hyphens for word-breaks | refs/, video-captions/, topic-models/ |
| Folder names (nested by identifier) | lowercase, underscores when grouping by id | player_<handle>/, study_01/ |
| Top-level documentation markdown | UPPER_SNAKE_CASE.md | README.md, CHANGELOG.md, CLAUDE.md, VIDEO_SCRIPT.md |
| Other markdown under folders | kebab-case or lowercase | outline.md, design-notes.md |
| Scripts | snake_case | run_pipeline.py, generate_report.py |
| Generated data files | stage/prefix + identifier + optional date | summary_2026-04-14.parquet, batch_001.jsonl |
| Date tokens in filenames | ISO YYYY-MM-DD or compact YYYYMMDD | snapshot_2026-03-09.xlsx |
Root-level folders for distinct projects or subprojects: lowercase kebab-case (video-one/, data-pipeline/).
_archive/ conventionWhen a folder produces a superseded version of something (regenerated images, old pipeline output, abandoned drafts), move the old content into a sibling _archive/ folder at the same level it was produced. Do not scatter *_old, *_backup, *_v1 folders around the tree.
_archive/ when multiple generations accumulate: _archive/2026-04-14/, _archive/v1/One project-level documentation file (conventionally CLAUDE.md at the repo root) serves as the single source of truth:
If no such file exists, the skill proposes creating a minimal one.
.gitignore baselineEvery project should ignore at least these categories:
# Secrets
.env
.env.local
*.pem
credentials*.json
token*.json
# Large media (project-specific — adjust)
*.mp3
*.mp4
*.mov
# OS / editor noise
.DS_Store
Thumbs.db
*.swp
# Coding-agent harness state (per-machine)
.claude/settings.local.json
**/.claude/settings.local.json
Specific plugin- or tool-managed directories that live in the project root (non-standard .<tool>/ folders with per-user config) should also be ignored if the tool treats them as per-user. The skill identifies these by the presence of EXTEND.md, settings.local.*, or similar per-user marker files.
Resolve the repo root:
git rev-parse --show-toplevel
If a path argument is provided, scope to that subtree; otherwise scan the whole repo. Enumerate every folder and file under root, skipping .git/, gitignored paths, and any folder already named _archive.
If a project-level docs file exists (CLAUDE.md, README.md), parse any structure diagram it contains and compare against actual disk state.
Run all four detectors and collect findings:
Compare folder names in the docs structure diagram to disk. On case-insensitive filesystems (Windows, macOS default), disk wins silently. Flag each mismatch.
Default resolution: keep lowercase on disk (Target Structure convention) and update the docs. Only rename folders on disk if the user explicitly asks.
Flag any of these living outside an _archive/ folder:
v1/, v2/, ..., old/, backup/, bak/, deprecated/, legacy/<name>_v1/, <name>_old/, <name>_backup/, <name>.bak/2024-03-09/, MAR09/) with no _archive/ parentVerify each candidate by diffing contents against the current canonical folder. If the candidate genuinely supersedes current content, propose moving it under a sibling _archive/. Watch for misnamed folders (e.g., a folder named prompts-v1/ whose content actually matches current PNGs in the parent — propose rename to prompts/, not archive).
A file is an orphan if no reference to it appears in:
README.md in the repo*.py, *.ts, *.r, *.R, *.sh, *.js)git ls-files '*.md')Common orphans: ad-hoc PDFs, one-off datasets, test images, manual downloads, screenshots. Propose a destination (refs/, assets/, data/) based on file type, or ask the user for intent. Never delete an orphan without explicit confirmation.
Check git ls-files for patterns that should be local-only:
**/.env (allow .env.example through)**/.claude/settings.local.json.<tool>/ at the repo root whose contents look per-user (marker files such as EXTEND.md, settings.local.*, preferences.json)**/.DS_Store, **/Thumbs.db, **/*.swpFor any hits, propose git rm --cached <path> plus the matching .gitignore entry. The file stays on disk — only the index entry is removed.
Write all proposed operations to ~/.claude/plans/organize-<repo>-<YYYYMMDD>.md with this structure:
git rm --cached calls, and docs editsUse AskUserQuestion for decisions that cannot be inferred:
refs/, assets/, data/); suggest creating a new one only if none fit and user confirms_archive/) vs. expanded (include pipeline or script reorganization)Use a single Python block for all moves, with retries for cloud-sync locks:
import shutil, time
from pathlib import Path
def safe_move(src: Path, dst: Path, retries: int = 5, delay: float = 1.0):
if not src.exists():
return
if dst.exists():
raise FileExistsError(dst)
dst.parent.mkdir(parents=True, exist_ok=True)
for _ in range(retries):
try:
shutil.copytree(src, dst) if src.is_dir() else shutil.copy2(src, dst)
break
except (PermissionError, OSError):
time.sleep(delay)
else:
raise
for _ in range(retries):
try:
shutil.rmtree(src) if src.is_dir() else src.unlink()
break
except (PermissionError, OSError):
time.sleep(delay)
else:
raise
Rules:
os.rename / mv a folder in a cloud-synced pathgit mvgit rm --cached <path> (file stays on disk, just untracked)After operations succeed:
_archive/ placement rule, subfolder casing rule, gitignored-local-state listRun, in order:
git status --short
git ls-files --others --ignored --exclude-standard
Walk the final tree and confirm:
.git/ and gitignored paths)git ls-filesReport a concise structural summary:
git rm --cachedTell the user: run /commit for a single conventional-commits commit (chore: standardize <repo> structure), or /ship to also update CHANGELOG.md and push.
Include
_archive/refs/ / assets/ / data/ (with user confirmation on destination).gitignoreExclude
/commit or /ship (explicit hand-off).git/ or gitignored paths~/.claude/plans/organize-<repo>-<date>.mdAskUserQuestion, not assumedcopytree + retry pattern, not rename / mv.gitignore covers any per-machine or per-user state flagged by Detector D/commit or /shiptesting
Capture session decisions, conventions, and lessons into plan files, auto-memory, and CLAUDE.md so a fresh session resumes cleanly. Use for "hand off," "wrap up," "update docs for next session," or before /compact.
data-ai
Run exploratory data analysis on tabular datasets with measurement-appropriate statistics. Use for EDA, descriptive statistics, data exploration, or preparing data summaries for reports and manuscripts.
research
Orchestrate end-to-end academic manuscript preparation following APA 7th edition. Use for writing papers, drafting sections, or academic writing support.
development
Generate professional slide deck images from content with smart logo branding. Use for creating slides, presentations, decks, or PPT output.