Communitygithub.com

bg-szy/TOP-SKILLS

CASSメモリシステム - AIコーディングエージェントのための手続き型メモリ。3層の認知アーキテクチャ、信頼度減衰、アンチパターン学習、エージェント間知識転送、トラウマガード安全システムを備えたBun/TypeScript CLI。

TOP-SKILLS とは?

CASSメモリシステム(CM)は、AIコーディングエージェントのための手続き型メモリであり、散在するセッションを永続的でクロスエージェントな知識ベースに変換します。3層の認知アーキテクチャ(エピソード記憶、作業記憶、手続き記憶)を採用し、人間の専門知識発達を模倣しています。Claude Code、Cursor、Codex、Aiderなど複数のエージェントプラットフォームをサポートし、あるエージェントで発見されたパターンを自動的に他のエージェントが利用できるようにします。主な機能として、`cm context '<task>' --json`コマンドによるタスク関連知識の取得、90日半減期に基づく信頼度減衰システム、有害なルールを自動的に警告に変換するアンチパターン学習、そして「ホットストーブ」原則に基づくトラウマガード安全システムが含まれます。セッションからのルール抽出・検証・管理を自動化するACEパイプラインを備え、インラインコードコメントによるフィードバックをサポートし、ルールを手動で追加する必要がありません。

対応✓Claude Code✓Codex CLI✓Cursor✓Gemini CLI
npx skills add https://github.com/bg-szy/TOP-SKILLS/tree/HEAD/skills/marketplace/cm

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

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

ドキュメント

CM - CASSメモリシステム

AIコーディングエージェントのための手続き型メモリ。散在するセッションを永続的でクロスエージェントなメモリに変換します。人間の専門知識発達を模倣した3層の認知アーキテクチャを使用します。

存在理由

AIコーディングエージェントは貴重な知識を蓄積しますが、以下の問題があります:

  • セッションに閉じ込められている - セッション終了時にコンテキストが失われる
  • エージェント固有 - ClaudeはCursorが学習したことを知らない
  • 非構造化 - 生のログは実用的なガイダンスではない
  • 崩壊の危険 - 単純な要約では重要な詳細が失われる

今月、認証バグを異なるエージェント間で3回解決しました。毎回ゼロから始めていました。

CMはクロスエージェント学習でこれを解決します。Cursorで発見されたパターンは、Claude Codeで即座に利用可能になります。


3層認知アーキテクチャ

┌─────────────────────────────────────────────────────────────────────┐
│                    エピソード記憶 (cass)                              │
│   すべてのエージェントからの生のセッションログ — 「グラウンドトゥルース」    │
│   Claude Code │ Codex │ Cursor │ Aider │ PI │ Gemini │ ChatGPT │ ...│
└───────────────────────────┬─────────────────────────────────────────┘
                            │ cass search
                            ▼
┌─────────────────────────────────────────────────────────────────────┐
│                    作業記憶 (Diary)                                 │
│   構造化されたセッション要約: 成果、決定など                              │
└───────────────────────────┬─────────────────────────────────────────┘
                            │ reflect + curate (自動化)
                            ▼
┌─────────────────────────────────────────────────────────────────────┐
│                    手続き記憶 (Playbook)                            │
│   信頼度追跡と減衰を備えた蒸留ルール                                    │
└─────────────────────────────────────────────────────────────────────┘

すべてのエージェントのセッションが共有メモリにフィードされます。Cursorで発見されたパターンは、次のセッションでClaude Codeを自動的に支援します。


必要なコマンド

cm context "<タスク>" --json

重要なタスクを開始する前にこれを実行してください。 以下を返します:

  • relevantBullets - タスク関連性でスコア付けされたPlaybookのルール
  • antiPatterns - 問題を引き起こしたこと
  • historySnippets - 過去のセッション(自分のものと他のエージェントのもの)
  • suggestedCassQueries - より深い調査のための検索

履歴のソースによるフィルタリング

historySnippets[].origin.kind は "local" または "remote" です。リモートヒットには origin.host が含まれます:

{
  "historySnippets": [
    {
      "source_path": "~/.claude/sessions/session-001.jsonl",
      "origin": { "kind": "local" }
    },
    {
      "source_path": "/home/user/.codex/sessions/session.jsonl",
      "origin": { "kind": "remote", "host": "workstation" }
    }
  ]
}

信頼度減衰システム

ルールは不滅ではありません。再検証なしに信頼度は減衰します:

メカニズム効果
90日半減期フィードバックなしで90日ごとに信頼度が半減
4倍有害乗数1回のミスは1回の成功の4倍としてカウント
成熟度進行candidate → established → proven

スコア減衰の可視化

初期スコア: 10.0 (今日10の役立つマーク)

90日後 (半減期):   5.0
180日後:           2.5
270日後:           1.25
365日後:           0.78

実効スコア計算式

effectiveScore = decayedHelpful - (4 × decayedHarmful)

// 減衰係数 = 0.5 ^ (daysSinceFeedback / 90)

成熟度ステートマシン

  ┌──────────┐       ┌─────────────┐    ┌────────┐
  │ candidate│──────▶│ established │───▶│ proven │
  └──────────┘       └─────────────┘    └────────┘
       │                   │                  │
       │                   │ (有害率 >25%)   │
       │                   ▼                  │
       │             ┌─────────────┐          │
       └────────────▶│ deprecated  │◀─────────┘
                     └─────────────┘

遷移ルール:

遷移条件
candidate → established3+ 役立つ、有害率 <25%
established → proven10+ 役立つ、有害率 <10%
any → deprecated有害率 >25% または明示的な非推奨化

アンチパターン学習

悪いルールは単に削除されるわけではありません。それらは警告になります:

"パフォーマンスのために認証トークンをキャッシュする"
    ↓ (3つの有害マーク)
"落とし穴: 有効期限検証なしで認証トークンをキャッシュしないでください"

ルールが複数回有害とマークされた場合(3+マークで有害率>50%)、自動的にアンチパターンに反転されます。


ACEパイプライン(ルールの作成方法)

Generator → Reflector → Validator → Curator
ステージ役割LLM?
Generatorタスク前コンテキストハイドレーション (cm context)いいえ
Reflectorセッションからのパターン抽出 (cm reflect)はい
Validatorcass履歴に対するエビデンスゲートはい
Curator決定論的デルタマージいいえ

重要: CuratorはLLMを使用しません。反復的なドリフトによるコンテキスト崩壊を防ぐためです。LLMはパターンを提案します。決定論的ロジックがそれらを管理します。

科学的検証

ルールがPlaybookに追加される前に、cass履歴に対して検証されます:

提案ルール: "認証デバッグの前に常にトークンの有効期限を確認する"
    ↓
エビデンスゲート: これが適用されたセッションをcassで検索
    ↓
結果: 5セッション見つかり、4件成功 → 承認

履歴的エビデンスのないルールは、証明されるまでcandidateとしてフラグ付けされます。


コマンドリファレンス

コンテキスト取得(主要ワークフロー)

# メインコマンド - 重要なタスクの前に実行
cm context "ユーザー認証を実装" --json

# トークン予算に応じて結果を制限
cm context "バグ修正" --json --limit 5 --no-history

# ワークスペースフィルター付き
cm context "リファクタリング" --json --workspace /path/to/project

# 自己文書化説明
cm quickstart --json

# システムヘルス
cm doctor --json
cm doctor --fix  # 問題を自動修正

# 類似ルールの検索
cm similar "エラーハンドリングのベストプラクティス"

Playbook管理

cm playbook list                              # すべてのルール
cm playbook get b-8f3a2c                      # ルール詳細
cm playbook add "最初にテストを実行する"         # ルール追加
cm playbook add --file rules.json             # ファイルから一括追加
cm playbook add --file rules.json --session /path/session.jsonl  # ソース追跡
cm playbook remove b-xyz --reason "古い"      # 削除
cm playbook export > backup.yaml              # エクスポート
cm playbook import shared.yaml                # インポート
cm playbook bootstrap react                   # 既存にスターター適用

cm top 10                                     # 最も効果的なルール
cm stale --days 60                            # 最近フィードバックのないルール
cm why b-8f3a2c                               # ルールの由来
cm stats --json                               # Playbookヘルスメトリクス

学習とフィードバック

