project-architecture-clean-code
Skill2 starsChanged 4 months agoMITView on GitHub
Establish and maintain clean project structure, folder/file organization conventions, naming standards, and lightweight documentation across a repository. Use whenever starting a new repo, the user asks how to organize files/folders, asks for a README or documentation, or the codebase organization has become inconsistent.
- Reads credentials
In this repository22 other files it gives its agents.
- accessibility-a11ySkill
- design-system-tailwindSkill
- motion-design-toolkitSkill
- nextjs-architectureSkill
- react-component-engineeringSkill
- react-three-fiber-3dSkill
- responsive-mobile-firstSkill
- auth-authorizationSkill
- database-schema-designSkill
- form-validation-error-handlingSkill
- mern-stack-architectureSkill
- rest-api-integrationSkill
- state-managementSkill
- landing-page-conversionSkill
- payment-gateway-integrationSkill
- saas-dashboard-adminSkill
- startup-mvp-developmentSkill
- ux-research-flow-designSkill
- visual-design-languageSkill
- ai-assisted-frontend-workflowSkill
- deployment-vercel-productionSkill
- performance-seo-optimizationSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
No magic numbers/strings — name them as constants with intent-revealing names.
- Very specific: line 45
Document architectural *decisions* (why Postgres over MongoDB, why a separate API service) as short ADRs in docs/adr/NNN-title.md — capture …
- Very specific: line 46
Keep .env.example in sync with actually-required env vars every time a new one is added — a stale .env.example is a recurring onboarding …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project Architecture, Clean Code & Documentation Skill
Repository structure baseline
.
├── .agents/skills/ # project-scoped agent skills (this convention)
├── .github/workflows/ # CI
├── src/ # or app/ + components/ etc. per framework skill
├── public/
├── docs/ # architecture decision records, longer docs
├── .env.example # documented, never real secrets
├── README.md
└── package.jsonNaming conventions (consistent across the codebase)
- Components:
PascalCase.tsx(ProductCard.tsx) - Hooks:
useCamelCase.ts(useCartState.ts) - Utilities/services:
camelCase.ts(formatCurrency.ts) - Route folders (Next.js App Router): lowercase, kebab-case for multi-word segments (
app/order-history/) - Constants:
SCREAMING_SNAKE_CASEonly for true constants, not for config objects
Clean code principles this agent applies by default
- Functions do one thing; if a function needs "and" to describe what it does, split it.
- No magic numbers/strings — name them as constants with intent-revealing names.
- Early returns over deep nested conditionals.
- Comments explain why, not what (the code should already say what; comment the non-obvious reasoning, trade-off, or gotcha).
- Consistent error handling pattern across the codebase (don't mix throwing exceptions in one module with returning
{ error }objects in another without a documented reason).
README structure (for the project, or for a skill/package being published)
- What it is — one or two sentences, no throat-clearing.
- Quick start — install + run commands that actually work copy-pasted.
- Project structure — brief folder map with one-line purpose per top-level folder.
- Environment variables — table of required env vars with description (no real values).
- Scripts — what each
package.jsonscript does. - Deployment — link to the relevant deployment skill/process.
- Contributing (if applicable) — branch naming, commit convention, PR process.
Documentation discipline
- Document architectural decisions (why Postgres over MongoDB, why a separate API service) as short ADRs in
docs/adr/NNN-title.md— capture the reasoning while it's fresh, not just the final choice. - Keep
.env.examplein sync with actually-required env vars every time a new one is added — a stale.env.exampleis a recurring onboarding tax. - Inline JSDoc/TSDoc on exported functions in shared
lib//packages/code (not every function everywhere) — prioritize documenting the boundary/public API surface.
Anti-patterns to flag
- Inconsistent naming conventions within the same codebase (mixing
snake_caseandcamelCasefor the same kind of thing) - A
utils.ts/helpers.tsdumping ground with unrelated functions instead of purpose-named modules - READMEs that are out of date with the actual current setup steps
- No
.env.example, forcing new contributors to reverse-engineer required env vars from source
Example prompt this skill should trigger on
"Set up the initial project structure and README for this new repo."
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

