Skip to content

chore(claude): split AGENTS.md into rules, skills, and hooks, fix stale docs - #751

Open
stasadev wants to merge 1 commit into
ddev:mainfrom
stasadev:20261005_stasadev_agents_md
Open

stasadev wants to merge 1 commit into
ddev:mainfrom
stasadev:20261005_stasadev_agents_md

Conversation

@stasadev

@stasadev stasadev commented Oct 5, 2026

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

Most of AGENTS.md moves into rules and skills that load only when needed, hooks now run the prettier and textlint checks that CI runs, and the docs that had drifted from the code are corrected.

The Issue

AGENTS.md had grown to 304 lines, all loaded in every session, although most of it applies only to blog content, images, or commits. Nothing enforced its rules, and .gitignore ignored all of .claude, so no shared Claude Code configuration could be committed. ddev textlint passed on errors it could not fix, because textlint --fix exits 0 when they remain, so CI failed where the local check had passed. README.md, README_SPONSOR.md, MARKDOWN_FORMATTING.md, and FORK_PREVIEW_SETUP.md had drifted from the code.

How This PR Solves The Issue

Follows ddev/ddev#8805 and its follow-ups. AGENTS.md keeps what applies to every change and links the rest:

  • .claude/rules/content.md (blog posts, their voice, schema, links, images) and .claude/rules/comments.md load only for the files they cover.
  • Skills: bump-deps documents the dependency bump from build(deps): bump astro from v6.1.1 to v6.1.3 #601, build(deps): bump astro from v6.1.8 to v6.3.1 #637, build: bump Astro from 6 to 7 #685, build: bump astro from v7.1.3 to v7.2.10 #734, and build(deps): bump astro from v7.2.10 to v7.3.5, @astrojs/react to v7 #747, including allowScripts. add-sponsor replaces README_SPONSOR.md, and only needs the sponsor's website. ddev-commit holds the commit and PR rules, and the PR template gains the Short Summary (TL;DR) section from the ddev/ddev template. blog-images holds the screenshot steps, now with a shorter FEATURE_IMAGE_GUIDE.md as feature-banner.md.
  • .claude/settings.json denies git push, allows read-only gh commands and the ddev checks, and adds two hooks. Before git commit, the check-only prettier and textlint run as in CI. After an edit, ddev prettier runs on that file, and ddev textlint too under src/content/.
  • ddev prettier and ddev textlint take optional file arguments, and ddev textlint checks again after fixing. The npm scripts call prettier and textlint by name, since npm run already puts node_modules/.bin on PATH.
  • .gitignore ignores only the personal files the Claude Code docs list.

The docs corrections include blog categories, the dev server port, page paths, image conversion to WebP, external link behavior, feature image sizes, the unused squareLogo, the theme toggle, and the fork preview workflows and URLs. Prettier has no Astro plugin, so AGENTS.md now says nothing formats .astro files. README.md is shorter, with setup steps that AGENTS.md and the skills no longer repeat, and opens with the logo, badges, and links, as the ddev/ddev README does. Two posts set modifiedData instead of modifiedDate, which the content schema dropped without an error, so their modified dates now show.

Manual Testing Instructions

ddev start
ddev prettier src/lib/api.ts             # formats one file
ddev textlint                             # fixes, then reports anything left

Start a new Claude Code session on this branch, then confirm that /bump-deps, /add-sponsor, /ddev-commit, and /blog-images are listed, that editing a file formats it, that git commit runs the checks first, and that git push is denied.

Automated Testing Overview

None. The hook scripts were run directly against a formatted file, an unformatted one, an unfixable textlint error, a .prettierignore path, a path outside the project, an empty payload, and a stopped project. In a live session, an edit was formatted, an unfixable textlint error was reported back, and git commit --dry-run was blocked while that error remained.

Release/Deployment Notes

No effect on the site build. Agents other than Claude Code keep reading AGENTS.md, which links each rule and skill file.

🤖 Developed with assistance from Claude Code

