component-architecture
Skill59 starsChanged 2 months agoMITView on GitHub
Decide where a component's boundaries go, where state lives, what its props should be, and whether to split it — using composition instead of configuration flags. Fires when adding a component to an existing tree, when a component has grown props or responsibilities, or when a review asks whether a structure will hold. Not for visual design decisions, not for styling systems, and not a licence to restructure code the task did not ask you to touch.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- yogvidwankhede/vishwakarmatheir own version, first seen Sep 26, 2026
- sanky369/vibe-building-skillstheir own version, first seen Jul 2, 2026
- param087/saas-ui-skillstheir own version, first seen Jun 6, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- sanky369/vibe-building-skills★ 30same name
- param087/saas-ui-skills★ 3same name
- yogvidwankhede/vishwakarma★ 1same 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 repository79 other files it gives its agents.
- agent-dispatcherSkill
- agent-designSkill
- agent-evalsSkill
- context-engineeringSkill
- llm-observabilitySkill
- mcp-designSkill
- memory-designSkill
- model-routingSkill
- prompt-engineeringSkill
- prompt-injection-defenseSkill
- retrieval-ragSkill
- structured-outputSkill
- tool-designSkill
- api-contract-verificationSkill
- api-designSkill
- authenticationSkill
- authorizationSkill
- background-jobsSkill
- cachingSkill
- idempotency-and-retriesSkill
- webhooksSkill
- database-migration-verificationSkill
- data-integritySkill
- data-pipelinesSkill
- data-qualitySkill
- migrationsSkill
- postgresSkill
- query-optimizationSkill
- schema-designSkill
- accessibilitySkill
- accessibility-verificationSkill
- design-systemsSkill
- design-to-codeSkill
- frontend-designSkill
- motion-designSkill
- responsive-designSkill
- ui-auditSkill
- ux-writingSkill
- ci-cdSkill
- deploymentSkill
- dockerSkill
- github-actionsSkill
- incident-responseSkill
- observabilitySkill
- release-verificationSkill
- rollbackSkill
- frontend-performanceSkill
- shadcn-uiSkill
- stack-detectionSkill
- tailwindSkill
- visual-verificationSkill
- competitive-analysisSkill
- copywritingSkill
- data-analysisSkill
- deep-researchSkill
- documentation-verificationSkill
- positioningSkill
- seoSkill
- source-evaluationSkill
- technical-writingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
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 23
State the component's one responsibility in a sentence: If the sentence needs "and", you have either two components or one component with a …
- Very specific: line 39
Prefer one variant-style union over several booleans that can contradict each other.
- Very specific: line 40
Reach for composition before configuration: When a component needs to vary in a place, take children or a slot rather than adding a flag.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Component architecture
Structure is decided by where change arrives, not by file length. A 300-line component with one reason to change is fine; a 40-line one that both fetches and renders is not.
When this fires
Adding a component to an existing tree, changing one whose props or responsibilities have grown, or reviewing whether a proposed structure will survive the next feature. It does not fire for styling-only edits or for copy changes.
Procedure
- Read the neighbours before designing. Open two or three components in the same directory. The project has already answered most of these questions — prop naming, where data is fetched, whether state lives in a store or in the tree. Matching an existing pattern beats importing a better one into one file.
- State the component's one responsibility in a sentence. If the sentence needs "and", you have either two components or one component with a helper. Write the sentence down; it is the boundary.
- Place each piece of state at the lowest node that reads it. Then move it up only when a second reader actually appears — not when you predict one. State owned above where it is read re-renders subtrees that do not care; state owned below its readers gets lifted in a panic later.
- Keep derived values derived. A value computable from existing state is not new state. Duplicating it creates two sources of truth and a synchronisation bug.
- Separate the data edge from the rendering. Fetching, subscriptions and effects belong at a route or container boundary; leaves take data as props. A leaf that fetches cannot be reused, previewed or tested without standing up its whole world.
- Respect the framework's own boundary where one exists — server vs client, island vs static. State, effects and event handlers force the interactive side, so push that boundary as far down the tree as it will go rather than marking a whole page interactive for one button.
- Design props as what, not how. A prop names a fact about the data or the situation
(
status,items,onSelect), not an instruction about rendering (shouldShowRedBorder). Prefer onevariant-style union over several booleans that can contradict each other. - Reach for composition before configuration. When a component needs to vary in a place, take
childrenor a slot rather than adding a flag. Three or four booleans that toggle regions is the signal: expose the regions as sub-components and let the caller arrange them. - Split on one of these triggers only — two independent reasons to change; a prop that is only read on one branch; a piece that a second caller genuinely needs; or the component cannot be exercised without mocking things unrelated to what it renders. Do not split for line count, and do not create an abstraction with a single caller.
- Before changing a shared component's API, find every caller and read them. A rename or a required-prop addition in shared code is a breaking change across the app — if the task did not ask for it, stop and ask rather than fanning the edit out.
- Check the result against the checklist, then verify it renders — structure that type-checks
can still mount wrong (see
browser-verification).
Checklist
- The component's responsibility fits one sentence without "and"
- Each state atom sits at the lowest node that reads it
- Nothing derivable is stored
- Data fetching sits at a container/route edge, not in a leaf
- The interactive boundary is as low in the tree as it goes
- No boolean prop combination can contradict another
- Varying regions are
children/slots, not flags - Every split has a named trigger; no single-caller abstraction was created
- Callers of any changed shared API were read, and breaking ones were raised
Failure handling
- A prop is drilled three or more levels — try composition first (pass the rendered element down), context second, a global store last. Reaching for the store first is how a local concern becomes an app-wide one.
- Everything re-renders on one keystroke — locate the state owner before optimising. Memoising around misplaced state hides the cause and adds a cache to keep correct.
- A component needs several unrelated mocks to render — that is the split trigger, not a testing problem.
- Two components look alike but change for different reasons — leave them duplicated. Merging them produces a component with a flag for every difference within two features.
- The existing pattern is genuinely bad — say so once, in one line, with what you would do instead. Do not refactor the surrounding tree inside an unrelated task.
Evidence to report
The responsibility sentence for each component you created or changed; where each piece of state now lives and why; props added or removed with the reason; each split and the trigger that forced it; what you deliberately left alone; and the callers you checked for any shared-API change. "Made it cleaner" is not evidence.
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.