# 手動フィードバック
cm mark b-8f3a2c --helpful
cm mark b-xyz789 --harmful --reason "リグレッションを引き起こした"
cm undo b-xyz789                              # フィードバックを取り消し

# セッション結果(位置指定: ステータス, ルール)
cm outcome success b-8f3a2c,b-def456
cm outcome failure b-x7k9p1 --summary "認証アプローチが失敗"
cm outcome-apply                              # Playbookに適用

# 振り返り(通常は自動化)
cm reflect --days 7 --json
cm reflect --session /path/to/session.jsonl   # 単一セッション
cm reflect --workspace /path/to/project       # プロジェクト固有

# 検証
cm validate "null参照の前に必ずチェックする"

# セッションをルールに対して監査
cm audit --days 30

# 完全に非推奨化
cm forget b-xyz789 --reason "より良いパターンに取って代わられた"

オンボーディング(エージェントネイティブ)

既存のエージェントを使用したゼロコストのPlaybook構築:

cm onboard status                             # 進捗確認
cm onboard gaps                               # カテゴリギャップ
cm onboard sample --fill-gaps                 # 優先順位付けられたセッション
cm onboard sample --agent claude --days 14    # エージェント/時間でフィルタリング
cm onboard sample --workspace /path/project   # ワークスペースでフィルタリング
cm onboard sample --include-processed         # セッションを再分析
cm onboard read /path/session.jsonl --template  # リッチコンテキスト
cm onboard mark-done /path/session.jsonl      # 処理済みとしてマーク
cm onboard reset                              # 最初からやり直し

トラウマガード(安全システム)

cm trauma list                                # アクティブなパターン
cm trauma add "DROP TABLE" --description "大量削除" --severity critical
cm trauma heal t-abc --reason "意図的なマイグレーション"
cm trauma remove t-abc
cm trauma scan --days 30                      # トラウマをスキャン
cm trauma import shared-traumas.yaml

cm guard --install                            # Claude Codeフック
cm guard --git                                # Git pre-commitフック
cm guard --install --git                      # 両方
cm guard --status                             # インストール確認

システムコマンド

cm init                                       # 初期化
cm init --starter typescript                  # テンプレート付き
cm init --force                               # 再初期化(バックアップ作成)
cm starters                                   # テンプレート一覧
cm serve --port 3001                          # MCPサーバー
cm usage                                      # LLMコスト統計
cm privacy status                             # プライバシー設定
cm privacy enable                             # クロスエージェントエンリッチメント有効化
cm privacy disable                            # エンリッチメント無効化
cm project --format agents.md                 # AGENTS.md用にエクスポート

スタータープレイブック

空のPlaybookから始めるのは大変です。スターターが厳選されたベストプラクティスを提供します:

cm starters                    # 利用可能なものを一覧表示
cm init --starter typescript   # スターターで初期化
cm playbook bootstrap react    # 既存のPlaybookに適用

内蔵スターター

スターター焦点ルール数
general普遍的なベストプラクティス5
typescriptTypeScript/Node.jsパターン4
reactReact/Next.js開発4
pythonPython/FastAPI/Django4
nodeNode.js/Expressサービス4
rustRustサービスパターン4

カスタムスターター

~/.cass-memory/starters/ にYAMLファイルを作成:

# ~/.cass-memory/starters/django.yaml
name: django
description: Djangoウェブフレームワークのベストプラクティス
bullets:
  - content: "データベース操作には必ずDjangoのORMを使用する"
    category: database
    maturity: established
    tags: [django, orm]

インラインフィードバック(作業中)

コードコメントにフィードバックを残します。振り返り中に解析されます:

// [cass: helpful b-8f3a2c] - このルールのおかげで無駄な調査を回避できた

// [cass: harmful b-x7k9p1] - このアドバイスは私たちのユースケースには間違っていた

エージェントプロトコル

1. 開始:    cm context "<タスク>" --json
2. 作業:     ルールに従うときにルールIDを参照(例: "b-8f3a2cに従っています...")
3. フィードバック: ルールが役立った/害を及ぼしたときにインラインコメントを残す
4. 終了:     ただ終了する。学習は自動的に行われます。

