核心开发 Skill

HE
henuwangkai
Community
👁 6·💰 ~0.02 USD·📅 发布于 2026年3月24日·📖 1 分钟阅读

全栈开发核心 Skill,包含项目架构、技术栈、开发流程规范

1. KeepRule 核心开发 Skill

KeepRule (keeprule.com) 全栈开发核心 Skill,包含项目架构、技术栈、开发流程规范

Prompt

---
name: KeepRule 核心规范
description: 项目概览、技术栈、API 域名配置、核心表简介、开发环境启动命令、检查清单。开发前必读的总纲文档。
---

# KeepRule 项目核心规范

> **重要**: 本文档是开发规范核心,必须严格遵守!

## 项目概述

KeepRule(守则)是一个投资原则学习平台,帮助用户学习巴菲特、芒格等投资大师的投资智慧。

## 项目结构

keeprule/ ├── frontend-nuxt/ # 前端 (Nuxt 3 + TypeScript + SSR) ← 主前端,支持 SEO ├── frontend/ # 前端旧版 (已废弃,禁止使用) ├── backend/ # 后端 API (Go-Zero + GORM) ├── database/ # 数据库脚本 (MySQL) ├── prod.sh # 生产环境部署脚本 └── CLAUDE.md # 开发规范入口


## 技术栈

| 模块   | 技术                                  | 说明               |
| ------ | ------------------------------------- | ------------------ |
| 前端   | Nuxt 3 + Vue 3.5 + TypeScript + Pinia | SSR 应用,支持 SEO |
| 后端   | Go 1.24 + Go-Zero + GORM              | RESTful API        |
| 数据库 | MySQL 8.0 (db_buffett)                | 数据存储           |
| AI     | GPTProto API (Claude Haiku 4.5)       | 智能对话           |

## API 域名配置

### 线上环境

| 项目                 | 线上域名                  |
| -------------------- | ------------------------- |
| **keeprule/backend** | `https://api.notionso.cn` |

### 本地开发

| 项目                       | 本地地址                | 启动方式                                       |
| -------------------------- | ----------------------- | ---------------------------------------------- |
| **keeprule/backend**       | `http://localhost:8001` | `cd backend && go run . -f etc/api.local.yaml` |
| **keeprule/frontend-nuxt** | `http://localhost:6001` | `cd frontend-nuxt && npm run dev`              |

### API 路径

- KeepRule API 前缀: `/api/v1/buffett/xxx`

## 核心表

### 官方数据(大师规则系统)

| 表名            | 用途     | 说明                                              |
| --------------- | -------- | ------------------------------------------------- |
| `bs_categories` | 大师分类 | 巴菲特、芒格等投资大师分类                        |
| `bs_rules`      | 投资原则 | **官方**维护的大师投资原则,用于学习和 LLM 上下文 |
| `bs_tags`       | 标签分类 | bs_rules 的标签系统(**暂时作废**)               |

### 用户私有数据

| 表名            | 用途     | 说明                                                       |
| --------------- | -------- | ---------------------------------------------------------- |
| `bs_users`      | 用户表   | 用户基础信息                                               |
| `bs_user_notes` | 用户笔记 | 用户私人笔记/交易日志(type=1 笔记,type=2 交易日志)      |
| `bs_user_rules` | 用户规则 | 用户自创建的投资规则,可发布到 bs_rules(设置 official=2) |
| `bs_user_tags`  | 用户标签 | 关联 bs_user_notes 和 bs_user_rules,**不关联** bs_rules   |

> **注意**:`bs_rules` 是官方大师规则,`bs_user_rules` 是用户私有规则,两者通过 `official` 字段区分发布状态。

### AI 和聊天系统

| 表名               | 用途           |
| ------------------ | -------------- |
| `bs_prompt`        | AI 提示词配置  |
| `bs_prompt_module` | 提示词模块分类 |
| `bs_ai_model`      | AI 模型配置    |
| `bs_chat`          | 会话记录       |
| `bs_chat_messages` | 消息记录       |

## 开发环境

### 启动后端
```bash
cd backend
go run . -f etc/api.local.yaml
# 服务运行在 http://localhost:8001

启动前端

cd frontend-nuxt
npm install
npm run dev
# 访问 http://localhost:6001

开发检查清单

开发完成前请确认:

  • 已创建功能分支(格式:feat_yymmdd_hh)
  • 后端代码在 keeprule/backend/ 目录
  • API 前缀是 /api/v1/buffett/xxx
  • 前端代码在 keeprule/frontend-nuxt/(禁止用旧 frontend)
  • 前端数据通过 API 获取,无硬编码
  • 前端路由使用 localePath() 生成
  • 数据库操作带 WHERE 条件
  • 未执行 DROP/TRUNCATE 语句
  • 未直接修改 internal/types/types.go
  • API 变更先修改了 .api 文件

代码修改原则

  1. 最小改动原则:只修改必要的代码,不做不必要的重构
  2. 先理解后修改:修改前先阅读理解现有代码逻辑
  3. 保持一致性:遵循项目现有的代码风格和规范
  4. 测试验证:修改后进行必要的测试验证
  5. 数据安全:重构时确保现有功能不变,数据不丢失

相关 Skills

讨论区

讨论区

登录后加入讨论。
MC
Maya Chen·2 hours ago

Tried this with a marketing ops workflow and it cut prompt iteration time by half. The Prompt section is especially reusable.

LW
Leo Wang·Yesterday

Would love a follow-up showing how you adapted this for team use.

  • We forked it internally
  • Replaced the model with Claude Sonnet
  • Saved the structure as a reusable playbook

相关推荐

相关资产

继续查看同一作者发布的其他资产。

返回首页