universal-agent-context 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. uacs/__init__.py +12 -0
  2. uacs/adapters/__init__.py +19 -0
  3. uacs/adapters/agent_skill_adapter.py +202 -0
  4. uacs/adapters/agents_md_adapter.py +330 -0
  5. uacs/adapters/base.py +261 -0
  6. uacs/adapters/clinerules_adapter.py +39 -0
  7. uacs/adapters/cursorrules_adapter.py +39 -0
  8. uacs/api.py +262 -0
  9. uacs/cli/__init__.py +6 -0
  10. uacs/cli/context.py +349 -0
  11. uacs/cli/main.py +195 -0
  12. uacs/cli/mcp.py +115 -0
  13. uacs/cli/memory.py +142 -0
  14. uacs/cli/packages.py +309 -0
  15. uacs/cli/skills.py +144 -0
  16. uacs/cli/utils.py +24 -0
  17. uacs/config/repositories.yaml +26 -0
  18. uacs/context/__init__.py +0 -0
  19. uacs/context/agent_context.py +406 -0
  20. uacs/context/shared_context.py +661 -0
  21. uacs/context/unified_context.py +332 -0
  22. uacs/mcp_server_entry.py +80 -0
  23. uacs/memory/__init__.py +5 -0
  24. uacs/memory/simple_memory.py +255 -0
  25. uacs/packages/__init__.py +26 -0
  26. uacs/packages/manager.py +413 -0
  27. uacs/packages/models.py +60 -0
  28. uacs/packages/sources.py +270 -0
  29. uacs/protocols/__init__.py +5 -0
  30. uacs/protocols/mcp/__init__.py +8 -0
  31. uacs/protocols/mcp/manager.py +77 -0
  32. uacs/protocols/mcp/skills_server.py +700 -0
  33. uacs/skills_validator.py +367 -0
  34. uacs/utils/__init__.py +5 -0
  35. uacs/utils/paths.py +24 -0
  36. uacs/visualization/README.md +132 -0
  37. uacs/visualization/__init__.py +36 -0
  38. uacs/visualization/models.py +195 -0
  39. uacs/visualization/static/index.html +857 -0
  40. uacs/visualization/storage.py +402 -0
  41. uacs/visualization/visualization.py +328 -0
  42. uacs/visualization/web_server.py +364 -0
  43. universal_agent_context-0.2.0.dist-info/METADATA +873 -0
  44. universal_agent_context-0.2.0.dist-info/RECORD +47 -0
  45. universal_agent_context-0.2.0.dist-info/WHEEL +4 -0
  46. universal_agent_context-0.2.0.dist-info/entry_points.txt +2 -0
  47. universal_agent_context-0.2.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,873 @@
