Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Component Architecture

ASecurity

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.

46 stars
0 votes
0 copies
0 views
Added 9/22/2026
ai-agentsgonodetestingapi

Works with

cliapi

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add nahid-sparktales/agent-dispatcher --skill component-architecture --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Component Architecture?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Component Architecture
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nahid-sparktales-component-architecture/badge)](https://www.skillsdirectory.com/skills/nahid-sparktales-component-architecture)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: component-architecture
description: 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.
---

# 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

1. **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.
2. **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.
3. **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.
4. **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.
5. **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.
6. **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.
7. **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 one `variant`-style union over several booleans that can contradict each other.
8. **Reach for composition before configuration.** When a component needs to vary in a place, take
   `children` or 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.
9. **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.
10. **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.
11. **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.

Attribution

nahid-sparktalesnahid-sparktales
View sourceMore from nahid-sparktales →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1066601 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

686011 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

651 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →