本文へ移動
cccskills
無料GitHub で公開

ai-context-layer

Designs cross-session agent memory: point-in-time facts, consolidation, tenant isolation. Use when auditing user memory or Mem0/Zep. Not for repo context (dev-context-engineering).

インストール方法を見る

含まれるファイル(162)

  • SKILL.md14.3 KB
  • agents/openai.yaml372 B
  • assets/contracts/context-bundle-template.md640 B
  • assets/contracts/entity-memory-contract.md1.1 KB
  • assets/contracts/feedback-outcome-contract.md2.3 KB
  • assets/design/context-layer-review-template.md369 B
  • assets/design/context-layer-system-design.md589 B
  • assets/eval/context-layer-scorecard.md4.9 KB
  • builds/cookbooks/cognee.md5.0 KB
  • builds/cookbooks/git_repo_ingest.md10.1 KB
  • builds/cookbooks/jit_context_loading.md928 B
  • builds/cookbooks/langgraph_store.md4.6 KB
  • builds/cookbooks/latency_cost.md6.9 KB
  • builds/cookbooks/letta.md4.9 KB
  • builds/cookbooks/mem0.md5.0 KB
  • builds/cookbooks/mongodb_atlas.md8.3 KB
  • builds/cookbooks/multimodal_assembly.md863 B
  • builds/cookbooks/openai_retrieval_managed.md1.0 KB
  • builds/cookbooks/ops_runbook.md9.3 KB
  • builds/cookbooks/pgvector.md4.9 KB
  • builds/cookbooks/README.md3.1 KB
  • builds/cookbooks/supermemory.md4.0 KB
  • builds/cookbooks/traps.md8.7 KB
  • builds/cookbooks/vertex_memory_bank.md1.1 KB
  • builds/demo/end_to_end.py6.3 KB
  • builds/demo/jit_multimodal.py4.4 KB
  • builds/demo/README.md1.6 KB
  • builds/evals/fakes.py6.9 KB
  • builds/evals/harness.py705 B
  • builds/evals/metrics/__init__.py675 B
  • builds/evals/metrics/rot.py4.0 KB
  • builds/evals/metrics/variance.py2.8 KB
  • builds/evals/README.md5.4 KB
  • builds/evals/reports/__init__.py103 B
  • builds/evals/reports/rollup.py1.9 KB
  • builds/evals/suites/cognee/__init__.py0 B
  • builds/evals/suites/cognee/conftest.py1.3 KB
  • builds/evals/suites/cognee/test_cognee.py976 B
  • builds/evals/suites/context_rot/__init__.py0 B
  • builds/evals/suites/context_rot/conftest.py1.2 KB
  • builds/evals/suites/context_rot/dataset.jsonl3.2 KB
  • builds/evals/suites/context_rot/README.md2.7 KB
  • builds/evals/suites/context_rot/test_context_rot.py5.4 KB
  • builds/evals/suites/jit_loading/__init__.py1 B
  • builds/evals/suites/jit_loading/test_jit_loading.py3.4 KB
  • builds/evals/suites/langgraph_store/__init__.py0 B
  • builds/evals/suites/langgraph_store/conftest.py1.1 KB
  • builds/evals/suites/langgraph_store/test_langgraph_store.py2.2 KB
  • builds/evals/suites/letta/__init__.py0 B
  • builds/evals/suites/letta/conftest.py1.5 KB
  • builds/evals/suites/letta/test_letta.py1.1 KB
  • builds/evals/suites/managed_boundary/__init__.py1 B
  • builds/evals/suites/managed_boundary/test_managed_boundary.py3.2 KB
  • builds/evals/suites/mem0/__init__.py0 B
  • builds/evals/suites/mem0/conftest.py1.3 KB
  • builds/evals/suites/mem0/test_mem0.py1.2 KB
  • builds/evals/suites/mode_collapse/__init__.py0 B
  • builds/evals/suites/mode_collapse/conftest.py1.3 KB
  • builds/evals/suites/mode_collapse/dataset.jsonl1.3 KB
  • builds/evals/suites/mode_collapse/README.md2.8 KB
  • builds/evals/suites/mode_collapse/test_mode_collapse.py2.8 KB
  • builds/evals/suites/multimodal/__init__.py1 B
  • builds/evals/suites/multimodal/test_multimodal.py3.1 KB
  • builds/evals/suites/postgres/__init__.py0 B
  • builds/evals/suites/postgres/conftest.py1.9 KB
  • builds/evals/suites/postgres/test_postgres_memory.py8.8 KB
  • builds/evals/suites/proactive_interference/__init__.py0 B
  • builds/evals/suites/proactive_interference/README.md2.5 KB
  • builds/evals/suites/proactive_interference/test_proactive_interference.py7.7 KB
  • builds/evals/suites/smoke/__init__.py0 B
  • builds/evals/suites/smoke/test_smoke.py13.7 KB
  • builds/evals/suites/smoke/test_tenant_canary.py3.9 KB
  • builds/evals/suites/state_maintenance/__init__.py0 B
  • builds/evals/suites/state_maintenance/README.md1.4 KB
  • builds/evals/suites/state_maintenance/test_sqlite_lifecycle.py11.5 KB
  • builds/evals/suites/state_maintenance/test_state_maintenance.py7.4 KB
  • builds/evals/suites/supermemory/__init__.py0 B
  • builds/evals/suites/supermemory/conftest.py1.4 KB
  • builds/evals/suites/supermemory/test_supermemory.py1.1 KB
  • builds/README.md4.7 KB
  • builds/reference_app/__init__.py106 B
  • builds/reference_app/adapters/__init__.py2.3 KB
  • builds/reference_app/adapters/anthropic_llm.py2.7 KB
  • builds/reference_app/adapters/base.py5.4 KB
  • builds/reference_app/adapters/cognee_adapter.py10.0 KB
  • builds/reference_app/adapters/langgraph_store_adapter.py8.6 KB
  • builds/reference_app/adapters/letta_adapter.py9.3 KB
  • builds/reference_app/adapters/mem0_adapter.py8.5 KB
  • builds/reference_app/adapters/migrations/0001_initial.sql5.3 KB
  • builds/reference_app/adapters/migrations/README.md1.4 KB
  • builds/reference_app/adapters/postgres_episodes.py1.5 KB
  • builds/reference_app/adapters/postgres_memory.py7.1 KB
  • builds/reference_app/adapters/postgres_retrieval.py4.2 KB
  • builds/reference_app/adapters/README.md2.8 KB
  • builds/reference_app/adapters/supermemory_adapter.py8.4 KB
  • builds/reference_app/contracts/__init__.py979 B
  • builds/reference_app/contracts/assembly.py3.8 KB
  • builds/reference_app/contracts/entity.py1.3 KB
  • builds/reference_app/contracts/feedback.py1.2 KB
  • builds/reference_app/contracts/knowledge.py1.7 KB
  • builds/reference_app/contracts/memory.py2.8 KB
  • builds/reference_app/contracts/runtime_refs.py1.5 KB
  • builds/reference_app/pyproject.toml468 B
  • builds/reference_app/README.md2.7 KB
  • builds/reference_app/runtime/__init__.py590 B
  • builds/reference_app/runtime/composition.py3.3 KB
  • builds/reference_app/runtime/sqlite_lifecycle.py12.0 KB
  • builds/reference_app/runtime/verbs.py19.9 KB
  • builds/TUTORIAL.md14.7 KB
  • data/sources.json76.1 KB
  • learnings.consolidated.md592 B
  • learnings.md1.0 KB
  • references/agent-memory-benchmarks.md13.6 KB
  • references/anti-patterns-catalog.md45.9 KB
  • references/architecture-and-build.md4.6 KB
  • references/architecture-patterns.md1.8 KB
  • references/architectures-by-organization.md43.0 KB
  • references/cache-augmented-generation.md10.2 KB
  • references/company-brain-assembly.md17.2 KB
  • references/composition-with-related-skills.md13.7 KB
  • references/context-assembly.md7.4 KB
  • references/context-hygiene.md22.0 KB
  • references/context-layer-detail.md11.9 KB
  • references/context-navigation.md9.4 KB
  • references/context-scope.md5.0 KB
  • references/conversational-surfaces-cross-platform.md41.5 KB
  • references/entity-and-memory-models.md5.9 KB
  • references/evals-and-operations.md7.6 KB
  • references/example-assessments.md4.9 KB
  • references/filesystem-as-memory.md6.9 KB
  • references/fine-tune-for-behavior-not-facts.md10.0 KB
  • references/git-anchored-ingestion.md5.6 KB
  • references/graph-and-relationship-layer.md4.3 KB
  • references/information-theory-applied.md6.6 KB
  • references/inspection-and-review-surfaces.md8.0 KB
  • references/just-in-time-context-loading.md1.7 KB
  • references/knowledge-compilation-and-wiki-pattern.md7.9 KB
  • references/long-context-first-architecture.md9.5 KB
  • references/managed-memory-boundaries.md20.4 KB
  • references/markdown-chunking-patterns.md5.5 KB
  • references/mcp-context-delivery.md4.6 KB
  • references/memory-responsibilities-audit.md12.4 KB
  • references/memory-scenario-playbooks.md26.4 KB
  • references/memory-stack-crosswalk.md26.6 KB
  • references/multi-source-wiki-ingestion.md15.9 KB
  • references/multimodal-context-assembly.md1.4 KB
  • references/operational-brain-pattern.md7.3 KB
  • references/patterns-catalog.md53.9 KB
  • references/policy-and-compliance-docs.md14.7 KB
  • references/reference-architectures.md55.4 KB
  • references/retrieval-and-grounding.md5.0 KB
  • references/retrieve-vs-preload-vs-finetune.md7.6 KB
  • references/security-threat-model.md21.0 KB
  • references/semantic-caching.md2.7 KB
  • references/sqlite-memory-lifecycle.md4.9 KB
  • references/stance-and-hygiene.md23.4 KB
  • references/substrate-combinations.md21.9 KB
  • references/tenant-isolation-patterns.md7.5 KB
  • references/vendor-landscape.md22.4 KB
  • scripts/check_sources.py5.7 KB
  • scripts/score_context_layer.py11.0 KB
  • scripts/test_scripts.py6.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

