From a5689f975c9a7c6b38a60234727c56a3cc230021 Mon Sep 17 00:00:00 2001 From: Jason Anton Date: Fri, 1 May 2026 13:42:54 -0400 Subject: [PATCH 1/3] docs: add docs/ scaffolding with ADR and runbook conventions Establish the docs/ structure as the canonical location for project documentation that bridges business need and technical reality. Adds: - docs/README.md: tech spec template covering overview, goals/non-goals, current state, solution, constraints, open questions, and glossary. - docs/adrs/: architectural decision records using an extended Michael Nygard format (Title, Status, Context, Decision, Consequences, Alternatives Considered). Includes README documenting when to write an ADR, the lifecycle, and numbering conventions. - docs/runbooks/: operational runbook template optimized for high-stress reading. Includes README codifying when to write one and the maintenance discipline (review-on-use, quarterly audit). Each subdirectory contains both a curated README index and a template file. Templates use the same blockquote convention as the rest of the repository (delete-after-instantiation). This is the foundation for follow-up work: Makefile generation targets (make adr / make runbook), CI-enforced docs hygiene (adr-lint with pre-commit and GitHub Actions integration), staleness detection, and broader documentation automation. Those land in subsequent commits to keep this change reviewable in isolation. --- .github/PULL_REQUEST_TEMPLATE.md | 0 .github/workflows/adr-lint.yml | 34 +++++ .gitignore | 2 +- .pre-commit-config.yaml | 41 +++++- .vscode/extensions.json | 2 +- .vscode/settings.json | 2 +- CODE_OF_CONDUCT.md | 6 +- CONTRIBUTING.md | 18 +-- Makefile | 145 +++++++++++++++++++ docs/README.md | 133 +++++++++++++++++ docs/adrs/README.md | 93 ++++++++++++ docs/adrs/template.md | 50 +++++++ docs/runbooks/README.md | 101 +++++++++++++ docs/runbooks/template.md | 88 ++++++++++++ scripts/README.md | 110 +++++++++++++++ scripts/adr-lint.py | 235 +++++++++++++++++++++++++++++++ 16 files changed, 1041 insertions(+), 19 deletions(-) mode change 100755 => 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/adr-lint.yml create mode 100644 docs/README.md create mode 100644 docs/adrs/README.md create mode 100644 docs/adrs/template.md create mode 100644 docs/runbooks/README.md create mode 100644 docs/runbooks/template.md create mode 100644 scripts/README.md create mode 100755 scripts/adr-lint.py diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md old mode 100755 new mode 100644 diff --git a/.github/workflows/adr-lint.yml b/.github/workflows/adr-lint.yml new file mode 100644 index 0000000..b5e7dc9 --- /dev/null +++ b/.github/workflows/adr-lint.yml @@ -0,0 +1,34 @@ +name: ADR Lint + +on: + pull_request: + paths: + - "docs/adrs/**" + - "scripts/adr-lint.py" + - ".github/workflows/adr-lint.yml" + push: + branches: [ main ] + paths: + - "docs/adrs/**" + - "scripts/adr-lint.py" + - ".github/workflows/adr-lint.yml" + +permissions: + contents: read + +concurrency: + group: adr-lint-${{ github.ref }} + cancel-in-progress: true + +jobs: + adr-lint: + name: ADR lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Run adr-lint (strict mode) + run: scripts/adr-lint.py --adr-dir docs/adrs --strict diff --git a/.gitignore b/.gitignore index 2e527d3..1fb8fe1 100644 --- a/.gitignore +++ b/.gitignore @@ -367,4 +367,4 @@ scratch/ NOTES.local.md TODO.local.md *.local -*.local.* \ No newline at end of file +*.local.* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b389896..dd667f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,13 +47,24 @@ repos: # Conventional Commits validation # =========================================================================== - repo: https://github.com/compilerla/conventional-pre-commit - rev: v3.6.0 + rev: v4.0.0 hooks: - id: conventional-pre-commit stages: [ commit-msg ] args: - - --types - - feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert + [ + feat, + fix, + docs, + style, + refactor, + perf, + test, + build, + ci, + chore, + revert, + ] # =========================================================================== # Markdown @@ -147,11 +158,30 @@ repos: - id: prettier name: prettier language: system - entry: pnpm exec prettier --write --ignore-unknown - files: \.(js|jsx|ts|tsx|mjs|cjs|json|jsonc|css|scss|html|md|yaml|yml)$ + entry: bash -c 'test -f package.json && pnpm exec prettier --write + --ignore-unknown "$@" || exit 0' -- + files: \.(js|jsx|ts|tsx|mjs|cjs|json|jsonc|css|scss|html)$ pass_filenames: true require_serial: false + # =========================================================================== + # Documentation — runs only when ADR files or the index change + # =========================================================================== + - repo: local + hooks: + - id: adr-lint + name: adr-lint + language: system + entry: scripts/adr-lint.py + files: ^docs/adrs/.*\.md$ + pass_filenames: false + require_serial: true + description: > + Validate ADR numbering, status fields, supersession references, and + index synchronization. Runs on the entire docs/adrs/ tree, not just + changed files, because ADR integrity is a global property (gaps, + duplicates, cross-references). + ci: autofix_commit_msg: "style: pre-commit auto-fixes" autoupdate_commit_msg: "chore(deps): pre-commit autoupdate" @@ -161,3 +191,4 @@ ci: - prettier - cargo-check - terraform_validate + - adr-lint diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3ec3f9e..80cf73c 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -35,4 +35,4 @@ "ms-azuretools.vscode-docker", "ms-azuretools.vscode-containers" ] -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 2ce71e3..0d9b95b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -251,4 +251,4 @@ "git.suggestSmartCommit": false, "terminal.integrated.scrollback": 10000 -} \ No newline at end of file +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 184c7e9..76cc266 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -86,12 +86,12 @@ harassment of an individual, or aggression toward or disparagement of classes of ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. +. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org -For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. -Translations are available at https://www.contributor-covenant.org/translations. +For answers to common questions about this code of conduct, see the FAQ at . +Translations are available at . diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 64ae6f6..699120e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -232,7 +232,7 @@ reasonable choice; consult the project's `README.md` for specifics. The exact layout varies by project, but common top-level directories include: -``` +```sh / ├── .github/ # CI workflows, issue/PR templates, Dependabot config ├── .vscode/ # Shared editor settings and extension recommendations @@ -283,12 +283,14 @@ A CI check (commitlint) verifies every commit on every pull request. ### Format -``` -(): - - - -