AGENT SKILL

tree-ring-memory

Use Tree Ring Memory for local-first AI-agent memory lifecycle work: recall, evidence, audit, forgetting, and consolidation without transcript dumping.

License 许可
Apache-2.0
最近更新
2026-10-22
Stars
★ 1
Forks
0

01 前言 Front Matter

name
tree-ring-memory
risk
safe
tags
[ "agent-memory", "local-first", "recall", "privacy", "codex", "sqlite", "cli" ]
tools
[ "claude", "codex", "cursor", "gemini", "antigravity", "opencode" ]
author
TerminallyLazy
source
community
license
Apache-2.0
category
development
date_added
2026-07-08
description
Use Tree Ring Memory for local-first AI-agent memory lifecycle work: recall, evidence, audit, forgetting, and consolidation without transcript dumping.
source_repo
TerminallyLazy/Tree-Ring-Memory
source_type
community
license_source
https://github.com/TerminallyLazy/Tree-Ring-Memory/blob/main/LICENSE

03 SKILL.md 正文

Tree Ring Memory

Overview

Tree Ring Memory is a framework-agnostic, local-first memory lifecycle layer for AI agents. Use this skill when an agent should recall, preserve, audit, or forget durable project memory without treating raw conversation transcripts as memory.

The public runtime is a Rust CLI/TUI with local SQLite/FTS storage, scoped recall, evidence records, audit, deterministic consolidation, maintenance, DOX/Revolve source adapters, framework discovery, redaction, and explicit forgetting.

When to Use This Skill

  • Use before resuming a project where prior decisions, warnings, preferences, or failed approaches may matter.
  • Use before changing architecture, storage, security, privacy, release, or agent-memory behavior.
  • Use when the user asks to remember, recall, audit, redact, forget, or consolidate agent memory.
  • Use after tests, reviews, incidents, or production behavior validate a lesson future agents should preserve.
  • Use when a project contains .tree-ring/SKILL.md, .tree-ring/CLI.md, or other Tree Ring bridge files.

How It Works

Step 1: Discover Local Guidance

Check whether the current project already has Tree Ring guidance:

test -f .tree-ring/SKILL.md && sed -n '1,220p' .tree-ring/SKILL.md
test -f .tree-ring/CLI.md && sed -n '1,220p' .tree-ring/CLI.md

Treat project-local .tree-ring files as more authoritative than generic examples in this skill. If the CLI is installed, inspect the current command surface before assuming flags:

tree-ring --help
tree-ring recall --help
tree-ring remember --help
tree-ring evidence --help
tree-ring audit --help
tree-ring forget --help

If Tree Ring is not installed, do not run remote installer commands automatically. Point the user to the project repository or install docs and ask whether they want installation help.

Step 2: Recall Before Risky Work

Use narrow, project-scoped recall first:

tree-ring recall "release behavior" --scope project
tree-ring recall "sqlite migration" --scope project
tree-ring recall "user preference" --scope global

Use recalled memory as context, not authority. Verify it against current source files, tests, docs, issues, pull requests, logs, and runtime state before making changes.

Step 3: Write Only Durable Memory

Write concise memory only when it is likely to help future agents:

tree-ring remember "Run project-scoped recall before release changes." --event-type lesson --scope project

Prefer specific event types when supported locally:

  • decision
  • lesson
  • warning
  • correction
  • user_preference
  • tool_result
  • summary
  • hypothesis

Store the durable lesson, decision, warning, or follow-up. Do not store the full conversation.

Step 4: Record Evidence for Evaluated Outcomes

Use evidence records for test runs, incidents, reviewed changes, or other evaluated outcomes:

tree-ring evidence \
  --outcome observed \
  --summary "Installer smoke test passed in an isolated HOME." \
  --evidence-ref "ci/install-smoke/2026-07-08"

Outcome guidance:

  • promoted: durable truth backed by strong evidence
  • rejected: failed or rolled-back approach worth keeping visible
  • deferred: unresolved idea or future option
  • observed: normal evaluated result

Do not promote weak, stale, or unreviewed claims to durable truth.

Step 5: Use Source Adapters Carefully

When a repo has structured source records, run dry runs first:

tree-ring dox sync --source-root . --dry-run
tree-ring revolve sync --source-root revolve --dry-run
tree-ring integrations scan --source-root .

Only write adapter summaries when they are concise, source-linked, useful, and privacy-safe. Imported memory does not replace the underlying AGENTS.md, Revolve record, test, pull request, issue, or documentation.

Ring Selection

Use the smallest durable ring that fits:

  • cambium: active or recent task context
  • outer: recent decisions and task lessons
  • inner: older compressed project knowledge
  • heartwood: durable high-confidence truths
  • scar: failures, regressions, rejected approaches, warnings
  • seed: unresolved ideas, hypotheses, follow-ups

Prefer outer or seed unless the user confirms durability or the evidence is strong.

Best Practices

  • Recall before risky or repeat work.
  • Keep project memory project-scoped unless it is a durable cross-project user preference.
  • Attach source references such as file paths, issue ids, PR ids, evaluation runs, or docs paths.
  • Re-check current source files and runtime state before acting on recalled memory.
  • Ask at closeout what future agents should remember, avoid, or revisit.
  • Use redaction, deletion, or supersession when memory is wrong, stale, sensitive, or replaced by a newer decision.

Security & Safety Notes

  • Never use Tree Ring Memory as a hidden recorder.
  • Do not store secrets, credentials, tokens, private keys, recovery codes, raw chain-of-thought, or temporary scratchpad content.
  • Do not store sensitive personal data unless the user explicitly asks and the retention boundary is safe.
  • Do not store copyrighted source text beyond short allowed excerpts.
  • Do not run installer, network, destructive, or mutation commands without explicit user approval and a clear target environment.
  • Treat all examples as commands to adapt after checking local --help, not as guaranteed command surfaces.

Limitations

  • Tree Ring Memory is not a replacement for source control, issue trackers, documentation, tests, logs, or live runtime verification.
  • Recalled memory can be stale or wrong. Always verify important claims against the current project before using them to make changes.
  • The CLI surface can change across releases. Prefer local .tree-ring guidance and tree-ring --help over copied command examples.
  • It should not be used for secret storage, comprehensive transcript archives, compliance retention, or unreviewed collection of sensitive personal data.
  • Cross-agent interoperability depends on each tool's ability to call the local CLI or read project-local guidance files.

Common Pitfalls

  • Problem: Recalled memory conflicts with current source. Solution: Treat source files, tests, docs, and runtime evidence as authoritative; supersede or forget stale memory.

  • Problem: Memory starts becoming transcript storage. Solution: Store only durable decisions, warnings, preferences, outcomes, and follow-ups.

  • Problem: A lesson is useful but contains sensitive detail. Solution: Store a redacted summary or do not store it.

Related Skills

  • @agent-memory-systems - Use for broad agent-memory architecture choices.
  • @agent-memory - Use for the listed hybrid memory MCP system.
  • @planning-with-files - Use when simple persistent files are enough.

Additional Resources

04 同仓库更多 Skills

Hazek-dc
Hazek-dc/PresensiGuru_FaceNet_EMAR

testing-best-practices

Laravel test design and review. Use when selecting coverage, naming or structuring tests, choosing assertions or test data, isolating dependencies, testing HTTP or security boundaries, improving suite performance, or reviewing test value. Use framework guidance or search-docs for Pest and PHPUnit syntax.

★ 1
Hazek-dc
Hazek-dc/PresensiGuru_FaceNet_EMAR

tailwindcss-development

Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex/grid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3/v4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML/CSS component, CSS file audits, build tool configuration, and vanilla CSS.

★ 1
Hazek-dc
Hazek-dc/PresensiGuru_FaceNet_EMAR

laravel-best-practices

Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.

★ 1
Hazek-dc
Hazek-dc/PresensiGuru_FaceNet_EMAR

infer-conventions

Use this skill to analyze how a Laravel application is actually written and record its conventions as shared rules. Trigger when the user wants to detect, infer, document, or standardize project conventions or coding style, set up or grow `.ai/rules`, resolve mixed or conflicting patterns (e.g. "are we using Form Requests or inline validation?"), or onboard agents and teammates to "how we do things here". Covers: a systematic sweep of ~49 Laravel convention dimensions (validation, models, architecture, testing, frontend, database, console), open-ended house-pattern discovery, conflict reporting, and recording rules scoped to the right paths via the Boost `record-rule` MCP tool. Only run this skill when the user explicitly asks for it; never start a sweep as part of another task. Do not use for one-off code review, enforcing formatting a linter already handles, or editing `.ai/rules` files by hand.

★ 1
Hazek-dc
Hazek-dc/PresensiGuru_FaceNet_EMAR

inertia-react-development

Develops Inertia.js v2 React client-side applications. Activates when creating React pages, forms, or navigation; using <Link>, <Form>, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions React with Inertia, React pages, React forms, or React navigation.

★ 1
Hazek-dc
Hazek-dc/PresensiGuru_FaceNet_EMAR

deploying-to-cloud

Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.

★ 1