@orkestrel/scaffold 0.0.21 → 0.0.22

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 (68) hide show
  1. package/dist/bin/scaffold.js +371 -140
  2. package/dist/bin/scaffold.js.map +1 -1
  3. package/dist/host/AGENTS.md +61 -42
  4. package/dist/host/CLAUDE.md +39 -408
  5. package/dist/host/agents/orchestration.md +454 -0
  6. package/dist/host/agents/skills/enterprise-bootstrap/SKILL.md +25 -7
  7. package/dist/host/agents/skills/orkestrel-align-packages/SKILL.md +2 -2
  8. package/dist/host/agents/skills/orkestrel-build-application/SKILL.md +42 -31
  9. package/dist/host/agents/skills/orkestrel-build-application/references/application.md +129 -0
  10. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +3 -3
  11. package/dist/host/agents/skills/orkestrel-debrief/references/field-testing.md +2 -2
  12. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +167 -0
  13. package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +98 -0
  14. package/dist/host/agents/skills/orkestrel-falsify/references/reconcile.md +148 -0
  15. package/dist/host/agents/skills/orkestrel-harden-package/SKILL.md +4 -2
  16. package/dist/host/agents/skills/orkestrel-harden-package/references/centralization.md +5 -5
  17. package/dist/host/agents/skills/orkestrel-harden-package/references/research.md +2 -0
  18. package/dist/host/agents/skills/orkestrel-polish-surface/SKILL.md +11 -6
  19. package/dist/host/claude/agents/analyst.md +59 -0
  20. package/dist/host/claude/agents/application.md +1 -1
  21. package/dist/host/claude/agents/builder.md +1 -1
  22. package/dist/host/claude/agents/checker.md +5 -1
  23. package/dist/host/claude/agents/codex.md +120 -94
  24. package/dist/host/claude/agents/grok.md +44 -32
  25. package/dist/host/claude/agents/implementer.md +1 -1
  26. package/dist/host/claude/agents/orkestrel.md +1 -1
  27. package/dist/host/claude/agents/planner.md +9 -3
  28. package/dist/host/claude/agents/researcher.md +6 -5
  29. package/dist/host/claude/agents/reviewer.md +12 -6
  30. package/dist/host/claude/agents/scout.md +7 -4
  31. package/dist/host/claude/agents/verifier.md +1 -1
  32. package/dist/host/claude/rules/application.md +17 -16
  33. package/dist/host/claude/rules/architecture.md +41 -22
  34. package/dist/host/claude/rules/documentation.md +2 -1
  35. package/dist/host/claude/rules/names.md +7 -6
  36. package/dist/host/claude/rules/quality.md +65 -18
  37. package/dist/host/claude/rules/styles.md +1 -1
  38. package/dist/host/claude/rules/tests.md +12 -6
  39. package/dist/host/claude/rules/typescript.md +1 -1
  40. package/dist/host/claude/rules/workspace.md +6 -3
  41. package/dist/host/claude/settings.json +2 -0
  42. package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +10 -0
  43. package/dist/host/codex/agents/analyst.toml +13 -4
  44. package/dist/host/codex/agents/checker.toml +1 -1
  45. package/dist/host/codex/agents/grok.toml +2 -1
  46. package/dist/host/codex/agents/opus.toml +1 -1
  47. package/dist/host/codex/agents/planner.toml +1 -1
  48. package/dist/host/codex/agents/researcher.toml +2 -2
  49. package/dist/host/codex/agents/reviewer.toml +1 -1
  50. package/dist/host/codex/agents/scout.toml +2 -2
  51. package/dist/host/codex/config.toml +23 -70
  52. package/dist/host/cursor/rules/orchestration.mdc +33 -0
  53. package/dist/host/guides/src/scaffold.md +301 -123
  54. package/dist/host/manifest.json +47 -1
  55. package/dist/host/tests/setupPolicy.ts +83 -3
  56. package/dist/src/core/index.cjs +404 -63
  57. package/dist/src/core/index.cjs.map +1 -1
  58. package/dist/src/core/index.d.cts +119 -41
  59. package/dist/src/core/index.d.ts +119 -41
  60. package/dist/src/core/index.js +401 -64
  61. package/dist/src/core/index.js.map +1 -1
  62. package/dist/src/server/index.cjs +83 -33
  63. package/dist/src/server/index.cjs.map +1 -1
  64. package/dist/src/server/index.d.cts +32 -16
  65. package/dist/src/server/index.d.ts +32 -16
  66. package/dist/src/server/index.js +84 -35
  67. package/dist/src/server/index.js.map +1 -1
  68. package/package.json +4 -4
