@kirill.konshin/lint 0.5.4 → 0.6.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.
Files changed (114) hide show
  1. package/README.md +47 -7
  2. package/commands/spec-author.md +39 -0
  3. package/dist/configs/base.d.ts +4 -3
  4. package/dist/configs/base.js +61 -74
  5. package/dist/configs/imports.d.ts +3 -2
  6. package/dist/configs/imports.js +95 -146
  7. package/dist/configs/nx.d.ts +4 -3
  8. package/dist/configs/nx.js +31 -41
  9. package/dist/configs/prettier.d.ts +3 -2
  10. package/dist/configs/prettier.js +19 -16
  11. package/dist/configs/promise.d.ts +3 -2
  12. package/dist/configs/promise.js +16 -16
  13. package/dist/configs/react.d.ts +4 -3
  14. package/dist/configs/react.js +178 -217
  15. package/dist/configs/storybook.d.ts +4 -3
  16. package/dist/configs/storybook.js +22 -22
  17. package/dist/configs/tailwind.d.ts +4 -3
  18. package/dist/configs/tailwind.js +67 -91
  19. package/dist/configs/testing.d.ts +7 -6
  20. package/dist/configs/testing.js +112 -136
  21. package/dist/configs/turbo.d.ts +4 -3
  22. package/dist/configs/turbo.js +19 -27
  23. package/dist/configs/typescriptTypeAware.d.ts +4 -3
  24. package/dist/configs/typescriptTypeAware.js +99 -95
  25. package/dist/configs/unicorn.d.ts +3 -2
  26. package/dist/configs/unicorn.js +34 -41
  27. package/dist/exts.d.ts +2 -1
  28. package/dist/exts.js +10 -11
  29. package/dist/index.d.ts +44 -41
  30. package/dist/index.js +53 -84
  31. package/dist/lib.d.ts +21 -21
  32. package/dist/lib.js +261 -301
  33. package/dist/lintPrepare.d.ts +33 -28
  34. package/dist/lintPrepare.js +347 -376
  35. package/dist/lintStaged.d.ts +4 -3
  36. package/dist/lintStaged.js +25 -22
  37. package/dist/prettier.d.ts +4 -3
  38. package/dist/prettier.js +16 -17
  39. package/dist/restrictions.d.ts +24 -0
  40. package/dist/restrictions.js +20 -0
  41. package/dist/yarn.cjs +79 -98
  42. package/dist/yarn.d.cts +3 -2
  43. package/package.json +24 -8
  44. package/rules/agent.md +7 -4
  45. package/rules/openspec.md +1 -1
  46. package/skills/spec-steward/SKILL.md +4 -12
  47. package/skills/spec-steward/references/audit.md +18 -43
  48. package/skills/spec-steward/references/contract.md +7 -7
  49. package/skills/spec-steward/references/criteria.md +4 -4
  50. package/skills/spec-steward/references/model.md +1 -1
  51. package/skills/spec-steward/references/review-format.md +6 -6
  52. package/skills/spec-steward/references/wiring.md +4 -4
  53. package/skills/spec-steward/references/worker.md +67 -0
  54. package/skills/spec-steward/scripts/lib/align.mjs +7 -6
  55. package/skills/spec-steward/scripts/lib/checks.mjs +6 -1
  56. package/skills/spec-steward/scripts/lib/corpus.mjs +5 -8
  57. package/skills/spec-steward/scripts/lib/coverage.mjs +2 -3
  58. package/skills/spec-steward/scripts/lib/evidence.mjs +2 -148
  59. package/skills/spec-steward/scripts/lib/wire.mjs +6 -4
  60. package/skills/spec-steward/scripts/steward.mjs +30 -91
  61. package/skills/spec-steward/sweeps.json +49 -0
  62. package/skills/spec-tools/SKILL.md +46 -0
  63. package/skills/spec-tools/references/contract.md +111 -0
  64. package/skills/spec-tools/references/gitlab.md +122 -0
  65. package/skills/spec-verify/SKILL.md +153 -0
  66. package/spec-tools/dist/audit-DkZZulq6.mjs +130 -0
  67. package/spec-tools/dist/auditChanged-CNGjlake.mjs +1 -0
  68. package/spec-tools/dist/auditChanged-CZCvMgyZ.mjs +618 -0
  69. package/spec-tools/dist/auditReport-xgq4wK2i.mjs +458 -0
  70. package/spec-tools/dist/auditScope-CBuBtfPG.mjs +104 -0
  71. package/spec-tools/dist/changeGates-DdeQKfle.mjs +333 -0
  72. package/spec-tools/dist/changeGates-uy4Ti8rK.mjs +1 -0
  73. package/spec-tools/dist/ci-BUewHJS3.mjs +143 -0
  74. package/spec-tools/dist/ci-CFBzn8Of.mjs +1 -0
  75. package/spec-tools/dist/cli.mjs +93 -0
  76. package/spec-tools/dist/comment-szasMMg2.mjs +57 -0
  77. package/spec-tools/dist/files-Bppsb34B.mjs +1 -0
  78. package/spec-tools/dist/files-QlzY687_.mjs +38 -0
  79. package/spec-tools/dist/html-BMTkpbUN.mjs +1766 -0
  80. package/spec-tools/dist/jsonrepair-Dlm5dEen.mjs +742 -0
  81. package/spec-tools/dist/repo-CjIoUPYl.mjs +16 -0
  82. package/spec-tools/dist/repo-DUcnJw3c.mjs +1 -0
  83. package/spec-tools/dist/run-BElA9du3.mjs +67 -0
  84. package/spec-tools/dist/specDiff-8G56jMYn.mjs +123 -0
  85. package/spec-tools/dist/steward-DeieyOcj.mjs +34 -0
  86. package/spec-tools/dist/stewardAudit-BRMM0lrD.mjs +1 -0
  87. package/spec-tools/dist/stewardAudit-v0vOMfLN.mjs +271 -0
  88. package/spec-tools/dist/tier-Cn0P7juM.mjs +1 -0
  89. package/spec-tools/dist/tier-c3s_mA_I.mjs +65 -0
  90. package/spec-tools/dist/util-wnxhsnWO.mjs +49 -0
  91. package/spec-tools/dist/verdict-BFfN9PO8.mjs +58 -0
  92. package/spec-tools/dist/workers-BcIgckeq.mjs +417 -0
  93. package/spec-tools/dist/workflowEvidence-DyBj8EdG.mjs +1 -0
  94. package/spec-tools/dist/workflowEvidence-oui6ghPI.mjs +78 -0
  95. package/dist/configs/base.d.ts.map +0 -1
  96. package/dist/configs/imports.d.ts.map +0 -1
  97. package/dist/configs/nx.d.ts.map +0 -1
  98. package/dist/configs/prettier.d.ts.map +0 -1
  99. package/dist/configs/promise.d.ts.map +0 -1
  100. package/dist/configs/react.d.ts.map +0 -1
  101. package/dist/configs/storybook.d.ts.map +0 -1
  102. package/dist/configs/tailwind.d.ts.map +0 -1
  103. package/dist/configs/testing.d.ts.map +0 -1
  104. package/dist/configs/turbo.d.ts.map +0 -1
  105. package/dist/configs/typescriptTypeAware.d.ts.map +0 -1
  106. package/dist/configs/unicorn.d.ts.map +0 -1
  107. package/dist/exts.d.ts.map +0 -1
  108. package/dist/index.d.ts.map +0 -1
  109. package/dist/lib.d.ts.map +0 -1
  110. package/dist/lintPrepare.d.ts.map +0 -1
  111. package/dist/lintStaged.d.ts.map +0 -1
  112. package/dist/prettier.d.ts.map +0 -1
  113. package/dist/yarn.d.cts.map +0 -1
  114. package/skills/spec-steward/workflows/audit.js +0 -539
