agentleFS
MohammadShehadehMohammadShehadeh/agent-skills/skills/feature/SKILL.md

feature

Skill2 starsChanged 14 days agoMITView on GitHub

Plan and build a feature the agent-craft way — user journey and business rules first, a flat component tree, an explicit state and communication map, then a colocated feature folder with direct imports, and a shared package only when 2+ consumers exist. Use whenever the user asks to add a feature, module, domain area, or "section of the app", or to add hooks, actions, or services to an existing one, and whenever a task would create a new folder under app/, features/, or packages/, even if they don't say "feature".

71 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use bug, bugfix and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • paulocsbSkill

    bug

    Investigation playbook for fixing a bug. Walks through 5 phases: reproduce → isolate → root cause → propose fix → validate. Forces concrete reasoning with code reads, log inspection, and git blame instead of pattern-matching guesses. Use for any non-trivial defect.

    Also in 8 projects that use this

  • team-attentionSkill

    bugfix

    Root cause based one-shot bug fix. debugger diagnosis → requirements.md generation → /execute. /bugfix "error description" Full investigation pipeline: debugger + gap-analyzer + standard verify. QA suggestion after successful fix.

    Also in 7 projects that use this

  • codebycoreySkill

    adopt

    Adopt an existing plan from conversation context into delta-spec format. Use when importing a plan, adopting planning that already happened, capturing plan mode output, or bringing in prior design work.

    Also in 4 projects that use this

  • Google CloudSkill

    fix

    Plan a remediation strategy after a test failure.

    Also in 10 projects that use this

  • marylinSkill

    recover

    Recover work from a crashed or interrupted session. Use when Claude crashed mid-task, after an unexpected exit, when you see 'stale sessions detected', or when you lost context and need to figure out what was happening.

    Also in 3 projects that use this

  • aegiswizardSkill

    context

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 65 edited versions we read keep these.

  • 4

    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:

    Search for what exists: similar features, services, hooks, primitives.

    line 22
  2. Distinctive:

    Ask about anything ambiguous.

    line 23
  3. Distinctive:

    Every journey step from step 1 works, including loading, empty, and failure.

    line 91
  4. Distinctive:

    Every changed line traces to the plan.

    line 96

“Common” is measured: kept by at least 6 in 10 of the 65 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

agent-craft Feature

How a feature is planned, where it lives, and how its folder is laid out. Load agent-craft:conventions for the rules inside each file.

Gates

  • No code before the plan (steps 1–3) is confirmed.
  • No files before the home (step 4) is answered from the repo. A second layout pattern in one repo costs every reader.
  • No package for a single consumer.
  • No types/, constants/, or lib/ file with a single consumer. It stays in the file that uses it.

1. Journey and business rules

  • Walk the user journey step by step: what the user sees, does, and expects at each point, including loading, empty, and failure. "A Gmail-like inbox" becomes: scan the list → open a message → read → reply, archive, or delete → back to the list.
  • Pull out the business rules behind each step (what marks a message read, who can archive, what orders the list). These are pure decisions and get tests.
  • Restate both as verifiable targets: behaviors, inputs and outputs, error keys.
  • Search for what exists: similar features, services, hooks, primitives. Extend before duplicating; duplicate a small pure thing rather than reach into another feature's files.
  • Ask about anything ambiguous.

2. Component tree

Outline top-down, build bottom-up:

  • Pages: one per journey destination (/inbox, /inbox/[messageId]), thin server components.
  • Sections: one per journey step or screen region (MessageList, ThreadView, ComposePanel).
  • Primitives: the existing UI layer first; a new one only when nothing fits.

Page → section → primitive, nothing in between that only forwards props. Name every unit by business meaning (MessageRow, not ListItem2) and note what data each renders.

3. State and communication

For every piece of state, write down:

  • Owner: the lowest common owner of what reads it. Selected message → the URL param; a row's hover → the row.
  • Server or client: server data is fetched where it's used or held in the query cache, never copied into useState.
  • Communication: parent → child by props, child → parent by on* callbacks, siblings through their shared owner, cross-page through the URL, a subtree-wide concern through one context. Write the chains out: MessageRow → onArchive → MessageList → archiveMessage action.
  • Optimistic or not: reversible, low-stakes writes (archive, star) are optimistic; destructive or server-decided ones wait.

Present steps 1–3 as the plan, with the files that change and an out-of-scope list. Wait for confirmation.

4. Home

SituationHome
Default: one app uses itThe route folder under app/, or features/<name>/, whichever the repo already uses
Two or more apps use it, or it ships on its own versionA package

5. Folder layout

<feature>/
  components/   # JSX
  hooks/        # use-*.ts, only when two components share one
  actions/      # 'use server' mutations
  services/     # reads and shared I/O
  lib/          # schemas and decisions shared by 2+ files, or that need their own tests
  • One level deep. A directory exists only when a file lives in it.
  • Types, constants, and error keys live in the file that uses or produces them. A types/ or constants/ directory appears only for things two files share.
  • Consumers import the defining file through the repo's alias (@/features/upload/components/dropzone). There is no index.ts and no "public" layer.
  • Code another feature needs moves to a shared top-level folder; a feature never imports another feature's internals.
  • Two known cases are a switch or a lookup map. A plugin-style registry only when outside code must register new cases.

6. Package — only when extracted

Same layout, plus per-file wildcard exports so nothing needs a barrel:

{
  "name": "@scope/upload",
  "type": "module",
  "sideEffects": false,
  "exports": {
    "./components/*": { "types": "./dist/components/*.d.ts", "default": "./src/components/*.tsx" },
    "./hooks/*": { "types": "./dist/hooks/*.d.ts", "default": "./src/hooks/*.ts" },
    "./actions/*": { "types": "./dist/actions/*.d.ts", "default": "./src/actions/*.ts" }
  }
}

A wildcard resolves one extension per directory: JSX only in components/, everything else .ts. Follow the repo's workspace and naming conventions; don't introduce workspaces into a single-package repo.

7. Verify

  • Every journey step from step 1 works, including loading, empty, and failure.
  • rg --files <feature> | rg "index\.ts$" returns nothing.
  • rg "export default" <feature> matches only Next.js file conventions.
  • Pick any file in the feature: it can be understood by opening at most two other files.
  • The repo's typecheck, lint, and test scripts pass, including tests for the business rules from step 1.
  • Every changed line traces to the plan.

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.