secondme

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SecondMe 一站式项目创建

One-stop Project Creation for SecondMe

secondme-init
secondme-prd
secondme-nextjs
三个步骤合并为一个完整流程。
工具使用: 收集用户输入时使用
AskUserQuestion
工具。

Combine the three steps of
secondme-init
secondme-prd
secondme-nextjs
into a complete workflow.
Tool Usage: Use the
AskUserQuestion
tool when collecting user input.

参数说明

Parameter Description

参数说明
(无参数)完整流程:初始化 → PRD → 生成项目
--quick
快速流程:初始化 → 跳过 PRD → 生成项目

ParameterDescription
(No parameters)Full workflow: Initialization → PRD → Project Generation
--quick
Quick workflow: Initialization → Skip PRD → Project Generation

执行流程

Execution Workflow

环境检查(首次执行前)

Environment Check (Before First Execution)

重要提醒: 当前目录将作为项目根目录,Next.js 项目会直接在此目录中初始化。
  1. 显示当前工作目录路径,让用户确认:
    📂 当前工作目录: /path/to/current/dir
    
    ⚠️  Next.js 项目将直接在此目录中初始化,请确保你已在一个新建的空文件夹中运行。
  2. 检查当前目录内容(除
    .secondme/
    .git/
    CLAUDE.md
    .claude/
    等配置文件外):
    • 如果目录为空或仅有配置文件:继续
    • 如果存在其他文件:发出警告并使用
      AskUserQuestion
      让用户确认是否继续

Important Reminder: The current directory will be used as the project root directory, and the Next.js project will be initialized directly here.
  1. Display the current working directory path for user confirmation:
    📂 Current Working Directory: /path/to/current/dir
    
    ⚠️  The Next.js project will be initialized directly in this directory. Please ensure you are running this in a new empty folder.
  2. Check the contents of the current directory (excluding configuration files such as
    .secondme/
    ,
    .git/
    ,
    CLAUDE.md
    ,
    .claude/
    ):
    • If the directory is empty or only contains configuration files: Continue
    • If other files exist: Issue a warning and use
      AskUserQuestion
      to let the user confirm whether to continue

阶段 0:检测当前状态

Phase 0: Detect Current Status

检查
.secondme/state.json
是否存在:
如果存在,读取
stage
字段判断进度:
stage说明操作
init
已完成初始化询问:从 PRD 阶段继续,还是重新开始?
prd
已完成 PRD询问:直接生成项目,还是重新定义 PRD?
ready
项目已生成询问:重新生成项目,还是全部重新开始?
如果不存在,从阶段 1 开始。

Check if
.secondme/state.json
exists:
If it exists, read the
stage
field to determine progress:
stageDescriptionAction
init
Initialization completedAsk: Continue from the PRD phase, or start over?
prd
PRD completedAsk: Generate the project directly, or redefine the PRD?
ready
Project generatedAsk: Regenerate the project, or start over entirely?
If it does not exist, start from Phase 1.

阶段 1:项目初始化

Phase 1: Project Initialization

