@cogito.ai/cli 0.4.2 → 0.4.4

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 (135) hide show
  1. package/README.md +29 -22
  2. package/dist/index.js +9 -15
  3. package/dist/templates/web-nextjs/.github/copilot-instructions.md +5 -6
  4. package/dist/templates/web-nextjs/README.md +25 -24
  5. package/dist/templates/web-nextjs/apps/docs/.source/browser.ts +1 -1
  6. package/dist/templates/web-nextjs/apps/docs/.source/server.ts +6 -6
  7. package/dist/templates/web-nextjs/apps/docs/app/docs/[[...slug]]/page.tsx +1 -6
  8. package/dist/templates/web-nextjs/apps/docs/app/docs/layout.tsx +1 -4
  9. package/dist/templates/web-nextjs/apps/docs/app/llms-full.txt/route.ts +3 -1
  10. package/dist/templates/web-nextjs/apps/docs/next-env.d.ts +1 -1
  11. package/dist/templates/web-nextjs/apps/web/.env.example +35 -0
  12. package/dist/templates/web-nextjs/apps/web/.github/copilot-instructions.md +53 -6
  13. package/dist/templates/web-nextjs/apps/web/.github/skills/impeccable/SKILL.md +55 -0
  14. package/dist/templates/web-nextjs/apps/web/DESIGN.md +65 -0
  15. package/dist/templates/web-nextjs/apps/web/messages/en.json +151 -5
  16. package/dist/templates/web-nextjs/apps/web/messages/zh.json +151 -5
  17. package/dist/templates/web-nextjs/apps/web/next-env.d.ts +1 -1
  18. package/dist/templates/web-nextjs/apps/web/next.config.ts +3 -3
  19. package/dist/templates/web-nextjs/apps/web/package.json +4 -0
  20. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/forgot-password/page.tsx +167 -38
  21. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/login/page.tsx +13 -3
  22. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/reset-password/page.tsx +4 -1
  23. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/signup/page.tsx +18 -17
  24. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/dashboard/page.tsx +1 -5
  25. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/payment/[paymentId]/page.tsx +88 -0
  26. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/payment/checkout/page.tsx +170 -0
  27. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/pricing/page.tsx +120 -0
  28. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/layout.tsx +45 -2
  29. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/profile/page.tsx +2 -8
  30. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/subscription/page.tsx +128 -0
  31. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/about/page.tsx +3 -6
  32. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/globals.css +17 -5
  33. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/help/page.tsx +1 -5
  34. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/layout.tsx +10 -8
  35. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/page.tsx +22 -6
  36. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/privacy/page.tsx +3 -6
  37. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/terms/page.tsx +1 -5
  38. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/create/route.ts +43 -0
  39. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/notify/route.ts +105 -0
  40. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/query/route.ts +54 -0
  41. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/return/route.ts +20 -0
  42. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/create/route.ts +52 -0
  43. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/create/route.ts +58 -0
  44. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/notify/route.ts +92 -0
  45. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/query/route.ts +54 -0
  46. package/dist/templates/web-nextjs/apps/web/src/app/auth/callback/route.ts +2 -3
  47. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/app-sidebar.tsx +13 -16
  48. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/chart-area-interactive.tsx +122 -146
  49. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/data-table.tsx +84 -149
  50. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-documents.tsx +7 -16
  51. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-main.tsx +4 -4
  52. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-secondary.tsx +4 -4
  53. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-user.tsx +12 -21
  54. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/page.tsx +10 -13
  55. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/section-cards.tsx +5 -9
  56. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/site-header.tsx +6 -7
  57. package/dist/templates/web-nextjs/apps/web/src/components/landing/features.tsx +63 -0
  58. package/dist/templates/web-nextjs/apps/web/src/components/landing/footer.tsx +48 -0
  59. package/dist/templates/web-nextjs/apps/web/src/components/landing/header.tsx +97 -0
  60. package/dist/templates/web-nextjs/apps/web/src/components/landing/hero.tsx +45 -0
  61. package/dist/templates/web-nextjs/apps/web/src/components/landing/how-it-works.tsx +35 -0
  62. package/dist/templates/web-nextjs/apps/web/src/components/landing/pricing-teaser.tsx +23 -0
  63. package/dist/templates/web-nextjs/apps/web/src/components/profile/profile-form.tsx +6 -4
  64. package/dist/templates/web-nextjs/apps/web/src/components/providers/theme-provider.tsx +16 -0
  65. package/dist/templates/web-nextjs/apps/web/src/components/ui/alert-dialog.tsx +32 -49
  66. package/dist/templates/web-nextjs/apps/web/src/components/ui/alert.tsx +16 -23
  67. package/dist/templates/web-nextjs/apps/web/src/components/ui/avatar.tsx +25 -38
  68. package/dist/templates/web-nextjs/apps/web/src/components/ui/badge.tsx +16 -18
  69. package/dist/templates/web-nextjs/apps/web/src/components/ui/breadcrumb.tsx +19 -26
  70. package/dist/templates/web-nextjs/apps/web/src/components/ui/button.tsx +23 -24
  71. package/dist/templates/web-nextjs/apps/web/src/components/ui/card.tsx +19 -36
  72. package/dist/templates/web-nextjs/apps/web/src/components/ui/chart.tsx +60 -94
  73. package/dist/templates/web-nextjs/apps/web/src/components/ui/checkbox.tsx +8 -11
  74. package/dist/templates/web-nextjs/apps/web/src/components/ui/collapsible.tsx +5 -17
  75. package/dist/templates/web-nextjs/apps/web/src/components/ui/command.tsx +25 -48
  76. package/dist/templates/web-nextjs/apps/web/src/components/ui/dialog.tsx +21 -35
  77. package/dist/templates/web-nextjs/apps/web/src/components/ui/drawer.tsx +24 -35
  78. package/dist/templates/web-nextjs/apps/web/src/components/ui/dropdown-menu.tsx +26 -55
  79. package/dist/templates/web-nextjs/apps/web/src/components/ui/field.tsx +62 -76
  80. package/dist/templates/web-nextjs/apps/web/src/components/ui/form.tsx +19 -34
  81. package/dist/templates/web-nextjs/apps/web/src/components/ui/input-otp.tsx +13 -20
  82. package/dist/templates/web-nextjs/apps/web/src/components/ui/input.tsx +6 -6
  83. package/dist/templates/web-nextjs/apps/web/src/components/ui/label.tsx +6 -6
  84. package/dist/templates/web-nextjs/apps/web/src/components/ui/pagination.tsx +21 -42
  85. package/dist/templates/web-nextjs/apps/web/src/components/ui/popover.tsx +16 -31
  86. package/dist/templates/web-nextjs/apps/web/src/components/ui/progress.tsx +5 -8
  87. package/dist/templates/web-nextjs/apps/web/src/components/ui/radio-group.tsx +8 -8
  88. package/dist/templates/web-nextjs/apps/web/src/components/ui/scroll-area.tsx +10 -12
  89. package/dist/templates/web-nextjs/apps/web/src/components/ui/select.tsx +26 -41
  90. package/dist/templates/web-nextjs/apps/web/src/components/ui/separator.tsx +7 -7
  91. package/dist/templates/web-nextjs/apps/web/src/components/ui/sheet.tsx +29 -38
  92. package/dist/templates/web-nextjs/apps/web/src/components/ui/sidebar.tsx +157 -189
  93. package/dist/templates/web-nextjs/apps/web/src/components/ui/skeleton.tsx +3 -3
  94. package/dist/templates/web-nextjs/apps/web/src/components/ui/slider.tsx +10 -15
  95. package/dist/templates/web-nextjs/apps/web/src/components/ui/sonner.tsx +13 -7
  96. package/dist/templates/web-nextjs/apps/web/src/components/ui/switch.tsx +9 -9
  97. package/dist/templates/web-nextjs/apps/web/src/components/ui/table.tsx +24 -48
  98. package/dist/templates/web-nextjs/apps/web/src/components/ui/tabs.tsx +21 -31
  99. package/dist/templates/web-nextjs/apps/web/src/components/ui/textarea.tsx +5 -5
  100. package/dist/templates/web-nextjs/apps/web/src/components/ui/theme-toggle.tsx +23 -0
  101. package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle-group.tsx +15 -16
  102. package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle.tsx +14 -15
  103. package/dist/templates/web-nextjs/apps/web/src/components/ui/tooltip.tsx +8 -12
  104. package/dist/templates/web-nextjs/apps/web/src/core/repositories/IAuthRepository.ts +2 -0
  105. package/dist/templates/web-nextjs/apps/web/src/core/types/auth.ts +1 -3
  106. package/dist/templates/web-nextjs/apps/web/src/features/auth/actions.ts +57 -1
  107. package/dist/templates/web-nextjs/apps/web/src/features/auth/index.ts +2 -0
  108. package/dist/templates/web-nextjs/apps/web/src/features/subscription/alipay/client.ts +36 -0
  109. package/dist/templates/web-nextjs/apps/web/src/features/subscription/alipay/server.ts +83 -0
  110. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/index.ts +4 -0
  111. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/pro-badge.tsx +9 -0
  112. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/pro-feature-comparison.tsx +70 -0
  113. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/quota-warning-banner.tsx +37 -0
  114. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/upgrade-button.tsx +42 -0
  115. package/dist/templates/web-nextjs/apps/web/src/features/subscription/hooks.ts +141 -0
  116. package/dist/templates/web-nextjs/apps/web/src/features/subscription/payment-helpers.ts +27 -0
  117. package/dist/templates/web-nextjs/apps/web/src/features/subscription/payment-service.ts +56 -0
  118. package/dist/templates/web-nextjs/apps/web/src/features/subscription/service.ts +55 -0
  119. package/dist/templates/web-nextjs/apps/web/src/features/subscription/types.ts +73 -0
  120. package/dist/templates/web-nextjs/apps/web/src/features/subscription/wechat/client.ts +33 -0
  121. package/dist/templates/web-nextjs/apps/web/src/features/subscription/wechat/server.ts +147 -0
  122. package/dist/templates/web-nextjs/apps/web/src/hooks/use-mobile.ts +4 -4
  123. package/dist/templates/web-nextjs/apps/web/src/i18n/config.ts +1 -1
  124. package/dist/templates/web-nextjs/apps/web/src/infra/db/SupabaseAuthRepository.ts +48 -4
  125. package/dist/templates/web-nextjs/apps/web/src/infra/db/client.ts +1 -4
  126. package/dist/templates/web-nextjs/apps/web/src/lib/supabase/admin.ts +23 -0
  127. package/dist/templates/web-nextjs/apps/web/src/lib/utils.ts +2 -2
  128. package/dist/templates/web-nextjs/apps/web/src/lib/validations/auth.ts +13 -0
  129. package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/client.ts +66 -0
  130. package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/crypto.ts +99 -0
  131. package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/types.ts +10 -0
  132. package/dist/templates/web-nextjs/apps/web/src/styles/tokens.css +58 -0
  133. package/dist/templates/web-nextjs/pnpm-lock.yaml +319 -0
  134. package/dist/templates/web-nextjs/supabase/migrations/20250608_add_subscription_tables.sql +125 -0
  135. package/package.json +1 -1
