needware-cli 1.7.11 → 1.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,32 @@
1
1
  /**
2
2
  * System prompt for Agent command
3
3
  */
4
- export function getSystemPrompt(workingDir, supabase) {
4
+ import * as fs from 'fs';
5
+ import * as path from 'path';
6
+ export function getSystemPrompt(workingDir, supabase, mode) {
7
+ let basePrompt = generateBasePrompt(workingDir, supabase);
8
+ // 如果是 plan 模式,附加 plan-mode skill 内容
9
+ if (mode === 'plan') {
10
+ try {
11
+ // 获取 skills/plan-mode/SKILL.md 的路径
12
+ const skillPath = path.join(process.cwd(), 'skills', 'plan-mode', 'SKILL.md');
13
+ if (fs.existsSync(skillPath)) {
14
+ const planModeSkill = fs.readFileSync(skillPath, 'utf-8');
15
+ basePrompt += `\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`;
16
+ basePrompt += `## PLAN MODE ENABLED\n\n`;
17
+ basePrompt += planModeSkill;
18
+ }
19
+ else {
20
+ console.warn(`Warning: Plan mode skill file not found at ${skillPath}`);
21
+ }
22
+ }
23
+ catch (error) {
24
+ console.warn(`Warning: Failed to load plan mode skill: ${error}`);
25
+ }
26
+ }
27
+ return basePrompt;
28
+ }
29
+ function generateBasePrompt(workingDir, supabase) {
5
30
  return `
6
31
  ## Working Directory Context
7
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/commands/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,MAAM,UAAU,eAAe,CAC7B,UAAkB,EAClB,QAAyB;IAEzB,OAAO;;;+CAGsC,UAAU;;wEAEe,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC;YAC1E,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,4CAA4C,KAAK,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,kBAAkB,CACzB,UAAkB,EAClB,QAAyB;IAEzB,OAAO;;;+CAGsC,UAAU;;wEAEe,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAuYvE,CAAC,IAAI,EAAE,CAAC;AACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "needware-cli",
3
- "version": "1.7.11",
3
+ "version": "1.7.13",
4
4
  "description": "一个功能强大的 Node.js 命令行工具",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: plan
3
+ description: plan mode 使用此指导 - plan mode 尽量多提供产品输出,只有在问具体技术时提供技术方案,技术方案由实施时决定。只有plan mode 使用此skill
4
+ ---
5
+
6
+ # Plan 模式 - 智能任务规划与执行
7
+
8
+ ## 概述
9
+
10
+ Plan 模式是一个以**产品输出为导向**的智能任务规划系统,将复杂任务分解为清晰的产品功能步骤。
11
+
12
+ **核心原则:**
13
+ - 📦 **产品输出优先**: 规划重点描述产品功能、用户价值和业务目标
14
+ - 🎯 **按需技术方案**: 只有在用户明确询问具体技术实现时,才提供技术方案细节
15
+ - 🔧 **实施决定方案**: 技术选型和实现方案在实际执行阶段根据项目环境决定
16
+ - 📊 **价值可见交付**: 每一步都以可见的产品功能产出为导向
17
+
18
+ **工作方式:**
19
+ - 🎯 **智能分解**: 将产品需求分解为用户可理解的功能模块
20
+ - 📋 **产品计划**: 执行前展示产品功能计划(做什么、为什么、价值是什么)
21
+ - 🚀 **进度可见**: 实时显示每个功能的完成状态
22
+ - 🔧 **灵活实现**: 实施时根据实际情况选择最佳技术方案
23
+ - 📊 **产品报告**: 执行后生成产品交付报告(而非技术实现报告)
24
+
25
+ **重要区分:**
26
+ - ✅ **默认输出**: 产品功能描述("实现用户登录功能"、"添加商品列表展示")
27
+ - ❌ **避免默认**: 技术实现细节("使用 Supabase Auth"、"创建 ProductList 组件")
28
+ - ✅ **特殊情况**: 当用户明确问"怎么实现"、"用什么技术"时,才详细说明技术方案
29
+
30
+ **在开始时宣布:** "我将使用 Plan 模式来规划这个任务,重点关注产品功能和价值交付。"
31
+
32
+ ## 使用条件
33
+
34
+ **触发条件:仅在 Plan 模式下使用**
35
+
36
+ ```
37
+ ✅ 当运行在 Plan 模式下时
38
+ → 必须使用此 Skill 作为执行指导
39
+
40
+ ❌ 其他情况
41
+ → 无需使用此 Skill
42
+ ```
43
+
44
+ ## 项目初始化结构说明
45
+
46
+ **项目为 React + Vite + TypeScript + shadcn/ui 标准结构,components/ui 下组件无需识别,直接使用。**
47
+
48
+ ### 项目结构
49
+
50
+ ```
51
+ app/
52
+ ├── components.json # shadcn/ui 配置 ✨
53
+ ├── eslint.config.js # ESLint 配置
54
+ ├── index.html # HTML 入口
55
+ ├── package.json # 依赖管理
56
+ ├── pnpm-lock.yaml # pnpm 锁文件 (使用 pnpm)
57
+ ├── postcss.config.js # PostCSS 配置
58
+ ├── tailwind.config.ts # Tailwind CSS 配置 ✨
59
+ ├── tsconfig.app.json # TypeScript 应用配置
60
+ ├── tsconfig.json # TypeScript 基础配置
61
+ ├── tsconfig.node.json # TypeScript Node 配置
62
+ ├── vite.config.ts # Vite 配置
63
+ └── src/
64
+ ├── App.css # 应用样式
65
+ ├── App.tsx # 根组件
66
+ ├── index.css # 全局样式
67
+ ├── main.tsx # React 入口
68
+ ├── vite-env.d.ts # Vite 类型定义
69
+ ├── components/
70
+ │ └── ui/ # shadcn/ui 组件库 ✨ (50+ 组件)
71
+ │ ├── accordion.tsx
72
+ │ ├── alert-dialog.tsx
73
+ │ ├── alert.tsx
74
+ │ ├── aspect-ratio.tsx
75
+ │ ├── avatar.tsx
76
+ │ ├── badge.tsx
77
+ │ ├── breadcrumb.tsx
78
+ │ ├── button.tsx
79
+ │ ├── calendar.tsx
80
+ │ ├── card.tsx
81
+ │ ├── carousel.tsx
82
+ │ ├── chart.tsx
83
+ │ ├── checkbox.tsx
84
+ │ ├── collapsible.tsx
85
+ │ ├── command.tsx
86
+ │ ├── context-menu.tsx
87
+ │ ├── dialog.tsx
88
+ │ ├── drawer.tsx
89
+ │ ├── dropdown-menu.tsx
90
+ │ ├── form.tsx
91
+ │ ├── hover-card.tsx
92
+ │ ├── input-otp.tsx
93
+ │ ├── input.tsx
94
+ │ ├── label.tsx
95
+ │ ├── menubar.tsx
96
+ │ ├── navigation-menu.tsx
97
+ │ ├── pagination.tsx
98
+ │ ├── popover.tsx
99
+ │ ├── progress.tsx
100
+ │ ├── radio-group.tsx
101
+ │ ├── resizable.tsx
102
+ │ ├── scroll-area.tsx
103
+ │ ├── select.tsx
104
+ │ ├── separator.tsx
105
+ │ ├── sheet.tsx
106
+ │ ├── sidebar.tsx
107
+ │ ├── skeleton.tsx
108
+ │ ├── slider.tsx
109
+ │ ├── sonner.tsx # Toast 通知
110
+ │ ├── switch.tsx
111
+ │ ├── table.tsx
112
+ │ ├── tabs.tsx
113
+ │ ├── textarea.tsx
114
+ │ ├── toast.tsx
115
+ │ ├── toaster.tsx
116
+ │ ├── toggle-group.tsx
117
+ │ ├── toggle.tsx
118
+ │ ├── tooltip.tsx
119
+ │ └── use-toast.ts
120
+ ├── hooks/ # 自定义 Hooks
121
+ │ ├── use-mobile.tsx
122
+ │ └── use-toast.ts
123
+ ├── lib/ # 工具库
124
+ │ └── utils.ts # 工具函数 (包含 cn() 函数)
125
+ └── pages/ # 页面目录
126
+ ├── Index.tsx # 首页
127
+ └── NotFound.tsx # 404 页面
128
+ ```
129
+
130
+ **项目配置说明:**
131
+ - ✅ React 18 + TypeScript + Vite 已完整配置
132
+ - ✅ Tailwind CSS 样式框架可直接使用
133
+ - ✅ shadcn/ui 组件库已完整安装(50+ 组件)
134
+ - ✅ pnpm 为包管理器(必须使用 `pnpm add`)
135
+ - ✅ 基础页面结构在 `src/pages/` 目录
136
+ - ⚠️ 后端服务未集成(如需数据库、AI、邮件功能,使用对应的 skill)
137
+
138
+ **⚠️ 重要:`components/ui/` 下的 shadcn/ui 组件无需读取源码,直接导入使用即可!**
139
+
140
+ ```typescript
141
+ // 直接使用,无需读取源码
142
+ import { Button } from '@/components/ui/button';
143
+ import { Card } from '@/components/ui/card';
144
+ import { Dialog } from '@/components/ui/dialog';
145
+ // ... 其他 50+ 组件
146
+ ```
147
+
148
+
149
+ ### 后端集成检查
150
+
151
+ #### Supabase 集成
152
+
153
+ **如需集成 Supabase,使用 `supabase-integration` skill:**
154
+
155
+ ```
156
+ 如果项目需要数据库、认证或存储功能:
157
+ 1. 使用 supabase-integration skill 进行集成
158
+ 2. Skill 会自动创建必要的配置和文件
159
+ 3. 集成完成后会包含以下内容:
160
+ - src/lib/supabase.ts 客户端配置
161
+ - .env 环境变量配置
162
+ - supabase/ 目录(migrations、functions)
163
+ ```
164
+
165
+ #### AI 功能集成
166
+
167
+ **如需 AI 功能(图像识别、智能分析等),使用 `ai-integration` skill:**
168
+
169
+ ```
170
+ 如果项目需要 AI 能力:
171
+ 1. 使用 ai-integration skill 进行集成
172
+ 2. Skill 会创建 AI 服务函数和前端调用代码
173
+ ```
174
+
175
+ #### 邮件发送功能
176
+
177
+ **如需发送邮件功能,使用 `resend-integration` skill:**
178
+
179
+ ```
180
+ 如果项目需要发送邮件(欢迎邮件、通知邮件等):
181
+ 1. 使用 resend-integration skill 进行集成
182
+ 2. Skill 会创建邮件发送 Edge Function
183
+ 3. 配置 Resend API Key 环境变量
184
+ ```
185
+
186
+ ### 包管理器
187
+
188
+ **项目使用 pnpm:**
189
+ - ✅ 安装依赖: `pnpm add [package]`
190
+ - ✅ 安装开发依赖: `pnpm add -D [package]`
191
+ - ❌ 不要使用 npm 或 yarn
192
+
193
+ ### 路由方案
194
+
195
+ **如需路由功能,可安装 React Router:**
196
+ ```bash
197
+ pnpm add react-router-dom
198
+ ```
199
+
200
+
201
+ **重要提醒:**
202
+ ⚠️ 此项目使用 pnpm,所有依赖安装必须使用 `pnpm add`,不要使用 npm 或 yarn!
203
+ ⚠️ 无需读取 `components/ui/` 目录下的组件源码,shadcn/ui 组件可直接导入使用!
204
+ ```
205
+
File without changes