agentleFS
auth-02auth-02/skills/stacked/SKILL.md

stacked

Skill1 starsChanged 5 months agoMITView on GitHub

Decompose LARGE, complex, or risky changes into a stack of small, dependent, independently reviewable units. Use only when the change is genuinely big: multiple architectural layers with functionally distinct concerns (models + storage + logic + API + UI), or a diff too large to review as one unit. Trigger on "stacked" / "stacked PRs" / "stack this" / how to break down a large change — or when a "build X" / "refactor W" request is clearly multi-layer and large. Do NOT use for small or moderate changes: bug fixes, tweaks, config, single-file or single-layer changes belong on ONE branch as ONE change — a stack of tiny branches adds overhead without value.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    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:

    Default to a single branch, single change for:

    line 23
  2. Distinctive:

    Prefer a stack of small changes over one massive change — and prefer one plain change over an unnecessary stack.

    line 36
  3. Distinctive:

    Before writing any code:

    line 54
  4. Distinctive:

    Not every feature requires every layer.

    line 72
  5. Distinctive:

    If a reviewer must answer multiple unrelated questions, the change is too large.

    line 144
  6. Distinctive:

    When uncertain whether the change is big enough to warrant a stack: don't stack it — ship it as one change.

    line 158
  7. Distinctive:

    When proposing a stack, present it clearly:

    line 166

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

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

Stacked

Decompose work into a stack of small, dependent, reviewable changes. Each change has a single responsibility and builds on the one below it.


When to Use

Stack only when all of these hold:

  • The change is large — too big to review comfortably as a single unit
  • It spans multiple architectural layers with functionally distinct concerns
  • Each layer would carry substantial, self-contained work worth its own review

When NOT to Use

Default to a single branch, single change for:

  • Bug fixes, tweaks, styling adjustments, config or copy changes
  • Single-file or single-layer changes, however "multi-step" the edit feels
  • Small features a reviewer can absorb in one sitting
  • Related small changes — batch them into one coherent change rather than one branch each

A stack of tiny branches is worse than one clear change: it multiplies review, CI, and merge overhead without improving reviewability. The size of the change decides, not the number of steps it took to write.


Core Principle

Prefer a stack of small changes over one massive change — and prefer one plain change over an unnecessary stack. Stacking is a tool for taming size, not a default workflow.

Small Change   ← top (depends on everything below)
    ↑
Small Change
    ↑
Small Change
    ↑
Small Change   ← bottom (no dependencies)

Implement from the bottom up. Review from the bottom up.


Decomposition Strategy

Before writing any code:

  1. Understand the complete scope
  2. Identify architectural boundaries
  3. Separate concerns
  4. Build a proposed stack
  5. Validate each layer has a single responsibility

Think in terms of:

  • Data structures — types, models, schemas
  • Persistence — storage, migrations, indexes
  • Domain logic — business rules, transformations
  • Tools / Services — utilities, clients, adapters
  • Workflows — orchestration, pipelines, agents
  • API — interfaces, contracts, endpoints
  • UI — presentation, interaction

Not every feature requires every layer.


Preferred Layering Order

Types / Models
      ↓
  Persistence
      ↓
 Domain Logic
      ↓
Tools / Services
      ↓
  Workflows
      ↓
     API
      ↓
      UI

Higher layers depend on lower layers. Lower layers must not depend on higher layers.


Naming

Name each change by capability and responsibility — not sequence.

Good:

search/indexing
search/retrieval
search/ranking
search/api

doc-parser/core
doc-parser/chunking
doc-parser/indexing
doc-parser/workflow

chat/session-model
chat/history-store
chat/context-builder
chat/agent

Avoid:

part-1
part-2
final
misc
changes

Names should explain what a change does without requiring additional context.


Reviewability Rule

Each change should answer a single question:

Does [this specific thing] look correct?

Examples:

  • "Does the indexing model look correct?"
  • "Does the retrieval implementation look correct?"
  • "Does the workflow orchestration look correct?"

If a reviewer must answer multiple unrelated questions, the change is too large. Split it.


Agent Behavior

  1. Plan the full stack first — propose it before writing any code
  2. Explain the proposed stack — show names, dependencies, and responsibilities
  3. Implement bottom-up — start with the lowest-dependency layer
  4. Keep responsibilities isolated — no mixing of architectural layers within a change
  5. Avoid unrelated refactors — scope each change tightly
  6. Prefer incremental progress — don't bundle work to seem efficient
  7. Write into the manifest — when a manifest exists for this task (tasks/<slug>/manifest.md), write the stack into its ## Stack section rather than presenting it only in chat. The manifest is the canonical record; chat is ephemeral. Update layer Status cells as PRs open and merge.

When uncertain whether the change is big enough to warrant a stack: don't stack it — ship it as one change. Only once you're inside a genuinely large stack and uncertain whether a layer is doing two jobs: split that layer.

Sizing floor: never create a layer that a reviewer would read in under a couple of minutes and think "why is this its own PR?" Merge such fragments into the adjacent layer they belong to.


Output Format

When proposing a stack, present it clearly:

feature-name/layer-one       ← implement first
      ↑
feature-name/layer-two
      ↑
feature-name/layer-three
      ↑
feature-name/layer-four      ← implement last

For each layer, briefly state:

  • What it does (one sentence)
  • What it depends on (prior layers, if any)
  • Why it's its own change (the single reviewable question)

Example

User request: Build a document intelligence pipeline that can parse, chunk, index, and search documents.

Proposed stack:

doc-intelligence/models          ← types and schemas
        ↑
doc-intelligence/parser          ← raw document ingestion
        ↑
doc-intelligence/chunking        ← splitting and segmentation logic
        ↑
doc-intelligence/indexing        ← storage and index construction
        ↑
doc-intelligence/search          ← retrieval and ranking
        ↑
doc-intelligence/workflow        ← end-to-end orchestration

Each layer has one job. Each layer can be reviewed independently. The story is clear from bottom to top.


Success Criteria

A stack is successful when:

  • Each change has one responsibility
  • Dependencies are obvious from the names and order
  • Changes are independently reviewable
  • The implementation story is clear from bottom to top
  • Testing can happen incrementally
  • Merging can happen incrementally
  • A reviewer can understand the full stack without confusion

Worked example (in examples/)

examples/notifications-system.md is a worked example showing how a complex feature — an in-app notifications system spanning schema, storage, delivery, API, and UI — decomposes into one tight bottom-up stack. Only the Stack section is shown: each layer's responsibility, its dependency on the layer below, the single reviewable question it answers, and its status. Note how even a large, multi-concern feature reduces to a short ladder where each layer is independently reviewable and nothing above can be built until the layer below it is tested.

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.

Reviews can't be read right now.

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.