Skip to main content

Architectural context layer for AI coding agents — function-level dependency graph via MCP

Project description

Winkers

Architectural context layer for AI coding agents.

License: MIT CI

Winkers builds a function-level dependency graph via tree-sitter, enriches it with semantic context via Claude API, and serves both to AI agents via MCP. The agent gets project structure, constraints, and conventions before writing any code.

Quick start

pipx install winkers              # or: pip install winkers
cd your-project
export ANTHROPIC_API_KEY=sk-ant-...   # optional, for semantic enrichment
winkers init                      # graph + semantic + MCP registration

Auto-detects Claude Code or Cursor and registers the MCP server. Without the API key, the graph still works — semantic enrichment is skipped.

What it does

Three-file model — zero duplication:

File Contains Generated by
graph.json Files, functions, call edges, import edges, complexity tree-sitter parse
semantic.json Zone intents, data flow, domain context, constraints Claude API (one call)
rules.json Coding conventions with detection + wrong_approach LLM audit + detectors

MCP tools

Tool Purpose
orient(include, zone?, min_callers?) Project map: zones, conventions, hotspots, routes, UI map, functions graph
scope(function?, file?) Deep context: callers, callees, related rules, semantic context
convention_read(target) Zone intent, data flow, domain context, checklist
rule_read(category) All rules for a category with wrong_approach

The agent calls orient(["map","conventions"]) first, then scope() for files it plans to modify. Token budget (default 2000) prevents context overflow.

CLI commands

winkers init                   # build graph + semantic + register MCP
winkers init --no-semantic     # graph only, no API call
winkers init --force           # force semantic re-enrichment
winkers serve                  # MCP server (stdio)
winkers dashboard              # browser graph at localhost:7420
winkers doctor                 # check dependencies, graph, API key
winkers record                 # record agent sessions for learning
winkers analyze                # find knowledge gaps in sessions (Haiku)
winkers improve                # show accumulated insights
winkers improve --apply        # inject insights into semantic.json
winkers protect --startup      # trace startup import chain
winkers hooks                  # install commit format + git hooks
winkers commits --range R      # normalize commit messages
winkers conventions-migrate    # import old conventions to rules.json

Improve loop

Winkers learns from agent sessions:

  1. Recordwinkers record parses Claude Code transcripts, scores sessions
  2. Analyzewinkers analyze sends traces to Haiku, finds knowledge gaps
  3. Accumulate — insights deduplicate (fuzzy match), priority escalates with repetition
  4. Applywinkers improve --apply injects high-priority insights into semantic.json
  5. Re-enrich — next winkers init feeds insights into the Claude API call

Dashboard

Interactive Cytoscape.js graph with:

  • Zone colors and caller-based sizing
  • Tech debt layer (complexity, long functions, monster files)
  • Session history and insight viewer
  • Right-click to view source

Languages

Python, TypeScript, JavaScript, Java, Go, Rust, C#

Installation

# Core (graph + MCP, no API calls)
pipx install winkers

# With semantic enrichment (Claude API)
pipx install winkers[semantic]

# Development
git clone https://github.com/n1cke1/winkers.git
cd winkers
pip install -e ".[dev]"
pytest tests/ -v

Privacy

  • Local by default. Graph parsing uses tree-sitter locally. No data leaves your machine unless you opt in to semantic enrichment.
  • Semantic enrichment sends source code to the Anthropic API (one call per winkers init). Set ANTHROPIC_API_KEY to enable. Use --no-semantic to skip.
  • Session analysis sends session traces (tool calls, not source code) to Haiku via winkers analyze. Costs ~$0.01/session.
  • No telemetry. Winkers does not phone home, collect usage data, or send anything anywhere without an explicit command.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

winkers-0.8.0.tar.gz (158.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

winkers-0.8.0-py3-none-any.whl (139.1 kB view details)

Uploaded Python 3

File details

Details for the file winkers-0.8.0.tar.gz.

File metadata

  • Download URL: winkers-0.8.0.tar.gz
  • Upload date:
  • Size: 158.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for winkers-0.8.0.tar.gz
Algorithm Hash digest
SHA256 6f6c13c840cc4de1af4fd618e891aa957dc0cd9cf812666bb9369c235b5bbb84
MD5 81b404369ef3eab10c3f3fa6e6963623
BLAKE2b-256 78158a1bc15352d500ee7f9342d28b0b120fd4fcfe50cc3b71022a5fe40cdc03

See more details on using hashes here.

File details

Details for the file winkers-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: winkers-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 139.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for winkers-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbd0e29c506826bf7957eee73886467e60eba2497b2cbe0d6fd1e42cb6e9bdb0
MD5 15d4abef468d35e8d62086a18f34b0d3
BLAKE2b-256 57e932f5c089589b02c1ac250b07dedc41ca81a258cb14b4d1068d2149efa6c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page