package/README.md CHANGED
@@ -41,23 +41,29 @@ Scaffold a new project from a template. Auto-detects the environment:
41
41
  - **TTY** → interactive prompts (human mode)
42
42
  - **Non-TTY / `--silent` / `--json`** → headless execution (agent/CI mode)
43
43
 
44
- | Flag | Type | Default | Description |
45
- | ---- | ---- | ------- | ----------- |
46
- | `--name` | string | required | Project name and target directory name |
47
- | `--template` | string | required | Template ID (e.g. `web-nextjs`) |
48
- | `--pm` | string | `pnpm` | Package manager: `pnpm` / `npm` / `yarn` / `bun` |
49
- | `--dir` | string | `./<name>` | Target directory (absolute or relative to cwd) |
50
- | `--json` | boolean | `false` | Output NDJSON result to stdout |
51
- | `--silent` | boolean | `false` | Suppress all output |
44
+ | Flag | Type | Default | Description |
45
+ | ------------ | ------- | ---------- | ------------------------------------------------ |
46
+ | `--name` | string | required | Project name and target directory name |
47
+ | `--template` | string | required | Template ID (e.g. `web-nextjs`) |
48
+ | `--pm` | string | `pnpm` | Package manager: `pnpm` / `npm` / `yarn` / `bun` |
49
+ | `--dir` | string | `./<name>` | Target directory (absolute or relative to cwd) |
50
+ | `--json` | boolean | `false` | Output NDJSON result to stdout |
51
+ | `--silent` | boolean | `false` | Suppress all output |
52
52
 
