vigiles 4.0.0 → 4.0.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/.claude-plugin/plugin.json +1 -1
- package/README.md +29 -18
- package/action.yml +1 -1
- package/dist/adapter-conformance.js +1 -1
- package/dist/adapters/claude-code/adapter.js +1 -1
- package/dist/check.d.ts +132 -0
- package/dist/check.js +318 -0
- package/dist/claude-code.d.ts +1 -1
- package/dist/claude-code.js +1 -1
- package/dist/cli.js +133 -55
- package/dist/core/compile.d.ts +1 -1
- package/dist/core/compile.js +1 -1
- package/dist/core/compose.d.ts +1 -1
- package/dist/core/compose.js +1 -1
- package/dist/core/generate-schema.d.ts +1 -1
- package/dist/core/generate-schema.js +4 -4
- package/dist/core/linters.js +2 -2
- package/dist/core/orphans.js +57 -14
- package/dist/core/proofs.js +1 -1
- package/dist/core/refs.d.ts +1 -1
- package/dist/core/refs.js +2 -2
- package/dist/core/sidecar.d.ts +1 -1
- package/dist/core/sidecar.js +1 -1
- package/dist/core/spec.d.ts +1 -1
- package/dist/core/spec.js +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/validate.js +2 -2
- package/dist/e2e.d.ts +10 -13
- package/dist/e2e.js +10 -17
- package/dist/{adapters/claude-code/eval-cache.d.ts → eval-cache.d.ts} +1 -1
- package/dist/{adapters/claude-code/eval-cache.js → eval-cache.js} +1 -1
- package/dist/{adapters/claude-code/eval.d.ts → eval.d.ts} +217 -2
- package/dist/{adapters/claude-code/eval.js → eval.js} +430 -20
- package/dist/harness-assert.d.ts +11 -8
- package/dist/harness-assert.js +21 -5
- package/dist/{adapters/claude-code/harness-test.d.ts → harness-test.d.ts} +50 -4
- package/dist/{adapters/claude-code/harness-test.js → harness-test.js} +106 -4
- package/dist/integration.d.ts +11 -3
- package/dist/integration.js +12 -3
- package/dist/jest.d.ts +3 -1
- package/dist/jest.js +3 -2
- package/dist/{adapters/claude-code/mock-model.d.ts → mock-model.d.ts} +2 -2
- package/dist/{adapters/claude-code/run-hook.d.ts → run-hook.d.ts} +23 -1
- package/dist/{adapters/claude-code/run-hook.js → run-hook.js} +29 -1
- package/dist/{adapters/claude-code/sandbox.js → sandbox.js} +1 -1
- package/dist/scan.d.ts +1 -1
- package/dist/scan.js +1 -1
- package/dist/setup-plan.d.ts +5 -1
- package/dist/setup-plan.js +11 -1
- package/dist/test-coverage.js +8 -1
- package/dist/testing.d.ts +10 -3
- package/dist/testing.js +15 -3
- package/dist/unit.d.ts +4 -2
- package/dist/unit.js +8 -2
- package/dist/vitest.d.mts +3 -1
- package/hooks/refs-nudge.sh +1 -1
- package/hooks/session-start.sh +3 -3
- package/package.json +8 -7
- package/skills/edit-spec/SKILL.md +21 -10
- package/skills/linter-docs/SKILL.md +23 -0
- package/skills/migrate-to-spec/SKILL.md +1 -1
- package/skills/strengthen/SKILL.md +1 -2
- package/skills/generate-rule/SKILL.md +0 -64
- /package/dist/{adapters/claude-code/egress-entry.d.ts → egress-entry.d.ts} +0 -0
- /package/dist/{adapters/claude-code/egress-entry.js → egress-entry.js} +0 -0
- /package/dist/{adapters/claude-code/egress-proxy.d.ts → egress-proxy.d.ts} +0 -0
- /package/dist/{adapters/claude-code/egress-proxy.js → egress-proxy.js} +0 -0
- /package/dist/{adapters/claude-code/egress.d.ts → egress.d.ts} +0 -0
- /package/dist/{adapters/claude-code/egress.js → egress.js} +0 -0
- /package/dist/{adapters/claude-code/eval-baseline.d.ts → eval-baseline.d.ts} +0 -0
- /package/dist/{adapters/claude-code/eval-baseline.js → eval-baseline.js} +0 -0
- /package/dist/{adapters/claude-code/judge.d.ts → judge.d.ts} +0 -0
- /package/dist/{adapters/claude-code/judge.js → judge.js} +0 -0
- /package/dist/{adapters/claude-code/mock-entry.d.ts → mock-entry.d.ts} +0 -0
- /package/dist/{adapters/claude-code/mock-entry.js → mock-entry.js} +0 -0
- /package/dist/{adapters/claude-code/mock-model.js → mock-model.js} +0 -0
- /package/dist/{adapters/claude-code/sandbox.d.ts → sandbox.d.ts} +0 -0
- /package/dist/{adapters/claude-code/stats.d.ts → stats.d.ts} +0 -0
- /package/dist/{adapters/claude-code/stats.js → stats.js} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: edit-spec
|
|
3
|
-
description: Edit a vigiles spec
|
|
4
|
-
disable-model-invocation: true
|
|
3
|
+
description: Edit a vigiles .spec.ts to change a compiled instruction file (CLAUDE.md / AGENTS.md) — add, modify, or remove a rule, section, command, or key file. Use whenever you need to change a CLAUDE.md/AGENTS.md that carries a vigiles hash (edit the spec, never the artifact), including adding a new enforce()/check()/guidance() rule.
|
|
5
4
|
argument-hint: <what to change — e.g., "add a rule about error handling" or "update the testing section">
|
|
6
5
|
---
|
|
7
6
|
|
|
@@ -27,7 +26,8 @@ Look for spec files in the repo root:
|
|
|
27
26
|
- `AGENTS.md.spec.ts` — source for AGENTS.md
|
|
28
27
|
- Any `*.spec.ts` matching instruction files
|
|
29
28
|
|
|
30
|
-
If no spec exists
|
|
29
|
+
If no spec exists: if there's a hand-written `CLAUDE.md`, suggest the
|
|
30
|
+
`migrate-to-spec` skill; otherwise suggest `npx vigiles init` to scaffold one.
|
|
31
31
|
|
|
32
32
|
### Step 2: Read and Understand the Spec
|
|
33
33
|
|
|
@@ -83,11 +83,22 @@ export default claude({
|
|
|
83
83
|
|
|
84
84
|
Based on what the user asked for:
|
|
85
85
|
|
|
86
|
-
**Adding a rule
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
|
|
86
|
+
**Adding a rule** (this absorbs the old `generate-rule` skill):
|
|
87
|
+
|
|
88
|
+
- **Classify the rule** from the request:
|
|
89
|
+
- `enforce()` — a linter rule can back it. Check the project's linter configs
|
|
90
|
+
(ESLint, Ruff, Clippy, Pylint, RuboCop, Stylelint) for a matching rule; also
|
|
91
|
+
consider an architectural tool (ast-grep, Dependency Cruiser, Steiger). If
|
|
92
|
+
uncertain whether a rule exists, **ask the user** rather than guessing.
|
|
93
|
+
- `check()` — a filesystem structural convention ("every X needs a Y"). Only
|
|
94
|
+
for file-pairing; never for code content.
|
|
95
|
+
- `guidance()` — can't be mechanically enforced (subjective conventions,
|
|
96
|
+
process rules, migration context).
|
|
97
|
+
- For `enforce()`: use the real linter rule name (e.g. `eslint/no-console`,
|
|
98
|
+
`@typescript-eslint/no-explicit-any`, `ruff/T201`).
|
|
99
|
+
- Add to the `rules` object with a kebab-case key derived from the intent,
|
|
100
|
+
preserving alphabetical order if the existing rules are alphabetical. Import
|
|
101
|
+
any new builders needed (e.g. `check` and `every` for the first `check()`).
|
|
91
102
|
|
|
92
103
|
**Updating a section:**
|
|
93
104
|
|
|
@@ -118,10 +129,10 @@ This regenerates the compiled instruction file(s). Review the output for any err
|
|
|
118
129
|
### Step 5: Verify
|
|
119
130
|
|
|
120
131
|
```bash
|
|
121
|
-
npx vigiles
|
|
132
|
+
npx vigiles lint
|
|
122
133
|
```
|
|
123
134
|
|
|
124
|
-
If the
|
|
135
|
+
If the vigiles plugin is installed (`/plugin marketplace add zernie/vigiles` then `/plugin install vigiles@vigiles`, or `npx vigiles init`), the PostToolUse hook recompiles automatically after you save the spec.
|
|
125
136
|
|
|
126
137
|
## Important
|
|
127
138
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: linter-docs
|
|
3
|
+
description: Deep linter reference for authoring or debugging a vigiles enforce() rule — plugin tables, AST selectors, type-aware rules, auto-fix, and edge cases for ESLint, Ruff, Pylint, RuboCop, and Stylelint. Use when you need the exact rule name or config for a specific linter, not for running a linter.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Reference material for the linters vigiles cross-references. Open the file for
|
|
8
|
+
the linter you're working with when you need exact rule names, AST selectors,
|
|
9
|
+
or config details to author an `enforce()` rule (or diagnose why one is reported
|
|
10
|
+
missing or disabled).
|
|
11
|
+
|
|
12
|
+
| Linter | Reference |
|
|
13
|
+
| --------- | -------------------------------------------------------------------------------------- |
|
|
14
|
+
| ESLint | [`eslint.md`](eslint.md) — plugin table, AST selectors, type-aware rules, auto-fix |
|
|
15
|
+
| Ruff | [`ruff.md`](ruff.md) — 800+ reimplemented rules, selection, auto-fix, pyproject config |
|
|
16
|
+
| Pylint | [`pylint.md`](pylint.md) — plugin table, astroid AST, type inference, custom checkers |
|
|
17
|
+
| RuboCop | [`rubocop.md`](rubocop.md) — gem table, node pattern DSL, auto-correct, custom cops |
|
|
18
|
+
| Stylelint | [`stylelint.md`](stylelint.md) — plugin table, PostCSS AST, custom rules, SCSS |
|
|
19
|
+
| Clippy | [`clippy.md`](clippy.md) — Rust lint groups and configuration |
|
|
20
|
+
|
|
21
|
+
These are read by the `strengthen` and `edit-spec` skills when matching a
|
|
22
|
+
guidance rule to a real linter rule. This skill is user-invoked (a reference,
|
|
23
|
+
not an action), so it never fires on its own — open the relevant file directly.
|
|
@@ -7,7 +7,7 @@ argument-hint: <path to CLAUDE.md, defaults to CLAUDE.md>
|
|
|
7
7
|
|
|
8
8
|
Convert an existing hand-written CLAUDE.md (or AGENTS.md) into a typed `CLAUDE.md.spec.ts` file. This is the incremental adoption path — you keep your existing instruction file as the starting point and get type safety going forward.
|
|
9
9
|
|
|
10
|
-
> **Don't need full TypeScript?** A typed spec is the deepest commitment level. If the user only wants verified rules without a build step, point them at markdown mode first: inline `<!-- vigiles:enforce ... -->` comments (Level 0) or a `vigiles:` YAML frontmatter block with `vigiles generate-schema` for editor autocomplete (Level 1). Both are verified by `vigiles
|
|
10
|
+
> **Don't need full TypeScript?** A typed spec is the deepest commitment level. If the user only wants verified rules without a build step, point them at markdown mode first: inline `<!-- vigiles:enforce ... -->` comments (Level 0) or a `vigiles:` YAML frontmatter block with `vigiles generate-schema` for editor autocomplete (Level 1). Both are verified by `vigiles lint` with the same engine as a spec. See `docs/markdown-mode.md`. Migrate to a spec only when they want compiler-grade guarantees.
|
|
11
11
|
|
|
12
12
|
## Instructions
|
|
13
13
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: strengthen
|
|
3
|
-
description: Upgrade guidance() rules to enforce()
|
|
4
|
-
disable-model-invocation: true
|
|
3
|
+
description: Upgrade a vigiles spec's guidance() rules to enforce() — scan the guidance rules in a CLAUDE.md/AGENTS.md spec and find existing linter rules (ESLint, Ruff, Clippy, Pylint, RuboCop, Stylelint) that back them. Use when asked to strengthen, harden, or make vigiles rules enforceable; NOT for general linting or fixing lint errors.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
Scan spec files for `guidance()` rules and suggest `enforce()` replacements backed by real linter rules.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<!-- vigiles:sha256:a9df2c1748576753 compiled from skills/generate-rule/SKILL.md.spec.ts -->
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
name: generate-rule
|
|
6
|
-
description: Add a new enforce(), check(), or guidance() rule to an existing spec file
|
|
7
|
-
disable-model-invocation: true
|
|
8
|
-
argument-hint: <rule>
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## Arguments
|
|
13
|
-
|
|
14
|
-
- `$1` **rule** — natural-language description of what the rule should enforce, e.g. "no console.log in production code"
|
|
15
|
-
|
|
16
|
-
## Steps
|
|
17
|
-
|
|
18
|
-
### Step 1
|
|
19
|
-
|
|
20
|
-
**Find the spec file.** Look for `CLAUDE.md.spec.ts` in the repo root. If it doesn't exist:
|
|
21
|
-
|
|
22
|
-
- If there's a hand-written `CLAUDE.md`, suggest running the `migrate-to-spec` skill first.
|
|
23
|
-
- If there's no `CLAUDE.md` either, suggest `npx vigiles init` to scaffold one.
|
|
24
|
-
|
|
25
|
-
### Step 2
|
|
26
|
-
|
|
27
|
-
**Classify the rule** from the description ($1):
|
|
28
|
-
|
|
29
|
-
- **enforce()** — if a linter rule can back it. Check the project's linter configs (ESLint, Ruff, Clippy, Pylint, RuboCop, Stylelint) for a matching rule; also consider an architectural tool (ast-grep, Dependency Cruiser, Steiger). If uncertain whether a rule exists, **ask the user** rather than guessing.
|
|
30
|
-
- **check()** — if it's a filesystem structural convention ("every X needs a Y"). Only for file-pairing; never for code content.
|
|
31
|
-
- **guidance()** — if it can't be mechanically enforced (subjective conventions, process rules, migration context).
|
|
32
|
-
|
|
33
|
-
### Step 3
|
|
34
|
-
|
|
35
|
-
**Generate the rule.** Create an entry with a kebab-case ID derived from the description. Examples:
|
|
36
|
-
|
|
37
|
-
"no-console": enforce("eslint/no-console", "Use structured logger for observability."),
|
|
38
|
-
|
|
39
|
-
"controller-tests": check(
|
|
40
|
-
every("src/**/*.controller.ts").has("{name}.controller.test.ts"),
|
|
41
|
-
"Every controller must have a co-located test file.",
|
|
42
|
-
),
|
|
43
|
-
|
|
44
|
-
"research-before-implementing": guidance(
|
|
45
|
-
"Google unfamiliar APIs before implementing.",
|
|
46
|
-
),
|
|
47
|
-
|
|
48
|
-
### Step 4
|
|
49
|
-
|
|
50
|
-
**Add it to the spec.** Read the existing spec file and add the new rule to the `rules` object, preserving alphabetical ordering if the existing rules are alphabetical. Import any new builders needed (e.g. `check` and `every` for the first `check()` rule).
|
|
51
|
-
|
|
52
|
-
### Step 5
|
|
53
|
-
|
|
54
|
-
**Compile and verify.** Build and recompile; if compilation fails (e.g. the linter rule doesn't exist), report the error and suggest alternatives. Show the user the updated spec and the compiled `CLAUDE.md` diff.
|
|
55
|
-
|
|
56
|
-
**Gate** — run the project's build command (retry up to 2×); do not proceed until it passes.
|
|
57
|
-
|
|
58
|
-
<!-- vigiles:gate role:build retry:2 -->
|
|
59
|
-
|
|
60
|
-
## Result
|
|
61
|
-
|
|
62
|
-
This skill is complete when the project's build command passes.
|
|
63
|
-
|
|
64
|
-
<!-- vigiles:result role:build -->
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|