design-system-component-lifecycle
Skill9 starsChanged 23 days agoMITView on GitHub
Use when creating or extending a design system component, defining a reusable component contract (props/slots/events, tokens), enforcing token usage over hardcoded values, or avoiding duplicated one-off components - "add a component", "a component is needed for", "ajoute un composant", "il manque un composant pour", element/pattern repeated across pages.
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-feature-challengeSkill
- api-contract-versioningSkill
- bug-ticket-root-causeSkill
- bug-triage-structuredSkill
- ci-pipeline-orchestrationSkill
- commit-readiness-reviewSkill
- comprehensive-test-strategySkill
- database-schema-evolutionSkill
- ddd-backend-implementationSkill
- design-system-component-lifecycleSkill
- detection-sweepSkill
- domain-glossarySkill
- domain-modeling-designSkill
- frontend-fullstack-implementationSkill
- frontend-spec-call-site-auditSkill
- merge-request-reviewSkill
- performance-profilingSkill
- recording-decisionsSkill
- recurring-bug-root-causeSkill
- refactoring-shared-component-apiSkill
- validating-features-end-to-endSkill
- visual-regression-checkSkill
- writing-robust-testsSkill
- adversarial-feature-challengeSkill
- api-contract-versioningSkill
- audit-architectureSkill
- audit-ci-cdSkill
- audit-complianceSkill
- audit-industrialisationSkill
- audit-observabilitySkill
- audit-performance-frontendSkill
- audit-qualitySkill
- audit-reportSkill
- audit-securitySkill
- audit-testingSkill
- bug-ticket-root-causeSkill
- bug-triage-structuredSkill
- ci-pipeline-orchestrationSkill
- commit-readiness-reviewSkill
- comprehensive-test-strategySkill
- daily-workflow-optimizationSkill
- database-schema-evolutionSkill
- ddd-backend-implementationSkill
- detection-sweepSkill
- domain-glossarySkill
- domain-modeling-designSkill
- frontend-fullstack-implementationSkill
- frontend-spec-call-site-auditSkill
- merge-request-reviewSkill
- performance-profilingSkill
- production-incident-diagnosticSkill
- qa-session-intakeSkill
- recording-decisionsSkill
- recurring-bug-root-causeSkill
- refactoring-shared-component-apiSkill
- validating-features-end-to-endSkill
- visual-regression-checkSkill
- writing-robust-testsSkill
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 16
This skill: when: creating a new DS component, adding a variant, covering a repeated raw pattern/element with a reusable component, or …
- Very specific: line 17
refactoring-shared-component-api: instead if: evolving the API (props/slots/events) of an already-shared component - no creation decision - Very specific: line 93
No generic script: raw-pattern detection (grep) and the lint rule are stack-specific.
≈ “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
Design system component lifecycle - decision → contract → enforcement
If the current repo has an equivalent skill, it wins - it knows the component prefix, the lint rules, and the project's audit specs.
This skill vs. others
- This skill when: creating a new DS component, adding a variant, covering a repeated raw pattern/element with a reusable component, or enforcing token usage
refactoring-shared-component-apiinstead if: evolving the API (props/slots/events) of an already-shared component - no creation decisionfrontend-spec-call-site-auditupstream if: specifying a feature that consumes the DS without extending it
Principle
A DS component is not just a view file: it is a file + its enforcement. Without enforcement (doc, lint, test), the raw pattern stays allowed elsewhere and the component becomes decorative - you fall back into the duplicated one-offs it was meant to eliminate. The expected output: component created, all the call sites of the raw pattern migrated, and the raw pattern now detected as an error.
Context to gather (before acting)
- Inventory the existing DS: does a component already cover the need? Read the components index/README (atoms, molecules) and the token library before inventing anything
- External library: does a primitive from an existing third-party UI lib cover the need? Reuse before creating
- Atom or molecule? Atom = primitive/control with no business logic · molecule = composition of atoms. Follow the project's naming/folder convention (a prefix often serves as the lint exemption)
- Inventory ALL the call sites of the raw pattern (
grep -rn '<raw pattern>' <src>) - migrating them is part of the batch, not just the requesting call site - Lint / typecheck / test commands: read
package.json/ CI config
Protocol
- [ ] 1. Decision: justify that no existing component nor external primitive covers the need
- [ ] 2. Contract: props/slots/events, tokens, testid, state (label/hint/error/disabled…)
- [ ] 3. Implementation: component + migration of ALL raw call sites
- [ ] 4. Enforcement: doc + lint + tests synchronized (all 3 layers)1. Decision (in this order)
- Does an existing DS component cover the need (possibly via a variant)?
- Does a primitive from an external UI lib cover it?
- Atom or molecule? Place/name it per the project convention
- List every call site of the raw pattern to migrate
2. Component contract
- Two-way API aligned with the project convention (a single name for the value + its update event), not a mix of conventions
- State props aligned with a reference neighboring component (
label,hint,error,disabled,required,size) rather than reinvented - Tokens, no hardcoded values: colors/spacing/typography go through the DS tokens - a literal value (hex, px) bypasses the contract
testidas pass-through from the call site, never hardcoded in the component (two instances on the same page = collision)- Variant with no safe default → make it required rather than picking an arbitrary default
3. Implementation + migration
- Migrate each call site listed in step 1; grep of the raw pattern = 0 occurrences outside an explicit exemption
- Anti-orphan: the new component has ≥ 1 real usage
4. Enforcement (the heart of the skill) - 3 synchronized layers
| Layer | Goal | Action |
| Doc | discoverability | Add the component to the DS index/README (raw pattern → component mapping) |
| Lint | prevent recurrence | Remove the raw pattern from the exemptions and give it a dedicated error message; autofix only if the transformation is mechanically safe. Test the rule on a witness file then on the whole <src> |
| Test | runtime proof | Component unit test (testid, value, states) + visual snapshot if the render is non-trivial + runtime audit that fails if the raw pattern reappears (when the DOM signal is reliable) |
Templates
templates/component-contract.md- component contract to fill in (API, tokens, testid, enforcement)
Traps & rationalizations
| Excuse | Reality |
| "I'll just make a quick local component for this page" | That's a duplicated one-off. Inventory the DS first; if the need is reusable, it goes in the DS. |
| "This exact hex/px isn't in the tokens" | Either the token exists and must be used, or the token is missing and must be added - not a hardcoded value that escapes the contract. |
| "The component works, enforcement can come later" | Without lint/test, the raw pattern stays allowed elsewhere: the component is decorative, not a DS extension. |
| "The requesting call site is migrated, that's enough" | The other raw call sites remain debt; the grep of the pattern must drop to 0. |
Exit condition
- Decision documented: why neither an existing component nor an external primitive
- Contract defined: consistent two-way API, tokens (zero hardcoded value), testid as pass-through
- ALL call sites of the raw pattern migrated (grep = 0 outside an exemption)
- Anti-orphan: ≥ 1 real usage of the new component
- Enforcement: doc + lint (exemption removed) + test/audit - all 3 layers
- Lint + typecheck + tests run, output pasted - never "it should pass"
Tooling
- No generic script: raw-pattern detection (
grep) and the lint rule are stack-specific; tool them in the project skill.
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.

