Communitygithub.com

/si:promote — 学習内容をルールに昇格

Claudeの自動メモリ(MEMORY.md)にある確立されたパターンをCLAUDE.mdまたは.claude/rules/に昇格させ、恒久的に強制されるルールにします。

si:promote — 学習内容をルールに昇格 とは?

このスキルは、Claude CodeなどのAIエージェントが自動メモリ(MEMORY.md)に蓄積した学習やパターンを、プロジェクトのルールシステム(CLAUDE.mdや.claude/rules/)に昇格させるためのワークフローを提供します。自動メモリは単なる背景ノートですが、昇格後は各セッションで強制される指示となり、チーム全体の一貫性を確保します。サポートされるプラットフォームはClaude Codeを想定しており、コマンドラインから直接操作できます。スキルはパターンの理解、自動メモリの検索、昇格先の決定、ルールへの変換、ファイルへの書き込み、古いメモリのクリーンアップという7段階の手順で構成され、昇格の判断基準やCLAUDE.mdと.claude/rules/の使い分け方も含まれています。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ASoudy/AGS/tree/HEAD/claude_skills_libraries/nginity-skills-library/engineering-team/self-improving-agent/skills/promote

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

si:promote — 学習内容をルールに昇格 は何をしますか?

Claudeの自動メモリからプロジェクトのルールシステムに、確立されたパターンを移動します。これにより、それは背景ノートではなく、強制される指示になります。

使用方法

/si:promote <パターンの説明>                    # 最適なターゲットを自動検出
/si:promote <パターン> --target claude.md       # CLAUDE.mdに昇格
/si:promote <パターン> --target rules/testing.md # スコープ付きルールに昇格
/si:promote <パターン> --target rules/api.md --paths "src/api/**/*.ts"  # パス指定付きスコープ

ワークフロー

ステップ1: パターンを理解する

ユーザーの説明を解析します。曖昧な場合、明確化のための質問を1つ行います:

  • 「Claudeが従うべき具体的な動作は何ですか?」
  • 「これはすべてのファイルに適用されますか、それとも特定のパスですか?」

ステップ2: 自動メモリ内のパターンを検索する

# MEMORY.md から関連エントリを検索
MEMORY_DIR="$HOME/.claude/projects/$(pwd | sed 's|/|%2F|g; s|%2F|/|; s|^/||')/memory"
grep -ni "<キーワード>" "$MEMORY_DIR/MEMORY.md"

一致するエントリを表示し、それがユーザーの意図するものであることを確認します。

ステップ3: 適切なターゲットを決定する

パターンのスコープターゲット例
プロジェクト全体に適用./CLAUDE.md「pnpmを使用し、npmは使用しない」
特定のファイルタイプに適用.claude/rules/<トピック>.md「APIハンドラにはバリデーションが必要」
全プロジェクトに適用~/.claude/CLAUDE.md「明示的なエラーハンドリングを優先」

ユーザーがターゲットを指定しなかった場合は、スコープに基づいて推奨します。

ステップ4: 簡潔なルールに抽出する

自動メモリのメモ形式から、CLAUDE.mdの指示形式に変換します:

変換前(MEMORY.md — 説明形式):

このプロジェクトはpnpmワークスペースを使用しています。npm installを試したところ失敗しました。ロックファイルはpnpm-lock.yamlです。依存関係にはpnpm installを使用する必要があります。

変換後(CLAUDE.md — 指示形式):

## ビルドと依存関係
- パッケージマネージャー: pnpm(npm不可)。`pnpm install` を使用。

抽出のルール:

  • 可能な限り1行1ルール
  • 命令形(「Xを使用」、「常にY」、「決してZしない」)
  • 概念だけでなく、コマンドや例を含める
  • 背景説明は不要 — 指示のみ

ステップ5: ターゲットに書き込む

CLAUDE.mdの場合:

  1. 既存のCLAUDE.mdを読み込む
  2. 適切なセクションを見つける(または作成する)
  3. 該当する見出しの下に新しいルールを追加する
  4. ファイルが200行を超える場合は、代わりに .claude/rules/ を使用することを提案する

.claude/rules/ の場合:

  1. ファイルが存在しなければ作成する
  2. スコープがある場合はYAMLフロントマターに paths を追加する
  3. ルールの内容を書き込む
---
paths:
  - "src/api/**/*.ts"
  - "tests/api/**/*"
---

# API開発ルール

- すべてのエンドポイントはZodスキーマで入力をバリデーションする
- エラーレスポンスには(生のErrorではなく)`ApiError` クラスを使用する
- ハンドラー関数にはOpenAPI JSDocコメントを含める

ステップ6: 自動メモリをクリーンアップする

昇格後、MEMORY.md内の元のエントリを削除またはマークします:

# 削除されるものを表示
grep -n "<パターン>" "$MEMORY_DIR/MEMORY.md"

ユーザーに削除の確認を求めます。その後、MEMORY.mdを編集して昇格したエントリを削除します。これにより、新しい学習内容のためのスペースが確保されます。

ステップ7: 確認

✅ {{ターゲット}} に昇格しました

ルール: "{{抽出されたルール}}"
ソース: MEMORY.md {{n}}行目(削除済み)
MEMORY.md: {{lines}}/200行 残り

このパターンは強制される指示になりました。Claudeは今後のすべてのセッションでこれに従います。

昇格判断ガイド

昇格すべき場合:

  • パターンが自動メモリに3回以上出現した
  • Claudeを同じことについて複数回訂正した
  • すべてのコントリビューターが知るべきプロジェクト規約である
  • 繰り返し発生するミスを防止する

昇格すべきでない場合:

  • 一度きりのデバッグメモである(自動メモリに残す)
  • セッション固有のコンテキストである(セッションメモリで対応)
  • 近いうちに変更される可能性がある(移行期間中など)
  • 既存のルールで既にカバーされている

CLAUDE.md vs .claude/rules/

CLAUDE.mdを使用する場合.claude/rules/を使用する場合
プロジェクト全体のルールファイルタイプ固有のパターン
ビルドコマンドテスト規約
アーキテクチャ上の決定API設計ルール
チーム規約フレームワーク固有の落とし穴

ヒント

  • CLAUDE.mdは200行未満に保つ — あふれた分はrules/を使用する
  • 1行1ルールの方が段落よりも管理が容易
  • 概念だけでなく、具体的なコマンドを含める
  • 昇格したルールは四半期ごとに見直す — 不要になったものは削除する

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ASoudy/AGS

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

ASoudy/AGS

Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

ASoudy/AGS

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

ASoudy/AGS

One sentence - what this skill does and when to invoke it

ASoudy/AGS

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

ASoudy/AGS

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

ASoudy/AGS

Pull a YouTube video transcript into a queryable markdown vault with yt-dlp subtitle discovery, VTT cleanup, metadata frontmatter, and capture-seed stubs.

ASoudy/AGS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

ASoudy/AGS

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

ASoudy/AGS

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

ASoudy/AGS

CRITICAL: Use for Makepad animation system. Triggers on: makepad animation, makepad animator, makepad hover, makepad state, makepad transition, "from: { all: Forward", makepad pressed, makepad 动画, makepad 状态, makepad 过渡, makepad 悬停效果

ASoudy/AGS

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

ASoudy/AGS

Next.js App Router principles. Server Components, data fetching, routing patterns.

ASoudy/AGS

Expert integration of Supabase Auth with Next.js App Router

ASoudy/AGS

React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

ASoudy/AGS

Best practices for Remotion - Video creation in React

ASoudy/AGS

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

ASoudy/AGS

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

ASoudy/AGS

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

ASoudy/AGS

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

関連スキル