53
53
  **JSON output (success):**
54
+
54
55
  ```json
55
- {"ok":true,"targetDir":"/path/to/my-app","name":"my-app","template":"web-nextjs"}
56
+ { "ok": true, "targetDir": "/path/to/my-app", "name": "my-app", "template": "web-nextjs" }
56
57
  ```
57
58
 
58
59
  **JSON output (failure):**
60
+
59
61
  ```json
60
- {"ok":false,"error":"TARGET_DIR_EXISTS","message":"Directory already exists: /path/to/my-app"}
62
+ {
63
+ "ok": false,
64
+ "error": "TARGET_DIR_EXISTS",
65
+ "message": "Directory already exists: /path/to/my-app"
66
+ }
61
67
  ```
62
68
 
63
69
  **Error codes:** `MISSING_ARG` · `TEMPLATE_NOT_FOUND` · `TARGET_DIR_EXISTS` · `CLI_VERSION_OUTDATED` · `SCAFFOLD_FAILED`
@@ -74,12 +80,13 @@ agentdock mcp
74
80
 
75
81
  **Available tools:**
76
82
 
77
- | Tool | Description |
78
- | ---- | ----------- |
79
- | `list_templates` | List all available project templates |
83
+ | Tool | Description |
84
+ | ------------------ | ------------------------------------------ |
85
+ | `list_templates` | List all available project templates |
80
86
  | `scaffold_project` | Scaffold a project into a target directory |
81
87
 
82
88
  **VS Code Copilot MCP config (`.vscode/mcp.json`):**
