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★ 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,greporlsoutput 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/*.yamlrun bytests/lifecycle/rows.py). Read the TARGET section ofreferences/family.mdand verify each name there withls/grep. - Absent (today): use the current harness:
ApmLifecycleRunner,IsolatedApmEnvironment,LifecycleStateSnapshot,LocalPackageFactory, thetests/integration/_*_kit.pyworlds, and the reference moduletests/integration/test_required_lifecycle_state_machine.py. Read the TODAY section ofreferences/family.md. This branch is authoritative untiltests/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/intests/fixtures/lifecycle_bug_ledger/); OpenAPMreq-*ids (CONFORMANCE.json); owner decisions (.apm/architecture/owners/*.json);CHANGELOG.mdguarantees; docs claims with must / never / fails / exits wording. Whentests/lifecycle/is present, rows useP-INV-I1..P-INV-I9andP-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
ownerfield 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:linefromgrep -n). - install, update,
deps updateandlockshare one pipeline. Each SIDE DOOR (a mutating path that skips the pipeline: local bundle,--mcp, the--dry-runplanner, 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 intests/lifecycle/(if present), thentests/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 |
Установить apm-lifecycle-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic