|
1 | 1 | # Documentation Instructions |
2 | 2 |
|
3 | 3 | ## Expectations |
4 | | -- Update README when behaviour changes. |
5 | | -- For patterns: add screenshot, purpose, usage notes, a11y notes. |
6 | | -- Maintain CHANGELOG entries for user-visible changes. |
| 4 | + |
| 5 | +- All documentation must comply with the standards below and respect the references and cross-linking conventions for every document created or updated. |
| 6 | +- Every `.md` file in `docs/` and its subfolders must include YAML frontmatter, clear structure, accessibility, and cross-references as described. |
7 | 7 |
|
8 | 8 | ## Structure |
9 | | -- Keep docs close to code; link from `README.md` to pattern/block docs. |
| 9 | + |
| 10 | +All cross-references and file links must be universal. Avoid branch-specific links unless necessary for historical context. Use `/blob/HEAD/` for repo-local files. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +# Universal Documentation Standards for `.md` Files |
| 15 | + |
| 16 | +## 1. Frontmatter |
| 17 | + |
| 18 | +Every documentation file should start with YAML frontmatter including: |
| 19 | + |
| 20 | +- `title`: Document title (required) |
| 21 | +- `description`: Brief summary of the file’s purpose (required) |
| 22 | +- `last_updated`: Date of last meaningful update (required) |
| 23 | +- `owners`: Responsible maintainers or teams (required) |
| 24 | +- `references`: Related files, specs, or external resources (required; must be real, repo-relative links) |
| 25 | + |
| 26 | +## 2. Structure & Headings |
| 27 | + |
| 28 | +- Use clear, hierarchical headings (`#`, `##`, `###`) for logical organization. |
| 29 | +- Include a Table of Contents for files longer than ~100 lines. |
| 30 | +- Start with an **Overview** or **Purpose** section. |
| 31 | + |
| 32 | +## 3. Clarity & Language |
| 33 | + |
| 34 | +- Use plain, concise language. |
| 35 | +- Avoid jargon unless defined. |
| 36 | +- Prefer UK English (per org standards). |
| 37 | + |
| 38 | +## 4. Navigation & Cross-References |
| 39 | + |
| 40 | +- Reference parent indexes and related docs (see `CHECKLIST_CROSSLINKING.md`). |
| 41 | +- Ensure bidirectional and lateral links—no dead ends. |
| 42 | +- All references must be respected and validated for every document. |
| 43 | +- Use `/blob/HEAD/` for repo-local files and relative links for files within the same repo. |
| 44 | + |
| 45 | +## 5. Formatting & Accessibility |
| 46 | + |
| 47 | +- Follow [WCAG 2.2 AA](https://www.w3.org/TR/WCAG22/) and a11y.instructions.md. |
| 48 | +- Use lists, tables, and code blocks for clarity. |
| 49 | +- Add alt text to images and diagrams. |
| 50 | +- Ensure headings and lists are properly spaced for readability. |
| 51 | +- Use badges for status, coverage, or compliance where relevant. |
| 52 | +- Run markdownlint and Prettier for formatting compliance. |
| 53 | + |
| 54 | +## 6. Diagrams & Visuals |
| 55 | + |
| 56 | +- Use Mermaid diagrams for workflows, architecture, or processes. |
| 57 | +- Include screenshots or illustrations where helpful. |
| 58 | + |
| 59 | +## 7. Examples & Usage |
| 60 | + |
| 61 | +- Provide code examples, sample commands, or usage scenarios. |
| 62 | +- For configuration or scripts, show input/output and expected results. |
| 63 | + |
| 64 | +## 8. Validation & Testing |
| 65 | + |
| 66 | +- Document how to validate, test, or review the content (e.g., linting, schema checks). |
| 67 | +- Validate all links and references after every edit. |
| 68 | + |
| 69 | +## 9. Change Log & Versioning |
| 70 | + |
| 71 | +- For critical or frequently updated docs, include a change log or version history. |
| 72 | +- Update `last_updated` and `version` fields on changes. |
| 73 | +- Document significant changes in commit messages and changelogs. |
| 74 | + |
| 75 | +## 10. Contribution & Review |
| 76 | + |
| 77 | +- State how to propose changes or report issues. |
| 78 | +- Reference contributing guidelines. |
| 79 | +- Schedule regular audits and integrate checks into CI/CD. |
| 80 | + |
| 81 | +## 11. Compliance & Security |
| 82 | + |
| 83 | +- For compliance/security docs, include audit status, responsible owner, and incident history. |
| 84 | + |
| 85 | +## 12. Accessibility & Inclusion |
| 86 | + |
| 87 | +- Ensure documentation is accessible to all users (screen reader compatibility, keyboard navigation, etc.). |
| 88 | +- Use people-first, bias-aware language. |
| 89 | + |
| 90 | +## 13. Footer |
| 91 | + |
| 92 | +- Add a consistent footer with references, contact info, and license. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## Documentation Checklist |
| 97 | + |
| 98 | +- [ ] YAML frontmatter is present and complete |
| 99 | +- [ ] Overview or Purpose section is clear |
| 100 | +- [ ] Table of Contents included for long files |
| 101 | +- [ ] Headings are hierarchical and logical |
| 102 | +- [ ] All links use `/blob/HEAD/` for repo-local files |
| 103 | +- [ ] All references are respected and validated |
| 104 | +- [ ] Formatting is clear and accessible |
| 105 | +- [ ] Diagrams and images have alt text |
| 106 | +- [ ] Examples and usage are provided where relevant |
| 107 | +- [ ] Validation/testing instructions included |
| 108 | +- [ ] Change log/version history present if needed |
| 109 | +- [ ] Contribution and review process described |
| 110 | +- [ ] Compliance/security info present if needed |
| 111 | +- [ ] Footer is present and complete |
0 commit comments