@bleedingdev/modern-js-create 3.4.0-ultramodern.12 → 3.4.0-ultramodern.13

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 (104) hide show
  1. package/README.md +13 -11
  2. package/dist/cjs/index.cjs +36 -3
  3. package/dist/cjs/locale/en.cjs +10 -0
  4. package/dist/cjs/locale/zh.cjs +10 -0
  5. package/dist/cjs/ultramodern-tooling/commands.cjs +185 -0
  6. package/dist/cjs/ultramodern-tooling/config.cjs +248 -0
  7. package/dist/cjs/ultramodern-workspace/add-vertical.cjs +39 -18
  8. package/dist/cjs/ultramodern-workspace/bridge-config.cjs +327 -0
  9. package/dist/cjs/ultramodern-workspace/codesmith.cjs +1 -0
  10. package/dist/cjs/ultramodern-workspace/contracts.cjs +119 -653
  11. package/dist/cjs/ultramodern-workspace/descriptors.cjs +4 -0
  12. package/dist/cjs/ultramodern-workspace/generation-result.cjs +1 -1
  13. package/dist/cjs/ultramodern-workspace/index.cjs +4 -0
  14. package/dist/cjs/ultramodern-workspace/mf-validation.cjs +572 -0
  15. package/dist/cjs/ultramodern-workspace/module-federation.cjs +14 -0
  16. package/dist/cjs/ultramodern-workspace/package-json.cjs +26 -12
  17. package/dist/cjs/ultramodern-workspace/public-api.cjs +4 -0
  18. package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +74 -44
  19. package/dist/cjs/ultramodern-workspace/write-workspace.cjs +37 -8
  20. package/dist/esm/index.js +36 -3
  21. package/dist/esm/locale/en.js +10 -0
  22. package/dist/esm/locale/zh.js +10 -0
  23. package/dist/esm/ultramodern-tooling/commands.js +132 -0
  24. package/dist/esm/ultramodern-tooling/config.js +196 -0
  25. package/dist/esm/ultramodern-workspace/add-vertical.js +39 -21
  26. package/dist/esm/ultramodern-workspace/bridge-config.js +270 -0
  27. package/dist/esm/ultramodern-workspace/codesmith.js +1 -0
  28. package/dist/esm/ultramodern-workspace/contracts.js +122 -608
  29. package/dist/esm/ultramodern-workspace/descriptors.js +2 -1
  30. package/dist/esm/ultramodern-workspace/generation-result.js +2 -2
  31. package/dist/esm/ultramodern-workspace/index.js +1 -0
  32. package/dist/esm/ultramodern-workspace/mf-validation.js +517 -0
  33. package/dist/esm/ultramodern-workspace/module-federation.js +14 -0
  34. package/dist/esm/ultramodern-workspace/package-json.js +26 -12
  35. package/dist/esm/ultramodern-workspace/public-api.js +1 -0
  36. package/dist/esm/ultramodern-workspace/workspace-scripts.js +75 -27
  37. package/dist/esm/ultramodern-workspace/write-workspace.js +38 -12
  38. package/dist/esm-node/index.js +36 -3
  39. package/dist/esm-node/locale/en.js +10 -0
  40. package/dist/esm-node/locale/zh.js +10 -0
  41. package/dist/esm-node/ultramodern-tooling/commands.js +133 -0
  42. package/dist/esm-node/ultramodern-tooling/config.js +197 -0
  43. package/dist/esm-node/ultramodern-workspace/add-vertical.js +39 -21
  44. package/dist/esm-node/ultramodern-workspace/bridge-config.js +271 -0
  45. package/dist/esm-node/ultramodern-workspace/codesmith.js +1 -0
  46. package/dist/esm-node/ultramodern-workspace/contracts.js +122 -608
  47. package/dist/esm-node/ultramodern-workspace/descriptors.js +2 -1
  48. package/dist/esm-node/ultramodern-workspace/generation-result.js +2 -2
  49. package/dist/esm-node/ultramodern-workspace/index.js +1 -0
  50. package/dist/esm-node/ultramodern-workspace/mf-validation.js +518 -0
  51. package/dist/esm-node/ultramodern-workspace/module-federation.js +14 -0
  52. package/dist/esm-node/ultramodern-workspace/package-json.js +26 -12
  53. package/dist/esm-node/ultramodern-workspace/public-api.js +1 -0
  54. package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +75 -27
  55. package/dist/esm-node/ultramodern-workspace/write-workspace.js +38 -12
  56. package/dist/types/locale/en.d.ts +10 -0
  57. package/dist/types/locale/index.d.ts +20 -0
  58. package/dist/types/locale/zh.d.ts +10 -0
  59. package/dist/types/ultramodern-tooling/commands.d.ts +1 -0
  60. package/dist/types/ultramodern-tooling/config.d.ts +43 -0
  61. package/dist/types/ultramodern-workspace/add-vertical.d.ts +5 -2
  62. package/dist/types/ultramodern-workspace/bridge-config.d.ts +64 -0
  63. package/dist/types/ultramodern-workspace/codesmith.d.ts +1 -0
  64. package/dist/types/ultramodern-workspace/contracts.d.ts +2 -17
  65. package/dist/types/ultramodern-workspace/descriptors.d.ts +1 -0
  66. package/dist/types/ultramodern-workspace/index.d.ts +2 -0
  67. package/dist/types/ultramodern-workspace/mf-validation.d.ts +27 -0
  68. package/dist/types/ultramodern-workspace/package-json.d.ts +4 -3
  69. package/dist/types/ultramodern-workspace/public-api.d.ts +2 -0
  70. package/dist/types/ultramodern-workspace/types.d.ts +2 -0
  71. package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +1 -7
  72. package/dist/types/ultramodern-workspace/write-workspace.d.ts +4 -2
  73. package/package.json +3 -3
  74. package/template-workspace/{.agents → .codex}/skills-lock.json +12 -12
  75. package/template-workspace/.gitignore.handlebars +3 -0
  76. package/template-workspace/AGENTS.md.handlebars +11 -5
  77. package/template-workspace/README.md.handlebars +15 -12
  78. package/template-workspace/oxfmt.config.ts +1 -0
  79. package/template-workspace/oxlint.config.ts +1 -0
  80. package/template-workspace/scripts/bootstrap-agent-skills.mjs +77 -67
  81. package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +56 -3
  82. package/templates/workspace-scripts/generate-public-surface-assets.mjs +239 -4
  83. package/templates/workspace-scripts/proof-cloudflare-version.mjs +282 -4
  84. package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +172 -1
  85. package/templates/workspace-scripts/ultramodern-typecheck.mjs +4 -2
  86. package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +783 -26
  87. /package/template-workspace/{.agents → .codex}/rstackjs-agent-skills-LICENSE +0 -0
  88. /package/template-workspace/{.agents → .codex}/skills/rsbuild-best-practices/SKILL.md +0 -0
  89. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/SKILL.md +0 -0
  90. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/command-map.md +0 -0
  91. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/common-analysis-patterns.md +0 -0
  92. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +0 -0
  93. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +0 -0
  94. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +0 -0
  95. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor.md +0 -0
  96. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +0 -0
  97. /package/template-workspace/{.agents → .codex}/skills/rslib-best-practices/SKILL.md +0 -0
  98. /package/template-workspace/{.agents → .codex}/skills/rslib-modern-package/SKILL.md +0 -0
  99. /package/template-workspace/{.agents → .codex}/skills/rspack-best-practices/SKILL.md +0 -0
  100. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/SKILL.md +0 -0
  101. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/bottlenecks.md +0 -0
  102. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/tracing-guide.md +0 -0
  103. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/scripts/analyze_trace.js +0 -0
  104. /package/template-workspace/{.agents → .codex}/skills/rstest-best-practices/SKILL.md +0 -0
@@ -1,3 +1,5 @@
1
1
  export { addUltramodernVertical, planUltramodernVertical, } from './add-vertical';
2
+ export type { UltramodernBridgeConfig, UltramodernBridgeConfigInput, UltramodernBridgeGate, UltramodernBridgeGateInput, UltramodernBridgeLockfilePolicy, UltramodernBridgeTestAlias, UltramodernBridgeWorkspacePackage, UltramodernBridgeWorkspacePackageInput, UltramodernEnabledBridgeConfigInput, } from './bridge-config';
3
+ export { normalizeUltramodernBridgeConfig } from './bridge-config';
2
4
  export type { AddUltramodernVerticalOptions, UltramodernCodeSmithOverlay, UltramodernCodeSmithOverlayRuntimeConfig, UltramodernGeneratedAppDescriptor, UltramodernGeneratedContractChange, UltramodernGenerationOperation, UltramodernGenerationResult, UltramodernGenerationWarning, UltramodernJsonMutation, UltramodernShellDependencyChange, UltramodernVerticalPlan, UltramodernWorkspaceOptions, } from './types';
3
5
  export { generateUltramodernWorkspace } from './write-workspace';
@@ -1,4 +1,5 @@
1
1
  import type { ResolvedUltramodernPackageSource, UltramodernPackageSourceStrategy } from '../ultramodern-package-source';
2
+ import type { UltramodernBridgeConfigInput } from './bridge-config';
2
3
  export type JsonValue = string | number | boolean | null | JsonValue[] | {
3
4
  [key: string]: JsonValue;
4
5
  };
