README

A set of Cursor rules for an AI detective game, covering its project structure, game logic, frontend, backend, API, themes, and troubleshooting.

In plain words
What is it for?
Use it when working on the game's Python backend, JavaScript frontend, APIs, WebSockets, themes, or recurring problem records.
Why use it?
It tells the coding assistant which project documentation to load and which development rules to follow for different questions.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/cnwinds/ai-detective/readme
Clone the repo
git clone --depth 1 https://github.com/cnwinds/ai-detective

Made for: Cursor.

Per session 3,500 This file is loaded in full into every session.
When invoked 3,500 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.03500 $0.03500
Opus 5 $0.01750 $0.01750
Sonnet 5 $0.00700 $0.00700
Haiku 4.5 $0.00350 $0.00350

Measured 2d ago against content hash 4e4ebc53236b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

README scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/README.mdc · 289 lines

How it starts

The opening of the file, as written. The whole thing — 289 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI侦探推理游戏 - Cursor规则总览

🤖 AI助手使用指南

⚠️ 重要原则: 你要根据用户的问题,决定是否要阅读其他的文档内容。

  • 强制加载: 每次对话都必须先加载本README文件
  • 按需加载: 根据问题内容决定是否需要加载其他专业文档
  • 智能判断: 分析用户问题的类型和复杂度,选择合适的文档组合
  • 高效响应: 避免无关文档的加载,提高响应效率

规则文件索引

本目录包含AI侦探推理游戏项目的完整Cursor规则集,帮助AI助手更好地理解项目结构、遵循开发规范、掌握核心概念。

重要提醒: 在开发过程中,相同的问题超过2次遇到,最终解决后,需要将问题和解决方案记录在 @troubleshooting-guide.mdc 文件中。如果之前有类似问题则进行修正。

📋 核心规则文件 (6个)

  1. ai-detective-game.mdc - 项目核心规则 (9.1KB)

    • 项目概述和技术栈
    • 项目架构和模块组织
    • 游戏机制和数据结构
    • 核心组件说明
    • AI交互机制和业务逻辑
  2. backend-development.mdc - 后端开发规范 (35KB+)

    • FastAPI应用架构和路由设计
    • Python异步编程和流式响应
    • Pydantic数据模型和验证
    • 错误处理和异常管理
    • 性能优化和缓存策略
    • 代码重构模式和最佳实践
    • 日志监控和性能分析
  3. frontend-development.mdc - 前端开发规范 (30KB+)

    • 原生JavaScript应用架构
    • CSS组件化和响应式设计
    • 移动端开发和触摸优化
    • 主题系统和设备适配
    • 性能优化和内存管理
    • HTML语义化和可访问性
    • 错误处理和用户体验
  4. theme-color-standards.mdc - 主题色规范 (新增, 18KB)

    • 完整的主题色系统设计规范
    • 核心主题变量定义和使用规则
    • 角色色彩系统和自动生成机制
    • 自定义组件样式规范(CustomSelect等)
    • 响应式适配和可访问性标准
    • 开发检查清单和常见问题解答
  5. api-development.mdc - API开发规范 (24KB)

    • RESTful API设计原则和架构设计
    • 后端Python实现和前端JavaScript调用
    • 游戏核心API (问答、指控、提示、会话管理)
    • WebSocket通信和流式响应处理
    • 管理员认证和历史记录API
    • 统一错误处理和性能优化
    • APIHelper工具类和最佳实践
  6. troubleshooting-guide.mdc - 故障排除和部署指南 (18KB)

    • 常见问题诊断 (导入、服务器、前端、WebSocket)
    • 调试技巧 (前端和后端)
    • 部署指南 (开发环境、Docker、生产环境)
    • 数据库管理和备份恢复
    • 性能监控和日志分析
    • 版本管理和更新策略

🎯 使用指南

🎯 按角色查看规则

后端开发者:

  1. ai-detective-game.mdc - 了解项目整体架构
  2. backend-development.mdc - 掌握Python/FastAPI开发规范
  3. api-development.mdc - 学习API设计和实现
  4. troubleshooting-guide.mdc - 解决后端问题

前端开发者:

  1. ai-detective-game.mdc - 了解项目整体架构
  2. frontend-development.mdc - 掌握JavaScript/CSS开发规范
  3. theme-color-standards.mdc - 遵循主题色彩规范
  4. api-development.mdc - 学习API调用方式
  5. troubleshooting-guide.mdc - 解决前端问题

Read the full file on GitHub · 289 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 289 lines · 3,500 tokens per session scan A 4e4ebc53236b

Subscribe to this mod's changes

README is a cursor rule published in the GitHub repository cnwinds/ai-detective (6 stars, last pushed 1y ago), licensed MIT. It adds 3,500 tokens to every session, about $0.0175 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.