Thanks for your interest in improving the Diataxis Docs Skill.
Useful contributions usually do one of these:
- improve the skill trigger wording or frontmatter
- add a better documentation blueprint in
references/ - make the README clearer or more beautiful (in both English and Chinese)
- add more realistic eval prompts, including negative (
non-trigger) cases - improve bilingual wording
- add a new example for API, SDK, or developer portal documentation
- add or refine a slash command under
.opencode/commands/
- Keep the change focused. One PR, one concern.
- Preserve the Diataxis separation between tutorial, how-to, reference, and explanation.
- Avoid adding generic writing advice that does not help the skill make a better documentation decision.
- Update the README (and
README.zh-CN.md) if the user-facing behavior changes. - Run
python scripts/check_local.pyand make sure it passes (see below). - If you touched an example, check that the internal links between
before.mdandafter/*.mdstill resolve.
Before pushing, always run:
python scripts/check_local.pyThe script runs validation checks locally and mirrors the CI workflow exactly:
- Validate evals.json — JSON is well-formed, every eval has the required fields (
id,category,prompt,expected_output,files), everyidis unique, everycategoryis in the whitelist, and prompts/expected outputs are non-trivial. - Check internal links — every relative Markdown link points to a file and heading anchor that exists, and Markdown files do not contain hidden zero-width characters.
- Verify structure — all required files and example files are present, including
scripts/export_rules.py(the universal export script for AI IDE integration),scripts/audit_docs.py(the optional docs smell scanner), and its unit tests. - Check version consistency —
SKILL.md,evals/evals.json, andCHANGELOG.mdagree on the current version. - Run audit docs tests —
tests/test_audit_docs.pyverifies the heuristic scanner output.
CI runs the same checks on every push to master and on every pull request, so a passing local run is the fastest way to keep CI green.
evals/evals.json is the test suite. Every entry is a contract about how the skill should behave on a specific prompt.
Each eval must include:
| Field | Purpose |
|---|---|
id |
Stable integer identifier. Must be unique. |
category |
One of the categories below. |
prompt |
The user-style request the skill should respond to. |
expected_output |
What a correct response looks like. Used for human review or an automated grader. |
files |
The references inside this repo that back the expected output. Use [] only for non-trigger evals where the skill should refuse to engage. |
category must be one of:
classificationper-form-writingdecision-frameworksingle-page-classificationmixed-form-detectionreviewlarge-systemmigrationadjacent-typesanti-pattern-avoidancenon-trigger
non-trigger is the only negative category. Its expected_output should describe how the skill declines, refuses, or stays silent. The skill must not read any reference files for these evals, which is why files is [].
files is required, but it does not have to be non-empty. Use it to make the eval self-documenting: list the references in this repo that should be consulted to produce the expected output. For example:
- A
per-form-writingeval that asks for a how-to should listreferences/doc-blueprints.md. - A
classificationeval that asks which form fits should listSKILL.mdandreferences/template-map.md. - A
migrationeval that references the worked example should listexamples/messy-to-diataxis/before.mdand the fourafter/*.mdfiles. - A
non-triggereval should list[].
The non-trigger empty case is the only one where [] is correct. For all other categories, an empty files is a code-review smell — the eval is probably under-specified.
Aim for at least two evals per category. Single-eval categories are easy to regress without noticing.
Slash commands live in .opencode/commands/. Each file is a small prompt template with a YAML frontmatter block.
Conventions:
- Filename:
docs-<verb>.md, lowercase, hyphen-separated. Use one ofclassify,split,review,audit,quickstart, or add a new verb that matches what the command actually does. - Frontmatter must include
descriptionon the first five lines; this is a repository convention so the command picker stays useful. OpenCode derives the command name from the file name and recognises onlydescription,agent,model,variant, andsubtaskin command frontmatter. - The body should be a short system prompt that references the relevant section of
SKILL.mdrather than duplicating its content. The point of a slash command is to point the model at the right part of the skill, not to copy it. - If you add a new command, also add a row to the
Slash commands/斜杠命令table inREADME.mdandREADME.zh-CN.md.
- Prefer simple, practical language.
- Keep the skill reader-first.
- Make the change easy to verify.
The skill uses a single source of truth for its version:
SKILL.mdfrontmattermetadata.version: X.Y.Zevals/evals.jsontop-levelversion: X.Y.ZCHANGELOG.md[X.Y.Z]entry under a dated heading
The three must match. If you change behaviour in a way that affects the contract with users, bump the version and add a CHANGELOG entry.
Open an issue if you are not sure whether a change fits the project. Use the templates in .github/ISSUE_TEMPLATE/ (bug, feature, docs, or general question) and the PR template in .github/PULL_REQUEST_TEMPLATE.md so reviewers have what they need on the first read.