vigiles 2.0.0 → 2.2.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 +182 -134
- package/dist/action-gate.d.ts +28 -0
- package/dist/action-gate.js +73 -0
- package/dist/cli.js +705 -230
- package/dist/community-skills.d.ts +22 -0
- package/dist/community-skills.js +86 -0
- package/dist/compile-generator.d.ts +48 -0
- package/dist/compile-generator.js +322 -0
- package/dist/compile.d.ts +4 -0
- package/dist/compile.js +239 -45
- package/dist/coverage.d.ts +56 -0
- package/dist/coverage.js +178 -0
- package/dist/doc-refs.d.ts +60 -0
- package/dist/doc-refs.js +246 -0
- package/dist/eval.d.ts +62 -0
- package/dist/eval.js +174 -0
- package/dist/evolve.js +60 -125
- package/dist/frontmatter.d.ts +75 -0
- package/dist/frontmatter.js +263 -0
- package/dist/generate-schema.d.ts +51 -0
- package/dist/generate-schema.js +125 -0
- package/dist/generate-types.js +39 -1
- package/dist/harness-test.d.ts +38 -0
- package/dist/harness-test.js +129 -0
- package/dist/hash.d.ts +8 -0
- package/dist/hash.js +16 -0
- package/dist/inline.d.ts +22 -4
- package/dist/inline.js +60 -13
- package/dist/integrity.d.ts +29 -0
- package/dist/integrity.js +44 -0
- package/dist/linters.d.ts +5 -3
- package/dist/linters.js +144 -4
- package/dist/mock-model.d.ts +31 -0
- package/dist/mock-model.js +189 -0
- package/dist/orphans.d.ts +52 -0
- package/dist/orphans.js +124 -0
- package/dist/proofs.js +22 -16
- package/dist/refs.d.ts +44 -0
- package/dist/refs.js +144 -0
- package/dist/session.d.ts +97 -0
- package/dist/session.js +306 -0
- package/dist/sidecar.d.ts +35 -0
- package/dist/sidecar.js +102 -0
- package/dist/skill-driver.d.ts +77 -0
- package/dist/skill-driver.js +76 -0
- package/dist/skill-runtime.d.ts +101 -0
- package/dist/skill-runtime.js +289 -0
- package/dist/skill-test.d.ts +47 -0
- package/dist/skill-test.js +77 -0
- package/dist/spec.d.ts +119 -13
- package/dist/spec.js +51 -4
- package/dist/symbols.d.ts +30 -0
- package/dist/symbols.js +142 -0
- package/dist/test-utils.d.ts +8 -0
- package/dist/test-utils.js +41 -0
- package/dist/types.d.ts +34 -8
- package/dist/types.js +19 -0
- package/dist/validate.js +5 -3
- package/package.json +26 -5
- package/.claude/settings.json +0 -46
- package/.claude/settings.local.json +0 -8
- package/.github/workflows/ci.yml +0 -81
- package/.prettierignore +0 -1
- package/.vigiles/generated.d.ts +0 -205
- package/CLAUDE.md +0 -95
- package/CLAUDE.md.spec.ts +0 -142
- package/CONTRIBUTING.md +0 -121
- package/dist/action.d.ts.map +0 -1
- package/dist/action.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cli.test.d.ts +0 -2
- package/dist/cli.test.d.ts.map +0 -1
- package/dist/cli.test.js +0 -650
- package/dist/cli.test.js.map +0 -1
- package/dist/compile.d.ts.map +0 -1
- package/dist/compile.js.map +0 -1
- package/dist/evolve.d.ts.map +0 -1
- package/dist/evolve.js.map +0 -1
- package/dist/freshness.d.ts +0 -67
- package/dist/freshness.d.ts.map +0 -1
- package/dist/freshness.js +0 -244
- package/dist/freshness.js.map +0 -1
- package/dist/freshness.test.d.ts +0 -2
- package/dist/freshness.test.d.ts.map +0 -1
- package/dist/freshness.test.js +0 -356
- package/dist/freshness.test.js.map +0 -1
- package/dist/generate-types.d.ts.map +0 -1
- package/dist/generate-types.js.map +0 -1
- package/dist/inline.d.ts.map +0 -1
- package/dist/inline.js.map +0 -1
- package/dist/inline.test.d.ts +0 -5
- package/dist/inline.test.d.ts.map +0 -1
- package/dist/inline.test.js +0 -152
- package/dist/inline.test.js.map +0 -1
- package/dist/linters.d.ts.map +0 -1
- package/dist/linters.js.map +0 -1
- package/dist/proofs.d.ts.map +0 -1
- package/dist/proofs.js.map +0 -1
- package/dist/proofs.test.d.ts +0 -9
- package/dist/proofs.test.d.ts.map +0 -1
- package/dist/proofs.test.js +0 -952
- package/dist/proofs.test.js.map +0 -1
- package/dist/spec.d.ts.map +0 -1
- package/dist/spec.js.map +0 -1
- package/dist/spec.test.d.ts +0 -2
- package/dist/spec.test.d.ts.map +0 -1
- package/dist/spec.test.js +0 -1222
- package/dist/spec.test.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js.map +0 -1
- package/dist/validate.test.d.ts +0 -2
- package/dist/validate.test.d.ts.map +0 -1
- package/dist/validate.test.js +0 -531
- package/dist/validate.test.js.map +0 -1
- package/docs/agent-setup.md +0 -85
- package/docs/agent-workflows.md +0 -103
- package/docs/comparison.md +0 -71
- package/docs/freshness.md +0 -124
- package/docs/inline-mode.md +0 -119
- package/docs/linter-support.md +0 -166
- package/docs/spec-format.md +0 -194
- package/eslint.config.mjs +0 -79
- package/examples/CLAUDE.md +0 -54
- package/examples/CLAUDE.md.spec.ts +0 -65
- package/examples/SKILL.md +0 -50
- package/examples/SKILL.md.spec.ts +0 -57
- package/fixtures/example-project/CLAUDE.md +0 -11
- package/fixtures/example-project/package.json +0 -9
- package/fixtures/example-project/src/index.ts +0 -3
- package/fixtures/example-project/src/utils.test.ts +0 -2
- package/fixtures/example-project/src/utils.ts +0 -3
- package/logo.png +0 -0
- package/research/adoption-strategy.md +0 -111
- package/research/agent-integration.md +0 -145
- package/research/ai-code-quality.md +0 -197
- package/research/code-search-for-agents.md +0 -313
- package/research/competitive-landscape.md +0 -163
- package/research/doc-freshness.md +0 -516
- package/research/executable-specs.md +0 -368
- package/research/feature-ideas.md +0 -464
- package/research/formal-proofs-for-agents.md +0 -338
- package/research/fp-for-agent-harness.md +0 -150
- package/research/fp-for-deterministic-ai.md +0 -131
- package/research/self-evolving-specs.md +0 -298
- package/schemas/claude-md-strict.yml +0 -18
- package/schemas/claude-md.yml +0 -6
- package/schemas/skill-strict.yml +0 -12
- package/schemas/skill.yml +0 -5
- package/skills/audit-feedback-loop/SKILL.md +0 -76
- package/skills/edit-spec/SKILL.md +0 -131
- package/skills/enforce-rules-format/SKILL.md +0 -71
- package/skills/generate-logo/SKILL.md +0 -102
- package/skills/generate-rule/SKILL.md +0 -90
- package/skills/linter-docs/clippy.md +0 -241
- package/skills/linter-docs/eslint.md +0 -384
- package/skills/linter-docs/pylint.md +0 -288
- package/skills/linter-docs/rubocop.md +0 -277
- package/skills/linter-docs/ruff.md +0 -187
- package/skills/linter-docs/stylelint.md +0 -247
- package/skills/migrate-to-spec/SKILL.md +0 -124
- package/skills/pr-to-lint-rule/SKILL.md +0 -97
- package/skills/strengthen/SKILL.md +0 -168
- package/src/action.ts +0 -214
- package/src/cli.test.ts +0 -914
- package/src/cli.ts +0 -1631
- package/src/compile.ts +0 -691
- package/src/evolve.ts +0 -781
- package/src/freshness.test.ts +0 -449
- package/src/freshness.ts +0 -299
- package/src/generate-types.ts +0 -448
- package/src/inline.test.ts +0 -206
- package/src/inline.ts +0 -164
- package/src/linters.ts +0 -739
- package/src/proofs.test.ts +0 -1314
- package/src/proofs.ts +0 -849
- package/src/spec.test.ts +0 -1471
- package/src/spec.ts +0 -427
- package/src/types.ts +0 -117
- package/src/validate.test.ts +0 -701
- package/src/validate.ts +0 -381
- package/tsconfig.json +0 -23
package/dist/types.d.ts
CHANGED
|
@@ -44,16 +44,44 @@ export interface ValidatePathsResult {
|
|
|
44
44
|
/** Toggleable rule settings. */
|
|
45
45
|
/** Rule severity: "warn" prints but exits 0, "error" fails, false disables. */
|
|
46
46
|
export type RuleSeverity = "warn" | "error" | false;
|
|
47
|
-
/**
|
|
48
|
-
export type
|
|
47
|
+
/** Rule with options: severity alone or [severity, options] tuple. */
|
|
48
|
+
export type RuleWithOptions<T> = RuleSeverity | [Exclude<RuleSeverity, false>, T];
|
|
49
|
+
/** Options for the coverage rule. */
|
|
50
|
+
export interface CoverageThresholds {
|
|
51
|
+
/** Min % of enabled linter rules with enforce() declarations. */
|
|
52
|
+
linterRules?: number;
|
|
53
|
+
/** Min % of npm scripts documented in spec commands. */
|
|
54
|
+
scripts?: number;
|
|
55
|
+
}
|
|
56
|
+
/** Options for the orphan-docs check. */
|
|
57
|
+
export interface OrphansConfig {
|
|
58
|
+
/**
|
|
59
|
+
* Glob patterns of `.md` files to scan for orphans. A doc is "orphaned"
|
|
60
|
+
* when no other markdown file references it. Defaults to vigiles-repo
|
|
61
|
+
* convention: `["docs/**\/*.md", "research/**\/*.md"]`. Set to `[]` to
|
|
62
|
+
* disable orphan detection entirely.
|
|
63
|
+
*/
|
|
64
|
+
include?: readonly string[];
|
|
65
|
+
/**
|
|
66
|
+
* Glob patterns to exclude within the include scope. Same shape as
|
|
67
|
+
* `tsconfig.json#exclude`.
|
|
68
|
+
*/
|
|
69
|
+
exclude?: readonly string[];
|
|
70
|
+
}
|
|
49
71
|
export interface RulesConfig {
|
|
50
72
|
/** Require .spec.ts for CLAUDE.md / AGENTS.md. Default: "warn". */
|
|
51
73
|
"require-spec"?: RuleSeverity;
|
|
52
74
|
/** Require .spec.ts for SKILL.md files. Default: false. */
|
|
53
75
|
"require-skill-spec"?: RuleSeverity;
|
|
54
|
-
/** Detect
|
|
55
|
-
|
|
76
|
+
/** Detect hand-edits to compiled markdown via SHA-256 hash. Default: "warn". */
|
|
77
|
+
integrity?: RuleSeverity;
|
|
78
|
+
/** Enforce minimum spec coverage thresholds. Default: false. ESLint-style: ["warn", { scripts: 50 }]. */
|
|
79
|
+
coverage?: RuleWithOptions<CoverageThresholds>;
|
|
56
80
|
}
|
|
81
|
+
/** Extract severity from a rule value (handles both simple and tuple forms). */
|
|
82
|
+
export declare function ruleSeverity<T>(rule: RuleWithOptions<T> | undefined): RuleSeverity;
|
|
83
|
+
/** Extract options from a rule value (returns undefined for simple severity). */
|
|
84
|
+
export declare function ruleOptions<T>(rule: RuleWithOptions<T> | undefined): T | undefined;
|
|
57
85
|
/** Full vigiles configuration. Loaded from .vigilesrc.json. */
|
|
58
86
|
export interface VigilesConfig {
|
|
59
87
|
ruleMarkers: MarkerType[];
|
|
@@ -71,10 +99,8 @@ export interface VigilesConfig {
|
|
|
71
99
|
linters?: Record<string, {
|
|
72
100
|
rulesDir?: string | string[];
|
|
73
101
|
}>;
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
/** Extra files to track in input-hash mode (e.g., monorepo root lock file). */
|
|
77
|
-
freshnessInputs?: string[];
|
|
102
|
+
/** Orphan-docs check configuration. Include/exclude globs, tsconfig-style. */
|
|
103
|
+
orphans?: OrphansConfig;
|
|
78
104
|
}
|
|
79
105
|
/** Valid marker types for rule detection. */
|
|
80
106
|
export type MarkerType = "headings" | "checkboxes";
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ruleSeverity = ruleSeverity;
|
|
4
|
+
exports.ruleOptions = ruleOptions;
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Rule parsing helpers
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
/** Extract severity from a rule value (handles both simple and tuple forms). */
|
|
9
|
+
function ruleSeverity(rule) {
|
|
10
|
+
if (rule === undefined)
|
|
11
|
+
return false;
|
|
12
|
+
if (Array.isArray(rule))
|
|
13
|
+
return rule[0];
|
|
14
|
+
return rule;
|
|
15
|
+
}
|
|
16
|
+
/** Extract options from a rule value (returns undefined for simple severity). */
|
|
17
|
+
function ruleOptions(rule) {
|
|
18
|
+
if (Array.isArray(rule))
|
|
19
|
+
return rule[1];
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
3
22
|
//# sourceMappingURL=types.js.map
|
package/dist/validate.js
CHANGED
|
@@ -12,6 +12,7 @@ const glob_1 = require("glob");
|
|
|
12
12
|
const node_path_1 = require("node:path");
|
|
13
13
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
14
14
|
const inline_js_1 = require("./inline.js");
|
|
15
|
+
const frontmatter_js_1 = require("./frontmatter.js");
|
|
15
16
|
// ---------------------------------------------------------------------------
|
|
16
17
|
// Constants & regex
|
|
17
18
|
// ---------------------------------------------------------------------------
|
|
@@ -27,7 +28,8 @@ const DEFAULT_FILES = ["CLAUDE.md"];
|
|
|
27
28
|
const DEFAULT_RULES = {
|
|
28
29
|
"require-spec": "warn",
|
|
29
30
|
"require-skill-spec": "warn",
|
|
30
|
-
|
|
31
|
+
integrity: "warn",
|
|
32
|
+
coverage: false,
|
|
31
33
|
};
|
|
32
34
|
const DEFAULT_CONFIG = {
|
|
33
35
|
ruleMarkers: ["headings", "checkboxes"],
|
|
@@ -150,11 +152,11 @@ function validate(content, { ruleMarkers, rules: rulesConfig, filePath } = {}) {
|
|
|
150
152
|
// verified on `vigiles audit` even without a .spec.ts sibling.
|
|
151
153
|
// Delegate to the real parser so a malformed marker can't
|
|
152
154
|
// satisfy require-spec with a rule that audit can't verify.
|
|
153
|
-
const hasInline = (0, inline_js_1.hasInlineRules)(content);
|
|
155
|
+
const hasInline = (0, inline_js_1.hasInlineRules)(content) || (0, frontmatter_js_1.hasFrontmatterRules)(content);
|
|
154
156
|
if (!(0, node_fs_1.existsSync)(specPath) && !hasInline) {
|
|
155
157
|
const msg = {
|
|
156
158
|
rule: "require-spec",
|
|
157
|
-
message: `No spec file found for "${filePath}". Expected "${specPath}". Run \`npx vigiles init --target=${filePath}\` to create one, add inline \`<!-- vigiles:enforce ... -->\` comments, or disable with <!-- vigiles-disable require-spec -->.`,
|
|
159
|
+
message: `No spec file found for "${filePath}". Expected "${specPath}". Run \`npx vigiles init --target=${filePath}\` to create one, add inline \`<!-- vigiles:enforce ... -->\` comments or a \`vigiles:\` frontmatter block, or disable with <!-- vigiles-disable require-spec -->.`,
|
|
158
160
|
line: 1,
|
|
159
161
|
};
|
|
160
162
|
if (specSeverity === "error") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vigiles",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Compile .spec.ts files to instruction files (CLAUDE.md, AGENTS.md) with linter cross-referencing",
|
|
5
5
|
"bin": {
|
|
6
6
|
"vigiles": "dist/cli.js"
|
|
@@ -11,17 +11,32 @@
|
|
|
11
11
|
".": "./dist/spec.js",
|
|
12
12
|
"./spec": "./dist/spec.js",
|
|
13
13
|
"./compile": "./dist/compile.js",
|
|
14
|
-
"./linters": "./dist/linters.js"
|
|
14
|
+
"./linters": "./dist/linters.js",
|
|
15
|
+
"./eval": "./dist/eval.js",
|
|
16
|
+
"./harness-test": "./dist/harness-test.js",
|
|
17
|
+
"./mock-model": "./dist/mock-model.js"
|
|
15
18
|
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist/**/*.js",
|
|
21
|
+
"dist/**/*.d.ts",
|
|
22
|
+
"!dist/**/*.test.js",
|
|
23
|
+
"!dist/**/*.test.d.ts",
|
|
24
|
+
"action.yml",
|
|
25
|
+
".claude-plugin",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
16
29
|
"scripts": {
|
|
17
30
|
"build": "tsc",
|
|
18
|
-
"test": "npm run build && node --test dist/spec.test.js dist/validate.test.js dist/cli.test.js dist/proofs.test.js dist/inline.test.js",
|
|
31
|
+
"test": "npm run build && node --test dist/spec.test.js dist/validate.test.js dist/cli.test.js dist/proofs.test.js dist/inline.test.js dist/sidecar.test.js dist/coverage.test.js dist/session.test.js dist/orphans.test.js dist/cedar.test.js dist/doc-refs.test.js dist/frontmatter.test.js dist/skill-pipeline.test.js dist/skill-runtime.test.js dist/skill-driver.test.js dist/skill-test.test.js dist/compile-generator.test.js dist/community-skills.test.js dist/action-gate.test.js dist/symbols.test.js dist/refs.test.js dist/harness-test.test.js dist/eval.test.js",
|
|
19
32
|
"lint": "eslint src/",
|
|
20
33
|
"fmt": "prettier --write .",
|
|
21
|
-
"fmt:check": "prettier --check ."
|
|
34
|
+
"fmt:check": "prettier --check .",
|
|
35
|
+
"test:e2e": "bash test/e2e/run.sh"
|
|
22
36
|
},
|
|
23
37
|
"devDependencies": {
|
|
24
38
|
"@eslint/js": "^10.0.1",
|
|
39
|
+
"@types/js-yaml": "^4.0.9",
|
|
25
40
|
"@types/minimatch": "^5.1.2",
|
|
26
41
|
"@types/node": "^20.19.39",
|
|
27
42
|
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
@@ -34,9 +49,15 @@
|
|
|
34
49
|
"typescript": "^5.9.3"
|
|
35
50
|
},
|
|
36
51
|
"dependencies": {
|
|
52
|
+
"@ast-grep/lang-python": "^0.0.6",
|
|
53
|
+
"@ast-grep/lang-ruby": "^0.0.7",
|
|
54
|
+
"@ast-grep/lang-rust": "^0.0.7",
|
|
55
|
+
"@ast-grep/napi": "^0.43.0",
|
|
37
56
|
"@jackchuka/mdschema": "^0.12.8",
|
|
38
57
|
"cosmiconfig": "^9.0.1",
|
|
39
58
|
"glob": "^13.0.6",
|
|
40
|
-
"
|
|
59
|
+
"js-yaml": "^4.1.0",
|
|
60
|
+
"minimatch": "^10.0.1",
|
|
61
|
+
"typescript": "^5.9.3"
|
|
41
62
|
}
|
|
42
63
|
}
|
package/.claude/settings.json
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hooks": {
|
|
3
|
-
"SessionStart": [
|
|
4
|
-
{
|
|
5
|
-
"matcher": "startup|compact",
|
|
6
|
-
"hooks": [
|
|
7
|
-
{
|
|
8
|
-
"type": "command",
|
|
9
|
-
"command": "npm install && npm run build && pip install ruff pylint && gem install rubocop 2>/dev/null; true"
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"PostToolUse": [
|
|
15
|
-
{
|
|
16
|
-
"matcher": "Edit|Write",
|
|
17
|
-
"hooks": [
|
|
18
|
-
{
|
|
19
|
-
"type": "command",
|
|
20
|
-
"command": "FILE=$(cat | jq -r '.tool_input.file_path // empty') && case \"$(basename \"$FILE\")\" in eslint.config.*|.eslintrc*|package.json|pyproject.toml|Cargo.toml) npx vigiles generate-types 2>&1 || true ;; esac && case \"$FILE\" in *.spec.ts) npx vigiles compile 2>&1 || true ;; esac"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"matcher": "Edit|Write",
|
|
26
|
-
"hooks": [
|
|
27
|
-
{
|
|
28
|
-
"type": "command",
|
|
29
|
-
"command": "npx prettier --check ."
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"PreToolUse": [
|
|
35
|
-
{
|
|
36
|
-
"matcher": "Edit|Write",
|
|
37
|
-
"hooks": [
|
|
38
|
-
{
|
|
39
|
-
"type": "command",
|
|
40
|
-
"command": "FILE=$(cat | jq -r '.tool_input.file_path // empty') && case \"$FILE\" in *.md) [ -f \"$FILE\" ] && head -1 \"$FILE\" | grep -q 'vigiles:sha256:' && { SPEC=$(head -1 \"$FILE\" | sed -n 's/.*compiled from \\(.*\\) -->/\\1/p'); echo \"BLOCKED: Edit $SPEC instead.\" >&2; exit 2; } ;; esac; exit 0"
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
}
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v4
|
|
14
|
-
|
|
15
|
-
- uses: actions/setup-node@v4
|
|
16
|
-
with:
|
|
17
|
-
node-version: "20"
|
|
18
|
-
cache: "npm"
|
|
19
|
-
|
|
20
|
-
- uses: actions/setup-python@v5
|
|
21
|
-
with:
|
|
22
|
-
python-version: "3.x"
|
|
23
|
-
|
|
24
|
-
- uses: ruby/setup-ruby@v1
|
|
25
|
-
with:
|
|
26
|
-
ruby-version: "3.3"
|
|
27
|
-
|
|
28
|
-
- name: Cache pip packages
|
|
29
|
-
uses: actions/cache@v4
|
|
30
|
-
with:
|
|
31
|
-
path: ~/.cache/pip
|
|
32
|
-
key: pip-${{ runner.os }}-ruff-pylint
|
|
33
|
-
|
|
34
|
-
- name: Cache gem packages
|
|
35
|
-
uses: actions/cache@v4
|
|
36
|
-
with:
|
|
37
|
-
path: ~/.local/share/gem
|
|
38
|
-
key: gem-${{ runner.os }}-rubocop
|
|
39
|
-
|
|
40
|
-
- run: npm ci
|
|
41
|
-
|
|
42
|
-
- name: Install linter CLIs for tests
|
|
43
|
-
run: |
|
|
44
|
-
pip install ruff pylint
|
|
45
|
-
gem install rubocop
|
|
46
|
-
rustup component add clippy
|
|
47
|
-
|
|
48
|
-
- name: Build
|
|
49
|
-
run: npm run build
|
|
50
|
-
|
|
51
|
-
- name: Run tests
|
|
52
|
-
run: npm test
|
|
53
|
-
|
|
54
|
-
- name: Type check
|
|
55
|
-
run: npx tsc --noEmit
|
|
56
|
-
|
|
57
|
-
- name: Check generated types compile
|
|
58
|
-
run: node dist/cli.js generate-types && npx tsc --noEmit
|
|
59
|
-
|
|
60
|
-
- name: Lint
|
|
61
|
-
run: npm run lint
|
|
62
|
-
|
|
63
|
-
- name: Check formatting
|
|
64
|
-
run: npm run fmt:check
|
|
65
|
-
|
|
66
|
-
check:
|
|
67
|
-
runs-on: ubuntu-latest
|
|
68
|
-
steps:
|
|
69
|
-
- uses: actions/checkout@v4
|
|
70
|
-
|
|
71
|
-
- uses: actions/setup-node@v4
|
|
72
|
-
with:
|
|
73
|
-
node-version: "20"
|
|
74
|
-
|
|
75
|
-
- run: npm ci
|
|
76
|
-
|
|
77
|
-
- name: Build
|
|
78
|
-
run: npm run build
|
|
79
|
-
|
|
80
|
-
- name: Audit compiled files
|
|
81
|
-
run: node dist/cli.js audit
|
package/.prettierignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.vigiles/generated.d.ts
|
package/.vigiles/generated.d.ts
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-generated by `vigiles generate-types`.
|
|
3
|
-
* DO NOT EDIT — re-run `vigiles generate-types` to update.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
declare module "vigiles/generated" {
|
|
7
|
-
|
|
8
|
-
/** 64 enabled eslint rules (via flat config). */
|
|
9
|
-
export type EslintRule =
|
|
10
|
-
| "constructor-super"
|
|
11
|
-
| "for-direction"
|
|
12
|
-
| "getter-return"
|
|
13
|
-
| "no-async-promise-executor"
|
|
14
|
-
| "no-case-declarations"
|
|
15
|
-
| "no-class-assign"
|
|
16
|
-
| "no-compare-neg-zero"
|
|
17
|
-
| "no-cond-assign"
|
|
18
|
-
| "no-const-assign"
|
|
19
|
-
| "no-constant-binary-expression"
|
|
20
|
-
| "no-constant-condition"
|
|
21
|
-
| "no-control-regex"
|
|
22
|
-
| "no-debugger"
|
|
23
|
-
| "no-delete-var"
|
|
24
|
-
| "no-dupe-args"
|
|
25
|
-
| "no-dupe-class-members"
|
|
26
|
-
| "no-dupe-else-if"
|
|
27
|
-
| "no-dupe-keys"
|
|
28
|
-
| "no-duplicate-case"
|
|
29
|
-
| "no-empty"
|
|
30
|
-
| "no-empty-character-class"
|
|
31
|
-
| "no-empty-pattern"
|
|
32
|
-
| "no-empty-static-block"
|
|
33
|
-
| "no-ex-assign"
|
|
34
|
-
| "no-extra-boolean-cast"
|
|
35
|
-
| "no-fallthrough"
|
|
36
|
-
| "no-func-assign"
|
|
37
|
-
| "no-global-assign"
|
|
38
|
-
| "no-import-assign"
|
|
39
|
-
| "no-invalid-regexp"
|
|
40
|
-
| "no-irregular-whitespace"
|
|
41
|
-
| "no-loss-of-precision"
|
|
42
|
-
| "no-misleading-character-class"
|
|
43
|
-
| "no-new-native-nonconstructor"
|
|
44
|
-
| "no-nonoctal-decimal-escape"
|
|
45
|
-
| "no-obj-calls"
|
|
46
|
-
| "no-octal"
|
|
47
|
-
| "no-prototype-builtins"
|
|
48
|
-
| "no-redeclare"
|
|
49
|
-
| "no-regex-spaces"
|
|
50
|
-
| "no-self-assign"
|
|
51
|
-
| "no-setter-return"
|
|
52
|
-
| "no-shadow-restricted-names"
|
|
53
|
-
| "no-sparse-arrays"
|
|
54
|
-
| "no-this-before-super"
|
|
55
|
-
| "no-unassigned-vars"
|
|
56
|
-
| "no-undef"
|
|
57
|
-
| "no-unexpected-multiline"
|
|
58
|
-
| "no-unreachable"
|
|
59
|
-
| "no-unsafe-finally"
|
|
60
|
-
| "no-unsafe-negation"
|
|
61
|
-
| "no-unsafe-optional-chaining"
|
|
62
|
-
| "no-unused-labels"
|
|
63
|
-
| "no-unused-private-class-members"
|
|
64
|
-
| "no-unused-vars"
|
|
65
|
-
| "no-useless-assignment"
|
|
66
|
-
| "no-useless-backreference"
|
|
67
|
-
| "no-useless-catch"
|
|
68
|
-
| "no-useless-escape"
|
|
69
|
-
| "no-with"
|
|
70
|
-
| "preserve-caught-error"
|
|
71
|
-
| "require-yield"
|
|
72
|
-
| "use-isnan"
|
|
73
|
-
| "valid-typeof";
|
|
74
|
-
|
|
75
|
-
/** All enabled linter rules across all detected linters. */
|
|
76
|
-
export type LinterRule = EslintRule;
|
|
77
|
-
|
|
78
|
-
/** 5 npm scripts from package.json. */
|
|
79
|
-
export type NpmScript =
|
|
80
|
-
| "build"
|
|
81
|
-
| "test"
|
|
82
|
-
| "lint"
|
|
83
|
-
| "fmt"
|
|
84
|
-
| "fmt:check";
|
|
85
|
-
|
|
86
|
-
/** 18 project files. */
|
|
87
|
-
export type ProjectFile =
|
|
88
|
-
| "src/action.ts"
|
|
89
|
-
| "src/cli.test.ts"
|
|
90
|
-
| "src/cli.ts"
|
|
91
|
-
| "src/compile.ts"
|
|
92
|
-
| "src/evolve.ts"
|
|
93
|
-
| "src/freshness.test.ts"
|
|
94
|
-
| "src/freshness.ts"
|
|
95
|
-
| "src/generate-types.ts"
|
|
96
|
-
| "src/inline.test.ts"
|
|
97
|
-
| "src/inline.ts"
|
|
98
|
-
| "src/linters.ts"
|
|
99
|
-
| "src/proofs.test.ts"
|
|
100
|
-
| "src/proofs.ts"
|
|
101
|
-
| "src/spec.test.ts"
|
|
102
|
-
| "src/spec.ts"
|
|
103
|
-
| "src/types.ts"
|
|
104
|
-
| "src/validate.test.ts"
|
|
105
|
-
| "src/validate.ts";
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare module "vigiles/spec" {
|
|
109
|
-
interface KnownLinterRules {
|
|
110
|
-
"eslint":
|
|
111
|
-
| "constructor-super"
|
|
112
|
-
| "for-direction"
|
|
113
|
-
| "getter-return"
|
|
114
|
-
| "no-async-promise-executor"
|
|
115
|
-
| "no-case-declarations"
|
|
116
|
-
| "no-class-assign"
|
|
117
|
-
| "no-compare-neg-zero"
|
|
118
|
-
| "no-cond-assign"
|
|
119
|
-
| "no-const-assign"
|
|
120
|
-
| "no-constant-binary-expression"
|
|
121
|
-
| "no-constant-condition"
|
|
122
|
-
| "no-control-regex"
|
|
123
|
-
| "no-debugger"
|
|
124
|
-
| "no-delete-var"
|
|
125
|
-
| "no-dupe-args"
|
|
126
|
-
| "no-dupe-class-members"
|
|
127
|
-
| "no-dupe-else-if"
|
|
128
|
-
| "no-dupe-keys"
|
|
129
|
-
| "no-duplicate-case"
|
|
130
|
-
| "no-empty"
|
|
131
|
-
| "no-empty-character-class"
|
|
132
|
-
| "no-empty-pattern"
|
|
133
|
-
| "no-empty-static-block"
|
|
134
|
-
| "no-ex-assign"
|
|
135
|
-
| "no-extra-boolean-cast"
|
|
136
|
-
| "no-fallthrough"
|
|
137
|
-
| "no-func-assign"
|
|
138
|
-
| "no-global-assign"
|
|
139
|
-
| "no-import-assign"
|
|
140
|
-
| "no-invalid-regexp"
|
|
141
|
-
| "no-irregular-whitespace"
|
|
142
|
-
| "no-loss-of-precision"
|
|
143
|
-
| "no-misleading-character-class"
|
|
144
|
-
| "no-new-native-nonconstructor"
|
|
145
|
-
| "no-nonoctal-decimal-escape"
|
|
146
|
-
| "no-obj-calls"
|
|
147
|
-
| "no-octal"
|
|
148
|
-
| "no-prototype-builtins"
|
|
149
|
-
| "no-redeclare"
|
|
150
|
-
| "no-regex-spaces"
|
|
151
|
-
| "no-self-assign"
|
|
152
|
-
| "no-setter-return"
|
|
153
|
-
| "no-shadow-restricted-names"
|
|
154
|
-
| "no-sparse-arrays"
|
|
155
|
-
| "no-this-before-super"
|
|
156
|
-
| "no-unassigned-vars"
|
|
157
|
-
| "no-undef"
|
|
158
|
-
| "no-unexpected-multiline"
|
|
159
|
-
| "no-unreachable"
|
|
160
|
-
| "no-unsafe-finally"
|
|
161
|
-
| "no-unsafe-negation"
|
|
162
|
-
| "no-unsafe-optional-chaining"
|
|
163
|
-
| "no-unused-labels"
|
|
164
|
-
| "no-unused-private-class-members"
|
|
165
|
-
| "no-unused-vars"
|
|
166
|
-
| "no-useless-assignment"
|
|
167
|
-
| "no-useless-backreference"
|
|
168
|
-
| "no-useless-catch"
|
|
169
|
-
| "no-useless-escape"
|
|
170
|
-
| "no-with"
|
|
171
|
-
| "preserve-caught-error"
|
|
172
|
-
| "require-yield"
|
|
173
|
-
| "use-isnan"
|
|
174
|
-
| "valid-typeof";
|
|
175
|
-
}
|
|
176
|
-
interface KnownProjectFiles {
|
|
177
|
-
files:
|
|
178
|
-
| "src/action.ts"
|
|
179
|
-
| "src/cli.test.ts"
|
|
180
|
-
| "src/cli.ts"
|
|
181
|
-
| "src/compile.ts"
|
|
182
|
-
| "src/evolve.ts"
|
|
183
|
-
| "src/freshness.test.ts"
|
|
184
|
-
| "src/freshness.ts"
|
|
185
|
-
| "src/generate-types.ts"
|
|
186
|
-
| "src/inline.test.ts"
|
|
187
|
-
| "src/inline.ts"
|
|
188
|
-
| "src/linters.ts"
|
|
189
|
-
| "src/proofs.test.ts"
|
|
190
|
-
| "src/proofs.ts"
|
|
191
|
-
| "src/spec.test.ts"
|
|
192
|
-
| "src/spec.ts"
|
|
193
|
-
| "src/types.ts"
|
|
194
|
-
| "src/validate.test.ts"
|
|
195
|
-
| "src/validate.ts";
|
|
196
|
-
}
|
|
197
|
-
interface KnownNpmScripts {
|
|
198
|
-
scripts:
|
|
199
|
-
| "build"
|
|
200
|
-
| "test"
|
|
201
|
-
| "lint"
|
|
202
|
-
| "fmt"
|
|
203
|
-
| "fmt:check";
|
|
204
|
-
}
|
|
205
|
-
}
|
package/CLAUDE.md
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<!-- vigiles:sha256:2a0c0efd642c787a compiled from CLAUDE.md.spec.ts -->
|
|
2
|
-
|
|
3
|
-
# CLAUDE.md
|
|
4
|
-
|
|
5
|
-
## Positioning
|
|
6
|
-
|
|
7
|
-
vigiles compiles `.spec.ts` files to instruction files (CLAUDE.md, AGENTS.md, or any markdown target). The spec is the source of truth. The markdown is a build artifact. Nobody else does this — other tools lint markdown after the fact. vigiles eliminates the problem at the source.
|
|
8
|
-
|
|
9
|
-
The linter cross-referencing engine is the core moat: `enforce("@typescript-eslint/no-floating-promises")` verifies the rule exists AND is enabled in your linter config. Same for ESLint, Ruff, Clippy, Pylint, RuboCop, and Stylelint. No other tool resolves rules against 6 linter APIs.
|
|
10
|
-
|
|
11
|
-
`generate-types` is the second moat: scans all 6 linter APIs, package.json, and project files to emit a `.d.ts` with type unions. The TS compiler then PROVES references are valid at authoring time — typos become type errors, not runtime surprises.
|
|
12
|
-
|
|
13
|
-
vigiles does NOT do architectural linting. Use ast-grep, Dependency Cruiser, Steiger, or eslint-plugin-boundaries for that. vigiles can reference their rules via `enforce()`.
|
|
14
|
-
|
|
15
|
-
## Architecture
|
|
16
|
-
|
|
17
|
-
Two rule types in specs:
|
|
18
|
-
|
|
19
|
-
- `enforce()` — delegated to external tool (linter, ast-grep, dependency-cruiser). vigiles verifies the rule exists and is enabled.
|
|
20
|
-
- `guidance()` — prose only, compiles to `**Guidance only**` in markdown.
|
|
21
|
-
|
|
22
|
-
Architectural linting (file pairing, import boundaries, AST patterns) belongs in external tools — reference them via `enforce()`.
|
|
23
|
-
|
|
24
|
-
Template literal types ensure linter names (`eslint/`, `ruff/`, etc.) are type-safe. Branded types (`VerifiedPath`, `VerifiedCmd`, `VerifiedRef`) distinguish verified references from raw strings.
|
|
25
|
-
|
|
26
|
-
Compilation: spec.ts → compiler reads spec, validates references (file paths via existsSync, npm scripts via package.json, linter rules via linter APIs), generates markdown with SHA-256 integrity hash.
|
|
27
|
-
|
|
28
|
-
Core modules: `src/spec.ts` (types + builders), `src/compile.ts` (compiler), `src/linters.ts` (6-linter cross-referencing engine), `src/generate-types.ts` (type generator), `src/proofs.ts` (proof algorithms for self-evolving specs), `src/evolve.ts` (evolution engine).
|
|
29
|
-
|
|
30
|
-
## Key Files
|
|
31
|
-
|
|
32
|
-
- `src/spec.ts` — Type system and builder functions (enforce, guidance, claude, skill, file, cmd, ref)
|
|
33
|
-
- `src/compile.ts` — Compiler: spec → markdown with SHA-256 hash, linter verification, reference validation
|
|
34
|
-
- `src/linters.ts` — Linter cross-referencing engine (ESLint, Stylelint, Ruff, Clippy, Pylint, RuboCop)
|
|
35
|
-
- `src/generate-types.ts` — Type generator: scans linters/package.json/filesystem → emits .d.ts
|
|
36
|
-
- `src/cli.ts` — CLI: init, compile, audit (3 primary commands + generate-types plumbing)
|
|
37
|
-
- `src/inline.ts` — Inline-mode parser: `<!-- vigiles:enforce ... -->` comments in markdown for gradual adoption
|
|
38
|
-
- `src/action.ts` — GitHub Action wrapper
|
|
39
|
-
- `src/spec.test.ts` — Spec + compiler test suite (node:test)
|
|
40
|
-
- `src/validate.test.ts` — Validation test suite (node:test)
|
|
41
|
-
- `src/cli.test.ts` — CLI integration + E2E test suite (node:test)
|
|
42
|
-
- `src/proofs.ts` — Deterministic proof algorithms (monotonicity lattice, NCD, Bloom filter, Merkle DAG, fixed-point, property testing)
|
|
43
|
-
- `src/evolve.ts` — Evolution engine: mutation operators, fitness function, proof-gated selection
|
|
44
|
-
- `src/proofs.test.ts` — Proof system + evolution engine tests (node:test)
|
|
45
|
-
- `CLAUDE.md.spec.ts` — This file — the source of truth for CLAUDE.md
|
|
46
|
-
- `examples/SKILL.md.spec.ts` — Example SKILL.md spec
|
|
47
|
-
- `research/adoption-strategy.md` — Adoption strategy: zero-config setup, progressive enforcement, agent workflows
|
|
48
|
-
- `research/competitive-landscape.md` — Competitive landscape: rule-porter, rulesync, vibe-cli, Ruler
|
|
49
|
-
- `research/executable-specs.md` — Design doc: executable spec system
|
|
50
|
-
- `research/feature-ideas.md` — Feature ideas: plugin API, custom rules, exhaustive coverage
|
|
51
|
-
- `research/ai-code-quality.md` — Research: AI code quality patterns
|
|
52
|
-
- `research/self-evolving-specs.md` — Design doc: self-evolving spec system (proofs, Merkle history, evolution engine)
|
|
53
|
-
- `research/code-search-for-agents.md` — Research: code search approaches (grep vs embeddings vs AST-grep)
|
|
54
|
-
- `docs/agent-workflows.md` — Agent-specific workflows (Claude Code, Codex, multi-agent, Cursor)
|
|
55
|
-
- `docs/agent-setup.md` — Non-interactive agent setup guide (hooks via settings.json)
|
|
56
|
-
- `docs/spec-format.md` — Spec format reference (target, sections, rules)
|
|
57
|
-
- `docs/linter-support.md` — Linter support details (6 linters + generate-types)
|
|
58
|
-
- `docs/inline-mode.md` — Inline mode: `<!-- vigiles:enforce ... -->` comments for gradual adoption without a .spec.ts
|
|
59
|
-
|
|
60
|
-
## Commands
|
|
61
|
-
|
|
62
|
-
- `npm run build` — Compile TypeScript to dist/
|
|
63
|
-
- `npm test` — Build and run all tests
|
|
64
|
-
- `npm run fmt` — Format with prettier
|
|
65
|
-
- `npm run fmt:check` — Check formatting
|
|
66
|
-
|
|
67
|
-
## Rules
|
|
68
|
-
|
|
69
|
-
### Never Skip Tests
|
|
70
|
-
|
|
71
|
-
**Guidance only** — All tests must pass. If a test requires a CLI tool (pylint, rubocop, ruff, clippy), install the tool, don't skip the test.
|
|
72
|
-
|
|
73
|
-
### Zero Config By Default
|
|
74
|
-
|
|
75
|
-
**Guidance only** — `vigiles compile` should work with just a .spec.ts file. Config exists only for overrides (maxRules, maxTokens).
|
|
76
|
-
|
|
77
|
-
### Dont Reimplement Linters
|
|
78
|
-
|
|
79
|
-
**Guidance only** — Architectural linting belongs in ast-grep/Dependency Cruiser/Steiger. Per-file code rules belong in ESLint/Ruff/Clippy. vigiles owns: spec compilation, linter cross-referencing, type generation, stale reference detection, and proof-based spec evolution.
|
|
80
|
-
|
|
81
|
-
### Smooth Adoption
|
|
82
|
-
|
|
83
|
-
**Guidance only** — `npx vigiles init && npx skills add zernie/vigiles` must work on first run with zero config. The wizard auto-detects the project, creates specs, generates types, compiles, and wires CI. After install the agent edits specs automatically — no workflow change required. Start permissive (guidance rules, `require-spec: false` available), tighten over time. Hesitant adopters can use inline mode (`<!-- vigiles:enforce ... -->` comments) without a .spec.ts — see `docs/inline-mode.md`. See `research/adoption-strategy.md`.
|
|
84
|
-
|
|
85
|
-
### Format Before Commit
|
|
86
|
-
|
|
87
|
-
**Guidance only** — Run `npm run fmt:check` before committing. Inline code spans in markdown need surrounding spaces to render correctly.
|
|
88
|
-
|
|
89
|
-
### Progressive Adoption
|
|
90
|
-
|
|
91
|
-
**Guidance only** — vigiles must be adoptable incrementally, like TypeScript. Three on-ramps, zero friction: (1) inline mode — add `<!-- vigiles:enforce ... -->` comments to an existing CLAUDE.md, no new files; (2) spec mode with `guidance()` only — `npx vigiles init` creates a .spec.ts, compiles to markdown, zero linter setup; (3) strict mode — `enforce()` rules, CI gating, `--strict` flag. Each level adds value without requiring the next. Never gate basic functionality on advanced setup. README examples should always show the simplest path first.
|
|
92
|
-
|
|
93
|
-
### No Session Links
|
|
94
|
-
|
|
95
|
-
**Guidance only** — This is a public repo. Claude Code session URLs are private and must not appear in commits or PRs.
|