forgetful-encode-repo
Skill301 starsChanged 2 months agoMITView on GitHub
Encode a repository into the Forgetful knowledge base — bootstrap the project, its entities, memories, and documents from the codebase itself. Use when bringing a new repo under Forgetful or refreshing a stale encoding. Re-encoding is an update pass: query-before-create makes it supersession, not duplication.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- forgetful-cli-setupSkill
- forgetful-context-gatherSkill
- forgetful-entitiesSkill
- forgetful-exploreSkill
- forgetful-filesSkill
- forgetful-mcp-setupSkill
- forgetful-proceduresSkill
- forgetful-recallSkill
- forgetful-rememberSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Read what the repo says about itself before reading code: README, docs/, contributor and agent guides, manifests (dependencies, entry …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Encoding a repository
The goal is a knowledge base a future session can lean on: the system modelled as entities, the decisions and conventions as atomic memories, the long-form understanding as documents, everything provenance-stamped back to the source. Encode twice and the second pass updates — never duplicates.
Invoking operations
Operations are named by registry name (create_project, create_entity, ...). Invoke via
whichever surface this agent has:
- MCP:
execute_forgetful_tool(tool_name="create_project", arguments={...}) - CLI:
forgetful call create_project --args '{"name": "..."}' --json
Get any operation's schema at runtime: how_to_use_forgetful_tool (MCP) or
forgetful tools info <operation> (CLI) — schemas are deliberately not repeated here.
Step 1 — Resolve the project
git remote get-url origin → owner/repo → list_projects with repo_name. Existing
project means this run is a refresh; otherwise create_project with the repo name and a
description of what the codebase is for.
Done when: a project_id exists and the run knows whether it is a first encode or a refresh.
Step 2 — Survey the sources
Read what the repo says about itself before reading code: README, docs/, contributor and agent guides, manifests (dependencies, entry points, scripts), CI and deploy configuration. Note the current commit — every write in this run cites it via provenance.
Done when: there is a source list of what will be encoded, ordered by signal.
Step 3 — Model the system as entities
Skills referenced by name below resolve via search_skills → export_skill when not
already available. Per forgetful-entities: the system itself and its key components
(services, packages, databases, external dependencies that matter) as entity_type:
"System", and their structure as relationships — part_of for composition, depends_on
for coupling. Dedupe against existing entities on a refresh.
Done when: the architecture is walkable as a graph, components to system, dependencies out.
Step 4 — Store the knowledge
Two layers, per forgetful-remember (its routing, atomicity test, and importance rubric
govern every write here):
- Documents for long-form understanding: architecture overviews, subsystem guides, design analyses.
- Atomic memories as the entry points: decisions, conventions, patterns, constraints —
each linked to its document via
document_ids, stamped withsource_repoandsource_files, and linked to the entities it concerns via a separatelink_entity_to_memorycall (not somethingcreate_memorydoes for you).
On a refresh, query first per source area: update what drifted, mark obsolete what the code contradicts, create only what is new.
Done when: each surveyed source area has produced its documents and entry-point memories, or explicitly had nothing worth encoding.
Step 5 — Report coverage
Close with a coverage report, in place of "done": project ID, entities created/updated, memories created/updated/obsoleted, documents written, source areas skipped and why, and the areas where knowledge is thin. Note repo-level gaps the survey turned up too — missing docs, absent CI, and the like — not only gaps in the encoding itself. Deliver the report in the final response to the user; it is not written anywhere in Forgetful. The report is the encode's acceptance surface — a reader should be able to spot a gap from it alone.
Done when: the report is delivered and honest about gaps.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

