ai-instruct
CLAUDE.md29 starsChanged 22 days agoApache-2.0View on GitHub
A collection of markdown guides for developers using AI coding assistants. The guides are consumed by other projects (pasted into chat, added to CLAUDE.md, .cursorrules, etc.) - this repo itself is not a web app or library. The only runnable code is the CLI in bin/init.js, which users run via npx ai-instruct init in their own projects. Run locally: Test the published package: The CLI has no dependencies - it uses only Node.js built-ins (fs, os, path, readline) plus the…
In this repository6 other files it gives its agents.
- llms.txtllms.txt
- aws-spa-deploySkill
- google-analytics-4Skill
- seo-llmoSkill
- web-accessibilitySkill
- web-performanceSkill
The file
We split this CLAUDE.md into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 43
All changes reach main through a pull request.
- Very specific: line 46
Edit content: - update one or more *-guide.md files (or add a new guide, see below), then rebuild:
- Very specific: line 50
Commit the guide and the regenerated skills/ files together.
- Distinctive: line 65
Every guide must follow this structure in order:
- Very specific: line 76
Create kebab-case-name.md at the repo root
- Distinctive: line 77
Follow the guide format above (read CONTRIBUTING.md for the full spec)
- Very specific: line 78
Add a row to the ## Guides table in README.md (Guide name | filename link | description)
- Very specific: line 80
Run npm run build:skills to generate skills/<skillName>/ (and npm run check:skills), then commit it alongside the guide.
- Very specific: line 81
Add the guide's raw GitHub URL to llms.txt
- Very specific: line 97
Use backtick skill names (seo-llmo, web-accessibility, etc.) or all guides, CLI, README when the change is not skill-specific.
- Distinctive: line 102
Commit message body explains *why*, not just what changed
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this repo is
A collection of markdown guides for developers using AI coding assistants. The guides are consumed by other projects (pasted into chat, added to CLAUDE.md, .cursorrules, etc.) - this repo itself is not a web app or library.
The only runnable code is the CLI in bin/init.js, which users run via npx ai-instruct init in their own projects.
CLI
Run locally:
node bin/init.js # standard flow (detect tool, write to ai-docs/)
node bin/init.js --skills # install as Claude Code skills in .claude/skills/
node bin/init.js --skills --user # install in ~/.claude/skills/ (user scope)Test the published package:
npx ai-instruct initThe CLI has no dependencies - it uses only Node.js built-ins (fs, os, path, readline) plus the global fetch (Node 18+). Do not add external packages.
bin/lib/guides.js is the single source of truth for the guide list (filenames, descriptions, skill names, skill descriptions, section summaries) and for the skill builder that turns a guide into skill files. Both the CLI and the build script import from it.
Plugin and skills (Claude Code)
The repo also publishes itself as a Claude Code plugin. The plugin bundles all 5 guides as skills under skills/<skill-name>/SKILL.md.
skills/is generated byscripts/build-skills.jsfrom the canonical*-guide.mdfiles plus the metadata inbin/lib/guides.js. Do not edit anything underskills/by hand - edit the source guide and rebuild.- The splitting logic (
buildSkillFiles) lives inbin/lib/guides.js, shared by the build script and the CLI. Skills use progressive disclosure: if a guide's single-file skill would exceed 500 lines, the build writesskills/<name>/SKILL.mdwith the frontmatter, the guide header, Section 0 in full, and a linked index, plus oneskills/<name>/references/<slug>.mdper remaining H2 section. The guide's own "Contents" section is replaced by that index. Intra-guide#anchorlinks are rewritten to point at the right reference file. Shorter guides stay a singleSKILL.md. The guides themselves stay single files because they are also used outside Claude Code. - Each index entry needs a one-line "when to read this" summary: the section's
Applies when:line, or an entry in that guide'ssectionSummariesmap inbin/lib/guides.js. The build fails on a missing summary, a stalesectionSummarieskey, or a link to an unknown anchor. - The build deletes and rewrites each
references/directory, so renamed sections never leave orphans.npm run check:skills(scripts/check-skills.js) verifies line limits, that every relative link and anchor resolves, and that every reference file is linked from itsSKILL.md. CI runs both and fails on any diff or untracked file underskills/. skills/is committed to the repo (not gitignored) so users installing via/plugin installget the files without running a build..claude-plugin/plugin.jsonand.claude-plugin/marketplace.jsondescribe the plugin and the marketplace (this repo is its own marketplace, so users can/plugin marketplace add ziniman/ai-instruct).- Versions in those two JSON files are synced from
package.jsonbyscripts/sync-versions.js, which runs automatically as part ofnpm version.
Release process
All changes reach main through a pull request. Never push to main directly and never run npm publish locally. Publishing to npm, tagging, and the GitHub release all happen in CI when a PR that bumps the version is merged.
- Branch:
git checkout -b <type>/<short-description>(e.g.docs/seo-llmo-mcp,fix/cli-windows-paths). - Edit content - update one or more
*-guide.mdfiles (or add a new guide, see below), then rebuild:
Commit the guide and the regeneratednpm run build:skills # regenerates skills/<name>/SKILL.md and references/skills/files together. - Bump the version in the same PR (skip this for changes that should not ship a release, e.g. README or CI tweaks):
The reponpm version patch # or minor / major.npmrcsetsgit-tag-version=false, so this only edits files: theversionhook runssync-versions.js(writes the new version to.claude-plugin/plugin.jsonandmarketplace.json) andbuild-skills.js, then stages them. Add a matching## vX.Y.Zentry toCHANGELOG.mdand commit everything. - Open the PR.
.github/workflows/ci.ymlchecks thatskills/matches the guides, that plugin versions matchpackage.json, and, if the version changed, that it is not already on npm and has a CHANGELOG entry. The job summary says whether merging will publish. - Merge.
.github/workflows/release.ymlruns on every push tomain. If thepackage.jsonversion is not on npm yet, it runsnpm publish(theprepublishOnlyhook rebuilds skills as a safety net), then creates thevX.Y.Ztag and a GitHub release titledvX.Y.Z - <PR title>with the CHANGELOG entry as notes. If the version is already published, it does nothing. The plugin marketplace (/plugin marketplace add ziniman/ai-instruct) readsmaindirectly, so it updates on merge either way.
npm auth uses trusted publishing (OIDC), so there is no NPM_TOKEN secret to rotate and no 2FA prompt. The trusted publisher is configured on npmjs.com under the package settings: GitHub Actions, repo ziniman/ai-instruct, workflow release.yml. Renaming the workflow file breaks publishing until that setting is updated.
Never bump the version by hand-editing package.json - it skips the sync hook and CI will fail on mismatched plugin versions.
Guide format (enforced by CONTRIBUTING.md)
Every guide must follow this structure in order:
- H1 title + metadata blockquote (
> Applies to: ... | Updated: Month YYYY) - Section 0: Before You Start - 4 - 6 plain-English questions with defaults, followed by a
> **AI assistant:**instruction line - Table of contents (for guides longer than ~150 lines)
- Content sections - one concept per section, self-contained
The Section 0 pattern is the core of the approach: questions replace generic boilerplate. Defaults must be detectable from the project (e.g. framework in package.json) or a best-practice baseline.
Adding a new guide
- Create
kebab-case-name.mdat the repo root - Follow the guide format above (read CONTRIBUTING.md for the full spec)
- Add a row to the
## Guidestable inREADME.md(Guide name | filename link | description) - Add the guide to the
GUIDESarray inbin/lib/guides.jswithname,file,desc,topic,skillName, andskillDescriptionfields. TheskillDescriptionis what triggers the skill in Claude Code - write it in the "Use this skill whenever..." style with explicit trigger contexts and skip-for cases (see existing entries). - Run
npm run build:skillsto generateskills/<skillName>/(andnpm run check:skills), then commit it alongside the guide. If the build asks for section summaries, addApplies when:lines to the guide or asectionSummariesmap to itsGUIDESentry - Add the guide's raw GitHub URL to
llms.txt
Changelog
CHANGELOG.md in the repo root tracks all meaningful changes. Update it on every commit that adds, modifies, or removes guide content, CLI behaviour, skills, or plugin metadata. Skip changelog entries for typo fixes, formatting-only changes, and version-bump-only commits.
Format: add a new ## vX.Y.Z · YYYY-MM-DD section at the top with one bold entry per changed area:
## vX.Y.Z · YYYY-MM-DD
**`skill-name`** — One-line description of what changed and why it matters
**`another-skill`** — Another changeUse backtick skill names (seo-llmo, web-accessibility, etc.) or all guides, CLI, README when the change is not skill-specific.
Commit style
- No
Co-Authored-Bylines - Commit message body explains why, not just what changed
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

