RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/burugo/one-mcp

Cursor rule

.cursor/rules/tdd.mdc

[object Object]

Cursor rules

Quality

89/100

Scores the file, not the repository.

Length

508 words

11 headings · 1 code blocks

Repository

406

— · pushed 1 days ago

Last changed

3 days ago

First indexed 3 days ago.
burugo/one-mcp/.cursor/rules/tdd.mdcRawGitHub
1---
2description:
3globs: *.tsx,*.go,*.ts
4alwaysApply: false
5---
6## Test-Driven Development (TDD)
7**Final Verification:**
8Always use: `go test -v ./backend/api/handler/... | grep FAIL`
9 
10**Debugging & Handling Verbose Output:**
11**Avoid** `go test -v ./...` directly in the terminal due to excessive output.
12**Recommended Alternatives:**
13* **Specific Tests:** `go test -v ./... -run ^TestSpecificFunction$` (Fastest for pinpointing).
14 
15## Project Startup and Logging Rules
16 
17**Service Startup:**
18- Use `bash ./run.sh` to start the one-mcp service
19- This script automatically loads .env, ensures PATH, kills port 3000 processes, and starts the Go backend in background
20- Logs are output to `backend.log`
21 
22**Log Monitoring:**
23- Use `tail -f backend.log` to monitor real-time logs
24- Use `tail -n 50 backend.log` to view recent log entries
25- Use `grep "ERROR\|WARN\|Failed" backend.log` to filter error messages
26**Service Management:**
27- Use `pkill -f one-mcp` to stop the service
28- Check service status with `ps aux | grep one-mcp | grep -v grep`
29- API status endpoint: `curl "http://localhost:3003/api/status"`
30 
31## 数据库重置和缓存管理
32 
33**数据库重置规则:**
34- **重要:** 删除数据库前必须先备份:`cp data/one-mcp.db data/one-mcp.db.backup.$(date +%Y%m%d_%H%M%S)`
35- 仅删除数据库文件 `rm -f data/one-mcp.db` 是不够的
36- **必须同时清理Redis缓存:** `redis-cli flushdb` 或 `redis-cli flushall`
37- 原因:用户列表查询有缓存机制,如果缓存中存在用户数据,系统不会创建新的root用户
38 
39**完整的数据库重置流程:**
40```bash
41# 1. 停止服务
42pkill -f one-mcp
43 
44# 2. 备份现有数据库
45cp data/one-mcp.db data/one-mcp.db.backup.$(date +%Y%m%d_%H%M%S)
46 
47# 3. 删除数据库文件
48rm -f data/one-mcp.db
49 
50# 4. 清理Redis缓存
51redis-cli flushdb
52 
53# 5. 重新启动服务
54bash ./run.sh
55```
56 
57**验证root用户创建:**
58- 查看日志:`grep "no user exists\|create a root user" backend.log`
59- 检查数据库:`sqlite3 data/one-mcp.db "SELECT id, username, LENGTH(token) as token_length FROM users;"`
60 
61## 前端API调用规范
62 
63**API路径构建:**
64- 当使用 `frontend/src/utils/api.ts` 中导出的 `api` 实例进行API调用时 (例如 `api.get`, `api.post` 等),**请勿在请求路径中再次添加 `/api` 前缀**。
65- 这是因为 `api` 实例的 `baseURL` 已经被配置为 `/api`,重复添加会导致 `/api/api/` 这样的错误路径。
66- **正确示例:** `api.get('/user/self')` 或 `api.post('/user', data)`。
67- **错误示例:** `api.get('/api/user/self')`。
68 
69# 项目目录结构
70 
71## 根目录 (`/`)
72- `backend.log` - 后端服务的运行日志文件。包含服务启动、运行过程中的各种信息,用于调试和监控。
73- `data/` - 数据存储目录。通常包含数据库文件、缓存数据或其它持久化数据。
74- `one-mcp` - 主应用程序可执行文件(Go语言编译产物)。
75- `.git/` - Git版本控制系统目录。包含所有版本历史和配置信息。
76- `.cursor/` - Cursor IDE的配置文件和工作区特定文件,包括Agent的规则和任务文件。
77 - `rules/` - 存放Agent的规则文件,如 `tdd.mdc` 和 `plan-mode.mdc`。
78 - `tdd.mdc` - TDD(测试驱动开发)相关规则和测试指南。
79 - `plan-mode.mdc` - Agent的计划模式(PLAN Mode)操作指南。
80 - `act-mode.mdc` - Agent的执行模式(ACT Mode)操作指南。
81 - (其他可能的Cursor配置或任务文件)
82- `main.go` - Go语言后端服务的主入口文件。
83- `go.sum` - Go模块依赖校验和文件,用于确保依赖的完整性和安全性。
84- `go.mod` - Go模块定义文件,声明项目依赖的外部模块。
85- `.gitignore` - Git忽略文件配置,指定不应被版本控制的文件和目录。
86- `.cursorignore` - Cursor IDE忽略文件配置,指定在IDE中不应被索引或处理的文件和目录。
87- `frontend/` - 前端应用程序的根目录。
88 - `src/` - 前端源代码目录。 (内部文件和子目录待进一步探索和注释,但为了简洁,此处暂不列出)
89 - `package-lock.json` - npm或yarn的锁定文件,记录了项目依赖的精确版本信息。
90 - `package.json` - 前端项目的元数据文件,包含项目信息、脚本命令和依赖列表。
91 - `node_modules/` - Node.js模块安装目录,存放前端项目的所有依赖包。
92 - `dist/` - 前端项目构建后的输出目录,包含用于部署的静态文件(HTML, CSS, JS等)。
93 - `tsconfig.tsbuildinfo` - TypeScript构建信息文件,用于增量编译优化。
94 - `vite.config.ts` - Vite前端构建工具的配置文件(TypeScript版本)。
95 - `vite.config.d.ts` - Vite配置文件的类型声明文件。
96 - `tsconfig.json` - TypeScript编译器的配置文件,定义了如何编译TypeScript代码。
97 - `tailwind.config.js` - Tailwind CSS框架的配置文件,用于自定义CSS样式。
98 - `components.json` - 可能用于UI组件库的配置文件,定义组件路径或配置。
99 - `tsconfig.node.json` - 针对Node.js环境的TypeScript配置文件。
100 - `tsconfig.app.json` - 针对前端应用本身的TypeScript配置文件。
101 - `postcss.config.js` - PostCSS工具的配置文件,用于处理CSS。
102 - `index.html` - 前端应用的HTML入口文件。
103 - `public/` - 静态资源目录,其中文件不会被Webpack等打包工具处理,直接复制到`dist`。
104 - `.gitignore` - 前端项目的Git忽略文件配置。
105 - `README.md` - 前端项目的说明文档。
106 - `eslint.config.js` - ESLint代码风格检查工具的配置文件。
107- `run.sh` - 服务启动脚本。
108- `dev.sh` - 开发环境启动脚本。
109- `.vscode/` - VS Code编辑器的工作区配置目录。
110- `DEVELOPMENT.md` - 开发指南或说明文档。
111- `build.sh` - 项目构建脚本。
112- `config/` - 项目的配置目录,可能包含通用配置文件。
113- `locales/` - 国际化(i18n)文件目录,存放多语言资源。
114- `backend/` - 后端服务的根目录。
115 - `data/` - 后端数据模型或持久化层相关代码。
116 - `model/` - 后端数据模型定义。
117 - `common/` - 后端通用工具函数、常量或共享代码。
118 - `library/` - 后端第三方库的封装或自定义库。
119 - `service/` - 后端业务逻辑服务层代码。
120 - `api/` - 后端API接口定义和处理逻辑。
121 - `config/` - 后端配置相关代码或文件。
122- `.tool-versions` - asdf版本管理工具的配置文件,指定项目所需的工具版本。
123- `doc/` - 项目文档目录。
124- `upload/` - 文件上传存储目录。
125- `Dockerfile` - Docker容器的构建文件,定义了如何构建应用程序的Docker镜像。
126- `LICENSE` - 项目的开源许可证文件。
127- `README.en.md` - 英文版的项目说明文档。
128- `README.md` - 项目的中文说明文档。
129- `VERSION` - 版本号文件。
130 
131 

