
file-organization
Design or refactor project structure around the right boundary unit: feature, shared layer, route segment, or workspace package. Use when a repo feels scattered, a team needs naming/import conventions, or the user must choose between type-based, feature-based, framework-colocated, and workspace layouts. Triggers on: file organization, folder structure, project structure, reorganize repo, feature folders, shared vs feature code, where should this file live, apps/packages split, and project layout refactor.
- Installs
- 397
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/akillness/jeo-skills --skill file-organization- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads file-organization automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
File Organization
Use this skill when the main question is "what structural boundary should this codebase use, and how do we move toward it without turning a reorg into chaos?"
The job is not to dump a giant folder tree and pretend it fits every repo. The job is to:
- identify the real organizing unit,
- separate feature/shared/framework/package boundaries,
- define naming and import rules that prevent drift,
- plan the migration safely,
- return a structure brief another engineer or agent can apply immediately.
Read references/boundary-decision-matrix.md before recommending a structure. Read references/migration-checklist.md before moving files or renaming directories. Read references/naming-and-import-rules.md when the problem includes barrel files, alias paths, or team conventions.
When to use this skill
- Choose a maintainable folder strategy for a new repo or app
- Refactor a repo whose
components/,hooks/,utils/, andstore/folders no longer match business boundaries - Decide whether code belongs in a feature module, shared layer, route segment, or workspace package
- Review structure drift before a large reorganization or migration
- Standardize naming, import paths, and ownership rules across a growing team
- Decide whether a monorepo/workspace split is justified or premature
- Produce a migration plan that minimizes broken imports, duplicate files, and half-finished moves
When not to use this skill
- The main task is designing reusable component APIs, variants, or slot/primitive composition → use
design-systemordesign-system - The main task is framework state ownership, cache/store boundaries, or URL/form/server-state placement → use
state-management - The main task is making the repo runnable across machines, services, toolchains, or containers → use
system-environment-setup - The main task is task runners, bootstrap scripts, hooks, or local-CI command design → use
deployment-automation - The main task is deployment topology or hosted CI/CD rollout → use
deployment-automationorvercel-deploy - The repo only needs a tiny mechanical file move with no architectural decision; in that case implement the move directly instead of reopening structure design
Instructions
Step 1: Classify the structural pressure before drawing folders
Normalize the request into this intake first:
structure_intake:
repo_shape: single-app | app-plus-api | monorepo | library-cli | content-site | unknown
current_pattern: type-based | feature-based | route-colocated | package-workspace | mixed | unknown
main_pressure:
- scattered-feature-code
- unclear-shared-boundaries
- framework-routing-collision
- premature-monorepo-split
- monorepo-needed-now
- naming-drift
- import-chaos
- migration-risk
- onboarding-confusion
- unknown
change_scope: greenfield | incremental-refactor | major-reorg | audit-only
primary_boundary_unit: feature | shared-layer | route-segment | package | unknown
confidence: high | medium | low
If the user is vague, prefer the smallest obvious interpretation and state the assumption.
Step 2: Choose one primary organization mode
Pick exactly one primary mode for the current run:
- starter cleanup
- Use when a type-based starter tree is still small enough to fix before it calcifies.
- feature modularization
- Use when business areas are spread across technical folders and need feature ownership.
- framework colocation
- Use when Next.js / similar router conventions should guide route-segment placement.
- shared layer governance
- Use when the repo already has features, but shared code keeps leaking everywhere.
- workspace split
- Use when multiple runnable apps/services/packages justify
apps/+packages/boundaries.
- Use when multiple runnable apps/services/packages justify
- migration audit
- Use when the repo needs a safe move plan more than a brand-new structure proposal.
Step 3: Choose the smallest boundary unit that solves the problem
Use these rules:
- Prefer feature folders when the same business area touches components, hooks, data access, tests, and state together.
- Prefer shared layers only for code reused by multiple features with stable ownership.
- Prefer framework colocation when routing/layout/file-convention semantics are part of the architecture, not just file storage.
- Prefer workspace packages only when there are multiple deployable apps/services, reusable libraries, or independent dependency/runtime needs.
- Do not promote a package split just because the repo feels messy; many repos need better feature/shared rules, not a monorepo.
- Keep generated artifacts, docs, scripts, and tests explicit instead of burying them in ambiguous utility folders.
Step 4: Apply the decision ladder
Use feature modularization when
- understanding one user-facing capability currently requires opening files across many technical folders
- changes in one domain repeatedly touch
components/,hooks/,utils/,api/, andstore/ - the team needs clear ownership per feature or business area
Use framework colocation when
- route segments, loaders, layouts, server/client boundaries, or file conventions shape where code must live
- the framework docs already define special files or reserved paths
- the real goal is to organize around routes/features without fighting the framework
Use shared layer governance when
- the repo already has features, but shared folders have become a dumping ground
- teams keep asking whether something is truly shared or just reused twice
- import paths and barrel files make boundaries hard to see
Use workspace split when
- the repo contains multiple apps/services/packages with distinct dependencies or runtime targets
- shared libraries need versioned or explicit package boundaries
- build/test/deploy concerns are meaningfully different per package
Use migration audit when
- the structure idea is mostly known but the move would break imports, docs, tests, or ownership if done casually
- the team needs staged moves, aliases, codemods, or compatibility shims
Step 5: Keep structural boundaries honest
A good structure recommendation says what it does not own.
Examples:
- if the real pain is reusable component primitives and API shape, route to
design-system - if the real pain is design-token / library-wide UI governance, route to
design-system - if the real pain is runtime/services/toolchain setup, route to
system-environment-setup - if the real pain is recurring scripts and task entrypoints, route to
deployment-automation - if the real pain is state/caching ownership, route to
state-management
Mixed requests are normal. Split them explicitly instead of forcing one folder strategy to solve everything.
Step 6: Set reusable naming and import guardrails
Any recommended structure should name these rules explicitly:
- Directory purpose — what belongs here and what does not
- Naming style — folder and file case conventions
- Shared vs feature rule — when code graduates into shared folders/packages
- Public API rule — whether features/packages export through one boundary file
- Import rule — whether deep imports across sibling features are forbidden
- Test/doc/story placement rule — colocated with feature or centralized by policy
Bad smells:
utils/orshared/becoming a junk drawer- feature code spread across five top-level technical folders
- barrel files that erase ownership and encourage deep implicit coupling
- moving to
apps/+packages/without a real package/runtime boundary - framework special files mixed with unrelated domain logic with no colocation rule
Step 7: Plan the migration before changing files
Before moving anything, produce a change plan that covers:
- current hotspots and why they are painful
- target boundary model
- staged move order
- alias/import or barrel compatibility strategy
- test/build/docs verification steps
- rollback or partial-adoption safety
Prefer incremental refactors over one huge rename when the repo is active.
Step 8: Produce the file-organization brief
Return a concise artifact someone can act on immediately.
Preferred format:
# File Organization Brief
## Mode
- Primary mode:
- Why this mode fits:
## Boundary choice
- Primary organizing unit:
- What belongs in feature/shared/route/package boundaries:
- What stays out of scope:
## Recommended structure
- Top-level folders/packages:
- One example feature/package layout:
- Naming/import rules:
## Migration plan
1. First step
2. Second step
3. Verification step
## Handoffs
- Adjacent skills:
- Risks / follow-up work:
Step 9: Prefer clarity over template worship
When modernizing an existing structure:
- keep the recommendation tied to current repo pressures, not a fashionable template
- use framework conventions where they help, but do not confuse framework files with the whole architecture
- move code toward the smallest durable boundary model
- treat naming/import rules as part of the architecture, not cleanup trivia
- preserve transferable principles that work across frontend, backend, and fullstack repos
Output format
Always return a file organization brief, repo structure recommendation, or migration audit.
Required qualities:
- classify the structure problem before prescribing a tree
- choose one primary organization mode
- name the boundary unit explicitly
- include route-outs to adjacent skills
- provide naming/import guardrails
- include a migration plan when the repo already exists
Examples
Example 1: Type-based starter tree is collapsing
Input
We have
components,hooks,utils, andstore, but every checkout change touches all four folders. How should we reorganize this React app?
Good output direction
- mode:
feature modularization - recommend feature folders for checkout/auth/catalog with a small shared layer
- add a rule for when code is allowed to move into shared
- keep state-ownership specifics routed to
state-management
Example 2: Next.js route folders are getting messy
Input
Our Next.js app router repo mixes route files, data helpers, and business logic all over
app/. We need a clean structure that still respects framework conventions.
Good output direction
- mode:
framework colocation - keep special route files where Next.js expects them
- colocate route-local code with route segments, move reusable domain logic into feature/shared boundaries outside route-only files
- mention route groups/private folders if they help organize without changing the URL
Example 3: Team wants to split into packages
Input
Should this repo become
apps/andpackages/? We now have a web app, worker, and shared UI library.
Good output direction
- mode:
workspace split - justify package boundaries by runnable targets and shared libraries
- recommend
apps/for deployables andpackages/for reusable libraries/tooling - include migration and verification steps instead of only drawing the final tree
Best practices
- Start from the pressure on the repo, not from a favorite architecture meme.
- Prefer the smallest boundary model that reduces change amplification.
- Treat shared code as a governed exception, not the default landing zone.
- Let framework conventions inform structure, but do not let them become accidental junk drawers.
- Split into packages only when dependencies, runtimes, or deployables truly require it.
- Name import and public-API rules early; they are part of the organization system.
- Use staged migrations and verification steps for live repos.
References
FAQ
What does the file-organization skill do?
Design or refactor project structure around the right boundary unit: feature, shared layer, route segment, or workspace package. Use when a repo feels scattered, a team needs naming/import conventions, or the user must choose between type-based, feature-based, framework-colocated, and workspace layouts. Triggers on: file organization, folder structure, project structure, reorganize repo, feature folders, shared vs feature code, where should this file live, apps/packages split, and project layout refactor.
How do I install file-organization?
Run npx skills add https://github.com/akillness/jeo-skills --skill file-organization in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/file-organization/ (personal) or .claude/skills/file-organization/ (project).
Which AI agents can use file-organization?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is file-organization safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains file-organization?
It is published by akillness in akillness/jeo-skills. It has 397 recorded installs.
More from akillness/jeo-skills
rtk
akillness/jeo-skills
Install, initialize, verify, and troubleshoot RTK (Rust Token Killer) for AI coding agents. Use when you need to reduce shell-command token output, confirm that the correct rtk binary is installed, choose between Homebrew, install.sh, or Cargo installation, wire rtk init for Claude Code, Codex, Gemini CLI, Cursor, Copilot, Windsurf, Cline, or OpenCode, or use compact wrappers such as rtk git status, rtk read, rtk grep, rtk test, rtk lint, and rtk gain. Triggers on: rtk, rust token killer, token saver cli, rtk init, rtk gain, codex rtk, gemini rtk, opencode rtk, claude hook token reduction.
graphify
akillness/jeo-skills
Drive Graphify from its CLI to build, refresh, query, export, and serve a durable code/corpus knowledge graph. Use when the user wants .graphify/GRAPHREPORT.md, graph.json, graph.html, graphify update/summary/query/path/explain/tree, change-aware review context, git-hook or watch-based refresh, a stdio MCP graph server, or an install into jeo, jeopi, gjc, opencode, Claude, Codex, or Gemini. Also covers the honest structural fallback when native extraction is empty or misleading. Route simple locate/reference work to codebase-search, narrative knowledge-base work to llm-wiki, and project-memory handoff to opencontext. Triggers on: graphify, graphify update, graphify query, knowledge graph CLI, GRAPHREPORT.md, graph.json, codebase graph, graph refresh, graphify install, graphify serve, review context, affected flows.
data-analysis
akillness/jeo-skills
Analyze datasets to extract insights, identify patterns, and generate reports.
code-refactoring
akillness/jeo-skills
Turn a cleanup packet into one behavior-preserving refactor brief. Use when simplifying a messy function/component/service, freezing behavior before touching fragile legacy code, splitting a cleanup-heavy diff into reviewable slices, or planning a repeated migration / codemod without changing intended behavior. Route diagnosis to debugging, review judgment to code-review, validation-program design to testing-strategies, bottleneck-led tuning to performance-optimization, and pure symbol inventory to codebase-search.
technical-writing
akillness/jeo-skills
Write internal technical documentation for engineers and operators: technical specs, architecture docs, ADRs, runbooks, migration plans, and developer-facing implementation guides. Use when the main job is capturing a technical decision, system boundary, operating procedure, or rollout path for builders and maintainers. Triggers on: tech spec, design doc, architecture doc, ADR, runbook, migration guide, implementation guide, rollout doc, operational guide, and internal technical writing. End-user onboarding guides, tutorials, FAQs, and help-center flows belong here too. Route API portals to api-documentation, release notes to changelog-maintenance, decks to presentation-builder, and GTM messaging to marketing-automation.
web-accessibility
akillness/jeo-skills
Routing-first skill for web accessibility remediation and verification. Use when the main job is classifying which accessibility surface is failing — semantics, keyboard/focus, labels/announcements, visual perception/reflow, media alternatives, or routed-app navigation feedback — and turning vague audit, WCAG, axe/Lighthouse, or "make this accessible" requests into one concrete remediation packet. Broad UI critique for hierarchy, polish, and launch readiness belongs here too. Route component API architecture and system governance to design-system, and responsive layout strategy to responsive-design.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.