一键导入
docs-workflow
Use when adding/editing docs under docs/. Enforces state separation between final-state docs, current-state, issues, and historical state.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when adding/editing docs under docs/. Enforces state separation between final-state docs, current-state, issues, and historical state.
用 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/moving/renaming fixtures under fixtures/. Covers naming rules, content rules, inventory, reference updates.
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 | docs-workflow |
| description | Use when adding/editing docs under docs/. Enforces state separation between final-state docs, current-state, issues, and historical state. |
Use this skill only for documentation changes under docs/ and README-level documentation changes.
Automatically run and pass the commands that match your change after making changes. Without mise, use mise with the same subcommand. First time: mise trust (docs).
mise run fmt (touches *.md / Rust in examples)mise run checkmise run nextest (and mise run clippy if Rust examples changed)issues/ cross-links or agent/issue docs: mise run check issuesThis skill enforces a strict separation between:
Docs are not a dumping ground for progress logs, milestone leftovers, stale plans, or half-implemented TODOs.
Project docs describe the intended final shape of ts2wasm.
A normal docs page should read as the target design contract of the project, not as a diary of what currently works.
Allowed in normal docs:
Not allowed in normal docs:
Write final-state docs as normative project contracts.
Use present tense where possible.
Good:
The compiler lowers TypeScript expressions into JS-value IR.The runtime represents string values as managed heap objects.The WASI target imports only the capabilities declared in the manifest.Bad:
The compiler will lower TypeScript expressions into JS-value IR.Currently strings are still handled by the old evaluator.TODO: add capability manifest support.In M6 we plan to introduce stdin support.Future-looking target design is allowed only when written as the accepted intended architecture, not as a task.
Actual implementation status belongs in:
current-state.md (repository root)Use this file for:
Rules for current-state.md:
Recommended structure:
# Current state
Last audited: YYYY-MM-DD
## Summary
## Implemented
## Partially implemented
## Not implemented
## Known divergence from final-state docs
## Open issues
## Validation commands
Future work belongs in issues/.
Use issues for:
A docs change that finds future work must either:
Normal docs must not keep TODOs after the issue is created.
Past state should usually be deleted.
Do not preserve old implementation descriptions “for context” in normal docs.
Allowed historical material:
Rules:
Classify each docs page before editing.
Allowed document types:
Each docs page should have one primary type.
Do not mix:
README should be a project entrypoint.
README may contain:
current-state.md (repository root)README must not contain:
When editing docs, run this audit mentally and mechanically.
For each changed paragraph, classify it as:
Then move it:
| Category | Destination |
|---|---|
| final-state contract | appropriate docs page |
| current-state fact | current-state.md (repo root) |
| future task | issues/ |
| historical note | delete, ADR, changelog, or issue |
| rationale | explanation doc or ADR |
Delete text that only explains old behavior.
Do not soften stale text with “previously”. Do not leave stale text under “Historical note” unless it is still operationally useful.
Any TODO-like text in docs must be converted into an issue.
Search patterns:
TODOFIXMEnot yetcurrentlytemporaryworkaroundfutureplannedwilllaterM[0-9]phaseroadmapblockedunsupportedIssue file should include:
# Title
## Problem
## Desired final state
## Implementation notes
## Acceptance criteria
## Validation commands
## Docs to update when done
After issue creation, replace the docs TODO with either:
current-state.md (repo root)Do not leave both.
If the docs describe final behavior that is not implemented yet, add or update current-state.md (repo root).
The current-state entry should name the divergence and link to the issue.
Example:
## Known divergence from final-state docs
- Capability manifest emission is specified in `docs/03-api-and-host-capability.md`, but the CLI does not yet emit the manifest by default.
Tracking: `issues/WB-123.md`
When docs describe script output, TestRecord JSONL, CLI output, or coverage tables, verify that the docs match actual code/tests.
Do not update contract docs based on intention alone unless current divergence is recorded in current-state.md (repo root) and an issue exists.
Before finalizing a docs cleanup, run targeted searches.
Recommended commands:
rg -n "TODO|FIXME|not yet|currently|temporary|workaround|future|planned|later|roadmap|blocked|unsupported" docs README.md
rg -n "M[0-9]+|phase|milestone" docs README.md
rg -n "will|should eventually|in the future" docs README.md
rg -n "current-state|Current state|Known divergence" docs README.md issues
For code contract docs, also search the code/tests:
rg -n "TestRecord|suite|status|unsupported|blocked|skip-with-reason" crates scripts docs
rg -n "capability|manifest|RuntimeLinkPlan|fd_read|fd_write" crates scripts docs
rg -n "fixtures/" crates scripts docs issues
Use ast-grep when checking structural code contracts.
Examples:
ast-grep --lang rust -p 'struct $NAME { $$$ }' crates
ast-grep --lang rust -p 'enum $NAME { $$$ }' crates
Always run:
cargo fmt --all --check
For docs-only changes, run at least:
rg -n "TODO|FIXME|not yet|currently|temporary|workaround|future|planned|later|roadmap|blocked|unsupported" docs README.md
When docs mention scripts or generated reports, also run:
scripts/check/shell-syntax.sh
When docs mention test status schema, coverage, fixture behavior, runtime ABI, or CLI contracts, run impacted tests:
cargo nextest run
A smaller impacted test set is acceptable only if the final report names exactly what was not run.
current-state.md becomes a permanent junk drawer.unsupported and blocked are described as passing coverage.Final response must include:
nonenone