[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78F26B5DC80A999PTPWE4NS":3,"skill-same:01M78F26B5DC80A999PTPWE4NS":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M78F26B5DC80A999PTPWE4NS","foreman-testing",null,"Use when running, extending, or debugging the Foreman bats suite - covers the gate mutex, baseline and skip-budget ratchets, positive controls, and bats assertion semantics.","CharlesHoskinson\u002Fforeman","CharlesHoskinson","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3279952?v=4","01M78F029R4HEDS222354N3VAX","Charles Hoskinson","01M78F02AN4AQKGVVK97YEG5NQ",9,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fplugins\u002Fforeman-qa\u002Fskills\u002Fforeman-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: foreman-testing\ndescription: Use when running, extending, or debugging the Foreman bats suite - covers the gate mutex, baseline and skip-budget ratchets, positive controls, and bats assertion semantics.\n---\n\n# foreman-testing\n\nOperational rules for running and extending the Foreman bats suite\n(`tests\u002F*.bats`, driven by `tests\u002Frun.sh`). Every rule here was learned by\nsomething breaking; follow them exactly, do not rediscover them.\n\n## Running tests\n\nRun everything through `tests\u002Frun.sh`, or take the mutex yourself:\n\n```bash\nflock \u002Froot\u002F.foreman\u002Fgate.lock bats --formatter tap tests\u002Fsome.bats\n# or, for the full policy-aware run:\ntests\u002Frun.sh\n```\n\n- **A raw `flock ... bats ...` wrapper can deadlock** on files that shell\n  out to `tests\u002Frun.sh` themselves (`tests\u002Ftest-policy.bats` does):\n  `tests\u002Frun.sh`'s own mutex is reentrant via an exported\n  `FOREMAN_BATS_MUTEX_HELD`, but a bare outer `flock` never sets it, so\n  the nested call blocks on a lock its own parent holds. Prefer\n  `bash tests\u002Frun.sh \u003Cfiles>`. Full mechanism: `references\u002Fbats-traps.md`.\n- **Exactly one bats runner at a time, host-wide.** `tests\u002Frun.sh` takes\n  `$HOME\u002F.foreman\u002Fgate.lock` via `flock` before running anything (falls\n  back to an atomic `mkdir` lock when `flock` is unavailable). Concurrent\n  runs flake the timing-sensitive tests, notably `tests\u002Fwatch.bats` and\n  `tests\u002Flane-run.bats`.\n- **Keep the host quiet during a gate run.** A concurrent build or agent\n  spawn can flake the VTICK fake-clock timing assertions in `watch.bats`\n  even while the mutex is held, because CPU contention stretches the real\n  wall-clock scheduling slack those assertions bound.\n- **Per-file timeout is 600s** (`TEST_FILE_TIMEOUT_S`, `--kill-after=30`).\n  A file that hangs is killed and recorded as `TIMEOUT` in the slice\n  report rather than left to hang the host. See\n  `references\u002Fbats-traps.md` for why this exists.\n\n## Assertion semantics -- the biggest trap\n\nBats runs every test body under `errexit`. A **bare command's exit status\nis a complete assertion** -- `grep -q pattern file` and a `jq -e` filter\npiped to `\u002Fdev\u002Fnull` each fail the test on their own if they exit\nnon-zero. No `assert_*` helper or bracket-test wrapper is required or\nimplied. A test-quality scanner that only recognizes bracket tests or\n`assert_*` calls as \"real checks\" undercounts real checks. Full detail\nand a measured example: `references\u002Fbats-traps.md`.\n\n- **Never write a bare `skip`.** Always `skip \"reason\"`. Use the\n  `require_*` helpers in `tests\u002Flib\u002Fpreconditions.bash`\n  (`require_platform`, `require_tool`, `require_non_root`, `require_built`,\n  `require_no_live_vendor`) -- each skips with an actionable reason instead\n  of a bare one.\n- **Never put a literal `@test` at column 0 inside a heredoc** in a\n  `.bats` file. Bats parses `.bats` files line-wise; a heredoc-embedded\n  `@test` reads as a new test declaration and silently breaks the\n  enclosing test. Build such fixtures with `printf` instead -- see\n  `references\u002Fbats-traps.md`.\n\n## Ratchets: baseline and skip-budget\n\n`tests\u002Fbaseline.tsv` (one expected pass count per file) and\n`tests\u002Fskip-budget.tsv` (permitted skips per file x platform, platform is\n`linux|wsl|windows`) are edited **deliberately**, never regenerated from a\nrun. Adding a new `.bats` file requires one `tests\u002Fbaseline.tsv` row and\nthree `tests\u002Fskip-budget.tsv` rows (one per platform) -- `tests\u002Frun.sh`\nerrors on a file missing either. Full mechanics:\n`references\u002Fgate-and-ratchets.md`.\n\n- Raising a baseline **tightens** it -- correct when a file legitimately\n  gained tests.\n- Lowering a baseline is a **regression** and needs justification.\n- Host-dependent counts are real (`tests\u002Fnats-bridge.bats` needs\n  `nats-server`\u002F`nats` on PATH; CI installs pinned versions). Do not \"fix\"\n  a baseline to match an incomplete environment -- install the dependency\n  instead.\n\n## Gate mode: shadow vs enforce\n\n`tests\u002Frun.sh` defaults `TEST_GATE_MODE=shadow`. In shadow mode,\nskip-budget, pass-baseline, and bare-skip failures do **not** affect exit\nstatus -- a run can print `RESULT ERROR runner_errors=1` and still exit 0.\n**Never read the exit code alone; read the `RESULT` and `TOTAL` lines.**\nEnforcing the gate (`TEST_GATE_MODE=enforce`) is tag criterion 2 and\nrequires the suite to complete on three consecutive runs first.\n\n## Controls: proving a check discriminates\n\nA check that only passes on known-good input proves nothing alone -- a\nhard-wired `exit 0` would pass too. `tests\u002Flib\u002Fpositive-control.bash`\nproves a check answers differently on a known-bad and a known-good input\nin the same run; a check that classifies both arms identically is\nrejected. `tests\u002Flib\u002Fcheck-inventory.sh` sweeps the whole tree (never a\ndiff) into `tests\u002F.check-inventory.tsv`; every `check_id` must appear in\n`tests\u002Fpositive-control-registry.tsv` or the shrinking\n`tests\u002Fpositive-control-todo.tsv`, or the build fails.\n`tests\u002Finject-regressions.sh` seeds known defects into an isolated\n`git archive HEAD` copy -- the working tree is never mutated -- and\nasserts the owning slice fails for each. Full detail:\n`references\u002Fgate-and-ratchets.md`.\n\n## Style\n\nMarkdown here must satisfy `markdownlint-cli2` per the repo's\n`.markdownlint-cli2.jsonc`: no consecutive blank lines (MD012), fenced\ncode blocks carry a language, headings are surrounded by blank lines,\nsingle trailing newline.\n","# foreman-testing\n\nOperational rules for running and extending the Foreman bats suite\n(`tests\u002F*.bats`, driven by `tests\u002Frun.sh`). Every rule here was learned by\nsomething breaking; follow them exactly, do not rediscover them.\n\n## Running tests\n\nRun everything through `tests\u002Frun.sh`, or take the mutex yourself:\n\n```bash\nflock \u002Froot\u002F.foreman\u002Fgate.lock bats --formatter tap tests\u002Fsome.bats\n# or, for the full policy-aware run:\ntests\u002Frun.sh\n```\n\n- **A raw `flock ... bats ...` wrapper can deadlock** on files that shell\n  out to `tests\u002Frun.sh` themselves (`tests\u002Ftest-policy.bats` does):\n  `tests\u002Frun.sh`'s own mutex is reentrant via an exported\n  `FOREMAN_BATS_MUTEX_HELD`, but a bare outer `flock` never sets it, so\n  the nested call blocks on a lock its own parent holds. Prefer\n  `bash tests\u002Frun.sh \u003Cfiles>`. Full mechanism: `references\u002Fbats-traps.md`.\n- **Exactly one bats runner at a time, host-wide.** `tests\u002Frun.sh` takes\n  `$HOME\u002F.foreman\u002Fgate.lock` via `flock` before running anything (falls\n  back to an atomic `mkdir` lock when `flock` is unavailable). Concurrent\n  runs flake the timing-sensitive tests, notably `tests\u002Fwatch.bats` and\n  `tests\u002Flane-run.bats`.\n- **Keep the host quiet during a gate run.** A concurrent build or agent\n  spawn can flake the VTICK fake-clock timing assertions in `watch.bats`\n  even while the mutex is held, because CPU contention stretches the real\n  wall-clock scheduling slack those assertions bound.\n- **Per-file timeout is 600s** (`TEST_FILE_TIMEOUT_S`, `--kill-after=30`).\n  A file that hangs is killed and recorded as `TIMEOUT` in the slice\n  report rather than left to hang the host. See\n  `references\u002Fbats-traps.md` for why this exists.\n\n## Assertion semantics -- the biggest trap\n\nBats runs every test body under `errexit`. A **bare command's exit status\nis a complete assertion** -- `grep -q pattern file` and a `jq -e` filter\npiped to `\u002Fdev\u002Fnull` each fail the test on their own if they exit\nnon-zero. No `assert_*` helper or bracket-test wrapper is required or\nimplied. A test-quality scanner that only recognizes bracket tests or\n`assert_*` calls as \"real checks\" undercounts real checks. Full detail\nand a measured example: `references\u002Fbats-traps.md`.\n\n- **Never write a bare `skip`.** Always `skip \"reason\"`. Use the\n  `require_*` helpers in `tests\u002Flib\u002Fpreconditions.bash`\n  (`require_platform`, `require_tool`, `require_non_root`, `require_built`,\n  `require_no_live_vendor`) -- each skips with an actionable reason instead\n  of a bare one.\n- **Never put a literal `@test` at column 0 inside a heredoc** in a\n  `.bats` file. Bats parses `.bats` files line-wise; a heredoc-embedded\n  `@test` reads as a new test declaration and silently breaks the\n  enclosing test. Build such fixtures with `printf` instead -- see\n  `references\u002Fbats-traps.md`.\n\n## Ratchets: baseline and skip-budget\n\n`tests\u002Fbaseline.tsv` (one expected pass count per file) and\n`tests\u002Fskip-budget.tsv` (permitted skips per file x platform, platform is\n`linux|wsl|windows`) are edited **deliberately**, never regenerated from a\nrun. Adding a new `.bats` file requires one `tests\u002Fbaseline.tsv` row and\nthree `tests\u002Fskip-budget.tsv` rows (one per platform) -- `tests\u002Frun.sh`\nerrors on a file missing either. Full mechanics:\n`references\u002Fgate-and-ratchets.md`.\n\n- Raising a baseline **tightens** it -- correct when a file legitimately\n  gained tests.\n- Lowering a baseline is a **regression** and needs justification.\n- Host-dependent counts are real (`tests\u002Fnats-bridge.bats` needs\n  `nats-server`\u002F`nats` on PATH; CI installs pinned versions). Do not \"fix\"\n  a baseline to match an incomplete environment -- install the dependency\n  instead.\n\n## Gate mode: shadow vs enforce\n\n`tests\u002Frun.sh` defaults `TEST_GATE_MODE=shadow`. In shadow mode,\nskip-budget, pass-baseline, and bare-skip failures do **not** affect exit\nstatus -- a run can print `RESULT ERROR runner_errors=1` and still exit 0.\n**Never read the exit code alone; read the `RESULT` and `TOTAL` lines.**\nEnforcing the gate (`TEST_GATE_MODE=enforce`) is tag criterion 2 and\nrequires the suite to complete on three consecutive runs first.\n\n## Controls: proving a check discriminates\n\nA check that only passes on known-good input proves nothing alone -- a\nhard-wired `exit 0` would pass too. `tests\u002Flib\u002Fpositive-control.bash`\nproves a check answers differently on a known-bad and a known-good input\nin the same run; a check that classifies both arms identically is\nrejected. `tests\u002Flib\u002Fcheck-inventory.sh` sweeps the whole tree (never a\ndiff) into `tests\u002F.check-inventory.tsv`; every `check_id` must appear in\n`tests\u002Fpositive-control-registry.tsv` or the shrinking\n`tests\u002Fpositive-control-todo.tsv`, or the build fails.\n`tests\u002Finject-regressions.sh` seeds known defects into an isolated\n`git archive HEAD` copy -- the working tree is never mutated -- and\nasserts the owning slice fails for each. Full detail:\n`references\u002Fgate-and-ratchets.md`.\n\n## Style\n\nMarkdown here must satisfy `markdownlint-cli2` per the repo's\n`.markdownlint-cli2.jsonc`: no consecutive blank lines (MD012), fenced\ncode blocks carry a language, headings are surrounded by blank lines,\nsingle trailing newline.\n",{"name":5,"description":7},"main","58f1b25a52305f5b14eba143e37a6b30466e9bf8","plugins\u002Fforeman-qa\u002Fskills\u002Fforeman-testing",4,"https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman","https:\u002F\u002Fgithub.com\u002FCharlesHoskinson","https:\u002F\u002Fwww.iog.io\u002F","CEO of IOG","2026-09-16 08:17:40",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add CharlesHoskinson\u002Fforeman --skill foreman-testing",{"tool":39,"command":40},"bunx","bunx skills add CharlesHoskinson\u002Fforeman --skill foreman-testing",{"tool":42,"command":43},"pnpm","pnpm dlx skills add CharlesHoskinson\u002Fforeman --skill foreman-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fplugins\u002Fforeman-qa\u002Fskills\u002Fforeman-testing\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fbats-traps.md","REFERENCE","参考文档",6309,"https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fplugins\u002Fforeman-qa\u002Fskills\u002Fforeman-testing\u002Freferences\u002Fbats-traps.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fgate-and-ratchets.md",7998,"https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fplugins\u002Fforeman-qa\u002Fskills\u002Fforeman-testing\u002Freferences\u002Fgate-and-ratchets.md",[58,64,71,78,85,92],{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M78F4F3YJ7YN8V4JN5EF4SNE","foreman","https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Ftool-check\u002Fcheck-one\u002Fhome-ok\u002F.claude\u002Fskills\u002Fforeman\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M78F4AAGHH448E8CBSSMVZBF","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M78F4846T6VZB3WZVBBFZB6A","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M78F45C2CQ2XPQ4SVQF6STY0","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M78F439T6S7EME6XMB7MG5CV","using-superpowers","Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions","https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers\u002Fskills\u002Fusing-superpowers\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M78F3ZZ8QFXAFBK5ZBMW1S9F","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002FCharlesHoskinson\u002Fforeman\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers\u002Fskills\u002Fusing-git-worktrees\u002FSKILL.md",[],[]]