ai-detective-game

ai-detective-game is a cursor rule for Cursor from cnwinds/ai-detective. It costs 0 tokens per session (2,535 once invoked), scanned A, original, MIT.

A set of project rules for an AI-powered detective game: a web game where an AI helps drive an investigation. It documents a Python FastAPI back end, a MySQL database, a plain JavaScript front end, and Docker deployment.

In plain words
What is it for?
Use it when changing game logic, evidence and accusation systems, saved game history, statistics, administration, API routes, or desktop and mobile interfaces.
Why use it?
It gives contributors a map of the game's parts and the technologies they must work with.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when changing game logic, evidence and accusation systems, saved game history, statistics, administration, API routes, or desktop and mobile interfaces.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/cnwinds/ai-detective/ai-detective-game
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.

Clone the repo
git clone --depth 1 https://github.com/cnwinds/ai-detective

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-detective-game

README.md
[![agentmods](https://agentmods.dev/badge/rules/cnwinds/ai-detective/ai-detective-game/github.svg)](https://agentmods.dev/rules/cnwinds/ai-detective/ai-detective-game)
Your own site
<a href="https://agentmods.dev/rules/cnwinds/ai-detective/ai-detective-game"><img src="https://agentmods.dev/badge/rules/cnwinds/ai-detective/ai-detective-game/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-detective-game

Your own site · 80×15
<a href="https://agentmods.dev/rules/cnwinds/ai-detective/ai-detective-game"><img src="https://agentmods.dev/badge/rules/cnwinds/ai-detective/ai-detective-game.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,535 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.02535
Opus 5 $0.00000 $0.01267
Sonnet 5 $0.00000 $0.00507
Haiku 4.5 $0.00000 $0.00253

Measured 9d ago against content hash 370b4ce9c527, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ai-detective-game 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 9d 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/ai-detective-game.mdc · 252 lines

How it starts

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

AI侦探推理游戏 - 项目核心规则

项目概述

这是一个AI驱动的侦探推理游戏,采用现代Web技术栈构建,支持PC和移动端双平台。项目完全使用Cursor AI开发完成,展示了AI辅助开发的强大潜力。

技术栈

  • 后端: Python + FastAPI + MySQL
  • 前端: 原生HTML/CSS/JavaScript (无框架)
  • AI服务: OpenAI兼容API
  • 部署: Docker + Docker Compose

项目架构

后端服务 (FastAPI)

backend/                    # 后端服务包
├── __init__.py            # 包初始化文件(必需)
├── app.py                 # FastAPI主应用 - 项目入口点
├── game_engine.py         # 游戏引擎核心逻辑
├── ai_service.py          # AI服务接口封装
├── models.py              # 数据模型定义
├── case_data.py           # 案例数据管理
├── evidence_system.py     # 证据系统
├── accusation_system.py   # 指控系统
├── game_recorder.py       # 游戏记录系统
├── statistics_service.py  # 统计服务
├── admin_auth.py          # 管理员认证
├── config.py              # 配置管理
├── version.py             # 版本管理
├── database.py            # 数据库操作
└── routes/                # API路由模块
    ├── __init__.py
    ├── game.py            # 游戏相关API
    ├── admin.py           # 管理员API
    ├── history.py         # 历史记录API
    ├── websocket.py       # WebSocket连接
    └── common.py          # 通用API

前端应用 (原生JavaScript)

frontend/                   # 前端界面
├── desktop.html           # PC桌面版界面
├── mobile.html            # 移动端界面
├── admin_dashboard.html   # 管理员仪表板
├── admin_history.html     # 管理员历史记录
├── admin_login.html       # 管理员登录
├── replay.html            # 游戏回放界面
└── static/                # 静态资源
    ├── css/               # 平台独立样式文件
    │   ├── desktop.css    # 桌面端完整独立样式
    │   └── mobile.css     # 移动端完整独立样式
    ├── js/                # JavaScript文件
    │   ├── desktop.js     # 桌面端主应用类
    │   ├── mobile.js      # 移动端主应用类
    │   ├── utils.js       # 通用工具类库
    │   ├── theme-manager.js # 主题管理系统
    │   └── theme-selector.js # 主题选择器组件
    └── themes.json        # 主题配置文件

部署和工具

docker/                    # Docker部署配置
├── Dockerfile            # Docker镜像构建
├── docker-compose.yml    # Docker Compose配置
├── deploy.sh             # Linux/macOS部署脚本
├── deploy.bat            # Windows部署脚本
└── mysql/                # MySQL配置
    └── init.sql          # 数据库初始化脚本

tools/                     # 开发工具
├── setup_database.py     # 数据库设置工具
└── update_version.py     # 版本更新工具

docs/                      # 项目文档
├── DEVELOPER_GUIDE.md     # 开发者指南
├── API_DOCUMENTATION.md  # API文档
└── AI侦探游戏案件创作指南.md # 案件创作指南

Read the full file on GitHub · 252 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. 9d ago First seen · 252 lines · 0 tokens per session scan A 370b4ce9c527

Subscribe to this mod's changes

ai-detective-game is a cursor rule published in the GitHub repository cnwinds/ai-detective (6 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,535 tokens. 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.