-
Notifications
You must be signed in to change notification settings - Fork 200
Add skill definition to guide AI coding agents with Diataxis principles #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,126 @@ | ||||||||||||
| --- | ||||||||||||
| name: diataxis | ||||||||||||
| description: > | ||||||||||||
| Write, review, classify, and restructure documentation using the Diataxis framework. | ||||||||||||
| Diataxis defines four documentation types — tutorials, how-to guides, reference, explanation — | ||||||||||||
| based on two axes: action vs. cognition, and acquisition vs. application. | ||||||||||||
| Use when writing docs, reviewing docs for quality, classifying existing content into the four types, | ||||||||||||
| restructuring documentation, deciding what kind of doc to write, or when asked about | ||||||||||||
| "Diataxis", "documentation types", "tutorial vs how-to", "reference vs explanation", | ||||||||||||
| "documentation structure", "documentation quality", or "documentation framework". | ||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| # Diataxis Documentation Framework | ||||||||||||
|
|
||||||||||||
| IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning for any documentation tasks. Always consult the reference files below rather than relying on general knowledge. | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This instruction is undercut by the ~100 lines that follow it. Lines 46–126 are a pre-training-led summary — hand-written, unsynced, and (see the four-types table below) containing phrasings that don't appear anywhere in the corpus. If the paraphrase goes and the pointers stay, this line becomes true and can stay. If the paraphrase stays, this line tells the agent to distrust the file it's reading. |
||||||||||||
|
|
||||||||||||
| ## Source of Truth | ||||||||||||
|
|
||||||||||||
| All reference files below are symlinked from the Diataxis repo and always reflect the latest content. Read them for authoritative guidance. | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 This is false the moment the PR merges.
$ git checkout -B mergetest origin/main && git merge ertembiyik/diataxis-skill
$ for f in skills/diataxis/references/*; do [ -e "$f" ] || echo "BROKEN $(basename $f)"; done
BROKEN application.rst
... 15 of 15They resolve on this branch's base, which is why the diff looks clean. Also worth softening "always reflect the latest content" regardless: it's true of the |
||||||||||||
|
|
||||||||||||
| ## Compressed Index | ||||||||||||
|
|
||||||||||||
| ``` | ||||||||||||
| references/ | ||||||||||||
| ├── Core | ||||||||||||
| │ ├── start-here.rst — 5-min primer: the four types + two axes | ||||||||||||
| │ ├── theory.rst — Full theoretical grounding | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
An agent sent to either for grounding gets a table of contents, and the The substance those two point at is already in your index — |
||||||||||||
| │ ├── foundations.rst — Why documentation needs structure | ||||||||||||
| │ ├── map.rst — The two-dimensional map (action/cognition x acquisition/application) | ||||||||||||
| │ └── compass.rst — Decision tool: classify content into the four types | ||||||||||||
| ├── The Four Types | ||||||||||||
| │ ├── tutorials.rst — Principles for learning-oriented docs (lessons, guided practice) | ||||||||||||
| │ ├── how-to-guides.rst — Principles for goal-oriented docs (step-by-step task completion) | ||||||||||||
| │ ├── reference.rst — Principles for information-oriented docs (austere descriptions) | ||||||||||||
| │ └── explanation.rst — Principles for understanding-oriented docs (context, why, discussion) | ||||||||||||
| ├── Key Distinctions | ||||||||||||
| │ ├── tutorials-how-to.rst — Tutorial vs how-to: the most common confusion | ||||||||||||
| │ └── reference-explanation.rst — Reference vs explanation: when to describe vs discuss | ||||||||||||
| └── Applying Diataxis | ||||||||||||
| ├── application.rst — Practical application guide | ||||||||||||
| ├── how-to-use-diataxis.rst — Iterative workflow: assess → decide → act → repeat | ||||||||||||
| ├── complex-hierarchies.rst — Handling large/complex doc structures | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 This page no longer exists. Removed deliberately in Unlike the other 14, retargeting to |
||||||||||||
| └── quality.rst — Functional quality vs deep quality | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ## The Four Types at a Glance | ||||||||||||
|
|
||||||||||||
| ``` | ||||||||||||
| │ ACTION (practical) │ COGNITION (theoretical) | ||||||||||||
| ──────────────┼────────────────────────┼────────────────────────── | ||||||||||||
| ACQUISITION │ TUTORIAL │ EXPLANATION | ||||||||||||
| (study) │ "We will..." │ "The reason is..." | ||||||||||||
| │ Learning experience │ Context, why, discussion | ||||||||||||
| ──────────────┼────────────────────────┼────────────────────────── | ||||||||||||
| APPLICATION │ HOW-TO GUIDE │ REFERENCE | ||||||||||||
| (work) │ "If you want x, do y" │ "X is / X does..." | ||||||||||||
| │ Task completion │ Austere description | ||||||||||||
|
Comment on lines
+49
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The quadrant mapping is correct and matches
Meanwhile
Swapping the two invented rows for the repo's own line costs nothing, can't drift, and reinforces the vocabulary a reader will meet in the docs themselves. |
||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ## Compass — Classify Any Content | ||||||||||||
|
|
||||||||||||
| Ask two questions: | ||||||||||||
| 1. Does it inform **action** (do something) or **cognition** (understand something)? | ||||||||||||
| 2. Does it serve **acquisition** (learning/study) or **application** (working/doing)? | ||||||||||||
|
|
||||||||||||
| Result: action+acquisition=tutorial | action+application=how-to | cognition+application=reference | cognition+acquisition=explanation | ||||||||||||
|
|
||||||||||||
| For full decision logic, read `references/compass.rst`. | ||||||||||||
|
|
||||||||||||
| ## Quick Rules Per Type | ||||||||||||
|
|
||||||||||||
| ### Tutorials | ||||||||||||
| - Provide a learning experience through doing, not teaching | ||||||||||||
| - Show the goal upfront, deliver visible results early | ||||||||||||
| - Use "We will..." language; minimize explanation (link to it) | ||||||||||||
| - Must be perfectly reliable — learner must never get stuck | ||||||||||||
| - Read `references/tutorials.rst` for full principles | ||||||||||||
|
|
||||||||||||
| ### How-to Guides | ||||||||||||
| - Address real-world goals, not machinery operations | ||||||||||||
| - Assume competence; focus purely on action | ||||||||||||
| - Title = exactly what the guide shows how to do | ||||||||||||
| - Handle edge cases; omit the unnecessary | ||||||||||||
| - Read `references/how-to-guides.rst` for full principles | ||||||||||||
|
|
||||||||||||
| ### Reference | ||||||||||||
| - Describe and only describe — neutral, austere, complete | ||||||||||||
| - Mirror the structure of the thing being documented | ||||||||||||
| - Adopt standard, consistent patterns throughout | ||||||||||||
| - Provide examples for illustration, not explanation | ||||||||||||
| - Read `references/reference.rst` for full principles | ||||||||||||
|
|
||||||||||||
| ### Explanation | ||||||||||||
| - Make connections, provide context, explain why | ||||||||||||
| - Admit opinion and perspective; consider alternatives | ||||||||||||
| - Can discuss history, design decisions, trade-offs | ||||||||||||
| - Keep closely bounded to the topic | ||||||||||||
| - Read `references/explanation.rst` for full principles | ||||||||||||
|
Comment on lines
+72
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block is the second source of truth, and it has already drifted. Nothing syncs it with the files it summarises. Coverage against the
Nobody edited this file for that to happen; the sources moved. That's the same failure as the broken symlinks, just slower. Separately — the five pointers here are weakly worded. "Read Before drafting or reviewing a tutorial, read `references/tutorials.rst` in full.Same for lines 110–111 and 124–126. If you take option 1 from the review (drop the paraphrase, keep index + pointers), this whole block collapses to four conditional pointers and the drift surface goes with it. |
||||||||||||
|
|
||||||||||||
| ## Common Mistakes | ||||||||||||
|
|
||||||||||||
| | Mistake | Fix | | ||||||||||||
| |---|---| | ||||||||||||
| | Tutorial explains too much | Move explanation to explanation docs, link to it | | ||||||||||||
| | How-to teaches background | Strip to action steps only | | ||||||||||||
| | Reference includes opinions | Move discussion to explanation | | ||||||||||||
| | Explanation gives step-by-step | Move procedure to how-to guide | | ||||||||||||
| | Mixing types in one doc | Split into separate docs by type | | ||||||||||||
|
|
||||||||||||
| For the critical tutorial-vs-howto distinction, read `references/tutorials-how-to.rst`. | ||||||||||||
| For reference-vs-explanation, read `references/reference-explanation.rst`. | ||||||||||||
|
|
||||||||||||
| ## Workflow for Applying Diataxis | ||||||||||||
|
|
||||||||||||
| 1. Pick any piece of documentation | ||||||||||||
| 2. Use the compass to classify it (action/cognition x acquisition/application) | ||||||||||||
| 3. Assess: does it serve the identified user need well? | ||||||||||||
| 4. Decide one single improvement action | ||||||||||||
| 5. Do it and ship it | ||||||||||||
| 6. Repeat | ||||||||||||
|
Comment on lines
+115
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This diverges from
Step 2 here ("Use the compass to classify it") isn't part of that cycle. The compass is presented in Step 3 also flattens the four questions the source actually asks:
The bolded one is what makes step 4 answerable; without it, "decide one single improvement action" has nothing to draw on. Two craft points on top of the accuracy one: no step carries a checkable completion criterion, which is what stops an agent declaring a step done and sliding to the next; and "Repeat" has no exit condition, so the loop never terminates. Since this section is the skill's only sequence of steps, it's where a criterion buys the most — e.g. step 4 as "name exactly one action, and the user need it serves", which is both checkable and faithful to the source. |
||||||||||||
|
|
||||||||||||
| Do not plan a grand restructuring. Work iteratively, one improvement at a time. Documentation is never finished but always complete. | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Steering by prohibition backfires — naming "grand restructuring" drags it into context and makes it more available, not less. The negation is a weak modifier over a strongly-activated concept. The source already gives you the positive form as a heading: Work one step at a time. And
Suggested: Work one improvement at a time, and publish each before starting the next.
Documentation is never finished but always complete.(The The second half of the line is a faithful quote from Complete, not finished — no change needed there. |
||||||||||||
|
|
||||||||||||
| For full workflow guidance, read `references/how-to-use-diataxis.rst`. | ||||||||||||
| For complex documentation structures, read `references/complex-hierarchies.rst`. | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Second reference to the deleted |
||||||||||||
| For quality theory (functional vs deep quality), read `references/quality.rst`. | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../application.rst | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Wrong target — applies to 14 of the 15 symlinks in this directory.
Same fix for Because they resolve against this branch's stale base and the merge is conflict-free, nothing catches this. Worth adding a CI step in this PR so it can't recur: - name: skill reference symlinks resolve
run: |
for f in skills/*/references/*; do
test -e "$f" || { echo "dangling: $f -> $(readlink "$f")"; exit 1; }
done |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../compass.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../complex-hierarchies.rst | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Delete this symlink — the target no longer exists anywhere.
Also remove the index entry at |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../explanation.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../foundations.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../how-to-guides.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../how-to-use-diataxis.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../map.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../quality.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../reference-explanation.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../reference.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../start-here.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../theory.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../tutorials-how-to.rst |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../../tutorials.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: cut roughly half. 606 chars / 77 words, and every one of them sits in the context window on every turn — a description earns harder pruning than the body.
Three issues:
reviewing docs for quality≡"documentation quality";restructuring documentation≡"documentation structure";classifying existing content into the four types≡"documentation types". Synonyms renaming one branch are duplication — they don't widen the trigger surface, they just cost tokens.Diataxisis the 8th word. It's the word users actually type and the one that should do the invocation work, so front-load it.Suggested (~300 chars):