@@ -1,13 +1,12 @@
1
- #!/usr/bin/env node
1
+ //#region src/lintPrepare.d.ts
2
2
  /**
3
3
  * @kirill.konshin/lint
4
4
  *
5
5
  * This script makes `rules`, `commands` and `skills` real directories in the consuming project's
6
- * `.agents` (canonical, cross-tool), `.claude` (Claude Code) and `.codex`, and fills them with
7
- * file symlinks only: package rules and skills (every file a skill folder ships, plus the package
8
- * README.md next to its SKILL.md, so a skill can reference `@README.md`) go into all three, pointing
9
- * straight at the installed package; the user's own files in `.agents` are mirrored into `.claude`
10
- * and `.codex`. It also
6
+ * `.agents` (canonical, cross-tool) and `.claude` (Claude Code), and fills them with
7
+ * file symlinks only: package rules, commands and skills (every file a skill folder ships, plus the package
8
+ * README.md next to its SKILL.md, so a skill can reference `@README.md`) go into both, pointing
9
+ * straight at the installed package; the user's own files in `.agents` are mirrored into `.claude`. It also
11
10
  * generates an `AGENTS.md` file for other tools, with `CLAUDE.md` symlinked to `AGENTS.md`.
12
11
  *
13
12
  * Usage:
@@ -18,19 +17,23 @@
18
17
  * The module also exports its functions and only runs `main()` when executed directly,
19
18
  * so it can be imported (for testing/reuse) without side effects.
20
19
  */
