tyrealq/q-skills/organize
Claude Code and agent skill by tyrealq/q-skills
- community
Checking that the SKILL.md file is still in the repository.
Audit project structure and documentation, align names and layout to conventions, remove or archive superseded content, and refine READMEs and CLAUDE.md. Use for cleaning up folders, standardizing layout, fixing stale docs, or streamlining documentation before a commit.
Install
npx vskill@latest install tyrealq/q-skills/organizeSKILL.md
Organize Skill
Audits a repository's layout and its project documentation against one set of conventions, using nine detectors, a plan file, and approval by group, and then hands off to /commit or /ship.
References
references/conventions.md: the target state the detectors check against. It covers naming, layout, reusable versus project code, the documentation model, the current-state rule, superseded content, and the.gitignorecategories.
Core Principles
- Plan before acting. Write every finding and every proposed operation to the plan file. Change no file until the user has approved the group that contains it; the one exception is a group labeled "fixes a written rule" (see Plan file), which is applied without asking.
- Take each answer from its source. Disk and
git ls-filesdecide what exists; the project's docs decide what a thing is for and which project rules hold;conventions.mddecides what a thing is called and how it is laid out wherever the project's docs state no rule. List every mismatch between these sources in the plan; the user decides which side changes, except in a group labeled "fixes a written rule". Where a rule written in the project's docs conflicts withconventions.md, follow the project rule and list the conflict as a note. - Ask for approval per group. The user approves or rejects each group of operations in the plan. A clear violation of a rule already written in the project's own docs is fixed without asking. New files and consolidations of duplicated content always wait for approval.
- List every move and deletion for approval. Every move and every deletion appears in the plan as its own operation, and none is applied before the user approves it.
- Edit project documentation only. Among Markdown files, edit only those whose job is describing the repository. Deliverable prose is outside this skill; see Scope.
- Move files safely on synced paths. Copy the file or folder with retry, confirm the copy, then remove the source. Never rename a folder in place on a cloud-synced path such as Dropbox, OneDrive, or iCloud. Let git detect renames after the move; do not use
git mv. A rename that changes only case uses the same method twice, through the temporary name that detector A gives.
Workflow
| Step | Action | Reference | |
|---|---|---|---|
| 1. Audit | Resolve the repository root with git rev-parse --show-toplevel, and limit the pass to a path argument when one is given. Record git status --short as the baseline for Step 7. List git ls-files and the gitignored paths (git ls-files --others --ignored --exclude-standard --directory), and walk the disk with those paths included so that detector B can see untracked generations. Read the root CLAUDE.md first, then every README.md in the tree and every owner file the docs point to. When the project's docs forbid sending a file's contents to this model (for example proprietary text), use only its name and path, and list any check that needs the contents (a diff, a count) under Open questions with the reason. | conventions.md § Documentation model | |
| 2. Layout detectors | Run detectors A to D. | Detectors A to D; conventions.md § Naming, § Layout, § Superseded content, § .gitignore categories | |
| 3. Documentation detectors | Run detectors E to I. | Detectors E to I; conventions.md § Documentation model, § Current-state rule, § Layout, § Naming | |
| 4. Plan file | Write the plan to ~/.claude/plans/organize-<repo>-<YYYYMMDD>.md, or to the path the user names, with the seven sections below. | Plan file, below | |
| 5. Clarify | Ask with AskUserQuestion for each open question, such as the date of a name that lacks part of its date, the destination of an orphan file, or the owner of duplicated content. | Step 1; Detectors A, C, and G | |
| 6. Apply | Apply the approved groups and the groups labeled "fixes a written rule", one group at a time in plan order, and stop at the first error. Within a group, make the moves and deletions before the documentation edits. | Core Principles; Plan file, below | |
| 7. Verify | Run git status --short and walk the final tree. Confirm that every folder the root map names exists; every folder that conventions.md § Documentation model requires a README for has one, and the root map points to each top-level README; no approved finding is left open; the paths untracked under detector D are gone from git ls-files; and git status --short shows only the baseline and the changes the plan lists. Report any check that fails and leave it open. | Plan file, below (Verification) | |
| 8. Hand off | Summarize what moved, what was deleted, what was untracked, which documentation files changed, and which findings were left out of scope. Name /commit for a single commit, or /ship to also update CHANGELOG.md and push. | Scope |
With the argument audit, or when the user asks for an audit only, stop after Step 4 and leave the open questions in the plan file unasked.
Plan file
The plan file has seven sections, in this order:
- Context: what started the pass, what the repository holds, and the path scope, if any.
- Findings: grouped under the detector letters A to I, each with its path and the line or name at issue. A note is a finding listed for the user with no operation proposed. Notes stay in Findings and are not repeated under Out of scope.
- Operations: numbered and grouped for approval. Each group lists its moves, deletions,
git rm --cachedcalls, and documentation edits. A documentation edit shows the old and the new text. A new file, such as a missing README, is drafted in full. Each move or rename carries, in the same group, the edit to every project document that names the old path, and to any note in the project's memory folder (~/.claude/projects/<project>/memory/*.md) that names it. - Out of scope: each finding that will not be acted on, with the reason.
- Open questions: each decision the audit cannot settle, with what the answer changes.
- Verification: the checks from Step 7 that apply to this plan.
- Rollback: how to reverse each group. A deleted tracked file or an edited document comes back with
git checkout HEAD -- <path>before a commit; a path untracked withgit rm --cachedis tracked again withgit add <path>; an archived folder moves back from_archive/.
An operations group reads like this:
Label each group "needs approval" or "fixes a written rule". Use the second label only for a group of documentation edits with no move, deletion, new file, or consolidation, and that removes no information: no sentence, clause, finding, or recorded reason that the edit does not restate as a current fact; give the file and line where the project states the rule.
Detectors
Run every detector over the whole tree, gitignored paths included, and record each finding in the plan file under its letter. The target state that each detector checks against is in references/conventions.md.
A. Name drift
- Looks for: folder and file names that break
conventions.md§ Naming, and names that differ in case or spelling between the docs and disk. - Verify: compare
git ls-filesand a walk of the disk against every name the root map and the READMEs give. - Resolve: propose the rename and the matching docs edit as one operation. On a case-insensitive filesystem, rename in two steps through a temporary name (
Data/todata_tmp/todata/) so that git and the sync client both record the change. When a name lacks part of its date, list it under Open questions instead of proposing a name. - Never flag: names that
conventions.md§ Naming writes in capitals (files a tool reads by a fixed name, owner files, and acronyms the project's docs write in capitals), or a name that follows a naming rule written in the project's docs (list the conflict withconventions.mdas a note).
B. Superseded generations
- Looks for: folders named
v1/,v2/,old/,backup/,bak/,deprecated/, orlegacy/; siblings named<name>_old,<name>_backup,<name>_v1, or<name>_v2; dated siblings of current content; and a plan or design document whose work is complete, that describes no part of the current project, and that no current doc points to. Search everywhere outside_archive/, including inside gitignored paths such asoutputs/. - Verify: for dated siblings, apply the test in
conventions.md§ Superseded content: a sibling is superseded only when the docs and scripts read the later one alone. Diff each remaining candidate against the current folder beside it; when it holds the current content under a wrong name, propose a rename, not a removal. - Resolve: delete the old version or move it to
_archive/, following the tracking split inconventions.md§ Superseded content. - Never flag: anything already inside
_archive/, or dated siblings that form a collection underconventions.md§ Superseded content. List received material that the docs mark as superseded as a note.
C. Orphan files
- Looks for: files outside gitignored paths whose name and path appear in no root map, README, script, or tracked Markdown file, and which do not sit inside a folder that the root map or a README describes; and files at the root that
conventions.md§ Layout does not allow, listed as a note when gitignored. - Verify: search for the basename and the relative path across
git ls-files '*.md'and the scripts (*.py,*.R,*.sh,*.js,*.ts). Then check the file's own folder; the file counts as covered when the root map or a README describes that folder. A covered file that nothing names, in a folder whose README has a file table that omits it, is a note. - Resolve: propose a destination among the existing folders based on file type, or ask the user what the file is for. Never delete an orphan without approval.
- Never flag: files a tool reads by a fixed name and owner files, as
conventions.md§ Naming defines them, or deliverables.
D. Tracked per-machine state
- Looks for: tracked paths that match a pattern in
conventions.md§ .gitignore categories, tracked per-user files inside a root.<tool>/folder as that section defines them, and a.gitignoremissing one of that section's categories. - Verify: confirm each path appears in
git ls-files, and check whether.gitignorealready has a line covering it. - Resolve: propose
git rm --cached <path>, plus the matching.gitignoreline when none exists. The file stays on disk; only the index entry is removed. - Never flag:
.env.exampleor other templates meant to be shared.
E. Stale facts
- Looks for: every path, filename, folder, command, and count named in project documentation.
- Verify: check each path and name against disk and
git ls-files, and each count against the file or script that produces it. For a command, confirm the script exists and read its argument parser to confirm it accepts the flags named. - Resolve: correct the doc to match disk. Never change a number without its source; when the source cannot be found, list the count under out of scope.
- Never flag: placeholder patterns such as
<name>_oldorYYYY-MM-DD_slug, external paths that the root map names as outside the repository, or a gitignored path that the docs describe as local to one machine or created at run time (an.envfile, a virtual environment).
F. History clauses
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/organize/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tyrealq/q-skills/organize)