agentleFS
ByronFinnByronFinn/dev-skills/skills/improve-architecture/SKILL.md

improve-architecture

Skill4 starsChanged 3 months agoMITView on GitHub

Periodically review and improve code architecture. Scan existing PRDs, find deepening opportunities and design debt based on domain language and decision records. Use for regular code health checks or proactive design debt cleanup. Trigger words: architecture, improve-architecture, 重构, 清理, 债务, 架构审查.

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use retro and commit.

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.
  • AWSSkill

    retro

    Conduct a retrospective on a coding session.

    Also in 3 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Done when: All PRDs scanned, codebase analyzed, findings categorized with priorities and effort estimates

    line 13
  2. Distinctive:

    Read available domain context before starting.

    line 19
  3. Very specific:

    PRD Traceability: If findings link to a PRD, fill the Arch reviewed by field:

    line 65

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

Improve Architecture: Review and Improve Code Architecture

🥷 Periodically clean design debt, keep code healthy.

Outcome Contract

  • Outcome: Architecture improvement report with findings, priorities, and PRD alignment analysis
  • Done when: All PRDs scanned, codebase analyzed, findings categorized with priorities and effort estimates
  • Evidence: Collected code patterns, PRD analysis, architecture alignment assessment
  • Output: Structured report with blocking/high/medium priority findings

Prerequisites

Read available domain context before starting. If any are missing, proceed without them and note the limitation in the report:

  • CONTEXT.md — domain glossary (if missing: scan code naming conventions instead)
  • docs/adr/ — architecture decisions (if missing: no historical decisions to check against)
  • docs/prd/*.md — product requirements (if missing: report focuses on code patterns only, no PRD alignment analysis)

Process Summary

Step 1: Apply the Skill Entry Protocol — it reads CONTEXT.md, ADRs, and PRDs. Code-level signals (duplication, coupling, long functions) don't strictly require domain context, so proceed even if docs are missing.

Step 2: Analyze current development direction — extract planned features, check compatibility with existing architecture

Step 3: Scan codebase using prioritized strategy — PRD-linked modules first, high-change-frequency modules next, cross-cutting concerns last. For each module, apply the objective detection heuristics in REFERENCE.md §Design Debt Signals (code duplication, long functions, tight coupling, mutable shared state, leaked/missing abstractions, shallow modules, god objects, dead code, speculative generality, message chains, deep inheritance, stub implementations, magic values, swallowed errors, repeated type dispatch — each tagged with the principle it detects, defined in ../rules/engineering-principles.md, and carrying a concrete grep/line-count threshold). Run the ADR compliance check (REFERENCE §3.3) against each ADR in docs/adr/.

Step 4: Analyze findings — categorize as blocking/high priority/medium priority with PRD links. Each finding must have specific location, evidence, and impact.

Step 5: Propose improvements — problem, suggestion, benefit, effort (Low/Medium/High with rationale), linked PRD

Step 6: Generate report — structured findings with next steps

See REFERENCE.md for scanning strategy, detection heuristics, ADR compliance procedure, and extended examples.

Gotchas

What happenedRule
Modify working code without verifyingRead and understand code before suggesting
Rename without improving structureDeepen modules, don't just rename
Change too much at onceSmall improvements, one at a time
Ignore domain languageName based on CONTEXT.md terms
Violate historical ADRCheck ADRs, create new ADR if needed
Ignore PRD constraintsCheck if improvement aligns with planned features
Introduce new concept without updatingSync update to CONTEXT.md

Output

Improve Architecture complete.

Scan scope:       [PRDs: N, Code files: N, ADRs: N]
Alignment:        [✅ N, ⚠️ N, ❌ N]
Findings:         [Blocking: N, High: N, Medium: N]

Next: Review blocking issues → /story to decompose → /implement to orchestrate implementation

PRD Traceability: If findings link to a PRD, fill the Arch reviewed by field:

- **Arch reviewed by**: `/improve-architecture` (<YYYY-MM-DD>) — <one-line finding + priority>

Workflow Position

Independent periodic activity, not in main development flow:

New feature dev: think → grill → story → implement → review
Bug fix: debug → review (optional)
Independent periodic: improve-architecture (every 2-4 weeks)

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.