Command Palette

Search for a command to run...

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

reverse-spec-for-rebuild

БесплатноЗапускает вложенные скриптыНе проверен

Characterize existing code into a rebuild package a team can reimplement from without the source: behavior specs, domain model, BR-NNN rules…

BlackBeltTechnologyот BlackBeltTechnology★ 357 звёзд на GitHub

Об этом скилле

reverse-spec-for-rebuild

Turn existing code into a rebuild package: enough data shapes, business rules, implicit behavior, provenance and known unknowns that a team can rebuild the same business logic and use cases without the original source. Works in any git repository; a kb tree and the OpenSpec CLI are optional accelerators.

Not the same as a kb-oriented behavioral spec generator: those strip line numbers and rule catalogs on purpose. This skill keeps them, so its output never goes under a kb-indexed root.

Methodology (provenance citations, confidence levels, state/edge/error checklists, entry-point completeness) adapted and rewritten from greenfield (Apache-2.0); see the package NOTICE.

When to use

  • A system will be rewritten (new stack, new team, vendor exit) and its business logic must survive.
  • You need a catalog of business rules, including the implicit ones that live in defaults, exception handlers and ordering.
  • You need to know what is NOT known about a system (registered gaps).

Skip for a single trivial file, or when you only want searchable docs.

Inputs

  • Target directory (default: repository root) and an optional single capability.
  • Optional previous rebuild package (for stable identifiers on re-run).
  • Optional protected roots override (default openspec docs packages .pi).

Procedure

G below is node <this skill dir>/scripts/guard.mjs (the deterministic guards in scripts/guard.mjs: check-dest, sweep, lint-spec, lint-cite), run from the repository root. PKG is .reverse-spec-scratch/<target-slug>/rebuild/ (<target-slug> = output of G slug <target>: root for the repository root, else a kebab-case form of the canonical repo-relative path plus a short hash — never ./.., never shared by two targets; it exits 2 for a target outside the repository. Never derive the slug by hand).

  1. Scratch must be ignored. git check-ignore -q .reverse-spec-scratch/ (keep the trailing slash: a dir/ ignore pattern does not match a not-yet-existing path without it). If it is not ignored, ask_user before writing anything: on consent append .reverse-spec-scratch/ to .git/info/exclude (never to a committed ignore file); on refusal stop.
  2. Run id + sweep leftovers. Set RUN_ID=$(G new-run) (UTC timestamp plus random suffix, so concurrent runs never share it); every transient validation id of this run is _rsfr-val-$RUN_ID-<cap>. Run G sweep — it removes only abandoned openspec/specs/_rsfr-val-* dirs (owner process gone, or no owner marker and untouched for 10 minutes); a concurrent run's live dirs and other skills' transient dirs are untouched.
  3. Resolve the target. Confirm the path exists; record git rev-parse HEAD for PKG/README.md. In this order:
    1. Lock the target. SLUG=$(G slug <target>), then G lock "$SLUG" "$RUN_ID". Exit 1 = another run holds this target (never share a PKG): ask_user whether that run is still active. Only when the user confirms it is dead, run the G break-lock "$SLUG" <owner> command the error names, then G lock again (acquisition is exclusive, so a racing run cannot also win). Locks never expire on their own, so a long step never loses ownership. Release with G unlock "$SLUG" "$RUN_ID" at step 14, and whenever the run stops early.
    2. Snapshot first. When a previous package is supplied (possibly PKG itself), copy its rules.md, quirks.md, gaps.md, README.md and _ids.json (when present) into .reverse-spec-scratch/<target-slug>/previous-$RUN_ID/, then chmod -R a-w it. This frozen snapshot is the ONLY "previous package" every merge of this run reads — never PKG, which each merge rewrites.
    3. Then move aside. If a package still sits at PKG, move it to PKG.prev-$RUN_ID. Create an empty PKG.
    4. Seed the id high-water marks. With a previous package: G seed-ids PKG/_ids.json <snapshot dir>; without one: G seed-ids PKG/_ids.json PKG (creates an all-zero file). _ids.json holds the highest BR/QUIRK/GAP number ever allocated, including ids the previous package already retired.
  4. Discover. One subagent with prompts/discovery.md (KB_AVAILABLE = kb tooling or AGENTS.md files present). It returns a capability manifest. Save it as PKG/_manifest.json and run G check-manifest PKG/_manifest.json; on exit 2 (an unsafe or duplicate capability name) re-run discovery or rename/merge the entries by hand, then re-check — names become file paths and validation ids, target code is untrusted, and two capabilities with one name would overwrite each other's outputs. Check unassigned_files is empty; otherwise add them to a capability or ask the subagent to re-cluster. For a single-capability target you may write the manifest by hand.
  5. Generate in parallel. One subagent per cap
Полный SKILL.md на GitHub

Установить reverse-spec-for-rebuild в Claude Code и Claude Desktop

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

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

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

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

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

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

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

SKILL.agent.mdSKILL.md.AGENTS.mdeval/answer-key.jsoneval/answer-key.json.AGENTS.mdeval/score.mdeval/score.md.AGENTS.mdprompts/auditor-rebuild.mdprompts/completeness.mdprompts/crud-classifier.mdprompts/discovery.mdprompts/generator-rebuild.mdprompts/sequence-generator.mdprompts/state-machine-generator.mdprompts/uc-linker.mdprompts/ui-screen-generator.mdprompts/usage-mapper.mdprompts/variability-classifier.mdreferences/behavior-checklists.mdreferences/behavior-checklists.md.AGENTS.mdreferences/package-templates.mdreferences/package-templates.md.AGENTS.mdreferences/provenance.mdreferences/provenance.md.AGENTS.mdreferences/ui-extraction.mdreferences/ui-extraction.md.AGENTS.mdreferences/ui-model.mdreferences/ui-model.md.AGENTS.mdscripts/guard.mjsscripts/guard.mjs.AGENTS.mdscripts/ui-extract/adapters/angularjs.mjsscripts/ui-extract/adapters/angularjs.mjs.AGENTS.mdscripts/ui-extract/compare.mjsscripts/ui-extract/compare.mjs.AGENTS.mdscripts/ui-extract/config-reads.mjsscripts/ui-extract/config-reads.mjs.AGENTS.mdscripts/ui-extract/config.mjsscripts/ui-extract/config.mjs.AGENTS.mdscripts/ui-extract/fill.mjsscripts/ui-extract/fill.mjs.AGENTS.mdscripts/ui-extract/flow.mjs

FAQ

Что делает скилл reverse-spec-for-rebuild?

Characterize existing code into a rebuild package a team can reimplement from without the source: behavior specs, domain model, BR-NNN rules (explicit/implicit), quirks, gaps, entry-point completeness, each claim cited file:line with confidence. Use on "reverse-engineer this for a rebuild", "extract the business rules", "reimplement X without the original code", "characterize code for a rewrite".

Как установить скилл reverse-spec-for-rebuild?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл reverse-spec-for-rebuild запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить reverse-spec-for-rebuild с