执行
secondme-init
的完整流程:
  1. 收集 App Info 或手动输入凭证(如果用户没有凭证,引导前往 https://develop.second.me 注册并创建 App)
  2. 解析 Scopes,推断功能模块
  3. 收集数据库连接串
  4. 确认模块选择
  5. 生成
    .secondme/state.json
    (包含
    api
    docs
    配置)
  6. 生成
    CLAUDE.md
完成标志:
stage
设为
"init"

Execute the full workflow of
secondme-init
:
  1. Collect App Info or manually enter credentials (if the user does not have credentials, guide them to https://develop.second.me to register and create an App)
  2. Parse Scopes and infer functional modules
  3. Collect database connection strings
  4. Confirm module selection
  5. Generate
    .secondme/state.json
    (including
    api
    and
    docs
    configurations)
  6. Generate
    CLAUDE.md
Completion Flag: Set
stage
to
"init"

阶段 2:产品需求定义

Phase 2: Product Requirement Definition

如果使用
--quick
参数
:跳过此阶段,直接进入阶段 3。
否则,执行
secondme-prd
的完整流程:
  1. 展示已选模块的 API 能力
  2. 收集应用目标和目标用户
  3. 根据模块针对性提问(chat/profile/note)
  4. 收集设计偏好
  5. 确认需求摘要
  6. 更新
    state.json
    prd
    字段
完成标志:
stage
设为
"prd"

If the
--quick
parameter is used
: Skip this phase and proceed directly to Phase 3.
Otherwise, execute the full workflow of
secondme-prd
:
  1. Display the API capabilities of the selected modules
  2. Collect application objectives and target users
  3. Ask targeted questions based on modules (chat/profile/note)
  4. Collect design preferences
  5. Confirm requirement summary
  6. Update the
    prd
    field in
    state.json
Completion Flag: Set
stage
to
"prd"

阶段 3:生成 Next.js 项目

Phase 3: Generate Next.js Project

执行
secondme-nextjs
的完整流程:
  1. 读取
    state.json
    中的配置和 PRD
  2. 在当前目录初始化 Next.js 项目
  3. 安装依赖(Prisma)
  4. 生成
    .env.local
    (从
    state.api
    读取端点)
  5. 生成 Prisma Schema(User 表必含 Token 字段)
  6. 根据模块生成代码
  7. 使用
    frontend-design:frontend-design
    skill 生成 UI
完成标志:
stage
设为
"ready"

Execute the full workflow of
secondme-nextjs
:
  1. Read the configurations and PRD from
    state.json
  2. Initialize the Next.js project in the current directory
  3. Install dependencies (Prisma)
  4. Generate
    .env.local
    (read endpoints from
    state.api
    )
  5. Generate Prisma Schema (the User table must include the Token field)
  6. Generate code based on modules
  7. Generate UI using the
    frontend-design:frontend-design
    skill
Completion Flag: Set
stage
to
"ready"

快速模式 vs 完整模式

Quick Mode vs Full Mode

完整模式 (/secondme)
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│  阶段 1     │ →  │  阶段 2     │ →  │  阶段 3     │
│  初始化     │    │  PRD 定义   │    │  生成项目   │
└─────────────┘    └─────────────┘    └─────────────┘

快速模式 (/secondme --quick)
┌─────────────┐    ┌─────────────┐
│  阶段 1     │ →  │  阶段 3     │
│  初始化     │    │  生成项目   │
└─────────────┘    └─────────────┘

Full Mode (/secondme)
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│  Phase 1    │ →  │  Phase 2    │ →  │  Phase 3    │
│  Initialization │    │  PRD Definition   │    │  Project Generation   │
└─────────────┘    └─────────────┘    └─────────────┘

Quick Mode (/secondme --quick)
┌─────────────┐    ┌─────────────┐
│  Phase 1    │ →  │  Phase 3    │
│  Initialization │    │  Project Generation   │
└─────────────┘    └─────────────┘

输出结果

Output Result

流程完成后显示:
🎉 SecondMe 项目创建完成!

项目信息:
- 应用名称: [app_name]
- 已选模块: auth, chat, profile
- 数据库: PostgreSQL

启动步骤:
1. npm install
2. npx prisma db push
3. npm run dev

项目将在 http://localhost:3000 启动

提示:
- .secondme/ 目录包含敏感配置,请添加到 .gitignore
- 如需修改配置,可单独运行 /secondme-init
- 如需重新定义需求,可单独运行 /secondme-prd

After the workflow is completed, the following will be displayed:
🎉 SecondMe project creation completed!

Project Information:
- App Name: [app_name]
- Selected Modules: auth, chat, profile
- Database: PostgreSQL

Startup Steps:
1. npm install
2. npx prisma db push
3. npm run dev

The project will start at http://localhost:3000

Tips:
- The .secondme/ directory contains sensitive configurations, please add it to .gitignore
- To modify configurations, you can run /secondme-init separately
- To redefine requirements, you can run /secondme-prd separately

单独使用子命令

Using Subcommands Separately

如果只需要执行某个阶段,可以单独使用:
命令说明
/secondme-init
仅执行初始化
/secondme-prd
仅执行 PRD 定义
/secondme-nextjs
仅执行项目生成
/secondme-nextjs --quick
跳过 PRD 检查,直接生成

If you only need to execute a certain phase, you can use the following commands separately:
CommandDescription
/secondme-init
Execute only initialization
/secondme-prd
Execute only PRD definition
/secondme-nextjs
Execute only project generation
/secondme-nextjs --quick
Skip PRD check and generate directly

错误恢复

Error Recovery

如果流程中断:
  • 已完成的阶段数据会保存在
    state.json
  • 重新运行
    /secondme
    会检测进度并询问是否继续
  • 可以选择从中断点继续,或重新开始某个阶段

If the workflow is interrupted:
  • Data from completed phases will be saved in
    state.json
  • Rerunning
    /secondme
    will detect progress and ask whether to continue
  • You can choose to continue from the breakpoint or restart a certain phase

设计原则提醒

Design Principle Reminder

生成的项目遵循以下设计原则:
  • 亮色主题:仅使用浅色主题
  • 简约优雅:极简设计,减少视觉噪音
  • 中文界面:所有用户可见文字使用中文
  • 稳定优先:避免复杂动画,仅用简单过渡效果
The generated project follows the following design principles:
  • Light Theme: Only use light theme
  • Simple and Elegant: Minimalist design, reduce visual noise
  • Chinese Interface: All user-visible text uses Chinese
  • Stability First: Avoid complex animations, only use simple transition effects