89
+
83
90
  ```json
84
91
  {
85
92
  "servers": {
@@ -96,8 +103,8 @@ agentdock mcp
96
103
 
97
104
  ## Available Templates
98
105
 
99
- | Template ID | Description |
100
- | ----------- | ----------- |
106
+ | Template ID | Description |
107
+ | ------------ | ----------------------------------------------------------------------------------------------------- |
101
108
  | `web-nextjs` | Next.js 16 + Supabase + next-intl + Tailwind CSS v4 + Vitest + Fumadocs — full-stack monorepo starter |
102
109
 
103
110
  ---
@@ -125,13 +132,13 @@ All adapters share the same Core Executor (scaffold + registry)
125
132
 
126
133
  **Tech stack:**
127
134
 
128
- | Component | Role |
129
- | --------- | ---- |
130
- | [Bun](https://github.com/oven-sh/bun) | Build: single-file Node.js executable |
131
- | [Citty](https://github.com/unjs/citty) | Command modeling: sub-commands, flag schema, lazy loading |
132
- | [Clack](https://github.com/bombshell-dev/clack) | Human interaction: TTY prompts |
133
- | [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) | Agent protocol: MCP Stdio server |
134
- | [Changesets](https://github.com/changesets/changesets) | Release governance: semantic versioning + changelog |
135
+ | Component | Role |
136
+ | ---------------------------------------------------------------------------- | --------------------------------------------------------- |
137
+ | [Bun](https://github.com/oven-sh/bun) | Build: single-file Node.js executable |
138
+ | [Citty](https://github.com/unjs/citty) | Command modeling: sub-commands, flag schema, lazy loading |
139
+ | [Clack](https://github.com/bombshell-dev/clack) | Human interaction: TTY prompts |
140
+ | [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) | Agent protocol: MCP Stdio server |
141
+ | [Changesets](https://github.com/changesets/changesets) | Release governance: semantic versioning + changelog |
135
142
 
136
143
  ---
137
144
 
package/dist/index.js CHANGED
@@ -868,7 +868,7 @@ var package_default;
868
868
  var init_package = __esm(() => {
869
869
  package_default = {
870
870
  name: "@cogito.ai/cli",
871
- version: "0.4.2",
871
+ version: "0.4.4",
872
872
  type: "module",
873
873
  description: "AgentDock CLI – scaffold projects for humans and AI agents",
874
874
  publishConfig: {
@@ -913,14 +913,7 @@ var init_version = __esm(() => {
913
913
  });
914
914
 
915
915
  // src/core/scaffold.ts
916
- import {
917
- cpSync,
918
- existsSync as existsSync2,
919
- mkdirSync,
920
- readdirSync,
921
- readFileSync as readFileSync2,
922
- writeFileSync
923
- } from "fs";
916
+ import { cpSync, existsSync as existsSync2, mkdirSync, readdirSync, readFileSync as readFileSync2, writeFileSync } from "fs";
924
917
  import { join as join2, dirname as dirname2 } from "path";
925
918
  import { fileURLToPath as fileURLToPath2 } from "url";
926
919
  import { execSync } from "child_process";
@@ -16329,7 +16322,12 @@ var init_tools = __esm(() => {
16329
16322
  required: ["name", "template"]
16330
16323
  },
16331
16324
  async handler(input) {
16332
- const { name, template: templateId, targetDir, packageManager } = input;
16325
+ const {
16326
+ name,
16327
+ template: templateId,
16328
+ targetDir,
16329
+ packageManager
16330
+ } = input;
16333
16331
  const template = getTemplate(templateId);
16334
16332
  if (!template) {
16335
16333
  return {
@@ -16373,11 +16371,7 @@ var init_tools = __esm(() => {
16373
16371
  return { ok: true, template };
16374
16372
  }
16375
16373
  };
16376
- ALL_TOOLS = [
16377
- listTemplatesTool,
16378
- scaffoldProjectTool,
16379
- getTemplateSchemaTool
16380
- ];
16374
+ ALL_TOOLS = [listTemplatesTool, scaffoldProjectTool, getTemplateSchemaTool];
16381
16375
  });
16382
16376
 
16383
16377
  // src/adapters/mcp/server.ts
@@ -6,11 +6,11 @@
6
6
 
7
7
  This project is a turborepo + pnpm monorepo with two applications:
8
8
 
9
- | Directory | Purpose |
10
- | ------------ | -------------------------------------------------------------------- |
11
- | `apps/web/` | Main Next.js 16 application (four-layer contract, features, i18n) |
12
- | `apps/docs/` | Fumadocs documentation site (features, decisions, changelog, roadmap)|
13
- | `packages/` | Shared tooling packages (eslint-config, tsconfig) |
9
+ | Directory | Purpose |
10
+ | ------------ | --------------------------------------------------------------------- |
11
+ | `apps/web/` | Main Next.js 16 application (four-layer contract, features, i18n) |
12
+ | `apps/docs/` | Fumadocs documentation site (features, decisions, changelog, roadmap) |
13
+ | `packages/` | Shared tooling packages (eslint-config, tsconfig) |
14
14
 
15
15
  Run all commands from the monorepo root: `pnpm build`, `pnpm lint`, `pnpm test`, `pnpm check-types`.
16
16
 
@@ -62,4 +62,3 @@ When adding a new feature `apps/web/src/features/<name>/`:
62
62
  6. Create `apps/docs/content/docs/features/<name>.mdx` — feature documentation.
63
63
 
64
64
  Reference implementation: `apps/web/src/features/hello/`.
65
-
@@ -8,18 +8,18 @@ Designed for both human developers and AI coding agents.
8
8
 
9
9
  ## Tech Stack
10
10
 
11
- | Layer | Technology |
12
- |-------|-----------|
13
- | Framework | [Next.js 16](https://nextjs.org) (App Router) |
14
- | Language | [TypeScript 5+](https://www.typescriptlang.org) (strict mode) |
15
- | Styling | [Tailwind CSS v4](https://tailwindcss.com) |
16
- | Database / Auth | [Supabase](https://supabase.com) (`@supabase/ssr`) |
17
- | i18n | [next-intl](https://next-intl.dev) (en / zh out of the box) |
18
- | Testing | [Vitest](https://vitest.dev) |
19
- | Package manager | [pnpm](https://pnpm.io) ≥ 9 |
20
- | Runtime | Node.js ≥ 18 |
21
- | Governance | [OpenSpec](https://github.com/fission-ai/openspec) (`@fission-ai/openspec`) |
22
- | Monorepo | [Turborepo](https://turbo.build/repo) + pnpm workspaces |
11
+ | Layer | Technology |
12
+ | --------------- | --------------------------------------------------------------------------- |
13
+ | Framework | [Next.js 16](https://nextjs.org) (App Router) |
14
+ | Language | [TypeScript 5+](https://www.typescriptlang.org) (strict mode) |
15
+ | Styling | [Tailwind CSS v4](https://tailwindcss.com) |
16
+ | Database / Auth | [Supabase](https://supabase.com) (`@supabase/ssr`) |
17
+ | i18n | [next-intl](https://next-intl.dev) (en / zh out of the box) |
18
+ | Testing | [Vitest](https://vitest.dev) |
19
+ | Package manager | [pnpm](https://pnpm.io) ≥ 9 |
20
+ | Runtime | Node.js ≥ 18 |
21
+ | Governance | [OpenSpec](https://github.com/fission-ai/openspec) (`@fission-ai/openspec`) |
22
+ | Monorepo | [Turborepo](https://turbo.build/repo) + pnpm workspaces |
23
23
 
24
24
  ## Directory Structure
25
25
 
@@ -64,12 +64,12 @@ cp .env.example .env.local
64
64
 
65
65
  Open `.env.local` and fill in your values:
66
66
 
67
- | Variable | Where to find it |
68
- |----------|-----------------|
69
- | `NEXT_PUBLIC_SUPABASE_URL` | Supabase Dashboard → Project Settings → API → Project URL |
70
- | `NEXT_PUBLIC_SUPABASE_ANON_KEY` | Supabase Dashboard → Project Settings → API → anon / public |
71
- | `SUPABASE_SERVICE_ROLE_KEY` | Supabase Dashboard → Project Settings → API → service_role (server only) |
72
- | `NEXT_PUBLIC_APP_URL` | `http://localhost:3000` for local dev |
67
+ | Variable | Where to find it |
68
+ | ------------------------------- | ------------------------------------------------------------------------ |
69
+ | `NEXT_PUBLIC_SUPABASE_URL` | Supabase Dashboard → Project Settings → API → Project URL |
70
+ | `NEXT_PUBLIC_SUPABASE_ANON_KEY` | Supabase Dashboard → Project Settings → API → anon / public |
71
+ | `SUPABASE_SERVICE_ROLE_KEY` | Supabase Dashboard → Project Settings → API → service_role (server only) |
72
+ | `NEXT_PUBLIC_APP_URL` | `http://localhost:3000` for local dev |
73
73
 
