[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CX5GMDB09YH2QX4QQ65Y3T":3,"skill-same:01M6CX5GMDB09YH2QX4QQ65Y3T":56},{"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":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M6CX5GMDB09YH2QX4QQ65Y3T","testing",null,"How to write and run tests in the ChangeDown monorepo. Use before writing any test code.","hackerbara\u002Fchangedown","hackerbara","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F264918693?v=4","01M6CX5543NWWB79REVZ03HFRR","Hackerbara","01M6CX558R4QPPWP1DKSYEXFF5",6,"MIT","https:\u002F\u002Fgithub.com\u002Fhackerbara\u002Fchangedown\u002Fblob\u002Fmain\u002Fpackages\u002Ftests\u002Fskills\u002Ftesting\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28],"writing","test","run tests","run","code","how","monorepo","write","use","changedown","2026-11-10 10:12:30",false,"---\nname: testing\ndescription: How to write and run tests in the ChangeDown monorepo. Use before writing any test code.\n---\n\n# ChangeDown Testing Guide\n\n## Two-Tier Testing Model\n\nThis project follows Paul Duvall's ATDD two-tier model:\n\n**Tier 1 — Gherkin (behaviors):** Every user-facing capability has a `.feature` file. Write the feature file FIRST, then implement. This is the behavioral contract.\n\n**Tier 2 — Native (edge cases):** Parser permutations, data-driven matrices, and internal function tests use `.test.ts` files with Mocha or Vitest. These cover exhaustive edge cases that don't need Gherkin ceremony.\n\n**Rule:** No implementation without a corresponding behavioral spec. Write the `.feature` file first.\n\n## Decision Tree\n\n```\nIs this a user-facing behavior, capability, or flow?\n  YES → Write a .feature file FIRST\n    VS Code extension behavior? → @slow tag, packages\u002Ftests\u002Fvscode\u002Ffeatures\u002F\n    Core\u002Fengine\u002Fhooks\u002Fmcp behavior? → packages\u002Ftests\u002Ffeatures\u002F\n  NO → Edge-case matrix or internal function test?\n    YES → .test.ts file (Mocha for core\u002Flsp, Vitest for engine\u002Fmcp\u002Fhooks)\n    NO → Does this test need to exist?\n```\n\n## Directory Map\n\n| What | Where | Runner |\n|------|-------|--------|\n| Core behavioral features | `packages\u002Ftests\u002Ffeatures\u002Fcore\u002F*.feature` | cucumber-js |\n| Engine behavioral features | `packages\u002Ftests\u002Ffeatures\u002Fengine\u002F*.feature` | cucumber-js |\n| Hooks behavioral features | `packages\u002Ftests\u002Ffeatures\u002Fhooks\u002F*.feature` | cucumber-js |\n| MCP journey features | `packages\u002Ftests\u002Ffeatures\u002Fjourneys\u002F*.feature` | cucumber-js |\n| MCP operation features | `packages\u002Ftests\u002Ffeatures\u002Fops\u002F*.feature` | cucumber-js |\n| VS Code extension features | `packages\u002Ftests\u002Fvscode\u002Ffeatures\u002F*.feature` | cucumber-js + Playwright |\n| Core unit tests | `packages\u002Ftests\u002Fcore\u002F*.test.ts` | Mocha |\n| Engine unit tests | `packages\u002Ftests\u002Fengine\u002F*.test.ts` | Vitest |\n| LSP unit tests | `packages\u002Ftests\u002Flsp\u002F*.test.ts` | Mocha |\n| MCP unit tests | `packages\u002Ftests\u002Fmcp\u002F*.test.ts` | Vitest |\n| Hooks unit tests | `packages\u002Ftests\u002Fhooks\u002F*.test.ts` | Vitest |\n| Step definitions (core) | `packages\u002Ftests\u002Ffeatures\u002Fsteps\u002F` | — |\n| Step definitions (vscode) | `packages\u002Ftests\u002Fvscode\u002Ffeatures\u002Fsteps\u002F` | — |\n\n## Search Before You Create\n\nBefore writing a new step definition → grep existing `steps\u002F` directories for similar patterns.\nBefore creating a helper function → check `packages\u002Ftests\u002Fvscode\u002Fjourneys\u002FplaywrightHarness.ts`.\nBefore adding a bridge command → check `packages\u002Fvscode-extension\u002Fsrc\u002Fcommands\u002Ftest-commands.ts`.\n\n## VS Code Extension Testing\n\nVS Code extension tests use Playwright to control an Electron instance. The harness has specific patterns that MUST be followed:\n\n**Bridge commands (use these, not command palette):**\n- `executeCommandViaBridge(page, 'changedown.commandName')` — reliable command execution\n- `updateSettingDirect(page, key, value)` — write to settings.json directly\n- `getDocumentText(page, { instanceId })` — reads temp file IPC, not Monaco DOM\n- `queryPanelState(page)` — reads panel state via bridge (local helper in panel.steps.ts)\n\n**NEVER do these:**\n- NEVER use `executeCommand()` via command palette (MRU fuzzy-match breaks)\n- NEVER use command palette for settings changes\n- NEVER read Monaco DOM directly for document text\n- NEVER probe webview iframe DOM for panel state\n\n**Polling pattern:** 200ms intervals, 3s timeout, timestamp validation for stale reads.\n\n**Instance batching:** VS Code instances are shared per fixture file across scenarios. Use `@destructive` tag for scenarios that modify fixture files.\n\n**Existing bridge commands in test-commands.ts:**\n`_testQueryPanelState`, `_testGetDocumentText`, `_testResetDocument`, `_testExecuteCommand`, `_testPasteClipboard`, `_testUpdateSetting`, `_testWaitForChanges`, `_testGetCursorPosition`\n\n## Test Output Persistence\n\nALWAYS capture test output to a dated file in `docs\u002Ffindings\u002F`:\n\n```bash\n# Correct — output is saved for other agents to analyze\nnpm run test:slow 2>&1 | tee docs\u002Ffindings\u002FYYYY-MM-DD-slow-suite-run.txt\n\n# WRONG — output lost, forces expensive re-run\nnpm run test:slow\nnpm run test:slow | tail -5\nnpm run test:slow > \u002Ftmp\u002Fresults.txt\n```\n\nOther agents need to read results without re-running a 5-minute suite. Never pipe to `\u002Ftmp\u002F` (cleared on reboot) or discard output.\n\n## Cross-Package Verification\n\nWhen a change touches shared code, verify across surfaces:\n\n| Changed | Also run |\n|---------|----------|\n| Core parser | MCP journey features + VS Code `@fast` + `@slow` decoration scenarios |\n| Footnote format | Core features + MCP propose\u002Freview journeys + VS Code accept\u002Freject |\n| Decoration logic | VS Code `@slow` D1-D9 + visual regression |\n| Hook behavior | Hooks features H1-H5 + VS Code tracking scenarios |\n| Status\u002Fmetadata chain | Review panel scenarios + hover scenarios + MCP read features |\n\nRun the affected cross-package scenarios, not just the unit tests in the package you changed.\n\n## Run Commands\n\n```bash\n# Build everything first (always)\nnpm run build\n\n# Core\u002Fengine\u002Fhooks\u002Fmcp cucumber features\ncd packages\u002Ftests && \u002Fusr\u002Fbin\u002Fenv npx cucumber-js --config features\u002Fcucumber.mjs\n\n# VS Code @fast (parser, in-process, \u003C1s)\ncd packages\u002Ftests\u002Fvscode && npm run test:fast\n\n# VS Code @slow (Playwright + VS Code, 3-5 min)\ncd packages\u002Ftests\u002Fvscode && npm run test:slow\n\n# Single scenario by tag\ncd packages\u002Ftests\u002Fvscode && npm run test:slow -- --tags '@J5'\n\n# Single scenario by name\ncd packages\u002Ftests\u002Fvscode && \u002Fusr\u002Fbin\u002Fenv npx cucumber-js --config features\u002Fcucumber.mjs --name 'tracks insertion'\n\n# Unit tests\ncd packages\u002Ftests && npm run test:vitest   # engine\u002Fmcp\u002Fhooks\ncd packages\u002Ftests && npm run test:mocha    # core\u002Flsp\n\n# ALWAYS tee output for other agents\nnpm run test:slow 2>&1 | tee docs\u002Ffindings\u002FYYYY-MM-DD-description.txt\n```\n","# ChangeDown Testing Guide\n\n## Two-Tier Testing Model\n\nThis project follows Paul Duvall's ATDD two-tier model:\n\n**Tier 1 — Gherkin (behaviors):** Every user-facing capability has a `.feature` file. Write the feature file FIRST, then implement. This is the behavioral contract.\n\n**Tier 2 — Native (edge cases):** Parser permutations, data-driven matrices, and internal function tests use `.test.ts` files with Mocha or Vitest. These cover exhaustive edge cases that don't need Gherkin ceremony.\n\n**Rule:** No implementation without a corresponding behavioral spec. Write the `.feature` file first.\n\n## Decision Tree\n\n```\nIs this a user-facing behavior, capability, or flow?\n  YES → Write a .feature file FIRST\n    VS Code extension behavior? → @slow tag, packages\u002Ftests\u002Fvscode\u002Ffeatures\u002F\n    Core\u002Fengine\u002Fhooks\u002Fmcp behavior? → packages\u002Ftests\u002Ffeatures\u002F\n  NO → Edge-case matrix or internal function test?\n    YES → .test.ts file (Mocha for core\u002Flsp, Vitest for engine\u002Fmcp\u002Fhooks)\n    NO → Does this test need to exist?\n```\n\n## Directory Map\n\n| What | Where | Runner |\n|------|-------|--------|\n| Core behavioral features | `packages\u002Ftests\u002Ffeatures\u002Fcore\u002F*.feature` | cucumber-js |\n| Engine behavioral features | `packages\u002Ftests\u002Ffeatures\u002Fengine\u002F*.feature` | cucumber-js |\n| Hooks behavioral features | `packages\u002Ftests\u002Ffeatures\u002Fhooks\u002F*.feature` | cucumber-js |\n| MCP journey features | `packages\u002Ftests\u002Ffeatures\u002Fjourneys\u002F*.feature` | cucumber-js |\n| MCP operation features | `packages\u002Ftests\u002Ffeatures\u002Fops\u002F*.feature` | cucumber-js |\n| VS Code extension features | `packages\u002Ftests\u002Fvscode\u002Ffeatures\u002F*.feature` | cucumber-js + Playwright |\n| Core unit tests | `packages\u002Ftests\u002Fcore\u002F*.test.ts` | Mocha |\n| Engine unit tests | `packages\u002Ftests\u002Fengine\u002F*.test.ts` | Vitest |\n| LSP unit tests | `packages\u002Ftests\u002Flsp\u002F*.test.ts` | Mocha |\n| MCP unit tests | `packages\u002Ftests\u002Fmcp\u002F*.test.ts` | Vitest |\n| Hooks unit tests | `packages\u002Ftests\u002Fhooks\u002F*.test.ts` | Vitest |\n| Step definitions (core) | `packages\u002Ftests\u002Ffeatures\u002Fsteps\u002F` | — |\n| Step definitions (vscode) | `packages\u002Ftests\u002Fvscode\u002Ffeatures\u002Fsteps\u002F` | — |\n\n## Search Before You Create\n\nBefore writing a new step definition → grep existing `steps\u002F` directories for similar patterns.\nBefore creating a helper function → check `packages\u002Ftests\u002Fvscode\u002Fjourneys\u002FplaywrightHarness.ts`.\nBefore adding a bridge command → check `packages\u002Fvscode-extension\u002Fsrc\u002Fcommands\u002Ftest-commands.ts`.\n\n## VS Code Extension Testing\n\nVS Code extension tests use Playwright to control an Electron instance. The harness has specific patterns that MUST be followed:\n\n**Bridge commands (use these, not command palette):**\n- `executeCommandViaBridge(page, 'changedown.commandName')` — reliable command execution\n- `updateSettingDirect(page, key, value)` — write to settings.json directly\n- `getDocumentText(page, { instanceId })` — reads temp file IPC, not Monaco DOM\n- `queryPanelState(page)` — reads panel state via bridge (local helper in panel.steps.ts)\n\n**NEVER do these:**\n- NEVER use `executeCommand()` via command palette (MRU fuzzy-match breaks)\n- NEVER use command palette for settings changes\n- NEVER read Monaco DOM directly for document text\n- NEVER probe webview iframe DOM for panel state\n\n**Polling pattern:** 200ms intervals, 3s timeout, timestamp validation for stale reads.\n\n**Instance batching:** VS Code instances are shared per fixture file across scenarios. Use `@destructive` tag for scenarios that modify fixture files.\n\n**Existing bridge commands in test-commands.ts:**\n`_testQueryPanelState`, `_testGetDocumentText`, `_testResetDocument`, `_testExecuteCommand`, `_testPasteClipboard`, `_testUpdateSetting`, `_testWaitForChanges`, `_testGetCursorPosition`\n\n## Test Output Persistence\n\nALWAYS capture test output to a dated file in `docs\u002Ffindings\u002F`:\n\n```bash\n# Correct — output is saved for other agents to analyze\nnpm run test:slow 2>&1 | tee docs\u002Ffindings\u002FYYYY-MM-DD-slow-suite-run.txt\n\n# WRONG — output lost, forces expensive re-run\nnpm run test:slow\nnpm run test:slow | tail -5\nnpm run test:slow > \u002Ftmp\u002Fresults.txt\n```\n\nOther agents need to read results without re-running a 5-minute suite. Never pipe to `\u002Ftmp\u002F` (cleared on reboot) or discard output.\n\n## Cross-Package Verification\n\nWhen a change touches shared code, verify across surfaces:\n\n| Changed | Also run |\n|---------|----------|\n| Core parser | MCP journey features + VS Code `@fast` + `@slow` decoration scenarios |\n| Footnote format | Core features + MCP propose\u002Freview journeys + VS Code accept\u002Freject |\n| Decoration logic | VS Code `@slow` D1-D9 + visual regression |\n| Hook behavior | Hooks features H1-H5 + VS Code tracking scenarios |\n| Status\u002Fmetadata chain | Review panel scenarios + hover scenarios + MCP read features |\n\nRun the affected cross-package scenarios, not just the unit tests in the package you changed.\n\n## Run Commands\n\n```bash\n# Build everything first (always)\nnpm run build\n\n# Core\u002Fengine\u002Fhooks\u002Fmcp cucumber features\ncd packages\u002Ftests && \u002Fusr\u002Fbin\u002Fenv npx cucumber-js --config features\u002Fcucumber.mjs\n\n# VS Code @fast (parser, in-process, \u003C1s)\ncd packages\u002Ftests\u002Fvscode && npm run test:fast\n\n# VS Code @slow (Playwright + VS Code, 3-5 min)\ncd packages\u002Ftests\u002Fvscode && npm run test:slow\n\n# Single scenario by tag\ncd packages\u002Ftests\u002Fvscode && npm run test:slow -- --tags '@J5'\n\n# Single scenario by name\ncd packages\u002Ftests\u002Fvscode && \u002Fusr\u002Fbin\u002Fenv npx cucumber-js --config features\u002Fcucumber.mjs --name 'tracks insertion'\n\n# Unit tests\ncd packages\u002Ftests && npm run test:vitest   # engine\u002Fmcp\u002Fhooks\ncd packages\u002Ftests && npm run test:mocha    # core\u002Flsp\n\n# ALWAYS tee output for other agents\nnpm run test:slow 2>&1 | tee docs\u002Ffindings\u002FYYYY-MM-DD-description.txt\n```\n",{"name":5,"description":7},"main","bf0b4d0cdd73c147890238c7fd0b2fd6111bf50a","packages\u002Ftests\u002Fskills\u002Ftesting",0,"https:\u002F\u002Fgithub.com\u002Fhackerbara\u002Fchangedown","https:\u002F\u002Fgithub.com\u002Fhackerbara","just a lil guy hacking away","2026-05-21 11:44:44",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add hackerbara\u002Fchangedown --skill testing",{"tool":48,"command":49},"bunx","bunx skills add hackerbara\u002Fchangedown --skill testing",{"tool":51,"command":52},"pnpm","pnpm dlx skills add hackerbara\u002Fchangedown --skill testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhackerbara\u002Fchangedown\u002Fblob\u002Fmain\u002Fpackages\u002Ftests\u002Fskills\u002Ftesting\u002FSKILL.md",true,[],[57,62,68,78],{"skillNo":58,"name":28,"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":59,"categories":60,"keywords":61,"publishedAt":29},"01M6CX5FMSB8RY3FSAHR724NDZ","https:\u002F\u002Fgithub.com\u002Fhackerbara\u002Fchangedown\u002Fblob\u002Fmain\u002Fpackages\u002Fopencode-plugin\u002Fskills\u002Fchangedown\u002FSKILL.md",[],[28],{"skillNo":63,"name":64,"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":65,"categories":66,"keywords":67,"publishedAt":29},"01M6CX5EJ8T7AHWM4VDWBGCVQ1","instructions","https:\u002F\u002Fgithub.com\u002Fhackerbara\u002Fchangedown\u002Fblob\u002Fmain\u002Fpackages\u002Fopencode-plugin\u002Finstructions\u002FSKILL.md",[],[64],{"skillNo":69,"name":28,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":29},"01M6CX5B3H2T094MZW6PTVG69D","Durable change tracking with annotations for AI agents","https:\u002F\u002Fgithub.com\u002Fhackerbara\u002Fchangedown\u002Fblob\u002Fmain\u002Fchangedown-plugin\u002Fskills\u002Fchangedown\u002FSKILL.md",[],[28,74,75,76,77],"tracking","annotations","change","ai agents",{"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":29},"01M6CX588W21TV4K6YEDE2J90F","changedown-codex","Use ChangeDown from Codex via MCP to read tracked Markdown, propose durable CriticMarkup changes, review changes, and work with active Word sessions. Use before editing Markdown in a ChangeDown-tracked project or when the user mentions ChangeDown, tracked changes, CriticMarkup, review changes, or word:\u002F\u002F sessions.","https:\u002F\u002Fgithub.com\u002Fhackerbara\u002Fchangedown\u002Fblob\u002Fmain\u002Fchangedown-plugin\u002Fskills\u002Fchangedown-codex\u002FSKILL.md",[],[85,86,27,87,88,89,90,91,92,93,94,95,96,97,98],"codex","changedown codex","project","active","MCP","user","read","editing","work","Word","markdown","review changes","sessions","review"]