App Context Layer

Design and review the application layer that selects, assembles, grounds, and learns from context for a product surface. Keep operational truth in tools, APIs, SQL, or a system of record; use derived memory only for durable facts or preferences with provenance, retention, and correction paths. This skill covers architecture and runtime contracts, not repo instruction files or prompt wording.

Quick Reference

QuestionDefaultLoad when needed
Where should operational truth live?Tools, APIs, SQL, or system-of-record servicescontext-layer-detail
Is the problem retrieval or context assembly?Use RAG for corpus retrieval; use this skill when personalization, relationships, action context, or surface bundles change the answerai-rag, context assembly
Is graph worth it?Only when relationship traversal changes the answergraph and relationship layer
Which architecture pattern fits?Select the smallest pattern that meets tenancy, freshness, evidence, and budget needspatterns catalog, reference architectures
Relational, graph, or vector storage?Use the owning database design matrix alongside the context decisionstorage paradigm selection
Is the scenario known (personal assistant, support/CRM, coding agent, multi-agent, regulated KB, code hub, incident, procedural, voice, analytics, on-device)?Load its playbook first: R1–R7 defaults, upgrade trigger, acceptance testsmemory-scenario-playbooks
Building or auditing a KB or memory system end to end?Classify the workload first, then audit the seven responsibilities (admission to materialisation) one by one; when precision and coverage both matter, link current state to its evidence (P22)memory-responsibilities-audit
Is a memory/retrieval service safe to adopt?Keep app-owned truth, provenance, isolation, retention, and rebuild paths; compare engines by representation × output and the responsibilities they implement nativelymanaged-memory boundaries, security threat model, vendor landscape

