You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve all P0/P1/P2 issues from tech debt review
P0: Generated ESLint configs are invalid
- Flat config: rule entries use object property syntax with quoted
severity strings; plugin keys with special chars are quoted;
plugins registered in plugins object
- Legacy config: output is valid JSON via JSON.stringify(); unmappable
rules appear as comment block after JSON
- Added tests that parse generated configs and validate syntax
P0: Unsupported parser rules become false passes
- All CATEGORY_MAP entries set to null; unmatched categories go to
unparseable instead of creating generic rules
- Verifiers return {passed: false, skipped: true} for unsupported
pattern types instead of silently passing
- Added skipped field to RuleResult type
P0: Drift and extract async config parsing
- parseEslintConfigAsync() supports .js, .mjs, .cjs, .ts files
- drift.ts and extract.ts now use async parser
- Synchronous parser throws for JS/TS files with actionable message
- Added resolveSafePath() to lint-config, drift, and extract commands
P0: GitHub Action drift mode broken
- Added RULEPROBE_BIN env var for resolved CLI path
- Made findEslintFileInWorkspace() async with proper await
- Both drift and verify steps in action.yml set RULEPROBE_BIN
P1: ESLint rule mapping accuracy
- no-wildcard-exports: import/no-namespace -> import/no-anonymous-default-export
- no-namespace-imports: @typescript-eslint/consistent-type-imports -> import/no-namespace
- no-unused-exports: no-unused-vars -> import/no-unused-modules
- no-implicit-any: @typescript-eslint/no-implicit-any -> @typescript-eslint/no-explicit-any
- no-deep-relative-imports: now includes maxDepth in options
P1: Package output contains stale build artifacts
- Added prebuild script (rm -rf dist) to clean before every build
- Added files allowlist to package.json
P1: README and reference docs stale
- Updated README format descriptions and verify format list
- Removed removed commands (compare, tasks, task, run) from cli-reference.md
- Added lint-config, drift, extract command docs
- Updated matchers.md to reflect 34 mappable matchers across 7 categories
P2: Path boundary and config validation
- resolveSafePath() applied to lint-config, drift, and extract
- Config validation now rejects unknown categories and verifiers
- verify command accepts all valid report formats (summary, detailed, ci added)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ruleprobe verify CLAUDE.md ./agent-output --format text
72
72
```
73
73
74
74
## What It Does
75
75
76
-
**Translate.** Reads 7 instruction file formats (CLAUDE.md, AGENTS.md, .cursorrules, copilot-instructions.md, GEMINI.md, .windsurfrules, .rules) and emits an ESLint config. Each extractable rule maps to an ESLint rule with appropriate severity and options. Rules that have no ESLint equivalent appear as comments in the output so you know what wasn't covered.
76
+
**Translate.** Reads 7 instruction file formats (CLAUDE.md, AGENTS.md, .cursorrules, copilot-instructions.md, GEMINI.md, .windsurfrules, .rules) and emits an ESLint config. Flat config is the default; pass `--format legacy` for `.eslintrc.json` output. Each extractable rule maps to an ESLint rule with appropriate severity and options. Rules that have no ESLint equivalent appear as comments in the output so you know what wasn't covered.
77
77
78
78
**Detect drift.** Compares parsed rules against an existing ESLint config. Reports rules in the instruction file but missing from ESLint (you're not enforcing what you said), rules in ESLint but not in the instructions (you're enforcing what you never stated), severity mismatches, and argument differences. Use `--format markdown` for PR-ready output.
| forbidden-pattern | 5 | AST, Regex | no `any`, no `console.log`, no `var`, no `TODO` comments |
251
-
| structure | 5 | AST, Filesystem | named exports, JSDoc required, max file length, max line length, no unused exports |
250
+
| forbidden-pattern | 5 | AST, Regex | no `any`, no `console.log`, no `var`, max line length, no `TODO` comments |
251
+
| structure | 4 | AST, Filesystem | named exports, JSDoc required, max file length, no unused exports |
252
252
| import-pattern | 4 | AST | no path aliases, no deep relative imports, no namespace imports, no wildcard exports |
253
253
| error-handling | 2 | AST | no empty catch, throw Error only |
254
254
| type-safety | 5 | AST, Regex | no enums, no type assertions, no non-null assertions, no implicit any, no ts directives |
255
-
| code-style | 8 | AST, Regex | no var, prefer const, no else after return, no nested ternary, no magic numbers, semicolons, quotes, max function length, max params |
255
+
| code-style | 9 | AST, Regex | prefer const, no else after return, no nested ternary, no magic numbers, semicolons, quotes, max function length, max params, no TODO comments |
256
256
257
257
Rules that can't map to ESLint (test file requirements, project config, git conventions) are reported as unmappable so you can enforce them through other tooling.
Output the full task prompt for a given template. Three templates ship: `rest-endpoint`, `utility-module`, `react-component`.
119
-
120
-
```bash
121
-
ruleprobe task rest-endpoint
122
-
```
115
+
| Option | Default | Description |
116
+
|--------|---------|-------------|
117
+
|`--format <format>`|`text`| Output format: `text`, `json`, or `markdown`|
118
+
|`--output <path>`| stdout | Write report to file |
123
119
124
120
---
125
121
126
-
## `ruleprobe run <instruction-file>`
122
+
## `ruleprobe extract <eslint-file>`
127
123
128
-
Invoke an AI agent on a task template, then verify its output. Requires `@anthropic-ai/claude-agent-sdk` and `ANTHROPIC_API_KEY` for SDK mode. Alternatively, use `--watch` to point at a directory where an agent will write output.
124
+
Parse an ESLint config and emit a markdown rules section suitable for pasting into an instruction file. Stylistic rules are reported but excluded from the output by default.
129
125
130
126
```bash
131
-
# SDK mode: invoke Claude, verify, report
132
-
ruleprobe run CLAUDE.md --task rest-endpoint --agent claude-code --model sonnet --format text
133
-
134
-
# Watch mode: wait for output in a directory, then verify
135
-
ruleprobe run CLAUDE.md --watch ./agent-output --timeout 300 --format json
0 commit comments