Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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:

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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
Полный SKILL.md на GitHub

Установить harden-architecture в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/adversarial-review.mdreferences/ci-ratchets.mdreferences/engineering-properties.mdreferences/formal-verification.mdreferences/log-and-report-templates.mdreferences/property-chaos-testing.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить harden-architecture с