@reporails/cli 0.2.1 → 0.3.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/README.md +36 -7
- package/bin/reporails.mjs +4 -67
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,10 +5,10 @@ Score your CLAUDE.md files. See what's missing. Improve your AI coding setup.
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx @reporails/cli
|
|
8
|
+
npx @reporails/cli setup
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This
|
|
11
|
+
This detects agents in your project and writes the MCP config. Then ask Claude:
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
> What ails claude?
|
|
@@ -29,8 +29,8 @@ That's it. You'll get a score, capability level, and actionable violations.
|
|
|
29
29
|
|
|
30
30
|
Violations:
|
|
31
31
|
CLAUDE.md (7 issues)
|
|
32
|
-
○
|
|
33
|
-
·
|
|
32
|
+
○ :1 No NEVER or AVOID statements found RRAILS:C:0003
|
|
33
|
+
· :1 No version or date marker found CORE:C:0012
|
|
34
34
|
...
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -70,14 +70,41 @@ Capability levels describe what your AI instruction setup enables — not how "m
|
|
|
70
70
|
| L5 | Maintained | Structural integrity, governance, navigation |
|
|
71
71
|
| L6 | Adaptive | Dynamic context, extensibility, persistence |
|
|
72
72
|
|
|
73
|
+
## GitHub Actions
|
|
74
|
+
|
|
75
|
+
Add `ails check` as a CI gate with inline PR annotations:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
# .github/workflows/reporails.yml
|
|
79
|
+
name: Reporails
|
|
80
|
+
on:
|
|
81
|
+
pull_request:
|
|
82
|
+
paths: ['CLAUDE.md', '.claude/**']
|
|
83
|
+
jobs:
|
|
84
|
+
check:
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v4
|
|
88
|
+
- uses: reporails/cli/action@v1
|
|
89
|
+
with:
|
|
90
|
+
min-score: '6.0'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
See the [main README](https://github.com/reporails/cli#github-actions) for full action inputs/outputs.
|
|
94
|
+
|
|
73
95
|
## Commands
|
|
74
96
|
|
|
75
97
|
```bash
|
|
98
|
+
ails setup # Set up MCP server for detected agents
|
|
76
99
|
ails check # Score your setup
|
|
77
100
|
ails check -f json # JSON output (for CI)
|
|
101
|
+
ails check -f github # GitHub Actions annotations
|
|
78
102
|
ails check --strict # Exit 1 if violations (for CI)
|
|
79
103
|
ails check --no-update-check # Skip pre-run update prompt
|
|
80
104
|
ails check --exclude-dir vendor # Exclude directory from scanning
|
|
105
|
+
ails check -v # Verbose: per-file PASS/FAIL with rule titles
|
|
106
|
+
ails heal # Interactive auto-fix + semantic evaluation
|
|
107
|
+
ails heal --non-interactive # JSON output for agents and scripts
|
|
81
108
|
ails explain CORE:S:0001 # Explain a rule
|
|
82
109
|
ails map # Show project structure
|
|
83
110
|
ails map --save # Generate backbone.yml
|
|
@@ -87,18 +114,20 @@ ails update --recommended # Update recommended rules only
|
|
|
87
114
|
ails update --force # Force reinstall even if current
|
|
88
115
|
ails update --cli # Upgrade the CLI package itself
|
|
89
116
|
ails dismiss CORE:C:0001 # Dismiss a semantic finding
|
|
117
|
+
ails judge . "RULE:FILE:pass:reason" # Cache semantic verdicts
|
|
90
118
|
ails version # Show version info
|
|
91
119
|
```
|
|
92
120
|
|
|
93
121
|
| Command | Description |
|
|
94
122
|
|---------|-------------|
|
|
95
|
-
| `
|
|
96
|
-
| `uninstall [--scope user\|project]` | Remove MCP server from Claude Code |
|
|
123
|
+
| `setup [PATH]` | Set up MCP server for detected agents |
|
|
97
124
|
| `check [PATH]` | Validate instruction files |
|
|
125
|
+
| `heal [PATH]` | Interactive auto-fix + semantic evaluation |
|
|
98
126
|
| `explain RULE_ID` | Show rule details |
|
|
99
127
|
| `map [PATH]` | Discover project structure |
|
|
100
128
|
| `update` | Update rules framework + recommended |
|
|
101
129
|
| `dismiss RULE_ID` | Dismiss a semantic finding |
|
|
130
|
+
| `judge PATH VERDICTS` | Cache semantic verdicts |
|
|
102
131
|
| `version` | Show version info |
|
|
103
132
|
|
|
104
133
|
## Updating
|
|
@@ -134,7 +163,7 @@ ails update --recommended
|
|
|
134
163
|
|
|
135
164
|
- **Node.js >= 18**
|
|
136
165
|
- **uv** — auto-installed if missing ([manual install](https://docs.astral.sh/uv/))
|
|
137
|
-
- **
|
|
166
|
+
- **No additional dependencies** — `setup` writes config files directly
|
|
138
167
|
|
|
139
168
|
## How It Works
|
|
140
169
|
|
package/bin/reporails.mjs
CHANGED
|
@@ -5,15 +5,13 @@ import { platform } from "node:os";
|
|
|
5
5
|
import { argv, exit } from "node:process";
|
|
6
6
|
|
|
7
7
|
const PYPI_PACKAGE = "reporails-cli";
|
|
8
|
-
const MCP_COMMAND = "ails-mcp";
|
|
9
8
|
const CLI_COMMAND = "ails";
|
|
10
9
|
|
|
11
10
|
const HELP = `
|
|
12
11
|
reporails — Score your CLAUDE.md files
|
|
13
12
|
|
|
14
13
|
Usage:
|
|
15
|
-
reporails
|
|
16
|
-
reporails uninstall [--scope user|project] Remove MCP server from Claude Code
|
|
14
|
+
reporails setup [PATH] Set up MCP server for detected agents
|
|
17
15
|
reporails check [PATH] [OPTIONS] Validate instruction files
|
|
18
16
|
reporails explain RULE_ID Show rule details
|
|
19
17
|
reporails map [PATH] [--save] Discover project structure
|
|
@@ -26,7 +24,7 @@ Usage:
|
|
|
26
24
|
reporails <command> [args...] Proxy any command to ails CLI
|
|
27
25
|
|
|
28
26
|
Examples:
|
|
29
|
-
npx @reporails/cli
|
|
27
|
+
npx @reporails/cli setup # Set up MCP server
|
|
30
28
|
npx @reporails/cli check # Score your setup
|
|
31
29
|
npx @reporails/cli explain CORE:S:0001 # Explain a rule
|
|
32
30
|
npx @reporails/cli update # Update rules + recommended
|
|
@@ -78,62 +76,10 @@ function ensureUv() {
|
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
78
|
|
|
81
|
-
function parseScope(args) {
|
|
82
|
-
const idx = args.indexOf("--scope");
|
|
83
|
-
if (idx !== -1 && idx + 1 < args.length) {
|
|
84
|
-
return args[idx + 1];
|
|
85
|
-
}
|
|
86
|
-
return "user";
|
|
87
|
-
}
|
|
88
|
-
|
|
89
79
|
// ---------------------------------------------------------------------------
|
|
90
80
|
// Subcommands
|
|
91
81
|
// ---------------------------------------------------------------------------
|
|
92
82
|
|
|
93
|
-
function install(args) {
|
|
94
|
-
if (!commandExists("claude")) {
|
|
95
|
-
console.error(
|
|
96
|
-
"Claude Code CLI not found.\nInstall it from: https://docs.anthropic.com/en/docs/claude-code",
|
|
97
|
-
);
|
|
98
|
-
exit(1);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
ensureUv();
|
|
102
|
-
|
|
103
|
-
const scope = parseScope(args);
|
|
104
|
-
const cmd = `claude mcp add --scope ${scope} reporails -- uvx --refresh --from ${PYPI_PACKAGE} ${MCP_COMMAND}`;
|
|
105
|
-
console.log(`Registering MCP server (scope: ${scope})...`);
|
|
106
|
-
|
|
107
|
-
try {
|
|
108
|
-
execSync(cmd, { stdio: "inherit" });
|
|
109
|
-
console.log("\nDone. Restart Claude Code to activate the MCP server.");
|
|
110
|
-
} catch {
|
|
111
|
-
console.error("Failed to register MCP server.");
|
|
112
|
-
exit(1);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function uninstall(args) {
|
|
117
|
-
if (!commandExists("claude")) {
|
|
118
|
-
console.error(
|
|
119
|
-
"Claude Code CLI not found.\nInstall it from: https://docs.anthropic.com/en/docs/claude-code",
|
|
120
|
-
);
|
|
121
|
-
exit(1);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const scope = parseScope(args);
|
|
125
|
-
const cmd = `claude mcp remove --scope ${scope} reporails`;
|
|
126
|
-
console.log(`Removing MCP server (scope: ${scope})...`);
|
|
127
|
-
|
|
128
|
-
try {
|
|
129
|
-
execSync(cmd, { stdio: "inherit" });
|
|
130
|
-
console.log("\nDone. MCP server removed.");
|
|
131
|
-
} catch {
|
|
132
|
-
console.error("Failed to remove MCP server.");
|
|
133
|
-
exit(1);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
83
|
function proxy(args) {
|
|
138
84
|
ensureUv();
|
|
139
85
|
|
|
@@ -163,14 +109,5 @@ if (!subcommand || subcommand === "--help" || subcommand === "-h") {
|
|
|
163
109
|
exit(0);
|
|
164
110
|
}
|
|
165
111
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
install(args.slice(1));
|
|
169
|
-
break;
|
|
170
|
-
case "uninstall":
|
|
171
|
-
uninstall(args.slice(1));
|
|
172
|
-
break;
|
|
173
|
-
default:
|
|
174
|
-
proxy(args);
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
112
|
+
// All subcommands proxy to the Python CLI
|
|
113
|
+
proxy(args);
|