1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
//! The Claude Code schema constants that `verify` enforces.
//!
//! Every literal here is grounded in the public docs (code.claude.com/docs/en/
//! plugins-reference, plugin-marketplaces, skills) as checked against the live
//! spec. Keep a comment citing the source for each rule so future-me can
//! re-verify against an updated spec without guessing where a number came from.
/// The combined `description` + `when_to_use` text in the SKILL.md skill
/// listing is capped at 1,536 characters.
///
/// Source: code.claude.com/docs/en/skills — "the combined `description` and
/// `when_to_use` text is truncated at 1,536 characters in the skill listing."
pub const SKILL_LISTING_CHAR_CAP: usize = 1_536;
/// A skill `name` is capped at 64 characters.
///
/// Source: skill-authoring docs — "name: Maximum 64 characters."
pub const SKILL_NAME_MAX_CHARS: usize = 64;
// `when_to_use` advertises trigger phrases; we flag if it's present but empty
// or only whitespace, since that defeats the whole point of the field.
// (We do not enforce a hard length — the listing cap covers the upper bound.)
/// Plugin / marketplace `name` must be kebab-case and contain no spaces.
/// Source: plugin-marketplaces — "kebab-case, no spaces." We use a permissive
/// regex that matches the AgentSkills.io open standard `^[a-z][a-z0-9-]*[a-z0-9]$`,
/// which allows no consecutive hyphens and a trailing alnum.
pub const NAME_KEBAB_REGEX: &str = r"^[a-z][a-z0-9-]*[a-z0-9]$";
// A name that is a single lowercase letter is a degenerate corner not covered
// by the regex above (which requires ≥2 chars); we accept it explicitly below
// by treating length-1 names as valid iff they're `[a-z]`.
// The relative-path form of a marketplace plugin `source` MUST start with
// `./`. We only flag structural problems; absolute and `../` are flagged.
// Source: plugin-marketplaces — "Relative path ... Must start with `./`.
// Resolved relative to the marketplace root."
/// Names we refuse outright. The design doc listed a candidate set; the live
/// docs did not confirm Anthropic publishes an authoritative reserved list, so
/// these are treated as WARNINGS (not hard failures), per the honest-verifier
/// posture in design §13 Mitigation ("verify is deliberately conservative").
/// A maintainer can ignore a warning; they cannot ignore the reputation cost of
/// clobbering an Anthropic-owned name.
pub const RESERVED_NAMES: & = &;
/// `plugin.json` MUST live at `.claude-plugin/plugin.json`. Source:
/// anthropics/claude-code manifest-reference.md — "Required path:
/// `.claude-plugin/plugin.json`."
pub const PLUGIN_JSON_PATH: &str = ".claude-plugin/plugin.json";
/// The `.claude-plugin/` directory houses the marketplace + plugin manifests.
/// Source: anthropics/claude-code plugin-reference.md. Verified July 2026.
pub const CLAUDE_PLUGIN_DIR: &str = ".claude-plugin";
/// `marketplace.json` lives at `.claude-plugin/marketplace.json`. Source:
/// plugin-marketplaces — "Create `.claude-plugin/marketplace.json`."
pub const MARKETPLACE_JSON_PATH: &str = ".claude-plugin/marketplace.json";
/// Cursor project rules live under `.cursor/rules/<name>.mdc`. Source:
/// cursor.com/docs/rules — "Project rules are stored as `.mdc` files in
/// `.cursor/rules/`." Verified July 2026.
pub const CURSOR_RULES_DIR: &str = ".cursor/rules";
/// Codex CLI skills live under `.codex/skills/<name>/SKILL.md`. Source:
/// the AgentSkills open standard (agskills.dev) and the Codex CLI skill
/// convention — same `SKILL.md` frontmatter shape as Claude, installed under
/// `.codex/skills/`. Verified July 2026.
pub const CODEX_SKILLS_DIR: &str = ".codex/skills";
/// Native Claude Code skills directory `.claude/skills/<name>/SKILL.md`.
/// Source: code.claude.com/docs/en/skills — Claude Code scans `.claude/skills/`
/// and auto-loads each skill with no plugin-install step. Same `SKILL.md`
/// frontmatter shape as the plugin `skills/<name>/SKILL.md` path, different
/// directory (native vs plugin-installed). Verified August 2026.
pub const CLAUDE_SKILLS_DIR: &str = ".claude/skills";
/// OpenCode agent definitions live under `.opencode/agents/<name>.md`. Source:
/// opencode.ai/docs/agents — "Place them in: Per-project:
/// `.opencode/agents/`". The markdown file name becomes the agent name.
/// Frontmatter: `description` (required), `mode`/`temperature`/`permissions`
/// (optional). Verified July 2026.
pub const OPENCODE_AGENTS_DIR: &str = ".opencode/agents";
/// GitHub Copilot custom instructions live at
/// `.github/copilot-instructions.md`. Source:
/// docs.github.com/copilot/how-tos/copilot-on-github/customize-copilot/
/// add-repository-instructions — "The path is always
/// `.github/copilot-instructions.md`." Plain markdown, no frontmatter.
/// Verified July 2026.
pub const COPILOT_INSTRUCTIONS_PATH: &str = ".github/copilot-instructions.md";
/// AGENTS.md lives at the repository root. Source: agents.md (Linux Foundation
/// stewarded, aaif.io/projects/agents-md) — "AGENTS.md is just standard Markdown.
/// Use any headings you like; the agent simply parses the text you provide."
/// Plain markdown, no frontmatter, no required fields. Read natively by 20+
/// coding agents (Codex, Cursor, Windsurf, Copilot, Aider, Zed, Warp, JetBrains
/// Junie, Freebuff, etc.). Verified July 2026.
pub const AGENTS_MD_PATH: &str = "AGENTS.md";
/// `CLAUDE.md` lives at the repository root. Source: the Claude Code
/// ecosystem convention — Claude Code, Cline, Roo Code, and their forks read
/// a root `CLAUDE.md` for project instructions. Plain markdown, no
/// frontmatter (same structural contract as AGENTS.md). Verified July 2026.
pub const CLAUDE_MD_PATH: &str = "CLAUDE.md";
/// `GEMINI.md` lives at the repository root. Source:
/// google-gemini.github.io/gemini-cli/docs/cli/gemini-md.html — "You can use
/// these files to give project-specific instructions ... to make the AI's
/// responses more accurate." Plain markdown, no frontmatter. Verified July 2026.
pub const GEMINI_MD_PATH: &str = "GEMINI.md";
/// Windsurf (Cascade) project rules live under `.windsurf/rules/<name>.md`.
/// Source: the Windsurf docs and the cursor↔windsurf converter ecosystem —
/// the same `description`/`globs`/`alwaysApply` frontmatter shape as Cursor
/// rules, `.md` files under `.windsurf/rules/`. Verified July 2026.
pub const WINDSURF_RULES_DIR: &str = ".windsurf/rules";
/// Aider reads a root-level `CONVENTIONS.md` for repo conventions. Plain
/// markdown, no frontmatter. Verified July 2026 against the aider docs.
pub const CONVENTIONS_MD_PATH: &str = "CONVENTIONS.md";
/// Cline workspace rules live in `.clinerules/` (`.md`/`.txt` files, optional
/// `paths:` YAML frontmatter for conditional rules). Source:
/// docs.cline.bot/customization/cline-rules — "Workspace rules go in
/// `.clinerules/` at your project root." Verified August 2026.
pub const CLINE_RULES_DIR: &str = ".clinerules";
/// Roo Code workspace rules live in `.roo/rules/` (markdown; mode-specific
/// rules live in `.roo/rules-{modeSlug}/`). Source: docs.roocode.com custom
/// modes / rules — "Instructions can also live in `.roo/rules/`
/// (workspace-wide)." Verified August 2026.
pub const ROO_RULES_DIR: &str = ".roo/rules";
/// Kilo Code project rules. The current format references `.kilo/rules/*.md`
/// via `kilo.jsonc`'s `instructions` array, but `.kilocode/rules/` is
/// auto-included for backward compatibility (kilo.ai/docs/customize/custom-rules
/// — "The extension is backward compatible with `.kilocode/rules/` directories").
/// Emitting into the backward-compatible directory loads with zero config edit.
/// Verified August 2026.
pub const KILOCODE_RULES_DIR: &str = ".kilocode/rules";
/// Goose (Block's open-source agent) reads a project-wide
/// `.goose/instructions.md`. Plain markdown, no frontmatter. Verified August
/// 2026 against the Goose docs + the ctxlint context-file registry.
pub const GOOSE_INSTRUCTIONS_PATH: &str = ".goose/instructions.md";
// Action-verb heuristic: the first word of a good skill description is an
// action verb (e.g. "Lint", "Generate", "Format"). We don't enforce grammar —
// we only flag descriptions that don't begin with an alphabetic word, a
// strong signal the description was written as a name/title. Source: skill
// best-practices — open with "one sentence describing what the skill does";
// the listing places the key use case first.