@stasadev
stasadev requested a review from rfay October 5, 2026 13:06
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

🌐 Fork Preview for PR #751

https://pr-751.ddev-com-fork-previews.pages.dev

This preview updates automatically when you push changes to your fork.

…le docs

## Short Summary (TL;DR)

Most of `AGENTS.md` moves into rules and skills that load only when needed, hooks now run the prettier and textlint checks that CI runs, and the docs that had drifted from the code are corrected.

## The Issue

`AGENTS.md` had grown to 304 lines, all loaded in every session, although most of it applies only to blog content, images, or commits. Nothing enforced its rules, and `.gitignore` ignored all of `.claude`, so no shared Claude Code configuration could be committed. `ddev textlint` passed on errors it could not fix, because `textlint --fix` exits 0 when they remain, so CI failed where the local check had passed. README.md, README_SPONSOR.md, MARKDOWN_FORMATTING.md, and FORK_PREVIEW_SETUP.md had drifted from the code.

## How This PR Solves The Issue

Follows ddev/ddev#8805 and its follow-ups. `AGENTS.md` keeps what applies to every change and links the rest:

- `.claude/rules/content.md` (blog posts, their voice, schema, links, images) and `.claude/rules/comments.md` load only for the files they cover.
- Skills: `bump-deps` documents the dependency bump from ddev#601, ddev#637, ddev#685, ddev#734, and ddev#747, including `allowScripts`. `add-sponsor` replaces README_SPONSOR.md, and only needs the sponsor's website. `ddev-commit` holds the commit and PR rules, and the PR template gains the Short Summary (TL;DR) section from the ddev/ddev template. `blog-images` holds the screenshot steps, now with a shorter FEATURE_IMAGE_GUIDE.md as `feature-banner.md`.
- `.claude/settings.json` denies `git push`, allows read-only `gh` commands and the `ddev` checks, and adds two hooks. Before `git commit`, the check-only prettier and textlint run as in CI. After an edit, `ddev prettier` runs on that file, and `ddev textlint` too under `src/content/`.
- `ddev prettier` and `ddev textlint` take optional file arguments, and `ddev textlint` checks again after fixing. The npm scripts call `prettier` and `textlint` by name, since `npm run` already puts `node_modules/.bin` on `PATH`.
- `.gitignore` ignores only the personal files the Claude Code docs list.

The docs corrections include blog categories, the dev server port, page paths, image conversion to WebP, external link behavior, feature image sizes, the unused `squareLogo`, the theme toggle, and the fork preview workflows and URLs. Prettier has no Astro plugin, so `AGENTS.md` now says nothing formats `.astro` files. README.md is shorter, with setup steps that `AGENTS.md` and the skills no longer repeat, and opens with the logo, badges, and links, as the ddev/ddev README does. Two posts set `modifiedData` instead of `modifiedDate`, which the content schema dropped without an error, so their modified dates now show.

## Manual Testing Instructions

```bash
ddev start
ddev prettier src/lib/api.ts             # formats one file
ddev textlint                             # fixes, then reports anything left
```

Start a new Claude Code session on this branch, then confirm that `/bump-deps`, `/add-sponsor`, `/ddev-commit`, and `/blog-images` are listed, that editing a file formats it, that `git commit` runs the checks first, and that `git push` is denied.

## Automated Testing Overview

None. The hook scripts were run directly against a formatted file, an unformatted one, an unfixable textlint error, a `.prettierignore` path, a path outside the project, an empty payload, and a stopped project. In a live session, an edit was formatted, an unfixable textlint error was reported back, and `git commit --dry-run` was blocked while that error remained.

## Release/Deployment Notes

No effect on the site build. Agents other than Claude Code, including Copilot code review, keep reading `AGENTS.md`, which links each rule and skill file.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stasadev
stasadev force-pushed the 20261005_stasadev_agents_md branch from 7ba3228 to d8905a0 Compare October 5, 2026 13:09

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

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.

2 participants