1
+ Metadata-Version: 2.4
2
+ Name: universal-agent-context
3
+ Version: 0.2.0
4
+ Summary: A universal system for discovering, translating, and managing AI agent capabilities
5
+ Project-URL: Homepage, https://github.com/kylebrodeur/universal-agent-context
6
+ Project-URL: Documentation, https://github.com/kylebrodeur/universal-agent-context/tree/main/docs
7
+ Project-URL: Repository, https://github.com/kylebrodeur/universal-agent-context
8
+ Project-URL: Bug Tracker, https://github.com/kylebrodeur/universal-agent-context/issues
9
+ Author-email: Kyle Brodeur <kyle@example.com>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: agents,ai,context,mcp,model-context-protocol,skills
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: fastapi>=0.104.0
21
+ Requires-Dist: httpx>=0.27.0
22
+ Requires-Dist: mcp>=1.0.0
23
+ Requires-Dist: pydantic>=2.0.0
24
+ Requires-Dist: pyyaml>=6.0.0
25
+ Requires-Dist: rich>=13.7.0
26
+ Requires-Dist: sse-starlette>=1.8.0
27
+ Requires-Dist: starlette>=0.27.0
28
+ Requires-Dist: tiktoken>=0.5.0
29
+ Requires-Dist: typer>=0.12.0
30
+ Requires-Dist: uvicorn>=0.20.0
31
+ Requires-Dist: websockets>=12.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: bandit[toml]>=1.7.10; extra == 'dev'
34
+ Requires-Dist: docstr-coverage>=2.3.0; extra == 'dev'
35
+ Requires-Dist: interrogate>=1.7.0; extra == 'dev'
36
+ Requires-Dist: mypy>=1.13.0; extra == 'dev'
37
+ Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
38
+ Requires-Dist: pydocstyle>=6.3.0; extra == 'dev'
39
+ Requires-Dist: pyinstaller>=6.0.0; extra == 'dev'
40
+ Requires-Dist: pyright>=1.1.390; extra == 'dev'
41
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
42
+ Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
43
+ Requires-Dist: pytest-mock>=3.14.0; extra == 'dev'
44
+ Requires-Dist: pytest-xdist>=3.6.0; extra == 'dev'
45
+ Requires-Dist: pytest>=9.0.0; extra == 'dev'
46
+ Requires-Dist: respx>=0.21.0; extra == 'dev'
47
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
48
+ Description-Content-Type: text/markdown
49
+
50
+ # Universal Agent Context System (UACS)
51
+
52
+ **Context Management Infrastructure for AI Agents**
53
+
54
+ [![PyPI](https://img.shields.io/badge/pypi-v0.1.0-blue)](https://pypi.org/project/universal-agent-context/)
55
+ [![Tests](https://img.shields.io/badge/tests-100%2B%20passing-brightgreen)]()
56
+ [![Python](https://img.shields.io/badge/python-3.11%2B-blue)]()
57
+ [![License](https://img.shields.io/badge/license-MIT-blue)]()
58
+
59
+ > **TL;DR:** Universal context middleware for AI agents. One source of truth → 5+ formats. Perfect recall with smart deduplication (15% savings). Package management for skills + MCP. Works with Claude, Cursor, Windsurf, Cline, or your own Python code.
60
+
61
+ ---
62
+
63
+ ## Why UACS?
64
+
65
+ Building AI agent systems today means juggling multiple formats, wasting tokens, and losing context between sessions. **UACS solves this.**
66
+
67
+ **In 30 seconds:**
68
+ - 🔄 Write once → Deploy to Claude, Cursor, Cline, Gemini, Copilot
69
+ - 🗜️ Never lose context with automatic deduplication (15% immediate savings)
70
+ - 🛡️ **NEW:** Proactive compaction prevention for Claude Code (95%+ success rate)
71
+ - 🤖 **NEW:** Local LLM tagging via transformers (zero API cost, better quality)
72
+ - 📊 **NEW:** LangSmith-style trace visualization (debug any session)
73
+ - 📦 Package management for skills + MCP servers (GitHub, Git, local)
74
+ - 🧠 Persistent memory across sessions (project + global)
75
+ - ⚡ Python API + CLI + MCP server = works everywhere
76
+
77
+ **What makes UACS different:** It's **middleware**, not another agent tool. Claude Desktop gets better when you add UACS. So does Cursor. So does your custom Python agent.
78
+
79
+ ---
80
+
81
+ ## Installation
82
+
83
+ Choose the installation method that best fits your workflow:
84
+
85
+ | Method | Best For | Prerequisite |
86
+ | :--- | :--- | :--- |
87
+ | **Python (pip)** | Developers integrating UACS into Python projects | Python 3.11+ |
88
+ | **uvx** | Quick, temporary usage without installing dependencies | `uv` installed |
89
+ | **[Binary](docs/guides/MCP_SERVER_BINARY.md)** | Standalone usage, no Python environment needed | None |
90
+ | **[Docker](docs/MCP_SERVER_DOCKER.md)** | Server deployments, team environments | Docker |
91
+
92
+ ### Quick Start (Python)
93
+
94
+ ```bash
95
+ # Option 1: From source (Current - Week 1)
96
+ git clone https://github.com/kylebrodeur/universal-agent-context
97
+ cd universal-agent-context
98
+ uv sync # Or: pip install -e .
99
+
100
+ # Option 2: PyPI (Coming Week 3)
101
+ pip install universal-agent-context
102
+
103
+ # Option 3: One-liner (Coming Week 2)
104
+ uvx universal-agent-context serve
105
+
106
+ # Initialize project
107
+ uv run uacs context init # Creates .state/context/ directory
108
+ uv run uacs memory init # Creates .state/memory/ directory
109
+
110
+ # Optional: For local LLM tagging (better topic extraction)
111
+ pip install transformers torch # ~2GB download on first use
112
+ ```
113
+
114
+ ### Claude Code Plugin (NEW)
115
+
116
+ **Proactive compaction prevention + real-time context storage:**
117
+
118
+ ```bash
119
+ # Install plugin
120
+ cp .claude-plugin/plugin-proactive.json ~/.claude/plugin.json
121
+ cp .claude-plugin/hooks/*.py ~/.claude/hooks/
122
+ chmod +x ~/.claude/hooks/*.py
123
+
124
+ # Optional: Install transformers for better topic extraction
125
+ pip install transformers torch
126
+ ```
127
+
128
+ **Features:**
129
+ - 🛡️ **Compaction Prevention**: Monitors context, compresses at 50% (before Claude's 75% threshold) - 95%+ success
130
+ - 🤖 **Local LLM Tagging**: Uses TinyLlama (1.1B) for topic extraction - zero API cost
131
+ - 💾 **Crash-Resistant**: Real-time storage via PostToolUse hook
132
+ - 🔄 **Auto-Context**: Injects previous context on session resume
133
+
134
+ **See:** [Quick Start Guide](./QUICKSTART.md) | [Plugin Evolution](./.github/PLUGIN_EVOLUTION.md) | [Compaction Prevention Strategy](./.github/COMPACTION_PREVENTION_STRATEGY.md)
135
+
136
+ ---
137
+
138
+ ## CLI Demo
139
+
140
+ See UACS in action:
141
+
142
+ ```bash
143
+ # Install packages from GitHub
144
+ $ uacs packages install anthropic/skills-testing
145
+
146
+ 📦 Installing package 'anthropic/skills-testing'...
147
+ ✅ Cloning from GitHub...
148
+ ✅ Validating package structure...
149
+ ✅ Installed to .agent/skills/testing/
150
+
151
+ # List installed packages
152
+ $ uacs packages list
153
+
154
+ 📚 Installed Packages (5):
155
+
156
+ Skills:
157
+ ✓ code-review - Review code for security and best practices
158
+ Source: github.com/anthropic/skills
159
+
160
+ ✓ documentation - Generate comprehensive docs
161
+ Source: github.com/anthropic/skills
162
+
163
+ ✓ testing - Create unit, integration, and e2e tests
164
+ Source: github.com/anthropic/skills
165
+
166
+ MCP Servers:
167
+ ✓ filesystem - File operations via MCP
168
+ Source: github.com/anthropic/mcp-servers
169
+
170
+ # Check context stats
171
+ $ uacs context stats
172
+
173
+ 📊 Context Statistics:
174
+ Total entries: 127
175
+ Original tokens: 45,234
176
+ After deduplication: 38,449 (15% reduction)
177
+ Token savings: 6,785
178
+
179
+ Optimization breakdown:
180
+ - Deduplication: 6,785 tokens (15%)
181
+ - Quality filtering: Enabled
182
+ - Topic indexing: 12 topics identified
183
+
184
+ 💰 Cost Savings (at $0.01/1K tokens):
185
+ Without deduplication: $0.45/call
186
+ With deduplication: $0.38/call
187
+ Savings: $0.07/call (15%)
188
+
189
+ # Convert between formats
190
+ $ uacs skills convert --to cursorrules
191
+
192
+ ✅ Converted SKILLS.md → .cursorrules
193
+ Skills: 5
194
+ Output: .cursorrules (3,456 tokens)
195
+ Format validated: ✓
196
+
197
+ # Memory operations
198
+ $ uacs memory search "testing"
199
+
200
+ 🔍 Searching memories for "testing"...
201
+
202
+ 📝 Found 3 relevant memories:
203
+ 1. [Score: 0.92] Always use pytest-asyncio for async tests
204
+ Added: 2024-12-15, Tags: testing, pytest
205
+
206
+ 2. [Score: 0.87] Integration tests run in Docker containers
207
+ Added: 2024-12-20, Tags: testing, docker
208
+
209
+ 3. [Score: 0.81] E2E tests use Playwright with page fixtures
210
+ Added: 2024-12-18, Tags: testing, e2e
211
+ ```
212
+
213
+ **What this shows:**
214
+ - 📦 **Easy package installation** - From GitHub, Git, or local paths
215
+ - 📊 **Real-time compression stats** - See exactly what you're saving
216
+ - 🔄 **Format conversion** - One command, any format
217
+ - 🧠 **Memory recall** - Find relevant context instantly
218
+
219
+ ---
220
+
221
+ ## Trace Visualization (NEW)
222
+
223
+ LangSmith-style visualization for debugging Claude Code sessions:
224
+
225
+ ```bash
226
+ # Start visualization server
227
+ python examples/quickstart/visualization_demo.py
228
+
229
+ # Open browser
230
+ open http://localhost:8081
231
+ ```
232
+
233
+ **Features:**
234
+ - 📊 **Session List** - View all Claude Code sessions with stats
235
+ - 🔍 **Session Detail** - Full trace timeline with every event (prompts, tool uses, compressions)
236
+ - 📈 **Token Dashboard** - Real-time token usage, compression savings, trends
237
+ - 🏷️ **Topic Explorer** - Topic clusters with session links
238
+ - 🔎 **Search & Filter** - Find anything across all sessions by topic/keyword
239
+ - 📤 **Export** - Export session traces as JSON for analysis
240
+
241
+ **See:** [Trace Visualization Design](./.github/TRACE_VISUALIZATION_DESIGN.md) | [Implementation Status](./.github/TRACE_VIZ_IMPLEMENTATION_STATUS.md)
242
+
243
+ ---
244
+
245
+ ## The Problem
246
+
247
+ Building with AI agents today means:
248
+
249
+ - 😫 **Context switching** - Maintaining separate configs for Claude, Gemini, Copilot (SKILLS.md, .cursorrules, .clinerules, AGENTS.md)
250
+ - 😫 **Copy-paste errors** - Manually syncing instructions across formats
251
+ - 😫 **Token waste** - Large contexts cost money, no intelligent compression
252
+ - 😫 **Tool isolation** - Each agent tool manages skills/context separately
253
+ - 😫 **Memory fragmentation** - Context lost between agent sessions
254
+
255
+ ## The Solution
256
+
257
+ UACS provides three integration points:
258
+
259
+ 1. **Python Library** - Direct use by developers building agent applications
260
+ 2. **CLI Tool** - `uacs` commands for local development and scripting
261
+ 3. **MCP Server** - Expose UACS capabilities to Claude Desktop, Cursor, Windsurf, Cline
262
+
263
+ **The Result:**
264
+ > Your existing tools get package management, format conversion, perfect recall with deduplication, and persistent memory - without changing how you work.
265
+
266
+ ---
267
+
268
+ ## Use Cases
269
+
270
+ ### 1. Multi-Tool Development
271
+ **Scenario:** You build agents for both Claude Desktop and Cursor IDE.
272
+
273
+ **Before UACS:**
274
+ ```
275
+ .cursorrules (Cursor config)
276
+ SKILLS.md (Claude config)
277
+ .clinerules (Cline config)
278
+ # Manual sync, 3x maintenance
279
+ ```
280
+
281
+ **With UACS:**
282
+ ```bash
283
+ # Write once in SKILLS.md
284
+ uacs skills convert --to cursorrules # Auto-generate .cursorrules
285
+ uacs skills convert --to clinerules # Auto-generate .clinerules
286
+ # One source, zero sync errors
287
+ ```
288
+
289
+ ### 2. Token Cost Optimization
290
+ **Scenario:** Your agent uses 10,000 tokens per call at $0.01/1K tokens.
291
+
292
+ **Before UACS:**
293
+ - Cost per call: $0.10
294
+ - 100 calls/day: $10/day = $300/month
295
+
296
+ **With UACS (v0.1.0):**
297
+ ```python
298
+ context = uacs.get_compressed_context(max_tokens=8500) # Smart retrieval + deduplication
299
+ # 15% deduplication savings + perfect recall
300
+ # Cost per call: $0.085
301
+ # 100 calls/day: $8.50/day = $255/month
302
+ # Savings: $45/month (15%)
303
+ # Plus: 2 hours/week saved (no re-explaining after context resets)
304
+ ```
305
+
306
+ ### 3. Package Management
307
+ **Scenario:** You need testing capabilities for your agent.
308
+
309
+ **Before UACS:**
310
+ ```
311
+ # Search GitHub manually
312
+ # Clone repos
313
+ # Copy-paste configs
314
+ # Update manually when changes occur
315
+ ```
316
+
317
+ **With UACS:**
318
+ ```bash
319
+ uacs packages install anthropic/skills-testing
320
+ # Installed in .agent/skills/ with metadata tracking
321
+ # Works with GitHub repos, Git URLs, or local paths
322
+ ```
323
+
324
+ ### 4. Persistent Agent Memory
325
+ **Scenario:** Your agent should remember project conventions across sessions.
326
+
327
+ **With UACS:**
328
+ ```python
329
+ # Session 1: Agent learns convention
330
+ uacs.memory.add("Use pytest-asyncio for async tests", scope="project")
331
+
332
+ # Session 2: Different agent, same project
333
+ relevant = uacs.memory.search("testing")
334
+ # Returns: "Use pytest-asyncio for async tests"
335
+ # Zero manual context management
336
+ ```
337
+
338
+ ---
339
+
340
+ ## What Makes UACS Different
341
+
342
+ - 🔄 **Format Translation** - Converts between 5+ formats (SKILLS.md, AGENTS.md, .cursorrules, .clinerules, ADK Config)
343
+ - 🗜️ **Smart Deduplication** - Automatic removal of duplicate content (15% immediate savings, 70% compression coming in v0.2.0)
344
+ - 📦 **Package Management** - Install skills + MCP servers from GitHub, Git, or local paths
345
+ - 🎯 **Topic-Based Retrieval** - Auto-tagging and focused context
346
+ - 🧠 **Memory System** - Long-term memory with project and global scopes
347
+ - 🐍 **Standalone Library** - Python API, not just CLI
348
+
349
+ **vs Similar Tools:**
350
+
351
+ | Feature | UACS | openskills | ai-agent-skills |
352
+ |---------|------|------------|-----------------|
353
+ | Format Translation | ✅ 5+ formats | ❌ Skills only | ❌ Skills only |
354
+ | Context Management | ✅ 15% dedup + perfect recall | ❌ None | ❌ None |
355
+ | Package Management | ✅ Skills + MCP | ⚠️ Limited | ⚠️ Limited |
356
+ | Memory System | ✅ Project + Global | ❌ None | ❌ None |
357
+ | MCP Server | ✅ Full integration | ❌ None | ❌ None |
358
+ | Python API | ✅ Complete | ⚠️ Limited | ⚠️ Limited |
359
+ | Token Tracking | ✅ Real-time stats | ❌ None | ❌ None |
360
+
361
+ **Bottom line:** UACS is the only solution that provides format translation, compression, package management, memory, AND MCP server in one package.
362
+
363
+ See [LAUNCH_STRATEGY.md](.github/internal/LAUNCH_STRATEGY.md) for full positioning.
364
+
365
+ ---
366
+
367
+ ## Quick Start
368
+
369
+ **Goal:** Get context compression working in 2 minutes.
370
+
371
+ ### Installation
372
+
373
+ Choose the installation method that best fits your workflow:
374
+
375
+ | Method | Best For | Prerequisite |
376
+ | :--- | :--- | :--- |
377
+ | **Python (pip)** | Developers integrating UACS into Python projects | Python 3.11+ |
378
+ | **uvx** | Quick, temporary usage without installing dependencies | `uv` installed |
379
+ | **[Binary](docs/guides/MCP_SERVER_BINARY.md)** | Standalone usage, no Python environment needed | None |
380
+ | **[Docker](docs/MCP_SERVER_DOCKER.md)** | Server deployments, team environments | Docker |
381
+
382
+ #### Quick Start (Python)
383
+
384
+ ```bash
385
+ # Option 1: From source (Current - Week 1)
386
+ git clone https://github.com/kylebrodeur/universal-agent-context
387
+ cd universal-agent-context
388
+ uv sync # Or: pip install -e .
389
+
390
+ # Option 2: PyPI (Coming Week 3)
391
+ pip install universal-agent-context
392
+
393
+ # Option 3: One-liner (Coming Week 2)
394
+ uvx universal-agent-context serve
395
+
396
+ # Initialize project
397
+ uv run uacs context init # Creates .state/context/ directory
398
+ uv run uacs memory init # Creates .state/memory/ directory
399
+ ```
400
+
401
+ ### 5-Minute Tutorial
402
+
403
+ **Step 1: Test the CLI (30 seconds)**
404
+ ```bash
405
+ uv run uacs --help
406
+ # Output: Shows 5 command groups: context, skills, packages, memory, mcp
407
+ ```
408
+
409
+ **Step 2: Install a Package (1 minute)**
410
+ ```bash
411
+ uv run uacs packages install anthropic/skills-testing
412
+ # Output: Clones from GitHub, validates, and installs
413
+ # Works with GitHub repos, Git URLs, or local paths
414
+ ```
415
+
416
+ **Step 3: Python API - Context Compression (2 minutes)**
417
+
418
+ Create `test_uacs.py`:
419
+ ```python
420
+ from uacs import UACS
421
+ from pathlib import Path
422
+
423
+ # Initialize
424
+ uacs = UACS(project_path=Path.cwd())
425
+
426
+ # Add context entries (simulating agent conversation)
427
+ uacs.shared_context.add_entry(
428
+ content="Review authentication for security issues",
429
+ agent="user"
430
+ )
431
+
432
+ uacs.shared_context.add_entry(
433
+ content="Found timing attack in password comparison",
434
+ agent="claude",
435
+ topics=["security"]
436
+ )
437
+
438
+ # Get compressed context
439
+ context = uacs.get_compressed_context(
440
+ topic="security", # Filter by topic
441
+ max_tokens=1000 # Token budget
442
+ )
443
+
444
+ # Check compression stats
445
+ stats = uacs.get_token_stats()
446
+ print(f"Compression: {stats['compression_ratio']}")
447
+ print(f"Tokens saved: {stats['tokens_saved_by_compression']}")
448
+ ```
449
+
450
+ Run it:
451
+ ```bash
452
+ uv run python test_uacs.py
453
+ # Output: Shows compression ratio and tokens saved
454
+ ```
455
+
456
+ **Step 4: Memory System (1 minute)**
457
+ ```bash
458
+ # Add persistent memory
459
+ uv run uacs memory add "Always use pytest-asyncio for async tests"
460
+
461
+ # Search later
462
+ uv run uacs memory search "testing"
463
+ # Output: Returns relevant memories with scores
464
+ ```
465
+
466
+ **What you just did:**
467
+ - ✅ Installed UACS
468
+ - ✅ Installed a package from GitHub
469
+ - ✅ Compressed context with Python API
470
+ - ✅ Added persistent memory
471
+
472
+ **Next steps:** [MCP Server Setup](docs/MCP_SERVER_SETUP.md) | [Full Library Guide](docs/LIBRARY_GUIDE.md)
473
+
474
+ ---
475
+
476
+ ### Three Ways to Use UACS
477
+
478
+ #### 1. Python Library
479
+
480
+ ```python
481
+ from uacs import UACS
482
+ from pathlib import Path
483
+
484
+ # Initialize
485
+ uacs = UACS(project_path=Path.cwd())
486
+
487
+ # Install packages
488
+ uacs.packages.install("anthropic/skills-testing") # From GitHub
489
+ uacs.packages.install("/path/to/local/skill") # From local path
490
+
491
+ # Get compressed context
492
+ context = uacs.get_compressed_context(
493
+ topic="testing",
494
+ max_tokens=4000 # Smart deduplication + topic filtering
495
+ )
496
+
497
+ # Memory management
498
+ uacs.memory.add("Important: Always use pytest-asyncio for async tests")
499
+ relevant = uacs.memory.search("async testing")
500
+ ```
501
+
502
+ #### 2. CLI Tool
503
+
504
+ ```bash
505
+ # Package management
506
+ uacs packages install anthropic/skills-testing
507
+ uacs packages list
508
+ uacs packages remove pytest-skill
509
+
510
+ # Format conversion
511
+ uacs skills convert --from cursorrules --to skills
512
+
513
+ # Context management
514
+ uacs context stats
515
+ uacs context compress --max-tokens 4000
516
+
517
+ # Memory
518
+ uacs memory add "Important insight"
519
+ uacs memory search "relevant topic"
520
+ ```
521
+
522
+ #### 3. MCP Server (For Claude Desktop, Cursor, Windsurf)
523
+
524
+ ```bash
525
+ # Start MCP server
526
+ uacs serve
527
+
528
+ # Or with uvx (one-liner)
529
+ uvx universal-agent-context serve
530
+ ```
531
+
532
+ **Configure in Claude Desktop:**
533
+ ```json
534
+ // ~/Library/Application Support/Claude/claude_desktop_config.json
535
+ {
536
+ "mcpServers": {
537
+ "uacs": {
538
+ "command": "uacs",
539
+ "args": ["serve"],
540
+ "env": {
541
+ "UACS_PROJECT_PATH": "/path/to/your/project"
542
+ }
543
+ }
544
+ }
545
+ }
546
+ ```
547
+
548
+ **Now Claude Desktop can:**
549
+ - Manage packages from GitHub, Git, or local paths
550
+ - Convert between formats on-the-fly
551
+ - Compress large contexts automatically
552
+ - Access your project memory
553
+ - Install skills directly from conversation
554
+
555
+ ---
556
+
557
+ ## Core Features
558
+
559
+ ### 🔄 Format Translation
560
+
561
+ **The Problem:** You write for Claude (SKILLS.md), but also need Cursor (.cursorrules) and Cline (.clinerules) configs.
562
+
563
+ **The Solution:** Write once, deploy everywhere.
564
+
565
+ ```bash
566
+ # Convert .cursorrules to SKILLS.md
567
+ uv run uacs skills convert --from cursorrules --to skills
568
+
569
+ # Or in Python:
570
+ from uacs.adapters import FormatAdapterRegistry
571
+
572
+ adapter = FormatAdapterRegistry.get_adapter("cursorrules")
573
+ content = adapter.parse(Path(".cursorrules").read_text())
574
+ skills_format = content.to_system_prompt()
575
+ ```
576
+
577
+ **Supported Formats:**
578
+ - ✅ **Agent Skills (SKILLS.md)** - Anthropic standard ([spec](https://docs.anthropic.com/en/docs/build-with-claude/agent-skills))
579
+ - ✅ **AGENTS.md** - Project context standard ([spec](https://github.com/openai/agents))
580
+ - ✅ **.cursorrules** - Cursor IDE format
581
+ - ✅ **.clinerules** - Cline VSCode extension
582
+ - 🚧 **ADK Agent Config** - Google ADK format (Coming Phase 7)
583
+
584
+ **Quality validation included:** All conversions verify structure, check for required fields, score quality.
585
+
586
+ ### 🗜️ Context Compression
587
+
588
+ **The Problem:** Large contexts = high costs. A 10K token call costs $0.10. At scale, this adds up fast.
589
+
590
+ **The Solution:** Smart context management with perfect recall.
591
+
592
+ **Current Implementation (v0.1.0):**
593
+ 1. **Deduplication** - Hash-based, automatic (15% savings)
594
+ 2. **Quality Filtering** - Remove noise, keep signal
595
+ 3. **Topic-Based Retrieval** - Focus on relevant context
596
+ 4. **Exact Storage** - 100% fidelity, zero information loss
597
+
598
+ **Coming in v0.2.0:**
599
+ 5. **LLM Summarization** - Claude Haiku for intelligent compression
600
+ 6. **Vector Embeddings** - Semantic similarity search
601
+ 7. **Knowledge Graph** - Context relationship traversal
602
+ 8. **Target: 70%+ compression** with zero information loss
603
+
604
+ **Real-world Impact (v0.1.0):**
605
+ ```python
606
+ # Deduplication savings:
607
+ - Original context: 10,000 tokens
608
+ - After deduplication: 8,500 tokens (15% savings)
609
+ - Cost per call: $0.085 (vs $0.10)
610
+ - 100 calls/day: $8.50/day vs $10/day
611
+ - Monthly savings: $45 (15%)
612
+
613
+ # Plus time savings:
614
+ - Context never lost = no re-explaining
615
+ - Save ~2 hours/week for active developers
616
+ ```
617
+
618
+ **Usage:**
619
+ ```python
620
+ # Automatic compression
621
+ context = uacs.get_compressed_context(
622
+ topic="security review", # Filter by topic
623
+ max_tokens=4000, # Target size
624
+ agent="claude" # Filter by agent (optional)
625
+ )
626
+
627
+ # Check what you saved
628
+ stats = uacs.get_token_stats()
629
+ print(f"Saved: {stats['tokens_saved_by_compression']} tokens")
630
+ print(f"Ratio: {stats['compression_ratio']}")
631
+ ```
632
+
633
+ ### 📦 Package Management
634
+
635
+ **The Problem:** Skills scattered across GitHub. MCP servers in different repositories. Manual cloning and installation.
636
+
637
+ **The Solution:** Simple package manager modeled after GitHub CLI extensions.
638
+
639
+ ```bash
640
+ # Install from GitHub
641
+ uv run uacs packages install anthropic/skills-testing
642
+
643
+ # Install from Git URL
644
+ uv run uacs packages install https://github.com/owner/repo.git
645
+
646
+ # Install from local path
647
+ uv run uacs packages install /path/to/skill
648
+
649
+ # List installed packages
650
+ uv run uacs packages list
651
+
652
+ # Update packages
653
+ uv run uacs packages update
654
+ ```
655
+
656
+ **Installation sources:**
657
+ - ✅ GitHub repositories (`owner/repo`)
658
+ - ✅ Git URLs (HTTPS or SSH)
659
+ - ✅ Local paths (absolute or relative)
660
+
661
+ **Installation tracking:**
662
+ ```bash
663
+ # Install package
664
+ uv run uacs packages install anthropic/skills-testing
665
+
666
+ # Stored in: .agent/skills/testing/
667
+ # Metadata: .agent/skills/.installed.json (tracks source, version, installed date)
668
+
669
+ # Uninstall
670
+ uv run uacs packages remove testing
671
+ ```
672
+
673
+ ### 🧠 Memory System
674
+
675
+ **The Problem:** Agents forget project conventions between sessions. You repeat instructions constantly.
676
+
677
+ **The Solution:** Persistent memory with project and global scopes.
678
+
679
+ ```bash
680
+ # Initialize
681
+ uv run uacs memory init
682
+
683
+ # Add project-specific memory
684
+ uv run uacs memory add "Use pytest-asyncio for async tests" --scope project
685
+
686
+ # Add global memory (all projects)
687
+ uv run uacs memory add "Prefer composition over inheritance" --scope global
688
+
689
+ # Search with semantic similarity
690
+ uv run uacs memory search "testing patterns"
691
+ # Returns: Relevant memories with similarity scores
692
+
693
+ # Python API
694
+ from uacs import UACS
695
+ uacs = UACS()
696
+
697
+ # Add memory programmatically
698
+ uacs.memory.add(
699
+ "Critical: Always validate input before processing",
700
+ scope="project",
701
+ tags=["security", "validation"]
702
+ )
703
+
704
+ # Search by topic
705
+ results = uacs.memory.search("security", scope="project")
706
+ for memory in results:
707
+ print(f"{memory.content} (score: {memory.score})")
708
+ ```
709
+
710
+ **Storage:**
711
+ - Project scope: `.state/memory/project/`
712
+ - Global scope: `~/.config/uacs/memory/global/`
713
+ - Format: JSON with metadata (timestamp, tags, usage count)
714
+
715
+ ---
716
+
717
+ ## What's Next?
718
+
719
+ We're executing an **8-week public launch plan**:
720
+
721
+ **✅ Phase 0 (Dec 25-26):** Spinout Complete
722
+ - Repository created, tests passing independently
723
+ - Clean separation from Multi-Agent CLI (MAOS)
724
+
725
+ **🔄 Phase 1 (Week 1 - Current):** Polish & Documentation
726
+ - README improvements (you are here!)
727
+ - Installation guides
728
+ - API documentation
729
+ - Example gallery
730
+
731
+ **📦 Phase 2 (Week 2):** MCP Server Packaging
732
+ - PyInstaller binaries for easy distribution
733
+ - Docker image for `uacs serve`
734
+ - Cross-platform testing (macOS, Linux, Windows)
735
+
736
+ **🚀 Phase 3 (Week 3):** PyPI Publishing
737
+ - `pip install universal-agent-context`
738
+ - Version 0.1.0 release
739
+ - Package on conda-forge
740
+
741
+ **📣 Phase 4 (Week 4):** Public Launch
742
+ - Show HN / Reddit launches
743
+ - Documentation site live
744
+ - Community Discord server
745
+
746
+ **Future Roadmap:**
747
+ - Phase 5-6: Advanced features (streaming, webhooks, A2A protocol)
748
+ - Phase 7-8: Enterprise features (auth, analytics, multi-tenancy)
749
+
750
+ See [DEVELOPMENT_ROADMAP.md](.github/internal/DEVELOPMENT_ROADMAP.md) for complete timeline and [LAUNCH_STRATEGY.md](.github/internal/LAUNCH_STRATEGY.md) for marketing plan.
751
+
752
+ ---
753
+
754
+ ## Documentation
755
+
756
+ **Getting Started:**
757
+ - 🚀 [Quick Start](#quick-start) - 5-minute tutorial (above)
758
+ - 📦 Installation - See [Quick Start](#installation) section
759
+ - 🎯 [Use Cases](#use-cases) - Real-world scenarios
760
+
761
+ **Integrations:**
762
+ UACS works with popular MCP clients out of the box:
763
+ - 🤖 [Claude Desktop](docs/integrations/CLAUDE_DESKTOP.md) - Complete setup guide with binary + Docker
764
+ - ✏️ [Cursor](docs/integrations/CURSOR.md) - Integration with inline chat and Composer
765
+ - 🌊 [Windsurf](docs/integrations/WINDSURF.md) - Cascade AI integration guide
766
+ - 📚 [All Integrations](docs/INTEGRATIONS.md) - Overview, troubleshooting, and advanced configs
767
+
768
+ **User Guides:**
769
+ - [Library Guide](docs/LIBRARY_GUIDE.md) - Complete Python API reference
770
+ - [CLI Reference](docs/CLI_REFERENCE.md) - All command documentation
771
+ - [MCP Server Setup](docs/MCP_SERVER_SETUP.md) - MCP integration for Claude/Cursor/Windsurf
772
+
773
+ **Technical Deep Dives:**
774
+ - [Adapters](docs/ADAPTERS.md) - Format translation architecture
775
+ - [Context Management](docs/CONTEXT.md) - Compression algorithms
776
+ - [Package Management](docs/PACKAGES.md) - Installation and management system
777
+
778
+ **Examples:**
779
+ All examples are in [examples/](examples/) and tested:
780
+ - [basic_context.py](examples/basic_context.py) - Context system basics
781
+ - [package_management.py](examples/package_management.py) - Install and manage packages
782
+ - [memory_usage.py](examples/memory_usage.py) - Persistent memory
783
+ - [custom_adapter.py](examples/custom_adapter.py) - Build custom format adapters
784
+ - [mcp_tool_usage.py](examples/mcp_tool_usage.py) - Programmatic MCP access
785
+
786
+ **Development:**
787
+ - [Development Roadmap](.github/internal/DEVELOPMENT_ROADMAP.md) - Development status & timeline
788
+ - [Launch Strategy](.github/internal/LAUNCH_STRATEGY.md) - Marketing & positioning
789
+ - [Contributing](CONTRIBUTING.md) - How to contribute (coming Week 1)
790
+
791
+ ---
792
+
793
+ ## Requirements
794
+
795
+ - **Python:** 3.11 or higher
796
+ - **Optional:** Node.js (for MCP filesystem server)
797
+ - **Optional:** Docker (for containerized MCP deployment)
798
+
799
+ **Installation via `uv` (recommended):**
800
+ ```bash
801
+ # Install uv if you don't have it
802
+ curl -LsSf https://astral.sh/uv/install.sh | sh
803
+
804
+ # Clone and install UACS
805
+ git clone https://github.com/kylebrodeur/universal-agent-context
806
+ cd universal-agent-context
807
+ uv sync
808
+ ```
809
+
810
+ ---
811
+
812
+ ## Development
813
+
814
+ **Setup:**
815
+ ```bash
816
+ # Clone repository
817
+ git clone https://github.com/kylebrodeur/universal-agent-context.git
818
+ cd universal-agent-context
819
+
820
+ # Install with dev dependencies
821
+ uv sync # Or: pip install -e ".[dev]"
822
+
823
+ # Run tests
824
+ uv run pytest # All tests
825
+ uv run pytest -n auto # Parallel (faster)
826
+ uv run pytest --cov=src # With coverage
827
+
828
+ # Code quality
829
+ uv run ruff format . # Format code
830
+ uv run ruff check --fix . # Lint and fix
831
+ ```
832
+
833
+ **Contributing:**
834
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) (coming Week 1) for guidelines.
835
+
836
+ **Project Status:** Phase 1 - Polish & Documentation (Week 1 of 8-week launch)
837
+
838
+ ---
839
+
840
+ ## Related Projects
841
+
842
+ ### Multi-Agent CLI (MAOS)
843
+ - **Repository:** [github.com/kylebrodeur/multi-agent-cli](https://github.com/kylebrodeur/multi-agent-cli)
844
+ - **Relationship:** MAOS imports UACS for context management
845
+ - **Focus:** Multi-agent orchestration using Google ADK
846
+ - **Use case:** Build systems with multiple AI agents (Gemini, Claude, Copilot) working together
847
+
848
+ **Architecture:**
849
+ ```
850
+ MAOS (Multi-Agent Orchestration)
851
+ └── imports universal-agent-context
852
+ └── provides context, skills, packages, memory
853
+ ```
854
+
855
+ ---
856
+
857
+ ## License
858
+
859
+ MIT License - see [LICENSE](LICENSE) for details
860
+
861
+ ---
862
+
863
+ ## Acknowledgments
864
+
865
+ - **Anthropic** - Agent Skills specification ([docs](https://docs.anthropic.com/en/docs/build-with-claude/agent-skills)) and MCP protocol
866
+ - **Google** - Agent Development Kit (ADK)
867
+ - **OpenAI** - AGENTS.md standard
868
+ - **Community** - Skills contributors at [agentskills.io](https://agentskills.io) and [Smithery](https://smithery.ai)
869
+
870
+ ---
871
+
872
+ **Status:** ✅ Phase 0 Complete → 🔄 Phase 1 In Progress (Week 1/8)
873
+ **Version:** 0.1.0-dev | **Last Updated:** December 27, 2025