以下を行う必要はありません:

  • cm reflect を実行する(自動化が処理します)
  • cm mark を手動で実行する(インラインコメントを使用してください)
  • 手動でルールをPlaybookに追加する

ギャップ分析カテゴリ

カテゴリキーワード
debuggingerror, fix, bug, trace, stack
testingtest, mock, assert, expect, jest
architecturedesign, pattern, module, abstraction
workflowtask, CI/CD, deployment
documentationcomment, README, API doc
integrationAPI, HTTP, JSON, endpoint
collaborationreview, PR, team
gitbranch, merge, commit
securityauth, token, encrypt, permission
performanceoptimize, cache, profile

カテゴリスタータスしきい値:

ステータスルール数優先度
critical0ルール高
underrepresented1-2ルール中
adequate3-10ルール低
well-covered11+ルールなし

トラウマガード: 安全システム

「熱いストーブ」の原則—過去のインシデントから学び、再発を防止します。

仕組み

セッション履歴              トラウマレジストリ              ランタイムガード
┌─────────────────┐         ┌─────────────────┐         ┌─────────────────┐
│ rm -rf /* (しまった)│ ──────▶ │ パターン: rm -rf │ ──────▶ │ ブロック: この  │
│ 「すみません、    │  scan   │ 重大度: FATAL   │  hook   │ コマンドは      │
│  間違えました...」│         │ セッション: abc123│         │ トラウマパターン │
└─────────────────┘         └─────────────────┘         └───と一致します───┘

内蔵の破壊パターン(20以上)

カテゴリ例
ファイルシステムrm -rf /, rm -rf ~, 再帰的削除
データベースDROP DATABASE, TRUNCATE, WHERE句なしのDELETE FROM
Gitmain/masterへのgit push --force, git reset --hard
インフラterraform destroy -auto-approve, kubectl delete namespace
クラウドaws s3 rm --recursive, 破壊的なCloudFormation

パターンストレージ

範囲場所目的
グローバル~/.cass-memory/traumas.jsonl個人パターン
プロジェクト.cass/traumas.jsonlチーム用にリポジトリにコミット

パターンライフサイクル

  • アクティブ: 一致するコマンドをブロック
  • ヒーリング: 一時的にバイパス(理由とタイムスタンプ付き)
  • 削除済み: 削除された(再追加可能)

MCPサーバー

エージェント統合用にMCPサーバーとして実行:

# ローカルのみ(推奨)
cm serve --port 3001

# 認証トークン付き(非ループバック用)
MCP_HTTP_TOKEN="<ランダム>" cm serve --host 0.0.0.0 --port 3001

公開ツール

ツール説明
get_contextタスクコンテキストを取得
add_ruleルールを追加
submit_feedbackフィードバックを送信
search_casscass履歴を検索
list_active_traumasアクティブなトラウマを一覧表示

.cassrc設定

cm init 時に ~/.cass-memory/.cassrc に生成されます。例:

# ~/.cass-memory/.cassrc
cass_path: ~/.cass-memory
api_keys:
  anthropic: sk-ant-...
  openai: sk-proj-...
enrichment: true
mcp:
  port: 3001

プライバシー: エンリッチメントが有効な場合、cm context は他のエージェントのセッションと照合します。無効にすると、ローカルセッションのみが使用されます。


より深く掘り下げる

シェル補完

cm completion zsh  > ~/.zsh/completions/_cm
cm completion bash > /etc/bash_completion.d/cm

システムログ

# デバッグ出力を表示
cm context "タスク" --json 2>&1 | head -100

# キャッシュ
cm doctor --fix  # キャッシュの問題を修正

リンク

Individual skills in this repo

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

bg-szy/TOP-SKILLS

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established visual direction. Skip when they have a design mockup, need a dashboard or app UI, are working at component level, building a multi-page app, or restyling with known design tokens — use frontend-design instead.

bg-szy/TOP-SKILLS

Fill out Microsoft Azure Landing Zone (ALZ) Accelerator checklists by interviewing the user, mapping their Azure subscriptions, integrating IP addressing documentation, and applying Microsoft Cloud Adoption Framework best practices. Produces a completed Excel checklist (.xlsx) ready for ALZ deployment. Use this skill whenever the user mentions Azure Landing Zone, ALZ checklist, landing zone accelerator, platform landing zone configuration, ALZ bootstrap, hub-and-spoke setup, Azure network topology planning, or wants to fill out any ALZ-related checklist or configuration file. Also trigger when the user uploads an Excel file that contains tabs like "Accelerator - Bootstrap", "Accelerator - Bicep", or "Accelerator - Terraform".

bg-szy/TOP-SKILLS

Compose a premium, animated landing page section by section in Next.js + Tailwind + Motion (Framer Motion) — built on a real design system, with editorial copy and motion that feels human-crafted, not template-generated. Use when building or rebuilding a landing page, marketing site, or hero/feature/pricing/CTA sections that need to look production-ready and bespoke from day one.

bg-szy/TOP-SKILLS

Write high-converting landing page copy using proven frameworks like PAS (Problem-Agitate-Solution), AIDA, and StoryBrand. Creates headlines, value propositions, CTAs, and full page sections optimized for conversion. Use when users need landing page copy, sales page content, or marketing website text.

bg-szy/TOP-SKILLS

Optimize landing pages for conversions, performance, and SEO. Use when improving landing pages, increasing conversions, or optimizing page performance.

bg-szy/TOP-SKILLS

Review investment portfolios for risk, diversification, fees. Asset allocation recommendations, tax-loss harvesting, rebalancing.

bg-szy/TOP-SKILLS

Beads Viewer - Graph-aware triage engine for Beads projects. Computes PageRank, betweenness, critical path, and cycles. Use --robot-* flags for AI agents.

bg-szy/TOP-SKILLS

CI red? Call us. Pipeline fire brigade deploys. Use when user mentions CI failures, build errors, test failures, or pipeline issues. Do NOT load for: local builds, standard implementation work, reviews, or setup.

bg-szy/TOP-SKILLS

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

bg-szy/TOP-SKILLS

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.

bg-szy/TOP-SKILLS

Use when the user asks to "pre-launch check the landing page", "run a Quality-Score preflight", or "verify ad-to-page message match before launch"; produces an ad↔page continuity report — message-match gaps, above-the-fold check, page-speed read, form-friction count, mobile-render flags — as a pass/fix punch list. Not for redesigning or rewriting the page — use landing-optimizer; not for scoring the account or the RQS — use ad-account-auditor. 落地页体验预检/广告落地页一致性检查

bg-szy/TOP-SKILLS

Use when the user asks to "optimize our landing page for influencer traffic", "fix our promo-code landing page", or "improve conversion from a creator campaign"; produces a message-match audit, page-structure and social-proof recommendations, a promo-code/CTA conversion plan, and an A/B test roadmap. Not for measuring campaign results after launch — use performance-analyzer.

bg-szy/TOP-SKILLS

Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review, critique or improve a landing page, sales page, opt-in page, product page or checkout flow, when conversion rate is low, when paid traffic is not converting, or when someone asks "why isn't this page converting" or wants a CRO / landing page review.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Account assets, equity and fund positions, P&L, cash flow records, account statements, margin ratios, buy-power estimates, order management, and DCA recurring investments via Longbridge (most require Trade permission). Frameworks: portfolio diagnosis, rebalancing, asset allocation, risk analysis (VaR/CVaR), performance attribution, and tax-loss harvesting. Triggers: "持仓", "账户", "盈亏", "资产", "对账单", "下单", "买入", "卖出", "撤单", "定投", "组合诊断", "再平衡", "资产配置", "风险分析", "绩效归因", "税损收割", "持倉", "賬戶", "盈虧", "對賬單", "下單", "買入", "賣出", "組合診斷", "再平衡", "稅損收割", "positions", "portfolio", "P&L", "order", "buy", "sell", "DCA", "statement", "risk analysis", "rebalancing", "tax harvesting", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

bg-szy/TOP-SKILLS

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

bg-szy/TOP-SKILLS

Process video files with audio extraction, format conversion (mp4, webm), and Whisper transcription. Use when user mentions video conversion, audio extraction, transcription, mp4, webm, ffmpeg, or whisper transcription.

bg-szy/TOP-SKILLS

Using the Wonda CLI to generate images, videos, music, and audio from the terminal — plus LinkedIn, Reddit, and X/Twitter research and automation

関連スキル