@yawlabs/ctxlint 0.19.0 → 0.20.0
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 +1 -1
- package/AGENT_SESSION_LINT_SPEC.md +34 -2
- package/CONTEXT_LINT_SPEC.md +782 -746
- package/README.md +2 -2
- package/agent-session-lint-rules.json +10 -0
- package/context-lint-rules.json +20 -0
- package/dist/index.js +960 -319
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -511,9 +511,9 @@ ctxlint is the reference implementation of four open specifications for linting
|
|
|
511
511
|
|
|
512
512
|
| Spec | What it covers |
|
|
513
513
|
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
514
|
-
| **[AI Context File Linting Spec](./CONTEXT_LINT_SPEC.md)** |
|
|
514
|
+
| **[AI Context File Linting Spec](./CONTEXT_LINT_SPEC.md)** | 41 rules for validating context files (CLAUDE.md, .cursorrules, AGENTS.md, etc.) across 16 clients. Covers file formats, frontmatter schemas, path/command validation, staleness, token budgets, redundancy, and contradictions. |
|
|
515
515
|
| **[MCP Config Linting Spec](./MCP_CONFIG_LINT_SPEC.md)** | 29 rules for validating MCP server configs (.mcp.json, .cursor/mcp.json, .vscode/mcp.json, etc.) across 8 clients. Covers schema validation, hardcoded secrets, env var syntax, deprecated transports, and cross-file consistency. |
|
|
516
|
-
| **[Agent Session Linting Spec](./AGENT_SESSION_LINT_SPEC.md)** |
|
|
516
|
+
| **[Agent Session Linting Spec](./AGENT_SESSION_LINT_SPEC.md)** | 12 rules for auditing agent session data (history, memory) across 8 agents. Covers cross-project secret consistency, config drift, stale memory, and loop detection. |
|
|
517
517
|
| **[Agent Skill Linting Spec](./AGENT_SKILL_LINT_SPEC.md)** | 5 rules for auditing Claude Code skill (`SKILL.md`) and agent (`.md`) definitions under `~/.claude`. Covers frontmatter presence, broken refs, trigger-phrase collisions, orphaned skills, and dead tool restrictions. (v1, experimental) |
|
|
518
518
|
|
|
519
519
|
All specs include machine-readable rule catalogs for programmatic consumption:
|
|
@@ -134,6 +134,16 @@
|
|
|
134
134
|
"message": "{count} files edited on '{branch}' with no intervening commit",
|
|
135
135
|
"fixable": false,
|
|
136
136
|
"stability": "stable"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "session/unresolvable-sha",
|
|
140
|
+
"category": "session",
|
|
141
|
+
"severity": "warning",
|
|
142
|
+
"description": "A memory cites a git SHA that does not resolve in the repository.",
|
|
143
|
+
"trigger": "A 7-40 character hex token outside code fences, preceded on the same line by a commit-citation cue (commit, SHA, HEAD, landed in, reverted, ...), does not resolve via git cat-file. UUID members, digest prefixes, decimal ids and version fragments are excluded before resolution; without a git repository the rule reports nothing.",
|
|
144
|
+
"message": "cited commit {sha} does not resolve in this repository",
|
|
145
|
+
"fixable": false,
|
|
146
|
+
"stability": "experimental"
|
|
137
147
|
}
|
|
138
148
|
],
|
|
139
149
|
"dataSources": [
|
package/context-lint-rules.json
CHANGED
|
@@ -170,6 +170,26 @@
|
|
|
170
170
|
"fixable": false,
|
|
171
171
|
"stability": "stable"
|
|
172
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"id": "commands/exit-status-masked",
|
|
175
|
+
"category": "commands",
|
|
176
|
+
"severity": "warning",
|
|
177
|
+
"description": "A verification command's exit status is discarded by a pipe into a filter, so the success claim that follows cannot fail.",
|
|
178
|
+
"trigger": "A verifier (tsc, eslint, biome, vitest, pytest, cargo test, or an npm/pnpm/yarn/bun script resolving to one) heads a pipeline whose last stage is a filter or pager (head, tail, grep, sed, awk, less, cat, tee, wc), and the pipeline is followed by && plus a success-announcing echo/printf, or by an echo of $?, with no set -o pipefail in scope.",
|
|
179
|
+
"message": "\"{cmd}\" — exit status comes from \"{filter}\", not \"{verifier}\"; the success claim cannot fail",
|
|
180
|
+
"fixable": false,
|
|
181
|
+
"stability": "experimental"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "commands/unknown-subcommand",
|
|
185
|
+
"category": "commands",
|
|
186
|
+
"severity": "error",
|
|
187
|
+
"description": "A documented invocation of the project's own binary uses a subcommand the CLI does not implement.",
|
|
188
|
+
"trigger": "A command invokes a name declared in package.json#bin with a leading non-flag argument that is not in the CLI's known subcommand set, where that set was statically resolved as closed from the entry file.",
|
|
189
|
+
"message": "\"{cmd}\" — \"{sub}\" is not a subcommand of {bin} (known: {known})",
|
|
190
|
+
"fixable": false,
|
|
191
|
+
"stability": "experimental"
|
|
192
|
+
},
|
|
173
193
|
{
|
|
174
194
|
"id": "staleness/stale",
|
|
175
195
|
"category": "staleness",
|