agentleFS
wandercomwandercom/kindex/AGENTS.md

kindex

AGENTS.md33 starsChanged 57 days agoMITView on GitHub

Kindex is a persistent knowledge graph that indexes conversations, projects, and intellectual work so that Codex never starts a session blind. The CLI is kin. Install Python test dependencies (pip install -e ".[dev,mcp]") and Node.js 24 or newer. Node executes the modern Claude adapter contract tests; it is not a Kindex package dependency. The CI workflow runs full pytest with Python 3.12, Node.js 24, and .[dev,mcp] on pull requests and pushes to main. It also supports manual dispatch and reusable…

  • Installs packages
  • Commits and pushes
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

20 rules. About 0 are common, 4 are distinctive, and 16 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When working in this codebase, follow these practices:

    line 67
  2. Very specific:

    Capture new knowledge: When you learn something significant, use kin add "<insight>" --tags <domain1>,<domain2> to persist it with tags.

    line 69
  3. Very specific:

    Create links: When you discover a relationship between concepts, use kin link <a> <b> <relationship> --why "<reason>" to connect them.

    line 70
  4. Very specific:

    Track decisions: Use kin add "<decision>" --type decision --tags <project> for architectural or design decisions.

    line 71
  5. Very specific:

    Record constraints: Use kin add "<rule>" --type constraint --trigger <event> --action <verify|warn|block> for invariants.

    line 72
  6. Very specific:

    Flag attention items: Use kin add "<item>" --type watch --owner <person> --expires <date> for things that need monitoring.

    line 73
  7. Very specific:

    Search before adding: Use kin search <term> or kin search <term> --tags <domain> to check if knowledge already exists before duplicating.

    line 74
  8. Very specific:

    Edit, don't re-add: Use kin edit <id-or-title> --content "..." to correct an existing node instead of creating a near duplicate.

    line 76
  9. Very specific:

    Coordinate multi-agent work: Use kin coord join <name> to become a member (unread tracking), kin coord attach <name> <node> for shared …

    line 77
  10. Very specific:

    Profiles: When profiles: are configured in ~/.config/kindex/kin.yaml, the active graph resolves by --profile flag > KIN_PROFILE env > .kin …

    line 78
  11. Very specific:

    Filter by tags: Use kin list --tags <tag1>,<tag2> to find nodes by tag (AND logic).

    line 79
  12. Very specific:

    Check status: Use kin status to see graph health and active operational nodes.

    line 80
  13. Very specific:

    Session tags: Use kin tag start <name> --focus "what you're working on" to create a named session handle.

    line 81
  14. Distinctive:

    When asked to release, follow these steps exactly.

    line 96
  15. Very specific:

    Run full test suite: pytest tests/ -v

    line 98
  16. Distinctive:

    Commit version bump and all changes

    line 100
  17. Very specific:

    Create GitHub release: gh release create vX.Y.Z --title "..." --notes "..."

    line 103
  18. Very specific:

    Verify on PyPI: pip index versions kindex 2>/dev/null | head -1 or check https://pypi.org/project/kindex/

    line 105
  19. Very specific:

    Verify the MCP listing metadata is current: server.json version/package fields match the release, and https://mcpmarket.com/server/kindex …

    line 114
  20. Distinctive:

    Search: Hybrid retrieval combining FTS5 BM25 scores, graph BFS traversal, and optional vector similarity, merged via Reciprocal Rank Fusion …

    line 121

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Kindex — Knowledge Graph for AI-Assisted Workflows

Kindex is a persistent knowledge graph that indexes conversations, projects, and intellectual work so that Codex never starts a session blind. The CLI is kin.

Running Tests

Install Python test dependencies (pip install -e ".[dev,mcp]") and Node.js 24 or newer. Node executes the modern Claude adapter contract tests; it is not a Kindex package dependency.

# All tests
pytest tests/ -v

# Specific module
pytest tests/test_cli.py -v
pytest tests/test_hooks.py -v
pytest tests/test_store.py -v

# With coverage
pytest tests/ --cov=kindex --cov-report=term-missing

The CI workflow runs full pytest with Python 3.12, Node.js 24, and .[dev,mcp] on pull requests and pushes to main. It also supports manual dispatch and reusable workflow calls. Publish to PyPI runs only on v* tag pushes and invokes CI before building and publishing. The test check must be required in branch protection to prevent merging a failing suite.

Key File Locations

