feat(monorepo): import repo-memory runtime

This commit is contained in:
2026-03-20 13:20:28 +08:00
parent b6e524de41
commit 388c25b1b0
20 changed files with 2461 additions and 10 deletions
+54
View File
@@ -0,0 +1,54 @@
---
name: repo-memory
description: Durable repository memory through a bundled briefdb CLI. Use when an agent needs to search prior project knowledge, ingest curated docs, record confirmed repository facts, inspect knowledge history, or verify whether stored knowledge may have gone stale in a local SQLite memory database instead of rediscovering the same repository context from scratch.
---
# Repo Memory
Use the bundled `./assets/briefdb` CLI to maintain and query durable repository memory.
## Quick Start
- Invoke `./assets/briefdb` relative to this skill directory.
- Default database path: `~/.codex/data/repo-memory.db`.
- Prefer searching before a deep repo dive so repeated work starts from existing knowledge.
- Run `init` before first use on a new database path.
## Rules
- Write only durable repository knowledge, not short-lived chat conclusions.
- Use `draft` for partial or single-evidence findings; use `confirmed` only when the fact is well-supported and traceable.
- Include concrete evidence whenever possible: `source_path`, `source_line`, `verified_on_commit`, aliases, and dependencies.
- Search and inspect before adding a near-duplicate entry.
- Use `verify` when code has moved enough that stored knowledge may need review.
## Typical Commands
```bash
./assets/briefdb init --db ~/.codex/data/repo-memory.db
./assets/briefdb search --db ~/.codex/data/repo-memory.db --repo zeus --query "ai insight fill"
./assets/briefdb ingest --db ~/.codex/data/repo-memory.db --repo /Users/xd/java/zeus
./assets/briefdb add --db ~/.codex/data/repo-memory.db --repo /Users/xd/java/zeus --kind term --key AITask --summary "Plan 内嵌任务结构,不是独立表" --source-path /Users/xd/java/zeus/app/app/src/main/java/foo/AITask.java --source-line 42 --status confirmed --alias "AI Task" --dep file:/Users/xd/java/zeus/app/app/src/main/java/foo/AITask.java:hard
./assets/briefdb list --db ~/.codex/data/repo-memory.db --repo zeus --kind term
./assets/briefdb events --db ~/.codex/data/repo-memory.db --id 1
./assets/briefdb verify --db ~/.codex/data/repo-memory.db --repo /Users/xd/java/zeus
./assets/briefdb repos --db ~/.codex/data/repo-memory.db
```
## Command Map
- `init`: initialize the repository-memory SQLite schema
- `search`: query stored repository knowledge before diving into code
- `ingest`: import structured knowledge from `docs/ai` markdown
- `add`: insert or update one durable knowledge entry
- `list`: inspect entries by repo or kind
- `events`: inspect history for one knowledge entry
- `link`: create a relationship between two entries
- `verify`: downgrade entries that may be stale after repo changes
- `repos`: list tracked repositories in the memory database
## Notes
- The CLI is intentionally lightweight; use it to anchor stable facts, not to replace real repo inspection.
- Start with API paths, routes, table names, log phrases, or concrete file paths when searching.
- If the bundled binary cannot execute on the current host, stop and report the compatibility issue instead of guessing a replacement workflow.