@specdest/devkit 0.1.2 → 0.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.
Files changed (61) hide show
  1. package/catalog/modules/checker-runtime/config.ts +4 -3
  2. package/catalog/modules/checker-runtime/fs.ts +4 -3
  3. package/catalog/modules/checker-runtime/manifest.json +6 -1
  4. package/catalog/modules/checker-runtime/runtime.ts +79 -0
  5. package/catalog/rules/abac-permissions-convex/check.ts +4 -3
  6. package/catalog/rules/abac-permissions-convex/manifest.json +3 -5
  7. package/catalog/rules/abac-permissions-supabase/check.ts +4 -3
  8. package/catalog/rules/abac-permissions-supabase/manifest.json +3 -5
  9. package/catalog/rules/convex-multi-presentation/check.ts +13 -12
  10. package/catalog/rules/convex-multi-presentation/manifest.json +3 -5
  11. package/catalog/rules/design-rules/check.ts +5 -4
  12. package/catalog/rules/design-rules/manifest.json +3 -5
  13. package/catalog/rules/e2e-test-rules/SKILL.md +1 -1
  14. package/catalog/rules/e2e-test-rules/check.ts +5 -4
  15. package/catalog/rules/e2e-test-rules/manifest.json +3 -5
  16. package/catalog/rules/error-handling-rules/check.ts +4 -3
  17. package/catalog/rules/error-handling-rules/manifest.json +3 -5
  18. package/catalog/rules/layers-and-contracts/check.ts +6 -5
  19. package/catalog/rules/layers-and-contracts/manifest.json +3 -5
  20. package/catalog/rules/layers-and-contracts-convex/check.ts +7 -6
  21. package/catalog/rules/layers-and-contracts-convex/manifest.json +3 -5
  22. package/catalog/rules/layers-and-contracts-supabase/check.ts +8 -7
  23. package/catalog/rules/layers-and-contracts-supabase/manifest.json +3 -5
  24. package/catalog/rules/module-size-rules/check.ts +9 -8
  25. package/catalog/rules/module-size-rules/manifest.json +3 -5
  26. package/catalog/rules/module-size-rules-convex/check.ts +9 -8
  27. package/catalog/rules/module-size-rules-convex/manifest.json +3 -5
  28. package/catalog/rules/module-size-rules-supabase/check.ts +9 -8
  29. package/catalog/rules/module-size-rules-supabase/manifest.json +3 -5
  30. package/catalog/rules/mutation-command-rules/check.ts +3 -2
  31. package/catalog/rules/mutation-command-rules/manifest.json +3 -5
  32. package/catalog/rules/nearby-contracts/SKILL.md +1 -1
  33. package/catalog/rules/nearby-contracts/check.ts +4 -3
  34. package/catalog/rules/nearby-contracts/manifest.json +3 -5
  35. package/catalog/rules/no-raw-click-buttons/check.ts +3 -2
  36. package/catalog/rules/no-raw-click-buttons/manifest.json +3 -5
  37. package/catalog/rules/public-api-export-barrels/SKILL.md +1 -1
  38. package/catalog/rules/public-api-export-barrels/check.ts +3 -2
  39. package/catalog/rules/public-api-export-barrels/manifest.json +3 -5
  40. package/catalog/rules/route-tree-fresh/check.ts +9 -7
  41. package/catalog/rules/route-tree-fresh/manifest.json +3 -5
  42. package/catalog/rules/strict-typescript/check.ts +16 -8
  43. package/catalog/rules/strict-typescript/manifest.json +3 -5
  44. package/catalog/rules/supabase-contracts/check.ts +10 -9
  45. package/catalog/rules/supabase-contracts/manifest.json +3 -5
  46. package/catalog/rules/supabase-declarative-schema/SKILL.md +1 -1
  47. package/catalog/rules/supabase-declarative-schema/check.ts +5 -4
  48. package/catalog/rules/supabase-declarative-schema/manifest.json +3 -5
  49. package/catalog/rules/tanstack-form-rules/SKILL.md +1 -1
  50. package/catalog/rules/tanstack-form-rules/check.ts +3 -2
  51. package/catalog/rules/tanstack-form-rules/manifest.json +3 -5
  52. package/catalog/rules/unit-test-rules/SKILL.md +1 -1
  53. package/catalog/rules/unit-test-rules/check.ts +6 -5
  54. package/catalog/rules/unit-test-rules/manifest.json +3 -5
  55. package/catalog/rules/unit-test-rules-convex/check.ts +8 -7
  56. package/catalog/rules/unit-test-rules-convex/manifest.json +3 -5
  57. package/catalog/rules/unit-test-rules-supabase/check.ts +7 -6
  58. package/catalog/rules/unit-test-rules-supabase/manifest.json +3 -5
  59. package/catalog/rules/workstation-controller-rules/check.ts +5 -4
  60. package/catalog/rules/workstation-controller-rules/manifest.json +3 -5
  61. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "public-api-export-barrels",
3
3
  "kind": "rule",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "requires": [
6
6
  "checker-runtime"
7
7
  ],
@@ -25,15 +25,13 @@
25
25
  "kind": "shared-markdown-section",
26
26
  "path": "AGENTS.md",
27
27
  "heading": "## Specdest rule: public-api-export-barrels",
28
- "body": "Use `.agents/skills/public-api-export-barrels/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/public-api-export-barrels/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/public-api-export-barrels/SKILL.md` when working in this rule area. Run `node .agents/skills/public-api-export-barrels/check.ts` before handoff."
29
29
  }
30
30
  ],
31
31
  "obsolete": [],
32
32
  "check": {
33
33
  "command": [
34
- "deno",
35
- "run",
36
- "--allow-read",
34
+ "node",
37
35
  ".agents/skills/public-api-export-barrels/check.ts"
38
36
  ]
39
37
  }
@@ -1,10 +1,11 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  // oxlint-disable no-console no-await-in-loop
2
3
  const decoder = new TextDecoder();
3
4
  const violations: string[] = [];
4
5
 
5
6
  async function exists(path: string): Promise<boolean> {
6
7
  try {
7
- await Deno.stat(path);
8
+ await runtime.stat(path);
8
9
  return true;
9
10
  } catch {
10
11
  return false;
@@ -13,7 +14,7 @@ async function exists(path: string): Promise<boolean> {
13
14
 
14
15
  async function* walk(dir: string): AsyncGenerator<string> {
15
16
  try {
16
- for await (const entry of Deno.readDir(dir)) {
17
+ for await (const entry of runtime.readDir(dir)) {
17
18
  const path = `${dir}/${entry.name}`;
18
19
  if (entry.isDirectory) yield* walk(path);
19
20
  if (entry.isFile && /\.tsx?$/.test(entry.name)) yield path;
@@ -23,23 +24,24 @@ async function* walk(dir: string): AsyncGenerator<string> {
23
24
  }
24
25
  }
25
26
 
26
- const usesTanstackFileRoutes = await exists("src/routes") || await exists("src/routeTree.gen.ts");
27
+ const usesTanstackFileRoutes =
28
+ (await exists("src/routes")) || (await exists("src/routeTree.gen.ts"));
27
29
 
28
30
  if (!usesTanstackFileRoutes) {
29
31
  console.log("route-tree-fresh not applicable");
30
- Deno.exit(0);
32
+ runtime.exit(0);
31
33
  }
32
34
 
33
35
  if (!(await exists("src/routeTree.gen.ts"))) {
34
36
  violations.push("missing generated route tree: src/routeTree.gen.ts");
35
37
  } else {
36
- const routeTree = decoder.decode(await Deno.readFile("src/routeTree.gen.ts"));
38
+ const routeTree = decoder.decode(await runtime.readFile("src/routeTree.gen.ts"));
37
39
 
38
40
  for await (const file of walk("src/routes")) {
39
41
  if (file.includes("/-components/")) continue;
40
42
  if (!file.endsWith(".tsx")) continue;
41
43
 
42
- const text = decoder.decode(await Deno.readFile(file));
44
+ const text = decoder.decode(await runtime.readFile(file));
43
45
  const match = text.match(/createFileRoute\(["']([^"']+)["']\)/u);
44
46
  if (!match) continue;
45
47
 
@@ -55,7 +57,7 @@ if (!(await exists("src/routeTree.gen.ts"))) {
55
57
 
56
58
  if (violations.length) {
57
59
  console.error(violations.join("\n"));
58
- Deno.exit(1);
60
+ runtime.exit(1);
59
61
  }
60
62
  console.log("route-tree-fresh ok");
61
63
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "route-tree-fresh",
3
3
  "kind": "rule",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "requires": [
6
6
  "checker-runtime"
7
7
  ],
@@ -20,15 +20,13 @@
20
20
  "kind": "shared-markdown-section",
21
21
  "path": "AGENTS.md",
22
22
  "heading": "## Specdest rule: route-tree-fresh",
23
- "body": "Use `.agents/skills/route-tree-fresh/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/route-tree-fresh/check.ts` before handoff."
23
+ "body": "Use `.agents/skills/route-tree-fresh/SKILL.md` when working in this rule area. Run `node .agents/skills/route-tree-fresh/check.ts` before handoff."
24
24
  }
25
25
  ],
26
26
  "obsolete": [],
27
27
  "check": {
28
28
  "command": [
29
- "deno",
30
- "run",
31
- "--allow-read",
29
+ "node",
32
30
  ".agents/skills/route-tree-fresh/check.ts"
33
31
  ]
34
32
  }
@@ -1,9 +1,10 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  // oxlint-disable no-console no-await-in-loop
2
3
  const violations: string[] = [];
3
4
 
4
5
  async function* walk(dir: string): AsyncGenerator<string> {
5
6
  try {
6
- for await (const entry of Deno.readDir(dir)) {
7
+ for await (const entry of runtime.readDir(dir)) {
7
8
  const path = `${dir}/${entry.name}`;
8
9
  if (entry.isDirectory) yield* walk(path);
9
10
  if (entry.isFile && /\.(ts|tsx)$/u.test(entry.name)) yield path;
@@ -26,7 +27,6 @@ function isTestOrStory(file: string): boolean {
26
27
  );
27
28
  }
28
29
 
29
-
30
30
  function stripComments(text: string): string {
31
31
  let result = "";
32
32
  let index = 0;
@@ -45,14 +45,17 @@ function stripComments(text: string): string {
45
45
  index += 1;
46
46
  continue;
47
47
  }
48
- if (char === "\"" || char === "'" || char === "`") {
48
+ if (char === '"' || char === "'" || char === "`") {
49
49
  quote = char;
50
50
  result += char;
51
51
  index += 1;
52
52
  continue;
53
53
  }
54
54
  if (char === "/" && next === "/") {
55
- while (index < text.length && text[index] !== "\n") { result += " "; index += 1; }
55
+ while (index < text.length && text[index] !== "\n") {
56
+ result += " ";
57
+ index += 1;
58
+ }
56
59
  continue;
57
60
  }
58
61
  if (char === "/" && next === "*") {
@@ -62,7 +65,10 @@ function stripComments(text: string): string {
62
65
  result += text[index] === "\n" ? "\n" : " ";
63
66
  index += 1;
64
67
  }
65
- if (index < text.length) { result += " "; index += 2; }
68
+ if (index < text.length) {
69
+ result += " ";
70
+ index += 2;
71
+ }
66
72
  continue;
67
73
  }
68
74
  result += char;
@@ -86,7 +92,7 @@ function checkBoundarySchemaTypes(file: string, text: string): void {
86
92
 
87
93
  for await (const file of walk("src")) {
88
94
  if (isIgnored(file)) continue;
89
- const text = await Deno.readTextFile(file);
95
+ const text = await runtime.readTextFile(file);
90
96
  const source = stripComments(text);
91
97
  checkBoundarySchemaTypes(file, source);
92
98
  if (isTestOrStory(file)) continue;
@@ -99,13 +105,15 @@ for await (const file of walk("src")) {
99
105
  if (/!\./u.test(source) || /!;/u.test(source)) {
100
106
  violations.push(`${file}: avoid non-null assertions`);
101
107
  }
102
- for (const match of source.matchAll(/\bas\s+(any|unknown|never)\b|\bas\s+unknown\s+as\b|<any>/gu)) {
108
+ for (const match of source.matchAll(
109
+ /\bas\s+(any|unknown|never)\b|\bas\s+unknown\s+as\b|<any>/gu,
110
+ )) {
103
111
  violations.push(`${file}:${lineNumber(text, match.index ?? 0)} avoid unsafe casts`);
104
112
  }
105
113
  }
106
114
 
107
115
  if (violations.length) {
108
116
  console.error(violations.join("\n"));
109
- Deno.exit(1);
117
+ runtime.exit(1);
110
118
  }
111
119
  console.log("strict-typescript ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "strict-typescript",
3
3
  "kind": "rule",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "requires": [
6
6
  "checker-runtime"
7
7
  ],
@@ -20,15 +20,13 @@
20
20
  "kind": "shared-markdown-section",
21
21
  "path": "AGENTS.md",
22
22
  "heading": "## Specdest rule: strict-typescript",
23
- "body": "Use `.agents/skills/strict-typescript/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/strict-typescript/check.ts` before handoff."
23
+ "body": "Use `.agents/skills/strict-typescript/SKILL.md` when working in this rule area. Run `node .agents/skills/strict-typescript/check.ts` before handoff."
24
24
  }
25
25
  ],
26
26
  "obsolete": [],
27
27
  "check": {
28
28
  "command": [
29
- "deno",
30
- "run",
31
- "--allow-read",
29
+ "node",
32
30
  ".agents/skills/strict-typescript/check.ts"
33
31
  ]
34
32
  }
@@ -1,3 +1,4 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  // oxlint-disable no-console no-await-in-loop
2
3
  const required = [
3
4
  "src/__generated__/database.ts",
@@ -16,7 +17,7 @@ const sharedPairs = [
16
17
  const missing: string[] = [];
17
18
  for (const path of required) {
18
19
  try {
19
- await Deno.stat(path);
20
+ await runtime.stat(path);
20
21
  } catch {
21
22
  missing.push(path);
22
23
  }
@@ -25,8 +26,8 @@ for (const path of required) {
25
26
  const mismatches: string[] = [];
26
27
  for (const [left, right] of sharedPairs) {
27
28
  try {
28
- const leftText = await Deno.readTextFile(left);
29
- const rightText = await Deno.readTextFile(right);
29
+ const leftText = await runtime.readTextFile(left);
30
+ const rightText = await runtime.readTextFile(right);
30
31
  if (leftText !== rightText) mismatches.push(`${left} != ${right}`);
31
32
  } catch {
32
33
  // Missing files are reported above.
@@ -59,14 +60,14 @@ if (missing.length || mismatches.length || incompleteSchemas.length || missingDa
59
60
  );
60
61
  }
61
62
  console.error(parts.join("\n"));
62
- Deno.exit(1);
63
+ runtime.exit(1);
63
64
  }
64
65
  console.log("supabase-contracts ok");
65
66
 
66
67
  async function findIncompleteGeneratedSchemas(): Promise<string[]> {
67
68
  try {
68
- const databaseText = await Deno.readTextFile("src/__generated__/database.ts");
69
- const schemaText = await Deno.readTextFile("src/__generated__/schema.ts");
69
+ const databaseText = await runtime.readTextFile("src/__generated__/database.ts");
70
+ const schemaText = await runtime.readTextFile("src/__generated__/schema.ts");
70
71
  const tableNames = getPublicTableNames(databaseText);
71
72
  const missingExports: string[] = [];
72
73
  for (const tableName of tableNames) {
@@ -85,13 +86,13 @@ async function findIncompleteGeneratedSchemas(): Promise<string[]> {
85
86
 
86
87
  async function findMissingDalTables(): Promise<string[]> {
87
88
  try {
88
- const databaseText = await Deno.readTextFile("src/__generated__/database.ts");
89
+ const databaseText = await runtime.readTextFile("src/__generated__/database.ts");
89
90
  const tableNames = new Set(getAllTableNames(databaseText));
90
91
  const violations: string[] = [];
91
92
  for await (const file of walk("src/dal")) {
92
93
  if (!file.endsWith(".ts")) continue;
93
94
  if (file.endsWith(".test.ts")) continue;
94
- const text = await Deno.readTextFile(file);
95
+ const text = await runtime.readTextFile(file);
95
96
  for (const tableName of getDalFromTableNames(text)) {
96
97
  if (!tableNames.has(tableName)) {
97
98
  violations.push(
@@ -122,7 +123,7 @@ function getDalFromTableNames(text: string): string[] {
122
123
 
123
124
  async function* walk(dir: string): AsyncGenerator<string> {
124
125
  try {
125
- for await (const entry of Deno.readDir(dir)) {
126
+ for await (const entry of runtime.readDir(dir)) {
126
127
  const path = `${dir}/${entry.name}`;
127
128
  if (entry.isDirectory) yield* walk(path);
128
129
  if (entry.isFile) yield path;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "supabase-contracts",
3
3
  "kind": "rule",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "requires": [
6
6
  "checker-runtime"
7
7
  ],
@@ -20,15 +20,13 @@
20
20
  "kind": "shared-markdown-section",
21
21
  "path": "AGENTS.md",
22
22
  "heading": "## Specdest backend rule: supabase-contracts",
23
- "body": "Use `.agents/skills/supabase-contracts/SKILL.md` for this backend-specific rule. Run `deno run --allow-read .agents/skills/supabase-contracts/check.ts` before handoff."
23
+ "body": "Use `.agents/skills/supabase-contracts/SKILL.md` for this backend-specific rule. Run `node .agents/skills/supabase-contracts/check.ts` before handoff."
24
24
  }
25
25
  ],
26
26
  "obsolete": [],
27
27
  "check": {
28
28
  "command": [
29
- "deno",
30
- "run",
31
- "--allow-read",
29
+ "node",
32
30
  ".agents/skills/supabase-contracts/check.ts"
33
31
  ]
34
32
  }
@@ -24,7 +24,7 @@ Use this skill before adding, changing, or reviewing Supabase schema, generated
24
24
  ## Check
25
25
 
26
26
  ```bash
27
- deno run --allow-read .agents/skills/supabase-declarative-schema/check.ts
27
+ node .agents/skills/supabase-declarative-schema/check.ts
28
28
  ```
29
29
 
30
30
  Configuration lives in `./config.json` in this skill folder. Keep exceptions explicit and small.
@@ -1,3 +1,4 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  // oxlint-disable no-console no-await-in-loop
2
3
  const violations: string[] = [];
3
4
 
@@ -10,7 +11,7 @@ type DeclarativeSchemaConfig = {
10
11
 
11
12
  async function readText(path: string): Promise<string | null> {
12
13
  try {
13
- return await Deno.readTextFile(path);
14
+ return await runtime.readTextFile(path);
14
15
  } catch {
15
16
  return null;
16
17
  }
@@ -18,7 +19,7 @@ async function readText(path: string): Promise<string | null> {
18
19
 
19
20
  async function exists(path: string): Promise<boolean> {
20
21
  try {
21
- await Deno.stat(path);
22
+ await runtime.stat(path);
22
23
  return true;
23
24
  } catch {
24
25
  return false;
@@ -27,7 +28,7 @@ async function exists(path: string): Promise<boolean> {
27
28
 
28
29
  async function* walk(dir: string): AsyncGenerator<string> {
29
30
  try {
30
- for await (const entry of Deno.readDir(dir)) {
31
+ for await (const entry of runtime.readDir(dir)) {
31
32
  const path = `${dir}/${entry.name}`;
32
33
  if (entry.isDirectory) yield* walk(path);
33
34
  if (entry.isFile) yield path;
@@ -255,7 +256,7 @@ if (!packageScripts) {
255
256
  if (violations.length) {
256
257
  console.error(`# supabase-declarative-schema violations: ${violations.length}`);
257
258
  for (const violation of violations) console.error(`- ${violation}`);
258
- Deno.exit(1);
259
+ runtime.exit(1);
259
260
  }
260
261
 
261
262
  console.log("supabase-declarative-schema ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "supabase-declarative-schema",
3
3
  "kind": "rule",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "requires": [
6
6
  "checker-runtime"
7
7
  ],
@@ -25,15 +25,13 @@
25
25
  "kind": "shared-markdown-section",
26
26
  "path": "AGENTS.md",
27
27
  "heading": "## Specdest backend rule: supabase-declarative-schema",
28
- "body": "Use `.agents/skills/supabase-declarative-schema/SKILL.md` for this backend-specific rule. Run `deno run --allow-read .agents/skills/supabase-declarative-schema/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/supabase-declarative-schema/SKILL.md` for this backend-specific rule. Run `node .agents/skills/supabase-declarative-schema/check.ts` before handoff."
29
29
  }
30
30
  ],
31
31
  "obsolete": [],
32
32
  "check": {
33
33
  "command": [
34
- "deno",
35
- "run",
36
- "--allow-read",
34
+ "node",
37
35
  ".agents/skills/supabase-declarative-schema/check.ts"
38
36
  ]
39
37
  }
@@ -5,7 +5,7 @@ Use TanStack Form for submitting route forms and form value state. Do not replac
5
5
  Before changing route forms, inspect this skill and run:
6
6
 
7
7
  ```bash
8
- deno run --allow-read .agents/skills/tanstack-form-rules/check.ts
8
+ node .agents/skills/tanstack-form-rules/check.ts
9
9
  ```
10
10
 
11
11
  Fix violations in application code separately from Devkit `sync`.
@@ -1,3 +1,4 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  // oxlint-disable no-console no-await-in-loop
2
3
  import { walk } from "../shared/fs.ts";
3
4
 
@@ -24,7 +25,7 @@ const files = (await walk("src/routes")).map((file) => `src/routes/${file}`).fil
24
25
  const violations: string[] = [];
25
26
 
26
27
  for (const file of files) {
27
- const text = await Deno.readTextFile(file);
28
+ const text = await runtime.readTextFile(file);
28
29
  if (/new\s+FormData\s*\(/u.test(text)) {
29
30
  for (const match of text.matchAll(/new\s+FormData\s*\(/gu)) {
30
31
  violations.push(
@@ -52,6 +53,6 @@ for (const file of files) {
52
53
  if (violations.length > 0) {
53
54
  console.error(`# tanstack form rule violations: ${violations.length}`);
54
55
  console.error(violations.join("\n"));
55
- Deno.exit(1);
56
+ runtime.exit(1);
56
57
  }
57
58
  console.log("tanstack-form-rules ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "tanstack-form-rules",
3
3
  "kind": "rule",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "requires": [
6
6
  "checker-runtime"
7
7
  ],
@@ -20,15 +20,13 @@
20
20
  "kind": "shared-markdown-section",
21
21
  "path": "AGENTS.md",
22
22
  "heading": "## Specdest rule: tanstack-form-rules",
23
- "body": "Use `.agents/skills/tanstack-form-rules/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/tanstack-form-rules/check.ts` before handoff."
23
+ "body": "Use `.agents/skills/tanstack-form-rules/SKILL.md` when working in this rule area. Run `node .agents/skills/tanstack-form-rules/check.ts` before handoff."
24
24
  }
25
25
  ],
26
26
  "obsolete": [],
27
27
  "check": {
28
28
  "command": [
29
- "deno",
30
- "run",
31
- "--allow-read",
29
+ "node",
32
30
  ".agents/skills/tanstack-form-rules/check.ts"
33
31
  ]
34
32
  }
@@ -47,7 +47,7 @@ nps lint
47
47
  Direct checker:
48
48
 
49
49
  ```bash
50
- deno run --allow-read .agents/skills/unit-test-rules/check.ts
50
+ node .agents/skills/unit-test-rules/check.ts
51
51
  ```
52
52
 
53
53
  ## Fix violations
@@ -1,3 +1,4 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  import { assertSchemaVersion, readSkillConfig } from "../shared/config.ts";
2
3
  import { exists, normalizePath, walk } from "../shared/fs.ts";
3
4
 
@@ -50,9 +51,9 @@ function isUnitTest(file: string): boolean {
50
51
 
51
52
  async function readJsonFile(path: string): Promise<Record<string, unknown> | null> {
52
53
  try {
53
- return JSON.parse(await Deno.readTextFile(path)) as Record<string, unknown>;
54
+ return JSON.parse(await runtime.readTextFile(path)) as Record<string, unknown>;
54
55
  } catch (error) {
55
- if (error instanceof Deno.errors.NotFound) return null;
56
+ if (error instanceof runtime.errors.NotFound) return null;
56
57
  throw error;
57
58
  }
58
59
  }
@@ -80,7 +81,7 @@ for (const file of [...allowedRootTests].sort()) {
80
81
 
81
82
  for (const file of files.filter(isUnitTest).sort()) {
82
83
  if (allowedForbiddenPatternFiles.has(file)) continue;
83
- const text = await Deno.readTextFile(`${root}/${file}`);
84
+ const text = await runtime.readTextFile(`${root}/${file}`);
84
85
  for (const pattern of forbiddenUnitTestPatterns) {
85
86
  if (text.includes(pattern)) {
86
87
  violations.push(`${file}: unit test contains forbidden pattern ${JSON.stringify(pattern)}`);
@@ -97,7 +98,7 @@ for (const owner of config.requiredCriticalOwnerTests ?? []) {
97
98
  violations.push(`${owner.test}: critical source ${owner.source} requires this owner test`);
98
99
  continue;
99
100
  }
100
- const text = await Deno.readTextFile(`${root}/${owner.test}`);
101
+ const text = await runtime.readTextFile(`${root}/${owner.test}`);
101
102
  for (const marker of owner.markers ?? [])
102
103
  if (!text.includes(marker))
103
104
  violations.push(
@@ -128,4 +129,4 @@ if (config.requireCoverageScript ?? true) {
128
129
 
129
130
  console.log(`# unit test rule violations: ${violations.length}`);
130
131
  for (const violation of violations) console.log(`- ${violation}`);
131
- if (violations.length > 0) Deno.exit(1);
132
+ if (violations.length > 0) runtime.exit(1);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "unit-test-rules",
3
3
  "kind": "rule",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "requires": [
6
6
  "checker-runtime"
7
7
  ],
@@ -25,15 +25,13 @@
25
25
  "kind": "shared-markdown-section",
26
26
  "path": "AGENTS.md",
27
27
  "heading": "## Specdest rule: unit-test-rules",
28
- "body": "Use `.agents/skills/unit-test-rules/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/unit-test-rules/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/unit-test-rules/SKILL.md` when working in this rule area. Run `node .agents/skills/unit-test-rules/check.ts` before handoff."
29
29
  }
30
30
  ],
31
31
  "obsolete": [],
32
32
  "check": {
33
33
  "command": [
34
- "deno",
35
- "run",
36
- "--allow-read",
34
+ "node",
37
35
  ".agents/skills/unit-test-rules/check.ts"
38
36
  ]
39
37
  }
@@ -1,3 +1,4 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  // oxlint-disable no-console no-await-in-loop
2
3
  const violations: string[] = [];
3
4
  const requiredDataDisplayStories = ["Empty", "Loading", "MinimumData", "FullData"] as const;
@@ -55,7 +56,7 @@ const zodSchemaFactories = [
55
56
 
56
57
  async function exists(path: string): Promise<boolean> {
57
58
  try {
58
- await Deno.stat(path);
59
+ await runtime.stat(path);
59
60
  return true;
60
61
  } catch {
61
62
  return false;
@@ -64,7 +65,7 @@ async function exists(path: string): Promise<boolean> {
64
65
 
65
66
  async function* walk(dir: string): AsyncGenerator<string> {
66
67
  try {
67
- for await (const entry of Deno.readDir(dir)) {
68
+ for await (const entry of runtime.readDir(dir)) {
68
69
  const path = dir + "/" + entry.name;
69
70
  if (entry.isDirectory) yield* walk(path);
70
71
  if (entry.isFile) yield path;
@@ -259,7 +260,7 @@ async function readAllTests(root: string): Promise<string> {
259
260
  const texts: string[] = [];
260
261
  for await (const file of walk(root)) {
261
262
  if (file.endsWith(".test.ts") || file.endsWith(".test.tsx")) {
262
- texts.push(await Deno.readTextFile(file));
263
+ texts.push(await runtime.readTextFile(file));
263
264
  }
264
265
  }
265
266
  return texts.join("\n");
@@ -277,7 +278,7 @@ const routeTests = await readAllTests("src/routes");
277
278
 
278
279
  for await (const file of walk("src")) {
279
280
  if (isStorybookFile(file)) {
280
- const storyText = await Deno.readTextFile(file);
281
+ const storyText = await runtime.readTextFile(file);
281
282
  if (importsZod(storyText) || definesLocalZodSchema(storyText)) {
282
283
  violations.push(
283
284
  file +
@@ -296,8 +297,8 @@ for await (const file of walk("src")) {
296
297
  continue;
297
298
  }
298
299
 
299
- const sourceText = await Deno.readTextFile(file);
300
- const storyText = await Deno.readTextFile(storyPath);
300
+ const sourceText = await runtime.readTextFile(file);
301
+ const storyText = await runtime.readTextFile(storyPath);
301
302
  if (!/\bplay\s*:/u.test(storyText) && !/\.play\s*=/u.test(storyText)) {
302
303
  violations.push(storyPath + ": Storybook stories must include a play test");
303
304
  }
@@ -412,6 +413,6 @@ for await (const file of walk("src")) {
412
413
 
413
414
  if (violations.length) {
414
415
  console.error(violations.join("\n"));
415
- Deno.exit(1);
416
+ runtime.exit(1);
416
417
  }
417
418
  console.log("unit-test-rules ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "unit-test-rules-convex",
3
3
  "kind": "rule",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "requires": [
6
6
  "checker-runtime"
7
7
  ],
@@ -20,15 +20,13 @@
20
20
  "kind": "shared-markdown-section",
21
21
  "path": "AGENTS.md",
22
22
  "heading": "## Specdest backend rule: unit-test-rules",
23
- "body": "Use `.agents/skills/unit-test-rules/SKILL.md` for this backend-specific rule. Run `deno run --allow-read .agents/skills/unit-test-rules/check.ts` before handoff."
23
+ "body": "Use `.agents/skills/unit-test-rules/SKILL.md` for this backend-specific rule. Run `node .agents/skills/unit-test-rules/check.ts` before handoff."
24
24
  }
25
25
  ],
26
26
  "obsolete": [],
27
27
  "check": {
28
28
  "command": [
29
- "deno",
30
- "run",
31
- "--allow-read",
29
+ "node",
32
30
  ".agents/skills/unit-test-rules/check.ts"
33
31
  ]
34
32
  }