agentleFS
leekleek/agent-skills/skills/architecture-satisfaction/SKILL.md

architecture-satisfaction

Skill5 starsChanged 11 days agoMITView on GitHub

Run a bounded architectural refactor loop toward a stated design.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 16 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    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:

    Stop when the architecture is satisfactory and checks pass.

    line 20
  2. Distinctive:

    Use this for a deliberate architectural refactor where the desired destination can be stated in concrete terms and the current system can …

    line 24
  3. Distinctive:

    Before editing code, write down the target in concrete terms.

    line 30
  4. Distinctive:

    If the target is vague, pause and clarify it: ask the open points as choices (a structured question (harness-tools), for example which …

    line 40
  5. Very specific:

    Create or update a progress file in /tmp named for the project, for example:

    line 46
  6. Distinctive:

    Run the relevant automated checks: tests, type checks, linters, formatters, build, migrations, or focused smoke scripts.

    line 71
  7. Distinctive:

    Commit each verified checkpoint when the user has asked for commits or the repository workflow expects checkpoint commits.

    line 74
  8. Distinctive:

    Update the progress file with the checkpoint, evidence, decisions, and next action.

    line 75
  9. Distinctive:

    Do not let several unrelated refactors accumulate before verification.

    line 88
  10. Distinctive:

    Ask the review pass to look for:

    line 92
  11. Distinctive:

    Call sites missed during the refactor.

    line 96
  12. Distinctive:

    Start each item that needs the user (a risk, a deferral, an approval) with ⚠️, and each failed check with ❌.

    line 115
  13. Distinctive:

    Do not begin a broad refactor without a concrete target and verification plan.

    line 119
  14. Distinctive:

    Do not combine unrelated architecture moves in one checkpoint.

    line 120
  15. Distinctive:

    Do not commit failing checkpoints unless the user explicitly wants a work-in-progress checkpoint.

    line 121
  16. Distinctive:

    Do not rewrite public interfaces, data shapes, or migration behavior without checking callers and compatibility.

    line 122
  17. Distinctive:

    Do not discard user changes or unrelated work.

    line 123

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

Architecture Satisfaction

Goal

Refactor toward a concrete architectural target while keeping the system working after each meaningful step.

Loop Prompt

Refactor until you are happy with the architecture. After each significant step, live-test the system, run an independent review, and commit. Track progress in /tmp/refactor-{projectname}.md.

Stop when the architecture is satisfactory and checks pass.

When To Use

Use this for a deliberate architectural refactor where the desired destination can be stated in concrete terms and the current system can be tested after each meaningful change.

This is not a general cleanup pass. Use housekeeper for low-risk code hygiene, and repository-cleanup for Git branch/PR/worktree/stash cleanup.

Define Satisfactory First

Before editing code, write down the target in concrete terms. Include the parts that make the architecture satisfactory, such as:

  • Module boundaries and ownership.
  • Dependency direction.
  • Public interfaces that should stay stable.
  • Behavior that must keep working.
  • Performance constraints.
  • Tests, smoke checks, or live flows that prove safety.
  • Known risks and rollback points.

If the target is vague, pause and clarify it: ask the open points as choices (a structured question (harness-tools), for example which public interfaces must stay stable; otherwise in chat). A subjective stop condition can otherwise run indefinitely.

Get the target approved before the first edit. Where the harness has plan mode, enter it (EnterPlanMode), write the target and verification plan as the plan, present it with ExitPlanMode for approval, and copy the approved plan into the progress file; otherwise show the target and plan in chat and wait for an explicit yes.

Progress File

Create or update a progress file in /tmp named for the project, for example:

/tmp/refactor-my-project.md

Track:

  • Architectural target and constraints.
  • Current risks.
  • Checkpoint history.
  • Decisions made.
  • Commands run and their results.
  • Independent review findings.
  • Blockers.
  • Next action.

The progress file is scratch state for long refactors and handoffs. Do not use it as a substitute for project documentation unless the user asks.

Workflow

  1. Inspect the current repository state: branch, uncommitted work, recent commits, test commands, app startup commands, and relevant architecture docs.
  2. Define the architectural target, constraints, current risks, and verification plan in the progress file, and get them approved (Define Satisfactory First) before any code edit.
  3. Make one significant, reviewable change at a time.
  4. Live-test the affected behavior after each significant change. Prefer the project's real app/runtime checks when available, not only static checks.
  5. Run the relevant automated checks: tests, type checks, linters, formatters, build, migrations, or focused smoke scripts.
  6. Run an independent review after each significant change. Run the code-review skill against the checkpoint's starting commit (its Correctness axis runs as the leek-skills:pr-reviewer subagent where the harness has subagents, and inline otherwise), and brief it with the Independent Review Focus below. Where that skill is not installed, use an existing autoreview command or a separate review pass that looks for behavior regressions, missed callers, leaky abstractions, and test gaps.
  7. Fix issues found by live testing, checks, or review before moving to the next architectural step.
  8. Commit each verified checkpoint when the user has asked for commits or the repository workflow expects checkpoint commits. Keep commits small and named after the architectural move.
  9. Update the progress file with the checkpoint, evidence, decisions, and next action.
  10. Repeat until the stated architecture target is met, checks pass, and review finds no blocking issue.

Checkpoint Discipline

Each checkpoint should have:

  • One coherent architectural change.
  • Passing or explicitly explained verification.
  • A reviewed diff.
  • A short commit message if committing.
  • A progress-file entry explaining what changed and why.

Do not let several unrelated refactors accumulate before verification. Small verified checkpoints reduce risk and preserve rollback points.

Independent Review Focus

Ask the review pass to look for:

  • Broken dependency direction or circular dependencies.
  • Interfaces that became broader or leak implementation details.
  • Call sites missed during the refactor.
  • Behavior changes not covered by tests.
  • Migration or data compatibility risks.
  • Performance regressions.
  • Over-abstracted code that is harder to understand than the original.
  • Documentation or comments that now describe old architecture.

Report

End with:

  • Architectural target.
  • Checkpoints completed.
  • Live tests and automated checks run.
  • Independent review findings and fixes.
  • Commits created, if any.
  • Remaining risks or deferred work.
  • Current progress-file path.

Start each item that needs the user (a risk, a deferral, an approval) with ⚠️, and each failed check with ❌. No other marks.

Guardrails

  • Do not begin a broad refactor without a concrete target and verification plan.
  • Do not combine unrelated architecture moves in one checkpoint.
  • Do not commit failing checkpoints unless the user explicitly wants a work-in-progress checkpoint.
  • Do not rewrite public interfaces, data shapes, or migration behavior without checking callers and compatibility.
  • Do not discard user changes or unrelated work.

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.