fabrico-creating-instructions
Skill2 starsChanged 4 months agoMITView on GitHub
Creates Claude Code memory files (CLAUDE.md) for Claude Code. Covers the root project memory (CLAUDE.md) and nested, directory-scoped memory files, plus @import references. Provides templates and a decision framework for memory vs. skill placement. Use when creating, reviewing, or updating CLAUDE.md memory files.
In this repository42 other files it gives its agents.
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- fabrico-architecture-designingSkill
- fabrico-building-admin-dashboardsSkill
- fabrico-building-admin-resourcesSkill
- fabrico-building-lean-applicationsSkill
- fabrico-codebase-analysingSkill
- fabrico-code-reviewingSkill
- fabrico-creating-agentsSkill
- fabrico-creating-promptsSkill
- fabrico-creating-skillsSkill
- fabrico-designing-multi-cloud-architectureSkill
- fabrico-e2e-testingSkill
- fabrico-engineering-promptsSkill
- fabrico-ensuring-accessibilitySkill
- fabrico-implementation-gap-analysingSkill
- fabrico-implementing-backendSkill
- fabrico-implementing-ci-cdSkill
- fabrico-implementing-formsSkill
- fabrico-implementing-frontendSkill
- fabrico-implementing-kubernetesSkill
- fabrico-implementing-observabilitySkill
- fabrico-implementing-terraform-modulesSkill
- fabrico-improving-codebasesSkill
- fabrico-improving-uiSkill
- fabrico-jira-task-formattingSkill
- fabrico-managing-secretsSkill
- fabrico-optimizing-cloud-costSkill
- fabrico-optimizing-frontendSkill
- fabrico-planning-migrationSkill
- fabrico-preparing-applications-for-aiSkill
- fabrico-preparing-applications-for-saasSkill
- fabrico-reverse-engineering-specSkill
- fabrico-reviewing-frontendSkill
- fabrico-sql-and-database-understandingSkill
- fabrico-task-analysingSkill
- fabrico-task-extractingSkill
- fabrico-task-quality-reviewingSkill
- fabrico-technical-context-discoveringSkill
- fabrico-transcript-processingSkill
- fabrico-ui-verifyingSkill
- fabrico-writing-hooksSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 55
Keep memory short and self-contained — each rule should be a single, simple statement.
- Very specific: line 60
Prefer @import over duplication when several memory files need the same content.
- Distinctive: line 67
Use the checklist below and track progress with the TodoWrite tool:
- Very specific: line 126
Use the ./assets/claude-md.template.md and ./assets/nested-claude-md.template.md templates as starting points.
- Distinctive: line 131
Create the file at CLAUDE.md in the repository root.
- Distinctive: line 132
No frontmatter — it is plain Markdown.
- Distinctive: line 133
Use clear Markdown headers to organize sections.
- Very specific: line 134
Use the ./assets/claude-md.template.md template.
- Very specific: line 138
Create the file as CLAUDE.md inside the target subdirectory (e.g.
- Very specific: line 139
No frontmatter and no applyTo — placement determines scope.
- Distinctive: line 140
Keep it focused on conventions unique to that subtree.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Creating Instructions
Creates well-structured memory files for Claude Code. Covers the root project "constitution" (CLAUDE.md) and granular, directory-scoped conventions (nested CLAUDE.md files), with clear guidance on what belongs in memory versus skills.
Core Design Principles
<principles><instruction-types>
Two ways to encode project memory exist:Root project memory (CLAUDE.md at the repository root): A single file per repository — the "constitution." Defines architecture, directory structure, languages, frameworks, library versions, and fundamental project constraints. Loaded automatically by Claude Code for ALL interactions in the project. No frontmatter required (it is plain Markdown). This is the first file any developer or AI agent should read to understand the project. A personal, untracked CLAUDE.local.md can hold developer-specific overrides.
Nested / scoped memory (CLAUDE.md files in subdirectories): Multiple files per repository. Plain Markdown, no frontmatter and no applyTo glob — scope is determined by file location. A CLAUDE.md inside src/api/ applies to that subtree. Claude Code loads a nested CLAUDE.md when it works on files within that directory. These encode directory-specific or domain-specific coding conventions. You can also pull shared content into any CLAUDE.md with an @import reference (e.g. @./docs/conventions.md) instead of duplicating it.
| Aspect | Root project memory | Nested / scoped memory |
| File | CLAUDE.md (repo root) | CLAUDE.md (in a subdirectory) |
| Count per repo | Exactly one root file | Multiple, one per relevant subtree |
| Frontmatter | None (plain Markdown) | None (plain Markdown) |
| Applied when | Every Claude Code interaction in the project | Claude works on files within that directory subtree |
| Scoping mechanism | Whole project | File location (the directory it lives in and below) |
| Purpose | Project constitution — architecture, stack, fundamental rules | Scoped conventions — directory- or domain-specific rules |
There is no applyTo glob in Claude Code. Scope is by file location: a CLAUDE.md in a subdirectory applies to that subtree. For content that should be shared across several memory files, factor it into a separate Markdown file and pull it in with @import rather than copying it.
</instruction-types>
<instructions-vs-skills>
Memory files define **RULES** — declarative constraints that Claude Code must follow whenever they apply. They are project-specific, loaded automatically, and encode decisions for THIS repository.Skills define HOW — procedural workflows loaded on-demand to perform specific tasks. Skills are generic, reusable across projects, and encode expert knowledge.
| If the content is... | It belongs in... | Example |
| A project-specific rule or constraint | Memory (CLAUDE.md) | "Use date-fns instead of moment.js — moment.js is deprecated" |
| A step-by-step workflow for performing a task | Skill | "How to perform code review with severity categorization" |
| A coding convention for a specific directory/subtree | Memory (nested CLAUDE.md) | "React components use functional style with hooks" |
| A reusable process template across projects | Skill | "How to create a new API endpoint with validation" |
| An architectural decision for this repository | Memory (root CLAUDE.md) | "This is a monorepo with apps/ and packages/ structure" |
| Domain knowledge needed to execute a task | Skill | "E2E testing patterns with Playwright Page Objects" |
| Technology stack and version requirements | Memory (root CLAUDE.md) | "TypeScript 5.4, React 19, Next.js 15" |
| A coding standard that linters don't enforce | Memory (nested CLAUDE.md) | "Business logic must not import from UI layer" |
Mental model: Memory files are "the law" (always in force). Skills are "expert handbooks" (consulted for specific tasks).
</instructions-vs-skills>
<conciseness>
Memory files compete for the context window with conversation history, skills, and the actual task.- Keep memory short and self-contained — each rule should be a single, simple statement.
- Include the reasoning behind rules (e.g., "Use
date-fnsinstead ofmoment.js— moment.js is deprecated and increases bundle size"). - Show preferred and avoided patterns with concrete code examples — Claude responds more effectively to examples than abstract rules.
- Focus on non-obvious rules — skip conventions that standard linters/formatters already enforce.
- Whitespace between rules is ignored — format for legibility.
- Prefer
@importover duplication when several memory files need the same content.</conciseness>
</principles>Creation Process
Use the checklist below and track progress with the TodoWrite tool:
Creation progress:
- [ ] Step 1: Determine the memory type
- [ ] Step 2: Define the memory scope
- [ ] Step 3: Gather content for the memory file
- [ ] Step 4: Write the memory file
- [ ] Step 5: Validate the memory fileStep 1: Determine the memory type
Determine from context or ask the user. Use the AskUserQuestion tool to clarify the user's intent if it's ambiguous:
- Is this a NEW project needing its first root
CLAUDE.md? → Create root project memory. - Are there an existing root
CLAUDE.mdand directory-specific rules are needed? → Create a nestedCLAUDE.mdin the relevant subdirectory. - Unsure? → Check if a root
CLAUDE.mdexists. If not, recommend creating it first. The constitution comes before specific laws.
Step 2: Define the memory scope
For root project memory, the scope is always the entire project. Research by:
- Reading
package.json,pyproject.toml,Cargo.toml,go.mod, or equivalent to identify languages, frameworks, and versions. - Analyzing the directory structure to understand architecture (monorepo, feature-based, layered, etc.).
- Reading existing config files (
.eslintrc,tsconfig.json,.prettierrc, etc.) to understand tooling. - Checking for existing README or architectural documentation.
For nested / scoped memory, determine:
- Which directory subtree the rules apply to (this is where you place the
CLAUDE.md). - What specific conventions exist for that subtree.
- Whether an existing memory file already covers this scope (avoid placing overlapping rules in parent and child memory files).
Scoping reference (file location, not globs):
Place CLAUDE.md at... | Applies to |
| Repository root | The whole project (every interaction) |
src/ | All files under src/ |
src/components/ | All files under the components directory |
src/api/ | All API-related files in that subtree |
tests/ | The test subtree (collocated conventions, fixtures, etc.) |
For TypeScript-vs-test or other file-type distinctions that don't map cleanly to a directory, encode the rule as a clearly-worded statement in the nearest enclosing CLAUDE.md (e.g. "Test files (*.test.ts) use ..."). There is no glob-based targeting — use prose plus location.
Step 3: Gather content for the memory file
For root project memory (the constitution), research and document:
- Architecture — Overall architecture pattern (monorepo, microservices, modular monolith, etc.), directory structure, and responsibility of each top-level directory.
- Technology Stack — ALL languages, frameworks, and key libraries with specific versions. Critical — Claude Code needs exact versions to generate compatible code.
- Coding Conventions — Conventions NOT enforced by linters/formatters. Architectural rules (e.g., "business logic must not import from UI layer"), project-specific naming conventions, and agreed-upon patterns.
- Error Handling — The project's error handling strategy.
- Testing Strategy — Testing approach (unit, integration, E2E), frameworks, and key patterns.
- Development Workflow — How developers interact with the project. Document task runners (Make, Taskfile, npm scripts, Turbo), containerization (Docker Compose commands), and common developer commands (build, test, lint, migrate, seed). Claude Code should use the same scripts and tools a regular developer would — never raw commands when a script exists.
For nested / scoped memory, research and document:
- Specific conventions for the target directory subtree.
- Preferred patterns with code examples.
- Anti-patterns to avoid with code examples.
- Reasoning behind non-obvious rules.
Use the ./assets/claude-md.template.md and ./assets/nested-claude-md.template.md templates as starting points.
Step 4: Write the memory file
For root project memory:
- Create the file at
CLAUDE.mdin the repository root. - No frontmatter — it is plain Markdown.
- Use clear Markdown headers to organize sections.
- Use the
./assets/claude-md.template.mdtemplate. - Factor out content shared with other memory files into a separate Markdown file and reference it with
@import(e.g.@./docs/conventions.md).
For nested / scoped memory:
- Create the file as
CLAUDE.mdinside the target subdirectory (e.g.src/api/CLAUDE.md,src/components/CLAUDE.md). - No frontmatter and no
applyTo— placement determines scope. - Keep it focused on conventions unique to that subtree; do not repeat root-level rules.
- Use the
./assets/nested-claude-md.template.mdtemplate.
Memory mechanics reference:
| Mechanism | Description |
Root CLAUDE.md | Loaded for every interaction in the project. Plain Markdown, no frontmatter. |
Nested CLAUDE.md | Loaded when Claude works within that directory subtree. Scope = file location. |
@import | Pull shared Markdown into any memory file (e.g. @./docs/conventions.md) to avoid duplication. |
CLAUDE.local.md | Personal, untracked overrides for an individual developer (gitignored). |
Step 5: Validate the memory file
Validation:
- [ ] File is in the correct location (root `CLAUDE.md`, or `CLAUDE.md` inside the intended subdirectory)
- [ ] No frontmatter (memory files are plain Markdown — no YAML, no applyTo)
- [ ] Scope is correct — the file lives in the directory whose subtree the rules govern
- [ ] Rules are short and self-contained — each rule is a single statement
- [ ] Non-obvious rules include reasoning ("because...")
- [ ] Preferred/avoided patterns include concrete code examples
- [ ] Shared content is pulled in via @import rather than duplicated across memory files
- [ ] No duplication of rules already enforced by linters/formatters
- [ ] No procedural workflow content (that belongs in skills)
- [ ] No agent personality or behavior definitions (that belongs in a subagent, `.claude/agents/*.md`)
- [ ] No slash-command / workflow triggers (that belongs in a command, `.claude/commands/*.md`)
- [ ] Root file covers: architecture, stack with versions, key conventions
- [ ] Nested files live in the right subtree and do not repeat root-level rulesQuick Reference
Memory File Types
| Type | Location | Purpose | Loading |
| Root project memory | CLAUDE.md (repo root) | Project constitution | Always loaded for the project |
| Nested / scoped memory | CLAUDE.md (in a subdirectory) | Scoped conventions | Loaded when working in that subtree |
| Imported memory | Any Markdown referenced via @import | Shared content reused across memory files | Pulled in wherever it is imported |
| Personal memory | CLAUDE.local.md (repo root, gitignored) | Developer-specific overrides | Loaded locally for that developer only |
| User (global) memory | ~/.claude/CLAUDE.md | Cross-project personal defaults | Loaded for all projects on that machine |
Priority Order
Higher takes precedence on conflict:
- Nested / more-specific
CLAUDE.md(closest to the files being worked on) — highest - Root project
CLAUDE.md - User (global)
~/.claude/CLAUDE.md— lowest
Personal CLAUDE.local.md overrides apply on top of the project's tracked memory for the individual developer.
Connected Skills
fabrico-creating-agents- to ensure subagent files (.claude/agents/*.md) don't embed coding standards that belong in memoryfabrico-creating-skills- to understand the boundary between procedural knowledge (skills) and declarative rules (memory)fabrico-creating-prompts- to ensure slash commands (.claude/commands/*.md) reference memory rather than duplicating conventionsfabrico-technical-context-discovering- the complementary skill that discovers and reads existing memory filesfabrico-codebase-analysing- to analyze existing memory files and identify patterns to follow
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.

