@kirill.konshin/lint 0.7.4 → 0.8.1

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 (56) hide show
  1. package/README.md +161 -113
  2. package/dist/config.d.ts +103 -0
  3. package/dist/config.js +112 -0
  4. package/dist/configs/base.d.ts +1 -1
  5. package/dist/configs/nx.d.ts +1 -1
  6. package/dist/configs/nx.js +3 -8
  7. package/dist/configs/react.d.ts +3 -3
  8. package/dist/configs/react.js +6 -16
  9. package/dist/configs/storybook.d.ts +3 -3
  10. package/dist/configs/storybook.js +4 -9
  11. package/dist/configs/tailwind.d.ts +6 -25
  12. package/dist/configs/tailwind.js +3 -64
  13. package/dist/configs/testing.d.ts +1 -1
  14. package/dist/configs/testing.js +3 -15
  15. package/dist/configs/turbo.d.ts +2 -2
  16. package/dist/configs/turbo.js +4 -6
  17. package/dist/configs/typescriptTypeAware.d.ts +1 -1
  18. package/dist/gates.d.ts +72 -0
  19. package/dist/gates.js +132 -0
  20. package/dist/index.d.ts +15 -51
  21. package/dist/index.js +16 -14
  22. package/dist/lib.d.ts +1 -1
  23. package/dist/lib.js +1 -1
  24. package/dist/lintPrepare.d.ts +75 -28
  25. package/dist/lintPrepare.js +243 -35
  26. package/dist/testColocation.js +1 -1
  27. package/dist/vitePlus.d.ts +8 -18
  28. package/dist/vitePlus.js +65 -47
  29. package/package.json +7 -4
  30. package/rules/agent.md +1 -0
  31. package/rules/db.md +1 -0
  32. package/rules/expo.md +2 -0
  33. package/rules/mui.md +3 -1
  34. package/rules/nextjs.md +3 -3
  35. package/rules/react.md +4 -28
  36. package/rules/tailwind.md +3 -2
  37. package/rules/typescript.md +1 -1
  38. package/rules/vite.md +1 -1
  39. package/skills/lint-db/SKILL.md +11 -9
  40. package/skills/lint-electron/SKILL.md +3 -1
  41. package/skills/lint-github/SKILL.md +10 -2
  42. package/skills/lint-gitlab/SKILL.md +17 -2
  43. package/skills/lint-migrate/SKILL.md +17 -1
  44. package/skills/lint-mui/SKILL.md +15 -18
  45. package/skills/lint-nextjs/SKILL.md +30 -18
  46. package/skills/lint-npm-yarn/SKILL.md +16 -30
  47. package/skills/lint-repo/SKILL.md +6 -6
  48. package/skills/lint-tailwind/SKILL.md +8 -8
  49. package/skills/lint-webstorm/SKILL.md +1 -1
  50. package/skills/lint-worktree/SKILL.md +25 -9
  51. package/skills/spec-steward/SKILL.md +1 -1
  52. package/skills/spec-steward/references/contract.md +1 -1
  53. package/skills/spec-steward/references/wiring.md +1 -1
  54. package/skills/spec-tools/SKILL.md +2 -2
  55. package/skills/spec-tools/scripts/cli.js +2 -2
  56. package/skills/spec-verify/SKILL.md +1 -1
@@ -44,7 +44,7 @@ Compare the project's `.idea` files with the templates below and [rules/webstorm
44
44
 
45
45
  # Vite+: Oxc plugin
46
46
 
