@erclx/aitk 3.12.1 → 3.13.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aitk",
3
3
  "description": "Automated governance, versioning, and discovery tools for Claude Code.",
4
- "version": "3.12.1",
4
+ "version": "3.13.0",
5
5
  "author": {
6
6
  "name": "Eric Le",
7
7
  "url": "https://github.com/erclx"
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: Route bash script authoring to the interactive or non-interactive skill, and name the lint gate
3
+ paths:
4
+ - '**/*.sh'
5
+ ---
6
+
7
+ # Bash standards
8
+
9
+ ## Skill routing
10
+
11
+ - Use `bash-script` for an interactive or human-facing script: prompts, a visual timeline UI, framed terminal output.
12
+ - Use `cli-script` for a non-interactive script: automation, CI, cron, a pipeline helper, or anything run by an agent rather than watched by a person.
13
+ - Load the matched skill's own reference templates rather than hand-rolling interactivity or logging patterns outside them.
14
+
15
+ ## Lint gate
16
+
17
+ - Format with `shfmt --write --indent 2` and lint with `shellcheck --severity=warning` before committing a script.
18
+ - Fix a shellcheck finding at the source. Suppress one with a directive comment only for a genuine false positive, and state why beside the suppression.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Enforce settled waits and falsifiable guards in end-to-end tests
3
+ paths:
4
+ - 'e2e/*.ts'
5
+ - 'e2e/**/*.ts'
6
+ ---
7
+
8
+ # End-to-end reliability standards
9
+
10
+ ## Waiting
11
+
12
+ - Settle on the condition a step waits for. Use `expect.poll` or a web-first assertion ahead of any read.
13
+ - Reserve a fixed duration for an assertion that nothing happened across a window.
14
+ - Bound every settle with an explicit timeout.
15
+ - Do not raise a timeout to clear a failure that reproduces under load. Replace the wait with a settle.
16
+ - Do not read a value once after a pause. Poll it.
17
+
18
+ ## Falsifiable guards
19
+
20
+ - Assert the set under test is non-empty before asserting a property over its members.
21
+ - Raise from an instrument that was refused rather than returning a value a passing assertion accepts.
22
+ - Run a new guard against the defect it was written for, and see it fail, before trusting it.
23
+ - Do not weaken an assertion to clear a failure. Narrow the wait instead.
24
+
25
+ ## Reproducing a failure that only appears in CI
26
+
27
+ - Reproduce under `Emulation.setCPUThrottlingRate` rather than by rerunning the gate.
28
+ - Read the state the assertion does not: which markers were set, which listeners fired, how far a transition ran.
29
+ - Vary the condition under suspicion deliberately. Do not compare counts across runs that differed in something uncontrolled.
30
+ - Read the check conclusion as its own act. A green diff review reports nothing about the gate.
31
+
32
+ ## Authority
33
+
34
+ - Follow `.claude/rules/lib/300-testing-ts.md` for framework choice, file placement, and test naming.
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Enforce which specs and which engines an end-to-end run covers at each point in the loop
3
+ paths:
4
+ - 'e2e/*.ts'
5
+ - 'e2e/**/*.ts'
6
+ ---
7
+
8
+ # Test scope standards
9
+
10
+ ## Selecting a run
11
+
12
+ - Narrow an end-to-end run by spec path or by test name. Never narrow it by engine.
13
+ - Run one named test while iterating on a behavior: `bun run test:e2e -- -g '<name>'`.
14
+ - Run one surface while iterating on that surface: `bun run test:e2e -- e2e/<area>.spec.ts`.
15
+ - Run `bun run test:e2e:changed` to select specs from the import graph.
16
+ - Run the whole suite before pushing.
17
+ - Pass `--project` in a local run only to reproduce a failure that engine has already reported. The CI matrix passes it on every job, one engine per leg, which is the gate rather than a narrowed run.
18
+ - Do not add a script that pins a default run to one engine.
19
+
20
+ ## Instruments
21
+
22
+ - Answer a question about the running page with a script against the dev server rather than with the suite.
23
+ - Do not enable `fullyParallel` in `playwright.config.ts`.
24
+ - Follow `.claude/rules/ui/440-surface-capture.md` for capture scope.
25
+ - Follow `.claude/rules/lib/305-e2e-reliability.md` for waits and guards.
@@ -4,6 +4,7 @@ paths:
4
4
  - '**/*.tsx'
5
5
  - '**/*.jsx'
6
6
  - '**/*.html'
7
+ - '**/*.astro'
7
8
  ---
8
9
 
9
10
  # Web security standards
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Enforce the same-tab default for an outbound link and for a mail link
3
+ paths:
4
+ - '**/*.tsx'
5
+ - '**/*.jsx'
6
+ - '**/*.astro'
7
+ - '**/*.html'
8
+ ---
9
+
10
+ # Link behavior standards
11
+
12
+ ## Default target
13
+
14
+ - Open a link in the same tab. Reserve `target="_blank"` for a destination that would discard in-progress work if it replaced the current page, such as a document a user is midway through elsewhere.
15
+ - Do not add `target="_blank"` as a default for every external link.
16
+
17
+ ## mailto: links
18
+
19
+ - Open a `mailto:` link in the same tab. It hands off to the mail client rather than replacing page content, so a new tab leaves an empty tab behind.
@@ -1,2 +1,2 @@
1
1
  extends = "node"
2
- rules = ["210-astro", "350-security-web", "400-ui", "410-a11y", "430-ux-completeness", "440-surface-capture"]
2
+ rules = ["210-astro", "350-security-web", "400-ui", "410-a11y", "430-ux-completeness", "440-surface-capture", "450-link-behavior"]
@@ -1,4 +1,4 @@
1
1
  extends = ""
2
2
  # Both folders whole. Every rule authored under them ships to a base consumer,
3
3
  # so adding one is a single edit rather than a file and a name here.
4
- rules = ["core", "claude"]
4
+ rules = ["core", "claude", "120-bash"]
@@ -1,2 +1,2 @@
1
1
  extends = "node"
2
- rules = ["200-react", "230-nextjs", "250-tailwind", "300-testing-ts", "310-zod", "350-security-web", "400-ui", "410-a11y", "420-forms", "430-ux-completeness", "440-surface-capture"]
2
+ rules = ["200-react", "230-nextjs", "250-tailwind", "300-testing-ts", "305-e2e-reliability", "306-test-scope", "310-zod", "350-security-web", "400-ui", "410-a11y", "420-forms", "430-ux-completeness", "440-surface-capture", "450-link-behavior"]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erclx/aitk",
3
3
  "type": "module",
4
- "version": "3.12.1",
4
+ "version": "3.13.0",
5
5
  "description": "Infrastructure and quality tooling for developer workflows",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -43,6 +43,7 @@ packages = [
43
43
  "test:ui" = "vitest --ui"
44
44
  "test:coverage" = "vitest run --coverage"
45
45
  "test:e2e" = "WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && playwright test"
46
+ "test:e2e:changed" = "WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && playwright test --only-changed"
46
47
  "test:e2e:ui" = "WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && playwright test --ui"
47
48
  "test:e2e:report" = "playwright show-report"
48
49
  "check:full" = "./scripts/verify.sh && bun run test:e2e"
@@ -103,6 +103,7 @@ Append rows:
103
103
  | `bun run test:run` | Run Vitest once with verbose reporter. |
104
104
  | `bun run test:coverage` | Run Vitest with coverage. |
105
105
  | `bun run test:e2e` | Run Playwright E2E tests. |
106
+ | `bun run test:e2e:changed` | Run Playwright E2E tests for specs the import graph reaches from the current diff. |
106
107
  | `bun run screenshot` | Build, preview, then capture screenshots. |
107
108
 
108
109
  `aitk tooling verify <stack>` is the only automated caller of `bun run screenshot`, running it for any stack whose `package.json` declares the script and asserting that PNG files land under `screenshots/`. It counts them with a recursive find carrying no depth limit, so the section folders the seed writes satisfy the assertion without a change to it. Do not flatten the layout to protect that check. No ship chain captures a screenshot, so the output path the seed writes is a contract that one verifier reads rather than a default a ship step depends on.