@syv-ai/rulecast 0.1.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 CHANGED
@@ -92,6 +92,7 @@ A refusal only ever rests on the text the agent is writing, never on a reconstru
92
92
  | `rulecast init` | Interactive setup |
93
93
  | `rulecast install` / `uninstall` | Add or remove the agent hooks |
94
94
  | `rulecast run` | Check staged files, changed files, or everything |
95
+ | `rulecast test` | Run each rule's good/bad examples; `--against` says how much it would flag |
95
96
  | `rulecast validate` | Check the config and print diagnostics |
96
97
  | `rulecast doctor` | Compile, check the environment, dry-run every rule |
97
98
  | `rulecast autoupdate` | Move pinned rule repos to their latest tag |
@@ -102,11 +103,57 @@ A refusal only ever rests on the text the agent is writing, never on a reconstru
102
103
 
103
104
  `rulecast run` is also how you use rulecast in CI. `--from-ref main` checks only what a branch changed, which matters most for `llm` rules — they judge changed files only.
104
105
 
106
+ ## Adopting a rule on a codebase that already breaks it
107
+
108
+ `rulecast run --all-files --summary` tells you how much you already owe:
109
+
110
+ ```text
111
+ backlog: 57 violations in 31 files
112
+
113
+ rule violations files
114
+ python/routes-never-call-crud 57 31
115
+
116
+ worst files violations
117
+ app/api/routes/orders.py 12
118
+ app/api/routes/users.py 9
119
+ ```
120
+
121
+ Watch the count, not the rate. Here is one real codebase on one rule, on `main`:
122
+
123
+ | date | violating / total |
124
+ |---|---|
125
+ | 2026-01-15 | 61 / 80 |
126
+ | 2026-06-01 | 58 / 143 |
127
+ | 2026-09-25 | 57 / 194 |
128
+
129
+ The rate fell from 76% to 29% and the count did not move. New code complied; the old violations were
130
+ never fixed, only diluted. A team watching the percentage would have believed it was winning.
131
+
132
+ Per-edit enforcement does not touch that stock — it only stops it growing. Fix it a file at a time:
133
+ edits to files that already followed the rule broke it 2% of the time, against 37% in files that
134
+ mostly did not, so a file you clean tends to stay clean. (One rule across 19 files: suggestive, not
135
+ proven.)
136
+
105
137
  If something is configured but quiet, `rulecast doctor` says why: it compiles the config, reports whether each rule's linter, parser, script or API key is actually there, says where the hooks and caches live, and runs every rule against one file it matches.
106
138
 
107
139
  ## Agents
108
140
 
109
- rulecast ships docs written for coding agents, not for people:
141
+ rulecast ships docs written for coding agents, not for people. Paste this to yours and it will set
142
+ rulecast up itself:
143
+
144
+ ```text
145
+ Set up rulecast in this project. Read
146
+ https://raw.githubusercontent.com/syv-ai/rulecast/v0.3.0/agents/SETUP.md
147
+ and follow it. Show me every file it creates or changes before I commit anything.
148
+ ```
149
+
150
+ If your agent cannot fetch a URL, this is the whole of it: run
151
+ `npx @syv-ai/rulecast init --yes --agent <your agent, e.g. claude-code>`, then show me
152
+ `.rulecast-config.yaml` and the other files it listed. Never edit hook settings by hand —
153
+ `rulecast install` and `rulecast uninstall` own them.
154
+
155
+ Once it is set up, ask the same agent to draft rules for your own conventions; `init` prints the
156
+ prompt to paste.
110
157
 
111
158
  - [`agents/SETUP.md`](https://github.com/syv-ai/rulecast/blob/main/agents/SETUP.md) — give this to your agent and it will set rulecast up itself.
112
159
  - [`agents/DRAFT-RULES.md`](https://github.com/syv-ai/rulecast/blob/main/agents/DRAFT-RULES.md) — it reads your `AGENTS.md`, proposes one rule per convention that code can visibly break, shows you what each would flag today, and asks you to keep, edit or drop it.
@@ -138,7 +185,7 @@ The budget is what shapes the design: one detector run per kind per event, kinds
138
185
 
139
186
  0.1. Everything above works and is tested. The config format may still change before 1.0 — `minimum_rulecast_version` exists so a rule can say what it needs.
140
187
 
141
- Next: adapters for Codex, Cursor and OpenCode; Biome; rule tests (good and bad examples run by `rulecast test`); an Azure OpenAI provider.
188
+ Next: adapters for Codex, Cursor and OpenCode; Biome; an Azure OpenAI provider.
142
189
 
143
190
  ## License
144
191