74
74
  ### 4. Set up Supabase Auth (required for login / signup)
75
75
 
@@ -129,6 +129,7 @@ apps/web/src/features/<your-feature>/
129
129
  ```
130
130
 
131
131
  Rules:
132
+
132
133
  - Features import from `apps/web/src/core/` (domain interfaces) — never from `apps/web/src/infra/` directly.
133
134
  - Every feature directory **must** have `__contract__.ts` (ESLint enforces this).
134
135
  - Add translations to `apps/web/messages/en.json` and `apps/web/messages/zh.json`.
@@ -193,12 +194,12 @@ See `openspec/config.yaml` for project-specific governance rules.
193
194
 
194
195
  ## Environment Variables Reference
195
196
 
196
- | Variable | Required | Exposed to browser | Description |
197
- |----------|----------|--------------------|-------------|
198
- | `NEXT_PUBLIC_SUPABASE_URL` | ✅ | ✅ | Supabase project URL |
199
- | `NEXT_PUBLIC_SUPABASE_ANON_KEY` | ✅ | ✅ | Supabase anon key (RLS protected) |
200
- | `SUPABASE_SERVICE_ROLE_KEY` | Optional | ❌ | Admin key, bypasses RLS |
201
- | `NEXT_PUBLIC_APP_URL` | Optional | ✅ | Canonical app URL |
197
+ | Variable | Required | Exposed to browser | Description |
198
+ | ------------------------------- | -------- | ------------------ | --------------------------------- |
199
+ | `NEXT_PUBLIC_SUPABASE_URL` | ✅ | ✅ | Supabase project URL |
200
+ | `NEXT_PUBLIC_SUPABASE_ANON_KEY` | ✅ | ✅ | Supabase anon key (RLS protected) |
201
+ | `SUPABASE_SERVICE_ROLE_KEY` | Optional | ❌ | Admin key, bypasses RLS |
202
+ | `NEXT_PUBLIC_APP_URL` | Optional | ✅ | Canonical app URL |
202
203
 
203
204
  > Variables prefixed with `NEXT_PUBLIC_` are bundled into client-side JavaScript.
204
205
  > Never put secrets in `NEXT_PUBLIC_*` variables.
@@ -7,6 +7,6 @@ const create = browser<typeof Config, import("fumadocs-mdx/runtime/types").Inter
7
7
  }
8
8
  }>();
9
9
  const browserCollections = {
10
- docs: create.doc("docs", {"index.mdx": () => import("../content/docs/index.mdx?collection=docs"), "changelog/index.mdx": () => import("../content/docs/changelog/index.mdx?collection=docs"), "decisions/turbo-package-manager.mdx": () => import("../content/docs/decisions/turbo-package-manager.mdx?collection=docs"), "features/auth.mdx": () => import("../content/docs/features/auth.mdx?collection=docs"), "features/hello.mdx": () => import("../content/docs/features/hello.mdx?collection=docs"), "roadmap/index.mdx": () => import("../content/docs/roadmap/index.mdx?collection=docs"), }),
10
+ docs: create.doc("docs", {"index.mdx": () => import("../content/docs/index.mdx?collection=docs"), "changelog/index.mdx": () => import("../content/docs/changelog/index.mdx?collection=docs"), "features/auth.mdx": () => import("../content/docs/features/auth.mdx?collection=docs"), "features/hello.mdx": () => import("../content/docs/features/hello.mdx?collection=docs"), "decisions/turbo-package-manager.mdx": () => import("../content/docs/decisions/turbo-package-manager.mdx?collection=docs"), "roadmap/index.mdx": () => import("../content/docs/roadmap/index.mdx?collection=docs"), }),
11
11
  };
12
12
  export default browserCollections;
@@ -1,13 +1,13 @@
1
1
  // @ts-nocheck
2
2
  import * as __fd_glob_10 from "../content/docs/roadmap/index.mdx?collection=docs"
3
- import * as __fd_glob_9 from "../content/docs/features/hello.mdx?collection=docs"
4
- import * as __fd_glob_8 from "../content/docs/features/auth.mdx?collection=docs"
5
- import * as __fd_glob_7 from "../content/docs/decisions/turbo-package-manager.mdx?collection=docs"
3
+ import * as __fd_glob_9 from "../content/docs/decisions/turbo-package-manager.mdx?collection=docs"
4
+ import * as __fd_glob_8 from "../content/docs/features/hello.mdx?collection=docs"
5
+ import * as __fd_glob_7 from "../content/docs/features/auth.mdx?collection=docs"
6
6
  import * as __fd_glob_6 from "../content/docs/changelog/index.mdx?collection=docs"
7
7
  import * as __fd_glob_5 from "../content/docs/index.mdx?collection=docs"
8
8
  import { default as __fd_glob_4 } from "../content/docs/roadmap/meta.json?collection=docs"
9
- import { default as __fd_glob_3 } from "../content/docs/decisions/meta.json?collection=docs"
10
- import { default as __fd_glob_2 } from "../content/docs/features/meta.json?collection=docs"
9
+ import { default as __fd_glob_3 } from "../content/docs/features/meta.json?collection=docs"
10
+ import { default as __fd_glob_2 } from "../content/docs/decisions/meta.json?collection=docs"
11
11
  import { default as __fd_glob_1 } from "../content/docs/changelog/meta.json?collection=docs"
12
12
  import { default as __fd_glob_0 } from "../content/docs/meta.json?collection=docs"
13
13
  import { server } from 'fumadocs-mdx/runtime/server';
@@ -18,4 +18,4 @@ const create = server<typeof Config, import("fumadocs-mdx/runtime/types").Intern
18
18
  }
19
19
  }>({"doc":{"passthroughs":["extractedReferences"]}});
20
20
 
21
- export const docs = await create.docs("docs", "content/docs", {"meta.json": __fd_glob_0, "changelog/meta.json": __fd_glob_1, "features/meta.json": __fd_glob_2, "decisions/meta.json": __fd_glob_3, "roadmap/meta.json": __fd_glob_4, }, {"index.mdx": __fd_glob_5, "changelog/index.mdx": __fd_glob_6, "decisions/turbo-package-manager.mdx": __fd_glob_7, "features/auth.mdx": __fd_glob_8, "features/hello.mdx": __fd_glob_9, "roadmap/index.mdx": __fd_glob_10, });
21
+ export const docs = await create.docs("docs", "content/docs", {"meta.json": __fd_glob_0, "changelog/meta.json": __fd_glob_1, "decisions/meta.json": __fd_glob_2, "features/meta.json": __fd_glob_3, "roadmap/meta.json": __fd_glob_4, }, {"index.mdx": __fd_glob_5, "changelog/index.mdx": __fd_glob_6, "features/auth.mdx": __fd_glob_7, "features/hello.mdx": __fd_glob_8, "decisions/turbo-package-manager.mdx": __fd_glob_9, "roadmap/index.mdx": __fd_glob_10, });
@@ -1,10 +1,5 @@
1
1
  import { source } from '@/lib/source'
2
- import {
3
- DocsBody,
4
- DocsDescription,
5
- DocsPage,
6
- DocsTitle,
7
- } from 'fumadocs-ui/layouts/docs/page'
2
+ import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/layouts/docs/page'
8
3
  import { notFound } from 'next/navigation'
9
4
 
10
5
  export default async function Page(props: { params: Promise<{ slug?: string[] }> }) {
@@ -4,10 +4,7 @@ import type { ReactNode } from 'react'
4
4
 
5
5
  export default function Layout({ children }: { children: ReactNode }) {
6
6
  return (
7
- <DocsLayout
8
- tree={source.getPageTree()}
9
- nav={{ title: 'Docs' }}
10
- >
7
+ <DocsLayout tree={source.getPageTree()} nav={{ title: 'Docs' }}>
11
8
  {children}
12
9
  </DocsLayout>
13
10
  )
@@ -5,7 +5,9 @@ export const revalidate = false
5
5
  export async function GET() {
6
6
  const pages = source.getPages()
7
7
  const texts = await Promise.all(
8
- pages.map(async (page) => `# ${page.data.title} (${page.url})\n\n${page.data.description ?? ''}`)
8
+ pages.map(
9
+ async (page) => `# ${page.data.title} (${page.url})\n\n${page.data.description ?? ''}`,
10
+ ),
9
11
  )
10
12
  return new Response(texts.join('\n\n'))
11
13
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- import "./.next/types/routes.d.ts";
3
+ import './.next/types/routes.d.ts'
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -24,3 +24,38 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
24
24
  # Default locale used for root redirects and i18n fallback
25
25
  # Allowed values: en, zh
26
26
  APP_DEFAULT_LOCALE=zh
27
+
28
+ # ──────────────────────────────────────────────────────────────────────────────
29
+ # Alipay Payment (Optional)
30
+ # Get these from: Alipay Open Platform → App Center → your app
31
+ # Sandbox: https://open.alipay.com/develop/sandbox
32
+ # ──────────────────────────────────────────────────────────────────────────────
33
+ ALIPAY_APP_ID=<your-app-id>
34
+ ALIPAY_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY-----
35
+ <your-private-key>
36
+ -----END RSA PRIVATE KEY-----
37
+ ALIPAY_PUBLIC_KEY=-----BEGIN PUBLIC KEY-----
38
+ <your-public-key>
39
+ -----END PUBLIC KEY-----
40
+ # Sandbox gateway (uncomment for sandbox testing):
41
+ # ALIPAY_GATEWAY=https://openapi-sandbox.dl.alipaydev.com/gateway.do
42
+ ALIPAY_NOTIFY_URL=https://your-domain.com/api/payments/alipay/notify
43
+
44
+ # ──────────────────────────────────────────────────────────────────────────────
45
+ # WeChat Pay (Optional)
46
+ # Get these from: WeChat Pay Merchant Platform
47
+ # ──────────────────────────────────────────────────────────────────────────────
48
+ WECHAT_PAY_APP_ID=wx<your-app-id>
49
+ WECHAT_PAY_MCH_ID=<your-mch-id>
50
+ WECHAT_PAY_API_V3_KEY=<your-32-char-apiv3-key>
51
+ WECHAT_PAY_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----
52
+ <your-private-key>
53
+ -----END PRIVATE KEY-----
54
+ WECHAT_PAY_SERIAL_NO=<your-cert-serial-no>
55
+ # Platform public key (download from GET /v3/certificates)
56
+ WECHAT_PAY_PLATFORM_PUBLIC_KEY=-----BEGIN PUBLIC KEY-----
57
+ <platform-public-key>
58
+ -----END PUBLIC KEY-----
59
+ # Domestic: https://api.mch.weixin.qq.com; Overseas: https://apihk.mch.weixin.qq.com
60
+ WECHAT_PAY_BASE_URL=https://api.mch.weixin.qq.com
61
+ WECHAT_PAY_NOTIFY_URL=https://your-domain.com/api/payments/wechat/notify
@@ -6,11 +6,11 @@
6
6
 
7
7
  This project is a turborepo + pnpm monorepo with two applications:
8
8
 
9
- | Directory | Purpose |
10
- | ------------ | -------------------------------------------------------------------- |
11
- | `apps/web/` | Main Next.js 16 application (four-layer contract, features, i18n) |
12
- | `apps/docs/` | Fumadocs documentation site (features, decisions, changelog, roadmap)|
13
- | `packages/` | Shared tooling packages (eslint-config, tsconfig) |
9
+ | Directory | Purpose |
10
+ | ------------ | --------------------------------------------------------------------- |
11
+ | `apps/web/` | Main Next.js 16 application (four-layer contract, features, i18n) |
12
+ | `apps/docs/` | Fumadocs documentation site (features, decisions, changelog, roadmap) |
13
+ | `packages/` | Shared tooling packages (eslint-config, tsconfig) |
14
14
 
15
15
  Run all commands from the monorepo root: `pnpm build`, `pnpm lint`, `pnpm test`, `pnpm check-types`.
16
16
 
@@ -34,6 +34,53 @@ Four rules are enforced at `error` severity in `apps/web/src/features/**`. Viola
34
34
  3. **`no-cross-feature`** — Features must not directly import from sibling feature internals. Import through the feature's `index.ts` only.
35
35
  4. **`no-core-mutation`** — `apps/web/src/core/` is read-only. Features and infra must not modify core types or interfaces in-place.
36
36
 
37
+ ## CSS Design System
38
+
39
+ This project uses a token-based CSS design system. **Always use semantic tokens**, not arbitrary Tailwind values.
40
+
41
+ ### Token Usage Rules
42
+
43
+ | Rule | Do This | Not This |
44
+ | --------------- | --------------------------------------- | ------------------------- |
45
+ | Background | `bg-surface`, `bg-surface-elevated` | `bg-gray-100`, `bg-white` |
46
+ | Text muted | `text-muted-foreground` | `text-gray-500` |
47
+ | Border | `border-border` | `border-gray-200` |
48
+ | Primary | `bg-primary`, `text-primary-foreground` | `bg-blue-500` |
49
+ | Section padding | `p-[var(--space-section)]` or `clamp()` | Hardcoded `px-16 py-24` |
50
+
51
+ ### Tailwind `@theme` Registration
52
+
53
+ The following semantic tokens are registered in `globals.css` `@theme` and available as Tailwind utilities:
54
+
55
+ - `--color-surface`, `--color-surface-elevated`
56
+ - `--color-muted-custom`, `--color-muted-foreground-custom`
57
+ - `--color-border-custom`
58
+ - `--color-primary-custom`, `--color-primary-foreground-custom`
59
+
60
+ ## Responsive Design Rules (Mobile-First)
61
+
62
+ - **DEFAULT**: Write mobile styles first (unprefixed Tailwind classes)
63
+ - **ENHANCEMENT**: Add desktop styles with `md:` / `lg:` prefixes
64
+ - **FORBIDDEN**: Never use `max-md:` / `max-lg:` downgrade patterns
65
+ - **Section spacing**: Use `clamp(32px, 8vw, 80px)` for section padding
66
+ - **Hero font**: Use `clamp(2rem, 5vw + 1rem, 4rem)` for hero titles
67
+ - **Touch targets**: All buttons and links must be at least `min-h-[44px] min-w-[44px]`
68
+ - **Container queries**: Use `@container` for component-level responsiveness (e.g., feature cards)
69
+
70
+ ## UI Anti-Patterns (AI Slop)
71
+
72
+ The following patterns are **strictly forbidden**. AI must self-check before generating UI:
73
+
74
+ 1. **Inter + Roboto font dominance** — Geist is the primary font.
75
+ 2. **Purple-to-blue gradients** — `from-purple-* to-blue-*` is banned.
76
+ 3. **Nested rounded cards** — No `rounded-xl` inside `rounded-xl`.
77
+ 4. **Pure black / pure gray text** — All neutrals must carry subtle hue.
78
+ 5. **Bounce / elastic easing** — No bounce or spring animations.
79
+ 6. **Neon glowing header text** — No text-shadow glow on dark backgrounds.
80
+ 7. **Icon tile above every heading** — No rounded square icon tiles above section headings.
81
+
82
+ Reference: `DESIGN.md` for full design system context.
83
+
37
84
  ## Docs Co-evolution
38
85
 
39
86
  Documentation lives alongside the application and grows with it:
@@ -49,6 +96,7 @@ Documentation lives alongside the application and grows with it:
49
96
  3. **Conventional commits** — `type(scope): summary` format required.
50
97
  4. **pnpm only** — Do not use `npm install` or `yarn`. Always `pnpm add`.
51
98
  5. **ESLint config** — Architecture rules come from `packages/eslint-config/features.js`.
99
+ 6. **Design system** — Use semantic tokens from `tokens.css`. Never hardcode colors or spacing.
52
100
 
53
101
  ## Feature Development Pattern
54
102
 
@@ -62,4 +110,3 @@ When adding a new feature `apps/web/src/features/<name>/`:
62
110
  6. Create `apps/docs/content/docs/features/<name>.mdx` — feature documentation.
63
111
 
64
112
  Reference implementation: `apps/web/src/features/hello/`.
