Skip to main content
skill CX Codex

project-structure · tartinerlabs — Claude Code skill: what it does, how to install

Audits directory layouts, flags file organisation anti-patterns, and safely moves code using git mv with automated import updates.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add tartinerlabs/skills --skill project-structure -a claude-code
Open on GitHub

What project-structure does

The skill evaluates project layouts and defaults to read-only auditing. It groups findings into HIGH, MEDIUM, and LOW tiers alongside violation counts. For UI-heavy projects like React or Next.js, it prioritises feature-based grouping; for backends built on FastAPI, Express, Django, or Go, it suggests layer-based layouts. Monorepos get a hybrid structure. Specific framework conventions activate solely when Next.js or Expo is detected.

Files remain untouched until you explicitly instruct a fix. During reorganisations, the skill runs mkdir -p before git mv so Git does not abort on missing directories, updates dependent import statements, and confirms no unresolved imports remain. It advises keeping code next to its sole caller and promoting it to shared folders only when a second caller emerges.

What it helps with

  • audit repository file organisation and detect directory anti-patterns
  • determine the right folder placement for new components or services
  • relocate files with git mv while automatically rewriting import paths
  • apply feature-based or layer-based grouping to an existing codebase

Example prompts for the agent

  • Audit our repository layout and list any structure anti-patterns.
  • Where should I place the new payment webhook handler?
  • Apply the suggested folder structure fixes and rewrite imports.

How to install project-structure

1Skills CLI (Vercel)

npx skills add tartinerlabs/skills --skill project-structure -a claude-code

2Manually: put the files in place

~/.claude/skills/project-structure/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/project-structure/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about project-structure

How to install project-structure in Claude Code?

Run npx skills add tartinerlabs/skills --skill project-structure -a claude-code in your terminal.

What does project-structure do?

It scans repository directories against grouping and colocation rules, generates an audit report, and applies file relocations upon request.

Does project-structure move files automatically without asking?

No. The skill defaults to reporting findings; it executes git mv and rewrites imports only when explicitly asked to reorganize or fix issues.

Source text

SKILL.md · MIT
---
name: project-structure
description: Use when deciding where code should live, organising files, or auditing project structure. Checks colocation, grouping, and directory anti-patterns.
license: MIT
allowed-tools: Read Glob Grep Edit Bash(git:*) Bash(mkdir:*)
model: haiku
effort: medium
compatibility: Any language project; framework-specific structure rules apply only when that framework is detected
metadata:
  short-description: Project structure and file organisation.
---

You are a project structure expert.

Audit and report by default; move files only when the user asks you to fix, reorganise, or apply something. When the ask is unclear, report first and offer to apply the fixes.

## Rules Overview

| Rule | Impact | File |
|------|--------|------|
| Colocation | HIGH | `rules/colocation.md` |
| Anti-patterns | HIGH | `rules/anti-patterns.md` |
| Feature-based grouping | MEDIUM | `rules/feature-based.md` |
| Layer-based grouping | MEDIUM | `rules/layer-based.md` |
| Framework structure | MEDIUM | `rules/framework-structure.md` (only when a supported framework is detected) |

## Workflow

### Step 1: Detect Project Type

Scan for project indicators to determine the appropriate organisation approach:

- Feature-heavy app (SPA, Next.js/React, or any UI-driven codebase) → feature-based
- Service / API (Express, Fastify, Hono, Django, FastAPI, Go, Rails, …) → layer-based
- Monorepo (`apps/` + `packages/`, or workspace manifests) → hybrid
- Existing structure → respect and extend current patterns

Load `rules/framework-structure.md` **only when a framework it covers is detected** (currently Next.js / Expo); otherwise the language-neutral colocation and grouping rules apply on their own.

### Step 2: Audit

Check the existing structure against all rules.

Report each finding as `path` — what is wrong → the fix, grouped under `### HIGH` / `### MEDIUM` / `### LOW`, and close with a per-rule violation count.

### Step 3: Recommend

Based on project type and existing patterns, recommend where new code should live. Default to placing new code next to its only consumer; promote it to a shared location when a second consumer appears. Extend the structure the project already has rather than introducing a second one alongside it.

### Step 4: Fix

Apply fixes for each violation:
1. Create the destination directory first if it does not exist (`mkdir -p <dest>`) — `git mv` fails when the target directory is missing
2. Move files to their correct location with `git mv`
3. Update all import paths in dependent files
4. Verify no broken imports remain after moves

© tartinerlabs · MIT · tartinerlabs/skills

Similar skills

All skills for Code review and refactoring →

project-structure by other authors comes first.

project-structure codewithmukesh A skill that tells your agent how to lay out a .NET solution: central package versions, shared build properties, .slnx format and naming rules. CX Codex +1 2,800installs project-structure wshaddix A skill that hands your coding agent a fixed layout for .NET solutions: where projects live, how shared build settings and package versions are wired. CX Codex +1 536installs project-structure modelcontextprotocol This skill maps the layout of the modelcontextprotocol/servers repo and tells you which file or directory a new piece of code belongs in. CX Codex +1 ★ 91,595repo stars improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. 1,141,062installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. 990,453installs codebase-design Matt Pocock This skill helps design modules with small interfaces and hidden complexity. Use it when refactoring code, choosing a seam, or making tests easier to write. 850,344installs code-review Matt Pocock Reviews changes from a chosen reference point against repository standards and the originating spec. Use it for a branch, PR, or work in progress. 789,521installs implement Matt Pocock Implements work from a specification or tickets, following a test-driven flow and ending with review and a commit. Use it when a coding task needs a defined delivery routine. 774,700installs

From the same set12

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor