@mison/ag-kit-cn 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
  2. package/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
  3. package/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
  4. package/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
  5. package/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
  6. package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
  7. package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
  8. package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  9. package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  10. package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  11. package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  12. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  13. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  14. package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  15. package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
  16. package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  17. package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  18. package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  19. package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  20. package/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
  21. package/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
  22. package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  23. package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  24. package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
  25. package/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
  26. package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
  27. package/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
  28. package/.agent/ARCHITECTURE.md +285 -0
  29. package/.agent/agents/backend-specialist.md +268 -0
  30. package/.agent/agents/code-archaeologist.md +106 -0
  31. package/.agent/agents/database-architect.md +225 -0
  32. package/.agent/agents/debugger.md +225 -0
  33. package/.agent/agents/devops-engineer.md +242 -0
  34. package/.agent/agents/documentation-writer.md +104 -0
  35. package/.agent/agents/explorer-agent.md +73 -0
  36. package/.agent/agents/frontend-specialist.md +618 -0
  37. package/.agent/agents/game-developer.md +162 -0
  38. package/.agent/agents/mobile-developer.md +382 -0
  39. package/.agent/agents/orchestrator.md +438 -0
  40. package/.agent/agents/penetration-tester.md +188 -0
  41. package/.agent/agents/performance-optimizer.md +187 -0
  42. package/.agent/agents/product-manager.md +112 -0
  43. package/.agent/agents/product-owner.md +95 -0
  44. package/.agent/agents/project-planner.md +405 -0
  45. package/.agent/agents/qa-automation-engineer.md +103 -0
  46. package/.agent/agents/security-auditor.md +170 -0
  47. package/.agent/agents/seo-specialist.md +111 -0
  48. package/.agent/agents/test-engineer.md +158 -0
  49. package/.agent/mcp_config.json +12 -0
  50. package/.agent/rules/GEMINI.md +273 -0
  51. package/.agent/scripts/auto_preview.py +148 -0
  52. package/.agent/scripts/checklist.py +217 -0
  53. package/.agent/scripts/session_manager.py +120 -0
  54. package/.agent/scripts/verify_all.py +327 -0
  55. package/.agent/skills/api-patterns/SKILL.md +84 -0
  56. package/.agent/skills/api-patterns/api-style.md +42 -0
  57. package/.agent/skills/api-patterns/auth.md +24 -0
  58. package/.agent/skills/api-patterns/documentation.md +26 -0
  59. package/.agent/skills/api-patterns/graphql.md +41 -0
  60. package/.agent/skills/api-patterns/rate-limiting.md +31 -0
  61. package/.agent/skills/api-patterns/response.md +37 -0
  62. package/.agent/skills/api-patterns/rest.md +40 -0
  63. package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  64. package/.agent/skills/api-patterns/security-testing.md +122 -0
  65. package/.agent/skills/api-patterns/trpc.md +41 -0
  66. package/.agent/skills/api-patterns/versioning.md +22 -0
  67. package/.agent/skills/app-builder/SKILL.md +75 -0
  68. package/.agent/skills/app-builder/agent-coordination.md +74 -0
  69. package/.agent/skills/app-builder/feature-building.md +53 -0
  70. package/.agent/skills/app-builder/project-detection.md +34 -0
  71. package/.agent/skills/app-builder/scaffolding.md +118 -0
  72. package/.agent/skills/app-builder/tech-stack.md +40 -0
  73. package/.agent/skills/app-builder/templates/SKILL.md +39 -0
  74. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  75. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  76. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  77. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  78. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  79. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  80. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  81. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
  82. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
  83. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
  84. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
  85. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  86. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
  87. package/.agent/skills/architecture/SKILL.md +57 -0
  88. package/.agent/skills/architecture/context-discovery.md +43 -0
  89. package/.agent/skills/architecture/examples.md +94 -0
  90. package/.agent/skills/architecture/pattern-selection.md +68 -0
  91. package/.agent/skills/architecture/patterns-reference.md +50 -0
  92. package/.agent/skills/architecture/trade-off-analysis.md +77 -0
  93. package/.agent/skills/bash-linux/SKILL.md +201 -0
  94. package/.agent/skills/behavioral-modes/SKILL.md +264 -0
  95. package/.agent/skills/brainstorming/SKILL.md +164 -0
  96. package/.agent/skills/brainstorming/dynamic-questioning.md +359 -0
  97. package/.agent/skills/clean-code/SKILL.md +200 -0
  98. package/.agent/skills/code-review-checklist/SKILL.md +125 -0
  99. package/.agent/skills/database-design/SKILL.md +54 -0
  100. package/.agent/skills/database-design/database-selection.md +43 -0
  101. package/.agent/skills/database-design/indexing.md +39 -0
  102. package/.agent/skills/database-design/migrations.md +50 -0
  103. package/.agent/skills/database-design/optimization.md +36 -0
  104. package/.agent/skills/database-design/orm-selection.md +30 -0
  105. package/.agent/skills/database-design/schema-design.md +56 -0
  106. package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
  107. package/.agent/skills/deployment-procedures/SKILL.md +241 -0
  108. package/.agent/skills/doc.md +177 -0
  109. package/.agent/skills/documentation-templates/SKILL.md +194 -0
  110. package/.agent/skills/frontend-design/SKILL.md +418 -0
  111. package/.agent/skills/frontend-design/animation-guide.md +331 -0
  112. package/.agent/skills/frontend-design/color-system.md +307 -0
  113. package/.agent/skills/frontend-design/decision-trees.md +418 -0
  114. package/.agent/skills/frontend-design/motion-graphics.md +306 -0
  115. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  116. package/.agent/skills/frontend-design/scripts/ux_audit.py +727 -0
  117. package/.agent/skills/frontend-design/typography-system.md +345 -0
  118. package/.agent/skills/frontend-design/ux-psychology.md +1118 -0
  119. package/.agent/skills/frontend-design/visual-effects.md +383 -0
  120. package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
  121. package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
  122. package/.agent/skills/game-development/SKILL.md +167 -0
  123. package/.agent/skills/game-development/game-art/SKILL.md +185 -0
  124. package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
  125. package/.agent/skills/game-development/game-design/SKILL.md +129 -0
  126. package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
  127. package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
  128. package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
  129. package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
  130. package/.agent/skills/game-development/web-games/SKILL.md +150 -0
  131. package/.agent/skills/geo-fundamentals/SKILL.md +155 -0
  132. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  133. package/.agent/skills/i18n-localization/SKILL.md +154 -0
  134. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  135. package/.agent/skills/intelligent-routing/SKILL.md +335 -0
  136. package/.agent/skills/lint-and-validate/SKILL.md +44 -0
  137. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
  138. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  139. package/.agent/skills/mcp-builder/SKILL.md +176 -0
  140. package/.agent/skills/mobile-design/SKILL.md +394 -0
  141. package/.agent/skills/mobile-design/decision-trees.md +516 -0
  142. package/.agent/skills/mobile-design/mobile-backend.md +491 -0
  143. package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
  144. package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
  145. package/.agent/skills/mobile-design/mobile-design-thinking.md +355 -0
  146. package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
  147. package/.agent/skills/mobile-design/mobile-performance.md +767 -0
  148. package/.agent/skills/mobile-design/mobile-testing.md +356 -0
  149. package/.agent/skills/mobile-design/mobile-typography.md +432 -0
  150. package/.agent/skills/mobile-design/platform-android.md +666 -0
  151. package/.agent/skills/mobile-design/platform-ios.md +561 -0
  152. package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
  153. package/.agent/skills/mobile-design/touch-psychology.md +537 -0
  154. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +311 -0
  155. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +241 -0
  156. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +489 -0
  157. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +263 -0
  158. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  159. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +431 -0
  160. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +683 -0
  161. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +149 -0
  162. package/.agent/skills/nextjs-react-expert/SKILL.md +286 -0
  163. package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  164. package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
  165. package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
  166. package/.agent/skills/parallel-agents/SKILL.md +194 -0
  167. package/.agent/skills/performance-profiling/SKILL.md +149 -0
  168. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  169. package/.agent/skills/plan-writing/SKILL.md +152 -0
  170. package/.agent/skills/powershell-windows/SKILL.md +166 -0
  171. package/.agent/skills/python-patterns/SKILL.md +441 -0
  172. package/.agent/skills/red-team-tactics/SKILL.md +203 -0
  173. package/.agent/skills/rust-pro/SKILL.md +190 -0
  174. package/.agent/skills/seo-fundamentals/SKILL.md +135 -0
  175. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +215 -0
  176. package/.agent/skills/server-management/SKILL.md +161 -0
  177. package/.agent/skills/systematic-debugging/SKILL.md +114 -0
  178. package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
  179. package/.agent/skills/tdd-workflow/SKILL.md +149 -0
  180. package/.agent/skills/testing-patterns/SKILL.md +178 -0
  181. package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
  182. package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
  183. package/.agent/skills/vulnerability-scanner/checklists.md +131 -0
  184. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +459 -0
  185. package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
  186. package/.agent/skills/webapp-testing/SKILL.md +187 -0
  187. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  188. package/.agent/workflows/brainstorm.md +113 -0
  189. package/.agent/workflows/create.md +59 -0
  190. package/.agent/workflows/debug.md +103 -0
  191. package/.agent/workflows/deploy.md +176 -0
  192. package/.agent/workflows/enhance.md +63 -0
  193. package/.agent/workflows/orchestrate.md +242 -0
  194. package/.agent/workflows/plan.md +89 -0
  195. package/.agent/workflows/preview.md +80 -0
  196. package/.agent/workflows/restore-localize-compat.md +525 -0
  197. package/.agent/workflows/status.md +86 -0
  198. package/.agent/workflows/test.md +144 -0
  199. package/.agent/workflows/ui-ux-pro-max.md +295 -0
  200. package/AGENT_FLOW.md +609 -0
  201. package/CHANGELOG.md +68 -0
  202. package/LICENSE +21 -0
  203. package/README.md +260 -0
  204. package/bin/adapters/base.js +63 -0
  205. package/bin/adapters/codex.js +391 -0
  206. package/bin/adapters/gemini.js +137 -0
  207. package/bin/ag-kit.js +1336 -0
  208. package/bin/core/builder.js +80 -0
  209. package/bin/core/generator.js +59 -0
  210. package/bin/core/resource-loader.js +64 -0
  211. package/bin/core/transformer.js +208 -0
  212. package/bin/interactive.js +65 -0
  213. package/bin/utils/atomic-writer.js +97 -0
  214. package/bin/utils/git-helper.js +68 -0
  215. package/bin/utils/managed-block.js +65 -0
  216. package/bin/utils/manifest.js +241 -0
  217. package/bin/utils.js +82 -0
  218. package/docs/codex-rules-template.md +36 -0
  219. package/docs/mapping-spec.md +68 -0
  220. package/docs/multi-target-adapter.md +80 -0
  221. package/docs/official/README.md +53 -0
  222. package/docs/official/antigravity/agent-modes-settings.md +64 -0
  223. package/docs/official/antigravity/rules-workflows.md +96 -0
  224. package/docs/official/antigravity/skills.md +147 -0
  225. package/docs/official/codex/agents-md.md +119 -0
  226. package/docs/official/codex/config-advanced.md +358 -0
  227. package/docs/official/codex/config-basic.md +141 -0
  228. package/docs/official/codex/config-reference.md +223 -0
  229. package/docs/official/codex/config-sample.md +216 -0
  230. package/docs/official/codex/mcp.md +107 -0
  231. package/docs/official/codex/rules.md +79 -0
  232. package/docs/official/codex/skills.md +114 -0
  233. package/docs/official/sources-index.md +32 -0
  234. package/docs/operations.md +145 -0
  235. package/docs/terminology-style-guide.md +69 -0
  236. package/package.json +51 -0
  237. package/scripts/postinstall-check.js +112 -0
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: cli-tool
3
+ description: Node.js CLI tool template principles(CLI 工具模板原则)。Commander.js、interactive prompts(交互式提示)。
4
+ ---
5
+
6
+ # CLI Tool Template(CLI 工具模板)
7
+
8
+ ## Tech Stack(技术栈)
9
+
10
+ | Component(组件) | Technology(技术) |
11
+ | --- | --- |
12
+ | Runtime(运行时) | Node.js 20+ |
13
+ | Language(语言) | TypeScript |
14
+ | CLI Framework(CLI 框架) | Commander.js |
15
+ | Prompts(提示) | Inquirer.js |
16
+ | Output(输出) | chalk + ora(着色/加载) |
17
+ | Config(配置) | cosmiconfig |
18
+
19
+ ---
20
+
21
+ ## Directory Structure(目录结构)
22
+
23
+ ```
24
+ project-name/
25
+ ├── src/
26
+ │ ├── index.ts # Entry point(入口)
27
+ │ ├── cli.ts # CLI setup(CLI 设置)
28
+ │ ├── commands/ # Command handlers(命令处理)
29
+ │ ├── lib/
30
+ │ │ ├── config.ts # Config loader(配置加载)
31
+ │ │ └── logger.ts # Styled output(样式化输出)
32
+ │ └── types/
33
+ ├── bin/
34
+ │ └── cli.js # Executable(可执行文件)
35
+ └── package.json
36
+ ```
37
+
38
+ ---
39
+
40
+ ## CLI Design Principles(CLI 设计原则)
41
+
42
+ | Principle(原则) | Description(说明) |
43
+ | --- | --- |
44
+ | Subcommands(子命令) | Group related actions(分组相关操作) |
45
+ | Options(选项) | Flags with defaults(带默认值的标志) |
46
+ | Interactive(交互) | Prompts when needed(需要时提示) |
47
+ | Non-interactive(非交互) | Support `--yes` flags(支持 `--yes` 标志) |
48
+
49
+ ---
50
+
51
+ ## Key Components(关键组件)
52
+
53
+ | Component(组件) | Purpose(用途) |
54
+ | --- | --- |
55
+ | Commander | Command parsing(命令解析) |
56
+ | Inquirer | Interactive prompts(交互提示) |
57
+ | Chalk | Colored output(彩色输出) |
58
+ | Ora | Spinners/loading(旋转指示/加载) |
59
+ | Cosmiconfig | Config file discovery(配置文件发现) |
60
+
61
+ ---
62
+
63
+ ## Setup Steps(设置步骤)
64
+
65
+ 1. Create project directory(创建项目目录)
66
+ 2. `npm init -y`
67
+ 3. Install deps(安装依赖):`npm install commander @inquirer/prompts chalk ora cosmiconfig`
68
+ 4. Configure bin in package.json(配置 bin)
69
+ 5. `npm link` for local testing(本地测试)
70
+
71
+ ---
72
+
73
+ ## Publishing(发布)
74
+
75
+ ```bash
76
+ npm login
77
+ npm publish
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Best Practices(最佳实践)
83
+
84
+ - Provide helpful error messages(清晰错误信息)
85
+ - Support both interactive and non-interactive modes(同时支持交互与非交互)
86
+ - Use consistent output styling(一致的输出样式)
87
+ - Validate inputs with Zod(使用 Zod 验证输入)
88
+ - Exit with proper codes(0 success, 1 error)
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: electron-desktop
3
+ description: Electron desktop app template principles(桌面应用模板原则)。Cross-platform(跨平台)、React、TypeScript。
4
+ ---
5
+
6
+ # Electron Desktop App Template(桌面应用模板)
7
+
8
+ ## Tech Stack(技术栈)
9
+
10
+ | Component(组件) | Technology(技术) |
11
+ | --- | --- |
12
+ | Framework(框架) | Electron 28+ |
13
+ | UI | React 18 |
14
+ | Language(语言) | TypeScript |
15
+ | Styling(样式) | Tailwind CSS |
16
+ | Bundler(打包器) | Vite + electron-builder |
17
+ | IPC(进程间通信) | Type-safe communication(类型安全通信) |
18
+
19
+ ---
20
+
21
+ ## Directory Structure(目录结构)
22
+
23
+ ```
24
+ project-name/
25
+ ├── electron/
26
+ │ ├── main.ts # Main process(主进程)
27
+ │ ├── preload.ts # Preload script(预加载脚本)
28
+ │ └── ipc/ # IPC handlers(IPC 处理)
29
+ ├── src/
30
+ │ ├── App.tsx
31
+ │ ├── components/
32
+ │ │ ├── TitleBar.tsx # Custom title bar(自定义标题栏)
33
+ │ │ └── ...
34
+ │ └── hooks/
35
+ ├── public/
36
+ └── package.json
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Process Model(进程模型)
42
+
43
+ | Process(进程) | Role(角色) |
44
+ | --- | --- |
45
+ | Main(主进程) | Node.js, system access(系统访问) |
46
+ | Renderer(渲染进程) | Chromium, React UI(界面) |
47
+ | Preload(预加载) | Bridge(桥接), context isolation(上下文隔离) |
48
+
49
+ ---
50
+
51
+ ## Key Concepts(关键概念)
52
+
53
+ | Concept(概念) | Purpose(用途) |
54
+ | --- | --- |
55
+ | contextBridge | Safe API exposure(安全 API 暴露) |
56
+ | ipcMain/ipcRenderer | Process communication(进程通信) |
57
+ | nodeIntegration: false | Security(安全) |
58
+ | contextIsolation: true | Security(安全) |
59
+
60
+ ---
61
+
62
+ ## Setup Steps(设置步骤)
63
+
64
+ 1. `npm create vite {{name}} -- --template react-ts`
65
+ 2. Install(安装):`npm install -D electron electron-builder vite-plugin-electron`
66
+ 3. Create `electron/` directory(创建目录)
67
+ 4. Configure main process(配置主进程)
68
+ 5. `npm run electron:dev`
69
+
70
+ ---
71
+
72
+ ## Build Targets(构建目标)
73
+
74
+ | Platform(平台) | Output(输出) |
75
+ | --- | --- |
76
+ | Windows | NSIS, Portable |
77
+ | macOS | DMG, ZIP |
78
+ | Linux | AppImage, DEB |
79
+
80
+ ---
81
+
82
+ ## Best Practices(最佳实践)
83
+
84
+ - Use preload script for main/renderer bridge(主/渲染进程桥接)
85
+ - Type-safe IPC with typed handlers(类型安全 IPC)
86
+ - Custom title bar for native feel(原生感)
87
+ - Handle window state(maximize/minimize)
88
+ - Auto-updates with electron-updater(自动更新)
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: express-api
3
+ description: Express.js REST API 模板原则。TypeScript(类型系统)、Prisma(ORM)、JWT(身份验证)。
4
+ ---
5
+
6
+ # Express.js API Template(API 模板)
7
+
8
+ ## Tech Stack(技术栈)
9
+
10
+ | Component(组件) | Technology(技术) |
11
+ | --- | --- |
12
+ | Runtime(运行时) | Node.js 20+ |
13
+ | Framework(框架) | Express.js |
14
+ | Language(语言) | TypeScript |
15
+ | Database(数据库) | PostgreSQL + Prisma |
16
+ | Validation(校验) | Zod |
17
+ | Auth(认证) | JWT + bcrypt |
18
+
19
+ ---
20
+
21
+ ## Directory Structure(目录结构)
22
+
23
+ ```
24
+ project-name/
25
+ ├── prisma/
26
+ │ └── schema.prisma
27
+ ├── src/
28
+ │ ├── app.ts # Express setup(Express 启动入口)
29
+ │ ├── config/ # Environment(环境配置)
30
+ │ ├── routes/ # Route handlers(路由处理)
31
+ │ ├── controllers/ # Business logic(业务逻辑)
32
+ │ ├── services/ # Data access(数据访问)
33
+ │ ├── middleware/
34
+ │ │ ├── auth.ts # JWT verify(JWT 鉴权)
35
+ │ │ ├── error.ts # Error handler(错误处理)
36
+ │ │ └── validate.ts # Zod validation(Zod 校验)
37
+ │ ├── schemas/ # Zod schemas(Zod 模式)
38
+ │ └── utils/
39
+ └── package.json
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Middleware Stack(中间件栈)
45
+
46
+ | Order(顺序) | Middleware(中间件) |
47
+ | --- | --- |
48
+ | 1 | helmet(安全) |
49
+ | 2 | cors |
50
+ | 3 | morgan(日志) |
51
+ | 4 | body parsing(请求体解析) |
52
+ | 5 | routes(路由) |
53
+ | 6 | error handler(错误处理) |
54
+
55
+ ---
56
+
57
+ ## API Response Format(API 响应格式)
58
+
59
+ | Type(类型) | Structure(结构) |
60
+ | --- | --- |
61
+ | 成功 | `{ success: true, data: {...} }` |
62
+ | 错误 | `{ error: "message", details: [...] }` |
63
+
64
+ ---
65
+
66
+ ## Setup Steps(设置步骤)
67
+
68
+ 1. 创建项目目录
69
+ 2. `npm init -y`
70
+ 3. 安装依赖:`npm install express prisma zod bcrypt jsonwebtoken`
71
+ 4. 配置 Prisma
72
+ 5. `npm run db:push`
73
+ 6. `npm run dev`
74
+
75
+ ---
76
+
77
+ ## Best Practices(最佳实践)
78
+
79
+ - 分层架构(routes → controllers → services)
80
+ - 使用 Zod(校验)验证所有输入
81
+ - 集中式错误处理
82
+ - 基于环境的配置
83
+ - 使用 Prisma(ORM)进行类型安全的数据库访问
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: flutter-app
3
+ description: Flutter mobile app template(移动应用模板)原则。Riverpod(状态管理)、Go Router(路由)、Clean Architecture(整洁架构)。
4
+ ---
5
+
6
+ # Flutter App Template(应用模板)
7
+
8
+ ## Tech Stack(技术栈)
9
+
10
+ | Component(组件) | Technology(技术) |
11
+ | --- | --- |
12
+ | Framework(框架) | Flutter 3.x |
13
+ | Language(语言) | Dart 3.x |
14
+ | State(状态) | Riverpod 2.0 |
15
+ | Navigation(导航) | Go Router |
16
+ | HTTP | Dio |
17
+ | Storage(存储) | Hive |
18
+
19
+ ---
20
+
21
+ ## Directory Structure(目录结构)
22
+
23
+ ```
24
+ project_name/
25
+ ├── lib/
26
+ │ ├── main.dart
27
+ │ ├── app.dart
28
+ │ ├── core/
29
+ │ │ ├── constants/
30
+ │ │ ├── theme/
31
+ │ │ ├── router/
32
+ │ │ └── utils/
33
+ │ ├── features/
34
+ │ │ ├── auth/
35
+ │ │ │ ├── data/
36
+ │ │ │ ├── domain/
37
+ │ │ │ └── presentation/
38
+ │ │ └── home/
39
+ │ ├── shared/
40
+ │ │ ├── widgets/
41
+ │ │ └── providers/
42
+ │ └── services/
43
+ │ ├── api/
44
+ │ └── storage/
45
+ ├── test/
46
+ └── pubspec.yaml
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Architecture Layers(架构层)
52
+
53
+ | Layer(层) | Contents(内容) |
54
+ | --- | --- |
55
+ | Presentation(表现层) | Screens(页面)、Widgets(组件)、Providers(提供器) |
56
+ | Domain(领域层) | Entities(实体)、Use Cases(用例) |
57
+ | Data(数据层) | Repositories(仓储)、Models(模型) |
58
+
59
+ ---
60
+
61
+ ## Key Packages(关键包)
62
+
63
+ | Package(包) | Purpose(用途) |
64
+ | --- | --- |
65
+ | flutter_riverpod | 状态管理 |
66
+ | riverpod_annotation | 代码生成 |
67
+ | go_router | 导航 |
68
+ | dio | HTTP 客户端 |
69
+ | freezed | 不可变模型 |
70
+ | hive | 本地存储 |
71
+
72
+ ---
73
+
74
+ ## Setup Steps(设置步骤)
75
+
76
+ 1. `flutter create {{name}} --org com.{{bundle}}`
77
+ 2. 更新 `pubspec.yaml`
78
+ 3. `flutter pub get`
79
+ 4. 运行代码生成:`dart run build_runner build`
80
+ 5. `flutter run`
81
+
82
+ ---
83
+
84
+ ## Best Practices(最佳实践)
85
+
86
+ - Feature-first(功能优先)文件夹结构
87
+ - Riverpod(状态管理)用于状态管理,React Query pattern(服务端状态模式)
88
+ - Freezed(不可变模型)用于不可变数据类
89
+ - Go Router(路由)用于声明式导航
90
+ - Material 3(设计规范)主题
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: monorepo-turborepo
3
+ description: Turborepo monorepo template principles(模板原则)。pnpm workspaces(工作区)、shared packages(共享包)。
4
+ ---
5
+
6
+ # Turborepo Monorepo Template(模板)
7
+
8
+ ## Tech Stack(技术栈)
9
+
10
+ | Component(组件) | Technology(技术) |
11
+ | --- | --- |
12
+ | Build System(构建系统) | Turborepo |
13
+ | Package Manager(包管理器) | pnpm |
14
+ | Apps(应用) | Next.js、Express |
15
+ | Packages(包) | Shared UI, Config, Types(共享 UI/配置/类型) |
16
+ | Language(语言) | TypeScript |
17
+
18
+ ---
19
+
20
+ ## Directory Structure(目录结构)
21
+
22
+ ```
23
+ project-name/
24
+ ├── apps/
25
+ │ ├── web/ # Next.js app(应用)
26
+ │ ├── api/ # Express API
27
+ │ └── docs/ # Documentation(文档)
28
+ ├── packages/
29
+ │ ├── ui/ # Shared components(共享组件)
30
+ │ ├── config/ # ESLint, TS, Tailwind
31
+ │ ├── types/ # Shared types(共享类型)
32
+ │ └── utils/ # Shared utilities(共享工具)
33
+ ├── turbo.json
34
+ ├── pnpm-workspace.yaml
35
+ └── package.json
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Key Concepts(关键概念)
41
+
42
+ | Concept(概念) | Description(说明) |
43
+ | --- | --- |
44
+ | Workspaces(工作区) | pnpm-workspace.yaml |
45
+ | Pipeline(管道) | turbo.json task graph(任务图) |
46
+ | Caching(缓存) | Remote/local task caching(远程/本地任务缓存) |
47
+ | Dependencies(依赖) | `workspace:*` protocol(协议) |
48
+
49
+ ---
50
+
51
+ ## Turbo Pipeline(任务管道)
52
+
53
+ | Task(任务) | Depends On(依赖) |
54
+ | --- | --- |
55
+ | build | ^build (dependencies first)(依赖优先) |
56
+ | dev | cache: false, persistent(不缓存,常驻) |
57
+ | lint | ^build |
58
+ | test | ^build |
59
+
60
+ ---
61
+
62
+ ## Setup Steps(设置步骤)
63
+
64
+ 1. Create root directory(创建根目录)
65
+ 2. `pnpm init`
66
+ 3. Create pnpm-workspace.yaml(创建)
67
+ 4. Create turbo.json(创建)
68
+ 5. Add apps and packages(添加应用与包)
69
+ 6. `pnpm install`
70
+ 7. `pnpm dev`
71
+
72
+ ---
73
+
74
+ ## Common Commands(常用命令)
75
+
76
+ | Command(命令) | Description(说明) |
77
+ | --- | --- |
78
+ | `pnpm dev` | Run all apps(运行全部应用) |
79
+ | `pnpm build` | Build all(构建全部) |
80
+ | `pnpm --filter @name/web dev` | Run specific app(运行指定应用) |
81
+ | `pnpm --filter @name/web add axios` | Add dep to app(为应用添加依赖) |
82
+
83
+ ---
84
+
85
+ ## Best Practices(最佳实践)
86
+
87
+ - Shared configs in packages/config(共享配置)
88
+ - Shared types in packages/types(共享类型)
89
+ - Internal packages with `workspace:*`
90
+ - Use Turbo remote caching for CI(CI 远程缓存)
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: nextjs-fullstack
3
+ description: Next.js Full-Stack template(全栈模板)原则。App Router、Prisma、Tailwind v4。
4
+ ---
5
+
6
+ # Next.js Full-Stack Template(全栈模板,2026 版)
7
+
8
+ ## Tech Stack(技术栈)
9
+
10
+ | Component(组件) | Technology(技术) | Version / Notes(版本/说明) |
11
+ | --- | --- | --- |
12
+ | Framework(框架) | Next.js | v16+(App Router、Turbopack) |
13
+ | Language(语言) | TypeScript | v5+(Strict Mode,严格模式) |
14
+ | Database(数据库) | PostgreSQL | Prisma ORM(Serverless-friendly,适配 Serverless) |
15
+ | Styling(样式) | Tailwind CSS | v4.0(零配置,CSS-first) |
16
+ | Auth(认证) | Clerk / Better Auth | 中间件保护路由 |
17
+ | UI Logic(UI 逻辑) | React 19 | Server Actions、useActionState |
18
+ | Validation(验证) | Zod | Schema 校验(API & Forms) |
19
+
20
+ ---
21
+
22
+ ## Directory Structure(目录结构)
23
+
24
+ ```
25
+ project-name/
26
+ ├── prisma/
27
+ │ └── schema.prisma # Database schema(数据库结构)
28
+ ├── src/
29
+ │ ├── app/
30
+ │ │ ├── (auth)/ # 登录/注册路由组
31
+ │ │ ├── (dashboard)/ # 受保护路由
32
+ │ │ ├── api/ # Route Handlers(仅用于 Webhooks/外部集成)
33
+ │ │ ├── layout.tsx # Root Layout(Metadata, Providers)
34
+ │ │ ├── page.tsx # Landing Page(落地页)
35
+ │ │ └── globals.css # Tailwind v4 配置(@theme 在此)
36
+ │ ├── components/
37
+ │ │ ├── ui/ # 可复用 UI(Button, Input)
38
+ │ │ └── forms/ # Client forms(useActionState)
39
+ │ ├── lib/
40
+ │ │ ├── db.ts # Prisma singleton client(单例客户端)
41
+ │ │ ├── utils.ts # Helper functions(辅助函数)
42
+ │ │ └── dal.ts # Data Access Layer(仅服务端)
43
+ │ ├── actions/ # Server Actions(变更)
44
+ │ └── types/ # Global TS Types(类型)
45
+ ├── public/
46
+ ├── next.config.ts # TypeScript Config(配置)
47
+ └── package.json
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Key Concepts(更新)
53
+
54
+ | Concept(概念) | Description(说明) |
55
+ | --- | --- |
56
+ | Server Components(服务端组件) | 在服务端渲染(默认)。无需 API 即可直接访问 Prisma。 |
57
+ | Server Actions(服务端动作) | 处理表单变更,替代传统 API Routes。用于 `action={}`。 |
58
+ | React 19 Hooks(钩子) | 表单状态管理:useActionState、useFormStatus、useOptimistic。 |
59
+ | Data Access Layer(数据访问层) | 数据安全。分离数据库逻辑(DTOs)以安全复用。 |
60
+ | Tailwind v4 | 样式引擎。无需 tailwind.config.js,在 CSS 中直接配置。 |
61
+
62
+ ---
63
+
64
+ ## Environment Variables(环境变量)
65
+
66
+ | Variable(变量) | Purpose(用途) |
67
+ | --- | --- |
68
+ | DATABASE_URL | PostgreSQL connection string(Prisma) |
69
+ | NEXT_PUBLIC_APP_URL | Public application URL(公共应用 URL) |
70
+ | NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Auth(使用 Clerk 时) |
71
+ | CLERK_SECRET_KEY | Auth secret(仅服务端) |
72
+
73
+ ---
74
+
75
+ ## Setup Steps(设置步骤)
76
+
77
+ 1. Initialize Project(初始化项目):
78
+ ```bash
79
+ npx create-next-app@latest my-app --typescript --tailwind --eslint
80
+ # 选择 Yes(App Router)
81
+ # 选择 No(src 目录)(可选,本模板使用 src)
82
+ ```
83
+
84
+ 2. Install DB & Validation(安装数据库与校验):
85
+ ```bash
86
+ npm install prisma @prisma/client zod
87
+ npm install -D ts-node # 用于运行 seed 脚本
88
+ ```
89
+
90
+ 3. Configure Tailwind v4(如缺失):
91
+ 确保 `src/app/globals.css` 使用新的导入语法,而不是配置文件:
92
+ ```css
93
+ @import "tailwindcss";
94
+
95
+ @theme {
96
+ --color-primary: oklch(0.5 0.2 240);
97
+ --font-sans: "Inter", sans-serif;
98
+ }
99
+ ```
100
+
101
+ 4. Initialize Database(初始化数据库):
102
+ ```bash
103
+ npx prisma init
104
+ # 更新 schema.prisma
105
+ npm run db:push
106
+ ```
107
+
108
+ 5. 启动开发服务器:
109
+ ```bash
110
+ npm run dev --turbo
111
+ # --turbo 启用更快的 Turbopack
112
+ ```
113
+
114
+ ---
115
+
116
+ ## 最佳实践(2026 标准)
117
+
118
+ - **获取数据(Fetch Data)**:在 Server Components 中直接调用 Prisma(async/await),不要用 useEffect 获取初始数据。
119
+ - **变更(Mutations)**:使用 Server Actions + React 19 的 `useActionState` 处理加载与错误状态,避免手动 useState。
120
+ - **类型安全(Type Safety)**:在 Server Actions(输入验证)与客户端表单之间共享 Zod schema。
121
+ - **安全(Security)**:将数据传给 Prisma 前必须用 Zod 验证输入。
122
+ - **样式(Styling)**:在 Tailwind v4 中使用原生 CSS 变量,便于动态主题。
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: nextjs-saas
3
+ description: Next.js SaaS template(SaaS 模板)原则(2026 Standards,2026 标准)。React 19、Server Actions(服务端动作)、Auth.js v6。
4
+ ---
5
+
6
+ # Next.js SaaS Template(2026 更新)
7
+
8
+ ## Tech Stack(技术栈)
9
+
10
+ | Component(组件) | Technology(技术) | Version / Notes(版本/说明) |
11
+ | --- | --- | --- |
12
+ | Framework(框架) | Next.js | v16+(App Router、React Compiler(编译器)) |
13
+ | Runtime(运行时) | Node.js | v24(Krypton LTS) |
14
+ | Auth(认证) | Auth.js | v6(原名 NextAuth) |
15
+ | Payments(支付) | Stripe API | Latest(最新) |
16
+ | Database(数据库) | PostgreSQL | Prisma v6(Serverless Driver,无服务器驱动) |
17
+ | Email(邮件) | Resend | React Email(邮件模板) |
18
+ | UI(界面) | Tailwind CSS | v4(Oxide Engine、无配置文件) |
19
+
20
+ ---
21
+
22
+ ## Directory Structure(目录结构)
23
+
24
+ ```
25
+ project-name/
26
+ ├── prisma/
27
+ │ └── schema.prisma # Database Schema(数据库 Schema)
28
+ ├── src/
29
+ │ ├── actions/ # NEW: Server Actions(用于数据变更,替代 API Routes(API 路由))
30
+ │ │ ├── auth-actions.ts
31
+ │ │ ├── billing-actions.ts
32
+ │ │ └── user-actions.ts
33
+ │ ├── app/
34
+ │ │ ├── (auth)/ # Route Group(路由组):登录、注册
35
+ │ │ ├── (dashboard)/ # Route Group(路由组):受保护路由(应用布局)
36
+ │ │ ├── (marketing)/ # Route Group(路由组):落地页、价格(营销布局)
37
+ │ │ └── api/ # 仅用于 Webhooks(回调)或 Edge cases(边缘场景)
38
+ │ │ └── webhooks/stripe/
39
+ │ ├── components/
40
+ │ │ ├── emails/ # React Email templates(邮件模板)
41
+ │ │ ├── forms/ # 使用 useActionState 的 Client components(客户端组件)(React 19)
42
+ │ │ └── ui/ # Shadcn UI(组件库)
43
+ │ ├── lib/
44
+ │ │ ├── auth.ts # Auth.js v6 config(配置)
45
+ │ │ ├── db.ts # Prisma Singleton(单例)
46
+ │ │ └── stripe.ts # Stripe Singleton(单例)
47
+ │ └── styles/
48
+ │ └── globals.css # Tailwind v4 导入(仅 CSS)
49
+ └── package.json
50
+ ```
51
+
52
+ ---
53
+
54
+ ## SaaS Features(SaaS 功能)
55
+
56
+ | Feature(功能) | Implementation(实现) |
57
+ | --- | --- |
58
+ | Auth(认证) | Auth.js v6 + Passkeys(通行密钥) + OAuth(授权) |
59
+ | Data Mutation(数据变更) | Server Actions(不使用 API routes(API 路由)) |
60
+ | Subscriptions(订阅) | Stripe Checkout & Customer Portal(结算与客户门户) |
61
+ | Webhooks(回调) | 异步处理 Stripe 事件 |
62
+ | Email(邮件) | 通过 Resend 发送事务邮件 |
63
+ | Validation(校验) | Zod(服务端校验) |
64
+
65
+ ---
66
+
67
+ ## Database Schema(数据库结构)
68
+
69
+ | Model(模型) | Fields(字段,关键字段) |
70
+ | --- | --- |
71
+ | User | id, email, stripeCustomerId, subscriptionId, plan |
72
+ | Account | OAuth provider data(OAuth 提供方数据,Google, GitHub...) |
73
+ | Session | 用户会话(Database strategy,数据库策略) |
74
+
75
+ ---
76
+
77
+ ## Environment Variables(环境变量)
78
+
79
+ | Variable(变量) | Purpose(用途) |
80
+ | --- | --- |
81
+ | DATABASE_URL | Prisma 连接字符串(Postgres) |
82
+ | AUTH_SECRET | 替代 NEXTAUTH_SECRET(Auth.js v6) |
83
+ | STRIPE_SECRET_KEY | Payments(支付,服务端) |
84
+ | STRIPE_WEBHOOK_SECRET | Webhook 校验 |
85
+ | RESEND_API_KEY | 邮件发送 |
86
+ | NEXT_PUBLIC_APP_URL | 应用规范 URL |
87
+
88
+ ---
89
+
90
+ ## Setup Steps(设置步骤)
91
+
92
+ 1. 初始化项目(Node 24):
93
+ ```bash
94
+ npx create-next-app@latest {{name}} --typescript --eslint
95
+ ```
96
+
97
+ 2. 安装核心库:
98
+ ```bash
99
+ npm install next-auth@beta stripe resend @prisma/client
100
+ ```
101
+
102
+ 3. 安装 Tailwind v4(添加到 globals.css):
103
+ ```css
104
+ @import "tailwindcss";
105
+ ```
106
+
107
+ 4. 配置环境变量(.env.local)
108
+
109
+ 5. 同步数据库:
110
+ ```bash
111
+ npx prisma db push
112
+ ```
113
+
114
+ 6. 运行本地 Webhook:
115
+ ```bash
116
+ npm run stripe:listen
117
+ ```
118
+
119
+ 7. 运行项目:
120
+ ```bash
121
+ npm run dev
122
+ ```