[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71JV3JQW4BJGTSP409G70P9":3,"skill-same:01M71JV3JQW4BJGTSP409G70P9":79},{"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":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":55,"commitSha":56,"skillDirectory":57,"forksCount":58,"repositoryHtmlUrl":59,"repositoryHomepageUrl":60,"ownerHtmlUrl":61,"ownerBlogUrl":62,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M71JV3JQW4BJGTSP409G70P9","code-verification",null,"Use after every code change, after writing tests, or before marking a task complete, and when the user says verify, quality gate, or audit code. Runs a 7-category mechanical check for TDZ, import, dead code, and mock leakage bugs.","coco-research\u002Fcoco","coco-research","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F68911604?v=4","01M71JRE9C4NM4NSZM4JD0BJTB","Coco Research","01M71JREA0ZMR0PMH3CKA99SN1",631,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco\u002Fblob\u002Fmain\u002Fskills\u002Fcode-verification\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"code verification","code","verification","mechanical","code change","when","bugs","for","mock","import","complete","tests","writing","task","use","dead code","audit","writing tests","quality gate","change","2026-11-10 10:12:30",false,"---\nname: code-verification\ndescription: \"Use after every code change, after writing tests, or before marking a task complete, and when the user says verify, quality gate, or audit code. Runs a 7-category mechanical check for TDZ, import, dead code, and mock leakage bugs.\"\ndomain: engineering\n---\n\n# Code Verification Skill\n\nA systematic post-implementation verification workflow that catches the bugs AI coding assistants most commonly introduce. This is NOT a code review for style or architecture — it is a mechanical correctness checklist that catches structural errors (TDZ, imports, dead code, mock leakage, CSS orphans, React anti-patterns) that humans and AI both miss during implementation.\n\n## When to Use\n\n- **After every code change** (1-2 files changed -> run immediately)\n- **After a multi-file feature** (run on all changed files in one pass)\n- **After writing\u002Fmodifying tests** (switch to Test Verification mode)\n- **Before marking any task complete** (final gate)\n- **When a subagent completes work** (verify their output)\n- **When user says**: \"verify\", \"check quality\", \"audit code\", \"run verification\", \"quality gate\", \"pre-commit check\"\n\n## Quick Start\n\n```\n1. Identify changed files (git diff --name-only or manual list)\n2. Run the 7-category checklist below on each file\n3. Run automated checks (build, lint, tests)\n4. Report findings as PASS \u002F FAIL \u002F WARNING\n5. Fix all FAIL items before proceeding\n```\n\n---\n\n## The 7-Category Verification Checklist\n\n### Category 1: Variable Declaration Order (TDZ Prevention)\n\n**What to check:** Variables, constants, and hooks used BEFORE their declaration in the same scope.\n\n**How it breaks:** JavaScript `const` and `let` have a \"temporal dead zone\" — referencing them before their declaration line throws `ReferenceError` at runtime, but no build error.\n\n**React-specific**: `useMemo`, `useCallback`, `useEffect` that reference state or derived values declared later in the component. This is the #1 AI-introduced bug.\n\n**Scan pattern:**\n- For every `useMemo`, `useCallback`, `useEffect`: check that ALL variables in the dependency array AND the callback body are declared ABOVE that hook.\n- For every function that references a `const`\u002F`let`: check the declaration is above the function definition.\n- For every destructured import used in a module-level `const`: check for circular dependencies.\n\n**Real examples caught:**\n- `activeQuestions` useMemo referenced 150 lines before its declaration\n- `baseDeps` used in JSX but handler functions declared 100 lines later\n- `DR_FIELDS` referenced in `NFR_CATALOG` before `export const DR_FIELDS` line\n\n**Fix:** Move the declaration above all usages. If it's a React hook, reorder hooks so dependencies come first.\n\n---\n\n### Category 2: Import\u002FExport Integrity\n\n**What to check:** Every import resolves to a real export. Named vs default matches.\n\n**How it breaks:** Build may succeed (tree-shaking ignores dead imports in dev mode) but runtime throws `undefined is not a function`.\n\n**Scan pattern:**\n- For each `import { X } from '.\u002Ffile'`: open `.\u002Ffile` and confirm `export { X }` or `export const X` or `export function X` exists.\n- For each `import X from '.\u002Ffile'`: confirm `export default X` exists.\n- Flag: `import { X } from '.\u002Ffile'` when file only has `export default X` (or vice versa).\n\n**Real examples caught:**\n- `useResizeHandle` imported as default when it's a named export\n- `ConfluencePagePicker` imported as default when it's a named export\n- Removed component still imported in 3 files\n\n**Automated check:**\n```bash\nnpx eslint --rule '{\"import\u002Fnamed\": \"error\", \"import\u002Fdefault\": \"error\"}' src\u002F\n```\n\n---\n\n### Category 3: Reference Integrity\n\n**What to check:** After any rename\u002Fremove\u002Fmove, ALL usages of the old name are updated.\n\n**Scan pattern:**\n- Search for ALL usages of the old name across the project\n- Verify zero references remain to removed identifiers\n- Check that moved code doesn't reference variables from its old scope\n\n**Real examples caught:**\n- `setPrdDocViewMode` was removed but `Cmd+E` handler still called it\n- Removed component still imported in 3 files\n\n```javascript\n\u002F\u002F BUG: setPrdDocViewMode was removed but Cmd+E handler still calls it\nuseEffect(() => {\n  const handler = (e) => {\n    if (e.metaKey && e.key === 'e') setPrdDocViewMode(prev => ...);  \u002F\u002F ReferenceError\n  };\n}, []);\n```\n\n---\n\n### Category 4: Dead Code Detection\n\n**What to check:** Unused imports, unreachable code, orphaned handlers.\n\n**Scan pattern:**\n- Unused imports: variable imported but never referenced in file body.\n- Orphaned event handlers: `onClick={handleFoo}` removed from JSX but `const handleFoo = ...` still declared.\n- Unreachable code: `return` before a code block, `if (false)` guard, feature-flagged code where flag is always false.\n- State setters never called: `const [x, setX] = useState()` where `setX` appears nowhere.\n- Functions defined but never called.\n\n**Automated check:**\n```bash\nnpx eslint --rule '{\"no-unused-vars\": \"error\", \"no-unreachable\": \"error\"}' src\u002Ffile.jsx\n```\n\n---\n\n### Category 5: React State & Effects\n\n**What to check:** State variables are used, effects clean up, no updates after unmount, correct dependencies.\n\n#### 5.1 Component Reuse Bugs\nWhen the same component renders for multiple routes (e.g., `OperationalDocEditor` for DR\u002FIRP\u002FRecovery):\n- Does it have a `key={uniqueId}` to force remount on route change?\n- Does it reset internal state when props change?\n\n#### 5.2 Effect Dependencies\nFor every `useEffect`:\n- Are all referenced variables in the dependency array?\n- Are object\u002Farray deps stable (memoized) or will they trigger infinite re-renders?\n- Does the cleanup function undo what the effect created?\n\n#### 5.3 Ref Safety\n- Is `ref.current` used in the render return? (Should be state instead — ref changes don't trigger re-render)\n- Are refs initialized before first access? (Common with resize handles)\n- Does `useRef` get set in an effect that runs after the component mounts?\n\n#### 5.4 Async State Updates\n- Does any async callback (fetch, setTimeout) update state after potential unmount?\n- Is there a cleanup function that cancels pending operations?\n- Every `useEffect` that calls an async function should have an abort\u002Fcancel mechanism.\n\n**Real examples caught:**\n- `initialLoadRef` set to `true` before async data arrived, blocking subsequent updates\n- `useResizeHandle` ref null on mount because empty state rendered first (MutationObserver fix needed)\n- DR\u002FIRP\u002FRecovery shared `OperationalDocEditor` reused state across route changes (fixed with `key={docType}`)\n- `prdDocViewMode` state removed but `Cmd+E` handler still called `setPrdDocViewMode`\n\n#### Common React Anti-Patterns\n\n| Anti-Pattern | Why It Breaks | Fix |\n|---|---|---|\n| Mutating state directly (`state.push(x)`) | React won't re-render | `setState([...state, x])` |\n| Object\u002Farray in `useEffect` deps | New reference every render -> infinite loop | `useMemo` the dep, or use primitive |\n| `ref.current` in render return | Ref changes don't trigger re-render | Use state instead |\n| `history.pushState` with `#fragment` in hash router | Double-hash URL breaks navigation | Use state-based tracking |\n| Inline object as prop (`style={{ color: 'red' }}`) | New reference every render, breaks `memo` | Extract to `useMemo` or module-level const |\n| `useEffect` missing cleanup for async | State update on unmounted component | AbortController or mounted flag |\n\n---\n\n### Category 6: Mock Isolation (Test Files Only)\n\n**What to check:** Mocks don't leak between tests. Fake timers are restored. Tests are meaningful.\n\n#### 6.1 Mock Leakage\n- `vi.mock()` \u002F `jest.mock()` at module level: OK\n- `mockImplementation()` inside a `describe` without `afterEach(() => mock.mockReset())`: LEAK RISK\n- `vi.useFakeTimers()` without corresponding `vi.useRealTimers()` in `afterEach`: LEAK\n- `mockResolvedValueOnce` chains: fragile if test execution order changes. Prefer `mockImplementation` that inspects the call.\n- Multiple `describe` blocks sharing the same `fetch.mock` without isolation: INTERFERENCE\n\n#### 6.2 Tautological Tests\nTests that can never fail:\n- Asserting a mock's return value equals itself\n- `expect(x).toBeDefined()` where x is hardcoded in setup\n- `expect(fn).toHaveBeenCalled()` immediately after calling fn yourself\n- `expect(array.length).toBeGreaterThanOrEqual(0)` (always true)\n\n#### 6.3 Query Specificity\n- `getByText` \u002F `getByRole` that matches multiple elements -> use `getAllBy*` or scope with `within()`\n- Tests that pass because they find the wrong element (e.g., finding a button label that also appears in a tooltip)\n\n#### 6.4 Meaningful Assertions\n- Every test should have at least one assertion\n- Tests should assert behavior, not just \"it renders\"\n- Snapshot tests should be small enough to review\n\n**Real examples caught:**\n- Jira test: `mockResolvedValueOnce` chain broke when test order changed; fixed with request-inspecting `mockImplementation`\n- `ConfluencePagePicker`: fake timers from one test leaked into search filter test\n- `NFRTracker`: missing `SettingsContext` mock caused cascading failures\n\n---\n\n### Category 7: CSS Class Integrity\n\n**What to check:** Every `className` in JSX has a corresponding CSS rule. No orphaned selectors.\n\n#### 7.1 Class Name Integrity\n- Extract all `className=\"...\"` and `className={`...`}` values from the JSX file.\n- For each class, search the associated CSS file(s) for `.classname`.\n- Flag: class used in JSX but not defined in CSS (will silently fail — no visual, no error).\n- Flag: class defined in CSS but not used in any JSX (dead CSS — bloat).\n\n**Note:** Dynamic classes like `className={isActive ? 'active' : ''}` need both branches checked.\n\n#### 7.2 CSS Variable Integrity\nFor every `var(--token)` in CSS:\n- Is the variable defined in `:root` or a parent selector?\n- Is it defined for both light and dark themes?\n\n---\n\n## Automated Verification Script\n\nRun these commands after any code change:\n\n```bash\n# 1. Build check\nnpm run build\n\n# 2. Lint check (catches unused vars, unreachable code)\nnpx eslint src\u002Fpath\u002Fto\u002Fchanged\u002Ffile.jsx\n\n# 3. Test check (run tests for changed file)\nnpx vitest run src\u002Fpath\u002Fto\u002Fchanged\u002Ffile.test.jsx\n\n# 4. Full suite (after a feature is complete)\nnpx vitest run\n\n# 5. Circular dependency check (if available)\nnpx madge --circular src\u002F\n```\n\n---\n\n## Report Template\n\nUse this format when reporting verification results:\n\n```markdown\n## Verification Report — [Project Name]\n**Date:** [YYYY-MM-DD]\n**Files checked:** [list]\n**Tool:** code-verification skill\n\n### PASS\n- `path\u002Fto\u002Ffile.jsx` — All 7 categories checked, no issues\n\n### FAIL (must fix before proceeding)\n- `path\u002Fto\u002Ffile.jsx:142` — [CAT 1: TDZ] `activeQuestions` referenced before declaration\n  **Fix:** Move `const activeQuestions = useMemo(...)` to line 95 (before `showClarifyingQuestions`)\n\n### WARNING (review, may be intentional)\n- `path\u002Fto\u002Ffile.jsx:88` — [CAT 4: DEAD CODE] `const [oldState, setOldState]` — setOldState never called\n  **Likely:** Leftover from removed feature. Remove if confirmed unused.\n\n### Summary\n| Category | Pass | Fail | Warn |\n|----------|------|------|------|\n| 1. TDZ | 4 | 1 | 0 |\n| 2. Imports | 5 | 0 | 0 |\n| 3. References | 5 | 0 | 0 |\n| 4. Dead Code | 4 | 0 | 1 |\n| 5. React State | 3 | 0 | 2 |\n| 6. Mocks | 3 | 0 | 1 |\n| 7. CSS | 5 | 0 | 0 |\n```\n\n---\n\n## Integration with Agents\n\nThis skill is the workflow. The agents are the executors:\n\n| Agent | Role | When |\n|-------|------|------|\n| Inline (main agent) | Runs Categories 1-5, 7 on product code | After implementation |\n| `test-guardian` | Runs Category 6 on test code | After writing tests |\n| `code-reviewer` | Broader quality review (SOLID, perf, security) | Before merge\u002Fdeploy |\n\n## Integration with Rules\n\n| Rule | Role | When |\n|------|------|------|\n| `verification-workflow.mdc` | Merged quality gate + pre-implementation checklist, enforced after every change | Always (auto-applied) |\n| `code-quality.mdc` | Documentation, error handling, and logging standards | When editing JS\u002FTS\u002FJSX\u002FPY |\n\n## Quick Commands\n\n```bash\n# Run all tests for a specific file\nnpx vitest run path\u002Fto\u002Ffile.test.jsx\n\n# Run full test suite\nnpx vitest run\n\n# Build check\nnpm run build\n\n# Lint check\nnpx eslint src\u002Fpath\u002Fto\u002Fchanged\u002Ffile.jsx\n```\n\n## When to Skip Verification\n\n- Editing **only** markdown, docs, or comments (no executable code)\n- Adding a `TODO` comment\n- Changing **only** CSS values (not selectors or class names)\n- Reverting a commit (restoring known-good state)\n\n## When Verification is MANDATORY (No Exceptions)\n\n- Any `.jsx`, `.js`, `.ts`, `.tsx` file edit\n- Any file rename or move\n- Any import\u002Fexport change\n- Any React hook addition, removal, or reordering\n- Any state variable addition or removal\n- Any test file modification\n- After running `npm install` or changing `package.json`\n- After merging branches or resolving conflicts\n- After a subagent completes work in another window\n","# Code Verification Skill\n\nA systematic post-implementation verification workflow that catches the bugs AI coding assistants most commonly introduce. This is NOT a code review for style or architecture — it is a mechanical correctness checklist that catches structural errors (TDZ, imports, dead code, mock leakage, CSS orphans, React anti-patterns) that humans and AI both miss during implementation.\n\n## When to Use\n\n- **After every code change** (1-2 files changed -> run immediately)\n- **After a multi-file feature** (run on all changed files in one pass)\n- **After writing\u002Fmodifying tests** (switch to Test Verification mode)\n- **Before marking any task complete** (final gate)\n- **When a subagent completes work** (verify their output)\n- **When user says**: \"verify\", \"check quality\", \"audit code\", \"run verification\", \"quality gate\", \"pre-commit check\"\n\n## Quick Start\n\n```\n1. Identify changed files (git diff --name-only or manual list)\n2. Run the 7-category checklist below on each file\n3. Run automated checks (build, lint, tests)\n4. Report findings as PASS \u002F FAIL \u002F WARNING\n5. Fix all FAIL items before proceeding\n```\n\n---\n\n## The 7-Category Verification Checklist\n\n### Category 1: Variable Declaration Order (TDZ Prevention)\n\n**What to check:** Variables, constants, and hooks used BEFORE their declaration in the same scope.\n\n**How it breaks:** JavaScript `const` and `let` have a \"temporal dead zone\" — referencing them before their declaration line throws `ReferenceError` at runtime, but no build error.\n\n**React-specific**: `useMemo`, `useCallback`, `useEffect` that reference state or derived values declared later in the component. This is the #1 AI-introduced bug.\n\n**Scan pattern:**\n- For every `useMemo`, `useCallback`, `useEffect`: check that ALL variables in the dependency array AND the callback body are declared ABOVE that hook.\n- For every function that references a `const`\u002F`let`: check the declaration is above the function definition.\n- For every destructured import used in a module-level `const`: check for circular dependencies.\n\n**Real examples caught:**\n- `activeQuestions` useMemo referenced 150 lines before its declaration\n- `baseDeps` used in JSX but handler functions declared 100 lines later\n- `DR_FIELDS` referenced in `NFR_CATALOG` before `export const DR_FIELDS` line\n\n**Fix:** Move the declaration above all usages. If it's a React hook, reorder hooks so dependencies come first.\n\n---\n\n### Category 2: Import\u002FExport Integrity\n\n**What to check:** Every import resolves to a real export. Named vs default matches.\n\n**How it breaks:** Build may succeed (tree-shaking ignores dead imports in dev mode) but runtime throws `undefined is not a function`.\n\n**Scan pattern:**\n- For each `import { X } from '.\u002Ffile'`: open `.\u002Ffile` and confirm `export { X }` or `export const X` or `export function X` exists.\n- For each `import X from '.\u002Ffile'`: confirm `export default X` exists.\n- Flag: `import { X } from '.\u002Ffile'` when file only has `export default X` (or vice versa).\n\n**Real examples caught:**\n- `useResizeHandle` imported as default when it's a named export\n- `ConfluencePagePicker` imported as default when it's a named export\n- Removed component still imported in 3 files\n\n**Automated check:**\n```bash\nnpx eslint --rule '{\"import\u002Fnamed\": \"error\", \"import\u002Fdefault\": \"error\"}' src\u002F\n```\n\n---\n\n### Category 3: Reference Integrity\n\n**What to check:** After any rename\u002Fremove\u002Fmove, ALL usages of the old name are updated.\n\n**Scan pattern:**\n- Search for ALL usages of the old name across the project\n- Verify zero references remain to removed identifiers\n- Check that moved code doesn't reference variables from its old scope\n\n**Real examples caught:**\n- `setPrdDocViewMode` was removed but `Cmd+E` handler still called it\n- Removed component still imported in 3 files\n\n```javascript\n\u002F\u002F BUG: setPrdDocViewMode was removed but Cmd+E handler still calls it\nuseEffect(() => {\n  const handler = (e) => {\n    if (e.metaKey && e.key === 'e') setPrdDocViewMode(prev => ...);  \u002F\u002F ReferenceError\n  };\n}, []);\n```\n\n---\n\n### Category 4: Dead Code Detection\n\n**What to check:** Unused imports, unreachable code, orphaned handlers.\n\n**Scan pattern:**\n- Unused imports: variable imported but never referenced in file body.\n- Orphaned event handlers: `onClick={handleFoo}` removed from JSX but `const handleFoo = ...` still declared.\n- Unreachable code: `return` before a code block, `if (false)` guard, feature-flagged code where flag is always false.\n- State setters never called: `const [x, setX] = useState()` where `setX` appears nowhere.\n- Functions defined but never called.\n\n**Automated check:**\n```bash\nnpx eslint --rule '{\"no-unused-vars\": \"error\", \"no-unreachable\": \"error\"}' src\u002Ffile.jsx\n```\n\n---\n\n### Category 5: React State & Effects\n\n**What to check:** State variables are used, effects clean up, no updates after unmount, correct dependencies.\n\n#### 5.1 Component Reuse Bugs\nWhen the same component renders for multiple routes (e.g., `OperationalDocEditor` for DR\u002FIRP\u002FRecovery):\n- Does it have a `key={uniqueId}` to force remount on route change?\n- Does it reset internal state when props change?\n\n#### 5.2 Effect Dependencies\nFor every `useEffect`:\n- Are all referenced variables in the dependency array?\n- Are object\u002Farray deps stable (memoized) or will they trigger infinite re-renders?\n- Does the cleanup function undo what the effect created?\n\n#### 5.3 Ref Safety\n- Is `ref.current` used in the render return? (Should be state instead — ref changes don't trigger re-render)\n- Are refs initialized before first access? (Common with resize handles)\n- Does `useRef` get set in an effect that runs after the component mounts?\n\n#### 5.4 Async State Updates\n- Does any async callback (fetch, setTimeout) update state after potential unmount?\n- Is there a cleanup function that cancels pending operations?\n- Every `useEffect` that calls an async function should have an abort\u002Fcancel mechanism.\n\n**Real examples caught:**\n- `initialLoadRef` set to `true` before async data arrived, blocking subsequent updates\n- `useResizeHandle` ref null on mount because empty state rendered first (MutationObserver fix needed)\n- DR\u002FIRP\u002FRecovery shared `OperationalDocEditor` reused state across route changes (fixed with `key={docType}`)\n- `prdDocViewMode` state removed but `Cmd+E` handler still called `setPrdDocViewMode`\n\n#### Common React Anti-Patterns\n\n| Anti-Pattern | Why It Breaks | Fix |\n|---|---|---|\n| Mutating state directly (`state.push(x)`) | React won't re-render | `setState([...state, x])` |\n| Object\u002Farray in `useEffect` deps | New reference every render -> infinite loop | `useMemo` the dep, or use primitive |\n| `ref.current` in render return | Ref changes don't trigger re-render | Use state instead |\n| `history.pushState` with `#fragment` in hash router | Double-hash URL breaks navigation | Use state-based tracking |\n| Inline object as prop (`style={{ color: 'red' }}`) | New reference every render, breaks `memo` | Extract to `useMemo` or module-level const |\n| `useEffect` missing cleanup for async | State update on unmounted component | AbortController or mounted flag |\n\n---\n\n### Category 6: Mock Isolation (Test Files Only)\n\n**What to check:** Mocks don't leak between tests. Fake timers are restored. Tests are meaningful.\n\n#### 6.1 Mock Leakage\n- `vi.mock()` \u002F `jest.mock()` at module level: OK\n- `mockImplementation()` inside a `describe` without `afterEach(() => mock.mockReset())`: LEAK RISK\n- `vi.useFakeTimers()` without corresponding `vi.useRealTimers()` in `afterEach`: LEAK\n- `mockResolvedValueOnce` chains: fragile if test execution order changes. Prefer `mockImplementation` that inspects the call.\n- Multiple `describe` blocks sharing the same `fetch.mock` without isolation: INTERFERENCE\n\n#### 6.2 Tautological Tests\nTests that can never fail:\n- Asserting a mock's return value equals itself\n- `expect(x).toBeDefined()` where x is hardcoded in setup\n- `expect(fn).toHaveBeenCalled()` immediately after calling fn yourself\n- `expect(array.length).toBeGreaterThanOrEqual(0)` (always true)\n\n#### 6.3 Query Specificity\n- `getByText` \u002F `getByRole` that matches multiple elements -> use `getAllBy*` or scope with `within()`\n- Tests that pass because they find the wrong element (e.g., finding a button label that also appears in a tooltip)\n\n#### 6.4 Meaningful Assertions\n- Every test should have at least one assertion\n- Tests should assert behavior, not just \"it renders\"\n- Snapshot tests should be small enough to review\n\n**Real examples caught:**\n- Jira test: `mockResolvedValueOnce` chain broke when test order changed; fixed with request-inspecting `mockImplementation`\n- `ConfluencePagePicker`: fake timers from one test leaked into search filter test\n- `NFRTracker`: missing `SettingsContext` mock caused cascading failures\n\n---\n\n### Category 7: CSS Class Integrity\n\n**What to check:** Every `className` in JSX has a corresponding CSS rule. No orphaned selectors.\n\n#### 7.1 Class Name Integrity\n- Extract all `className=\"...\"` and `className={`...`}` values from the JSX file.\n- For each class, search the associated CSS file(s) for `.classname`.\n- Flag: class used in JSX but not defined in CSS (will silently fail — no visual, no error).\n- Flag: class defined in CSS but not used in any JSX (dead CSS — bloat).\n\n**Note:** Dynamic classes like `className={isActive ? 'active' : ''}` need both branches checked.\n\n#### 7.2 CSS Variable Integrity\nFor every `var(--token)` in CSS:\n- Is the variable defined in `:root` or a parent selector?\n- Is it defined for both light and dark themes?\n\n---\n\n## Automated Verification Script\n\nRun these commands after any code change:\n\n```bash\n# 1. Build check\nnpm run build\n\n# 2. Lint check (catches unused vars, unreachable code)\nnpx eslint src\u002Fpath\u002Fto\u002Fchanged\u002Ffile.jsx\n\n# 3. Test check (run tests for changed file)\nnpx vitest run src\u002Fpath\u002Fto\u002Fchanged\u002Ffile.test.jsx\n\n# 4. Full suite (after a feature is complete)\nnpx vitest run\n\n# 5. Circular dependency check (if available)\nnpx madge --circular src\u002F\n```\n\n---\n\n## Report Template\n\nUse this format when reporting verification results:\n\n```markdown\n## Verification Report — [Project Name]\n**Date:** [YYYY-MM-DD]\n**Files checked:** [list]\n**Tool:** code-verification skill\n\n### PASS\n- `path\u002Fto\u002Ffile.jsx` — All 7 categories checked, no issues\n\n### FAIL (must fix before proceeding)\n- `path\u002Fto\u002Ffile.jsx:142` — [CAT 1: TDZ] `activeQuestions` referenced before declaration\n  **Fix:** Move `const activeQuestions = useMemo(...)` to line 95 (before `showClarifyingQuestions`)\n\n### WARNING (review, may be intentional)\n- `path\u002Fto\u002Ffile.jsx:88` — [CAT 4: DEAD CODE] `const [oldState, setOldState]` — setOldState never called\n  **Likely:** Leftover from removed feature. Remove if confirmed unused.\n\n### Summary\n| Category | Pass | Fail | Warn |\n|----------|------|------|------|\n| 1. TDZ | 4 | 1 | 0 |\n| 2. Imports | 5 | 0 | 0 |\n| 3. References | 5 | 0 | 0 |\n| 4. Dead Code | 4 | 0 | 1 |\n| 5. React State | 3 | 0 | 2 |\n| 6. Mocks | 3 | 0 | 1 |\n| 7. CSS | 5 | 0 | 0 |\n```\n\n---\n\n## Integration with Agents\n\nThis skill is the workflow. The agents are the executors:\n\n| Agent | Role | When |\n|-------|------|------|\n| Inline (main agent) | Runs Categories 1-5, 7 on product code | After implementation |\n| `test-guardian` | Runs Category 6 on test code | After writing tests |\n| `code-reviewer` | Broader quality review (SOLID, perf, security) | Before merge\u002Fdeploy |\n\n## Integration with Rules\n\n| Rule | Role | When |\n|------|------|------|\n| `verification-workflow.mdc` | Merged quality gate + pre-implementation checklist, enforced after every change | Always (auto-applied) |\n| `code-quality.mdc` | Documentation, error handling, and logging standards | When editing JS\u002FTS\u002FJSX\u002FPY |\n\n## Quick Commands\n\n```bash\n# Run all tests for a specific file\nnpx vitest run path\u002Fto\u002Ffile.test.jsx\n\n# Run full test suite\nnpx vitest run\n\n# Build check\nnpm run build\n\n# Lint check\nnpx eslint src\u002Fpath\u002Fto\u002Fchanged\u002Ffile.jsx\n```\n\n## When to Skip Verification\n\n- Editing **only** markdown, docs, or comments (no executable code)\n- Adding a `TODO` comment\n- Changing **only** CSS values (not selectors or class names)\n- Reverting a commit (restoring known-good state)\n\n## When Verification is MANDATORY (No Exceptions)\n\n- Any `.jsx`, `.js`, `.ts`, `.tsx` file edit\n- Any file rename or move\n- Any import\u002Fexport change\n- Any React hook addition, removal, or reordering\n- Any state variable addition or removal\n- Any test file modification\n- After running `npm install` or changing `package.json`\n- After merging branches or resolving conflicts\n- After a subagent completes work in another window\n",{"name":5,"domain":54,"description":7},"engineering","main","cd89f013b617f7eea982a9bbc60e992974fda2aa","skills\u002Fcode-verification",15,"https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco","https:\u002F\u002Fcocoresearch.org\u002Fcoco\u002F","https:\u002F\u002Fgithub.com\u002Fcoco-research","https:\u002F\u002Fcocoresearch.org","Local-first, open-source tools for people who work with AI agents: governed memory, agents that check their own work, and data that stays on your machine.","2026-11-11 12:18:13",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add coco-research\u002Fcoco --skill code-verification",{"tool":71,"command":72},"bunx","bunx skills add coco-research\u002Fcoco --skill code-verification",{"tool":74,"command":75},"pnpm","pnpm dlx skills add coco-research\u002Fcoco --skill code-verification","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco\u002Fblob\u002Fmain\u002Fskills\u002Fcode-verification\u002FSKILL.md",true,[],[80,105,115,131,166,185],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":87,"publishedAt":49},"01M71KEJXF9KMT0BWCMRSRFA4M","trading-super-intelligence","Trading Super Intelligence Team. Named real-world personas across 8 cells. Built local-first (LM Studio) and validator-gated. Illustrative composites; see DISCLAIMER.md.","https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco\u002Fblob\u002Fmain\u002Fsystems\u002Fsuperintelligence\u002Ftrading\u002FSKILL.md",[86],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],"super","trading super intelligence","intelligence","trading","validator","personas","local","composites","studio","team","across","world","first","gated","2026","lm studio","local-first",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":112,"publishedAt":49},"01M71KEFWS3CMAP7DF1P0FWTDE","strategy-super-intelligence","Strategy Super Intelligence Team. Named real-world personas across 7 cells. Built local-first (LM Studio) and validator-gated. Illustrative composites; see DISCLAIMER.md.","https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco\u002Fblob\u002Fmain\u002Fsystems\u002Fsuperintelligence\u002Fstrategy\u002FSKILL.md",[111],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[113,88,114,90,92,93,94,95,96,97,98,99,100,101,102,103,104],"strategy","strategy super intelligence",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":125,"publishedAt":49},"01M71KED56ZEPK2QE84QSQPMT0","risk-compliance-super-intelligence","Risk & Compliance (GRC) Super Intelligence Team. Named real-world personas across 7 cells. Built local-first (LM Studio) and validator-gated. Illustrative composites; see DISCLAIMER.md.","https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco\u002Fblob\u002Fmain\u002Fsystems\u002Fsuperintelligence\u002Frisk-compliance\u002FSKILL.md",[121,122],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":123,"categoryName":124,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000037","律师与法务",[126,88,127,128,129,90,92,93,94,95,130,96,97,98,99,100,101,102,103,104],"risk","risk compliance super intelligence","compliance","risk compliance","grc",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":150,"publishedAt":49},"01M71KE9A2FWSC74VA96W1EZSN","product-design-super-intelligence","Your product + design brain trust and decision partner. Named personas across 8 cells spanning product strategy, discovery\u002Fresearch, growth\u002Fmetrics, design foundations\u002Fusability, design leadership\u002Fcraft, UX\u002Fcontent, design systems, and a…","https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco\u002Fblob\u002Fmain\u002Fsystems\u002Fsuperintelligence\u002Fproduct-design\u002FSKILL.md",[137,140,143,144,147],{"categoryNo":138,"categoryName":139,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":141,"categoryName":142,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":145,"categoryName":146,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000031","产品经理",{"categoryNo":148,"categoryName":149,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000032","设计师",[151,152,90,153,88,154,155,156,157,158,159,97,98,160,161,102,162,163,164,165],"design","product","product design","product design super intelligence","foundations","product-design","decision","design systems","usability","leadership","ux","brain","craft","metrics","trust",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":174,"publishedAt":49},"01M71KE6H9FPSD9TECYFBPXZ8Y","legal-ip-super-intelligence","Your legal, IP, and regulatory brain trust. 31 named personas across 7 cells covering patent strategy, tech licensing, regulatory litigation, AI governance, open-source compliance, privacy law, and antitrust.","https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco\u002Fblob\u002Fmain\u002Fsystems\u002Fsuperintelligence\u002Flegal-ip\u002FSKILL.md",[172,173],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":123,"categoryName":124,"taxonomyType":26,"taxonomyTypeDesc":27},[175,88,176,90,177,178,165,179,93,180,181,182,113,97,98,183,128,184,102,162],"ip","legal ip super intelligence","legal","sep","tech","litigation","ai governance","open","open-source","governance",{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":192,"publishedAt":49},"01M71KE36QRY610V6YVB9JWRND","healthcare-life-sciences-super-intelligence","Your healthcare and life sciences brain trust. 25 named personas across 7 cells covering drug discovery, medtech, biotech strategy, health policy, genomics, clinical trials, and healthcare economics.","https:\u002F\u002Fgithub.com\u002Fcoco-research\u002Fcoco\u002Fblob\u002Fmain\u002Fsystems\u002Fsuperintelligence\u002Fhealthcare-life-sciences\u002FSKILL.md",[191],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[193,88,194,195,90,178,165,196,197,93,198,199,113,97,98,200,201,202,203,102],"healthcare","healthcare life sciences super intelligence","life","economics","discovery","policy","clinical","clinical trials","health","trials","genomics"]