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.
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.mdinstinct-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 的 REST API 设计模式,包括资源命名、状态码、分页、过滤、错误响应、版本控制和速率限制。
用于系统设计、可扩展性及技术决策的软件架构专家。在规划新功能、重构大型系统或做出架构决策时请主动(PROACTIVELY)使用。
编写文章、指南、博客、教程、时事通讯(Newsletter)等长内容,支持从示例或品牌指南中提取独特的语感语调。适用于需要撰写超过一个段落的精炼文本,尤其是对语气一致性、结构和可信度有较高要求时。
后端架构模式、API 设计、数据库优化以及 Node.js、Express 和 Next.js API 路由的服务端最佳实践。
构建与 TypeScript 错误修复专家。当构建失败或出现类型错误时,请主动(PROACTIVELY)使用。仅修复构建/类型错误,保持最小差异(diff),不进行架构性修改。重点是快速使构建通过(get the build green)。
个人通讯幕僚 (Chief of Staff),负责分拣电子邮件、Slack、LINE 和 Messenger。将消息分类为 4 个级别 (skip/info_only/meeting_info/action_required),生成草稿回复,并通过钩子 (Hooks) 强制执行发送后的后续跟进。适用于管理多渠道通讯工作流。
启动 NanoClaw 智能体 (Agent) REPL — 一个由 claude CLI 驱动的持久化、会话感知 (session-aware) 的 AI 助手。
ClickHouse 数据库模式、查询优化、分析以及高性能分析工作负载的数据工程最佳实践。