agentleFS
AgentiveStackAgentiveStack/skills/architect/SKILL.md

architect

Skill72 starsChanged 7 months agoMITView on GitHub

Surface architectural friction in the codebase and design better module interfaces. Uses parallel sub-agents to explore radically different interface designs. Based on "deep modules" philosophy — small interfaces hiding significant complexity. Use when code feels tangled, hard to test, or hard to navigate.

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ecosystem-reference, fractal-delegation 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.
  • naman10parikhSkill

    ecosystem-reference

    Quick-access directory of Claude Code ecosystem repos, skills, plugins, MCPs, and patterns. Use when improving the harness.

    Also in 5 projects that use this

  • naman10parikhSkill

    fractal-delegation

    Also in 5 projects that use this

  • jaydubya818Skill

    figure-it-out

    Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.

    Also in 66 projects that use this

  • shiwenbin1617Skill

    ketchup-video

    Catch the user up like /ketchup, with a short subtitled video of slides for what happened and the waiting calls as text under it. Use for /ketchup-video.

    Also in 22 projects that use this

  • bnemaSkill

    setup-pstack

    Configure which Pi models pstack uses per role. Detects available provider/model specs and writes pstack's user configuration. Use for /setup-pstack, "configure pstack models", or changing pstack model choices.

    Also in 33 projects that use this

  • eryzerzSkill

    make-bot-ui

    Use when building a custom UI (page, dashboard, buttons) that should wake a Grok Bot over a webhook, when the user must provide a webhook sender key, or when exposing that UI on Tailscale.

    Also in 25 projects that use this

  • +5 more from naman10parikh

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 160 edited versions we read keep these.

  • 1

    Distinctive

    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
  1. Distinctive:

    Ask the user: "Which of these would you like to explore?"

    line 50
  2. Very specific:

    If it warrants implementation → save as a spec in docs/contexts/<name>/specs/

    line 95
  3. Very specific:

    If it's a significant architectural decision → consider an ADR in docs/contexts/<name>/adrs/

    line 96
  4. Very specific:

    Update docs/contexts/<name>/CONTEXT.md if ownership or contracts change

    line 97

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

Architecture Improvement

Explore the codebase to surface architectural friction, then design deep module interfaces using parallel sub-agents. A deep module (Ousterhout) has a small interface hiding a large implementation — more testable, more navigable, more resilient to change.

Process

1. Discover project context

Read domain documentation:

  1. docs/CONTEXT_MAP.md — bounded contexts and relationships
  2. docs/contexts/*/CONTEXT.md — ownership, invariants, contracts
  3. docs/UBIQUITOUS_LANGUAGE.md — canonical terminology

2. Explore the codebase

Navigate organically, noting friction:

  • Where does understanding one concept require bouncing between many small files?
  • Where are modules so shallow that the interface is nearly as complex as the implementation?
  • Where have pure functions been extracted "for testability" but the real bugs hide in how they're called?
  • Where do tightly-coupled modules create integration risk at the seams?
  • Which parts are untested or hard to test?
  • Where do bounded context boundaries leak? (one context directly accessing another's internals)

The friction you experience IS the signal.

3. Present candidates

Present a numbered list of deepening opportunities:

1. [Cluster Name]
   Modules: [which modules/concepts are involved]
   Coupling: [why they're coupled — shared types, call patterns, co-ownership]
   Dependency type: [in-process | local-substitutable | remote-owned | true-external]
   Test impact: [what tests would be replaced by boundary tests]
   Context: [which bounded context(s)]

2. ...

Ask the user: "Which of these would you like to explore?"

4. Frame the problem space

For the chosen candidate, write a user-facing explanation:

  • The constraints any new interface would need to satisfy
  • The dependencies it relies on
  • A rough illustrative code sketch (NOT a proposal — just grounding)

Show this to the user, then proceed to design.

5. Design multiple interfaces

Spawn 3+ sub-agents in parallel. Each must produce a radically different interface:

  • Agent 1: "Minimize the interface — 1-3 entry points max"
  • Agent 2: "Maximize flexibility — support many use cases and extension"
  • Agent 3: "Optimize for the most common caller — make the default case trivial"
  • Agent 4 (if applicable): "Ports & adapters — inject all external dependencies"

Each agent outputs:

  1. Interface signature (types, methods, params)
  2. Usage example
  3. What complexity it hides internally
  4. Dependency strategy
  5. Trade-offs

6. Compare and recommend

Present designs sequentially, then compare in prose:

  • Interface simplicity (fewer methods, simpler params = better)
  • General-purpose vs specialized
  • Implementation efficiency
  • Depth (small interface + deep implementation = good)
  • Ease of correct use vs ease of misuse

Give your recommendation. Be opinionated — the user wants a strong read.

7. Capture the decision

Based on user's choice:

  • If it warrants implementation → save as a spec in docs/contexts/<name>/specs/
  • If it's a significant architectural decision → consider an ADR in docs/contexts/<name>/adrs/
  • Update docs/contexts/<name>/CONTEXT.md if ownership or contracts change

Dependency categories

CategoryDescriptionTest strategy
In-processPure computation, no I/OMerge and test directly
Local-substitutableHas local test stand-in (e.g., SQLite for Postgres)Test with substitute
Remote but ownedYour own services across network boundaryPort + adapter pattern, in-memory adapter for tests
True externalThird-party services (Stripe, OpenAI)Mock at boundary

Testing principle

Replace, don't layer. Once boundary tests exist for a deepened module, delete the old shallow unit tests. Tests assert on observable outcomes through the public interface, not internal state.

Related skills

  • /domain — stress-test the chosen design against the domain model
  • /spec — formalize the improvement into a spec
  • /slice — break the refactor into vertical slices
  • /holistic — understand the broader system before refactoring

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.