create-infrastructure
Skill1 starsChanged 58 days agoMITView on GitHub
Scaffold shared infrastructure — providers, hooks, layout components, i18n, config/theme. Use when the project builds reusable plumbing in shared/, or when user says "scaffold shared", "create provider", "setup layout". NOT for domain features with entities and endpoints (create-feature) or extending existing shared code (modify-feature).
1 other project uses a version of this.
Adopted by
Most recently taken up by
- harness/harness-skillstheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- harness/harness-skills★ 127same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- design-craft/CLAUDE.mdCLAUDE.md
- android-emulatorSkill
- audit-branchSkill
- brainstormSkill
- create-devtoolSkill
- create-featureSkill
- execute-tasksSkill
- finish-featureSkill
- frontend-testingSkill
- generate-feature-docSkill
- generate-prdSkill
- git-commitSkill
- ios-simulatorSkill
- modify-featureSkill
- pipeline-helpSkill
- plan-implementationSkill
- prd-clarifierSkill
- prd-to-uxSkill
- prototypeSkill
- react-clean-architectureSkill
- receiving-code-reviewSkill
- refactoring-uiSkill
- setup-daher-skillsSkill
- systematic-debuggingSkill
- test-mobile-appSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Related: create-feature (domain features), plan-implementation (upstream planning), react-clean-architecture (architecture rationale), …
- Very specific: line 39
All paths relative to src/ unless noted otherwise.
- Distinctive: line 102
Every provider follows: context + provider component + consumer hook + guard.
- Very specific: line 104
Create context with createContext<T | null>(null)
- Distinctive: line 107
Never put provider logic in components — provider is pure context, logic lives in hooks
- Distinctive: line 133
Always create both EN and ES files
- Very specific: line 137
All routes come from the centralized links object, never hardcoded.
≈ “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
Create Infrastructure
Scaffold shared infrastructure that lives in the shared root, public/, or the project root. Covers providers, hooks, layout components, i18n translations, config/theme setup, and shared utilities.
All shared/ and ui/ paths below resolve against the roots defined in the project's .claude/rules/project-structure.md.
For domain features with entities, API endpoints, and CRUD operations, use create-feature instead.
Related: create-feature (domain features), plan-implementation (upstream planning), react-clean-architecture (architecture rationale), frontend-testing (post-scaffold tests), generate-feature-doc (post-implementation docs).
Conventions live in the project's .claude/rules/ (component/hook separation, error handling, centralized links, colors, layout ownership) — this skill carries only the deliverable catalog, scaffold order, and templates. Small deltas not covered by the rules: references/shared-conventions.md.
Before You Begin
Gather from the user (or extract from the implementation plan):
- Project name (descriptive): e.g.,
app-layout,theme-setup,auth-infrastructure - Deliverables list — each deliverable needs: name, type (from catalog below), target file path, dependencies, acceptance criteria
Deliverable Type Catalog
| Type | Location | Example |
| Provider | shared/providers/{name}-provider.tsx | auth-provider.tsx |
| Hook (truly shared) | shared/hooks/use-{name}.ts | use-debounce.ts |
| Layout component | shared/layouts/{module}/components/{component}.tsx | navbar/components/navbar.tsx |
| Layout hook | shared/layouts/{module}/hooks/use-{name}.ts | navbar/hooks/use-navbar-items.ts |
| Layout barrel | shared/layouts/{module}/index.ts | navbar/index.ts |
| i18n namespace | public/locales/{locale}/{namespace}.json | en/app-layout.json |
| Shared utility | shared/{module}/index.ts | shared/links/index.ts |
| Config/Foundation | project root or src/styles/ | globals.css, components.json |
| Test page | pages/{page-name}.tsx | reservation-details-v2/[id].tsx |
All paths relative to src/ unless noted otherwise.
Layout shells are not infra deliverables. A layout shell that assembles building blocks for a specific page belongs in the feature's
components/folder (e.g.,features/reservation-details/components/reservation-detail-layout.tsx), not inshared/layouts/.
Infrastructure Directory Structure
src/
shared/
providers/
{name}-provider.tsx # Context + Provider + useX hook
index.ts
hooks/
use-{name}.ts # Truly shared hooks (used across multiple components)
index.ts
layouts/
{module}/ # One folder per layout module
components/ # REQUIRED - all UI rendering lives here
{component}.tsx # Pure renderer (imports from ../hooks/)
hooks/ # REQUIRED - all logic lives here
use-{component}.ts # Component-specific hook (required)
index.ts # Barrel: exports components + hooks
index.ts # Re-exports from all module folders
links/
index.ts # Centralized routes + buildUrl
utils/
index.ts # Shared helpers
features/
{feature}/
components/
{feature}-layout.tsx # Feature-specific layout shell (NOT in shared/layouts)
ui/
*.tsx # shadcn/ui components (installed via CLI)
public/
locales/
en/{namespace}.json
es/{namespace}.json
src/styles/
globals.css # Theme + CSS variablesImplementation Checklist
Infrastructure: {project-name}
[ ] 1. Foundation — theme, config files, directory structure, dependency installs
[ ] 2. Shared utilities — centralized links, helpers
[ ] 3. Providers — context + provider + hook per provider
[ ] 4. i18n translations — EN/ES JSON files per namespace
[ ] 5. Hooks — shared hooks (may depend on providers, i18n, links)
[ ] 6. shadcn installs — {pm} dlx shadcn@latest add {components} (project package manager)
[ ] 7. Layout components — UI building blocks (may depend on hooks + shadcn)
[ ] 8. Layout shells — compose layout components
[ ] 9. Test page — proof of concept wiring everything together
[ ] 10. Barrel exports — index.ts for each shared moduleKey Conventions
Provider Pattern
Every provider follows: context + provider component + consumer hook + guard.
- Create context with
createContext<T | null>(null) - Export
{Name}Providercomponent that wraps children with context - Export
use{Name}hook that throws if used outside provider - Never put provider logic in components — provider is pure context, logic lives in hooks
Layout Module Pattern
Each layout building block lives in its own module folder with mandatory components/ and hooks/ subdirectories:
shared/layouts/{module}/
components/
{component}.tsx # UI rendering ONLY (imports from ../hooks/)
hooks/
use-{component}.ts # ALL logic lives here (required)
index.ts # Barrel: re-exports components + hooksA module can contain multiple related components (e.g., navbar/components/navbar.tsx and navbar/components/language-selector.tsx), each with a corresponding hook in hooks/.
Layout Shell Pattern
A layout shell composes shared building blocks for a specific feature page. It belongs in features/{feature}/components/{feature}-layout.tsx, not in shared/layouts/.
i18n Pattern
- One JSON file per locale per namespace in
public/locales/{locale}/{namespace}.json - Keys scoped by section:
navbar.bookings,footer.home,backButton.back(nested objects, not flat dot-notation) - Consumed via
useTranslation('{namespace}')fromnext-i18next— only inside hooks; components receive already-translated strings (seecomponent-hook-separation.md) - Always create both EN and ES files
Centralized Links
All routes come from the centralized links object, never hardcoded. See centralized-links.md in the project's .claude/rules/.
Infrastructure-Specific Anti-Patterns
- Don't skip the hook — every layout component MUST have a corresponding
use-{component}.tshook - Don't skip the provider guard —
useXmust throw outside<XProvider> - Don't dump layout components flat in
shared/layouts/— each building block gets its own named subfolder withcomponents/andhooks/directories - Don't put component files at the module root — component
.tsxfiles go in{module}/components/, never directly in{module}/ - Don't build feature-specific layout shells in
shared/layouts/— compose shared building blocks inside the feature'scomponents/folder - Don't put component-specific hooks in
shared/hooks/— if a hook is only used by one layout component, it lives inshared/layouts/{component-name}/hooks/
General anti-patterns (logic in components, hardcoded routes/colors, legacy imports, etc.) are covered by the project's .claude/rules/.
Code Templates
For complete code templates of each infrastructure deliverable type, read references/templates.md.
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.