PathPurpose
src/kindex/cli.pyCLI entry point and all kin subcommands
src/kindex/dream.pyDream cycle: fuzzy dedup, suggestion auto-apply, domain edges
src/kindex/referent.pyR0 referent binding: digest validation, staleness sweep, rebind
src/kindex/snapshots.pyPre-merge SQLite snapshots (rotating, fail-closed) to XDG state dir
src/kindex/dream_deep.pyLLM-powered cluster consolidation (--deep mode only)
src/kindex/store.pySQLite + FTS5 storage layer
src/kindex/config.pyConfiguration loading and Config model
src/kindex/graph.pyGraph analytics (centrality, communities, bridges)
src/kindex/retrieve.pyHybrid search (FTS5 + graph BFS + RRF merge)
src/kindex/extract.pyKnowledge extraction from text and sessions
src/kindex/ingest.pyProject and session ingestion pipeline
src/kindex/sessions.pySession tag lifecycle (start, update, segment, resume)
src/kindex/coordination.pyCollab conversations (members, cursors, inject messages, resources)
src/kindex/locks.pyAdvisory node locks (acquire, release, expiry sweep)
src/kindex/hooks.pyClaude Code hook handlers (prime, compact)
src/kindex/setup.pySystem setup (Codex hooks, launchd, crontab, .kin git merge driver)
src/kindex/kin_merge.pyStructured 3-way union merge for .kin/index.json + .kin/code-map.json (kin merge-kin git driver)
src/kindex/daemon.pyBackground daemon and cron cycle
src/kindex/budget.pyLLM spend tracking and budget enforcement
src/kindex/vectors.pyVector embedding, contextual chunk indexing, reindex maintenance, and similarity search
src/kindex/vault.pyMarkdown vault import/export
src/kindex/models.pyCore data models
src/kindex/schema.pyDatabase schema and migrations
src/kindex/llm.pyLLM provider abstraction
tests/All tests (pytest)
~/.kindex/Default data directory (SQLite DB, logs)
~/.config/kindex/kin.yamlUser config
.kin/configGit-tracked project context and optional work policy
.kin/index.jsonGit-tracked project graph snapshot generated by kin index
.kin/code-map.jsonGit-tracked repo code map generated by kin export code-map
.gitattributesPoints .kin/index.json + .kin/code-map.json at the merge=kindex driver (auto-written by kin index)

Session Directives

When working in this codebase, follow these practices:

  • Capture new knowledge: When you learn something significant, use kin add "<insight>" --tags <domain1>,<domain2> to persist it with tags.
  • Create links: When you discover a relationship between concepts, use kin link <a> <b> <relationship> --why "<reason>" to connect them.
  • Track decisions: Use kin add "<decision>" --type decision --tags <project> for architectural or design decisions.
  • Record constraints: Use kin add "<rule>" --type constraint --trigger <event> --action <verify|warn|block> for invariants.
  • Flag attention items: Use kin add "<item>" --type watch --owner <person> --expires <date> for things that need monitoring.
  • Search before adding: Use kin search <term> or kin search <term> --tags <domain> to check if knowledge already exists before duplicating.
  • Bind claims about code: kin add "<claim>" --referent <path> hashes the referent so kin stale can later demote claims whose referent moved (re-verify with kin stale --rebind <id>).
  • Edit, don't re-add: Use kin edit <id-or-title> --content "..." to correct an existing node instead of creating a near duplicate. Additive types (decision, constraint, directive, checkpoint, watch) only accept --append and --expires; use kin supersede <id> "<new text>" --reason "..." to replace them with history. kin changelog shows per-field diffs.
  • Coordinate multi-agent work: Use kin coord join <name> to become a member (unread tracking), kin coord attach <name> <node> for shared resources, kin coord inject <name> set "<msg>" [--to <agent>] for standing messages, and kin lock <id> --ttl <min> --note "<why>" / kin unlock <id> for advisory locks before editing contested nodes.
  • Profiles: When profiles: are configured in ~/.config/kindex/kin.yaml, the active graph resolves by --profile flag > KIN_PROFILE env > .kin chain profile: key > cwd roots match > default_profile. kin profile which shows the resolution; kin whoami shows the agent identity used for locks/claims/collabs.
  • Filter by tags: Use kin list --tags <tag1>,<tag2> to find nodes by tag (AND logic). Tags supplement auto-categorization.
  • Check status: Use kin status to see graph health and active operational nodes.
  • Session tags: Use kin tag start <name> --focus "what you're working on" to create a named session handle. Update with kin tag update <name> --focus "..." or kin tag segment <name> --focus "new topic" --summary "what happened". Resume in a new session with kin tag resume <name>. End with kin tag end <name> --summary "...". See kin tag list for all tags.
  • Project policy: .kin/config ships with the repo. Run kin policy check --event agent-start before meaningful code work when shell access is available. Linear is opt-in only; enforce it only when work_policy.linear.enabled is true in the project config.

