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.7.5.tar.gz (128.1 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.7.5-py3-none-any.whl (107.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for winkers-0.7.5.tar.gz
Algorithm Hash digest
SHA256 102bf230d663d68bcd0f9995d2c47a203ef9f444bdb0c53587c63058ce3e0eec
MD5 56048fbc6118fda1a4f82f0ef1891072
BLAKE2b-256 b03daa4b574f061b1f24efc60c6eb9e8810c5f650cd7eb1cabd1dc0160f0870b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: winkers-0.7.5-py3-none-any.whl
  • Upload date:
  • Size: 107.4 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.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 53f20dc78a56dbdc3b0c096f640aacc322785a8f3f2bc0e0f3d5bfa20b2969b5
MD5 152d86efc13c8949a5da2e7b981f1119
BLAKE2b-256 749ddef618ebf4356028f0087801c4e27a8585c207aa55b3b1c972c0ff1d1bfd

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