65
-
@@ -0,0 +1,55 @@
1
+ # Impeccable Design Skill
2
+
3
+ > Skill for enforcing high-quality UI design and catching AI Slop in AI-generated code.
4
+
5
+ ## Overview
6
+
7
+ Impeccable is a design quality assurance skill that helps AI Coding Agents produce refined, non-generic UI by enforcing design system constraints and catching common AI-generated anti-patterns.
8
+
9
+ ## Commands
10
+
11
+ ### `/impeccable init`
12
+
13
+ Initialize design context. Reads `DESIGN.md` and `PRODUCT.md` (if exists) to establish design baseline.
14
+
15
+ ### `/impeccable craft <component>`
16
+
17
+ Generate a component following the design system in `DESIGN.md`. Uses semantic tokens, OKLCH colors, and mobile-first responsive patterns.
18
+
19
+ ### `/impeccable critique <area>`
20
+
21
+ Review UI for design quality issues: spacing, color consistency, typography, contrast, accessibility.
22
+
23
+ ### `/impeccable polish`
24
+
25
+ Apply spacing/typography/color fixes based on DESIGN.md constraints. Fixes minor inconsistencies.
26
+
27
+ ### `/impeccable adapt`
28
+
29
+ Check and fix responsive behavior at 375px, 768px, and 1280px breakpoints.
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ npx impeccable skills install
35
+ ```
36
+
37
+ This creates `.github/skills/impeccable/` with this SKILL.md.
38
+
39
+ ## Anti-Patterns Detected
40
+
41
+ 1. Inter/Roboto font dominance
42
+ 2. Purple-to-blue gradients
43
+ 3. Nested rounded cards
44
+ 4. Pure black/gray text
45
+ 5. Bounce/elastic animations
46
+ 6. Neon glowing header text
47
+ 7. Icon tile above every heading
48
+
49
+ ## CI Integration
50
+
51
+ ```bash
52
+ npx impeccable detect src/ --fast --json
53
+ ```
54
+
55
+ Run in CI to detect AI Slop. Returns JSON report with findings.
@@ -0,0 +1,65 @@
1
+ # AgentDock Web Template — Design System
2
+
3
+ > This document serves as the design context anchor for AI Coding Agents. Every UI generation must reference this file before producing components.
4
+
5
+ ## Project Type & Design Positioning
6
+
7
+ - **Type**: SaaS starter template (B2B/B2C universal)
8
+ - **Style**: Clean / Professional / Modern
9
+ - **Philosophy**: Not minimal, not flashy. Purposeful, trustworthy, and easy to extend.
10
+
11
+ ## Typography System
12
+
13
+ | Token | Value | Usage |
14
+ | ---------------- | ------------------------- | ------------------------- |
15
+ | `--font-heading` | Geist Sans | Headlines, hero text, nav |
16
+ | `--font-body` | Geist Sans | Body text, UI labels |
17
+ | Fallback | `system-ui`, `sans-serif` | Geist loading failure |
18
+
19
+ - **Font scale**: `--text-xs` (0.75rem) → `--text-4xl` (2.25rem)
20
+ - **Hero title**: `clamp(2rem, 5vw + 1rem, 4rem)` — responsive, fluid
21
+ - **Body line-height**: 1.6 for readability
22
+
23
+ ## Color Strategy (OKLCH)
24
+
25
+ Brand color is defined via OKLCH hue/chroma/lightness variables:
26
+
27
+ - `--color-brand-h: 262`, `--color-brand-c: 0.26`, `--color-brand-l: 0.56`
28
+ - Override these three variables to retheme the entire application.
29
+
30
+ ### Semantic Tokens
31
+
32
+ | Token | Light | Dark | Usage |
33
+ | -------------------------- | ---------------- | --------------- | ---------------------- |
34
+ | `--color-surface` | oklch(0.985 ...) | oklch(0.13 ...) | Page backgrounds |
35
+ | `--color-surface-elevated` | oklch(1 ...) | oklch(0.18 ...) | Cards, modals |
36
+ | `--color-muted` | oklch(0.94 ...) | oklch(0.22 ...) | Secondary backgrounds |
37
+ | `--color-muted-foreground` | oklch(0.52 ...) | oklch(0.62 ...) | Placeholder, meta text |
38
+ | `--color-border` | oklch(0.88 ...) | oklch(0.28 ...) | Dividers, borders |
39
+
40
+ ## Spacing System
41
+
42
+ - **Baseline**: 4px (`--space-1`)
43
+ - **Section spacing**: `clamp(64px, 10vw, 120px)` — never hardcode section padding
44
+ - **Touch targets**: Minimum `44px x 44px` for all interactive elements
45
+
46
+ ## 7 AI Slop Anti-Patterns (FORBIDDEN)
47
+
48
+ When generating or reviewing UI, the following patterns are **strictly forbidden**:
49
+
50
+ 1. **Inter + Roboto font dominance** — Geist is the primary font. Do not fall back to Inter as the main font.
51
+ 2. **Purple-to-blue gradients** — `from-purple-* to-blue-*` is banned. Use `--color-primary` or solid colors.
52
+ 3. **Nested rounded cards** — Do not place `rounded-xl` cards inside `rounded-xl` cards. One level of radius is enough.
53
+ 4. **Pure black / pure gray text** — All grays must carry a subtle hue (our neutrals are tinted).
54
+ 5. **Bounce / elastic easing** — No `bounce`, `elastic`, or spring animations. Use `ease-out` or `cubic-bezier(0.4, 0, 0.2, 1)`.
55
+ 6. **Neon glowing header text on dark backgrounds** — No text-shadow glow effects. Keep it clean.
56
+ 7. **Icon tile above every heading** — Do not place a rounded square icon tile above every section heading. Use icon + heading inline or omit.
57
+
58
+ ## Impeccable Workflow
59
+
60
+ When designing new pages or sections, follow this workflow:
61
+
62
+ 1. **Craft** (`/impeccable craft`) — Generate initial design based on DESIGN.md context
63
+ 2. **Critique** (`/impeccable critique`) — Review for spacing, color, typography consistency
64
+ 3. **Polish** (`/impeccable polish`) — Fix spacing, font sizes, color values
65
+ 4. **Adapt** (`/impeccable adapt`) — Ensure responsive at 375px / 768px / 1280px