modify-feature
Skill1 starsChanged 58 days agoMITView on GitHub
Extend or refactor EXISTING feature code with discipline. Use when adding code to a feature that already ships (a new hook, component, endpoint, or section inside an existing module), when restructuring components without changing behavior (extract a hook, split a fat component, promote to shared, absorb duplication, migrate to current conventions), or when the user says "refactor", "extract", "move this to shared", "add X to the Y feature", "clean this component up". NOT for building a new feature from scratch (create-feature), shared plumbing (create-infrastructure), visual-only polish (refactoring-ui), bug fixes (systematic-debugging), or behavior changes (those are features — route to the pipeline).
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ThisIsSadeghi/KMPilottheir own version, first seen Aug 4, 2026
- ThisIsSadeghi/Loupetheir own version, first seen Jul 5, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ThisIsSadeghi/KMPilot★ 56same name
- ThisIsSadeghi/Loupe★ 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 repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- design-craft/CLAUDE.mdCLAUDE.md
- android-emulatorSkill
- audit-branchSkill
- brainstormSkill
- create-devtoolSkill
- create-featureSkill
- create-infrastructureSkill
- execute-tasksSkill
- finish-featureSkill
- frontend-testingSkill
- generate-feature-docSkill
- generate-prdSkill
- git-commitSkill
- ios-simulatorSkill
- 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
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
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 24
If a request mixes refactor + behavior change, split it: refactor first (this skill), behavior second (pipeline or Extend).
- Very specific: line 29
Load the relevant rules: Read the .claude/rules/ files matching what you'll touch (components → component-hook-separation, layout-ownership.
- Very specific: line 30
Reuse check: Before writing anything new, search for an existing solution: the project's ui root and its custom/, shared/, and sibling …
- Distinctive: line 44
Safety net before touching: Do the existing tests pin the current behavior of what you're restructuring?
- Distinctive: line 52
Execute surgically: Every changed line traces to the refactor goal (working-principles trace test).
- Very specific: line 64
Use AskUserQuestion to offer: commit via the git-commit skill (refactor commits stay separate from feature commits — refactor(scope): vs …
- Distinctive: line 68
Never mix refactor and behavior change in one diff.
- Distinctive: line 69
Never skip Phase 0 — editing unread code is how conventions drift.
- Distinctive: line 70
Never extend a shared component to fit one consumer — adapt the consumer.
≈ “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
Project config:
{app}is the project's new-code root from.claude/rules/project-structure.md; project values (package manager, commands, base branch, error surface) come fromdocs/agents/project-conventions.md. Resolve both before writing any file — never assume. If a needed file is missing, stop: "Run/setup-daher-skillsfirst — missing<file>."
Modify Feature
Two workflows over existing code: Extend (add code to a shipped feature) and Refactor (restructure without behavior change). Both share the same first and last phases.
Am I in the right skill?
| Situation | Route to |
| New feature/module from scratch | create-feature |
| Shared plumbing (provider, layout, i18n namespace) | create-infrastructure |
| Bug — something behaves wrong | systematic-debugging |
| Visual polish or design audit only | refactoring-ui |
| Behavior changes, new user-visible capability, or multi-feature impact | Pipeline: brainstorm / generate-prd |
| Add code inside an existing feature | This skill — Extend |
| Restructure existing code, zero behavior change | This skill — Refactor |
If a request mixes refactor + behavior change, split it: refactor first (this skill), behavior second (pipeline or Extend). Never both in one diff.
Phase 0 — Read First (both workflows, mandatory)
- Map the slice.
lsthe feature directory; Read every file you plan to touch, its co-located tests, and the feature barrel. Do not edit code you haven't read. - Load the relevant rules. Read the
.claude/rules/files matching what you'll touch (components → component-hook-separation, layout-ownership; hooks → tanstack-query; API → api-boundary, error-handling; anything → project-structure). Rules are the source of truth — never rely on memory of them. - Reuse check. Before writing anything new, search for an existing solution: the project's ui root and its
custom/,shared/, and sibling features. Use existing components as-is — if one almost fits, adapt the consumer, don't extend the shared component. - Consumer map. Grep the call sites of every export you plan to change (repo-wide, not just the feature). This list is your blast radius — you'll re-check it in the final phase.
Workflow A — Extend
- Placement first. Decide where the new piece lives per
project-structure.md: inside the sub-feature that uses it, at the parent feature's shared level (hooks/,domain/,api/) if 2+ sub-features need it, or promoted toshared//ui/custom/only when it's genuinely cross-feature. - Follow the neighboring pattern. The new code should look like the file next to it — same naming, same hook/component split, same test style. Consistency with the local slice beats the ideal template. When the neighbor predates a current rule, follow the rule and note the drift; don't copy the outdated pattern.
- New API surface → the boundary applies. A new endpoint means dto schema + mapper + hand-authored domain type per
api-boundary.md— even inside a feature that predates the pattern. - Write the code + its tests (co-located; two-level factories per the
frontend-testingskill if the feature has them). - Go to Final Phase.
Workflow B — Refactor
- Classify honestly. Will ANY user-visible behavior change (rendered output, requests, navigation, timing)? Yes → this is not a refactor; stop and route to the pipeline. The test for later: zero assertion changes in existing tests.
- Safety net before touching. Do the existing tests pin the current behavior of what you're restructuring? If coverage is thin, write characterization tests FIRST and watch them pass against the current code — a refactor without a net is a gamble, not a refactor.
- Use the standard moves (each links to its rule):
- Extract hook from component → component-hook-separation.md (component becomes a pure renderer)
- Split a fat component → layout-ownership.md (children render flush; the parent owns spacing)
- Promote to
shared/orui/custom/→ project-structure placement rules; move, update every consumer from the Phase 0 map, delete the original - Absorb duplication → react-clean-architecture extraction triggers (3+ occurrences, or 2 with a third in sight — not before)
- Migrate legacy code toward
{app}patterns → project-structure.md scope notes (only when already touching that code) - Feature predates the API boundary → migrate that endpoint's slice to dto/mapper per api-boundary.md's migration note (migrate one endpoint first and use it as the reference for the rest)
- Execute surgically. Every changed line traces to the refactor goal (working-principles trace test). No drive-by improvements, no comment rewrites, no formatting churn — mention smells you find, don't fix them here.
- Go to Final Phase.
Final Phase (both workflows)
- Consumer sweep. Re-grep the Phase 0 consumer map: every call site compiles against the new shape, imports updated, no orphaned exports left behind.
- If a Zustand action, a store-driven effect, or a query invalidation changed, run the click-path audit (a reference of the
systematic-debuggingskill): map which keys the action sets and which it resets that it does not own, then trace every handler on the affected screen. A refactor that moves state is where "the wizard jumps back a step" bugs are born, and the test suite rarely pins them.
- If a Zustand action, a store-driven effect, or a query invalidation changed, run the click-path audit (a reference of the
- Fresh verification (verification-before-completion.md):
pnpm vitest run {feature-dir}— if the glob matches 0 test files, that's a FAIL, not a pass — andpnpm build. For Refactor: the suite must be green with zero assertion changes; an assertion you "had to" change means behavior changed — reclassify and tell the user. - Report honestly: what changed, what was reused vs created, any drift/smells noticed but not fixed.
Next Step
Use AskUserQuestion to offer: commit via the git-commit skill (refactor commits stay separate from feature commits — refactor(scope): vs feat(scope):), continue with another modification, or run refactoring-ui (Audit) if components changed visually.
Rules
- Never mix refactor and behavior change in one diff.
- Never skip Phase 0 — editing unread code is how conventions drift.
- Never extend a shared component to fit one consumer — adapt the consumer.
- Characterization tests are written BEFORE the refactor, never after.
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.