20
+ /**
21
+ * A rule file. `paths` scopes it: Claude Code loads it only for matching files.
22
+ */
21
23
  type Rule = {
22
- file: string;
23
- name: string;
24
- description?: string;
25
- content: string;
24
+ file: string;
25
+ name: string;
26
+ description?: string;
27
+ paths?: string[];
28
+ content: string;
26
29
  };
27
30
  type Skill = {
28
- name: string;
31
+ name: string;
29
32
  };
30
33
  type ExistingFile = {
31
- exists: boolean;
32
- generated: boolean;
33
- customSection: string | null;
34
+ exists: boolean;
35
+ generated: boolean;
36
+ customSection: string | null;
34
37
  };
35
38
  /**
36
39
  * Read all markdown files from the package rules directory.
@@ -42,11 +45,15 @@ export declare function readRules(): Rule[];
42
45
  */
43
46
  export declare function readSkills(): Skill[];
44
47
  /**
45
- * Package files to link, keyed by their path inside an agent dir: `rules/<file>`, and every file of a skill at its
46
- * own relative path, plus the package README.md next to its `SKILL.md` (unless the skill ships one), so a skill can
47
- * reference `@README.md`.
48
+ * Read the package commands directory: every markdown file is a command named after the file.
49
+ */
50
+ export declare function readCommands(): string[];
51
+ /**
52
+ * Package files to link, keyed by their path inside an agent dir: `rules/<file>`, `commands/<file>`, and every file
53
+ * of a skill at its own relative path, plus the package README.md next to its `SKILL.md` (unless the skill ships
54
+ * one), so a skill can reference `@README.md`.
48
55
  */
49
- export declare function packageFiles(rules: Rule[], skills: Skill[]): Map<string, string>;
56
+ export declare function packageFiles(rules: Rule[], skills: Skill[], commands?: string[]): Map<string, string>;
50
57
  /**
51
58
  * The user's own files in `.agents` `rules`, `commands` and `skills`, keyed like packageFiles() - everything there
52
59
  * except the package links (and dotfiles).
@@ -54,8 +61,8 @@ export declare function packageFiles(rules: Rule[], skills: Skill[]): Map<string
54
61
  export declare function readUserFiles(cwd: string): Map<string, string>;
55
62
  /**
56
63
  * Make `rules`, `commands` and `skills` real directories in every agent dir and link the files we know into them:
57
- * package files into all three, pointing straight at the package, the user's own `.agents` files into `.claude` and
58
- * `.codex`. Real files and linked directories are the user's - never written over or through. Dead links are
64
+ * package files into both, pointing straight at the package, and the user's own `.agents` files into `.claude`.
65
+ * Real files and linked directories are the user's - never written over or through. Dead links are
59
66
  * removed, and so are links from the previous run that are no longer placed: each directory's generated `.gitignore`
60
67
  * records them (and keeps them out of git, so the user's own files there stay tracked).
61
68
  *
@@ -82,13 +89,12 @@ export declare function checkClaudeMdSafety(claudeMdPath: string): void;
82
89
  */
83
90
  export declare function symlinkClaudeMd(cwd: string): void;
84
91
  /**
85
- * Generate AGENTS.md with a `# Rules` section: a `## Title` block per rule file (the package's
86
- * and the user's own) with its frontmatter `description` and a reference to its `.agents/rules` entry.
92
+ * Generate AGENTS.md with a `# Rules` section: one entry per rule (the package's and the user's own) with
93
+ * its frontmatter `description`, the `paths` it is scoped to and a plain link to its `.agents/rules` entry.
87
94
  *
88
- * `.claude/rules/*.md` are symlinked by syncAgentDirs() above and auto-discovered by
89
- * Claude Code at launch (confirmed: Claude Code recursively loads every `.md` file
90
- * under `.claude/rules`, symlinks included) - no reference to them is needed here.
91
- * The sections below are for other tools that only read AGENTS.md.
95
+ * The links are plain, never `@path` imports: Claude Code loads `.claude/rules` itself (syncAgentDirs() links them
96
+ * there) and honours each rule's `paths`, while an `@` import would load every rule into every session, scoped or not.
97
+ * Codex, which expands no `@`, reads this index.
92
98
  */
93
99
  export declare function generateAgentsFile(rules: Rule[], customSection: string | null): string;
94
100
  /**
@@ -102,5 +108,4 @@ export declare function checkExisting(targetPath: string): ExistingFile;
102
108
  * Main function
103
109
  */
104
110
  export declare function main(): void;
105
- export {};
106
- //# sourceMappingURL=lintPrepare.d.ts.map
111
+ //#endregion