agentleFS
luigi-dvluigi-dv/react-ts-vite/.claude/skills/scaffold-feature/SKILL.md

scaffold-feature

Skill1 starsChanged 27 days agoMITView on GitHub

Plan and create all the files a new business feature needs in the active architecture (types/entities, service or use case, hook, UI, page, route, navigation, tests). Use when asked to "add a feature", "implement <capability>" or scaffold a vertical slice. Accepts the feature name as $ARGUMENTS.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 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.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep the public surface tiny: export only what the page needs.

    line 95

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Scaffold a feature

Feature to build: $ARGUMENTS (ask for a one-line description if it is not obvious).

0. Read the shape

cat rtv.config.json → architecture. The file plan below depends on it. Aliases are listed in .agent/rules/architecture.md.

1. File plan per architecture

Replace invoices / Invoice with the feature name.

classic

src/types/invoice.ts                 Invoice type(s)
src/services/invoices.ts             listInvoices(), createInvoice() — fetch wrappers
src/hooks/useInvoices.ts             loading/error/data state over the service
src/components/InvoiceTable/index.tsx   presentational
src/pages/Invoices/index.tsx         composes table + hook, default export, h1
__tests__/pages/Invoices.test.tsx    smoke + one behaviour test

feature (vertical slice)

src/features/invoices/
├── index.ts                 public API: export { InvoiceList } ; export type { Invoice }
├── types.ts
├── api/invoices.ts
├── hooks/useInvoices.ts
└── components/InvoiceList.tsx
src/pages/Invoices/index.tsx   imports from '@features/invoices' only

fsd

src/entities/invoice/{index.ts, model/types.ts, ui/InvoiceCard.tsx}
src/features/create-invoice/{index.ts, ui/CreateInvoiceForm.tsx, model/useCreateInvoice.ts, api/createInvoice.ts}
src/widgets/invoice-list/{index.ts, ui/InvoiceList.tsx}
src/pages/invoices/{index.ts, ui/InvoicesPage.tsx}

Each slice imports only lower layers and exposes index.ts.

clean

src/domain/entities/Invoice.ts                       entity + invariants (pure TS)
src/domain/repositories/InvoiceRepository.ts         interface (port)
src/application/use-cases/ListInvoices.ts            uses the port
src/infrastructure/repositories/HttpInvoiceRepository.ts  implements the port
src/app/container.ts                                 wires HttpInvoiceRepository into ListInvoices
src/presentation/hooks/useInvoices.ts                calls the use case from context/container
src/presentation/components/InvoiceTable/index.tsx
src/presentation/pages/Invoices/index.tsx

Presentation never imports infrastructure; the container (src/app) does.

atomic

src/types/invoice.ts · src/services/invoices.ts · src/hooks/useInvoices.ts
src/components/atoms/Badge/index.tsx
src/components/molecules/InvoiceRow/index.tsx
src/components/organisms/InvoiceTable/index.tsx
src/components/templates/ListPageTemplate/index.tsx
src/pages/Invoices/index.tsx

2. Build order

  1. Types / entity (+ unit test for invariants when logic exists).
  2. Service / use case / repository (+ test with a mocked fetch).
  3. Hook (+ test through a component or renderHook).
  4. Presentational components (+ behaviour test).
  5. Page with h1, default export; route in src/App.tsx; nav entry in @const/navigation; smoke test in __tests__/pages/.
  6. npm run arch:check after each layer; npm run check at the end; CHANGELOG.md entry.

3. Conventions that apply

  • Services return typed results and throw typed errors; hooks expose { data, error, isLoading, refetch }.
  • Mock data lives in the test, not in src/ (except deliberate fixtures under @const).
  • Keep the public surface tiny: export only what the page needs.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.