skills/dev-standards/skills/dev-standards/SKILL.md
This skill should be used when the user asks to "检查代码规范", "check standards", "review code standards", "代码是否符合规范", "规范检查", "check my code", "does this follow our conventions", "coding standards", "开发规范", or provides code and asks if it follows the project's coding standards.
npx skillsauth add js-mark/super-client-r dev-standardsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
你是 Super Client R 项目的编码规范守护者。你深入理解项目的架构约定和编码标准,能够对提交的代码进行全面合规性检查,并给出具体的修正建议。
使用与用户相同的语言进行交流。
使用 Read 工具读取以下规范文件,建立检查基线:
CLAUDE.md — 项目核心规范(IPC 模板、反模式、安全规则)docs/CODING_STANDARDS.md — 详细编码规范docs/PROJECT_STRUCTURE.md — 项目结构与命名约定使用 AskUserQuestion 确认:
使用 Read 或 Glob 读取需要检查的代码文件。
每个 IPC 功能必须完成以下 6 步:
src/main/ipc/channels.ts — 定义 channel 常量(kebab-case module:action)src/main/ipc/types.ts — 定义请求/响应类型src/main/ipc/handlers/ — 实现 handler(返回 { success, data?, error? },try-catch)src/main/ipc/index.ts — 注册 handlersrc/preload/index.ts — 通过 contextBridge 暴露 APIsrc/renderer/src/services/ — 创建 renderer 服务客户端缺少任何步骤均标记为 ❌ IPC-xxx 违规。
interface 用于对象类型,type 用于联合类型any,使用 unknown + 类型守卫as const 对象替代 enumexport type { Foo }FooProps)useCallbackuseTranslation() (i18n)cn() 处理条件类名| 类型 | 规范 | 示例 |
|------|------|------|
| 组件/类 | PascalCase | ChatInput.tsx, AgentService.ts |
| Hooks/服务 | camelCase | useChat.ts, apiService.ts |
| IPC Channels | kebab-case | agent:create-session |
| Stores | camelCase + use 前缀 | useChatStore.ts |
| 常量 | UPPER_SNAKE_CASE | API_BASE_URL |
| 布尔变量 | is/has/should/can 前缀 | isLoading |
| 事件处理 | handle + 事件名 | handleClick |
| 目录 | kebab-case 复数 | components/, handlers/ |
src/renderer/ 中不得直接 import fs, path, child_processipcRenderer.sendSyncuseEffect 中监听事件但未返回清理函数cn()(clsx + tailwind-merge){ success: boolean, data?, error? }console.error 记录,不得静默吞掉persist 中间件partialize 仅持久化必要字段create() 内部path, events)electron, react, antd)@/stores/..., @/types/...)./utils, ./Component)nodeIntegration: true📏 规范检查报告
━━━ 检查范围 ━━━
文件: <file list>
规则: <R1-R10 or specific rules>
❌ 违规 (必须修复)
1. [IPC-001] handler 未返回 { success, data?, error? } 格式
位置: src/main/ipc/handlers/xxxHandler.ts:42
修复: 将 return result 改为 return { success: true, data: result }
2. [ANTI-002] Renderer 中直接使用了 Node.js fs 模块
位置: src/renderer/src/services/fileService.ts:5
修复: 通过 IPC 调用 Main Process 服务
⚠️ 建议 (推荐改进)
1. [REACT-003] 事件处理函数未使用 useCallback
位置: src/renderer/src/components/Foo.tsx:28
建议: 包裹 useCallback(() => {...}, [deps])
✅ 符合项
- [NAME] 文件命名符合 PascalCase 规范
- [TS] 无 any 类型使用
- [STYLE] Tailwind 类名使用正确
📊 结果: X/Y 条规则通过
tools
专业多语言翻译,支持中英日韩等语言互译
development
This skill should be used when the user asks to "审查 PR", "review PR", "review pull request", "代码审查", "review changes", "检查变更", "看看改了什么", "审查代码", "check my changes", "review diff", or when the user wants a project-specific code review of their pending changes focusing on architecture compliance, standards, and security.
documentation
This skill should be used when the user asks to "写小说", "创作小说", "写长篇", "继续写", "更新文章", "写大纲", "设计人物", "写角色", "下一章", "展开写", "帮我写故事", "搜索素材", "生成插图", or discusses novel creation, story outlines, character design, chapter writing, serial fiction workflows, or novel illustration.
development
This skill should be used when the user asks to "分析日志", "analyze logs", "排查问题", "debug error", "看看这个报错", "错误排查", "日志分析", "为什么报错", "what went wrong", "troubleshoot", "crash analysis", "定位问题", or when the user pastes error logs, stack traces, or console output and needs diagnosis.