@yawlabs/ctxlint 0.25.1 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pre-commit-hooks.yaml +10 -10
- package/AGENT_SESSION_LINT_SPEC.md +632 -612
- package/AGENT_SKILL_LINT_SPEC.md +20 -18
- package/CONTEXT_LINT_SPEC.md +809 -782
- package/MCP_CONFIG_LINT_SPEC.md +434 -419
- package/README.md +553 -553
- package/agent-session-lint-rules.json +243 -243
- package/bin/ctxlint.mjs +410 -360
- package/context-lint-rules.json +695 -754
- package/dist/index.js +234 -252
- package/mcp-config-lint-rules.json +45 -162
- package/package.json +5 -4
package/AGENT_SKILL_LINT_SPEC.md
CHANGED
|
@@ -18,12 +18,12 @@ These definition files have the same failure modes as context files: their front
|
|
|
18
18
|
|
|
19
19
|
This specification defines a standard set of lint rules for validating agent-skill definitions. It is the **fourth pillar** alongside context-file linting, MCP-config linting, and session-data linting:
|
|
20
20
|
|
|
21
|
-
| Pillar
|
|
22
|
-
|
|
23
|
-
| Context files | Instructions the agent reads
|
|
24
|
-
| MCP configs
|
|
25
|
-
| Session data
|
|
26
|
-
| Agent skills
|
|
21
|
+
| Pillar | What it checks | Specification |
|
|
22
|
+
| ------------- | ------------------------------------ | ---------------------------------------------------------- |
|
|
23
|
+
| Context files | Instructions the agent reads | [CONTEXT_LINT_SPEC.md](./CONTEXT_LINT_SPEC.md) |
|
|
24
|
+
| MCP configs | Tools the agent can use | [MCP_CONFIG_LINT_SPEC.md](./MCP_CONFIG_LINT_SPEC.md) |
|
|
25
|
+
| Session data | History and memory the agent carries | [AGENT_SESSION_LINT_SPEC.md](./AGENT_SESSION_LINT_SPEC.md) |
|
|
26
|
+
| Agent skills | Skills and subagents the agent loads | This document |
|
|
27
27
|
|
|
28
28
|
**v1 scope is deliberately tight: Claude Code only** (`~/.claude/skills/<name>/SKILL.md` and `~/.claude/agents/*.md`). Other agents' skill/subagent formats may be added in later spec versions.
|
|
29
29
|
|
|
@@ -35,10 +35,10 @@ This specification defines a standard set of lint rules for validating agent-ski
|
|
|
35
35
|
|
|
36
36
|
### 1.1 Data sources (v1)
|
|
37
37
|
|
|
38
|
-
| Kind
|
|
39
|
-
|
|
40
|
-
| Skill
|
|
41
|
-
| Agent (subagent) | `~/.claude/agents/<name>.md`
|
|
38
|
+
| Kind | Location | Required frontmatter |
|
|
39
|
+
| ---------------- | ---------------------------------- | ---------------------------------------------------------- |
|
|
40
|
+
| Skill | `~/.claude/skills/<name>/SKILL.md` | `name`, `description` |
|
|
41
|
+
| Agent (subagent) | `~/.claude/agents/<name>.md` | `name`, `description` (optional `tools` / `allowed-tools`) |
|
|
42
42
|
|
|
43
43
|
The skill `<name>` is the directory name; the agent `<name>` is the filename without `.md`. A `~/.claude/skills/<name>/` directory with no `SKILL.md` is an **orphaned skill** -- the directory exists but Claude Code has nothing to load.
|
|
44
44
|
|
|
@@ -53,25 +53,26 @@ Skill/agent definitions live in the user-global `~/.claude/` tree, NOT inside th
|
|
|
53
53
|
5 rules in 1 category (`skill`). All rules audit Claude Code skill (`SKILL.md`) and agent (`.md`) definition files.
|
|
54
54
|
|
|
55
55
|
Severity levels:
|
|
56
|
+
|
|
56
57
|
- **error** -- the definition is structurally broken (e.g. unclosed or absent frontmatter). The skill/agent will not load as intended.
|
|
57
58
|
- **warning** -- the definition has a likely problem worth investigating (missing field, broken reference, trigger collision, dead tool restriction).
|
|
58
59
|
- **info** -- reserved for future advisory rules.
|
|
59
60
|
|
|
60
61
|
### 2.1 skill — agent skill audit
|
|
61
62
|
|
|
62
|
-
| Rule ID
|
|
63
|
-
|
|
64
|
-
| `skill/missing-frontmatter`
|
|
65
|
-
| `skill/broken-ref`
|
|
66
|
-
| `skill/trigger-collision`
|
|
67
|
-
| `skill/orphaned`
|
|
68
|
-
| `skill/dead-tool-restriction` | warning (info when the unknown name is PascalCase) | An agent's `tools` / `allowed-tools` frontmatter lists a non-MCP, non-wildcard tool name that is not a known Claude Code built-in tool
|
|
63
|
+
| Rule ID | Severity | Trigger | Message |
|
|
64
|
+
| ----------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
65
|
+
| `skill/missing-frontmatter` | warning (error when frontmatter absent/unclosed) | A SKILL.md / agent .md has no `---`-delimited frontmatter, has unclosed frontmatter, or is missing a required field (`name`, `description`) | `{file}: missing required frontmatter field "{field}"` |
|
|
66
|
+
| `skill/broken-ref` | warning | A `./` or `../` path reference in the body (outside example code blocks) does not exist relative to the skill directory | `{file}: references "{path}" which does not exist relative to the skill directory` |
|
|
67
|
+
| `skill/trigger-collision` | warning | A normalized trigger phrase (quoted phrase in the description, or a `trigger`/`triggers` field) is declared by more than one distinct skill/agent | `Trigger phrase "{trigger}" is declared by {count} skills/agents — only one will win` |
|
|
68
|
+
| `skill/orphaned` | warning | A `~/.claude/skills/<name>/` directory contains no `SKILL.md` | `{dir}: skill directory has no SKILL.md — Claude Code has nothing to load` |
|
|
69
|
+
| `skill/dead-tool-restriction` | warning (info when the unknown name is PascalCase) | An agent's `tools` / `allowed-tools` frontmatter lists a non-MCP, non-wildcard tool name that is not a known Claude Code built-in tool | `{file}: tool restriction lists "{tool}" which is not a known Claude Code tool` |
|
|
69
70
|
|
|
70
71
|
**Notes:**
|
|
71
72
|
|
|
72
73
|
- **`skill/broken-ref`** reuses the path-reference detection shape from the context-file pillar. Only explicitly-relative references (`./`, `../`) are verified, resolved against the skill/agent file's own directory; bare `foo/bar` tokens in prose are too ambiguous to resolve without false positives, so they are skipped. References inside example code blocks (`ts`, `py`, `json`, ...) are excluded.
|
|
73
74
|
- **`skill/trigger-collision`** extracts triggers from quoted phrases inside the `description` (e.g. `"ship 1.3.X"`) and from an optional `trigger`/`triggers` field. Phrases are lowercased and whitespace-collapsed before comparison.
|
|
74
|
-
- **`skill/dead-tool-restriction`** validates only against the known built-in tool set. MCP-namespaced tools (`mcp__server__tool`) and wildcard entries are skipped because their validity depends on the loaded MCP servers, which the linter cannot see statically. Severity is split by name shape: an unknown **PascalCase** name is reported as
|
|
75
|
+
- **`skill/dead-tool-restriction`** validates only against the known built-in tool set. MCP-namespaced tools (`mcp__server__tool`) and wildcard entries are skipped because their validity depends on the loaded MCP servers, which the linter cannot see statically. Severity is split by name shape: an unknown **PascalCase** name is reported as _info_ -- it may be a built-in newer than the linter's known-tool list, which drifts across Claude Code versions; anything else (lowercase, separators) doesn't match Claude Code's tool naming and keeps the _warning_ (far more likely a typo).
|
|
75
76
|
|
|
76
77
|
All v1 rules are marked **experimental** in the catalog -- the heuristics are conservative and may broaden as more skill/agent shapes are observed. Experimental rules bump patch; promotion to stable bumps minor (see `CHANGELOG.md` versioning policy).
|
|
77
78
|
|
|
@@ -95,6 +96,7 @@ Rule IDs use the ctxlint `category/slug` format (see [CONTRIBUTING.md](./CONTRIB
|
|
|
95
96
|
### Versioning
|
|
96
97
|
|
|
97
98
|
This spec follows semver:
|
|
99
|
+
|
|
98
100
|
- **Patch** (1.0.x): Typo fixes, clarifications, no rule changes.
|
|
99
101
|
- **Minor** (1.x.0): New rules added, new agents/skill formats documented.
|
|
100
102
|
- **Major** (x.0.0): Rules removed or semantics changed in breaking ways.
|