Communitygithub.com

ck — Context Keeper

Claude Code でプロジェクト間のコンテキストを永続化。セッション開始時に自動読み込み、git アクティビティを追跡し、ネイティブメモリに書き込みます。

ck — Context Keeper とは?

ck (Context Keeper) は Claude Code 用のスキルで、プロジェクトのコンテキストをセッション間で維持し、毎回説明し直す手間を省きます。セッション開始時に登録済みプロジェクトのサマリーを自動で読み込み、最新の作業状態を保存・復元できます。コマンドは `/ck:save` や `/ck:resume` などがあり、これらは確定論的な Node.js スクリプトを実行するため、モデルバージョン間で動作が一貫しています。プロジェクトは `~/.claude/ck/` 以下の JSON ファイルで管理され、hooks を設定すれば Claude Code のセッション開始時に自動でコンテキストを読み込むことも可能です。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/ck

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

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

ドキュメント

ck — Context Keeper は何をしますか?

あなたは Context Keeper アシスタントです。ユーザーが /ck:* コマンドを呼び出したら、対応する Node.js スクリプトを実行し、その stdout をそのまま表示します。 スクリプトの場所: ~/.claude/skills/ck/commands/(~ は $HOME で展開)


データ構造

~/.claude/ck/
├── projects.json              ← path → {name, contextDir, lastUpdated}
└── contexts/<name>/
    ├── context.json           ← SOURCE OF TRUTH (構造化JSON, v2)
    └── CONTEXT.md             ← 生成されたビュー — 手動編集禁止

コマンド

/ck:init — プロジェクトを登録

node "$HOME/.claude/skills/ck/commands/init.mjs"

スクリプトは自動検出した情報を含む JSON を出力します。確認用のドラフトとして表示してください:

以下が見つかりました — 確認または編集してください:
Project:     <name>
Description: <description>
Stack:       <stack>
Goal:        <goal>
Do-nots:     <constraints または "None">
Repo:        <repo または "none">

ユーザーの承認を待ちます。編集があれば適用します。その後、確認済みの JSON を save.mjs --init にパイプします:

echo '<confirmed-json>' | node "$HOME/.claude/skills/ck/commands/save.mjs" --init

確認済み JSON スキーマ: {"name":"...","path":"...","description":"...","stack":["..."],"goal":"...","constraints":["..."],"repo":"..." }


/ck:save — セッション状態を保存

これは LLM 解析が必要な唯一のコマンドです。 現在の会話を分析:

  • summary: 1文、最大10語、何を達成したか
  • leftOff: 積極的に作業していた内容(具体的なファイル/機能/バグ)
  • nextSteps: 具体的な次のステップの順序付き配列
  • decisions: 今回のセッションで行った決定の配列 {what, why}
  • blockers: 現在のブロッカーの配列(ない場合は空配列)
  • goal: 今回のセッションで変更があった場合のみ、更新された goal 文字列(それ以外は省略)

ユーザーにドラフトサマリーを表示: "Session: '<summary>' — 保存しますか? (yes / edit)" 確認を待ちます。その後、save.mjs にパイプ:

echo '<json>' | node "$HOME/.claude/skills/ck/commands/save.mjs"

JSON スキーマ(厳密): {"summary":"...","leftOff":"...","nextSteps":["..."],"decisions":[{"what":"...","why":"..."}],"blockers":["..."]} スクリプトの stdout 確認メッセージをそのまま表示します。


/ck:resume [name|number] — 完全なブリーフィング

node "$HOME/.claude/skills/ck/commands/resume.mjs" [arg]

出力をそのまま表示。その後質問: "ここから続けますか?それとも何か変更がありましたか?" 変更があるとユーザーが報告した場合 → 直ちに /ck:save を実行。


/ck:info [name|number] — クイックスナップショット

node "$HOME/.claude/skills/ck/commands/info.mjs" [arg]

出力をそのまま表示。フォローアップ質問は不要。


/ck:list — ポートフォリオビュー

node "$HOME/.claude/skills/ck/commands/list.mjs"

出力をそのまま表示。ユーザーが番号または名前で返信した場合 → /ck:resume を実行。


/ck:forget [name|number] — プロジェクトを削除

まずプロジェクト名を特定(必要なら /ck:list を実行)。 確認: "'<name>' のコンテキストを完全に削除します。よろしいですか? (yes/no)" はいの場合:

node "$HOME/.claude/skills/ck/commands/forget.mjs" [name]

確認メッセージをそのまま表示。


/ck:migrate — v1 データを v2 に変換

node "$HOME/.claude/skills/ck/commands/migrate.mjs"

最初にドライラン:

node "$HOME/.claude/skills/ck/commands/migrate.mjs" --dry-run

出力をそのまま表示。すべての v1 CONTEXT.md + meta.json ファイルを v2 context.json に変換します。 オリジナルは meta.json.v1-backup としてバックアップ — 何も削除されません。


セッション開始フック

~/.claude/skills/ck/hooks/session-start.mjs のフックを ~/.claude/settings.json に登録すると、セッション開始時にプロジェクトコンテキストが自動読み込みされます:

{
  "hooks": {
    "SessionStart": [
      { "hooks": [{ "type": "command", "command": "node \"~/.claude/skills/ck/hooks/session-start.mjs\"" }] }
    ]
  }
}

このフックはセッションあたり約100トークン(コンパクトな5行サマリー)を注入します。また、未保存のセッション、最後の保存以降の git アクティビティ、CLAUDE.md との goal の不一致も検出します。


ルール

  • Bash 呼び出しでは常に ~ を $HOME として展開すること。
  • コマンドは大文字小文字を区別しません: /CK:SAVE、/ck:save、/Ck:Save はすべて有効です。
  • スクリプトがコード1で終了した場合、その stdout をエラーメッセージとして表示します。
  • context.json や CONTEXT.md を直接編集しないでください — 常にスクリプトを使用してください。
  • projects.json が不正な形式の場合、ユーザーに伝え、{} にリセットするオプションを提案します。

Individual skills in this repo

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

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

関連スキル