Skip to content

Add handbook-pr Claude skill for handbook changes - #54218

Merged
allenhouchins merged 1 commit into
mainfrom
allenhouchins/handbook-pr-skill
Sep 28, 2026
Merged

allenhouchins merged 1 commit into
mainfrom
allenhouchins/handbook-pr-skill

Conversation

@allenhouchins

@allenhouchins allenhouchins commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a handbook-pr skill so handbook changes requested from Slack (or anywhere else) turn into small, correct PRs the page maintainer can merge without edits.

Why: Since late August, Claude has opened 13 handbook-only PRs from Slack (9 merged, 4 closed). Their descriptions vary a lot. #52865 and #52979 paste the whole code checklist with every item marked N/A, #52471 and #51968 are freeform, and #52426 has an escaped HTML comment and two "Generated with" footers. The cause is the .claude/CLAUDE.md rule that every PR must use .github/pull_request_template.md, even though check-pr-template doesn't run on handbook/ changes. #52471 also wrote the same ritual twice, once in marketing.rituals.yml and again as prose on the page.

What the skill does:

  • Reads Writing at Fleet, Brand, and the content-style skill at the start of each change. It links to them instead of copying their rules, so it stays current when those pages change.
  • Asks the requester for missing facts instead of inventing them, and searches for existing coverage before adding anything new.
  • Lists the rules that fail the website build or docs CI (maintainedBy and title meta tags, @fleetdm.com emails, {{ }}, "click here" links, required ritual fields and autoIssue frequencies) and the link rules from writing.md (heading renames, full URLs).
  • Checks that nothing private from the Slack thread lands on a public page.
  • Defines a short handbook-only PR description (requested by, before/after, page link, **AI:** line) and requests exactly one reviewer: the page's maintainedBy, falling back to githubRepoDRIByPath in website/config/custom.js.

Checker script: .claude/skills/handbook-pr/scripts/check-handbook-diff.sh compares the branch with origin/main and reports:

  • Errors: build and CI failures, invalid ritual YAML, and GitHub usernames that don't exist
  • Warnings: renamed or removed headings, with every repo link to the old anchor; deleted or moved pages; relative links; em dashes; "FleetDM"; whitespace-only changes; and files changed outside handbook/

Anchors are computed the same way as website/api/helpers/strings/to-html.js.

Related cleanups:

  • .claude/CLAUDE.md: handbook-only PRs use the skill's description format instead of the PR template.
  • content-style and spec-story no longer point to handbook/marketing/fleet-ai-writing-instructions.md, which was deleted in No more AI writing like this. #53209.
  • .claude/README.md: adds the skill to the skills reference and updates the counts.

Not in this PR: handbook/marketing/README.md still links to the deleted fleet-ai-writing-instructions page in two places. That's a handbook change with a different maintainer, so it should be a separate PR.

Checklist for submitter

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.
    • The checker only passes GitHub usernames that match [A-Za-z0-9-]+ to gh api. Everything else it reads from the diff is quoted and only matched against.

Testing

  • QA'd all new/changed functionality manually
    • Heading anchors: the script's anchors matched fleetdm.com's live heading IDs on 6 handbook pages (communications, writing, why-this-way, product-design, sales, engineering). The only differences were the numeric suffixes the site adds to duplicate headings.
    • Checker, with deliberately broken edits: each case below was reported, then the edits were reverted.
      • @fleetdm.com email, "click here" link, {{ }} outside backticks, em dash, relative anchor and path, "FleetDM"
      • A renamed heading, which listed all 3 inbound links to #scheduling-a-meeting. A heading that only changed level wasn't flagged.
      • A new page with a bad filename, no maintainedBy, and a title over 40 characters (counting emoji as 2)
      • Rituals missing dri or description, autoIssue with an unsupported frequency, a fake DRI username, and invalid YAML
      • A deleted page, an edit to a file whose path has emoji and spaces (legal/📜 Fleet Privacy Policy.md), and a whitespace-only change
    • A clean edit reports 0 errors and exits 0. Any error exits 1.
    • Ran under macOS /bin/bash 3.2 and bash 5.3.
    • The skill's frontmatter parses as valid YAML.

AI

AI: Claude Code (claude-opus-5-5)