47
- When the project uses `vite-plus`: the [Oxc plugin](https://plugins.jetbrains.com/plugin/27061-oxc) runs `vp lint --lsp` / `vp fmt --lsp` (AUTOMATIC mode finds `vite-plus`), so the `vite.config.ts` blocks apply. Prettier is disabled and `.idea/jsLinters/eslint.xml` deleted. The plugin stores booleans as attributes while the Vite+ docs write `<option>` - keep both; the IDE rewrites the file in its own form on save. Ask the user to confirm Settings → Tools → Oxc after reopening.
47
+ When the project uses `vite-plus`: the [Oxc plugin](https://plugins.jetbrains.com/plugin/27061-oxc) runs `vp lint --lsp` / `vp fmt --lsp` (AUTOMATIC mode finds `vite-plus`), so the Vite+ config applies (`vite.config.ts`, with the blocks from the `vitePlus` key of `lint.config.ts`). Prettier is disabled and `.idea/jsLinters/eslint.xml` deleted. The plugin stores booleans as attributes while the Vite+ docs write `<option>` - keep both; the IDE rewrites the file in its own form on save. Ask the user to confirm Settings → Tools → Oxc after reopening.
48
48
 
49
49
  `.idea/externalDependencies.xml` (required plugin; un-ignore it if `.idea` is gitignored: `!.idea/externalDependencies.xml`):
50
50
 
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  name: lint-worktree
3
- description: Git worktrees in `.worktrees` and the JetBrains IDEA / WebStorm module-name clash they cause. Use when creating, attaching or removing a git worktree.
3
+ description: Git worktrees inside the main checkout (`.worktrees`, Claude Code's `.claude/worktrees`) and the JetBrains IDEA / WebStorm module-name clash they cause. Use when creating, attaching or removing a git worktree.
4
4
  ---
5
5
 
6
- - Prefer creating worktrees inside the main repo in `.worktrees` directory
7
- - Directory `.worktrees` has to be gitignored, banned from IDEA indexing, and marked as excluded
6
+ - Prefer creating worktrees inside the main repo in `.worktrees` directory; Claude Code creates its worktrees in `.claude/worktrees`
7
+ - Each worktree folder has to be gitignored (`.gitignore` or the shared `.git/info/exclude`) and marked as excluded in the main checkout's `.idea/%projectName%.iml` (`<excludeFolder url="file://$MODULE_DIR$/.claude/worktrees" />`)
8
+ - Without the exclusion, the main project indexes a second copy of every source and `node_modules`, and its save actions reformat the worktree's files
8
9
 
9
10
  # Git Worktrees & JetBrains IDEA / WebStorm
10
11
 
@@ -14,15 +15,30 @@ description: Git worktrees in `.worktrees` and the JetBrains IDEA / WebStorm mod
14
15
  1. **Rename** — do not copy — `.idea/%projectName%.iml` to `.idea/%projectName% %Branch Title%.iml`. The module name is the file name, and attaching the worktree registers whichever `.iml` it finds: a copy beside the original still attaches as `%projectName%`.
15
16
  2. Point `.idea/modules.xml` at the renamed file.
16
17
  3. Write the same name into `.idea/.name`.
17
- 4. A main project the worktree is attached to lists it in its own `.idea/modules.xml`: point that entry at the renamed file too.
18
18
  - Keep the rename local, and NEVER commit it or merge it back:
19
19
  - The tracked `.iml` first: stage the branch's own edits to it (`git add .idea/%projectName%.iml`), then `git update-index --skip-worktree .idea/%projectName%.iml`, then rename. The staged content is what the branch commits; the rename never shows as a deletion. An edit the branch later makes to the renamed file has to be staged back the same way.
20
20
  - Ignore the renamed file in the shared `.git/info/exclude` with the pattern `.idea/%projectName% *.iml`.
21
21
  - A **tracked** `.idea/modules.xml` or `.idea/.name`: run `git update-index --skip-worktree` on it.
22
22
  - An **untracked** one (often `modules.xml` is in `.idea/.gitignore` and `.name` does not exist yet): `skip-worktree` fails on it, so leave it to `.idea/.gitignore` or add it to the shared `.git/info/exclude` as well (e.g. `.idea/.name`).
23
+ - A worktree that has both the original `.iml` and a renamed copy: do the `skip-worktree` step on the original, then delete it.
23
24
  - Verify with `git status --short .idea`: nothing from the rename is listed, only the staged edits.
24
- - Before a rebase, merge or checkout that updates those files (tracked ones only):
25
- 1. Rename the `.iml` back and run `git update-index --no-skip-worktree` on every file marked above.
26
- 2. Restore them with `git checkout -- <files>`.
27
- 3. Redo the rename afterwards.
28
- - A worktree created **inside** the main checkout (e.g. `.worktrees/<name>`, where agents put theirs) is indexed by the main project as part of itself, a second copy of every source and `node_modules`, and the main project's save actions start reformatting the worktree's files. Exclude its folder in the main checkout's `.idea/%projectName%.iml` (`<excludeFolder url="file://$MODULE_DIR$/.worktrees" />`) and list it in `.gitignore`, so the excluded-folders baseline of [rules/webstorm.md](../../rules/webstorm.md) holds. Attaching such a worktree can replace the main checkout's own entry in its `.idea/modules.xml`: keep both — the main `.idea/%projectName%.iml` and the worktree's renamed one — then reload the project. A nested worktree shows as its own module node inside the tree, not as a separate top-level project; for a top-level entry, create the worktree outside the main checkout.
25
+
26
+ # Attaching a Worktree to the Main Project
27
+
28
+ - Attaching edits tracked files of the main checkout:
29
+ - `.idea/modules.xml` gets an entry for the worktree's `.iml`; attaching can replace the main checkout's own entry: keep both, then reload the project
30
+ - `.idea/%projectName%.iml` gets `<orderEntry type="module" module-name="%projectName% %Branch Title%" />`
31
+ - `.idea/vcs.xml` can get `<mapping directory="" vcs="Git" />` instead of `$PROJECT_DIR$`
32
+ - Keep these edits local, the same as the rename: stage only the real edits to these files (e.g. a new `excludeFolder`), then `git update-index --skip-worktree` them
33
+ - To stage part of a file without `git add -p`: `git hash-object -w` the wanted content, then `git update-index --cacheinfo 100644,<blob>,<path>`
34
+ - Verify with `git status --short .idea` in the main checkout: only the staged edits are listed
35
+ - A worktree inside the main checkout shows as a module node inside the main tree, under its excluded folder, never as a top-level tree; for a top-level tree, create the worktree outside the main checkout (for Claude Code: its "Worktree location" setting; do not change it without the user's approval)
36
+ - After the worktree is detached or removed: `git update-index --no-skip-worktree` the main checkout's files, then `git checkout -- <files>`
37
+
38
+ # Before a Rebase, Merge or Checkout
39
+
40
+ In each checkout, for tracked files marked above that the operation updates:
41
+
42
+ 1. Rename the `.iml` back and run `git update-index --no-skip-worktree` on every marked file.
43
+ 2. Restore them with `git checkout -- <files>`.
44
+ 3. Redo the rename and the marks afterwards.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: spec-steward
3
- description: Guard, audit and repair an OpenSpec specification corpus — whether these are the right rules, in the right place, with the right evidence; it proposes spec changes and never fails a build. Use when auditing specs for corpus quality (the whole corpus, a change, or one capability), producing or processing a spec review file (the YAML review `.spec-audit/spec-review.yaml`, where the owner answers each item's `decision` with ✅ / ❌ / a comment), aligning rules shared by several repositories, wiring the spec guard (edit hook, AGENTS.md routing, OPSX config) into a repository, or when the repository's spec gate, `spec-tools steward check` or the edit hook reports a finding. Deterministic scripts do the mechanical work; the skill supplies the procedure. It does not audit code conformance; the `spec-verify` skill does. Writing a rule is the `/spec-author` command.
3
+ description: Guard, audit and repair an OpenSpec specification corpus - are these the right rules, in the right place, with the right evidence; it proposes spec changes and never fails a build. Use when auditing spec corpus quality, processing a spec review file (`.spec-audit/spec-review.yaml`), aligning rules shared by several repositories, wiring the spec guard into a repository, or when `spec-tools steward check` or the edit hook reports a finding. Not for code conformance (the `spec-verify` skill) or for writing a rule (the `spec-author` skill).
4
4
  ---
5
5
 
6
6
  # Spec steward
@@ -35,7 +35,7 @@ A citation of a scenario's anchor binds the scenario only where it sits in one o
35
35
  | In a test file (a JavaScript or TypeScript `*.test.*`, `*.spec.*` or `*.test-d.*` file, a file under `__tests__/` or `e2e/`, or a Python or Go test file), inside a `describe`, `it`, `test`, `suite` or `bench` call, with any `.only`, `.skip`, `.concurrent`, `.sequential`, `.todo`, `.each(…)`, `.for(…)`, `.runIf(…)`, `.skipIf(…)` or `.fails` chain, and Playwright's `test.describe`, `test.step`, `.serial`, `.parallel`, `.fixme` and `.fail`; in a Python test file, inside a `test_…` function or a `Test…` class; in a Go test file, inside a `Test…` function | yes |
36
36
  | In a test file, in the comment run directly above such a call or function (in Python, its decorators too), with no blank line between | yes |
37
37
  | In a test file, on a type assertion — an `Expect<…>` type alias, or an `expectTypeOf(…)` or `assertType(…)` call — at the top level or inside a block | yes |
38
- | In a lint configuration — `eslint.config.{js,mjs,cjs,ts,mts,cts}`, `vite.config.{js,mjs,cjs,ts,mts,cts}` (Vite+) or `yarn.config.cjs` — anywhere | yes |
38
+ | In a lint configuration — `eslint.config.{js,mjs,cjs,ts,mts,cts}`, `vite.config.{js,mjs,cjs,ts,mts,cts}` (Vite+), `lint.config.{js,mjs,cjs,ts,mts,cts}` (`@kirill.konshin/lint`) or `yarn.config.cjs` — anywhere | yes |
39
39
  | In a file matching a `binds` glob the repository declares — `"spec-steward": { "binds": [...] }` in its root `package.json`, or `--binds <glob>` — (a check script, a Dockerfile, a CI configuration), anywhere | yes |
40
40
  | Anywhere else in a test file: its header, a fixture, a helper | no — it binds nothing and fails nothing |
41
41
  | Code, configuration, YAML, a Dockerfile or a document that no `--binds` glob matches | no — it is a pointer |
@@ -5,7 +5,7 @@ A skill is discovered at the agent's discretion, so it cannot be the only thing
5
5
  | Point | What it does | Placed by |
6
6
  | --- | --- | --- |
7
7
  | Scoped rule `.agents/rules/openspec.md` (+ `.claude/rules`) | Hard constraints, loaded when the agent touches `openspec/**`. | `lint-prepare` (`@kirill.konshin/lint`) |
8
- | Skill `.agents/skills/spec-steward` (+ `.claude/skills`) | The procedures, the model, the contract and the scripts. | `lint-prepare` |
8
+ | Skill `.agents/skills/spec-steward` (+ `.claude/skills`) | The procedures, the model, the contract and the scripts. | `lint-prepare` (through the `skills` CLI) |
9
9
  | Edit hook in `.claude/settings.json` | Runs `steward hook` after every Edit/Write/MultiEdit and feeds findings back to the agent at once — only for what the edit changed, with no ratchet. | `steward wire --fix` |
10
10
  | Routing line in `AGENTS.md` | Tells every agent, Codex included, where the guard lives, and that corpus-quality audits use this skill while code conformance is the `spec-verify` audit. | You, beside the specification-driven convention; `wire --fix` prints the line. |
11
11
  | OPSX operation guidance in `openspec/config.yaml` | One narrow line each for `apply` and `archive`: run the repository's spec gate (AGENTS.md → Checks); a `weakened` finding stops the flow. | `steward wire --fix`, when the file has OpenSpec's standard shape |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: spec-tools
3
- description: The machinery around both audits — set up and run the `spec-tools` CLI of `@kirill.konshin/lint` in an OpenSpec repository — the change gates and workflow-evidence gate beside spec-steward's corpus gate, the requirement-level specification diff, the `spec-verify` code-conformance audit (run class, scope, workers, merge, verdict), and the glue a CI pipeline runs around a headless AI review (verdict gate, merge-request comment, HTML reports). Use when wiring these into a repository or its pipeline, when a `spec-tools` command fails or its output needs reading, or when deciding which run class an audit is.
3
+ description: Set up and run the `spec-tools` CLI of `@kirill.konshin/lint` in an OpenSpec repository - change gates, workflow-evidence gate, specification diff, runs of the `spec-verify` audit, and the CI glue around a headless AI review. Use when wiring spec-tools into a repository or its pipeline, when a `spec-tools` command fails or its output needs reading, or when choosing the run class of an audit.
4
4
  ---
5
5
 
6
6
  # spec-tools
@@ -35,7 +35,7 @@ Run them through the package manager (`yarn spec-tools gates`), the bin (`node_m
35
35
 
36
36
  ## Setting a repository up
37
37
 
38
- 1. Pin `@kirill.konshin/lint`; `lint-prepare` links the `spec-steward`, `spec-tools` and `spec-verify` skills.
38
+ 1. Pin `@kirill.konshin/lint`; `lint-prepare` installs the `spec-steward`, `spec-tools` and `spec-verify` skills.
39
39
  2. Declare what binds beyond spec-steward's defaults once, in the root `package.json`: `"spec-steward": { "binds": ["scripts/checks/**", "**/*.Dockerfile", ".gitlab-ci.yml"] }`.
40
40
  3. List the gates in the repository's `AGENTS.md` checks: `openspec validate --strict --all`, `spec-tools gates`, and after a requirement changes `spec-tools changed` with `/spec-verify changed` and `spec-tools diff`.
41
41
  4. Ignore the generated files with one `.gitignore` line, `.spec-audit/`: every file the tools and the audits write is under it — YAML data, the Markdown and HTML reports, `claude.jsonl`, the job logs. In CI, publish `.spec-audit/` as each audit job's artifacts path.
@@ -7689,7 +7689,7 @@ var init_citations = __esmMin((() => {
7689
7689
  CITE = /((?:\.{1,2}\/)*(?:[\w@.-]+\/)*?openspec\/specs\/[\w./-]*?spec\.md)(?:#([\w-]+))?/g;
7690
7690
  SKIP = /(?:^|\/)(?:node_modules|dist|build|coverage|\.git|\.nx|\.yarn|\.yalc|\.turbo|\.next|\.docusaurus|\.eve)(?:\/|$)|^openspec\/changes\/|(?:^|\/)spec\.md$/;
7691
7691
  TEST_FILE = /(?:^|\/)(?:__tests__|e2e)\/|\.(?:test|spec|test-d)\.[cm]?[jt]sx?$|(?:^|\/)test_[^/]+\.py$|_test\.(?:py|go)$/;
7692
- LINT_CONFIG = /(?:^|\/)(?:(?:eslint|vite)\.config\.[cm]?[jt]s|yarn\.config\.cjs)$/;
7692
+ LINT_CONFIG = /(?:^|\/)(?:(?:eslint|vite|lint)\.config\.[cm]?[jt]s|yarn\.config\.cjs)$/;
7693
7693
  isTestFile = (file) => TEST_FILE.test(file) && !isDoc(file);
7694
7694
  isLintConfig = (file) => LINT_CONFIG.test(file);
7695
7695
  anchorCache = /* @__PURE__ */ new Map();
@@ -9184,7 +9184,7 @@ function wireCli(opts, root) {
9184
9184
  const labels = {
9185
9185
  agents: "AGENTS.md routes to spec-steward",
9186
9186
  rule: ".agents/rules/openspec.md (or .claude/rules) is linked by lint-prepare",
9187
- skill: ".agents/skills/spec-steward (or .claude/skills) is linked by lint-prepare",
9187
+ skill: ".agents/skills/spec-steward (or .claude/skills) is installed by lint-prepare",
9188
9188
  hook: ".claude/settings.json runs the edit hook",
9189
9189
  opsx: `openspec/config apply/archive guidance points at the repository's spec gate (${GATE_POINTER})`
9190
9190
  };
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: spec-verify
3
- description: Audit whether the code satisfies the intent of the OpenSpec specifications; its verdict gates CI. Checks what no tool can - cross-capability contradiction, code that does not satisfy a requirement's intent, whether a bound test asserts its scenario, and gaps nobody recorded. It audits code conformance only; corpus quality is the spec-steward skill's audit. The judging rules are in the spec-tools skill's references/rules/ (common.md, spec-verify.md). Readers only judge; each writes .spec-audit/parts/findings/part-<n>-<reader>.yaml and `spec-tools report` renders .spec-audit/spec-verify.md. Interactively, run `spec-tools audit`, then summarize the report and ask the operator what to do. After changing a capability, `/spec-verify changed` judges what changed.
3
+ description: Audit whether the code satisfies the intent of the OpenSpec specifications; its verdict gates CI. Finds what no tool can - cross-capability contradictions, code that misses a requirement's intent, bound tests that do not assert their scenario, gaps nobody recorded. Use for a code-conformance audit (`spec-tools audit`) or after changing a capability (`/spec-verify changed`). Not for corpus quality (the `spec-steward` skill).
4
4
  model: claude-haiku-5-5
5
5
  effort: high
6
6
  ---