Auto-Context Loading

At the start of each session, load relevant context:

kin prime --for hook

This auto-detects the current project from $PWD and outputs a context block with relevant knowledge, active constraints, and recent changes.

Release Checklist

When asked to release, follow these steps exactly. Do NOT install twine or attempt manual PyPI upload — it's fully automated.

  1. Run full test suite: pytest tests/ -v
  2. Bump version in pyproject.toml and add a ## [X.Y.Z] - YYYY-MM-DD entry to CHANGELOG.md. The pre-commit hook (scripts/sync-version.sh) syncs src/kindex/__init__.py, the README badge, docs/index.html, server.json, docs/.well-known/mcp/server-card.json and both plugin manifests from it; tests/test_release_metadata.py fails CI if any surface disagrees. If git config core.hooksPath is set globally (it is on Jeremy's machine), the repo hook never runs: run bash scripts/sync-version.sh by hand before committing, and run pytest tests/test_release_metadata.py before tagging
  3. Commit version bump and all changes
  4. Push to main: git push origin main
  5. Tag: git tag vX.Y.Z && git push origin vX.Y.Z
  6. Create GitHub release: gh release create vX.Y.Z --title "..." --notes "..."
  7. Watch the workflow: gh run watch <id> -R wandercom/kindex -- every job (test, build, publish, mcp-registry) must pass
  8. Verify on PyPI: pip index versions kindex 2>/dev/null | head -1 or check https://pypi.org/project/kindex/
  9. The release publishes the server entry to the MCP Registry after PyPI succeeds (.github/workflows/publish-mcp.yml, OIDC, no token; it refuses to publish a version PyPI does not have, and gh workflow run publish-mcp.yml -f tag=vX.Y.Z -R wandercom/kindex backfills a release tagged before this existed). The workflow confirms the registry itself, but to check by hand -- note that search matches substrings across every server and every historical version, so io.github.jmcentire/kindex and old releases come back too; match the exact name and the registry's isLatest flag rather than a position in the list:

    curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.wandercom/kindex&version=latest" \
      | python3 -c "import json,sys; n='io.github.wandercom/kindex'; e=[x['server'] for x in json.load(sys.stdin)['servers'] if x['server']['name']==n and x['_meta']['io.modelcontextprotocol.registry/official']['isLatest']]; print(e[0]['version'] if e else 'MISSING')"

    The registry is how MCP clients discover the server.

  10. Verify the MCP listing metadata is current: server.json version/package fields match the release, and https://mcpmarket.com/server/kindex reflects the published package after indexing.

Definition of done: The release is complete when (a) all workflow jobs are green, (b) the new version appears on PyPI, (c) pip install kindex==X.Y.Z succeeds, and (d) MCP/server metadata has been updated or a marketplace refresh has been requested. If any job fails, fix the issue, bump to a new patch version, and repeat from step 1 -- do not re-tag or force-push an existing tag.

Architecture Notes

  • Storage: SQLite with FTS5 full-text search, triggers for index sync
  • Search: Hybrid retrieval combining FTS5 BM25 scores, graph BFS traversal, and optional vector similarity, merged via Reciprocal Rank Fusion (RRF)
  • Embeddings: Voyage defaults to voyage-context-4; contextual chunking activates only for provider/model support. Use kin embed plan/enqueue/drain/reindex/status for scoped or gradual reindexing.
  • Context tiers: full (~4000 tokens), abridged (~1500), summarized (~750), executive (~200), index (~100) -- auto-selected by budget
  • Node types: concept, document, session, person, project, decision, question, artifact, skill, constraint, directive, checkpoint, watch
  • Edge types: relates_to, depends_on, derived_from, contradicts, etc. with weights and provenance
  • Node mutability classes (enforced by kin edit / MCP edit, overridable via config edit_policy):
ClassNode typesAllowed edits
editableconcept, document, artifact, skill, person, project, questionFull in-place: title, content, append, tags, intent, expires
additivedecision, constraint, directive, checkpoint, watchappend + expires only; replace via kin supersede
managedtask, session, coordinationRefused — use kin task / kin tag / kin coord
  • Audience: private / team / public scoping with export boundary enforcement
  • Weight decay: Nodes and edges naturally fade unless accessed, keeping the graph fresh
  • Generated .kin artifacts (.kin/index.json, .kin/code-map.json): never hand-resolve a git conflict in them. kin index auto-registers the kin merge-kin structured union merge driver (via .gitattributes + local .git/config); kin setup-merge (re)installs it per clone. Regenerate with kin index / kin export code-map rather than hand-editing the JSON.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.