Summary by CodeRabbit

  • Documentation
    • Handbook updates are now checked for deleted or moved pages, renamed or removed heading links, invalid links, and formatting patterns that may cause problems.
    • Changed handbook pages are checked for required metadata, title length, and page naming and heading conventions.
    • Ritual configuration edits are checked for valid syntax, required fields, and supported scheduling frequencies.
    • Maintainer and DRI usernames are verified when available; otherwise, the check reports that verification could not be performed.
    • The check reports edits outside the handbook and whitespace-only changes. Errors affect its exit status; warnings do not.

Handbook PRs opened by Claude from Slack have inconsistent descriptions
(some paste the full code checklist marked N/A), duplicate content, and
no consistent reviewer. The new skill links to Fleet's writing
guidelines instead of copying them, covers the website build and link
rules, adds a public-content check, and defines a handbook-only PR
description and reviewer rule. A checker script flags build errors,
broken heading anchors, relative links, and whitespace churn.

Also exempts handbook-only PRs from the PR template rule in CLAUDE.md,
and removes references to handbook/marketing/fleet-ai-writing-instructions.md,
which was deleted in #53209.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved validation gaps and contradictory PR-format instructions remain.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds a dedicated Claude workflow and validation script for focused handbook PRs, while updating related documentation and removing obsolete writing-guide references.

Changes:

  • Adds the handbook-pr skill and diff checker.
  • Updates Claude instructions and skill documentation.
  • Removes stale AI-writing-guide references.
File Description
.claude/​skills/​spec-story/​SKILL.md Removes obsolete writing-guide reference
.claude/​skills/​handbook-pr/​SKILL.md Adds handbook PR workflow
.claude/​skills/​handbook-pr/​scripts/​check-handbook-diff.sh Adds handbook validation checks
.claude/​skills/​content-style/​SKILL.md Updates canonical writing guidance
.claude/​skills/​content-style/​references/​style-rules.md Updates style reference
.claude/​README.md Documents the new skill
.claude/​CLAUDE.md Adds handbook PR guidance and exception

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +31 to +41
# Mirrors how website/api/helpers/strings/to-html.js builds heading IDs:
# _.kebabCase (lodash 3) of the lowercased heading HTML, with apostrophes removed.
slugify() {
printf '%s' "$1" |
sed -E 's/^(>[[:space:]]*)?#+[[:space:]]+//; s/[[:space:]]+#*[[:space:]]*$//' |
sed -E 's/`([^`]*)`/ code \1 code /g; s/\*\*([^*]*)\*\*/ strong \1 strong /g; s/\*([^*]+)\*/ em \1 em /g' |
sed -E 's/(^|[^[:alnum:]])_([^_]+)_([^[:alnum:]]|$)/\1 em \2 em \3/g' |
sed -e "s/’//g" -e "s/'//g" |
tr '[:upper:]' '[:lower:]' |
LC_ALL=C grep -oE '[a-z]+|[0-9]+' |
paste -sd- -
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: fleetdm/fleet/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f3f934c4-3daf-4701-a4e0-eb470951886d

📥 Commits

Reviewing files that changed from the base of the PR and between 42464fb and 6e71b8e.

⛔ Files ignored due to path filters (6)
  • .claude/CLAUDE.md is excluded by !**/*.md
  • .claude/README.md is excluded by !**/*.md
  • .claude/skills/content-style/SKILL.md is excluded by !**/*.md
  • .claude/skills/content-style/references/style-rules.md is excluded by !**/*.md
  • .claude/skills/handbook-pr/SKILL.md is excluded by !**/*.md
  • .claude/skills/spec-story/SKILL.md is excluded by !**/*.md
📒 Files selected for processing (1)
  • .claude/skills/handbook-pr/scripts/check-handbook-diff.sh

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

Adds a shell script that compares handbook changes against a merge base. The script checks Markdown edits, page metadata, heading anchors, ritual YAML, and newly added GitHub handles. It reports errors and warnings. It exits with status 2 if it cannot find the repository root or merge base, and exits with status 1 when it finds errors.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 6e71b

The identified path-parsing concern does not prevent handbook checks from running, and no remaining issue warrants delaying merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding a Claude skill for handbook changes.
Description check ✅ Passed The description explains the purpose, scope, implementation, testing, and AI tool used. It omits the related issue field and several non-applicable template sections, but it is mostly complete for thi…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@allenhouchins
allenhouchins merged commit 66ed677 into main Sep 28, 2026
11 checks passed
@allenhouchins
allenhouchins deleted the allenhouchins/handbook-pr-skill branch September 28, 2026 17:13

This branch was previously deployed

1 inactive deployment
Docker Hub — 6e71b8ed Deployed Sep 28, 2026 by allenhouchins via publish #106371
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants