@bleedingdev/modern-js-create 3.2.0-ultramodern.1 → 3.2.0-ultramodern.11

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 (43) hide show
  1. package/README.md +12 -0
  2. package/dist/index.js +330 -185
  3. package/package.json +5 -2
  4. package/template/.agents/skills-lock.json +34 -0
  5. package/template/AGENTS.md +20 -0
  6. package/template/api/effect/index.ts.handlebars +7 -45
  7. package/template/modern.config.ts.handlebars +20 -24
  8. package/template/oxfmt.config.ts +8 -0
  9. package/template/oxlint.config.ts +12 -0
  10. package/template/package.json.handlebars +41 -26
  11. package/template/scripts/bootstrap-agent-skills.mjs +95 -0
  12. package/template/scripts/validate-ultramodern.mjs.handlebars +81 -17
  13. package/template/shared/effect/api.ts.handlebars +1 -2
  14. package/template/src/modern.runtime.ts.handlebars +2 -4
  15. package/template/src/routes/index.css.handlebars +14 -3
  16. package/template/src/routes/page.tsx.handlebars +28 -11
  17. package/template/tsconfig.json +106 -2
  18. package/template-workspace/.agents/rstackjs-agent-skills-LICENSE +21 -0
  19. package/template-workspace/.agents/skills/rsbuild-best-practices/SKILL.md +57 -0
  20. package/template-workspace/.agents/skills/rsdoctor-analysis/SKILL.md +96 -0
  21. package/template-workspace/.agents/skills/rsdoctor-analysis/references/command-map.md +113 -0
  22. package/template-workspace/.agents/skills/rsdoctor-analysis/references/common-analysis-patterns.md +190 -0
  23. package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +88 -0
  24. package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +138 -0
  25. package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +71 -0
  26. package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor.md +39 -0
  27. package/template-workspace/.agents/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +103 -0
  28. package/template-workspace/.agents/skills/rslib-best-practices/SKILL.md +58 -0
  29. package/template-workspace/.agents/skills/rslib-modern-package/SKILL.md +173 -0
  30. package/template-workspace/.agents/skills/rspack-best-practices/SKILL.md +70 -0
  31. package/template-workspace/.agents/skills/rspack-tracing/SKILL.md +75 -0
  32. package/template-workspace/.agents/skills/rspack-tracing/references/bottlenecks.md +47 -0
  33. package/template-workspace/.agents/skills/rspack-tracing/references/tracing-guide.md +38 -0
  34. package/template-workspace/.agents/skills/rspack-tracing/scripts/analyze_trace.js +184 -0
  35. package/template-workspace/.agents/skills/rstest-best-practices/SKILL.md +133 -0
  36. package/template-workspace/.agents/skills-lock.json +95 -0
  37. package/template-workspace/AGENTS.md +45 -0
  38. package/template-workspace/oxfmt.config.ts +16 -0
  39. package/template-workspace/oxlint.config.ts +19 -0
  40. package/template-workspace/pnpm-workspace.yaml +12 -0
  41. package/template-workspace/scripts/bootstrap-agent-skills.mjs +95 -0
  42. package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +188 -59
  43. package/template/biome.json +0 -41
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
24
- "version": "3.2.0-ultramodern.1",
24
+ "version": "3.2.0-ultramodern.11",
25
25
  "types": "./dist/types/index.d.ts",
26
26
  "main": "./dist/index.js",
27
27
  "bin": {
@@ -41,7 +41,7 @@
41
41
  "@types/node": "^25.8.0",
42
42
  "@typescript/native-preview": "7.0.0-dev.20260516.1",
43
43
  "tsx": "^4.22.0",
44
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.1"
44
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.11"
45
45
  },
46
46
  "publishConfig": {
47
47
  "registry": "https://registry.npmjs.org/",
@@ -52,5 +52,8 @@
52
52
  "build": "rslib build && pnpm -w tsgo:dts \"$PWD\"",
53
53
  "dev": "rslib build -w",
54
54
  "start": "node ./dist/index.js"
55
+ },
56
+ "ultramodern": {
57
+ "frameworkVersion": "3.2.0-ultramodern.11"
55
58
  }
56
59
  }
@@ -0,0 +1,34 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "installDir": ".agents/skills",
4
+ "sources": [
5
+ {
6
+ "id": "techsiocz-private",
7
+ "visibility": "private",
8
+ "repository": "https://github.com/TechsioCZ/skills",
9
+ "install": "clone-if-authorized",
10
+ "baseline": [
11
+ {
12
+ "name": "plan-graph",
13
+ "reason": "Build and validate DAGs from .plan.md files"
14
+ },
15
+ {
16
+ "name": "dag",
17
+ "reason": "Inspect current plan frontiers and blocked lanes"
18
+ },
19
+ {
20
+ "name": "subagent-graph",
21
+ "reason": "Design dependency-aware multi-agent launch graphs"
22
+ },
23
+ {
24
+ "name": "helm",
25
+ "reason": "Steer already-running multi-agent work"
26
+ },
27
+ {
28
+ "name": "debugger-mode",
29
+ "reason": "Run hypothesis-driven debugging with runtime evidence"
30
+ }
31
+ ]
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,20 @@
1
+ # UltraModern Agent Contract
2
+
3
+ This project is generated for Codex-first UltraModern.js work.
4
+
5
+ ## Quality Gates
6
+
7
+ - `pnpm lint` runs Oxlint with the Ultracite preset.
8
+ - `pnpm format` runs oxfmt.
9
+ - `pnpm typecheck` runs effect-tsgo as the TypeScript checker.
10
+ - `pnpm ultramodern:check` verifies the generated contract.
11
+
12
+ ## Private Skills
13
+
14
+ Private orchestration skills are not vendored into this template. If you are authorized for `TechsioCZ/skills`, run:
15
+
16
+ ```bash
17
+ pnpm skills:install
18
+ ```
19
+
20
+ The installer clones that private repository and copies only the allowlisted skills from `.agents/skills-lock.json`.
@@ -2,60 +2,22 @@
2
2
  Effect,
3
3
  HttpApiBuilder,
4
4
  Layer,
5
- Schema,
6
- ServiceMap,
7
5
  defineEffectBff,
8
6
  } from '@modern-js/plugin-bff/effect-server';
9
7
  import { bffEffectApi } from '../../shared/effect/api';
10
8
 
11
- class GreetingUnavailableError extends Schema.TaggedError<GreetingUnavailableError>()(
12
- 'GreetingUnavailableError',
13
- {
14
- message: Schema.String,
15
- },
16
- ) {}
17
-
18
- class GreetingService extends ServiceMap.Service<GreetingService>()('GreetingService', {
19
- make: Effect.succeed({
20
- hello: Effect.fn('GreetingService.hello')(function* () {
21
- if (Date.now() < 0) {
22
- return yield* Effect.fail(
23
- new GreetingUnavailableError({
24
- message: 'Greeting service is unavailable',
25
- }),
26
- );
27
- }
28
-
29
- return {
30
- message: 'Hello from Effect HttpApi',
31
- runtime: 'effect' as const,
32
- };
33
- }),
34
- }),
35
- }) {
36
- static readonly layer = Layer.effect(this, this.make);
37
- }
38
-
39
- const greetingsLayer = HttpApiBuilder.group(bffEffectApi, 'greetings', handlers =>
9
+ const greetingsLayer = HttpApiBuilder.group(bffEffectApi, 'greetings', (handlers) =>
40
10
  handlers.handle('hello', () =>
41
- GreetingService.use(service => service.hello()).pipe(
42
- Effect.catchTag('GreetingUnavailableError', error =>
43
- Effect.succeed({
44
- message: error.message,
45
- runtime: 'effect' as const,
46
- }),
47
- ),
48
- ),
11
+ Effect.succeed({
12
+ message: 'Hello from Effect HttpApi',
13
+ runtime: 'effect' as const,
14
+ }),
49
15
  ),
50
16
  );
51
17
 
52
- const layer = HttpApiBuilder.layer(bffEffectApi).pipe(
53
- Layer.provide(greetingsLayer),
54
- Layer.provide(GreetingService.layer),
55
- );
18
+ const layer = HttpApiBuilder.layer(bffEffectApi).pipe(Layer.provide(greetingsLayer));
56
19
 
57
20
  export default defineEffectBff({
58
21
  api: bffEffectApi,
59
22
  layer,
60
- });
61
- {{/if}}
23
+ });{{/if}}
@@ -1,41 +1,37 @@
1
+ // @effect-diagnostics nodeBuiltinImport:off processEnv:off
1
2
  import { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';
2
3
  import path from 'node:path';
3
4
  {{#if enableBff}}import { bffPlugin } from '@modern-js/plugin-bff';
4
5
  {{/if}}{{#if isTanstackRouter}}import { tanstackRouterPlugin } from '@modern-js/plugin-tanstack';
5
6
  {{/if}}
6
-
7
- const appId = process.env.MODERN_BASELINE_APP_ID || path.basename(process.cwd());
8
- const enableModuleFederationSSR =
9
- process.env.MODERN_BASELINE_ENABLE_MF_SSR !== 'false';
10
- const enableBffRequestId =
11
- process.env.MODERN_BASELINE_ENABLE_BFF_REQUEST_ID !== 'false';
7
+ const appId = process.env['MODERN_BASELINE_APP_ID'] || path.basename(process.cwd());
8
+ const enableModuleFederationSSR = process.env['MODERN_BASELINE_ENABLE_MF_SSR'] !== 'false';
9
+ const enableBffRequestId = process.env['MODERN_BASELINE_ENABLE_BFF_REQUEST_ID'] !== 'false';
12
10
  const enableTelemetryExporters =
13
- process.env.MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS !== 'false';
14
- const telemetryFailLoudStartup =
15
- process.env.MODERN_TELEMETRY_FAIL_LOUD_STARTUP !== 'false';
11
+ process.env['MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS'] !== 'false';
12
+ const telemetryFailLoudStartup = process.env['MODERN_TELEMETRY_FAIL_LOUD_STARTUP'] !== 'false';
13
+ const otlpEndpoint = process.env['MODERN_TELEMETRY_OTLP_ENDPOINT'];
14
+ const victoriaMetricsEndpoint = process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'];
16
15
 
17
16
  // https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html
18
17
  export default defineConfig(
19
18
  presetUltramodern(
20
19
  {
21
- plugins: [
20
+ {{#if enableBff}} bff: {
21
+ {{#if useEffectBff}} effect: {
22
+ openapi: true,
23
+ },
24
+
25
+ {{/if}} runtimeFramework: '{{bffRuntime}}',
26
+ },
27
+
28
+ {{/if}} plugins: [
22
29
  appTools(),
23
30
  {{#if isTanstackRouter}}
24
31
  tanstackRouterPlugin(),
25
32
  {{/if}}{{#if enableBff}}
26
33
  bffPlugin(),
27
- {{/if}}
28
- ],
29
- {{#if enableBff}}
30
- bff: {
31
- runtimeFramework: '{{bffRuntime}}',
32
- {{#if useEffectBff}}
33
- effect: {
34
- openapi: true,
35
- },
36
- {{/if}}
37
- },
38
- {{/if}}
34
+ {{/if}} ],
39
35
  },
40
36
  {
41
37
  appId,
@@ -43,8 +39,8 @@ export default defineConfig(
43
39
  enableModuleFederationSSR,
44
40
  enableTelemetryExporters,
45
41
  telemetryFailLoudStartup,
46
- otlpEndpoint: process.env.MODERN_TELEMETRY_OTLP_ENDPOINT,
47
- victoriaMetricsEndpoint: process.env.MODERN_TELEMETRY_VICTORIA_ENDPOINT,
42
+ ...(typeof otlpEndpoint === 'string' ? { otlpEndpoint } : {}),
43
+ ...(typeof victoriaMetricsEndpoint === 'string' ? { victoriaMetricsEndpoint } : {}),
48
44
  },
49
45
  ),
50
46
  );
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'oxfmt';
2
+ import ultracite from 'ultracite/oxfmt';
3
+
4
+ export default defineConfig({
5
+ extends: [ultracite],
6
+ ignorePatterns: ['dist', 'node_modules', '.modern', '.modernjs', '**/routeTree.gen.ts'],
7
+ singleQuote: true,
8
+ });
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from 'oxlint';
2
+ import core from 'ultracite/oxlint/core';
3
+ import react from 'ultracite/oxlint/react';
4
+
5
+ export default defineConfig({
6
+ env: {
7
+ browser: true,
8
+ node: true,
9
+ },
10
+ extends: [core, react],
11
+ ignorePatterns: ['dist', 'node_modules', '.modern', '.modernjs', '**/routeTree.gen.ts'],
12
+ });
@@ -1,47 +1,62 @@
1
1
  {
2
2
  "name": "{{packageName}}",
3
3
  "version": "0.1.0",
4
+ "type": "module",
4
5
  "scripts": {
5
6
  "reset": "npx rimraf node_modules ./**/node_modules",
6
7
  "dev": "modern dev",
7
8
  "build": "modern build",
8
9
  "serve": "modern serve",
9
- "ultramodern:check": "node ./scripts/validate-ultramodern.mjs"{{#unless isSubproject}},
10
- "lint": "biome check",
10
+ "typecheck": "node -e \"const fs = require('node:fs'); const { execFileSync, spawnSync } = require('node:child_process'); const bin = execFileSync('effect-tsgo', ['get-exe-path'], { encoding: 'utf8' }).trim(); if (process.platform !== 'win32') fs.chmodSync(bin, 0o755); const result = spawnSync(bin, ['--noEmit', '-p', 'tsconfig.json'], { stdio: 'inherit' }); process.exit(result.status ?? 1);\"",
11
+ "skills:install": "node ./scripts/bootstrap-agent-skills.mjs",
12
+ "skills:check": "node ./scripts/bootstrap-agent-skills.mjs --check",
13
+ "ultramodern:check": "{{#unless isSubproject}}pnpm format:check && pnpm lint && {{/unless}}pnpm typecheck{{#unless isSubproject}} && pnpm skills:check{{/unless}} && node ./scripts/validate-ultramodern.mjs"{{#unless isSubproject}},
14
+ "format": "oxfmt .",
15
+ "format:check": "oxfmt --check .",
16
+ "lint": "oxlint .",
17
+ "lint:fix": "oxlint . --fix",
11
18
  "prepare": "simple-git-hooks"{{/unless}}
12
19
  },
13
- "engines": {
14
- "node": ">=20"
15
- }{{#unless isSubproject}},
16
- "lint-staged": {
17
- "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
18
- "biome check --files-ignore-unknown=true"
19
- ]
20
- },
21
- "simple-git-hooks": {
22
- "pre-commit": "npx lint-staged"
23
- }{{/unless}},
24
20
  "dependencies": {
25
- "@modern-js/runtime": "{{version}}"{{#if isTanstackRouter}},
26
- "@modern-js/plugin-tanstack": "{{version}}",
27
- "@tanstack/react-router": "1.170.1"{{/if}},
21
+ {{#if isTanstackRouter}} "@modern-js/plugin-tanstack": "{{pluginTanstackVersion}}",
22
+ {{/if}} "@modern-js/runtime": "{{runtimeVersion}}",
23
+ {{#if isTanstackRouter}} "@tanstack/react-router": "1.170.1",
24
+ {{/if}}
28
25
  "react": "^19.2.3",
29
26
  "react-dom": "^19.2.0"
30
27
  },
31
28
  "devDependencies": {
32
- "@modern-js/app-tools": "{{version}}",
33
- "@modern-js/tsconfig": "{{version}}"{{#if enableBff}},
34
- "@modern-js/plugin-bff": "{{version}}"{{/if}}{{#if enableTailwind}},
29
+ "@effect/tsgo": "0.7.3",
30
+ "@modern-js/app-tools": "{{appToolsVersion}}",
31
+ {{#if enableBff}} "@modern-js/plugin-bff": "{{pluginBffVersion}}",
32
+ {{/if}} "@modern-js/tsconfig": "{{tsconfigVersion}}",
33
+ {{#if enableTailwind}}
35
34
  "@tailwindcss/postcss": "^4.1.18",
36
- "postcss": "^8.5.6",
37
- "tailwindcss": "^4.1.18"{{/if}}{{#unless isSubproject}},
38
- "@biomejs/biome": "1.9.4"{{/unless}},
39
- "@typescript/native-preview": "7.0.0-dev.20260516.1",
35
+ {{/if}}
40
36
  "@types/node": "^20",
41
37
  "@types/react": "^19.1.8",
42
- "@types/react-dom": "^19.1.6"{{#unless isSubproject}},
38
+ "@types/react-dom": "^19.1.6",
39
+ "@typescript/native-preview": "7.0.0-dev.20260518.1",
40
+ {{#unless isSubproject}}
43
41
  "lint-staged": "~15.4.0",
44
- "simple-git-hooks": "^2.11.1"{{/unless}},
45
- "rimraf": "^6.0.1"
42
+ "oxfmt": "0.50.0",
43
+ "oxlint": "1.65.0",
44
+ {{/unless}}{{#if enableTailwind}} "postcss": "^8.5.6",
45
+ {{/if}} "rimraf": "^6.0.1"{{#unless isSubproject}},
46
+ "simple-git-hooks": "^2.11.1"{{/unless}}{{#if enableTailwind}},
47
+ "tailwindcss": "^4.1.18"{{/if}}{{#unless isSubproject}},
48
+ "ultracite": "7.7.0"{{/unless}}
49
+ }{{#unless isSubproject}},
50
+ "simple-git-hooks": {
51
+ "pre-commit": "npx lint-staged"
52
+ },
53
+ "lint-staged": {
54
+ "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
55
+ "oxfmt --write",
56
+ "oxlint --fix"
57
+ ]
58
+ }{{/unless}},
59
+ "engines": {
60
+ "node": ">=20"
46
61
  }
47
62
  }
@@ -0,0 +1,95 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+
6
+ const root = process.cwd();
7
+ const lockPath = path.join(root, '.agents/skills-lock.json');
8
+ const checkOnly = process.argv.includes('--check');
9
+ const force = process.argv.includes('--force');
10
+
11
+ const readJson = (filePath) => JSON.parse(fs.readFileSync(filePath, 'utf-8'));
12
+
13
+ const run = (command, args, options = {}) =>
14
+ execFileSync(command, args, {
15
+ cwd: options.cwd ?? root,
16
+ encoding: 'utf-8',
17
+ stdio: options.stdio ?? ['ignore', 'pipe', 'pipe'],
18
+ });
19
+
20
+ const cloneSource = (source, targetDir) => {
21
+ const repo = source.repository.replace(/^https:\/\/github.com\//u, '');
22
+ try {
23
+ run('gh', ['repo', 'clone', repo, targetDir, '--', '--depth', '1'], {
24
+ stdio: 'inherit',
25
+ });
26
+ } catch {
27
+ run('git', ['clone', '--depth', '1', source.repository, targetDir], {
28
+ stdio: 'inherit',
29
+ });
30
+ }
31
+ };
32
+
33
+ const resolveSkillDir = (sourceRoot, skillName) => {
34
+ const candidates = [
35
+ path.join(sourceRoot, skillName),
36
+ path.join(sourceRoot, 'skills', skillName),
37
+ path.join(sourceRoot, 'skills', 'engineering', skillName),
38
+ path.join(sourceRoot, 'skills', 'productivity', skillName),
39
+ ];
40
+ return candidates.find((candidate) => fs.existsSync(path.join(candidate, 'SKILL.md')));
41
+ };
42
+
43
+ if (!fs.existsSync(lockPath)) {
44
+ console.error('Missing .agents/skills-lock.json');
45
+ process.exit(1);
46
+ }
47
+
48
+ const lock = readJson(lockPath);
49
+ const installDir = path.join(root, lock.installDir ?? '.agents/skills');
50
+ const privateSources = (lock.sources ?? []).filter(
51
+ (source) => source.install === 'clone-if-authorized',
52
+ );
53
+
54
+ if (checkOnly) {
55
+ const missing = privateSources.flatMap((source) =>
56
+ (source.baseline ?? [])
57
+ .map((skill) => skill.name)
58
+ .filter((skillName) => !fs.existsSync(path.join(installDir, skillName, 'SKILL.md'))),
59
+ );
60
+ if (missing.length > 0) {
61
+ console.warn(
62
+ `Private skills not installed: ${missing.join(', ')}. Run pnpm skills:install if you have access.`,
63
+ );
64
+ } else {
65
+ console.log('Agent skills are installed.');
66
+ }
67
+ process.exit(0);
68
+ }
69
+
70
+ fs.mkdirSync(installDir, { recursive: true });
71
+
72
+ for (const source of privateSources) {
73
+ const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ultramodern-skills-'));
74
+ try {
75
+ cloneSource(source, tempDir);
76
+ for (const skill of source.baseline ?? []) {
77
+ const sourceSkillDir = resolveSkillDir(tempDir, skill.name);
78
+ if (!sourceSkillDir) {
79
+ throw new Error(`Skill ${skill.name} not found in ${source.repository}`);
80
+ }
81
+ const targetSkillDir = path.join(installDir, skill.name);
82
+ if (fs.existsSync(targetSkillDir)) {
83
+ if (!force) {
84
+ console.log(`Skipping existing ${skill.name}`);
85
+ continue;
86
+ }
87
+ fs.rmSync(targetSkillDir, { force: true, recursive: true });
88
+ }
89
+ fs.cpSync(sourceSkillDir, targetSkillDir, { recursive: true });
90
+ console.log(`Installed ${skill.name}`);
91
+ }
92
+ } finally {
93
+ fs.rmSync(tempDir, { force: true, recursive: true });
94
+ }
95
+ }
@@ -2,17 +2,14 @@ import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
 
4
4
  const configPath = path.resolve(process.cwd(), 'modern.config.ts');
5
- const templateManifestPath = path.resolve(
6
- process.cwd(),
7
- '.modernjs/mv-template-manifest.json',
8
- );
5
+ const templateManifestPath = path.resolve(process.cwd(), '.modernjs/mv-template-manifest.json');
9
6
 
10
7
  if (!fs.existsSync(configPath)) {
11
8
  console.error('modern.config.ts not found');
12
9
  process.exit(1);
13
10
  }
14
11
 
15
- const content = fs.readFileSync(configPath, 'utf8');
12
+ const content = fs.readFileSync(configPath, 'utf-8');
16
13
  const requiredTokens = [
17
14
  'presetUltramodern(',
18
15
  'appTools()',
@@ -20,12 +17,10 @@ const requiredTokens = [
20
17
  'enableBffRequestId',
21
18
  'enableTelemetryExporters',
22
19
  ];
23
- const missing = requiredTokens.filter(token => !content.includes(token));
20
+ const missing = requiredTokens.filter((token) => !content.includes(token));
24
21
 
25
22
  if (missing.length > 0) {
26
- console.error(
27
- `Ultramodern contract check failed. Missing tokens: ${missing.join(', ')}`,
28
- );
23
+ console.error(`Ultramodern contract check failed. Missing tokens: ${missing.join(', ')}`);
29
24
  process.exit(1);
30
25
  }
31
26
 
@@ -34,9 +29,7 @@ if (!fs.existsSync(templateManifestPath)) {
34
29
  process.exit(1);
35
30
  }
36
31
 
37
- const templateManifest = JSON.parse(
38
- fs.readFileSync(templateManifestPath, 'utf8'),
39
- );
32
+ const templateManifest = JSON.parse(fs.readFileSync(templateManifestPath, 'utf-8'));
40
33
  const requiredDeniedPaths = [
41
34
  '.git/**',
42
35
  '.github/**',
@@ -52,8 +45,22 @@ const requiredPostMaterialization = [
52
45
  'dependency-install-with-lifecycle-deny',
53
46
  'template-manifest-retained',
54
47
  ];
48
+ const requiredPaths = [
49
+ 'AGENTS.md',
50
+ '.agents/skills-lock.json',
51
+ 'oxlint.config.ts',
52
+ 'oxfmt.config.ts',
53
+ 'scripts/bootstrap-agent-skills.mjs',
54
+ ];
55
55
  const manifestErrors = [];
56
56
 
57
+ for (const requiredPath of requiredPaths) {
58
+ if (!fs.existsSync(path.resolve(process.cwd(), requiredPath))) {
59
+ console.error(`${requiredPath} not found`);
60
+ process.exit(1);
61
+ }
62
+ }
63
+
57
64
  if (templateManifest.schemaVersion !== 1) {
58
65
  manifestErrors.push('schemaVersion');
59
66
  }
@@ -65,10 +72,10 @@ if (templateManifest.source?.type !== 'builtin') {
65
72
  if (
66
73
  !Array.isArray(templateManifest.integrity?.checksums) ||
67
74
  !templateManifest.integrity.checksums.some(
68
- checksum =>
75
+ (checksum) =>
69
76
  checksum.algorithm === 'sha256' &&
70
77
  checksum.scope === 'source-tree' &&
71
- /^[0-9a-f]{64}$/.test(checksum.value),
78
+ /^[0-9a-f]{64}$/u.test(checksum.value),
72
79
  )
73
80
  ) {
74
81
  manifestErrors.push('integrity.checksums[source-tree]');
@@ -92,11 +99,68 @@ for (const token of requiredPostMaterialization) {
92
99
 
93
100
  if (manifestErrors.length > 0) {
94
101
  console.error(
95
- `Ultramodern template manifest check failed. Invalid fields: ${manifestErrors.join(
96
- ', ',
97
- )}`,
102
+ `Ultramodern template manifest check failed. Invalid fields: ${manifestErrors.join(', ')}`,
98
103
  );
99
104
  process.exit(1);
100
105
  }
101
106
 
107
+ const packageJson = JSON.parse(
108
+ fs.readFileSync(path.resolve(process.cwd(), 'package.json'), 'utf-8'),
109
+ );
110
+ const unresolvedTemplateMarker = String.fromCodePoint(123, 123);
111
+ if (JSON.stringify(packageJson).includes(unresolvedTemplateMarker)) {
112
+ console.error('package.json contains unresolved template markers');
113
+ process.exit(1);
114
+ }
115
+ const skillsLock = JSON.parse(
116
+ fs.readFileSync(path.resolve(process.cwd(), '.agents/skills-lock.json'), 'utf-8'),
117
+ );
118
+ const requiredScripts = {
119
+ format: 'oxfmt .',
120
+ 'format:check': 'oxfmt --check .',
121
+ lint: 'oxlint .',
122
+ 'lint:fix': 'oxlint . --fix',
123
+ 'skills:check': 'node ./scripts/bootstrap-agent-skills.mjs --check',
124
+ 'skills:install': 'node ./scripts/bootstrap-agent-skills.mjs',
125
+ };
126
+
127
+ for (const [scriptName, scriptCommand] of Object.entries(requiredScripts)) {
128
+ if (packageJson.scripts?.[scriptName] !== scriptCommand) {
129
+ console.error(`Missing or invalid package script: ${scriptName}`);
130
+ process.exit(1);
131
+ }
132
+ }
133
+
134
+ if (
135
+ !packageJson.scripts?.typecheck?.includes('effect-tsgo') ||
136
+ !packageJson.scripts.typecheck.includes('get-exe-path')
137
+ ) {
138
+ console.error('typecheck must use effect-tsgo as the TypeScript checker');
139
+ process.exit(1);
140
+ }
141
+
142
+ for (const dependency of [
143
+ '@effect/tsgo',
144
+ '@typescript/native-preview',
145
+ 'oxlint',
146
+ 'oxfmt',
147
+ 'ultracite',
148
+ ]) {
149
+ if (!packageJson.devDependencies?.[dependency]) {
150
+ console.error(`Missing devDependency: ${dependency}`);
151
+ process.exit(1);
152
+ }
153
+ }
154
+
155
+ const privateSource = skillsLock.sources?.find(
156
+ (source) => source.repository === 'https://github.com/TechsioCZ/skills',
157
+ );
158
+ const privateSkills = new Set(privateSource?.baseline?.map((skill) => skill.name));
159
+ for (const skillName of ['plan-graph', 'dag', 'subagent-graph', 'helm', 'debugger-mode']) {
160
+ if (!privateSkills.has(skillName)) {
161
+ console.error(`Missing private skill allowlist entry: ${skillName}`);
162
+ process.exit(1);
163
+ }
164
+ }
165
+
102
166
  console.log('Ultramodern contract check passed.');
@@ -14,5 +14,4 @@ export const bffEffectApi = HttpApi.make('BffApi').add(
14
14
  }),
15
15
  }),
16
16
  ),
17
- );
18
- {{/if}}
17
+ );{{/if}}
@@ -1,9 +1,7 @@
1
1
  import { defineRuntimeConfig } from '@modern-js/runtime';
2
2
 
3
3
  export default defineRuntimeConfig({
4
- {{#if isTanstackRouter}}
5
- router: {
4
+ {{#if isTanstackRouter}} router: {
6
5
  framework: 'tanstack',
7
- },
8
- {{/if}}
6
+ },{{/if}}
9
7
  });
@@ -4,7 +4,12 @@
4
4
  body {
5
5
  padding: 0;
6
6
  margin: 0;
7
- font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
7
+ font-family:
8
+ PingFang SC,
9
+ Hiragino Sans GB,
10
+ Microsoft YaHei,
11
+ Arial,
12
+ sans-serif;
8
13
  background: linear-gradient(to bottom, transparent, #fff) #eceeef;
9
14
  }
10
15
 
@@ -67,8 +72,14 @@ main {
67
72
  padding: 0.6rem 0.9rem;
68
73
  font-size: 1.05rem;
69
74
  font-family:
70
- Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
71
- Bitstream Vera Sans Mono, Courier New, monospace;
75
+ Menlo,
76
+ Monaco,
77
+ Lucida Console,
78
+ Liberation Mono,
79
+ DejaVu Sans Mono,
80
+ Bitstream Vera Sans Mono,
81
+ Courier New,
82
+ monospace;
72
83
  }
73
84
 
74
85
  .container-box .grid {