Summary
This issue proposes evaluating—and, if the proof of concept succeeds, performing—a migration of the repository-memory pipeline from:
deterministically transformed docs and source code
+ Graphify graph/report
→ OpenKB compilation
→ large OKF concept wiki
to:
repository source, existing docs, tests, and Git history
→ OpenWiki code mode
→ compact, incrementally maintained, editable OKF wiki
The motivation is not that OpenKB or Graphify are intrinsically bad tools. They appear to solve different problems from the one this skill ultimately needs to solve.
The intended product is a reusable transformation skill that gives any repository a durable, version-controlled and agent-readable memory. The OKF wiki itself must be the canonical memory, not a disposable documentation export or a build artifact generated from another hidden source of truth.
The current OpenKB-based implementation works mechanically, but experiments on both this project and another large repository have exposed several architectural problems:
- approximately 500 concepts;
- an
index.md exceeding 1,000 lines;
- overlapping or nearly synonymous concept pages;
- weak compression when source files are transformed to Markdown;
- a large catalog that agents must read before they know what is relevant;
- expensive full recompilation;
- generated pages that cannot safely serve as a durable manual editing surface;
- a lossy use of Graphify, where its queryable graph is reduced to a Markdown report and then summarized again by OpenKB.
OpenWiki now appears much closer to the intended model. Its repository mode explicitly aims to produce a small, human-shaped documentation hierarchy, starts from quickstart.md, avoids documenting every file, assigns one canonical home to each concept, and performs surgical updates based on Git changes. OpenWiki issue #84 requests OKF output, and OpenWiki PR #263 implements deterministic OKF v0.1 output for code and personal modes.
This issue asks us to validate that OpenWiki can replace OpenKB and remove Graphify from the mandatory memory-generation pipeline.
Original objective
The transformation skill should make a repository “agent ready” by creating and maintaining a durable repository memory.
That memory should:
- explain the repository’s purpose, architecture, workflows, domain model, constraints, operations, tests and extension points;
- work when a repository has substantial existing documentation;
- also work when the repository has little or no human documentation and the implementation must be inferred from source code, tests, configuration and Git history;
- remain useful to humans as ordinary Markdown;
- remain directly editable by humans and coding agents;
- be versioned and reviewed with normal Git diffs;
- be consumable by Claude Code, Codex, OpenCode, Hermes, OpenClaw and other harnesses without requiring a proprietary runtime;
- be portable as an Open Knowledge Format v0.1 bundle;
- preserve source references and make implementation claims verifiable;
- remain concise enough that agents can discover relevant context progressively instead of loading an exhaustive corpus into every conversation;
- evolve incrementally as code and documentation change;
- avoid repeatedly paying to rediscover or regenerate the entire repository context.
Important non-goal
The skill is not meant to implement a new general-purpose vector store, memory database, RAG engine or coding harness.
The goal is to select and orchestrate a tool that maintains a good repository-memory wiki.
Current implementation
The current design has approximately four levels:
Level 0
AGENTS.md router
|
| instructs the agent to read the OKF index
v
Level 1
OKF index.md
~1,000 lines, ~500 concept descriptions
|
| links to generated knowledge
v
Level 2
OpenKB summaries, concepts, entities and explorations
|
| links to raw evidence
v
Level 3
Deterministically transformed Markdown sources
- original Markdown/docs
- Python source converted to Markdown
- TypeScript source converted to Markdown
- other supported files
- Graphify GRAPH_REPORT.md
The raw-source lifecycle is deterministic:
- new files are added;
- changed files are replaced;
- deleted files are removed;
- filenames and ordering are stable;
- the transformation avoids timestamps and other avoidable nondeterminism.
The wiki is then refreshed with OpenKB recompilation.
Graphify was added to improve code understanding:
- it builds a tree-sitter-derived structural graph;
- produces
graph.json;
- produces a human-readable
GRAPH_REPORT.md;
- can answer scoped graph queries;
- can expose its graph over MCP.
However, the current pipeline primarily submits GRAPH_REPORT.md to OpenKB as one more document.
Problems observed in practice
1. The root index has stopped functioning as a router
The intention was progressive discovery:
AGENTS.md
→ index.md
→ relevant concepts
→ supporting evidence
In practice, requiring the agent to read a 1,000-line catalog containing roughly 500 concepts means the entire concept taxonomy is broadcast before the agent has enough task-specific information to rank it.
This is not strong progressive discovery. It is exhaustive catalog injection followed by selective reading.
The agent must:
- inspect hundreds of short descriptions;
- distinguish overlapping concepts from each other;
- select several potentially relevant pages;
- resolve duplicated explanations;
- often inspect the source code anyway.
Research supports being cautious about this pattern:
- Lost in the Middle found that models do not use all positions in long contexts equally and can perform worse when relevant information is buried in the middle.
- ContextBench evaluated 1,136 repository tasks across 66 repositories and eight programming languages and found that coding agents generally favor recall over precision, retrieve substantial unused context, and still have large gaps between explored and effectively used context.
- Claude Code loads only the first 200 lines or 25 KB of its memory index at startup and leaves detailed topic files for on-demand reads. Claude Code memory documentation
- Codex caps the combined project instruction chain at 32 KiB by default and recommends nested, scope-specific guidance. Codex
AGENTS.md documentation
- OpenClaw keeps detailed memory files behind search rather than injecting them all at bootstrap. OpenClaw memory documentation
- Hermes limits its always-loaded durable memory to approximately 1,300 tokens. Hermes memory documentation
These systems are not directly equivalent to an OKF repository wiki, but they consistently demonstrate the same principle:
Keep the bootstrap context small and route toward detailed material only when it is relevant.
OpenKB also has an open request for integration with a search engine such as QMD, which confirms that selective text retrieval is not currently part of the core wiki-navigation path: OpenKB issue #63.
2. Five hundred concepts are not necessarily bad, but the present topology is
A wiki can legitimately have hundreds or thousands of pages. The problem is not the number alone.
Five hundred concepts can remain useful when they are:
- organized hierarchically;
- searchable;
- assigned to clear domains or modules;
- reached through compact local indexes;
- sufficiently distinct;
- useful enough to compress several source locations.
The current result is problematic because:
- all concepts appear in one large global routing surface;
- several concepts overlap semantically;
- some pages largely restate one source file;
- descriptions are not always discriminative enough to route reliably;
- new source ingestion can create another nearby concept instead of consolidating an existing one.
The useful quality test is:
Does this page connect and compress knowledge that would otherwise require inspecting several files, tests, configurations or documents?
A page explaining an authentication lifecycle across middleware, services, configuration, failure handling and tests is valuable.
A page that paraphrases one small auth_service.py file is usually not valuable enough to justify a persistent wiki page.
3. Converting source code to Markdown makes it ingestible, but not structurally understood
OpenKB is primarily a heterogeneous document compiler. It accepts Markdown, PDF, Word, PowerPoint, HTML, Excel, CSV, text and URLs. It summarizes documents, reads existing concept/entity pages, and creates or updates concepts across sources. OpenKB README
Transforming .py and .ts files to Markdown allows them to enter that pipeline, but it does not give OpenKB native knowledge of:
- symbol identity;
- imports;
- callers and callees;
- inheritance;
- type relationships;
- public versus private APIs;
- test-to-implementation relationships;
- module boundaries;
- change-impact paths.
Fine-grained evidence addressing is also not yet fully built into the format: OpenKB issue #72 requests stable, addressable paragraph identifiers so that concepts and external systems can reference precise passages rather than entire pages.
The code remains text placed inside a document-oriented workflow.
OpenKB also currently sends Markdown through its short-document path without a general heading-aware chunking fallback. OpenKB issue #73 documents that Markdown sources are sent as one complete LLM message regardless of their size, with no heading-aware, token-aware or hierarchical fallback. The reporter reproduced this against a corpus of 475 Markdown documents and several documents that could not fit into a practical model context. Large-document processing with local models has also produced timeout pressure for users, as documented in OpenKB issue #132.
4. OpenKB’s compilation strategy encourages concept accumulation
According to the OpenKB documentation, each ingested document:
- receives a summary;
- is compared with existing concept and entity pages;
- may create or update multiple concepts;
- may touch approximately 10–15 wiki pages;
- updates the global index and log.
This is useful for accumulating knowledge from heterogeneous papers, specifications and business documents.
For a repository containing many implementation files, however, source-by-source compilation can repeatedly ask an LLM to decide whether a code concern:
- belongs in an existing concept;
- deserves a new concept;
- is a subtopic;
- should be merged with an existing page;
- should be renamed;
- should remain merely a source reference.
Those decisions are probabilistic. At larger scales, previous probabilistic taxonomy choices become state that influences later compilation.
OpenKB itself lists the following work on its roadmap:
- scaling to large collections with nested folder support;
- hierarchical concept/topic indexing for massive knowledge bases;
- a database-backed storage engine.
Those roadmap entries align closely with the limitations currently being observed. OpenKB README
5. Full recompilation is not a satisfactory maintenance model
openkb recompile --all reruns compilation for all indexed sources, regenerates summaries and rewrites concept pages. The OpenKB documentation explicitly warns that manual edits to managed concept pages are overwritten. OpenKB README
This has several consequences:
- update cost grows with both corpus size and wiki size;
- unchanged sources are reconsidered;
- large existing concepts are repeatedly rewritten;
- compilation order and model behavior can affect ontology decisions;
- a correction made directly to a concept page may disappear;
- a model or prompt update can cause large unrelated diffs;
- the wiki is difficult to treat as a durable collaborative memory.
OpenKB has also had an issue where length-truncated model responses could be repaired into parseable JSON and written as partial concept pages. OpenKB issue #148 documents concept pages being silently truncated while the command still completed successfully. The specific defect was addressed by OpenKB PR #161, which rejects malformed or truncated model output before committing page mutations, but the incident still illustrates the risk inherent in repeatedly rewriting large generated pages.
6. The wiki is not a sufficiently safe editing surface
The desired contract is:
The committed OKF wiki is the memory.
Humans and agents may improve it.
Future maintenance should preserve valid improvements.
The present OpenKB contract is closer to:
Raw documents are compiler inputs.
Managed wiki pages are compiler outputs.
Manual changes to generated pages may be overwritten.
This makes the wiki more like a compiled artifact than the canonical memory desired by this project.
Customizing OpenKB’s wiki instructions can influence future generations, but it does not turn arbitrary page edits into durable source data.
7. Graphify is currently used through its weakest interface
Graphify provides:
- deterministic tree-sitter extraction for many languages;
- a queryable
graph.json;
- scoped graph queries;
- community detection;
- confidence distinctions such as
EXTRACTED, INFERRED and AMBIGUOUS;
- optional MCP access;
- a broad
GRAPH_REPORT.md. Graphify README
Our pipeline does this:
AST-derived/queryable graph
→ global Markdown report
→ OpenKB summarization
→ concept page
→ agent reads generated prose
This collapses a rich, queryable representation into static prose, then summarizes it again.
If Graphify remains in the project, the more appropriate usage is:
agent needs exact structural information
→ graphify query / MCP
→ relevant graph neighborhood
→ current source verification
It should not be mandatory merely to produce a report that another LLM compiler ingests.
What current repository-documentation research suggests
The strongest recent repository-documentation systems converge on several ideas that differ from the current OpenKB pipeline.
RepoAgent
RepoAgent builds dependency information and generates code documentation in dependency-aware order. It demonstrates the value of repository structure over independent file summarization, but its original implementation is strongly Python-oriented and tends toward fine-grained code documentation.
It is not a direct replacement for a concise, heterogeneous, editable repository-memory wiki.
CodeWiki
CodeWiki uses hierarchical decomposition, recursive processing and architectural synthesis across multiple programming languages. Its reported CodeWikiBench quality score is 68.79% with proprietary models and 64.80% with an open model configuration, compared with 64.06% for DeepWiki.
Its hierarchy-first strategy is more appropriate than a flat file-to-concept process.
However, CodeWiki is primarily a documentation generator. Its generated documentation remains an output derived from its analysis pipeline. That does not align as closely with the requirement that the committed OKF wiki itself remain the primary editable memory.
HCGS / Code-Craft
Hierarchical Code Graph Summarization constructs bottom-up summaries over a code graph. It reports up to an 82% relative improvement in top-1 retrieval precision on its evaluated codebases.
Its important lesson is not necessarily that we should adopt that exact implementation. It is that summaries should be attached to structural scopes and retrieved hierarchically—not generated as hundreds of globally competing concepts.
RepoDoc
RepoDoc is the closest research architecture to the ideal code-documentation lifecycle:
- construct a repository knowledge graph;
- cluster code into cohesive hierarchical modules;
- generate scoped, cross-referenced documentation;
- propagate source changes through the graph;
- regenerate only affected documentation.
Its authors report, across 24 repositories and eight languages:
- 32.5% higher API coverage;
- 10.4% higher completeness;
- three times faster initial generation;
- 85% fewer generation tokens;
- 73% less update time;
- 77% fewer update tokens;
- 10.2% higher update recall.
These are author-reported benchmark results and still need independent replication. The public implementation is also currently young.
RepoDoc nevertheless strongly validates the principle that repository documentation should be organized around cohesive modules and semantic change impact rather than flat source ingestion.
Structural memory remains useful, but it is complementary
Codebase-Memory builds a persistent tree-sitter-based repository graph and exposes it over MCP. Its authors report 83% answer quality versus 92% for file exploration, while using ten times fewer tokens and 2.1 times fewer tool calls across 31 repositories.
This suggests:
- structural indexes can be excellent routing tools;
- they can dramatically reduce exploration cost;
- they do not fully replace source verification;
- structural navigation and semantic wiki memory are complementary.
This supports making Graphify or another code graph optional runtime tooling, rather than feeding its global report into the wiki compiler.
Tool comparison for this project
| Concern |
OpenKB |
Graphify |
OpenWiki |
| Primary abstraction |
Heterogeneous document knowledge base |
Structural/queryable knowledge graph |
Human-shaped repository knowledge wiki |
| Main input |
Documents converted to Markdown/PageIndex |
Source, docs and other artifacts parsed into graph nodes/edges |
Repository source, existing docs, tests, configuration and Git history |
| Native code structure |
No general AST/code graph |
Yes |
No persistent AST graph |
| Output |
Summaries, concepts, entities, explorations and index |
graph.json, report, visualization, queries/MCP |
quickstart.md plus a compact hierarchy of repository pages |
| Initial granularity |
Potentially many concepts per source |
Nodes, edges and communities |
At most eight documentation pages initially |
| Duplication policy |
Prompt asks model to reuse existing concepts |
Graph identity and edge model |
One canonical page per concept; link instead of repeating |
| Update strategy |
Source recompile; --all rewrites managed pages |
Graph rebuild/incremental structural updates |
Git-aware documentation impact plan and surgical page edits |
| No-change behavior |
Recompile still invokes compilation when requested |
Structural rebuild possible |
No-op preflight skips the agent when repository state is unchanged |
| Human editing |
Markdown is editable, but recompilation overwrites managed pages |
Graph/report are primarily generated outputs |
Existing pages are read as update input and accurate wording should be preserved |
| Canonical memory fit |
Weak for fully editable canonical wiki |
Not a semantic wiki |
Strong |
| OKF |
Supported |
No |
Implemented in open PR #263 |
| Best role |
Papers, specifications and heterogeneous document corpora |
Exact structural exploration |
Compact, durable repository memory |
Why OpenWiki appears to fit the requirement better
OpenWiki’s current repository-mode instructions explicitly require the agent to:
- use
quickstart.md as the entry point;
- explain architecture, workflows, domain concepts, data models, integrations, operations, testing and extension points;
- explain why important code exists, not only where it is;
- organize documentation like human documentation rather than a file inventory;
- avoid thin pages;
- avoid repeating concepts;
- give each concept one canonical home;
- use existing README files, docs trees, runbooks and skills as primary material;
- summarize and link to existing documentation rather than duplicating it wholesale;
- inspect representative source files instead of reading every file;
- use at most eight documentation pages on the initial run and track deferred coverage in the
quickstart.md backlog. OpenWiki prompt
For updates, it requires:
- reading the existing wiki before editing;
- constructing a source-change-to-document impact plan;
- modifying only pages directly affected by repository changes;
- preserving useful structure and wording when still accurate;
- replacing one stale sentence instead of adding broad new prose when possible;
- keeping each concept in one canonical page;
- avoiding formatting-only changes;
- avoiding broad refreshes;
- normally touching only one or two pages when fewer than approximately five source files changed;
- permitting a complete no-op when the wiki is already current. OpenWiki prompt
OpenWiki previously performed a complete agent run even when no repository change existed. OpenWiki issue #44 reported a zero-diff update taking 759 seconds, compared with 117 seconds for an update with a real source diff. The behavior was corrected by OpenWiki PR #57, which skips model and agent initialization when Git HEAD is unchanged and there are no meaningful worktree changes.
These rules directly address the pathologies observed in the current wiki.
OpenWiki’s pending OKF support
OpenWiki issue #84 requests Open Knowledge Format support. OpenWiki PR #263 implements OKF v0.1 as the standard output for code and personal modes.
The implementation must comply with the actual OKF v0.1 specification.
For every non-reserved .md concept document:
- a parseable YAML frontmatter block is mandatory;
- the frontmatter must contain a non-empty
type;
title, description, resource, tags and timestamp are optional but recommended where applicable;
- producer-defined additional keys are permitted;
- unknown additional fields should be preserved when round-tripping.
The reserved files have separate rules:
index.md is an optional OKF directory inventory for progressive disclosure and must follow the index structure defined by the specification when present;
log.md is an optional chronological update log and must follow the date-grouped structure defined by the specification when present;
- index files normally contain no frontmatter, except that the bundle-root
index.md may contain okf_version: "0.1" as the specification’s explicit versioning exception.
PR #263 proposes a useful ownership split.
Model/human/agent-owned
- concept page bodies;
- repository explanations;
- architectural rationale;
- workflows;
- source references;
- curated content.
Code-owned
- mandatory, valid YAML frontmatter on every non-reserved Markdown page;
- the required non-empty
type;
- recommended
title, description and timestamp metadata;
- reserved indexes and logs;
- OKF version declaration;
- conformance validation.
The pull request states that:
- the model writes page bodies rather than attempting to generate conformance metadata;
- a deterministic post-run pass adds or normalizes frontmatter;
- the post-run pass owns
type, title, description and timestamp;
- timestamps change only when page bodies change;
log.md changes only when content changes;
- writes are atomic;
- no-op updates leave the bundle byte-identical;
- a conformance fixture is validated in tests. OpenWiki PR #263
This is compatible with treating the OKF wiki as canonical memory.
The semantic content remains directly editable Markdown, but the frontmatter itself is not optional. Every concept page must remain a conformant OKF document. Mechanical normalization should preserve the human-authored body and unknown producer-defined metadata rather than treating the page as disposable output.
Important current limitation
As of July 13, 2026, OpenWiki PR #263 is still open and awaiting an approving review.
A migration should therefore either:
- wait for the pull request to merge and use a released OpenWiki version containing it; or
- temporarily pin the exact reviewed commit SHA rather than a floating pull-request branch.
The branch has already been force-pushed during development, so relying on the branch name alone would not provide a reproducible dependency.
Is the OpenWiki wiki really canonical and editable?
The answer appears to be yes, with one qualification.
OpenWiki updates read the existing wiki and edit it in place. The existing pages are therefore state used by the next update—not merely an export regenerated from a separate database.
Humans and normal coding agents can directly:
- correct a technical explanation;
- add architectural rationale;
- record a non-obvious invariant;
- improve navigation;
- add a missing workflow;
- clarify a source reference;
- consolidate duplicated explanations.
Future update runs are instructed to preserve those changes when they remain accurate.
Current OpenWiki code mode explicitly treats /openwiki/INSTRUCTIONS.md as the shared, user-authored repository brief. It must be read to understand scope and priorities and must not be modified during normal init, update or chat runs unless the user explicitly requests a brief change. OpenWiki prompt
Because openwiki/INSTRUCTIONS.md is a non-reserved Markdown file inside the OKF tree, it must itself remain conformant: it needs parseable YAML frontmatter with a non-empty type. The deterministic OKF post-pass should normalize its required metadata without overwriting its user-authored body or additional producer-defined fields.
The qualification is that edit preservation is partly enforced through agent instructions rather than an immutable merge algorithm.
An OpenWiki update could still accidentally rewrite or omit valuable manual material. For that reason:
- updates should always produce reviewable Git diffs;
- CI should open a PR/MR rather than push directly;
- the memory contract must be explicit in
openwiki/INSTRUCTIONS.md;
- preservation of manual edits must be tested during the proof of concept.
This is still materially closer to the required model than OpenKB recompilation, which explicitly treats managed pages as replaceable compiler output.
Why quickstart.md, not the complete OKF index.md, should be the agent entry point
The router should no longer require agents to read a 1,000-line global catalog.
The target navigation should be:
AGENTS.md
→ openwiki/quickstart.md
→ one or two relevant architecture/domain/workflow pages
→ current source and tests when verification is needed
quickstart.md should be a compact semantic router written for humans and agents.
The OKF index.md can remain a mechanically generated bundle inventory and progressive-disclosure aid, but it should not automatically be injected into every repository task when it enumerates more information than the task requires.
OpenWiki currently maintains bounded blocks in root AGENTS.md and CLAUDE.md files so coding agents are directed toward the repository wiki while non-OpenWiki content remains untouched. OpenWiki README
The desired routing contract is:
## Repository memory
The canonical repository memory is under `openwiki/`.
For questions involving architecture, workflows, domain behavior,
operations, tests or repository conventions:
1. Read `openwiki/quickstart.md`.
2. Open only the linked pages relevant to the current task.
3. Verify implementation details against current source code and tests.
4. Treat the wiki as canonical project context and rationale, while
treating current source and tests as authoritative for implementation.
5. Update the relevant wiki page when a task reveals durable missing or
stale project knowledge.
Why OpenClaw memory-wiki and Hermes are not direct replacements
OpenClaw and Hermes provide useful examples of bounded runtime memory, but neither is primarily a repository-wiki compiler.
OpenClaw’s memory architecture keeps a compact bootstrap memory and places detailed files behind search. Its memory-wiki functionality can consume and manage synthesized knowledge, but it does not replace the need to understand a repository and author the initial architectural wiki. OpenClaw memory documentation
Hermes provides a very small persistent memory plus searchable session history. It is a harness-specific runtime memory mechanism, not a tool for generating and incrementally maintaining repository architecture documentation. Hermes memory documentation
They reinforce OpenWiki’s compact-entry-point model but should not become mandatory dependencies of the transformation skill.
Why CodeWiki and RepoDoc are not the proposed primary migration target
CodeWiki has stronger explicit structural decomposition than OpenWiki and is an important comparison point.
However, this project requires the committed wiki to remain the primary editable source of memory. CodeWiki is more naturally treated as a generator whose documentation is derived from its repository-analysis process.
RepoDoc is the strongest research match for graph-based incremental documentation, but its public implementation is currently too young to become a foundational dependency without additional validation.
OpenWiki provides the better immediate fit because:
- its wiki is maintained in place;
- it explicitly starts updates from the existing pages;
- it prioritizes preservation and surgical edits;
- it uses a compact human documentation hierarchy;
- it supports a user-owned repository brief in
openwiki/INSTRUCTIONS.md;
- it now has an active OKF implementation.
Proposed target architecture
┌─────────────────────────┐
│ Existing repository docs│
│ README, ADRs, runbooks │
└───────────┬─────────────┘
│
Repository source ──────────────────┤
Tests/config/Git history ───────────┤
▼
OpenWiki code mode
│
reads and edits existing wiki in place
│
▼
Canonical repository OKF memory
openwiki/
├── quickstart.md
├── architecture/
├── domain/
├── workflows/
├── operations/
├── testing/
├── INSTRUCTIONS.md
├── index.md
└── log.md
│
┌──────────────┴──────────────┐
▼ ▼
Human/agent editing Agent consumption
via AGENTS.md router
Optional structural tooling may exist beside this:
agent requires exact callers, dependencies or impact analysis
→ Graphify query/MCP or another structural index
→ current source verification
It should not feed a global report into the wiki compiler by default.
Proposed repository-memory contract
openwiki/INSTRUCTIONS.md should be committed as the shared, user-authored OpenWiki brief for the repository. Because it is a non-reserved concept file inside the OKF tree, it must include valid frontmatter with a non-empty type.
---
type: Repository Memory Contract
title: Repository memory contract
description: Editorial and maintenance rules for the canonical repository memory.
---
# Repository memory contract
The `openwiki/` directory is the canonical, editable memory of this
repository. It is not a disposable documentation export.
## Editorial requirements
- Preserve accurate human- and agent-authored content during updates.
- Do not recreate the wiki from scratch after initialization.
- Modify existing wording only when repository evidence makes it stale,
incomplete, misleading or contradictory.
- Give each architectural or domain concept one canonical home.
- Link to canonical explanations instead of repeating them.
- Prefer cohesive architecture, workflow, domain, operations and testing
pages over file-by-file documentation.
- Do not create Markdown mirrors of source files.
- Keep `quickstart.md` compact and use it as the primary semantic router.
- Keep the page set intentionally small and factorized.
- Reference relevant source paths, symbols, tests and existing docs.
- Treat current source and tests as authoritative for implementation
behavior.
- Preserve design rationale, constraints, decisions and maintainer
knowledge that cannot be reconstructed from code alone.
- Flag contradictions instead of silently deleting important curated
knowledge.
- A normal update may make no changes.
Proposed migration plan
Phase 0 — dependency decision
Phase 1 — preserve the current implementation as an evaluation baseline
Before removing anything:
The old bundle should be used for comparison, not automatically migrated concept by concept.
Phase 2 — OpenWiki proof of concept
On this repository and at least one large Python/TypeScript repository:
Phase 3 — agent routing
Phase 4 — lifecycle automation
OpenWiki currently ships example GitHub Actions, GitLab CI and Bitbucket Pipelines update workflows. OpenWiki README
Phase 5 — retire the existing mandatory pipeline
After successful evaluation:
Phase 6 — decide Graphify’s optional status
Run separate tests for questions such as:
- “Who calls this function?”
- “What modules depend on this package?”
- “What is the impact radius of changing this interface?”
- “What path connects these two components?”
- “Which symbols are structurally central?”
If normal harness source tools are sufficient, remove Graphify entirely.
If Graphify materially improves those cases:
Acceptance criteria
The migration should not be accepted only because the OpenWiki output looks cleaner. It should satisfy measurable requirements.
Memory shape
Editability and durability
Incremental maintenance
Agent usefulness
Prepare at least 30 representative questions/tasks covering:
- architecture;
- domain behavior;
- end-to-end workflows;
- configuration;
- error handling;
- testing;
- extension points;
- code-change impact;
- project rationale.
Compare:
- source tools only;
- current OpenKB/Graphify bundle;
- OpenWiki OKF;
- OpenWiki OKF plus optional Graphify queries.
Record:
- correctness;
- files ultimately inspected;
- time to identify the correct subsystem;
- number of tool calls;
- prompt/input tokens;
- wiki pages opened;
- stale or contradicted claims;
- hallucinated symbols;
- whether the agent used the wiki or bypassed it;
- whether the wiki reduced raw-source exploration.
The OpenWiki migration should improve context efficiency without reducing answer or implementation correctness.
Risks and open questions
1. OpenWiki OKF support is not merged yet
Do we wait for OpenWiki issue #84 to be closed by PR #263, or temporarily pin the PR’s current reviewed commit?
2. Manual edit preservation is prompt-enforced
How reliably does OpenWiki preserve manually curated content and conformant producer-defined frontmatter across:
- small updates;
- cross-cutting changes;
- model changes;
- prompt changes;
- page moves and consolidations?
This must be tested explicitly.
3. Initial exploration cost can vary
OpenWiki is an autonomous repository explorer rather than a deterministic AST-first analyzer. OpenWiki issue #51 reports approximately 12× cost variance between repeated initial runs of the same repository. OpenWiki PR #273 proposes a --max-iterations guard that bounds a run by LangGraph graph steps.
We should define:
- a supported model;
- a maximum iteration/work budget;
- a maximum acceptable initial cost;
- failure/retry behavior;
- whether a local repository map should be supplied as optional evidence.
4. Lack of native structural graph
OpenWiki may miss relationships that a deterministic AST/LSP graph exposes directly.
We need to determine whether:
- normal Claude Code/Codex source discovery is sufficient;
- Graphify remains useful as optional runtime tooling;
- another lightweight structural index should replace it;
- none of this is necessary for the semantic-memory objective.
5. Migration of valuable existing knowledge
The existing OpenKB wiki may contain useful synthesis and explorations.
It should not be copied wholesale into the new wiki, because doing so would preserve its duplication and taxonomy problems.
A migration procedure should:
- initialize OpenWiki from current repository evidence;
- compare the new wiki with the old bundle;
- identify valuable rationale, decisions or cross-cutting explanations absent from the new wiki;
- curate those items into the appropriate canonical OpenWiki pages;
- discard redundant concepts and source paraphrases.
6. index.md versus quickstart.md
The OKF PR mechanically owns reserved indexes. The project should explicitly define:
quickstart.md as the semantic entry point;
index.md as the OKF inventory/progressive-disclosure structure;
AGENTS.md and CLAUDE.md as minimal routing and behavior contracts.
7. Generated versus curated content
OpenWiki does not impose a hard generated/curated directory split.
Do we need:
- an explicit frontmatter field indicating provenance;
- a convention for manually curated sections;
- a claim/evidence format;
- or is normal Git ownership plus
INSTRUCTIONS.md sufficient?
The preference should be to avoid adding complexity unless testing demonstrates a real need.
8. OKF frontmatter ownership and preservation
PR #263 makes frontmatter code-owned to guarantee conformance, while the OKF specification permits producer-defined fields and recommends preserving unknown keys during round-tripping.
The proof of concept must verify that deterministic normalization:
- always adds the required non-empty
type;
- keeps concept bodies directly editable;
- does not remove valid custom metadata;
- handles manually added concept pages;
- respects the special rules for
index.md and log.md;
- leaves no-op bundles byte-identical.
Proposed decision
Proceed with an OpenWiki proof of concept and treat it as the preferred migration target.
The expected end state is:
Mandatory:
- OpenWiki code mode
- OKF v0.1 output
- openwiki/ committed as canonical memory
- compact AGENTS.md/CLAUDE.md → quickstart.md routing
- Git-reviewed incremental updates
Removed from mandatory pipeline:
- OpenKB
- full source-to-Markdown conversion
- recompile --all
- global Graphify report ingestion
- 500-concept flat index
Optional:
- Graphify or another structural code index for exact graph-native queries
The migration should be finalized only after the edit-preservation, OKF-conformance, incremental-update, cost and agent-usefulness acceptance criteria have been tested on both this project and at least one large mixed Python/TypeScript repository.
References
Specifications and tools
Harness memory strategies
Research
Summary
This issue proposes evaluating—and, if the proof of concept succeeds, performing—a migration of the repository-memory pipeline from:
to:
The motivation is not that OpenKB or Graphify are intrinsically bad tools. They appear to solve different problems from the one this skill ultimately needs to solve.
The intended product is a reusable transformation skill that gives any repository a durable, version-controlled and agent-readable memory. The OKF wiki itself must be the canonical memory, not a disposable documentation export or a build artifact generated from another hidden source of truth.
The current OpenKB-based implementation works mechanically, but experiments on both this project and another large repository have exposed several architectural problems:
index.mdexceeding 1,000 lines;OpenWiki now appears much closer to the intended model. Its repository mode explicitly aims to produce a small, human-shaped documentation hierarchy, starts from
quickstart.md, avoids documenting every file, assigns one canonical home to each concept, and performs surgical updates based on Git changes. OpenWiki issue #84 requests OKF output, and OpenWiki PR #263 implements deterministic OKF v0.1 output for code and personal modes.This issue asks us to validate that OpenWiki can replace OpenKB and remove Graphify from the mandatory memory-generation pipeline.
Original objective
The transformation skill should make a repository “agent ready” by creating and maintaining a durable repository memory.
That memory should:
Important non-goal
The skill is not meant to implement a new general-purpose vector store, memory database, RAG engine or coding harness.
The goal is to select and orchestrate a tool that maintains a good repository-memory wiki.
Current implementation
The current design has approximately four levels:
The raw-source lifecycle is deterministic:
The wiki is then refreshed with OpenKB recompilation.
Graphify was added to improve code understanding:
graph.json;GRAPH_REPORT.md;However, the current pipeline primarily submits
GRAPH_REPORT.mdto OpenKB as one more document.Problems observed in practice
1. The root index has stopped functioning as a router
The intention was progressive discovery:
In practice, requiring the agent to read a 1,000-line catalog containing roughly 500 concepts means the entire concept taxonomy is broadcast before the agent has enough task-specific information to rank it.
This is not strong progressive discovery. It is exhaustive catalog injection followed by selective reading.
The agent must:
Research supports being cautious about this pattern:
AGENTS.mddocumentationThese systems are not directly equivalent to an OKF repository wiki, but they consistently demonstrate the same principle:
OpenKB also has an open request for integration with a search engine such as QMD, which confirms that selective text retrieval is not currently part of the core wiki-navigation path: OpenKB issue #63.
2. Five hundred concepts are not necessarily bad, but the present topology is
A wiki can legitimately have hundreds or thousands of pages. The problem is not the number alone.
Five hundred concepts can remain useful when they are:
The current result is problematic because:
The useful quality test is:
A page explaining an authentication lifecycle across middleware, services, configuration, failure handling and tests is valuable.
A page that paraphrases one small
auth_service.pyfile is usually not valuable enough to justify a persistent wiki page.3. Converting source code to Markdown makes it ingestible, but not structurally understood
OpenKB is primarily a heterogeneous document compiler. It accepts Markdown, PDF, Word, PowerPoint, HTML, Excel, CSV, text and URLs. It summarizes documents, reads existing concept/entity pages, and creates or updates concepts across sources. OpenKB README
Transforming
.pyand.tsfiles to Markdown allows them to enter that pipeline, but it does not give OpenKB native knowledge of:Fine-grained evidence addressing is also not yet fully built into the format: OpenKB issue #72 requests stable, addressable paragraph identifiers so that concepts and external systems can reference precise passages rather than entire pages.
The code remains text placed inside a document-oriented workflow.
OpenKB also currently sends Markdown through its short-document path without a general heading-aware chunking fallback. OpenKB issue #73 documents that Markdown sources are sent as one complete LLM message regardless of their size, with no heading-aware, token-aware or hierarchical fallback. The reporter reproduced this against a corpus of 475 Markdown documents and several documents that could not fit into a practical model context. Large-document processing with local models has also produced timeout pressure for users, as documented in OpenKB issue #132.
4. OpenKB’s compilation strategy encourages concept accumulation
According to the OpenKB documentation, each ingested document:
This is useful for accumulating knowledge from heterogeneous papers, specifications and business documents.
For a repository containing many implementation files, however, source-by-source compilation can repeatedly ask an LLM to decide whether a code concern:
Those decisions are probabilistic. At larger scales, previous probabilistic taxonomy choices become state that influences later compilation.
OpenKB itself lists the following work on its roadmap:
Those roadmap entries align closely with the limitations currently being observed. OpenKB README
5. Full recompilation is not a satisfactory maintenance model
openkb recompile --allreruns compilation for all indexed sources, regenerates summaries and rewrites concept pages. The OpenKB documentation explicitly warns that manual edits to managed concept pages are overwritten. OpenKB READMEThis has several consequences:
OpenKB has also had an issue where length-truncated model responses could be repaired into parseable JSON and written as partial concept pages. OpenKB issue #148 documents concept pages being silently truncated while the command still completed successfully. The specific defect was addressed by OpenKB PR #161, which rejects malformed or truncated model output before committing page mutations, but the incident still illustrates the risk inherent in repeatedly rewriting large generated pages.
6. The wiki is not a sufficiently safe editing surface
The desired contract is:
The present OpenKB contract is closer to:
This makes the wiki more like a compiled artifact than the canonical memory desired by this project.
Customizing OpenKB’s wiki instructions can influence future generations, but it does not turn arbitrary page edits into durable source data.
7. Graphify is currently used through its weakest interface
Graphify provides:
graph.json;EXTRACTED,INFERREDandAMBIGUOUS;GRAPH_REPORT.md. Graphify READMEOur pipeline does this:
This collapses a rich, queryable representation into static prose, then summarizes it again.
If Graphify remains in the project, the more appropriate usage is:
It should not be mandatory merely to produce a report that another LLM compiler ingests.
What current repository-documentation research suggests
The strongest recent repository-documentation systems converge on several ideas that differ from the current OpenKB pipeline.
RepoAgent
RepoAgent builds dependency information and generates code documentation in dependency-aware order. It demonstrates the value of repository structure over independent file summarization, but its original implementation is strongly Python-oriented and tends toward fine-grained code documentation.
It is not a direct replacement for a concise, heterogeneous, editable repository-memory wiki.
CodeWiki
CodeWiki uses hierarchical decomposition, recursive processing and architectural synthesis across multiple programming languages. Its reported CodeWikiBench quality score is 68.79% with proprietary models and 64.80% with an open model configuration, compared with 64.06% for DeepWiki.
Its hierarchy-first strategy is more appropriate than a flat file-to-concept process.
However, CodeWiki is primarily a documentation generator. Its generated documentation remains an output derived from its analysis pipeline. That does not align as closely with the requirement that the committed OKF wiki itself remain the primary editable memory.
HCGS / Code-Craft
Hierarchical Code Graph Summarization constructs bottom-up summaries over a code graph. It reports up to an 82% relative improvement in top-1 retrieval precision on its evaluated codebases.
Its important lesson is not necessarily that we should adopt that exact implementation. It is that summaries should be attached to structural scopes and retrieved hierarchically—not generated as hundreds of globally competing concepts.
RepoDoc
RepoDoc is the closest research architecture to the ideal code-documentation lifecycle:
Its authors report, across 24 repositories and eight languages:
These are author-reported benchmark results and still need independent replication. The public implementation is also currently young.
RepoDoc nevertheless strongly validates the principle that repository documentation should be organized around cohesive modules and semantic change impact rather than flat source ingestion.
Structural memory remains useful, but it is complementary
Codebase-Memory builds a persistent tree-sitter-based repository graph and exposes it over MCP. Its authors report 83% answer quality versus 92% for file exploration, while using ten times fewer tokens and 2.1 times fewer tool calls across 31 repositories.
This suggests:
This supports making Graphify or another code graph optional runtime tooling, rather than feeding its global report into the wiki compiler.
Tool comparison for this project
graph.json, report, visualization, queries/MCPquickstart.mdplus a compact hierarchy of repository pages--allrewrites managed pagesWhy OpenWiki appears to fit the requirement better
OpenWiki’s current repository-mode instructions explicitly require the agent to:
quickstart.mdas the entry point;quickstart.mdbacklog. OpenWiki promptFor updates, it requires:
OpenWiki previously performed a complete agent run even when no repository change existed. OpenWiki issue #44 reported a zero-diff update taking 759 seconds, compared with 117 seconds for an update with a real source diff. The behavior was corrected by OpenWiki PR #57, which skips model and agent initialization when Git HEAD is unchanged and there are no meaningful worktree changes.
These rules directly address the pathologies observed in the current wiki.
OpenWiki’s pending OKF support
OpenWiki issue #84 requests Open Knowledge Format support. OpenWiki PR #263 implements OKF v0.1 as the standard output for code and personal modes.
The implementation must comply with the actual OKF v0.1 specification.
For every non-reserved
.mdconcept document:type;title,description,resource,tagsandtimestampare optional but recommended where applicable;The reserved files have separate rules:
index.mdis an optional OKF directory inventory for progressive disclosure and must follow the index structure defined by the specification when present;log.mdis an optional chronological update log and must follow the date-grouped structure defined by the specification when present;index.mdmay containokf_version: "0.1"as the specification’s explicit versioning exception.PR #263 proposes a useful ownership split.
Model/human/agent-owned
Code-owned
type;title,descriptionandtimestampmetadata;The pull request states that:
type,title,descriptionandtimestamp;log.mdchanges only when content changes;This is compatible with treating the OKF wiki as canonical memory.
The semantic content remains directly editable Markdown, but the frontmatter itself is not optional. Every concept page must remain a conformant OKF document. Mechanical normalization should preserve the human-authored body and unknown producer-defined metadata rather than treating the page as disposable output.
Important current limitation
As of July 13, 2026, OpenWiki PR #263 is still open and awaiting an approving review.
A migration should therefore either:
The branch has already been force-pushed during development, so relying on the branch name alone would not provide a reproducible dependency.
Is the OpenWiki wiki really canonical and editable?
The answer appears to be yes, with one qualification.
OpenWiki updates read the existing wiki and edit it in place. The existing pages are therefore state used by the next update—not merely an export regenerated from a separate database.
Humans and normal coding agents can directly:
Future update runs are instructed to preserve those changes when they remain accurate.
Current OpenWiki code mode explicitly treats
/openwiki/INSTRUCTIONS.mdas the shared, user-authored repository brief. It must be read to understand scope and priorities and must not be modified during normal init, update or chat runs unless the user explicitly requests a brief change. OpenWiki promptBecause
openwiki/INSTRUCTIONS.mdis a non-reserved Markdown file inside the OKF tree, it must itself remain conformant: it needs parseable YAML frontmatter with a non-emptytype. The deterministic OKF post-pass should normalize its required metadata without overwriting its user-authored body or additional producer-defined fields.The qualification is that edit preservation is partly enforced through agent instructions rather than an immutable merge algorithm.
An OpenWiki update could still accidentally rewrite or omit valuable manual material. For that reason:
openwiki/INSTRUCTIONS.md;This is still materially closer to the required model than OpenKB recompilation, which explicitly treats managed pages as replaceable compiler output.
Why
quickstart.md, not the complete OKFindex.md, should be the agent entry pointThe router should no longer require agents to read a 1,000-line global catalog.
The target navigation should be:
quickstart.mdshould be a compact semantic router written for humans and agents.The OKF
index.mdcan remain a mechanically generated bundle inventory and progressive-disclosure aid, but it should not automatically be injected into every repository task when it enumerates more information than the task requires.OpenWiki currently maintains bounded blocks in root
AGENTS.mdandCLAUDE.mdfiles so coding agents are directed toward the repository wiki while non-OpenWiki content remains untouched. OpenWiki READMEThe desired routing contract is:
Why OpenClaw memory-wiki and Hermes are not direct replacements
OpenClaw and Hermes provide useful examples of bounded runtime memory, but neither is primarily a repository-wiki compiler.
OpenClaw’s memory architecture keeps a compact bootstrap memory and places detailed files behind search. Its memory-wiki functionality can consume and manage synthesized knowledge, but it does not replace the need to understand a repository and author the initial architectural wiki. OpenClaw memory documentation
Hermes provides a very small persistent memory plus searchable session history. It is a harness-specific runtime memory mechanism, not a tool for generating and incrementally maintaining repository architecture documentation. Hermes memory documentation
They reinforce OpenWiki’s compact-entry-point model but should not become mandatory dependencies of the transformation skill.
Why CodeWiki and RepoDoc are not the proposed primary migration target
CodeWiki has stronger explicit structural decomposition than OpenWiki and is an important comparison point.
However, this project requires the committed wiki to remain the primary editable source of memory. CodeWiki is more naturally treated as a generator whose documentation is derived from its repository-analysis process.
RepoDoc is the strongest research match for graph-based incremental documentation, but its public implementation is currently too young to become a foundational dependency without additional validation.
OpenWiki provides the better immediate fit because:
openwiki/INSTRUCTIONS.md;Proposed target architecture
Optional structural tooling may exist beside this:
It should not feed a global report into the wiki compiler by default.
Proposed repository-memory contract
openwiki/INSTRUCTIONS.mdshould be committed as the shared, user-authored OpenWiki brief for the repository. Because it is a non-reserved concept file inside the OKF tree, it must include valid frontmatter with a non-emptytype.Proposed migration plan
Phase 0 — dependency decision
type.index.mdandlog.mdfiles follow the OKF specification.openwiki/INSTRUCTIONS.mdin local and CI runs.Phase 1 — preserve the current implementation as an evaluation baseline
Before removing anything:
index.mdsize and approximate token count;The old bundle should be used for comparison, not automatically migrated concept by concept.
Phase 2 — OpenWiki proof of concept
On this repository and at least one large Python/TypeScript repository:
openwiki/INSTRUCTIONS.md;openwiki code --init --printexactly once;quickstart.md;Phase 3 — agent routing
AGENTS.mdandCLAUDE.mdblocks toopenwiki/quickstart.md;Phase 4 — lifecycle automation
openwiki code --update --printcommand;OpenWiki currently ships example GitHub Actions, GitLab CI and Bitbucket Pipelines update workflows. OpenWiki README
Phase 5 — retire the existing mandatory pipeline
After successful evaluation:
.openkb-project/raw/source-mirroring lifecycle;.py/.ts-to-Markdown duplication;openkb recompile --all;Phase 6 — decide Graphify’s optional status
Run separate tests for questions such as:
If normal harness source tools are sufficient, remove Graphify entirely.
If Graphify materially improves those cases:
graphify queryor MCP usage;GRAPH_REPORT.mdon every task;Acceptance criteria
The migration should not be accepted only because the OpenWiki output looks cleaner. It should satisfy measurable requirements.
Memory shape
quickstart.mdis a compact router, not an exhaustive content dump..mdfile has parseable YAML frontmatter.type.index.mdandlog.mdfiles conform to their OKF-defined structures.Editability and durability
openwiki/directory is the canonical memory.openwiki/INSTRUCTIONS.mdremains user-owned and is consumed by code mode.Incremental maintenance
Agent usefulness
Prepare at least 30 representative questions/tasks covering:
Compare:
Record:
The OpenWiki migration should improve context efficiency without reducing answer or implementation correctness.
Risks and open questions
1. OpenWiki OKF support is not merged yet
Do we wait for OpenWiki issue #84 to be closed by PR #263, or temporarily pin the PR’s current reviewed commit?
2. Manual edit preservation is prompt-enforced
How reliably does OpenWiki preserve manually curated content and conformant producer-defined frontmatter across:
This must be tested explicitly.
3. Initial exploration cost can vary
OpenWiki is an autonomous repository explorer rather than a deterministic AST-first analyzer. OpenWiki issue #51 reports approximately 12× cost variance between repeated initial runs of the same repository. OpenWiki PR #273 proposes a
--max-iterationsguard that bounds a run by LangGraph graph steps.We should define:
4. Lack of native structural graph
OpenWiki may miss relationships that a deterministic AST/LSP graph exposes directly.
We need to determine whether:
5. Migration of valuable existing knowledge
The existing OpenKB wiki may contain useful synthesis and explorations.
It should not be copied wholesale into the new wiki, because doing so would preserve its duplication and taxonomy problems.
A migration procedure should:
6.
index.mdversusquickstart.mdThe OKF PR mechanically owns reserved indexes. The project should explicitly define:
quickstart.mdas the semantic entry point;index.mdas the OKF inventory/progressive-disclosure structure;AGENTS.mdandCLAUDE.mdas minimal routing and behavior contracts.7. Generated versus curated content
OpenWiki does not impose a hard generated/curated directory split.
Do we need:
INSTRUCTIONS.mdsufficient?The preference should be to avoid adding complexity unless testing demonstrates a real need.
8. OKF frontmatter ownership and preservation
PR #263 makes frontmatter code-owned to guarantee conformance, while the OKF specification permits producer-defined fields and recommends preserving unknown keys during round-tripping.
The proof of concept must verify that deterministic normalization:
type;index.mdandlog.md;Proposed decision
Proceed with an OpenWiki proof of concept and treat it as the preferred migration target.
The expected end state is:
The migration should be finalized only after the edit-preservation, OKF-conformance, incremental-update, cost and agent-usefulness acceptance criteria have been tested on both this project and at least one large mixed Python/TypeScript repository.
References
Specifications and tools
Harness memory strategies
AGENTS.mddiscovery and size limitsResearch