This is the tinymist language service, integrated with editor frontends and other tools to provide features like code intelligence, linting, debugging, and preview rendering for Typst projects.
- Read the nearest relevant docs before editing. Start with
docs/dev-guide.md, then inspect the affected crate or editor directory. - For any non-trivial behavior change, check OpenSpec first: accepted specs live in
openspec/specs/and active work lives inopenspec/changes/. - Keep changes scoped to the task, prefer source-of-truth files over generated outputs, and follow existing crate and feature boundaries.
- Before finishing, run the smallest meaningful validation for the area you touched and summarize what you verified.
- Use the OpenSpec workflow for new features, behavior changes, multi-step fixes, and refactors. Small local edits can skip it when a formal change would add more overhead than value.
- Do not hand-edit generated Markdown files.
README.md,MAINTAINERS.md,crates/typlite/README.md, and many docs undereditors/are generated bynode scripts/link-docs.mjs. - Treat
tinymist.lockfiles and similar generated outputs as artifacts. If a change requires them to differ, regenerate them instead of patching them manually. - Keep warnings at zero. CI runs with
RUSTFLAGS='-Dwarnings', andcargo clippy,cargo fmt, docs, and tests are part of the normal quality bar. - Prefer the smallest test command that covers your change, but widen validation when work spans Rust, editor tooling, generated docs, or feature flags.
- Preserve unrelated user changes. The worktree may already be dirty.
- Avoid editing dependency pins, version metadata, or release files unless the task actually requires it.
- Use Conventional Commits for commit messages, for example
fix(renderer-diff): keep sidebar scrollable.
- Start by reading
openspec/config.yaml, the relevant accepted spec inopenspec/specs/, and any matching active change underopenspec/changes/. - If the work fits an existing active change, continue in that change instead of creating parallel artifacts.
- Keep
proposal.md,design.md,tasks.md, and spec deltas aligned with implementation when you work inside an OpenSpec change. - Use archived changes in
openspec/changes/archive/as prior art, not as the source of current requirements.
crates/tinymist-cli/: thetinymistbinary entrypoint and top-level CLI commands.crates/tinymist/: shared runtime and service logic used by system and web builds.crates/tinymist-query/: analyzer engine behind most language-intelligence features. Snapshot tests are especially important here.crates/tinymist-analysis/: lower-level analysis utilities and supporting logic.crates/tinymist-world/andcrates/tinymist-project/: Typst world, project model, config loading, package handling, and filesystem-facing state.crates/tinymist-render/,crates/typst-preview/,crates/tinymist-assets/, andtools/typst-preview-frontend/: preview and rendering pipeline, plus bundled frontend assets.crates/tinymist-lint/,crates/tinymist-debug/,crates/tinymist-dap/, andcrates/sync-lsp/: linting, debugging, DAP, and protocol plumbing.editors/vscode/: the main editor frontend and most JavaScript and TypeScript tooling.editors/: other editor integrations. Many of their docs are generated, so check the source before editing Markdown directly.tests/: end-to-end coverage, command fixtures, and sample workspaces.docs/: developer and user documentation.docs/dev-guide.mdis the best high-level entry point.scripts/: build, generation, validation, and release helpers.
- Identify which crate, editor frontend, docs source, or generated asset is actually responsible for the behavior.
- Read nearby docs and tests before changing code. For analyzer work, inspect existing fixtures and snapshots first.
- Decide whether the task is a small local edit or needs OpenSpec artifacts.
- Fix the root cause in the primary source file whenever possible, instead of layering workarounds onto generated outputs or secondary wrappers.
- Follow the repo's existing feature-flag structure. If you touch feature combinations, plan to run
scripts/feature-testing.sh. - When documentation is generated, edit the underlying Typst or source docs and then regenerate with
node scripts/link-docs.mjs.
- Rust changes in one crate:
cargo test -p <crate> - Broad Rust changes:
cargo test --workspace -- --skip=e2e - Formatting:
cargo fmt --check --all - Lints:
cargo clippy --workspace --all-targets - Feature-flag coverage:
scripts/feature-testing.sh - Analyzer snapshots:
cargo insta test -p tinymist-query --accept - CLI or end-to-end behavior:
./scripts/e2e.sh - VS Code frontend:
yarn lintandyarn test:vsc - Preview or localization assets:
yarn build:previewandyarn build:l10n - Generated docs:
node scripts/link-docs.mjs --check - Grammar changes:
yarn test:grammar
- Report the behavior change in user-facing terms.
- List the validation you ran.
- Call out anything you could not verify locally.
- Write commit messages in Conventional Commits format, such as
fix(query): handle missing labels. - Keep PR content limited to a list of modified features and issue operations, such as
Close #123. - Do not include validation logs, command transcripts, or detailed execution notes in PR content.
- Follow workspace lints in
Cargo.toml.missing_docs,missing_safety_doc, andundocumented_unsafe_blocksare all watched in this repo. - Keep code warning-free under the workspace toolchain and CI settings.
- Prefer targeted tests first, then widen to workspace checks if the change crosses crate boundaries or affects shared infrastructure.
- Inspect snapshot diffs before accepting them. Snapshot churn is expected in analyzer and e2e tests, but it should always be intentional.
- Generated files are marked at the top with
Do not edit manually. Respect that marker. - If you change docs that are mirrored into generated Markdown, rerun
node scripts/link-docs.mjsrather than editing the generated copies. - Keep documentation changes close to the code or feature they describe, and update OpenSpec artifacts when behavior-level guidance changes.