--- name: docs-writing description: "Load when creating or editing any Markdown file or documentation HTML, such as README, DEVELOPMENT, architecture docs, reference docs, SKILL.md and AGENTS.md, and when rewriting or reviewing one." license: MIT user-invocable: true metadata: author: "vanillagreen" source: "kendex" repository: "https://github.com/vanillagreencom/kendex" bugs: "https://github.com/vanillagreencom/kendex/issues" --- ## Project Instructions Problems with a kendex-owned skill go through `kendex report`; check ownership in the file first. Migrate this repository hand-written harness instructions only through an authorized instruction migration. Put rules used by one installed skill in that skill's named [skill-instructions] key in kendex.toml, or kendex-local.toml only for a source catalog. Put agent-specific rules in the named [agent-additional-instructions] key and command-specific rules in the named [command-instructions] key. Keep only rules every agent needs in AGENTS.md. Keep operator instructions in consumer docs. Preserve every still-required rule. Remove an empty source instruction file only after its replacement is checked. # Docs Writing Use this skill to write, edit or review repository Markdown and documentation HTML. Policy and operating documents also follow § Writing. ## The standard - Write short sentences in active voice and present tense. Name the actor. Keep a condition with its exception. - Give each instruction its own sentence or list item in execution order. Give each table cell one fact. Write a conditional rule as prose below the table. - Use plain words and consistent terms. Keep technical terms the intended reader needs. Remove sales language, quips, metaphors and hedges. - Give each fact one home. Point other readers there. - Give headings subject names. Keep cited headings and rule names unless the same change updates their citers. ## Layout Use the repository's existing locations and names. Use this default layout where the repository has none. | Path | Reader | Holds | Required | |---|---|---|---| | `README.md` | a person choosing or using it | the sections [references/readme.md](references/readme.md) orders | yes | | `AGENTS.md` | every agent, at session start | what the repo is, the commands, the conventions every agent needs, and task routes to principle docs, directly or through named nested instructions | yes | | `DEVELOPMENT.md` | a maintainer | build, run, test and debug: only what the tooling does not show | where needed | | `LICENSE` | a person | the licence | yes | | `CHANGELOG.md`, `changelog.d/` | a person reading a release | release notes | released packages | | `/AGENTS.md` | an agent working in that folder | the folder's commands, rules every agent there needs that no linked principle doc owns, and task triggers for the principle docs that govern it | where a folder has its own rules | | `docs/architecture/.md` | an agent about to do the work the doc governs | one principle: the approach, why, the rules, one code example | where a principle exists | | `docs/decisions/INDEX.md` and `-.md` | a reviewer or agent about to reverse a choice | decision records: the choice, why, the rejected option, when to revisit | where such choices exist | | `docs/images/` | a reader of a README or doc | the screenshots and images those files show | when used | | `docs/runbook.md` | an operator | step-by-step procedures for a running system | operated systems | Keep product content, including help, legal and adapter docs, in the locations the repository declares in its `AGENTS.md`. Keep a skill's reference docs in its `references/`. For assistant-home policy, memory and session records, read [references/assistant-home.md](references/assistant-home.md) and follow their owning routes. For working artifacts, see § Plans and research. ### Reference rules - Give each principle doc a task trigger in the root or applicable nested `AGENTS.md`. Route from the root to nested instructions when the nested file owns the trigger. - Where the repository adopts review instructions, point its selected reviewers to the same principle docs for matching paths. Use the adopted package's render route for generated instructions. GitHub Copilot setup belongs to the repository's chosen review integration. - Find decisions by keyword with `decisions search`. Cite a decision ID in a code comment only where that code carries out the choice. - Link from a README when its reader needs the target. - Give architecture topics task-based reading routes. Delete an index that only repeats those routes. Keep the decider index, skill reference routes, generated example inventories and product navigation. ## Per file type Keep a passage when any intended reader needs it for their task. For an agent, keep a rule that prevents a real, costly mistake its tools, loaded instructions, workflow and ordinary competence leave possible. Move a passage to the file where its reader needs it. Keep license and notice text its license requires. Follow the repository's declared file-type route where it has one. Supporting evidence follows its declared type even when it sits beside a decision record. Configure the selected validator to use the same classification. For files without a declared route, use the first matching row in the default table. `*` matches across `/`. Read the rules and example for the chosen type. | Path | Section | Example | |---|---|---| | `docs/decisions/*.md` | § Decision records | [decision.md](examples/decision.md) | | `docs/architecture/*.md` | [architecture.md](references/architecture.md) | [architecture-plugins.md](examples/architecture-plugins.md) | | `docs/runbook.md` | § Runbooks | [runbook.md](examples/runbook.md) | | `AGENTS.md` | [agents.md](references/agents.md) | [root-agents.md](examples/root-agents.md) | | `*/AGENTS.md` | [agents.md](references/agents.md) | [nested-agents-plugins.md](examples/nested-agents-plugins.md) | | `SKILL.md`, `*/SKILL.md`, `*/workflows/*.md`, `agents/*.md`, `*/agents/*.md` | [skill-files.md](references/skill-files.md) | [skill-entry.md](examples/skill-entry.md) | | `*/documentation/*.md` | [human-page.md](references/human-page.md) | [HIW-tasks.md](examples/HIW-tasks.md) | | `*/references/*.md`, `*/schemas/*.md`, `*/patterns/*.md`, `CHECKS.md`, `*/CHECKS.md` | [reference-docs.md](references/reference-docs.md) | [reference.md](examples/reference.md) | | `DEVELOPMENT.md`, `*/DEVELOPMENT.md` | [development.md](references/development.md) | [development.md](examples/development.md) | | `README.md`, `*/README.md` | [readme.md](references/readme.md) | [readme.md](examples/readme.md) | | none: the product content directory a repository names | [human-page.md](references/human-page.md) | [human-page.md](examples/human-page.md) | ### One home per fact Link to the owner of a value, inventory or procedure. Classify user help, operating steps, skill procedures and reference contracts by file type first. Route internal design claims in this order. 1. Put a choice that meets the decider bar in a decision record. Give the choice, reason, rejected alternative and revisit trigger. 2. Put the approach that governs a task, its reason and its current rules in a principle doc. Cite the decision ID for the choice it follows. 3. Keep feature behavior in code, tests and the tracker item where one exists. Keep a local reason or external cause at its code site. See [the behavior spec example](examples/behaviour-spec.md) for where each kind of claim goes. ### Rules Before adding an agent rule, identify the task step, what the agent reads at that step, the act it takes and the dated mistake the rule prevents. Put the case in the work item or commit. Put the rule where the agent needs it. To fix a missed rule, use the first option that fits. 1. Remove the step that permits the mistake, or let the tool perform the act. 2. Have that step's tool print the instruction as an advisory. 3. Move the rule into the step. 4. Ask what the agent should do at that step. For a judgment call, have the agent answer in its own words where the reader already looks. An inapplicable case names its reason. Leave the answer to human or agent review. A tool refuses only an exact case whose wrong pass cannot be undone. Apply code-quality's guidance on over-engineering before adding a refusal. ### Decision records Read by a reviewer or agent about to reverse a choice. Follow the [decider skill](../decider/SKILL.md) for the admission bar, format and workflows. ### Runbooks Write for an operator maintaining or recovering a running system. Name the task, trigger, target environment, prerequisites and approval for effects on service or data. Put steps in execution order. For each step, name the expected reading, its source and the condition to continue. Treat an unavailable reading as unresolved. Give stop and recovery steps the current operating contract supports. Name who receives a failure and its evidence. Check the end state and clean up temporary access, files and settings. Keep evidence readable through handoff. Keep the runbook focused on operating steps. See [the runbook example](examples/runbook.md). ### Documentation HTML A standalone documentation page follows its equivalent Markdown type and opens offline without a build step. Use local styles and assets. Use inline SVG when a diagram clarifies the text. Pages built or served by the product follow its content rules. ### `CHANGELOG.md` and `changelog.d/` Follow the repository's release-note conventions and selected changelog tool. ## Maintenance - Update a doc when its claim changes. - Name the checker and the scope it enforces. For a rule without a checker, name how a reviewer or operator checks it, or state the gap. - Keep loaded instructions within the selected harness's limits, including imports. ## Plans and research Use repository scratch, `tmp/` by default, for new working plans, research, measurements, handoffs and rewrite records. The consumer's selected handoff workflow owns delivery, durable location and retention. For a local handoff without a selected workflow, give the reader the readable scratch path. Assistant-home records follow their own contracts. ## Format - Follow the repository's format and validator. By default, keep paragraphs and list items on single lines. Separate blocks with blank lines and preserve tables and fenced code. - Resolve relative links. Say when to read each target or what it holds. - Keep dates, attribution, sources and supersession where they establish current rules or qualify evidence. - Reuse installed package rules through the package and its project settings. Keep literal paths in commands, settings and other program inputs that need them. ## Writing Make focused edits in place. For new facts use § One home per fact, and for new or repaired agent rules use § Rules. For conversion, restructuring or a sweep of reader needs, follow the [rewrite workflow](workflows/rewrite.md) at the requested scope. For every edit, verify each claim against its owner and preserve its actor, scope, conditions, exceptions, required order, dates, attribution, supersession and evidence status. Leave verification unresolved when the source is unread. Follow the guidance and example for the file type.