Use This Skill When

  • deciding between tools, SQL, RAG, vector search, graph, or memory for an app surface
  • designing or reviewing user, customer/org, domain, action, or multi-surface context
  • defining context assembly, typed contracts, freshness, ACL scope, provenance, or token budgets
  • designing multimodal context or org-scale context systems, and deciding when to clear or compact context mid-session
  • assessing a managed memory/retrieval product without surrendering app-owned truth

Do Not Use This Skill For

  • repo-local instruction systems such as AGENTS.md, CLAUDE.md, or .claude/rules/
  • pure code graphs, blast-radius analysis, or multi-repo inventory
  • retrieval-only tuning when the broader context architecture is already decided
  • prompt shape, structured output, or few-shot authoring

Route elsewhere: retrieval, grounding, citation corpora, and retrieve-vs-preload choices -> ai-rag; pgvector schemas and index builds -> ai-vector-brain; fine-tuning -> ai-llm. Use ai-agents for agent tools/approvals/rollouts, ai-prompt-engineering for prompt shape, software-ai-integration for shipping a feature, and the dev-context-* skills for repo context and graphs.

Core Workflow

  1. Classify the request. Choose profile/personalization, memory, retrieval/grounding, relationship context, assembly, multimodal, knowledge-base ingestion, or review/build. Route pure retrieval, repo context, and agent-control work to its owner. When the scenario is known, load memory-scenario-playbooks first and take its stage defaults; otherwise classify the workload with memory-responsibilities-audit.
  2. Choose the source of truth. Keep operational facts in authoritative tools or stores. Separate derived memory, raw episodes, retrieved evidence, and user-supplied context; attach provenance, owner scope, freshness, and retention requirements.
  3. Select the smallest pattern. Use the decision matrix in patterns-catalog, then load only the matching reference architecture or layer deep dive. Do not preload the full stance, vendor landscape, or recipe catalog.
  4. Define contracts and lifecycle. Specify typed projections for EntityProfile, LearnedMemory, KnowledgeSource, RetrievalResult, ContextAssemblyRequest, ContextBundle, feedback, and artifact references. Define write, select, compress, isolate, order, and format behavior for the consuming surface.
  5. Apply admission and threat gates. Check authority, tenancy/ACL, freshness, provenance, token budget, contradiction handling, prompt-injection/poisoning risk, and deletion or rebuild paths. Keep tool permissions and human approvals in the consuming runtime; this skill does not grant them.
  6. Validate the proposed boundary. Test retrieval/assembly quality, isolation, freshness, contradiction and erasure paths, context hygiene, and model/provider portability at the relevant evidence level. For staged memory mutations, run the SQLite lifecycle reference on disk; then test the selected engine with its actual role and configuration. Report skipped engine suites as untested. For claims that these skills improve an agent, use the paired skills ablation with an independent holdout.
  7. Report completion. State the architecture decision, contracts, assumptions, evidence, checks, unresolved unknowns, and next bounded step. Continue through implementation, inspection, and fixes until the requested local outcome is complete or a named external/runtime gate remains.

Context Admission Gate

For every candidate item, attach the available envelope metadata: source class (operational, retrieved, derived, or user-supplied), owner scope, observed or effective time, provenance ID, and token cost. For a direct user turn, default provenance to the session and turn ID and time to receipt; do not require the user to supply system metadata. Admit an item only when the requesting surface is authorized, freshness is adequate, and it fits the surface budget after higher-authority items. Exclude it for missing metadata only when that missing field is material to authority, isolation, or freshness. Record the item ID, class, and exclusion reason; do not retain rejected raw content unless retention is explicitly authorized.

Context Mutation

Clearing or compacting context mid-session forces the provider cache to rewrite everything after the edit point. Clear only when cleared_tokens × read_price × remaining_turns > rewritten_suffix_tokens × (write_price − read_price); otherwise keep the tokens and mutate at the next task boundary. Before any compaction, pin a must-survive set and fail the compaction if a recall probe loses any pinned item. Worked example and probe: context-hygiene. Prefix layout itself belongs to ai-prompt-engineering.

Safety and Portability

  • Keep model/provider choices behind vendor-neutral contracts and adapters. Re-verify context limits, cache behavior, managed-memory capabilities, and version-specific claims for the consuming model.
  • Never treat raw chat, tool payloads, embeddings, or retrieved documents as trusted durable memory. Extract typed facts, preserve source episodes, and keep a correction, invalidation, erasure, and rebuild path.
  • Treat tenant isolation, ACL scope, provenance, freshness, and prompt-injection defenses as runtime controls that must be tested at the relevant boundary. A prose review or local fixture does not prove production isolation; apply scope at candidate generation and run the cross-tenant canary test on every assembly, cache-key or filter change.
  • Keep irreversible writes, external actions, and human approvals in the consuming runtime’s explicit policy. Existing authorization for the requested local work remains valid; do not repeat it unnecessarily.

Completion Contract

A design review is complete when the selected pattern, source boundaries, typed contracts, admission rules, validation checks, evidence level, and unresolved assumptions are recorded. A build task is complete only after the changed artifact is inspected, relevant checks pass, failures are fixed, and runtime or external gates are clearly identified. Distinguish static bundle validation, local fixture evidence, runtime loading, observed routing, and production behavior.

Navigation

Learnings Loop

Consult relevant entries in learnings.consolidated.md when prior context-layer decisions or known pitfalls matter; otherwise skip it. Read raw learnings.md history only when a repeated failure, provenance question, or unresolved decision needs it. After applying the skill, record a dated learning only when an observed pattern or mistake is worth preserving, using agents-skills-feedback-loop/scripts/append_learning.py; do not modify this file.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Configures Claude Code hooks and Codex hooks.json/notify. Use when adding PreToolUse guards, Stop hooks, managed hooks, format-on-save, preflight, audits, or worktree/budget hooks.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Configures and hardens Claude Code and Codex MCP servers. Use when connecting databases, APIs, SaaS, building servers, or serving a clearance-filtered knowledge base.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Owns instruction files: AGENTS.md, CLAUDE.md, personal and repo rules. Use when writing, pruning, auditing them, sharing rules across Claude and Codex, or fixing ignored rules.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Creates and audits agent skills: SKILL.md, references, scripts, runtime metadata. Use when writing, validating, or security-reviewing a skill, or fixing truncated skill listings.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Adds per-skill learnings loops for dated patterns, mistakes, and domain facts. Use when wiring skill memory, consolidation, or drift audits.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Chooses subagent, team, workflow, or debate and launches it on Claude Code or Codex. Use when delegating, running agent review boards, or installing shared agents.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

vasilyu1983 のスキルをすべて見る

このスキルの問題を報告する