Command Palette

Search for a command to run...

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

apm-lifecycle-tests

БесплатноБез исполняемых скриптовНе проверен

Use this skill when you write, extend or migrate an APM lifecycle test: any test that drives the real apm CLI through command sequences and checks durable…

microsoftот microsoft★ 4 492 звезды на GitHub

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

APM lifecycle tests

A lifecycle test proves a USER PROMISE on the installed CLI. It drives apm through real command sequences in a hermetic world, snapshots durable state before and after, and asserts observable facts: files present or absent, bytes unchanged, lockfile rows, MCP config entries, egress. It is the only tier that can prove a negative ("nothing else was written", "the user's file survived", "the denied hook is gone"). In agentic coding, where no human walks the CLI by hand, this harness is the walkthrough.

Unit tests on each side of a boundary do not replace it. A lifecycle test whose only assertion is a string compare is NOT lifecycle proof.

Surfaces that need it: install / uninstall / update / compile / audit paths; the deployment ledger, lockfile write path or deployed_files; target resolution, widening or narrowing; any write into a target root (.github/, .claude/, .cursor/, .agents/, ...) or user scope (~/.apm/); --dry-run on any command; cleanup, prune, drift or orphan handling.

Operating rules

  • Single thread. Plan, execute, verify by running.
  • Every fact is a tool result. "The test passes", "no test exists", "this path exists" come from pytest, grep or ls output in this session, never from memory or prose.
  • Restate the promise id at the top of every step's notes.
  • ASCII only in test code, ids, comments and output assertions.

Procedure

Step 0 -- locate the family

Run ls tests/lifecycle/conftest.py.

  • Present: use the target family (world, driver, model, oracles, receipts, replay rows in tests/lifecycle/replay/rows/*.yaml run by tests/lifecycle/rows.py). Read the TARGET section of references/family.md and verify each name there with ls/grep.
  • Absent (today): use the current harness: ApmLifecycleRunner, IsolatedApmEnvironment, LifecycleStateSnapshot, LocalPackageFactory, the tests/integration/_*_kit.py worlds, and the reference module tests/integration/test_required_lifecycle_state_machine.py. Read the TODAY section of references/family.md. This branch is authoritative until tests/lifecycle/ exists.

Step 1 -- name the promise, the cell and the owner

  • PROMISE. A testable statement APM makes to a user, cited to source. Precedence: cross-cutting invariants I1-I9 (below); bug-ledger property ids (property_catalog/ in tests/fixtures/lifecycle_bug_ledger/); OpenAPM req-* ids (CONFORMANCE.json); owner decisions (.apm/architecture/owners/*.json); CHANGELOG.md guarantees; docs claims with must / never / fails / exits wording. When tests/lifecycle/ is present, rows use P-INV-I1..P-INV-I9 and P-LAW-<ledger property id>; owner ids (P-OWN-*) resolve only once a promise catalog exists. Write: PROMISE: <id> -- <sentence> (source: <path>).
  • CELL. A factor tuple. Factors: OP, SRC, PRIM, SCOPE, LOCK, DEPLOYED, GATE, TGT, NET; modifiers FROZEN, DRYRUN, FORCE, SELECT, UPDATE, NOPOLICY. Example: OP=update SRC=git PRIM=lsp SCOPE=project GATE=revoked-after-deploy.
  • OWNER. The module that decides the behavior (the owner field in .apm/architecture/owners/*.json). A fix belongs in the owner.

If you cannot name a promise, stop and ask. A test with no promise is unexplained, not automatically deletable.

Step 2 -- derive cells and check what exists

  • Partition a factor only where the code branches; cite the branch (file:line from grep -n).
  • install, update, deps update and lock share one pipeline. Each SIDE DOOR (a mutating path that skips the pipeline: local bundle, --mcp, the --dry-run planner, unpack) is its own family; defects cluster there.
  • Pairwise (t=2) by default. t=3 only on split-authority triples: OP x GATE x PRIM, FROZEN x SCOPE x GATE, OP x SRC x PRIM, OP x SCOPE x LOCK, DRYRUN x OP x SRC.
  • Equivalence is partial; name the exceptions (hosts same except lock identity; targets same except MCP ownership; file primitives same except compile staging).
  • Search before writing: grep -rn "<symbol|flag|error text|issue>" tests/. Look in tests/lifecycle/ (if present), then tests/integration/*lifecycle*.py. Prefer EXTENDING an existing test (parametrize case, assertion, replay row, machine rule) over a new module; lifecycle tests are expensive in CI time.

Step 3 -- pick the instrument

Situation Today (no tests/lifecycle/) Target family
one cell, fixed steps ApmLifecycleRunner test or parametrize case in the matching tests/integration/*lifecycle*.py replay row in tests/lifecycle/replay/rows/*.yaml
transition that must hold from many states case in test_required_lifecycle_state_machine.py or rule in tests/lifecycle/machines/test_m_spine.py state-machine rule, where the family provides machines (verify with ls)
history, ownership of unmanaged assets, platform, failure phase, cache, graph or version, concurrency scenario on a _*_kit.py world
Полный SKILL.md на GitHub

Установить apm-lifecycle-tests в Claude Code и Claude Desktop

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

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

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

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

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

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

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

assets/templates.mdevals/README.mdevals/content-evals.jsonevals/trigger-evals.jsonreferences/family.mdreferences/migrate-and-merge.mdreferences/oracles.md

FAQ

Что делает скилл apm-lifecycle-tests?

Use this skill when you write, extend or migrate an APM lifecycle test: any test that drives the real apm CLI through command sequences and checks durable state (deployed files, lockfile, MCP configs, approvals, egress). Apply it for a bug fix or behavior change in install, update, uninstall, prune, compile, audit, approve or deny, pack or bundle, marketplace, policy, MCP or LSP; for a regression trap; for a lifecycle_smoke test, state-machine rule, replay row, scenario, security table or docs journey; and whenever a reviewer says lifecycle coverage is missing, even if the request only says "add an e2e or integration test". It names the promise, picks the instrument, writes the failing-before test with snapshot and invariant oracles, and records the bug-ledger row. Not for pure unit tests, PR review verdicts, or deciding which tests to delete.

Как установить скилл apm-lifecycle-tests?

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

Скилл apm-lifecycle-tests запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить apm-lifecycle-tests с