npx skills add https://github.com/akillness/oh-my-gods --skill agent-configuration项目描述文件(CLAUDE.md、README 等)是 面向 AI 的项目手册。AI 智能体在参考时会优先考虑这些文件。
/init # Claude 分析代码库并生成草稿
# Project: [项目名称]
## 技术栈
- **前端**: React + TypeScript
- **后端**: Node.js + Express
- **数据库**: PostgreSQL
- **ORM**: Drizzle
## 编码规范
- 使用 TypeScript 严格模式
- 优先使用服务端组件而非客户端组件
- 使用 `async/await` 而非 `.then()`
- 始终使用 Zod 验证用户输入
## 禁止事项
- 切勿提交 `.env` 文件
- 切勿在 TypeScript 中使用 `any` 类型
- 切勿绕过身份验证检查
- 切勿在客户端代码中暴露 API 密钥
## 常用命令
- `npm run dev`: 启动开发服务器
- `npm run build`: 构建生产版本
- `npm run test`: 运行测试
不佳(冗长):
我们的认证系统是使用 NextAuth.js 构建的,这是一个
用于 Next.js 应用程序的完整身份验证解决方案...
(5 行以上的解释)
Project description files (CLAUDE.md, README, etc.) are project manuals for AI. AI agents reference these files with top priority.
/init # Claude analyzes the codebase and generates a draft
# Project: [Project Name]
## Tech Stack
- **Frontend**: React + TypeScript
- **Backend**: Node.js + Express
- **Database**: PostgreSQL
- **ORM**: Drizzle
## Coding Standards
- Use TypeScript strict mode
- Prefer server components over client components
- Use `async/await` instead of `.then()`
- Always validate user input with Zod
## DO NOT
- Never commit `.env` files
- Never use `any` type in TypeScript
- Never bypass authentication checks
- Never expose API keys in client code
## Common Commands
- `npm run dev`: Start development server
- `npm run build`: Build for production
- `npm run test`: Run tests
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
良好(简洁):
## 身份验证
- 使用 Credentials 提供程序的 NextAuth.js
- JWT 会话策略
- **禁止**: 绕过身份验证检查、暴露会话密钥
"开始时可以没有项目描述文件。当你发现自己重复说同样的事情时,再添加内容。"
Hooks 是在特定事件上自动运行的 shell 命令。它们充当 AI 的 防护栏。
| Hook | 触发时机 | 使用场景 |
|---|---|---|
PreToolUse | 工具执行前 | 阻止危险命令 |
PostToolUse | 工具执行后 | 日志记录、发送通知 |
PermissionRequest | 权限请求时 | 自动批准/拒绝 |
Notification | 通知时 | 外部系统集成 |
SubagentStart | 子智能体启动时 | 监控 |
SubagentStop | 子智能体停止时 | 结果收集 |
// ~/.claude/settings.json
{
"hooks": {
"PreToolUse": [
{
"pattern": "rm -rf /",
"action": "block",
"message": "阻止根目录删除"
},
{
"pattern": "rm -rf /*",
"action": "block",
"message": "阻止危险删除命令"
},
{
"pattern": "sudo rm",
"action": "warn",
"message": "警告:sudo 删除命令"
},
{
"pattern": "curl * | sh",
"action": "block",
"message": "阻止管道脚本执行"
},
{
"pattern": "chmod 777",
"action": "warn",
"message": "警告:权限设置过高"
}
]
}
}
| 功能 | 加载时机 | 主要用户 | 令牌效率 |
|---|---|---|---|
| 项目描述文件 | 始终加载 | 项目团队 | 低(始终加载) |
| Skills | 按需加载 | AI 自动 | 高(按需) |
| 斜杠命令 | 用户调用时 | 开发者 | 中等 |
| 插件/MCP | 安装时 | 团队/社区 | 视情况而定 |
始终适用的规则 → 项目描述文件
仅特定任务所需的知识 → Skills(令牌效率高)
频繁使用的命令 → 斜杠命令
外部服务集成 → 插件 / MCP
# 创建 skill 目录
mkdir -p ~/.claude/skills/my-skill
# 编写 SKILL.md
cat > ~/.claude/skills/my-skill/SKILL.md << 'EOF'
---
name: my-skill
description: 我的自定义技能
platforms: [Claude, Gemini, ChatGPT]
---
# 我的技能
## 何时使用
- 当需要执行特定任务时
## 使用说明
1. 第一步
2. 第二步
EOF
.env、credentials.json 等密钥文件sudo 命令curl | sh 格式的脚本chmod 777 设置过高权限# 使用 cc-safe 工具检查危险命令
npx cc-safe .
npx cc-safe ~/projects
# 检测目标:
# - sudo, rm -rf, chmod 777
# - curl | sh, wget | bash
# - git reset --hard, git push --force
# - npm publish, docker run --privileged
# 仅自动批准安全命令
/sandbox "npm test"
/sandbox "npm run lint"
/sandbox "git status"
/sandbox "git diff"
# 模式批准
/sandbox "git *" # 所有 git 命令
/sandbox "npm test *" # npm test 相关
# MCP 工具模式
/sandbox "mcp__server__*"
project/
├── .claude/ # Claude Code 设置
│ ├── team-settings.json
│ ├── hooks/
│ └── skills/
├── .agent-skills/ # 通用技能
│ ├── backend/
│ ├── frontend/
│ └── ...
├── CLAUDE.md # 面向 Claude 的项目描述
├── .cursorrules # Cursor 设置
└── ...
{
"permissions": {
"allow": [
"Read(src/)",
"Write(src/)",
"Bash(npm test)",
"Bash(npm run lint)"
],
"deny": [
"Bash(rm -rf /)",
"Bash(sudo *)"
]
},
"hooks": {
"PreToolUse": {
"command": "bash",
"args": ["-c", "echo '团队钩子:验证中...'"]
}
},
"mcpServers": {
"company-db": {
"command": "npx",
"args": ["@company/db-mcp"]
}
}
}
提交 .claude/ 文件夹 → 团队成员克隆 → 相同设置自动应用 → 团队标准得以维持
| 智能体 | 配置文件 | 位置 |
|---|---|---|
| Claude Code | CLAUDE.md, settings.json | 项目根目录, ~/.claude/ |
| Gemini CLI | .geminirc | 项目根目录, ~/ |
| Cursor | .cursorrules | 项目根目录 |
| ChatGPT | 自定义指令 | UI 设置 |
.agent-skills/
├── backend/
├── frontend/
├── code-quality/
├── infrastructure/
├── documentation/
├── project-management/
├── search-analysis/
└── utilities/
/init 或手动)c, cc, g, cx)export EDITOR=vim)cc-safe)~/.claude/settings.json # 全局设置
~/.claude/skills/ # 全局技能
.claude/settings.json # 项目设置
.claude/skills/ # 项目技能
.agent-skills/ # 通用技能
CLAUDE.md # 项目 AI 手册
1. 使用 Hooks 阻止危险命令
2. 仅使用 /sandbox 自动批准安全命令
3. 定期使用 cc-safe 进行审计
4. 仅在容器中进行实验模式
项目描述文件:始终加载(保持简洁)
Skills:按需加载(令牌效率高)
.toon 模式:节省 95% 令牌
每周安装次数
1
代码仓库
首次出现
1 天前
安全审计
安装于
mcpjam1
claude-code1
replit1
junie1
windsurf1
zencoder1
Bad (verbose):
Our authentication system is built using NextAuth.js, which is a
complete authentication solution for Next.js applications...
(5+ lines of explanation)
Good (concise):
## Authentication
- NextAuth.js with Credentials provider
- JWT session strategy
- **DO NOT**: Bypass auth checks, expose session secrets
"Start without a project description file. Add content when you find yourself repeating the same things."
Hooks are shell commands that run automatically on specific events. They act as guardrails for AI.
| Hook | Trigger | Use Case |
|---|---|---|
PreToolUse | Before tool execution | Block dangerous commands |
PostToolUse | After tool execution | Log recording, send notifications |
PermissionRequest | On permission request | Auto approve/deny |
Notification | On notification | External system integration |
SubagentStart | Subagent start | Monitoring |
SubagentStop | Subagent stop | Result collection |
// ~/.claude/settings.json
{
"hooks": {
"PreToolUse": [
{
"pattern": "rm -rf /",
"action": "block",
"message": "Block root directory deletion"
},
{
"pattern": "rm -rf /*",
"action": "block",
"message": "Block dangerous deletion command"
},
{
"pattern": "sudo rm",
"action": "warn",
"message": "Caution: sudo delete command"
},
{
"pattern": "curl * | sh",
"action": "block",
"message": "Block piped script execution"
},
{
"pattern": "chmod 777",
"action": "warn",
"message": "Caution: excessive permission setting"
}
]
}
}
| Feature | Load Timing | Primary Users | Token Efficiency |
|---|---|---|---|
| Project Description File | Always loaded | Project team | Low (always loaded) |
| Skills | Load on demand | AI auto | High (on-demand) |
| Slash Commands | On user call | Developers | Medium |
| Plugins/MCP | On install | Team/Community | Varies |
Rules that always apply → Project Description File
Knowledge needed only for specific tasks → Skills (token efficient)
Frequently used commands → Slash Commands
External service integration → Plugins / MCP
# Create skill directory
mkdir -p ~/.claude/skills/my-skill
# Write SKILL.md
cat > ~/.claude/skills/my-skill/SKILL.md << 'EOF'
---
name: my-skill
description: My custom skill
platforms: [Claude, Gemini, ChatGPT]
---
# My Skill
## When to use
- When needed for specific tasks
## Instructions
1. First step
2. Second step
EOF
.env, credentials.jsonsudo commandscurl | sh formatchmod 777# Check for dangerous commands with cc-safe tool
npx cc-safe .
npx cc-safe ~/projects
# Detection targets:
# - sudo, rm -rf, chmod 777
# - curl | sh, wget | bash
# - git reset --hard, git push --force
# - npm publish, docker run --privileged
# Auto-approve only safe commands
/sandbox "npm test"
/sandbox "npm run lint"
/sandbox "git status"
/sandbox "git diff"
# Pattern approval
/sandbox "git *" # All git commands
/sandbox "npm test *" # npm test related
# MCP tool patterns
/sandbox "mcp__server__*"
project/
├── .claude/ # Claude Code settings
│ ├── team-settings.json
│ ├── hooks/
│ └── skills/
├── .agent-skills/ # Universal skills
│ ├── backend/
│ ├── frontend/
│ └── ...
├── CLAUDE.md # Project description for Claude
├── .cursorrules # Cursor settings
└── ...
{
"permissions": {
"allow": [
"Read(src/)",
"Write(src/)",
"Bash(npm test)",
"Bash(npm run lint)"
],
"deny": [
"Bash(rm -rf /)",
"Bash(sudo *)"
]
},
"hooks": {
"PreToolUse": {
"command": "bash",
"args": ["-c", "echo 'Team hook: validating...'"]
}
},
"mcpServers": {
"company-db": {
"command": "npx",
"args": ["@company/db-mcp"]
}
}
}
Commit .claude/ folder → Team members Clone → Same settings automatically applied → Team standards maintained
| Agent | Config File | Location |
|---|---|---|
| Claude Code | CLAUDE.md, settings.json | Project root, ~/.claude/ |
| Gemini CLI | .geminirc | Project root, ~/ |
| Cursor | .cursorrules | Project root |
| ChatGPT | Custom Instructions | UI settings |
.agent-skills/
├── backend/
├── frontend/
├── code-quality/
├── infrastructure/
├── documentation/
├── project-management/
├── search-analysis/
└── utilities/
/init or manual)c, cc, g, cx)export EDITOR=vim)cc-safe)~/.claude/settings.json # Global settings
~/.claude/skills/ # Global skills
.claude/settings.json # Project settings
.claude/skills/ # Project skills
.agent-skills/ # Universal skills
CLAUDE.md # Project AI manual
1. Block dangerous commands with Hooks
2. Auto-approve only safe commands with /sandbox
3. Regular audit with cc-safe
4. Experiment mode in containers only
Project Description File: Always loaded (keep concise)
Skills: Load on demand (token efficient)
.toon mode: 95% token savings
Weekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Installed on
mcpjam1
claude-code1
replit1
junie1
windsurf1
zencoder1
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
62,200 周安装
Dev Browser:JavaScript沙盒化浏览器控制CLI工具 - 自动化测试与爬虫开发利器
1,200 周安装
OKX Onchain OS 审计日志技能 - 离线问题排查与日志文件路径指南
1,200 周安装
Playwright 交互式测试技能:持久会话调试本地Web/Electron应用,无需重启工具链
1,100 周安装
自动设置预提交钩子:Husky + lint-staged + Prettier 一键配置代码质量检查
1,200 周安装
CTF Pwn 二进制漏洞利用技术大全 - 栈溢出、ROP、格式化字符串、内核利用实战指南
1,100 周安装
Claude Code 内存优化器:4步减少30-50%令牌,提升加载速度与API成本效益
1,100 周安装