Skip to main content
ClaudeWave
Slash Command1.2k estrellas del repoactualizado 3mo ago

instinct-export

The instinct-export command exports learned coding patterns and habits from Claude Code's project or global scope into shareable YAML files. Use this command when migrating instincts to new machines, collaborating with team members, or contributing standardized behaviors to project conventions. Filter exports by domain, confidence level, or scope using optional flags, with results written to specified files or standard output.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/xu-xiang/everything-claude-code-zh/HEAD/commands/instinct-export.md -o ~/.claude/commands/instinct-export.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

instinct-export.md

# 习惯(Instinct)导出命令(Instinct Export Command)

将习惯(Instincts)导出为可共享格式。适用于:
- 与团队成员共享
- 迁移至新机器
- 为项目规范(Conventions)做贡献

## 用法(Usage)

```
/instinct-export                           # 导出所有个人习惯
/instinct-export --domain testing          # 仅导出测试相关的习惯
/instinct-export --min-confidence 0.7      # 仅导出高置信度的习惯
/instinct-export --output team-instincts.yaml
/instinct-export --scope project --output project-instincts.yaml
```

## 执行逻辑(What to Do)

1. 检测当前项目上下文(Context)
2. 按选定范围(Scope)加载习惯:
   - `project`:仅限当前项目
   - `global`:仅限全局
   - `all`:项目 + 全局合并(默认)
3. 应用过滤器(`--domain`、`--min-confidence`)
4. 将 YAML 格式的导出结果写入文件(如果未提供输出路径,则输出至 `stdout`)

## 输出格式(Output Format)

创建一个 YAML 文件:

```yaml
# Instincts Export
# Generated: 2025-01-22
# Source: personal
# Count: 12 instincts

---
id: prefer-functional-style
trigger: "when writing new functions"
confidence: 0.8
domain: code-style
source: session-observation
scope: project
project_id: a1b2c3d4e5f6
project_name: my-app
---

# Prefer Functional Style

## Action
Use functional patterns over classes.
```

## 参数(Flags)

- `--domain <name>`:仅导出指定领域(Domain)
- `--min-confidence <n>`:最低置信度阈值
- `--output <file>`:输出文件路径(省略时打印至 `stdout`)
- `--scope <project|global|all>`:导出范围(Scope)(默认:`all`)
api-designSkill

生产级 API 的 REST API 设计模式,包括资源命名、状态码、分页、过滤、错误响应、版本控制和速率限制。

article-writingSkill

编写文章、指南、博客、教程、时事通讯(Newsletter)等长内容,支持从示例或品牌指南中提取独特的语感语调。适用于需要撰写超过一个段落的精炼文本,尤其是对语气一致性、结构和可信度有较高要求时。

backend-patternsSkill

后端架构模式、API 设计、数据库优化以及 Node.js、Express 和 Next.js API 路由的服务端最佳实践。

coding-standardsSkill

TypeScript、JavaScript、React、Node.js 开发的通用编码标准、最佳实践和模式。

content-engineSkill

为 X、LinkedIn、TikTok、YouTube、时事通讯(Newsletters)以及跨平台内容重加工营销活动(Repurposed multi-platform campaigns)创建平台原生的内容系统。当用户需要社交媒体帖子、推文串(Threads)、脚本、内容日历,或将单一源素材清晰地适配到多个平台时使用。

e2e-testingSkill

Playwright E2E 测试模式、页面对象模型(POM)、配置、CI/CD 集成、产物管理以及不稳定测试(flaky test)策略。

eval-harnessSkill

适用于 Claude Code 会话的正规评测框架(Evaluation Framework),实现了评测驱动开发(Eval-Driven Development, EDD)原则

frontend-patternsSkill

React、Next.js、状态管理(State Management)、性能优化(Performance Optimization)及 UI 最佳实践的前端开发模式。