extract-and-relocate-angular-component-feature
Skill29 starsChanged 2 months agoMITView on GitHub
Extract a UI feature (buttons, forms, state, methods) from one Angular component into a new self-contained component, then wire it into the destination component. Use when moving a feature between components in an Angular monorepo to eliminate duplication and improve encapsulation.
In this repository25 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- agent-lanesSkill
- angular-3d-scene-crafterSkill
- angular-frontend-patternsSkill
- angular-gsap-animation-crafterSkill
- ddd-architectureSkill
- execute-phase-gated-taskSkill
- fleet-orchestrationSkill
- humanize-librarySkill
- impeccableSkill
- nestjs-backend-patternsSkill
- nestjs-deploymentSkill
- nx-workspace-architectSkill
- orchestrationSkill
- ptah-cli-usageSkill
- resilient-nestjs-patternsSkill
- saas-platform-patternsSkill
- saas-workspace-initializerSkill
- skill-creatorSkill
- technical-content-writerSkill
- tribunalSkill
- typesafe-aiSkill
- ui-ux-designerSkill
- video-showcaseSkill
- webhook-architectureSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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
- Very specific: line 16
All state signals (signal(), computed()) used only by this feature
- Distinctive: line 17
All event handler methods scoped to the feature
- Distinctive: line 23
Import the extracted component
- Very specific: line 24
Add it to the imports array
- Distinctive: line 32
All state and methods tied solely to the feature
- Distinctive: line 33
Keep read-only guards or banners that affect the input flow
- Distinctive: line 37
Shared dependencies: If the feature's state is used elsewhere in the source, leave it there.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Steps
- Identify source and destination components — Locate the component currently rendering the feature and where it needs to move. Review both templates and identify the feature block (template markup + related state + event handlers).
- Clarify scope and context — If the destination renders only in certain contexts (e.g., grid mode vs. detail panel), ask whether the feature should follow the destination's visibility or render in both. This prevents silent regressions.
- Create a new self-contained component — In the same library, create a new component file with:
- Descriptive kebab-case name (e.g.,
send-message.component.ts) @Input()properties for required data (e.g.,tabId,sessionId)@Output()event emitters for parent-state changes (instead of injecting parent services)- All state signals (
signal(),computed()) used only by this feature - All event handler methods scoped to the feature
- Template markup copied from the source
- Descriptive kebab-case name (e.g.,
- Export from the library barrel — Add the new component to the library's
index.tsso it's importable by other libraries. - Wire into the destination component — In the destination:
- Import the extracted component
- Add it to the
importsarray - Render it in the template at the intended location
- Bind required inputs using bracket notation
- Subscribe to outputs if the feature emits state changes
- Clean the source component — Remove:
- The feature's template block (HTML)
- Imports specific only to that feature
- All state and methods tied solely to the feature
- Keep read-only guards or banners that affect the input flow
Gotchas
- Shared dependencies: If the feature's state is used elsewhere in the source, leave it there; extract only isolated features.
- Portability via outputs: Emit parent-state changes via
@Output()rather than injecting the parent service — keeps the component reusable. - Barrel exports are critical: Omit the barrel export and consumers won't find the component.
- Context changes cause regressions: Silent visibility changes (feature hidden in one mode but rendered in another) are easy to miss—always clarify.
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.