@@ -1,5 +1,10 @@
1
1
  {
2
2
  "entries": [
3
+ {
4
+ "storage": "agents/orchestration.md",
5
+ "destination": ".agents/orchestration.md",
6
+ "executable": false
7
+ },
3
8
  {
4
9
  "storage": "agents/skills/enterprise-bootstrap/SKILL.md",
5
10
  "destination": ".agents/skills/enterprise-bootstrap/SKILL.md",
@@ -60,6 +65,11 @@
60
65
  "destination": ".agents/skills/orkestrel-build-application/agents/openai.yaml",
61
66
  "executable": false
62
67
  },
68
+ {
69
+ "storage": "agents/skills/orkestrel-build-application/references/application.md",
70
+ "destination": ".agents/skills/orkestrel-build-application/references/application.md",
71
+ "executable": false
72
+ },
63
73
  {
64
74
  "storage": "agents/skills/orkestrel-debrief/SKILL.md",
65
75
  "destination": ".agents/skills/orkestrel-debrief/SKILL.md",
@@ -80,6 +90,21 @@
80
90
  "destination": ".agents/skills/orkestrel-debrief/references/instruction-audit.md",
81
91
  "executable": false
82
92
  },
93
+ {
94
+ "storage": "agents/skills/orkestrel-falsify/SKILL.md",
95
+ "destination": ".agents/skills/orkestrel-falsify/SKILL.md",
96
+ "executable": false
97
+ },
98
+ {
99
+ "storage": "agents/skills/orkestrel-falsify/references/brief.md",
100
+ "destination": ".agents/skills/orkestrel-falsify/references/brief.md",
101
+ "executable": false
102
+ },
103
+ {
104
+ "storage": "agents/skills/orkestrel-falsify/references/reconcile.md",
105
+ "destination": ".agents/skills/orkestrel-falsify/references/reconcile.md",
106
+ "executable": false
107
+ },
83
108
  {
84
109
  "storage": "agents/skills/orkestrel-harden-package/SKILL.md",
85
110
  "destination": ".agents/skills/orkestrel-harden-package/SKILL.md",
@@ -125,6 +150,11 @@
125
150
  "destination": ".agents/skills/orkestrel-polish-surface/references/capture-harness.md",
126
151
  "executable": false
127
152
  },
153
+ {
154
+ "storage": "claude/agents/analyst.md",
155
+ "destination": ".claude/agents/analyst.md",
156
+ "executable": false
157
+ },
128
158
  {
129
159
  "storage": "claude/agents/application.md",
130
160
  "destination": ".claude/agents/application.md",
@@ -265,6 +295,11 @@
265
295
  "destination": ".claude/skills/orkestrel-debrief/SKILL.md",
266
296
  "executable": false
267
297
  },
298
+ {
299
+ "storage": "claude/skills/orkestrel-falsify/SKILL.md",
300
+ "destination": ".claude/skills/orkestrel-falsify/SKILL.md",
301
+ "executable": false
302
+ },
268
303
  {
269
304
  "storage": "claude/skills/orkestrel-harden-package/SKILL.md",
270
305
  "destination": ".claude/skills/orkestrel-harden-package/SKILL.md",
@@ -350,6 +385,11 @@
350
385
  "destination": ".cursor/mcp.json",
351
386
  "executable": false
352
387
  },
388
+ {
389
+ "storage": "cursor/rules/orchestration.mdc",
390
+ "destination": ".cursor/rules/orchestration.mdc",
391
+ "executable": false
392
+ },
353
393
  {
354
394
  "storage": "dotfiles/editorconfig",
355
395
  "destination": ".editorconfig",
@@ -452,9 +492,12 @@
452
492
  ".agents/skills/orkestrel-align-packages/references",
453
493
  ".agents/skills/orkestrel-build-application",
454
494
  ".agents/skills/orkestrel-build-application/agents",
495
+ ".agents/skills/orkestrel-build-application/references",
455
496
  ".agents/skills/orkestrel-debrief",
456
497
  ".agents/skills/orkestrel-debrief/agents",
457
498
  ".agents/skills/orkestrel-debrief/references",
499
+ ".agents/skills/orkestrel-falsify",
500
+ ".agents/skills/orkestrel-falsify/references",
458
501
  ".agents/skills/orkestrel-harden-package",
459
502
  ".agents/skills/orkestrel-harden-package/agents",
460
503
  ".agents/skills/orkestrel-harden-package/references",
@@ -469,14 +512,17 @@
469
512
  ".claude/skills/orkestrel-align-packages",
470
513
  ".claude/skills/orkestrel-build-application",
471
514
  ".claude/skills/orkestrel-debrief",
515
+ ".claude/skills/orkestrel-falsify",
472
516
  ".claude/skills/orkestrel-harden-package",
473
517
  ".claude/skills/orkestrel-polish-surface",
474
518
  ".codex",
475
519
  ".codex/agents",
476
520
  ".cursor",
521
+ ".cursor/rules",
477
522
  "guides",
478
523
  "guides/src",
479
524
  "scripts",
480
525
  "tests"
481
- ]
526
+ ],
527
+ "digest": "e4351919e4d34e3696ee3ce77e2cce555c20acc58a29649cd9f3c489f3d0bf2b"
482
528
  }