Commands it names

  • go test -v ./backend/api/handler/... | grep FAIL
  • go test -v ./...
  • go test -v ./... -run ^TestSpecificFunction$
  • go.sum
  • go.mod
  • eslint.config.js

Sections

  • Test-Driven Development (TDD)
  • Project Startup and Logging Rules
  • 数据库重置和缓存管理
  • 1. 停止服务
  • 2. 备份现有数据库
  • 3. 删除数据库文件
  • 4. 清理Redis缓存
  • 5. 重新启动服务
  • 前端API调用规范
  • 项目目录结构
  • 根目录 (`/`)

What it covers

testlint-formattesting-strategyapido-not

Stack — with the evidence

go

(1.00)

docker

(1.00)

node

(0.95)

react

(0.70)

tailwind

(0.70)

vite

(0.70)

vitest

(0.70)

playwright

(0.70)

eslint

(0.70)

typescript

(0.60)

github-actions

(0.60)

javascript

(0.50)

Glob targeting

  • *.tsx
  • *.go
  • *.ts

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
burugo
Language
—
License
—
Archived
no

All configs in this repo

Also in burugo/one-mcp

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
burugo/one-mcp.cursor/rules/language.mdc · 406Cursor rulesgodocker+10git4/1003 days ago
burugo/one-mcp.cursor/rules/thing.mdc · 406Cursor rulesgodocker+10styledatabase58/1003 days ago
burugo/one-mcpAGENTS.md · 406AGENTS.mdgodocker+10setupbuildtestlint-format+479/1003 days ago
Diff against .cursor/rules/language.mdc Diff against .cursor/rules/thing.mdc Diff against AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack