harden-architecture
БесплатноБез исполняемых скриптовНе проверенRuns wave-based architectural hardening of a live codebase by lifting duplicated logic into shared primitives, giving each state machine a single typed owner…
от existential-birds★ 92 звезды на GitHubОб этом скилле
Architectural Hardening
Reduce architectural entropy in a live codebase through small, closed, verified waves: one canonical owner or shared primitive per wave, every caller migrated, the replaced path deleted, and the resulting invariant locked by a machine check. This skill edits code. Working product behavior and external contracts stay intact unless a change is recorded as a confirmed bug fix or a sign-off item.
When to Use
- "Reduce the architectural entropy in this repo." / "Harden this codebase."
- "Make the order/job/session state machine explicit and give it one owner."
- "We keep fixing the same race in different places; fix it at the root."
- "Add TLA+, Lean, property tests, or CI ratchets for our critical flows."
- "Delete dead code and speed up the test suite without breaking anything."
Use a narrower skill when the request is narrower:
- Survey a repository and file issues without editing code:
refactor-repo(../refactor-repo/SKILL.md). - Review a branch diff for structural quality:
review-structure(../review-structure/SKILL.md). - Mechanics of one named refactoring:
fowler-refactoring(../fowler-refactoring/SKILL.md).
Authorization and Setup
Loading this skill is not an instruction to start editing. All four gates pass before the first edit:
| Gate | Pass condition |
|---|---|
| A1 Scope | The request names the repository and, optionally, subsystems, a budget, and a deliverable. Missing pieces take these defaults: whole repository ranked by live user impact; no budget, so the run ends at convergence as defined under the wave loop; commits on local branches. Push or open pull requests only when the user asked for them. |
| A2 Isolation | After git fetch origin, work happens in a dedicated worktree cut from the remote default branch (git worktree add --no-track -b hardening/<slug> ../<repo>-hardening origin/<default-branch>) or the host's equivalent isolated workspace. <slug> is a short kebab-case name for the campaign, such as orders-state. The user's checkout is never modified. |
| A3 Baseline | The repository's own verification commands (from its contributor docs and CI config) ran on the untouched branch. Commands, pass/fail counts, and wall-clock are recorded. Pre-existing failures are listed, never hidden by weakening a check. Green, everywhere below, means every check passes, including checks a wave adds, except the failures listed here. |
| A4 Repository rules | The repository's contributor and agent instruction files were read. They take precedence over this skill. |
Target Architecture
Design the architecture the product would have if it started today with full knowledge of its real requirements, edge cases, and production constraints, then converge toward it. Persisted rows, queued work, deployed clients, and rolling deploys are part of those requirements. Work on live, user-facing code first: confirm a subsystem is live (routes, feature flags, decision records, usage evidence) before investing in it, and rank live user flows, hot APIs, shared UI and domain primitives, and core infrastructure above dormant features.
Eight properties define the target. Detection steps, remedies, traps, and per-stack mappings are in references/engineering-properties.md.
- Explicit state machines, single owners, stronger typing. Every persisted status column and every multi-step client or async flow has one owner module holding its transition table or total pure reducer. Coupled boolean flags become one closed state type with exhaustive matching, so illegal states cannot be constructed.
- Functional core, imperative shell. Transitions, rules, planners, eligibility matrices, recovery logic, and codecs are pure functions with time, randomness, and configuration passed in. Handlers, workers, and components read inputs, call the core, and perform effects at the edge.
- DRY through shared primitives. When siblings repeat the same loader, lifecycle, persistence, retry, or state-machine code, lift one typed primitive, migrate every caller, and delete the copies. Apply the deletion test to every layer: if this were deleted, would complexity disappear or spread to callers? Keep only layers where it would spread.
- One source of truth, generated downstream. Each enum, error code, transition table, limit, and API contract is defined once. Other copies are generated from it and CI fails on drift.
- Deep modules and locality of change. Small interfaces hide real complexity. One domain rule changes in one logical module. No import cycles and no hidden module-level mutable state.
- Concurrency and lifecycle safety. Server writes use compare-and-swap that checks rows affected, atomic single-statement updates, idempotency keys, and post-commit effects gated on a real transition. Clie
Установить harden-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл harden-architecture?
Runs wave-based architectural hardening of a live codebase by lifting duplicated logic into shared primitives, giving each state machine a single typed owner, separating a pure functional core from an imperative shell, fixing concurrency and lifecycle races, and locking every invariant with property and chaos tests, TLA+ model checking, Lean 4 proofs over exported tables, and CI ratchets. Use when asked to reduce architectural entropy, harden or deduplicate a codebase, make state machines explicit, systematically fix race conditions or stuck UI states, add formal verification or CI ratchets, safely delete dead code, or speed up tests and CI without changing product behavior. Operates at repository scale over multiple waves and is not meant for a single refactoring or a diff review.
Как установить скилл harden-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл harden-architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic