@specdest/devkit 0.1.3 → 0.2.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 (66) hide show
  1. package/README.md +28 -0
  2. package/catalog/modules/checker-runtime/config.ts +4 -3
  3. package/catalog/modules/checker-runtime/fs.ts +4 -3
  4. package/catalog/modules/checker-runtime/manifest.json +6 -1
  5. package/catalog/modules/checker-runtime/runtime.ts +79 -0
  6. package/catalog/rules/abac-permissions-convex/check.ts +4 -3
  7. package/catalog/rules/abac-permissions-convex/manifest.json +3 -5
  8. package/catalog/rules/abac-permissions-supabase/check.ts +4 -3
  9. package/catalog/rules/abac-permissions-supabase/manifest.json +3 -5
  10. package/catalog/rules/convex-multi-presentation/SKILL.md +1 -2
  11. package/catalog/rules/convex-multi-presentation/check.ts +14 -80
  12. package/catalog/rules/convex-multi-presentation/manifest.json +13 -11
  13. package/catalog/rules/design-rules/check.ts +5 -4
  14. package/catalog/rules/design-rules/manifest.json +3 -5
  15. package/catalog/rules/e2e-test-rules/SKILL.md +1 -1
  16. package/catalog/rules/e2e-test-rules/check.ts +5 -4
  17. package/catalog/rules/e2e-test-rules/manifest.json +3 -5
  18. package/catalog/rules/error-handling-rules/check.ts +4 -3
  19. package/catalog/rules/error-handling-rules/manifest.json +3 -5
  20. package/catalog/rules/layers-and-contracts/check.ts +6 -5
  21. package/catalog/rules/layers-and-contracts/manifest.json +3 -5
  22. package/catalog/rules/layers-and-contracts-convex/check.ts +7 -6
  23. package/catalog/rules/layers-and-contracts-convex/manifest.json +3 -5
  24. package/catalog/rules/layers-and-contracts-supabase/check.ts +8 -7
  25. package/catalog/rules/layers-and-contracts-supabase/manifest.json +3 -5
  26. package/catalog/rules/module-size-rules/check.ts +9 -8
  27. package/catalog/rules/module-size-rules/manifest.json +3 -5
  28. package/catalog/rules/module-size-rules-convex/check.ts +9 -8
  29. package/catalog/rules/module-size-rules-convex/manifest.json +3 -5
  30. package/catalog/rules/module-size-rules-supabase/check.ts +9 -8
  31. package/catalog/rules/module-size-rules-supabase/manifest.json +3 -5
  32. package/catalog/rules/mutation-command-rules/check.ts +3 -2
  33. package/catalog/rules/mutation-command-rules/manifest.json +3 -5
  34. package/catalog/rules/nearby-contracts/SKILL.md +1 -1
  35. package/catalog/rules/nearby-contracts/check.ts +4 -3
  36. package/catalog/rules/nearby-contracts/manifest.json +3 -5
  37. package/catalog/rules/no-raw-click-buttons/check.ts +3 -2
  38. package/catalog/rules/no-raw-click-buttons/manifest.json +3 -5
  39. package/catalog/rules/public-api-export-barrels/SKILL.md +1 -1
  40. package/catalog/rules/public-api-export-barrels/check.ts +3 -2
  41. package/catalog/rules/public-api-export-barrels/manifest.json +3 -5
  42. package/catalog/rules/route-tree-fresh/check.ts +9 -7
  43. package/catalog/rules/route-tree-fresh/manifest.json +3 -5
  44. package/catalog/rules/strict-typescript/check.ts +16 -8
  45. package/catalog/rules/strict-typescript/manifest.json +3 -5
  46. package/catalog/rules/supabase-contracts/check.ts +10 -9
  47. package/catalog/rules/supabase-contracts/manifest.json +3 -5
  48. package/catalog/rules/supabase-declarative-schema/SKILL.md +1 -1
  49. package/catalog/rules/supabase-declarative-schema/check.ts +5 -4
  50. package/catalog/rules/supabase-declarative-schema/manifest.json +3 -5
  51. package/catalog/rules/tanstack-form-rules/SKILL.md +1 -1
  52. package/catalog/rules/tanstack-form-rules/check.ts +3 -2
  53. package/catalog/rules/tanstack-form-rules/manifest.json +3 -5
  54. package/catalog/rules/unit-test-rules/SKILL.md +1 -1
  55. package/catalog/rules/unit-test-rules/check.ts +6 -5
  56. package/catalog/rules/unit-test-rules/manifest.json +3 -5
  57. package/catalog/rules/unit-test-rules-convex/check.ts +8 -7
  58. package/catalog/rules/unit-test-rules-convex/manifest.json +3 -5
  59. package/catalog/rules/unit-test-rules-supabase/check.ts +7 -6
  60. package/catalog/rules/unit-test-rules-supabase/manifest.json +3 -5
  61. package/catalog/rules/workstation-controller-rules/check.ts +5 -4
  62. package/catalog/rules/workstation-controller-rules/manifest.json +3 -5
  63. package/package.json +20 -2
  64. package/src/project-operations.js +17 -14
  65. package/src/sync-core.js +78 -8
  66. package/catalog/rules/convex-multi-presentation/boundary-test-baseline.json +0 -3
@@ -1,3 +1,4 @@
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[] = [];
@@ -14,7 +15,7 @@ const sourceDirectories = ["src"];
14
15
 
15
16
  async function* walk(dir: string): AsyncGenerator<string> {
16
17
  try {
17
- for await (const entry of Deno.readDir(dir)) {
18
+ for await (const entry of runtime.readDir(dir)) {
18
19
  const path = `${dir}/${entry.name}`;
19
20
  if (ignoredDirectories.some((ignored) => path.startsWith(ignored))) {
20
21
  continue;
@@ -47,7 +48,7 @@ function lineNumber(text: string, index: number): number {
47
48
  for (const dir of sourceDirectories) {
48
49
  for await (const file of walk(dir)) {
49
50
  if (isAllowedRawErrorFile(file)) continue;
50
- const text = decoder.decode(await Deno.readFile(file));
51
+ const text = decoder.decode(await runtime.readFile(file));
51
52
  const rawErrorPattern = /throw\s+new\s+Error\s*\(/gu;
52
53
  for (const match of text.matchAll(rawErrorPattern)) {
53
54
  violations.push(
@@ -67,6 +68,6 @@ for (const dir of sourceDirectories) {
67
68
 
68
69
  if (violations.length) {
69
70
  console.error(violations.join("\n"));
70
- Deno.exit(1);
71
+ runtime.exit(1);
71
72
  }
72
73
  console.log("error-handling-rules ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "error-handling-rules",
3
3
  "kind": "rule",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
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: error-handling-rules",
23
- "body": "Use `.agents/skills/error-handling-rules/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/error-handling-rules/check.ts` before handoff."
23
+ "body": "Use `.agents/skills/error-handling-rules/SKILL.md` when working in this rule area. Run `node .agents/skills/error-handling-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/error-handling-rules/check.ts"
33
31
  ]
34
32
  }
@@ -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 && /\.(ts|tsx)$/.test(entry.name)) yield path;
@@ -117,7 +118,7 @@ async function hasRouteLocalDataHooks(file: string): Promise<boolean> {
117
118
  async function siblingPageControllerImportsDataHook(file: string): Promise<boolean> {
118
119
  const controller = file.replace(/\.tsx$/, ".controller.ts");
119
120
  if (!(await exists(controller))) return false;
120
- const text = decoder.decode(await Deno.readFile(controller));
121
+ const text = decoder.decode(await runtime.readFile(controller));
121
122
  return importsDataHook(text);
122
123
  }
123
124
 
@@ -155,7 +156,7 @@ for await (const file of walk("src/routes")) {
155
156
  if (file.endsWith(".form.schema.ts")) requireOperationSpecificFormName(file);
156
157
  if (!implementationFile(file)) continue;
157
158
 
158
- const text = decoder.decode(await Deno.readFile(file));
159
+ const text = decoder.decode(await runtime.readFile(file));
159
160
  const specs = importSpecs(text);
160
161
 
161
162
  for (const spec of specs) {
@@ -260,6 +261,6 @@ for await (const file of walk("src/routes")) {
260
261
 
261
262
  if (violations.length) {
262
263
  console.error(violations.join("\n"));
263
- Deno.exit(1);
264
+ runtime.exit(1);
264
265
  }
265
266
  console.log("layers-and-contracts ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "layers-and-contracts",
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: layers-and-contracts",
23
- "body": "Use `.agents/skills/layers-and-contracts/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/layers-and-contracts/check.ts` before handoff."
23
+ "body": "Use `.agents/skills/layers-and-contracts/SKILL.md` when working in this rule area. Run `node .agents/skills/layers-and-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/layers-and-contracts/check.ts"
33
31
  ]
34
32
  }
@@ -1,3 +1,4 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  import { runtimeBoundarySchemaUsageViolations } from "./policy.ts";
2
3
 
3
4
  // oxlint-disable no-console no-await-in-loop
@@ -6,7 +7,7 @@ const violations: string[] = [];
6
7
 
7
8
  async function exists(path: string): Promise<boolean> {
8
9
  try {
9
- await Deno.stat(path);
10
+ await runtime.stat(path);
10
11
  return true;
11
12
  } catch {
12
13
  return false;
@@ -15,7 +16,7 @@ async function exists(path: string): Promise<boolean> {
15
16
 
16
17
  async function* walk(dir: string): AsyncGenerator<string> {
17
18
  try {
18
- for await (const entry of Deno.readDir(dir)) {
19
+ for await (const entry of runtime.readDir(dir)) {
19
20
  const path = `${dir}/${entry.name}`;
20
21
  if (entry.isDirectory) yield* walk(path);
21
22
  if (entry.isFile && /\.(ts|tsx)$/.test(entry.name)) yield path;
@@ -119,7 +120,7 @@ async function hasRouteLocalDataHooks(file: string): Promise<boolean> {
119
120
  async function siblingPageControllerImportsDataHook(file: string): Promise<boolean> {
120
121
  const controller = file.replace(/\.tsx$/, ".controller.ts");
121
122
  if (!(await exists(controller))) return false;
122
- const text = decoder.decode(await Deno.readFile(controller));
123
+ const text = decoder.decode(await runtime.readFile(controller));
123
124
  return importsDataHook(text);
124
125
  }
125
126
 
@@ -138,7 +139,7 @@ async function requireRuntimeBoundarySchemaUsage(
138
139
  const schemaFile = file.replace(/\.(ts|tsx)$/u, `.${kind}.schema.ts`);
139
140
  if (!(await exists(schemaFile))) return;
140
141
  const implementationName = baseName(file).replace(/\.(ts|tsx)$/u, "");
141
- const schemaText = await Deno.readTextFile(schemaFile);
142
+ const schemaText = await runtime.readTextFile(schemaFile);
142
143
  for (const violation of runtimeBoundarySchemaUsageViolations({
143
144
  expectedImportSpec: `./${implementationName}.${kind}.schema`,
144
145
  implementationText: text,
@@ -176,7 +177,7 @@ for await (const file of walk("src/routes")) {
176
177
  if (file.endsWith(".form.schema.ts")) requireOperationSpecificFormName(file);
177
178
  if (!implementationFile(file)) continue;
178
179
 
179
- const text = decoder.decode(await Deno.readFile(file));
180
+ const text = decoder.decode(await runtime.readFile(file));
180
181
  const specs = importSpecs(text);
181
182
 
182
183
  for (const spec of specs) {
@@ -283,6 +284,6 @@ for await (const file of walk("src/routes")) {
283
284
 
284
285
  if (violations.length) {
285
286
  console.error(violations.join("\n"));
286
- Deno.exit(1);
287
+ runtime.exit(1);
287
288
  }
288
289
  console.log("layers-and-contracts ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "layers-and-contracts-convex",
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 backend rule: layers-and-contracts",
28
- "body": "Use `.agents/skills/layers-and-contracts/SKILL.md` for this backend-specific rule. Run `deno run --allow-read .agents/skills/layers-and-contracts/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/layers-and-contracts/SKILL.md` for this backend-specific rule. Run `node .agents/skills/layers-and-contracts/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/layers-and-contracts/check.ts"
38
36
  ]
39
37
  }
@@ -1,3 +1,4 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  import { runtimeBoundarySchemaUsageViolations } from "./policy.ts";
2
3
 
3
4
  // oxlint-disable no-console no-await-in-loop
@@ -6,7 +7,7 @@ const violations: string[] = [];
6
7
 
7
8
  async function exists(path: string): Promise<boolean> {
8
9
  try {
9
- await Deno.stat(path);
10
+ await runtime.stat(path);
10
11
  return true;
11
12
  } catch {
12
13
  return false;
@@ -15,7 +16,7 @@ async function exists(path: string): Promise<boolean> {
15
16
 
16
17
  async function* walk(dir: string): AsyncGenerator<string> {
17
18
  try {
18
- for await (const entry of Deno.readDir(dir)) {
19
+ for await (const entry of runtime.readDir(dir)) {
19
20
  const path = `${dir}/${entry.name}`;
20
21
  if (entry.isDirectory) yield* walk(path);
21
22
  if (entry.isFile && /\.(ts|tsx)$/.test(entry.name)) yield path;
@@ -174,7 +175,7 @@ async function requireRuntimeBoundarySchemaUsage(
174
175
  const schemaFile = file.replace(/\.(ts|tsx)$/u, `.${kind}.schema.ts`);
175
176
  if (!(await exists(schemaFile))) return;
176
177
  const implementationName = baseName(file).replace(/\.(ts|tsx)$/u, "");
177
- const schemaText = await Deno.readTextFile(schemaFile);
178
+ const schemaText = await runtime.readTextFile(schemaFile);
178
179
  for (const violation of runtimeBoundarySchemaUsageViolations({
179
180
  expectedImportSpec: `./${implementationName}.${kind}.schema`,
180
181
  implementationText: text,
@@ -218,7 +219,7 @@ for await (const file of walk(routeRoot ?? "src/routes")) {
218
219
  if (file.endsWith(".form.schema.ts")) requireOperationSpecificFormName(file);
219
220
  if (!implementationFile(file)) continue;
220
221
 
221
- const text = decoder.decode(await Deno.readFile(file));
222
+ const text = decoder.decode(await runtime.readFile(file));
222
223
  const specs = importSpecs(text);
223
224
 
224
225
  for (const spec of specs) {
@@ -319,7 +320,7 @@ for await (const file of walk(routeRoot ?? "src/routes")) {
319
320
  for await (const file of walk("src/application")) {
320
321
  if (!implementationFile(file)) continue;
321
322
 
322
- const text = decoder.decode(await Deno.readFile(file));
323
+ const text = decoder.decode(await runtime.readFile(file));
323
324
  forbid(/@\/routes\//.test(text), file, "application must not import route-layer code");
324
325
  forbid(/@\/components\//.test(text), file, "application must not import UI components");
325
326
  forbid(
@@ -344,7 +345,7 @@ for await (const file of walk("src/application")) {
344
345
  for await (const file of walk("src/dal")) {
345
346
  if (!implementationFile(file)) continue;
346
347
 
347
- const text = decoder.decode(await Deno.readFile(file));
348
+ const text = decoder.decode(await runtime.readFile(file));
348
349
  forbid(/@\/routes\//.test(text), file, "DAL must not import route-layer code");
349
350
  forbid(/@\/components\//.test(text), file, "DAL must not import UI components");
350
351
 
@@ -365,6 +366,6 @@ for await (const file of walk("src/dal")) {
365
366
 
366
367
  if (violations.length) {
367
368
  console.error(violations.join("\n"));
368
- Deno.exit(1);
369
+ runtime.exit(1);
369
370
  }
370
371
  console.log("layers-and-contracts ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "layers-and-contracts-supabase",
3
3
  "kind": "rule",
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
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: layers-and-contracts",
28
- "body": "Use `.agents/skills/layers-and-contracts/SKILL.md` for this backend-specific rule. Run `deno run --allow-read .agents/skills/layers-and-contracts/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/layers-and-contracts/SKILL.md` for this backend-specific rule. Run `node .agents/skills/layers-and-contracts/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/layers-and-contracts/check.ts"
38
36
  ]
39
37
  }
@@ -1,11 +1,12 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  const textEncoder = new TextEncoder();
2
3
 
3
4
  function writeLine(message: string): void {
4
- Deno.stdout.writeSync(textEncoder.encode(`${message}\n`));
5
+ runtime.stdout.writeSync(textEncoder.encode(`${message}\n`));
5
6
  }
6
7
 
7
8
  function writeError(message: string): void {
8
- Deno.stderr.writeSync(textEncoder.encode(`${message}\n`));
9
+ runtime.stderr.writeSync(textEncoder.encode(`${message}\n`));
9
10
  }
10
11
 
11
12
  type ModuleSizeConfig = {
@@ -15,7 +16,7 @@ type ModuleSizeConfig = {
15
16
  readonly ignoredGlobs?: readonly string[];
16
17
  };
17
18
 
18
- const root = Deno.cwd();
19
+ const root = runtime.cwd();
19
20
  const config = await readConfig();
20
21
  const maxFileLines = Number(config.maxFileLines ?? 260);
21
22
  const maxComponentLines = Number(config.maxComponentLines ?? 180);
@@ -36,7 +37,7 @@ const errors: string[] = [];
36
37
  async function readConfig(): Promise<ModuleSizeConfig> {
37
38
  try {
38
39
  const parsed = JSON.parse(
39
- await Deno.readTextFile(".agents/skills/module-size-rules/config.json"),
40
+ await runtime.readTextFile(".agents/skills/module-size-rules/config.json"),
40
41
  ) as ModuleSizeConfig;
41
42
  return parsed;
42
43
  } catch {
@@ -111,7 +112,7 @@ function functionLineViolations(rel: string, text: string): string[] {
111
112
 
112
113
  async function walk(dir: string): Promise<void> {
113
114
  try {
114
- for await (const ent of Deno.readDir(dir)) {
115
+ for await (const ent of runtime.readDir(dir)) {
115
116
  const p = `${dir}/${ent.name}`;
116
117
  if (ent.isDirectory) {
117
118
  if (!["node_modules", ".git", "dist", "coverage", "code-templates"].includes(ent.name)) {
@@ -120,7 +121,7 @@ async function walk(dir: string): Promise<void> {
120
121
  } else if (/\.(ts|tsx)$/u.test(ent.name)) {
121
122
  const rel = toRelative(p);
122
123
  if (shouldIgnore(rel)) continue;
123
- const text = await Deno.readTextFile(p);
124
+ const text = await runtime.readTextFile(p);
124
125
  const lines = text.split(/\r?\n/u).length;
125
126
  const limit = rel.endsWith(".tsx") ? maxComponentLines : maxFileLines;
126
127
  if (lines > limit) {
@@ -130,7 +131,7 @@ async function walk(dir: string): Promise<void> {
130
131
  }
131
132
  }
132
133
  } catch (error) {
133
- if (!(error instanceof Deno.errors.NotFound)) throw error;
134
+ if (!(error instanceof runtime.errors.NotFound)) throw error;
134
135
  }
135
136
  }
136
137
 
@@ -138,6 +139,6 @@ await walk(`${root}/src`);
138
139
  await walk(`${root}/.agents/skills`);
139
140
  if (errors.length > 0) {
140
141
  writeError(errors.join("\n"));
141
- Deno.exit(1);
142
+ runtime.exit(1);
142
143
  }
143
144
  writeLine("module-size-rules ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "module-size-rules",
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 rule: module-size-rules",
28
- "body": "Use `.agents/skills/module-size-rules/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/module-size-rules/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/module-size-rules/SKILL.md` when working in this rule area. Run `node .agents/skills/module-size-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/module-size-rules/check.ts"
38
36
  ]
39
37
  }
@@ -1,11 +1,12 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  const textEncoder = new TextEncoder();
2
3
 
3
4
  function writeLine(message: string): void {
4
- Deno.stdout.writeSync(textEncoder.encode(`${message}\n`));
5
+ runtime.stdout.writeSync(textEncoder.encode(`${message}\n`));
5
6
  }
6
7
 
7
8
  function writeError(message: string): void {
8
- Deno.stderr.writeSync(textEncoder.encode(`${message}\n`));
9
+ runtime.stderr.writeSync(textEncoder.encode(`${message}\n`));
9
10
  }
10
11
 
11
12
  type ModuleSizeConfig = {
@@ -15,7 +16,7 @@ type ModuleSizeConfig = {
15
16
  readonly ignoredGlobs?: readonly string[];
16
17
  };
17
18
 
18
- const root = Deno.cwd();
19
+ const root = runtime.cwd();
19
20
  const config = await readConfig();
20
21
  const maxFileLines = Number(config.maxFileLines ?? 260);
21
22
  const maxComponentLines = Number(config.maxComponentLines ?? 180);
@@ -37,7 +38,7 @@ const errors: string[] = [];
37
38
  async function readConfig(): Promise<ModuleSizeConfig> {
38
39
  try {
39
40
  const parsed = JSON.parse(
40
- await Deno.readTextFile(".agents/skills/module-size-rules/config.json"),
41
+ await runtime.readTextFile(".agents/skills/module-size-rules/config.json"),
41
42
  ) as ModuleSizeConfig;
42
43
  return parsed;
43
44
  } catch {
@@ -112,7 +113,7 @@ function functionLineViolations(rel: string, text: string): string[] {
112
113
 
113
114
  async function walk(dir: string): Promise<void> {
114
115
  try {
115
- for await (const ent of Deno.readDir(dir)) {
116
+ for await (const ent of runtime.readDir(dir)) {
116
117
  const p = `${dir}/${ent.name}`;
117
118
  if (ent.isDirectory) {
118
119
  if (!["node_modules", ".git", "dist", "coverage", "code-templates"].includes(ent.name)) {
@@ -121,7 +122,7 @@ async function walk(dir: string): Promise<void> {
121
122
  } else if (/\.(ts|tsx)$/u.test(ent.name)) {
122
123
  const rel = toRelative(p);
123
124
  if (shouldIgnore(rel)) continue;
124
- const text = await Deno.readTextFile(p);
125
+ const text = await runtime.readTextFile(p);
125
126
  const lines = text.split(/\r?\n/u).length;
126
127
  const limit = rel.endsWith(".tsx") ? maxComponentLines : maxFileLines;
127
128
  if (lines > limit) {
@@ -131,7 +132,7 @@ async function walk(dir: string): Promise<void> {
131
132
  }
132
133
  }
133
134
  } catch (error) {
134
- if (!(error instanceof Deno.errors.NotFound)) throw error;
135
+ if (!(error instanceof runtime.errors.NotFound)) throw error;
135
136
  }
136
137
  }
137
138
 
@@ -140,6 +141,6 @@ await walk(`${root}/convex`);
140
141
  await walk(`${root}/.agents/skills`);
141
142
  if (errors.length > 0) {
142
143
  writeError(errors.join("\n"));
143
- Deno.exit(1);
144
+ runtime.exit(1);
144
145
  }
145
146
  writeLine("module-size-rules ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "module-size-rules-convex",
3
3
  "kind": "rule",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
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: module-size-rules",
28
- "body": "Use `.agents/skills/module-size-rules/SKILL.md` for this backend-specific rule. Run `deno run --allow-read .agents/skills/module-size-rules/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/module-size-rules/SKILL.md` for this backend-specific rule. Run `node .agents/skills/module-size-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/module-size-rules/check.ts"
38
36
  ]
39
37
  }
@@ -1,11 +1,12 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  const textEncoder = new TextEncoder();
2
3
 
3
4
  function writeLine(message: string): void {
4
- Deno.stdout.writeSync(textEncoder.encode(`${message}\n`));
5
+ runtime.stdout.writeSync(textEncoder.encode(`${message}\n`));
5
6
  }
6
7
 
7
8
  function writeError(message: string): void {
8
- Deno.stderr.writeSync(textEncoder.encode(`${message}\n`));
9
+ runtime.stderr.writeSync(textEncoder.encode(`${message}\n`));
9
10
  }
10
11
 
11
12
  type ModuleSizeConfig = {
@@ -15,7 +16,7 @@ type ModuleSizeConfig = {
15
16
  readonly ignoredGlobs?: readonly string[];
16
17
  };
17
18
 
18
- const root = Deno.cwd();
19
+ const root = runtime.cwd();
19
20
  const config = await readConfig();
20
21
  const maxFileLines = Number(config.maxFileLines ?? 260);
21
22
  const maxComponentLines = Number(config.maxComponentLines ?? 180);
@@ -38,7 +39,7 @@ const errors: string[] = [];
38
39
  async function readConfig(): Promise<ModuleSizeConfig> {
39
40
  try {
40
41
  const parsed = JSON.parse(
41
- await Deno.readTextFile(".agents/skills/module-size-rules/config.json"),
42
+ await runtime.readTextFile(".agents/skills/module-size-rules/config.json"),
42
43
  ) as ModuleSizeConfig;
43
44
  return parsed;
44
45
  } catch {
@@ -113,7 +114,7 @@ function functionLineViolations(rel: string, text: string): string[] {
113
114
 
114
115
  async function walk(dir: string): Promise<void> {
115
116
  try {
116
- for await (const ent of Deno.readDir(dir)) {
117
+ for await (const ent of runtime.readDir(dir)) {
117
118
  const p = `${dir}/${ent.name}`;
118
119
  if (ent.isDirectory) {
119
120
  if (!["node_modules", ".git", "dist", "coverage", "code-templates"].includes(ent.name)) {
@@ -122,7 +123,7 @@ async function walk(dir: string): Promise<void> {
122
123
  } else if (/\.(ts|tsx)$/u.test(ent.name)) {
123
124
  const rel = toRelative(p);
124
125
  if (shouldIgnore(rel)) continue;
125
- const text = await Deno.readTextFile(p);
126
+ const text = await runtime.readTextFile(p);
126
127
  const lines = text.split(/\r?\n/u).length;
127
128
  const limit = rel.endsWith(".tsx") ? maxComponentLines : maxFileLines;
128
129
  if (lines > limit) {
@@ -132,7 +133,7 @@ async function walk(dir: string): Promise<void> {
132
133
  }
133
134
  }
134
135
  } catch (error) {
135
- if (!(error instanceof Deno.errors.NotFound)) throw error;
136
+ if (!(error instanceof runtime.errors.NotFound)) throw error;
136
137
  }
137
138
  }
138
139
 
@@ -140,6 +141,6 @@ await walk(`${root}/src`);
140
141
  await walk(`${root}/.agents/skills`);
141
142
  if (errors.length > 0) {
142
143
  writeError(errors.join("\n"));
143
- Deno.exit(1);
144
+ runtime.exit(1);
144
145
  }
145
146
  writeLine("module-size-rules ok");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "module-size-rules-supabase",
3
3
  "kind": "rule",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
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: module-size-rules",
28
- "body": "Use `.agents/skills/module-size-rules/SKILL.md` for this backend-specific rule. Run `deno run --allow-read .agents/skills/module-size-rules/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/module-size-rules/SKILL.md` for this backend-specific rule. Run `node .agents/skills/module-size-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/module-size-rules/check.ts"
38
36
  ]
39
37
  }
@@ -1,3 +1,4 @@
1
+ import { runtime } from "../shared/runtime.ts";
1
2
  import { assertSchemaVersion, readSkillConfig } from "../shared/config.ts";
2
3
  import { exists } from "../shared/fs.ts";
3
4
 
@@ -12,7 +13,7 @@ for (const boundary of config.boundaries) {
12
13
  violations.push(`${boundary.file}: configured mutation boundary is missing`);
13
14
  continue;
14
15
  }
15
- const text = await Deno.readTextFile(path);
16
+ const text = await runtime.readTextFile(path);
16
17
  for (const marker of boundary.requiredMarkers ?? [])
17
18
  if (!text.includes(marker))
18
19
  violations.push(
@@ -26,4 +27,4 @@ for (const boundary of config.boundaries) {
26
27
  }
27
28
  console.log(`# mutation command rule violations: ${violations.length}`);
28
29
  for (const violation of violations) console.log(`- ${violation}`);
29
- if (violations.length > 0) Deno.exit(1);
30
+ if (violations.length > 0) runtime.exit(1);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "mutation-command-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: mutation-command-rules",
28
- "body": "Use `.agents/skills/mutation-command-rules/SKILL.md` when working in this rule area. Run `deno run --allow-read .agents/skills/mutation-command-rules/check.ts` before handoff."
28
+ "body": "Use `.agents/skills/mutation-command-rules/SKILL.md` when working in this rule area. Run `node .agents/skills/mutation-command-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/mutation-command-rules/check.ts"
38
36
  ]
39
37
  }
@@ -12,7 +12,7 @@ Boundary-specific contracts such as `*.input.schema.ts`, `*.output.schema.ts`, `
12
12
  ## Check
13
13
 
14
14
  ```bash
15
- deno run --allow-read .agents/skills/nearby-contracts/check.ts
15
+ node .agents/skills/nearby-contracts/check.ts
16
16
  ```
17
17
 
18
18
  Configuration lives in `./config.json` in this skill folder. Keep exceptions explicit and small.