@@ -1,6 +1,6 @@
1
1
  import { globSync, readFileSync } from 'node:fs'
2
2
  import { isBuiltin } from 'node:module'
3
- import { basename, join } from 'node:path'
3
+ import { basename, extname, join } from 'node:path'
4
4
  import * as ts from 'typescript'
5
5
 
6
6
  /** Centralized source modules whose top-level declarations must all be exported. */
@@ -60,6 +60,9 @@ export const DATA_SOURCE_FILES: readonly string[] = Object.freeze([
60
60
  'validators.ts',
61
61
  ])
62
62
 
63
+ /** Domain folders whose modules each export one named function rather than one class. */
64
+ export const FUNCTION_DOMAIN_FOLDERS: readonly string[] = Object.freeze(['app/browser/composables'])
65
+
63
66
  /** Worker-only value globals that WebWorker typing must not expose to core implementations. */
64
67
  export const WORKER_SCOPE_VALUE_GLOBALS: readonly string[] = Object.freeze([
65
68
  'name',
@@ -139,6 +142,28 @@ export function isCodingSourcePath(path: string): boolean {
139
142
  )
140
143
  }
141
144
 
145
+ /**
146
+ * Whether a path is an eligible function-domain module.
147
+ *
148
+ * @param path - The workspace-relative source path to inspect
149
+ * @returns `true` when the path is a direct module of a registered function domain
150
+ */
151
+ export function isFunctionDomainPath(path: string): boolean {
152
+ const normalized = normalizePolicyPath(path)
153
+ const file = basename(normalized)
154
+ const separator = normalized.lastIndexOf('/')
155
+ const parent = separator < 0 ? '' : normalized.slice(0, separator)
156
+ return (
157
+ FUNCTION_DOMAIN_FOLDERS.includes(parent) &&
158
+ /^[a-z][A-Za-z0-9]*\.ts$/u.test(file) &&
159
+ file !== 'index.ts' &&
160
+ file !== 'main.ts' &&
161
+ !CENTRAL_SOURCE_FILES.includes(file) &&
162
+ !FUNCTION_SOURCE_FILES.includes(file) &&
163
+ !DATA_SOURCE_FILES.includes(file)
164
+ )
165
+ }
166
+
142
167
  /** Whether a declaration carries an explicit export modifier. */
143
168
  export function hasExportModifier(node: ts.Node): boolean {
144
169
  return (
@@ -458,7 +483,16 @@ export function inspectCodingSource(
458
483
  if (!normalizedPath.startsWith('app/browser/')) {
459
484
  violations.push(`${normalizedPath} Vue components belong in app/browser`)
460
485
  }
461
- violations.push(...inspectVueCodingLaw(normalizedPath, vueScripts?.(normalizedPath, content)))
486
+ // A missing extractor is reported, never absorbed. Returning [] here would make
487
+ // every SFC's script block silently unchecked while the surrounding sweep still
488
+ // reported success — an instrument claiming a coverage it does not have.
489
+ if (vueScripts === undefined) {
490
+ violations.push(
491
+ `${normalizedPath} requires a Vue script extractor; its script blocks were not inspected`,
492
+ )
493
+ return violations
494
+ }
495
+ violations.push(...inspectVueCodingLaw(normalizedPath, vueScripts(normalizedPath, content)))
462
496
  return violations
463
497
  }
464
498
 
@@ -536,6 +570,34 @@ export function inspectCodingNode(
536
570
  ts.forEachChild(node, (child) => inspectCodingNode(path, child, violations, checker))
537
571
  }
538
572
 
573
+ /**
574
+ * Inspect one eligible function-domain module for its required declaration shape.
575
+ *
576
+ * @param path - The source path used in diagnostics
577
+ * @param source - The parsed source file to inspect
578
+ * @returns A shape violation when the module is not imports plus one matching named export
579
+ */
580
+ export function inspectFunctionModule(path: string, source: ts.SourceFile): readonly string[] {
581
+ const file = basename(normalizePolicyPath(path))
582
+ const declarations = source.statements.filter(ts.isFunctionDeclaration)
583
+ const functions = declarations.filter((declaration) => declaration.body !== undefined)
584
+ const invalid = source.statements.filter(
585
+ (statement) => !ts.isImportDeclaration(statement) && !ts.isFunctionDeclaration(statement),
586
+ )
587
+ const declaration = functions[0]
588
+ if (
589
+ functions.length === 1 &&
590
+ invalid.length === 0 &&
591
+ declarations.every((candidate) => candidate.name?.text === file.slice(0, -3)) &&
592
+ declaration !== undefined &&
593
+ hasExportModifier(declaration) &&
594
+ !hasModifier(declaration, ts.SyntaxKind.DefaultKeyword)
595
+ ) {
596
+ return []
597
+ }
598
+ return [`${path} declarations do not form one matching exported function implementation`]
599
+ }
600
+
539
601
  /** Inspect one TypeScript source module for repository coding-law violations. */
540
602
  export function inspectCodingLaw(path: string, content: string): readonly string[] {
541
603
  const violations: string[] = []
@@ -544,6 +606,8 @@ export function inspectCodingLaw(path: string, content: string): readonly string
544
606
  if (source === undefined) throw new Error(`Policy source was not bound at ${path}`)
545
607
  const checker = program.getTypeChecker()
546
608
  const file = basename(path)
609
+ const stem = basename(file, extname(file))
610
+ const functionModule = isFunctionDomainPath(path)
547
611
  const placementExempt =
548
612
  !CENTRAL_SOURCE_FILES.includes(file) &&
549
613
  !FUNCTION_SOURCE_FILES.includes(file) &&
@@ -553,6 +617,9 @@ export function inspectCodingLaw(path: string, content: string): readonly string
553
617
  if (/\.[cm]?jsx?$/u.test(path)) {
554
618
  violations.push(`${path} production modules use TypeScript source extensions`)
555
619
  }
620
+ if (FUNCTION_DOMAIN_FOLDERS.some((folder) => basename(folder) === stem)) {
621
+ violations.push(`${path} names a function domain, which belongs in a folder rather than a file`)
622
+ }
556
623
  if (/@ts-(?:expect-error|ignore|nocheck)|eslint-disable|oxlint-disable/u.test(content)) {
557
624
  violations.push(`${path} forbids suppression directives`)
558
625
  }
@@ -598,6 +665,7 @@ export function inspectCodingLaw(path: string, content: string): readonly string
598
665
  }
599
666
  if (
600
667
  !placementExempt &&
668
+ !functionModule &&
601
669
  ts.isFunctionDeclaration(statement) &&
602
670
  !FUNCTION_SOURCE_FILES.includes(file)
603
671
  ) {
@@ -605,6 +673,7 @@ export function inspectCodingLaw(path: string, content: string): readonly string
605
673
  }
606
674
  if (
607
675
  !placementExempt &&
676
+ !functionModule &&
608
677
  ts.isVariableStatement(statement) &&
609
678
  !DATA_SOURCE_FILES.includes(file)
610
679
  ) {
@@ -646,6 +715,10 @@ export function inspectCodingLaw(path: string, content: string): readonly string
646
715
  }
647
716
  }
648
717
 
718
+ if (functionModule) {
719
+ violations.push(...inspectFunctionModule(path, source))
720
+ }
721
+
649
722
  if (/^[A-Z][A-Za-z0-9]*\.ts$/u.test(file)) {
650
723
  const classes = source.statements.filter(ts.isClassDeclaration)
651
724
  const invalid = source.statements.filter(
@@ -673,7 +746,14 @@ export function inspectCodingLaw(path: string, content: string): readonly string
673
746
  return violations
674
747
  }
675
748
 
676
- /** Inspect every production source under one workspace. */
749
+ /**
750
+ * Inspect every production source under one workspace.
751
+ *
752
+ * @remarks
753
+ * `vueScripts` is required whenever the workspace contains a `.vue` file: script
754
+ * blocks cannot be read without it, and omitting it is reported as a violation
755
+ * against each SFC rather than passing silently.
756
+ */
677
757
  export function inspectCodingWorkspace(
678
758
  root: string,
679
759
  vueScripts?: VueScriptExtractorInterface,