跳转至

/skill-create - 本地技能生成

通过分析仓库的 git 历史来提取编码模式,并生成用于向 Claude 传授团队实践的 SKILL.md 文件。

使用方法

/skill-create                    # 現在のリポジトリを分析
/skill-create --commits 100      # 最後の100コミットを分析
/skill-create --output ./skills  # カスタム出力ディレクトリ
/skill-create --instincts        # continuous-learning-v2用のinstinctsも生成

执行内容

  1. 解析 Git 历史 - 分析提交、文件变更和模式
  2. 检测模式 - 识别重复的工作流和惯例
  3. 生成 SKILL.md - 创建有效的 Claude Code 技能文件
  4. 可选创建 Instincts - 用于 continuous-learning-v2 系统

分析步骤

步骤 1:收集 Git 数据

# ファイル変更を含む最近のコミットを取得
git log --oneline -n ${COMMITS:-200} --name-only --pretty=format:"%H|%s|%ad" --date=short

# ファイル別のコミット頻度を取得
git log --oneline -n 200 --name-only | grep -v "^$" | grep -v "^[a-f0-9]" | sort | uniq -c | sort -rn | head -20

# コミットメッセージのパターンを取得
git log --oneline -n 200 | cut -d' ' -f2- | head -50

步骤 2:检测模式

查找以下模式类型:

模式 检测方法
提交规范 提交消息的正则表达式(feat:、fix:、chore:)
文件共同变更 总是被一起修改的文件
工作流序列 重复的文件变更模式
架构 文件夹结构和命名规则
测试模式 测试文件的位置、命名和覆盖率

步骤 3:生成 SKILL.md

输出格式:

---
name: {repo-name}-patterns
description: {repo-name}から抽出されたコーディングパターン
version: 1.0.0
source: local-git-analysis
analyzed_commits: {count}
---

# {Repo Name} Patterns

## コミット規約
{検出されたコミットメッセージパターン}

## コードアーキテクチャ
{検出されたフォルダ構造と構成}

## ワークフロー
{検出された繰り返しファイル変更パターン}

## テストパターン
{検出されたテスト規約}

步骤 4:生成 Instincts(--instincts 时)

用于 continuous-learning-v2 集成:

---
id: {repo}-commit-convention
trigger: "when writing a commit message"
confidence: 0.8
domain: git
source: local-repo-analysis
---

# Conventional Commitsを使用

## Action
コミットにプレフィックス: feat:, fix:, chore:, docs:, test:, refactor:

## Evidence
- {n}件のコミットを分析
- {percentage}%がconventional commitフォーマットに従う

输出示例

在 TypeScript 项目中运行 /skill-create 时,可能会生成如下输出:

---
name: my-app-patterns
description: my-appリポジトリからのコーディングパターン
version: 1.0.0
source: local-git-analysis
analyzed_commits: 150
---

# My App Patterns

## コミット規約

このプロジェクトは**conventional commits**を使用します:
- `feat:` - 新機能
- `fix:` - バグ修正
- `chore:` - メンテナンスタスク
- `docs:` - ドキュメント更新

## コードアーキテクチャ
src/ ├── components/ # Reactコンポーネント(PascalCase.tsx) ├── hooks/ # カスタムフック(use*.ts) ├── utils/ # ユーティリティ関数 ├── types/ # TypeScript型定義 └── services/ # APIと外部サービス
## ワークフロー

### 新しいコンポーネントの追加
1. `src/components/ComponentName.tsx`を作成
2. `src/components/__tests__/ComponentName.test.tsx`にテストを追加
3. `src/components/index.ts`からエクスポート

### データベースマイグレーション
1. `src/db/schema.ts`を変更
2. `pnpm db:generate`を実行
3. `pnpm db:migrate`を実行

## テストパターン

- テストファイル: `__tests__/`ディレクトリまたは`.test.ts`サフィックス
- カバレッジ目標: 80%以上
- フレームワーク: Vitest

GitHub App 集成

如需高级功能(10k 以上提交、团队共享、自动 PR),请使用 Skill Creator GitHub App:

相关命令

  • /instinct-import - 导入生成的 instincts
  • /instinct-status - 显示已学习的 instincts
  • /evolve - 将 instincts 聚类为技能/代理

Everything Claude Code 的一部分

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 ev/ECC