Skip to content

docs: add ai agent support (skill, guide, llms.txt) - #4804

Merged
escapedcat merged 4 commits into
masterfrom
docs/ai-agent-support
Jun 2, 2026
Merged

escapedcat merged 4 commits into
masterfrom
docs/ai-agent-support

Conversation

@escapedcat

Copy link
Copy Markdown
Member

Problem

AI coding agents (Claude Code, Copilot, Cursor, …) now write a large share of commits in
repos that use commitlint. Today they interact with commitlint blindly: commit → hook
rejects → parse human-oriented terminal output → retry. Nothing teaches them to read the
repo's convention upfront, and nothing on commitlint.js.org is consumable by LLMs in a
structured way.

What this PR does

Three additions, zero new runtime code — documentation and build metadata only:

1. Agent skill — skills/committing-with-commitlint/SKILL.md

A tool-neutral Agent Skills file that teaches AI agents to:

  1. detect that a repo uses commitlint
  2. read the enforced rules via commitlint --print-config json (including how to
    interpret [severity, applicability, value] rule triples)
  3. write a compliant message
  4. pre-validate it via stdin before committing
  5. self-correct from ✖ … [rule-name] hook rejections — and never bypass with --no-verify

The skill hardcodes no convention — it teaches reading each repo's resolved config, so one
skill works in every repo. Every CLI command and output quoted in it was verified against
the actual v21.0.2 CLI.

2. Docs guide — docs/guides/ai-agents.md

New "AI agents" page in the Guides sidebar:

  • install the skill (one curl command)
  • AGENTS.md / CLAUDE.md fallback snippet for tools without skill support
  • CLI primitives reference for agents and automation (--print-config json, stdin
    linting, --last, --edit, --strict exit codes)
  • pointers to llms.txt / llms-full.txt

3. llms.txt — vitepress-plugin-llms

One dev dependency + 2-line VitePress config change. The docs build (and the existing
Pages deploy workflow) now emits:

  • https://commitlint.js.org/llms.txt — page index for LLMs
  • https://commitlint.js.org/llms-full.txt — entire docs as one markdown file (~77 KB)
  • a clean .md twin of every docs page

So LLMs answering "how do I configure commitlint?" can read current docs instead of
hallucinating from training data.

@escapedcat escapedcat changed the title Docs/ai agent support docs: add ai agent support (skill, guide, llms.txt) Jun 2, 2026
@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Add AI agent support and LLM-friendly documentation

📝 Documentation ✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add Agent Skills file teaching AI agents to use commitlint
• Create AI agents guide with CLI primitives and setup instructions
• Generate llms.txt files for LLM-friendly documentation access
• Add vitepress-plugin-llms dependency for automatic doc generation
Diagram
flowchart LR
  A["Agent Skills<br/>SKILL.md"] -->|teaches| B["AI Agents"]
  C["AI Agents Guide<br/>ai-agents.md"] -->|instructs| B
  D["vitepress-plugin-llms"] -->|generates| E["llms.txt<br/>llms-full.txt"]
  B -->|reads config via| F["commitlint CLI"]
  E -->|enables| G["LLM Access<br/>to Docs"]

Loading

Grey Divider

File Changes

1. docs/.vitepress/config.ts ⚙️ Configuration changes +6/-0

Configure VitePress for llms.txt generation

• Import and register vitepress-plugin-llms plugin
• Add "AI agents" guide link to sidebar navigation
• Configure Vite plugins section with llmstxt plugin

docs/.vitepress/config.ts


2. package.json Dependencies +1/-0

Add vitepress-plugin-llms dependency

• Add vitepress-plugin-llms v1.13.1 as dev dependency

package.json


3. pnpm-lock.yaml Dependencies +534/-0

Lock vitepress-plugin-llms and dependencies

• Lock vitepress-plugin-llms and 50+ transitive dependencies
• Include markdown parsing, remark, micromark, and utility packages
• Add type definitions and encoding/decoding utilities

pnpm-lock.yaml


View more (2)
4. skills/committing-with-commitlint/SKILL.md 📝 Documentation +102/-0

Add commitlint Agent Skills file

• Define Agent Skills format file for AI coding agents
• Document 5-step process: detect commitlint, read rules, write message, validate, self-correct
• Explain rule format [severity, applicability, value] with rule reference table
• Provide example commit message and rejection handling guidance

skills/committing-with-commitlint/SKILL.md


5. docs/guides/ai-agents.md 📝 Documentation +55/-0

Add AI agents guide to documentation

• Create new guide for AI agents using commitlint
• Document skill installation via curl for Agent Skills-compatible tools
• Provide fallback instructions for tools without skill support
• List CLI primitives table for agents and automation
• Link to llms.txt resources for LLM documentation access

docs/guides/ai-agents.md


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Jun 2, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

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.

Pull request overview

This PR adds AI-agent–consumable documentation artifacts to help coding agents discover and follow a repository’s commitlint rules (via resolved config introspection), and makes the docs site publish llms.txt/llms-full.txt outputs via a VitePress build plugin.

Changes:

  • Add an Agent Skills file (SKILL.md) describing how to detect commitlint, read resolved rules (--print-config json), validate via stdin, and self-correct from hook failures.
  • Add a new “AI agents” docs guide and link it into the Guides sidebar.
  • Add vitepress-plugin-llms and wire it into the VitePress config so the docs build can emit LLM-friendly outputs.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
skills/committing-with-commitlint/SKILL.md New agent skill describing commitlint-aware commit message workflow.
docs/guides/ai-agents.md New guide page with skill install instructions and CLI primitives for agents.
docs/.vitepress/config.ts Adds “AI agents” to Guides sidebar and enables vitepress-plugin-llms.
package.json Adds vitepress-plugin-llms as a dev dependency.
pnpm-lock.yaml Lockfile updates for the new VitePress plugin and its transitive deps.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@escapedcat
escapedcat force-pushed the docs/ai-agent-support branch from 78b7fcc to 24ae207 Compare June 2, 2026 12:06
Reword the absent-rule guidance so it does not attribute the conservative
baseline to the Conventional Commits spec, document that config-conventional
allows 100-char headers, and note the empty-rules failure when no config
exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@escapedcat
escapedcat merged commit 36dc150 into master Jun 2, 2026
14 checks passed
@escapedcat
escapedcat deleted the docs/ai-agent-support branch June 2, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants