Skip to content

Commit 15c8dba

Browse files
committed
update: claude.md
1 parent 0ce3c44 commit 15c8dba

1 file changed

Lines changed: 52 additions & 20 deletions

File tree

CLAUDE.md

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,33 @@ context block, and returns it through MCP.
1212

1313
## Architecture
1414
- MCP server using the official Python MCP SDK (`mcp` package)
15-
- On-demand fetching: no background processes, no vector DB, no daemons
16-
- Sources: Jira REST API, Fireflies GraphQL API, local markdown docs
15+
- On-demand fetching with optional pre-processing agent
16+
- Sources: Jira REST API, Fireflies GraphQL API, Slack, Gmail, local markdown docs
1717
- Synthesis: LLM (Claude Haiku / GPT-4o-mini / Ollama) combines raw data into structured block
18-
- Cache: simple in-memory TTL cache, no persistent storage
19-
20-
### Fetch Strategy (Two-Phase)
21-
For `get_task_context`, we use a two-phase fetch:
22-
1. **Phase 1:** Fetch Jira ticket first (need ticket data for doc/meeting matching)
23-
2. **Phase 2:** Fetch meetings and docs in parallel, using ticket title/components/labels
24-
- Meetings: search by ticket ID AND keywords from ticket title
25-
- Docs: match by components, labels, keywords; always include standards
26-
27-
This ensures docs and meetings are contextually relevant to the specific ticket.
18+
- Cache: in-memory TTL cache + optional SQLite for pre-built context
19+
20+
### Plugin System
21+
Source adapters and synthesis engines are plugins.
22+
- Plugin interfaces defined in src/devscontext/plugins/base.py
23+
- Built-in plugins: jira, fireflies, slack, gmail, local_docs
24+
- External plugins: discovered via Python entry points (devscontext.plugins)
25+
- Plugins are activated by being listed in .devscontext.yaml
26+
27+
### Pre-processing Agent
28+
- Watches Jira for tickets entering a configurable status (default: "Ready for Development")
29+
- Runs a multi-step pipeline: deep fetch → broad search → thorough matching → multi-pass synthesis
30+
- Stores pre-built context in SQLite (.devscontext/cache.db)
31+
- MCP server checks pre-built storage first, falls back to on-demand if not found
32+
- Agent and MCP server are separate processes sharing the same SQLite file
33+
34+
### Fetch Strategy
35+
Primary source (Jira) fetched first, then all secondary sources in parallel.
36+
Each source plugin declares if it needs primary context via a needs_primary_context flag.
37+
38+
### Optional RAG
39+
Disabled by default. When enabled via config, enhances local doc matching
40+
with embedding-based semantic search. Requires: pip install devscontext[rag]
41+
Index built manually: devscontext index-docs
2842

2943
### Tool Behaviors
3044
- `get_task_context`: Full LLM synthesis, cached
@@ -37,7 +51,15 @@ This ensures docs and meetings are contextually relevant to the specific ticket.
3751
- `httpx` - async HTTP client for API calls
3852
- `click` - CLI framework
3953
- `pyyaml` - config parsing
40-
- `anthropic` / `openai` - LLM clients for synthesis (optional deps)
54+
- `pydantic` - data validation and models
55+
- `aiosqlite` - async SQLite for pre-built context storage
56+
57+
### Optional Dependencies
58+
All heavy deps are optional. Core install remains lightweight.
59+
- `anthropic` / `openai` - LLM clients for synthesis
60+
- `slack_sdk` - pip install devscontext[slack]
61+
- `google-api-python-client` - pip install devscontext[gmail]
62+
- `sentence-transformers` - pip install devscontext[rag]
4163

4264
## Code Style
4365
- Use async/await for all I/O operations
@@ -52,12 +74,16 @@ This ensures docs and meetings are contextually relevant to the specific ticket.
5274
## Project Structure
5375
- `src/devscontext/server.py` - MCP server setup and tool registration
5476
- `src/devscontext/core.py` - main orchestration (fetch -> extract -> synthesize -> return)
55-
- `src/devscontext/adapters/` - one file per source (jira.py, fireflies.py, local_docs.py)
56-
- `src/devscontext/adapters/base.py` - abstract base class for adapters
77+
- `src/devscontext/adapters/` - one file per source (jira.py, fireflies.py, slack.py, gmail.py, local_docs.py)
78+
- `src/devscontext/plugins/` - plugin system (base.py, registry.py, synthesis.py)
79+
- `src/devscontext/rag/` - optional RAG support (embeddings.py, index.py)
5780
- `src/devscontext/synthesis.py` - LLM synthesis prompt and client
5881
- `src/devscontext/cache.py` - in-memory TTL cache
82+
- `src/devscontext/storage.py` - SQLite storage for pre-built context
83+
- `src/devscontext/preprocessor.py` - pre-processing agent
84+
- `src/devscontext/watcher.py` - Jira status watcher for agent
5985
- `src/devscontext/config.py` - YAML config loading and validation
60-
- `src/devscontext/cli.py` - CLI commands (init, test, serve)
86+
- `src/devscontext/cli.py` - CLI commands (init, test, serve, agent)
6187
- `src/devscontext/utils.py` - text utilities (keyword extraction, truncation)
6288

6389
## MCP Tools (3 total)
@@ -66,12 +92,13 @@ This ensures docs and meetings are contextually relevant to the specific ticket.
6692
3. `get_standards(area: str | None)` - coding standards, optionally filtered
6793

6894
## Key Design Decisions
69-
- On-demand fetching, NOT background ingestion
70-
- No vector DB - use API search + keyword matching on local files
71-
- LLM synthesis happens at retrieval time with fresh data
95+
- On-demand fetching with optional pre-processing for instant retrieval
96+
- No external vector DB - use NumPy + cosine similarity for optional RAG
97+
- LLM synthesis happens at retrieval time (or pre-built by agent)
7298
- Config via `.devscontext.yaml` in project root
7399
- Auth credentials via environment variables only (never in config file)
74-
- Graceful degradation: if Fireflies is not configured, skip it and return Jira + docs only
100+
- Graceful degradation: if a source is not configured, skip it and return available context
101+
- Plugin architecture: adapters and synthesis engines are extensible
75102

76103
### Local Docs Matching
77104
Local docs are matched to tickets via:
@@ -95,3 +122,8 @@ Docs are classified by path:
95122
- `devscontext init` - create .devscontext.yaml interactively
96123
- `devscontext test` - fetch a sample ticket and show synthesized output
97124
- `devscontext serve` - start MCP server (stdio transport)
125+
- `devscontext agent start` - start pre-processing agent (watches Jira)
126+
- `devscontext agent run-once` - process all matching tickets once
127+
- `devscontext agent status` - show agent and storage status
128+
- `devscontext agent process TICKET-123` - process a specific ticket
129+
- `devscontext index-docs` - build RAG index for local docs (requires [rag])

0 commit comments

Comments
 (0)