anthropics/skills180kwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
浏览器与测试
搜索文档、Skill 和 MCP
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.
把这段话发给 Claude Code、Codex 或 Cursor。智能体会先检查安全性,你确认后才安装。
读取 https://funcoding.ai/skills/coco-research/coco/code-verification/install.md ,按里面的步骤帮我安装这个 Skill。
A 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.
1. Identify changed files (git diff --name-only or manual list)
2. Run the 7-category checklist below on each file
3. Run automated checks (build, lint, tests)
4. Report findings as PASS / FAIL / WARNING
5. Fix all FAIL items before proceeding
What to check: Variables, constants, and hooks used BEFORE their declaration in the same scope.
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.
React-specific: useMemo, useCallback, useEffect that reference state or derived values declared later in the component. This is the #1 AI-introduced bug.
Scan pattern:
useMemo, useCallback, useEffect: check that ALL variables in the dependency array AND the callback body are declared ABOVE that hook.const/let: check the declaration is above the function definition.const: check for circular dependencies.Real examples caught:
activeQuestions useMemo referenced 150 lines before its declarationbaseDeps used in JSX but handler functions declared 100 lines laterDR_FIELDS referenced in NFR_CATALOG before export const DR_FIELDS lineFix: Move the declaration above all usages. If it's a React hook, reorder hooks so dependencies come first.
What to check: Every import resolves to a real export. Named vs default matches.
How it breaks: Build may succeed (tree-shaking ignores dead imports in dev mode) but runtime throws undefined is not a function.
Scan pattern:
import { X } from './file': open ./file and confirm export { X } or export const X or export function X exists.import X from './file': confirm export default X exists.import { X } from './file' when file only has export default X (or vice versa).Real examples caught:
useResizeHandle imported as default when it's a named exportConfluencePagePicker imported as default when it's a named exportAutomated check:
npx eslint --rule '{"import/named": "error", "import/default": "error"}' src/
What to check: After any rename/remove/move, ALL usages of the old name are updated.
Scan pattern:
Real examples caught:
setPrdDocViewMode was removed but Cmd+E handler still called it// BUG: setPrdDocViewMode was removed but Cmd+E handler still calls it
useEffect(() => {
const handler = (e) => {
if (e.metaKey && e.key === 'e') setPrdDocViewMode(prev => ...); // ReferenceError
};
}, []);
What to check: Unused imports, unreachable code, orphaned handlers.
Scan pattern:
onClick={handleFoo} removed from JSX but const handleFoo = ... still declared.return before a code block, if (false) guard, feature-flagged code where flag is always false.const [x, setX] = useState() where setX appears nowhere.Automated check:
npx eslint --rule '{"no-unused-vars": "error", "no-unreachable": "error"}' src/file.jsx
What to check: State variables are used, effects clean up, no updates after unmount, correct dependencies.
When the same component renders for multiple routes (e.g., OperationalDocEditor for DR/IRP/Recovery):
key={uniqueId} to force remount on route change?For every useEffect:
ref.current used in the render return? (Should be state instead — ref changes don't trigger re-render)useRef get set in an effect that runs after the component mounts?useEffect that calls an async function should have an abort/cancel mechanism.Real examples caught:
initialLoadRef set to true before async data arrived, blocking subsequent updatesuseResizeHandle ref null on mount because empty state rendered first (MutationObserver fix needed)OperationalDocEditor reused state across route changes (fixed with key={docType})prdDocViewMode state removed but Cmd+E handler still called setPrdDocViewMode| Anti-Pattern | Why It Breaks | Fix |
|---|---|---|
Mutating state directly (state.push(x)) | React won't re-render | setState([...state, x]) |
Object/array in useEffect deps | New reference every render -> infinite loop | useMemo the dep, or use primitive |
ref.current in render return | Ref changes don't trigger re-render | Use state instead |
history.pushState with #fragment in hash router | Double-hash URL breaks navigation | Use state-based tracking |
Inline object as prop (style={{ color: 'red' }}) | New reference every render, breaks memo | Extract to useMemo or module-level const |
useEffect missing cleanup for async | State update on unmounted component | AbortController or mounted flag |
What to check: Mocks don't leak between tests. Fake timers are restored. Tests are meaningful.
vi.mock() / jest.mock() at module level: OKmockImplementation() inside a describe without afterEach(() => mock.mockReset()): LEAK RISKvi.useFakeTimers() without corresponding vi.useRealTimers() in afterEach: LEAKmockResolvedValueOnce chains: fragile if test execution order changes. Prefer mockImplementation that inspects the call.describe blocks sharing the same fetch.mock without isolation: INTERFERENCETests that can never fail:
expect(x).toBeDefined() where x is hardcoded in setupexpect(fn).toHaveBeenCalled() immediately after calling fn yourselfexpect(array.length).toBeGreaterThanOrEqual(0) (always true)getByText / getByRole that matches multiple elements -> use getAllBy* or scope with within()Real examples caught:
mockResolvedValueOnce chain broke when test order changed; fixed with request-inspecting mockImplementationConfluencePagePicker: fake timers from one test leaked into search filter testNFRTracker: missing SettingsContext mock caused cascading failuresWhat to check: Every className in JSX has a corresponding CSS rule. No orphaned selectors.
className="..." and className={...} values from the JSX file..classname.Note: Dynamic classes like className={isActive ? 'active' : ''} need both branches checked.
For every var(--token) in CSS:
:root or a parent selector?Run these commands after any code change:
# 1. Build check
npm run build
# 2. Lint check (catches unused vars, unreachable code)
npx eslint src/path/to/changed/file.jsx
# 3. Test check (run tests for changed file)
npx vitest run src/path/to/changed/file.test.jsx
# 4. Full suite (after a feature is complete)
npx vitest run
# 5. Circular dependency check (if available)
npx madge --circular src/
Use this format when reporting verification results:
## Verification Report — [Project Name]
**Date:** [YYYY-MM-DD]
**Files checked:** [list]
**Tool:** code-verification skill
### PASS
- `path/to/file.jsx` — All 7 categories checked, no issues
### FAIL (must fix before proceeding)
- `path/to/file.jsx:142` — [CAT 1: TDZ] `activeQuestions` referenced before declaration
**Fix:** Move `const activeQuestions = useMemo(...)` to line 95 (before `showClarifyingQuestions`)
### WARNING (review, may be intentional)
- `path/to/file.jsx:88` — [CAT 4: DEAD CODE] `const [oldState, setOldState]` — setOldState never called
**Likely:** Leftover from removed feature. Remove if confirmed unused.
### Summary
| Category | Pass | Fail | Warn |
|----------|------|------|------|
| 1. TDZ | 4 | 1 | 0 |
| 2. Imports | 5 | 0 | 0 |
| 3. References | 5 | 0 | 0 |
| 4. Dead Code | 4 | 0 | 1 |
| 5. React State | 3 | 0 | 2 |
| 6. Mocks | 3 | 0 | 1 |
| 7. CSS | 5 | 0 | 0 |
This skill is the workflow. The agents are the executors:
| Agent | Role | When |
|---|---|---|
| Inline (main agent) | Runs Categories 1-5, 7 on product code | After implementation |
test-guardian | Runs Category 6 on test code | After writing tests |
code-reviewer | Broader quality review (SOLID, perf, security) | Before merge/deploy |
| Rule | Role | When |
|---|---|---|
verification-workflow.mdc | Merged quality gate + pre-implementation checklist, enforced after every change | Always (auto-applied) |
code-quality.mdc | Documentation, error handling, and logging standards | When editing JS/TS/JSX/PY |
# Run all tests for a specific file
npx vitest run path/to/file.test.jsx
# Run full test suite
npx vitest run
# Build check
npm run build
# Lint check
npx eslint src/path/to/changed/file.jsx
TODO comment.jsx, .js, .ts, .tsx file editnpm install or changing package.json
anthropics/skills180kToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
浏览器与测试
addyosmani/agent-skills104kEstablishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.
浏览器与测试
addyosmani/agent-skills104kDrives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality.
浏览器与测试
addyosmani/agent-skills104kRefines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".
浏览器与测试
addyosmani/agent-skills104kTests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.
浏览器与测试
ComposioHQ/awesome-claude-skills77kToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
浏览器与测试