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 blocksRepository
406
— · pushed 1 days agoLast changed
3 days ago
First indexed 3 days ago.123456## Test-Driven Development (TDD)7**Final Verification:**8Always use: `go test -v ./backend/api/handler/... | grep FAIL`910**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).1415## Project Startup and Logging Rules1617**Service Startup:**18- Use `bash ./run.sh` to start the one-mcp service19- This script automatically loads .env, ensures PATH, kills port 3000 processes, and starts the Go backend in background20- Logs are output to `backend.log`2122**Log Monitoring:**23- Use `tail -f backend.log` to monitor real-time logs24- Use `tail -n 50 backend.log` to view recent log entries25- Use `grep "ERROR\|WARN\|Failed" backend.log` to filter error messages26**Service Management:**27- Use `pkill -f one-mcp` to stop the service28- Check service status with `ps aux | grep one-mcp | grep -v grep`29- API status endpoint: `curl "http://localhost:3003/api/status"`3031## 数据库重置和缓存管理3233**数据库重置规则:**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用户3839**完整的数据库重置流程:**40```bash41# 1. 停止服务42pkill -f one-mcp4344# 2. 备份现有数据库45cp data/one-mcp.db data/one-mcp.db.backup.$(date +%Y%m%d_%H%M%S)4647# 3. 删除数据库文件48rm -f data/one-mcp.db4950# 4. 清理Redis缓存51redis-cli flushdb5253# 5. 重新启动服务54bash ./run.sh55```5657**验证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;"`6061## 前端API调用规范6263**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')`。6869# 项目目录结构7071## 根目录 (`/`)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` - 版本号文件。130131
Also in burugo/one-mcp
Diff this repo’s formatsOne 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?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| burugo/one-mcp.cursor/rules/language.mdc · 406 | Cursor rules | git | 4/100 | 3 days ago | |
| burugo/one-mcp.cursor/rules/thing.mdc · 406 | Cursor rules | styledatabase | 58/100 | 3 days ago | |
| burugo/one-mcpAGENTS.md · 406 | AGENTS.md | setupbuildtestlint-format+4 | 79/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
