@kirill.konshin/lint 0.7.4 → 0.8.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 +160 -113
- package/dist/config.d.ts +103 -0
- package/dist/config.js +112 -0
- package/dist/configs/base.d.ts +1 -1
- package/dist/configs/nx.d.ts +1 -1
- package/dist/configs/nx.js +3 -8
- package/dist/configs/react.d.ts +3 -3
- package/dist/configs/react.js +6 -16
- package/dist/configs/storybook.d.ts +3 -3
- package/dist/configs/storybook.js +4 -9
- package/dist/configs/tailwind.d.ts +6 -25
- package/dist/configs/tailwind.js +3 -64
- package/dist/configs/testing.d.ts +1 -1
- package/dist/configs/testing.js +3 -15
- package/dist/configs/turbo.d.ts +2 -2
- package/dist/configs/turbo.js +4 -6
- package/dist/configs/typescriptTypeAware.d.ts +1 -1
- package/dist/gates.d.ts +72 -0
- package/dist/gates.js +132 -0
- package/dist/index.d.ts +15 -51
- package/dist/index.js +16 -14
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/lintPrepare.d.ts +75 -28
- package/dist/lintPrepare.js +243 -35
- package/dist/testColocation.js +1 -1
- package/dist/vitePlus.d.ts +8 -18
- package/dist/vitePlus.js +40 -47
- package/package.json +7 -4
- package/rules/agent.md +1 -0
- package/rules/db.md +1 -0
- package/rules/expo.md +2 -0
- package/rules/mui.md +3 -1
- package/rules/nextjs.md +3 -3
- package/rules/react.md +4 -28
- package/rules/tailwind.md +3 -2
- package/rules/typescript.md +1 -1
- package/rules/vite.md +1 -1
- package/skills/lint-db/SKILL.md +11 -9
- package/skills/lint-electron/SKILL.md +3 -1
- package/skills/lint-github/SKILL.md +10 -2
- package/skills/lint-gitlab/SKILL.md +17 -2
- package/skills/lint-migrate/SKILL.md +17 -1
- package/skills/lint-mui/SKILL.md +15 -18
- package/skills/lint-nextjs/SKILL.md +30 -18
- package/skills/lint-npm-yarn/SKILL.md +16 -30
- package/skills/lint-repo/SKILL.md +6 -6
- package/skills/lint-tailwind/SKILL.md +8 -8
- package/skills/lint-webstorm/SKILL.md +1 -1
- package/skills/lint-worktree/SKILL.md +25 -9
- package/skills/spec-steward/SKILL.md +1 -1
- package/skills/spec-steward/references/contract.md +1 -1
- package/skills/spec-steward/references/wiring.md +1 -1
- package/skills/spec-tools/SKILL.md +2 -2
- package/skills/spec-tools/scripts/cli.js +2 -2
- package/skills/spec-verify/SKILL.md +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lint-worktree
|
|
3
|
-
description: Git worktrees
|
|
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
|
-
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
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
|
|
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:
|
|
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`
|
|
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
|
|
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.
|
|
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
|
---
|