一键导入
fixtures-workflow
Use when adding/editing/moving/renaming fixtures under fixtures/. Covers naming rules, content rules, inventory, reference updates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when adding/editing/moving/renaming fixtures under fixtures/. Covers naming rules, content rules, inventory, reference updates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when adding/editing scripts under scripts/. Covers layout conventions, shell rules, output contracts, validation.
Use for ast-grep lint rules when general-purpose linters cannot express patterns. Covers config, rules, testing, CI integration.
Use for TypeScript/ECMAScript compatibility changes. Defines decision order for semantic compatibility, WASI lowering, Node fallback.
Use when adding/editing docs under docs/. Enforces state separation between final-state docs, current-state, issues, and historical state.
Use when acting as gatekeeper/reviewer for PRs or agent outputs. Covers sources of truth, required commands, reject conditions, domain checklists.
Use when resolving git merge conflicts, especially after git pull --rebase or git merge origin/master
| name | fixtures-workflow |
| description | Use when adding/editing/moving/renaming fixtures under fixtures/. Covers naming rules, content rules, inventory, reference updates. |
Use this skill when a change touches fixtures/** or fixture path references caused by a fixtures/** change.
Automatically run the matching entries below after making changes and ensure they pass. Without mise, use mise with the same subcommand. First time: mise trust (docs).
mise run fmt and mise run nextest (minimum)mise run clippy as wellmise run check as a light aggregate (fmt + script syntax + issues invariants)mise run update-coverage-matrix / mise run reference-coverage (see scripts/ for flags)This skill is for fixture input files, fixture naming, fixture migration, and fixture reference synchronization. It may update script path references, but it must not redesign script behavior. Use scripts-workflow for script logic, script output schema, command-line options, CI script orchestration, or coverage pipeline behavior changes.
In scope:
fixtures/** TypeScript inputs for project-owned smoke, compile, iwasm, and Node differential testscrates/cli/tests/**scripts/**docs/**README.mdAGENTS.md.github/workflows/**artifacts/coverage/** only when the document explicitly tracks project fixturesTestRecord suite/case strings and fixture-related metadataOut of scope:
test262, TypeScript compiler cases, or typescript-goPrefer tools in this order:
ast-grep / sg for structural searches in Rust, TypeScript, JavaScript, JSON, YAML, and other supported languages.rg (ripgrep) for broad text/path searches, literal fixture path searches, and shell/doc scans.Do not use plain text grep when the question is structurally about code shape, such as TestRecord construction, fixture helper calls, or Rust test registration.
Use rg for:
fixtures/ inventoryUse sg for:
TestRecord { ... } recordsassert_fixture_*Scripts are consumers of fixtures. A fixture workflow may update literal paths in scripts when a fixture path changed.
Allowed here:
fixtures/<old-path> with fixtures/<new-path>scripts/check/shell-syntax.sh after touching scriptsNot allowed here:
If a fixture rename reveals that a script needs different logic, stop the fixture-only change and hand off the script part to scripts-workflow.
m1, m2, m6.Good examples:
fixtures/primitives-control-flow/boolean-if.ts
fixtures/core-semantics/truthiness.ts
fixtures/arrays-objects/array-oob.ts
fixtures/builtins-and-io/stdin.ts
fixtures/classes-and-inheritance/class-super-method.ts
fixtures/modules-and-typed-optimizations/require-cache.ts
Bad examples:
fixtures/m3/test1.ts
fixtures/new-tests/foo.ts
fixtures/misc/bar.ts
fixtures/runtime-fixes/case.ts
Each fixture should make one behavior observable through stdout, compile success, compile failure, or runtime behavior.
Prefer:
console.logAvoid:
process.envprocess.argvBefore changing fixture paths, build the impact list.
Run broad text/path searches with rg:
rg -n 'fixtures/<old-path>|<old-dir>/' crates scripts docs README.md AGENTS.md .github artifacts
rg -n '<old-file-name>|<old-dir>' crates scripts docs README.md AGENTS.md .github artifacts
rg -n 'fixtures/' crates/cli/tests scripts docs README.md AGENTS.md .github artifacts
Run structural Rust searches with sg:
sg run --lang rust -p 'TestRecord { $$$ }' crates/cli/tests crates/shared/src
sg run --lang rust -p 'assert_fixture_compiles($$$)' crates/cli/tests
sg run --lang rust -p 'assert_fixture_matches_node($$$)' crates/cli/tests
sg run --lang rust -p 'assert_fixture_matches_iwasm($$$)' crates/cli/tests
sg run --lang rust -p 'run_differential_test($$$)' crates/cli/tests
For YAML workflow path references, prefer structured search first:
sg run --lang yaml -p 'fixtures/**' .github/workflows
If the structural query is too narrow or invalid for the target file type, fall back to rg:
rg -n 'fixtures/' .github/workflows
For broad migrations, also run:
find fixtures -type f | sort
rg -n 'fixtures/' crates/cli/tests scripts docs README.md AGENTS.md .github artifacts
sg run --lang rust -p 'TestRecord { $$$ }' crates/cli/tests crates/shared/src
Use the result as the migration checklist. Do not rely on memory.
When fixture paths change, update all affected references in one change.
Check at minimum:
crates/cli/tests/**
fixtures/assert_fixture_compilesassert_fixture_matches_nodeTestRecord metadata
suite should remain meaningful and path-aligned, usually fixtures/<domain-dir>case should remain the fixture filenametarget must stay correctreason and trackingscripts/**
docs/**
Root/agent files
README.mdAGENTS.md.github/copilot-instructions.md.agents/skills/** only when the documented workflow becomes staleCI/workflows
.github/workflows/** path triggersGenerated or semi-generated artifacts
Keep path and suite strings consistent.
Preferred shape:
fixture path: fixtures/<domain-dir>/<case>.ts
TestRecord.suite: fixtures/<domain-dir>
TestRecord.case: <case>.ts
Do not leave mixed old/new names:
fixtures/m6/stdin.ts
fixtures/builtins-and-io/stdin.ts
suite: fixtures/m6
suite: fixtures/builtins-and-io
A directory migration is not complete until path strings, suite strings, docs, and script consumers agree.
.ts file.TestRecord classification and tracking.docs/05-compatibility-and-semantics.md or docs/06-testing-and-coverage.md.git mv for the file or directory.Always run:
cargo fmt --all --check
For fixture content changes, run the directly impacted tests first, then the project gate:
cargo nextest run -p ts2wasm-cli
For fixture-heavy or path migration changes, run:
cargo nextest run
If scripts were touched only for fixture path synchronization, also run:
scripts/check/shell-syntax.sh
If the moved fixture is used by differential execution, run the relevant differential/integration test. Examples:
cargo nextest run -p ts2wasm-cli --test m2_node_diff
cargo nextest run -p ts2wasm-cli --test m6_builtin_methods
cargo nextest run -p ts2wasm-cli --test m7_control_flow
cargo nextest run -p ts2wasm-cli --test m8_oop_classes
cargo nextest run -p ts2wasm-cli --test m9_modules
cargo nextest run -p ts2wasm-cli --test m10_node_apis
If the fixture requires iwasm, state whether iwasm was available. Do not report an iwasm-dependent check as passed if it was skipped because the tool was missing.
If docs mention coverage artifacts, validate the coverage matrix check when relevant:
mise run update-coverage-matrix -- --check
Do not run reference corpus scripts for ordinary project fixture edits unless the change affects reference coverage, TestRecord schema, differential classification, or CI coverage scripts.
After any move or rename, run searches that should return zero old references.
Use rg for literal old path checks:
rg -n 'fixtures/<old-path>|<old-dir>/' crates scripts docs README.md AGENTS.md .github artifacts
rg -n 'suite: "fixtures/<old-dir>|suite = "fixtures/<old-dir>' crates
Use sg for structural verification in Rust tests:
sg run --lang rust -p 'TestRecord { $$$ }' crates/cli/tests crates/shared/src
sg run --lang rust -p 'assert_fixture_compiles($$$)' crates/cli/tests
sg run --lang rust -p 'assert_fixture_matches_node($$$)' crates/cli/tests
sg run --lang rust -p 'run_differential_test($$$)' crates/cli/tests
For broad migrations, run a consistency scan:
find fixtures -maxdepth 2 -type f | sort
rg -n 'fixtures/' crates/cli/tests scripts docs README.md AGENTS.md .github artifacts
sg run --lang rust -p 'TestRecord { $$$ }' crates/cli/tests crates/shared/src
TestRecord.suite left old.artifacts/coverage/reference-coverage-matrix.md is hand-edited for project fixtures even though it tracks reference corpus data.reason or tracking.sg would catch structural call sites more reliably.Every fixture workflow result must report:
rg gate results for old paths after rename/migration.sg structural gate results for Rust fixture references.rg, sg, or iwasm, if applicable.Use this format when handing the result to gatekeeper or another agent.
Fixture workflow handoff
Scope:
- Added:
- Edited:
- Moved:
- Removed:
- Not changed:
Reference sync:
- crates/cli/tests:
- scripts:
- docs:
- README/AGENTS:
- .github/workflows:
- artifacts:
TestRecord:
- suite changes:
- case changes:
- non-pass reason/tracking changes:
Validation:
- cargo fmt --all --check:
- cargo nextest run -p ts2wasm-cli <impacted>:
- cargo nextest run:
- scripts/check/shell-syntax.sh:
- mise run update-coverage-matrix -- --check:
- iwasm-dependent checks:
Search gates:
- rg old fixture path references:
- rg old suite references:
- sg TestRecord structural scan:
- sg fixture helper call scan:
Risks:
- Runtime behavior changed:
- Script behavior changed:
- CI trigger changed:
- Coverage artifact changed:
Intentional non-updates:
- <file or area>: <reason>