@@ -78,6 +79,7 @@ export type UltramodernWorkspaceOptions = {
78
79
  modernVersion: string;
79
80
  enableTailwind?: boolean;
80
81
  overlays?: UltramodernCodeSmithOverlay[];
82
+ bridge?: UltramodernBridgeConfigInput;
81
83
  packageSource?: {
82
84
  strategy?: UltramodernPackageSourceStrategy;
83
85
  modernPackageVersion?: string;
@@ -1,11 +1,5 @@
1
1
  import type { WorkspaceApp } from './types';
2
- export declare function createAssertMfTypesScript(remotes?: WorkspaceApp[]): string;
3
2
  export declare function createWorkspaceValidationScript(scope: string, enableTailwind: boolean, remotes?: WorkspaceApp[]): string;
4
3
  export declare function createWorkspaceI18nBoundaryValidationScript(): string;
5
- export declare function createPublicSurfaceAssetsScript(): string;
6
- export declare function createCloudflareProofHelperScript(): string;
7
- export declare function createCloudflareVersionProofScript(): string;
8
4
  export declare function createPerformanceReadinessConfigScript(): string;
9
- export declare function createPerformanceReadinessScript(): string;
10
- export declare function createUltramodernTypecheckScript(): string;
11
- export declare function writeGeneratedWorkspaceScripts(targetDir: string, scope: string, enableTailwind: boolean, remotes?: WorkspaceApp[]): void;
5
+ export declare function writeGeneratedWorkspaceScripts(targetDir: string, _scope: string, _enableTailwind: boolean, _remotes?: WorkspaceApp[]): void;
@@ -1,4 +1,6 @@
1
- import type { ResolvedPackageSource, UltramodernGenerationResult, UltramodernWorkspaceOptions, WorkspaceApp } from './types';
2
- export declare function writeApp(targetDir: string, scope: string, app: WorkspaceApp, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes?: WorkspaceApp[]): void;
1
+ import type { UltramodernBridgeConfig } from './bridge-config';
2
+ import type { JsonValue, ResolvedPackageSource, UltramodernGenerationResult, UltramodernWorkspaceOptions, WorkspaceApp } from './types';
3
+ export declare function writeApp(targetDir: string, scope: string, app: WorkspaceApp, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes?: WorkspaceApp[], bridge?: UltramodernBridgeConfig): void;
3
4
  export declare function writeSharedPackages(targetDir: string, scope: string): void;
5
+ export declare function createCompactUltramodernConfig(scope: string, modernVersion: string, packageSource: ResolvedPackageSource, apps?: WorkspaceApp[], enableTailwind?: boolean, bridge?: UltramodernBridgeConfig): JsonValue;
4
6
  export declare function generateUltramodernWorkspace(options: UltramodernWorkspaceOptions): UltramodernGenerationResult;
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
24
- "version": "3.4.0-ultramodern.12",
24
+ "version": "3.4.0-ultramodern.13",
25
25
  "types": "./dist/types/index.d.ts",
26
26
  "main": "./dist/esm-node/index.js",
27
27
  "bin": {
@@ -75,7 +75,7 @@
75
75
  ],
76
76
  "dependencies": {
77
77
  "@modern-js/codesmith": "2.6.9",
78
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.4.0-ultramodern.12"
78
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.4.0-ultramodern.13"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@rslib/core": "0.23.0",
@@ -97,6 +97,6 @@
97
97
  "test": "rm -rf dist && rslib build -c rslibconfig.mts && rstest --passWithNoTests"
98
98
  },
99
99
  "ultramodern": {
100
- "frameworkVersion": "3.4.0-ultramodern.12"
100
+ "frameworkVersion": "3.4.0-ultramodern.13"
101
101
  }
102
102
  }
@@ -4,9 +4,9 @@
4
4
  "repository": "https://github.com/rstackjs/agent-skills",
5
5
  "commit": "61c948b42512e223bad44b83af4080eba48b2677",
6
6
  "license": "MIT",
7
- "licensePath": ".agents/rstackjs-agent-skills-LICENSE"
7
+ "licensePath": ".codex/rstackjs-agent-skills-LICENSE"
8
8
  },
9
- "installDir": ".agents/skills",
9
+ "installDir": ".codex/skills",
10
10
  "sources": [
11
11
  {
12
12
  "id": "rstack-agent-skills",
@@ -14,7 +14,7 @@
14
14
  "repository": "https://github.com/rstackjs/agent-skills",
15
15
  "commit": "61c948b42512e223bad44b83af4080eba48b2677",
16
16
  "license": "MIT",
17
- "licensePath": ".agents/rstackjs-agent-skills-LICENSE",
17
+ "licensePath": ".codex/rstackjs-agent-skills-LICENSE",
18
18
  "install": "vendored"
19
19
  },
20
20
  {
@@ -26,7 +26,7 @@
26
26
  "baseline": [
27
27
  {
28
28
  "name": "mf",
29
- "path": ".agents/skills/mf",
29
+ "path": ".codex/skills/mf",
30
30
  "reason": "Module Federation docs, config inspection, type checking, shared dependency checks, and observability troubleshooting"
31
31
  }
32
32
  ]
@@ -63,42 +63,42 @@
63
63
  "baseline": [
64
64
  {
65
65
  "name": "rsbuild-best-practices",
66
- "path": ".agents/skills/rsbuild-best-practices",
66
+ "path": ".codex/skills/rsbuild-best-practices",
67
67
  "reason": "Modern.js application build configuration and Rsbuild troubleshooting"
68
68
  },
69
69
  {
70
70
  "name": "rspack-best-practices",
71
- "path": ".agents/skills/rspack-best-practices",
71
+ "path": ".codex/skills/rspack-best-practices",
72
72
  "reason": "Rspack bundling, CSS, asset, profiling, and production behavior"
73
73
  },
74
74
  {
75
75
  "name": "rspack-tracing",
76
- "path": ".agents/skills/rspack-tracing",
76
+ "path": ".codex/skills/rspack-tracing",
77
77
  "reason": "Trace-backed Rspack failure and performance debugging"
78
78
  },
79
79
  {
80
80
  "name": "rsdoctor-analysis",
81
- "path": ".agents/skills/rsdoctor-analysis",
81
+ "path": ".codex/skills/rsdoctor-analysis",
82
82
  "reason": "Evidence-backed bundle composition, duplication, and retained-module analysis"
83
83
  },
84
84
  {
85
85
  "name": "rslib-best-practices",
86
- "path": ".agents/skills/rslib-best-practices",
86
+ "path": ".codex/skills/rslib-best-practices",
87
87
  "reason": "Rslib shared package and design-system library authoring"
88
88
  },
89
89
  {
90
90
  "name": "rslib-modern-package",
91
- "path": ".agents/skills/rslib-modern-package",
91
+ "path": ".codex/skills/rslib-modern-package",
92
92
  "reason": "Modern package contracts, exports, declarations, side effects, and release readiness"
93
93
  },
94
94
  {
95
95
  "name": "rstest-best-practices",
96
- "path": ".agents/skills/rstest-best-practices",
96
+ "path": ".codex/skills/rstest-best-practices",
97
97
  "reason": "Rstest configuration, test writing, mocking, snapshots, coverage, and CI behavior"
98
98
  },
99
99
  {
100
100
  "name": "mf",
101
- "path": ".agents/skills/mf",
101
+ "path": ".codex/skills/mf",
102
102
  "reason": "Module Federation docs, config inspection, type checking, shared dependency checks, and observability troubleshooting"
103
103
  }
104
104
  ],
@@ -2,4 +2,7 @@ node_modules/
2
2
  dist/
3
3
  build/
4
4
  .modernjs/cache/
5
+ .modern-js/
6
+ **/.modern-js/
5
7
  .modernjs/agent-reference-repos-tmp/
8
+ .codex/reports/
@@ -1,7 +1,7 @@
1
1
  # UltraModern Agent Contract
2
2
 
3
3
  This workspace is generated as an agent-ready UltraModern.js SuperApp shell.
4
- Agents should treat the files under `.agents/skills` as local project
4
+ Codex should treat the files under `.codex/skills` as local project
5
5
  instructions, not optional reading.
6
6
 
7
7
  ## Quality Gates
@@ -19,7 +19,7 @@ baseline; do not reintroduce Corepack or older pnpm aliases.
19
19
  - `pnpm check` is a local convenience aggregate for the primitive gates.
20
20
  - Generated CI runs primitive gates as separate matrix jobs instead of calling `pnpm check`.
21
21
  - Generated Codex stop hooks and subagent-stop hooks run `pnpm format && pnpm lint:fix && pnpm check`.
22
- - `postinstall` formats the generated tree and installs `lefthook`. It never clones repositories or installs system packages; agent skill repos and reference repos are explicit opt-in steps (`pnpm skills:install`, `pnpm agents:refs:install`). Generated `lefthook.yml` runs separate format and lint-fix commands on pre-commit; pre-push runs read-only primitive gates in parallel.
22
+ - `postinstall` formats the generated tree, installs/updates pinned Codex skills, and installs `lefthook`. It never installs system packages. Clone-backed public skills are attempted by default; offline clone failures are advisory. Reference repos remain an explicit `pnpm agents:refs:install` step. Generated `lefthook.yml` runs separate format and lint-fix commands on pre-commit; pre-push runs read-only primitive gates in parallel.
23
23
 
24
24
  ## Localized Routes
25
25
 
@@ -48,7 +48,13 @@ Use these skills when the task touches the matching subsystem:
48
48
  - `rstest-best-practices`: Rstest configuration, test writing, mocking, snapshots, coverage, and CI test behavior.
49
49
  - `mf`: Module Federation docs, Modern.js integration, DTS/type checks, shared dependency checks, runtime errors, and observability troubleshooting.
50
50
 
51
- The public `module-federation/agent-skills` repository is installed only when you explicitly run `pnpm skills:install` (or set `ULTRAMODERN_AGENT_SKILLS=1` before `pnpm install`). Postinstall never clones repositories. `pnpm skills:install` remains strict for required public skills. `pnpm skills:check` fails when a vendored skill is missing and warns when clone-installed skills such as `mf` have not been fetched yet.
51
+ Skill bodies are lockfile-pinned in `.codex/skills-lock.json` and installed
52
+ into the repo-owned `.codex/skills` directory by default. The installer updates
53
+ only pinned skill directories and preserves unrelated user skills already
54
+ present under `.codex/skills`. Set `ULTRAMODERN_SKIP_CODEX_SKILLS=1` or
55
+ `ULTRAMODERN_CODEX_SKILLS=0` to opt out during install. `pnpm skills:check` is
56
+ advisory when local skill bodies are missing so offline CI can still run the
57
+ normal gate.
52
58
 
53
59
  ## Private Skills
54
60
 
@@ -58,7 +64,7 @@ ScriptedAlchemy/TechsioCZ skills are private and are cloned only when the curren
58
64
  pnpm skills:install
59
65
  ```
60
66
 
61
- The installer copies only the pinned private skills from `.agents/skills-lock.json`: `plan-graph`, `dag`, `subagent-graph`, `helm`, and `debugger-mode`.
67
+ The installer copies only the pinned private skills from `.codex/skills-lock.json`: `plan-graph`, `dag`, `subagent-graph`, `helm`, and `debugger-mode`.
62
68
 
63
69
  ## Agent Reference Repositories
64
70
 
@@ -85,4 +91,4 @@ Agents may read files under `repos/` to understand upstream patterns, APIs, and
85
91
 
86
92
  ## Skill Provenance
87
93
 
88
- The vendored Rstack skills, public Module Federation skill, and private TechsioCZ skill set are pinned in `.agents/skills-lock.json`. Do not update, remove, or replace them casually. If a skill needs updating, update the lock file and run the affected primitive gate plus `pnpm check`.
94
+ The Rstack skills, public Module Federation skill, and private TechsioCZ skill set are pinned in `.codex/skills-lock.json`. Do not update, remove, or replace them casually. If a skill needs updating, update the lock file and run the affected primitive gate plus `pnpm check`.
@@ -80,11 +80,14 @@ UltraModern.js source lookup using squashed git subtrees) are an explicit
80
80
  opt-in step: run `pnpm agents:refs:install` when you want them. `pnpm install`
81
81
  never clones repositories.
82
82
 
83
- Vendored agent skills ship with the scaffold. Clone-installed skills (such as
84
- the Module Federation `mf` skill) are fetched only when you explicitly run
85
- `pnpm skills:install`, or when `ULTRAMODERN_AGENT_SKILLS=1` is set during
86
- `pnpm install`. `pnpm skills:check` warns about missing clone-installed skills
87
- without failing the gate.
83
+ Codex skill bodies are lockfile-pinned in `.codex/skills-lock.json` and
84
+ repo-owned under `.codex/skills`. `pnpm install` runs the bootstrap by default:
85
+ vendored pinned skills are copied locally, clone-backed public skills are
86
+ fetched when network access is available, and offline clone failures remain
87
+ advisory. Existing unrelated `.codex/skills/*` directories are preserved. Set
88
+ `ULTRAMODERN_SKIP_CODEX_SKILLS=1` or `ULTRAMODERN_CODEX_SKILLS=0` to opt out.
89
+ `pnpm skills:check` is advisory when local skill bodies are missing so offline
90
+ CI can still run the normal gate.
88
91
 
89
92
  The topology and ownership metadata are generated under `topology/`. The
90
93
  workspace also ships `.github/workflows/ultramodern-workspace-gates.yml` and
@@ -93,12 +96,12 @@ actions, frozen installs, StepSecurity audit-mode runner hardening, dependency
93
96
  dashboard review, one-day release age, grouped updates, and manual approval for
94
97
  major upgrades.
95
98
 
96
- Package source metadata is generated at
97
- `.modernjs/ultramodern-package-source.json`. The default strategy keeps
98
- UltraModern.js runtime and tooling packages on `workspace:*` for monorepo
99
- development. To create a workspace that can install those packages outside the
100
- monorepo, generate with `--ultramodern-package-source install`; generated shared
101
- packages still use `workspace:*` because they are part of this workspace.
99
+ Package source provenance is recorded in `.modernjs/ultramodern.json`. The
100
+ default strategy keeps UltraModern.js runtime and tooling packages on
101
+ `workspace:*` for monorepo development. To create a workspace that can install
102
+ those packages outside the monorepo, generate with
103
+ `--ultramodern-package-source install`; generated shared packages still use
104
+ `workspace:*` because they are part of this workspace.
102
105
 
103
106
  ## Public URL Environment Variables
104
107
 
@@ -151,7 +154,7 @@ pnpm cloudflare:proof -- --require-public-urls
151
154
  | Package cohort mismatch | Regenerate with one package source strategy, run `mise install`, then rerun `pnpm install` from the activated shell. | Generated workspace package source metadata |
152
155
  | Install failure | Check the active Node/pnpm from `mise install`; rerun `pnpm install` after the shell sees the pinned versions. | Toolchain setup |
153
156
  | Build failure | Run the matching primitive gate (`pnpm lint`, `pnpm typecheck`, `pnpm i18n:boundaries`, `pnpm contract:check`) before `pnpm build`; fix the owning failure first. | Owning package or generated contract |
154
- | Missing public URL | Set the env key from `.modernjs/ultramodern-generated-contract.json`, for example `ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP`. | Deployment operator |
157
+ | Missing public URL | Set the app public URL env key recorded in `.modernjs/ultramodern.json`, for example `ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP`. | Deployment operator |
155
158
  | Cloudflare credentials | Confirm Wrangler credentials before `pnpm cloudflare:deploy`; local checks do not prove live Worker access. | Deployment operator |
156
159
  | Asset or CSS 404 | Rebuild with `pnpm build` or `pnpm cloudflare:deploy` and inspect emitted Modern/Rspack asset paths instead of hardcoding CSS URLs. | Framework/runtime asset pipeline |
157
160
  | Federation manifest failure | Run the shell and vertical build scripts, then check each deployed `/mf-manifest.json` URL used by the shell. | Module Federation owner |
@@ -5,6 +5,7 @@ export default defineConfig({
5
5
  extends: [ultracite],
6
6
  ignorePatterns: [
7
7
  '.agents',
8
+ '.codex/skills',
8
9
  '.output',
9
10
  '**/*.json',
10
11
  'dist',
@@ -10,6 +10,7 @@ export default defineConfig({
10
10
  extends: [core, react],
11
11
  ignorePatterns: [
12
12
  '.agents',
13
+ '.codex/skills',
13
14
  '.output',
14
15
  'dist',
15
16
  'node_modules',
@@ -2,19 +2,22 @@ import { execFileSync } from 'node:child_process';
2
2
  import fs from 'node:fs';
3
3
  import os from 'node:os';
4
4
  import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
5
6
 
6
7
  const root = process.cwd();
7
- const lockPath = path.join(root, '.agents/skills-lock.json');
8
+ const scriptDir = path.dirname(fileURLToPath(import.meta.url));
9
+ const templateWorkspaceDir = path.resolve(scriptDir, '..');
10
+ const vendoredSkillsDir = path.join(templateWorkspaceDir, '.codex/skills');
11
+ const lockPath = path.join(root, '.codex/skills-lock.json');
8
12
  const checkOnly = process.argv.includes('--check');
9
- const force = process.argv.includes('--force');
10
13
  const postinstall = process.argv.includes('--postinstall');
11
14
  const truthy = value => /^(1|true|yes|on)$/i.test(String(value ?? ''));
12
15
  const falsy = value => /^(0|false|no|off)$/i.test(String(value ?? ''));
13
16
  const skipRequested =
14
- truthy(process.env.ULTRAMODERN_SKIP_AGENT_SKILLS) ||
15
- falsy(process.env.ULTRAMODERN_AGENT_SKILLS);
17
+ truthy(process.env.ULTRAMODERN_SKIP_CODEX_SKILLS) ||
18
+ falsy(process.env.ULTRAMODERN_CODEX_SKILLS);
16
19
  const cloneTimeoutMs = Number.parseInt(
17
- process.env.ULTRAMODERN_AGENT_SKILLS_CLONE_TIMEOUT_MS ?? '60000',
20
+ process.env.ULTRAMODERN_CODEX_SKILLS_CLONE_TIMEOUT_MS ?? '60000',
18
21
  10,
19
22
  );
20
23
 
@@ -60,7 +63,7 @@ const requireGit = () => {
60
63
  }
61
64
 
62
65
  throw new Error(
63
- 'Git is required to install agent skills. Install git yourself (for example "brew install git" or "sudo apt-get install git") and run pnpm skills:install again. This script never installs system packages on your behalf.',
66
+ 'Git is required to install clone-backed Codex skills. Install git yourself (for example "brew install git" or "sudo apt-get install git") and run pnpm skills:install again. This script never installs system packages on your behalf.',
64
67
  );
65
68
  };
66
69
 
@@ -172,31 +175,42 @@ const resolveSkillDir = (sourceRoot, skillName) => {
172
175
  };
173
176
 
174
177
  if (!fs.existsSync(lockPath)) {
175
- console.error('Missing .agents/skills-lock.json');
178
+ console.error('Missing .codex/skills-lock.json');
176
179
  process.exit(1);
177
180
  }
178
181
 
179
182
  const lock = readJson(lockPath);
180
- const installDir = path.join(root, lock.installDir ?? '.agents/skills');
183
+ const installDir = path.join(root, lock.installDir ?? '.codex/skills');
181
184
  const sources = lock.sources ?? [];
182
- const requiredCloneSources = sources.filter(
183
- source => source.install === 'clone',
184
- );
185
+ const vendoredSources = sources.filter(source => source.install === 'vendored');
186
+ const cloneSources = sources.filter(source => source.install === 'clone');
185
187
  const optionalCloneSources = sources.filter(
186
188
  source => source.install === 'clone-if-authorized',
187
189
  );
188
- const cloneSourceSkillNames = new Set(
189
- [...requiredCloneSources, ...optionalCloneSources].flatMap(source =>
190
- (source.baseline ?? []).map(skill => skill.name),
190
+ const explicitSourceSkillNames = new Set(
191
+ [...vendoredSources, ...cloneSources, ...optionalCloneSources].flatMap(
192
+ source => (source.baseline ?? []).map(skill => skill.name),
191
193
  ),
192
194
  );
193
- const vendoredRequiredSkills = (lock.baseline ?? []).filter(
194
- skill => !cloneSourceSkillNames.has(skill.name),
195
- );
196
- const cloneOptIn = truthy(process.env.ULTRAMODERN_AGENT_SKILLS);
195
+ const skillsForSource = source =>
196
+ source.baseline ??
197
+ (source.install === 'vendored'
198
+ ? (lock.baseline ?? []).filter(
199
+ skill => !explicitSourceSkillNames.has(skill.name),
200
+ )
201
+ : []);
202
+ const lockedSkillNames = (lock.baseline ?? []).map(skill => skill.name);
203
+ const installedSkillNames = () =>
204
+ lockedSkillNames.filter(skillName =>
205
+ fs.existsSync(path.join(installDir, skillName, 'SKILL.md')),
206
+ );
207
+ const missingSkillNames = () =>
208
+ lockedSkillNames.filter(
209
+ skillName => !fs.existsSync(path.join(installDir, skillName, 'SKILL.md')),
210
+ );
197
211
 
198
212
  if (skipRequested) {
199
- const reason = 'agent skills bootstrap skipped by environment';
213
+ const reason = 'Codex skills bootstrap skipped by environment';
200
214
  if (checkOnly) {
201
215
  console.log(reason);
202
216
  process.exit(0);
@@ -207,80 +221,76 @@ if (skipRequested) {
207
221
  }
208
222
 
209
223
  if (checkOnly) {
210
- const missingVendored = vendoredRequiredSkills
211
- .map(skill => skill.name)
212
- .filter(
213
- skillName => !fs.existsSync(path.join(installDir, skillName, 'SKILL.md')),
214
- );
215
- const missingCloneInstalled = [
216
- ...requiredCloneSources,
217
- ...optionalCloneSources,
218
- ].flatMap(source =>
219
- (source.baseline ?? [])
220
- .map(skill => skill.name)
221
- .filter(
222
- skillName =>
223
- !fs.existsSync(path.join(installDir, skillName, 'SKILL.md')),
224
- ),
225
- );
226
-
227
- if (missingVendored.length > 0) {
228
- console.error(
229
- `Required agent skills not installed: ${missingVendored.join(', ')}. Run pnpm skills:install.`,
230
- );
231
- process.exit(1);
232
- }
233
-
234
- if (missingCloneInstalled.length > 0) {
224
+ const missing = missingSkillNames();
225
+ const installed = installedSkillNames();
226
+ if (missing.length > 0) {
235
227
  console.log(
236
- `Advisory: clone-installed agent skills are not present: ${missingCloneInstalled.join(', ')}. This is expected in CI, nested generated workspaces, and postinstall-only installs; run pnpm skills:install when you need those skills.`,
228
+ `Advisory: pinned Codex skills are not installed: ${missing.join(', ')}. This is expected in offline postinstall runs and fresh check-only CI; run pnpm skills:install when you need local skill bodies.`,
237
229
  );
238
230
  } else {
239
- console.log('All pinned agent skills are installed.');
231
+ console.log('All pinned Codex skills are installed.');
232
+ }
233
+ if (installed.length > 0) {
234
+ console.log(`Installed Codex skills: ${installed.join(', ')}.`);
240
235
  }
241
236
  process.exit(0);
242
237
  }
243
238
 
244
- if (postinstall && !cloneOptIn) {
245
- console.log(
246
- 'Skipping agent skill repository clones during postinstall. Run pnpm skills:install (or set ULTRAMODERN_AGENT_SKILLS=1 before installing) to fetch them.',
247
- );
248
- installLefthook();
249
- process.exit(0);
239
+ fs.mkdirSync(installDir, { recursive: true });
240
+
241
+ const installSkillFromDir = (sourceSkillDir, skillName) => {
242
+ const targetSkillDir = path.join(installDir, skillName);
243
+ if (path.resolve(sourceSkillDir) === path.resolve(targetSkillDir)) {
244
+ console.log(`Pinned Codex skill ${skillName} is already present`);
245
+ return;
246
+ }
247
+ if (fs.existsSync(targetSkillDir)) {
248
+ removeTree(targetSkillDir);
249
+ }
250
+ fs.mkdirSync(path.dirname(targetSkillDir), { recursive: true });
251
+ fs.cpSync(sourceSkillDir, targetSkillDir, { recursive: true });
252
+ console.log(`Installed Codex skill ${skillName}`);
253
+ };
254
+
255
+ for (const source of vendoredSources) {
256
+ for (const skill of skillsForSource(source)) {
257
+ const sourceSkillDir = resolveSkillDir(vendoredSkillsDir, skill.name);
258
+ if (!sourceSkillDir) {
259
+ throw new Error(
260
+ `Vendored Codex skill ${skill.name} not found in ${vendoredSkillsDir}`,
261
+ );
262
+ }
263
+ installSkillFromDir(sourceSkillDir, skill.name);
264
+ }
250
265
  }
251
266
 
252
- fs.mkdirSync(installDir, { recursive: true });
253
- requireGit();
267
+ const cloneInstallSources = postinstall
268
+ ? cloneSources
269
+ : [...cloneSources, ...optionalCloneSources];
254
270
 
255
- for (const source of [...requiredCloneSources, ...optionalCloneSources]) {
271
+ for (const source of cloneInstallSources) {
256
272
  const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ultramodern-skills-'));
257
273
  try {
258
274
  try {
275
+ requireGit();
259
276
  cloneSource(source, tempDir);
260
277
  } catch (error) {
261
278
  if (source.install === 'clone-if-authorized' || postinstall) {
262
- console.warn(`Skipping ${source.repository}; ${error.message}`);
279
+ console.warn(
280
+ `Advisory: unable to install Codex skills from ${source.repository}; ${error.message}. Offline postinstall may continue. Run pnpm skills:install later when network access is available.`,
281
+ );
263
282
  continue;
264
283
  }
265
284
  throw error;
266
285
  }
267
- for (const skill of source.baseline ?? []) {
286
+ for (const skill of skillsForSource(source)) {
268
287
  const sourceSkillDir = resolveSkillDir(tempDir, skill.name);
269
288
  if (!sourceSkillDir) {
270
289
  throw new Error(
271
290
  `Skill ${skill.name} not found in ${source.repository}`,
272
291
  );
273
292
  }
274
- const targetSkillDir = path.join(installDir, skill.name);
275
- if (fs.existsSync(targetSkillDir)) {
276
- if (!force) {
277
- console.log(`Skipping existing ${skill.name}`);
278
- continue;
279
- }
280
- removeTree(targetSkillDir);
281
- }
282
- fs.cpSync(sourceSkillDir, targetSkillDir, { recursive: true });
283
- console.log(`Installed ${skill.name}`);
293
+ installSkillFromDir(sourceSkillDir, skill.name);
284
294
  }
285
295
  } finally {
286
296
  removeTree(tempDir);
@@ -6,11 +6,64 @@ const generatedContractPath = path.join(
6
6
  root,
7
7
  '.modernjs/ultramodern-generated-contract.json',
8
8
  );
9
- const generatedContract = fs.existsSync(generatedContractPath)
10
- ? JSON.parse(fs.readFileSync(generatedContractPath, 'utf-8'))
11
- : undefined;
9
+ const compactConfigPath = path.join(root, '.modernjs/ultramodern.json');
12
10
  const defaultAppDirs = {{defaultAppDirsJson}};
13
11
 
12
+ function readJson(filePath) {
13
+ return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
14
+ }
15
+
16
+ function normalizeRelativePath(value) {
17
+ return String(value ?? '').replace(/\\/gu, '/').replace(/^\.\/+/u, '');
18
+ }
19
+
20
+ function readGeneratedContractView() {
21
+ if (fs.existsSync(compactConfigPath)) {
22
+ const compactConfig = readJson(compactConfigPath);
23
+ return {
24
+ sourcePath: compactConfigPath,
25
+ apps: Array.isArray(compactConfig.topology?.apps)
26
+ ? compactConfig.topology.apps.map(app => {
27
+ const moduleFederation =
28
+ app.moduleFederation && typeof app.moduleFederation === 'object'
29
+ ? app.moduleFederation
30
+ : {};
31
+ return {
32
+ id: String(app.id),
33
+ path:
34
+ typeof app.path === 'string'
35
+ ? normalizeRelativePath(app.path)
36
+ : '.',
37
+ moduleFederation: {
38
+ exposes: Array.isArray(moduleFederation.exposes)
39
+ ? moduleFederation.exposes.filter(
40
+ expose => typeof expose === 'string',
41
+ )
42
+ : [],
43
+ dts: {
44
+ compilerInstance:
45
+ moduleFederation.dts?.compilerInstance ?? 'tsgo',
46
+ tsConfigPath:
47
+ moduleFederation.dts?.tsConfigPath ??
48
+ './tsconfig.mf-types.json',
49
+ },
50
+ },
51
+ };
52
+ })
53
+ : [],
54
+ };
55
+ }
56
+ if (fs.existsSync(generatedContractPath)) {
57
+ return {
58
+ sourcePath: generatedContractPath,
59
+ ...readJson(generatedContractPath),
60
+ };
61
+ }
62
+ return undefined;
63
+ }
64
+
65
+ const generatedContract = readGeneratedContractView();
66
+
14
67
  const args = process.argv.slice(2);
15
68
  if (args.includes('--help') || args.includes('-h')) {
16
69
  process.stdout.write(`Usage: