Skip to content

Commit 6ccefac

Browse files
committed
feat: optional RAG layer and documentation updates
1 parent fdaf9f3 commit 6ccefac

17 files changed

Lines changed: 2604 additions & 128 deletions

CONTRIBUTING.md

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,58 @@ pytest tests/test_integration.py
3232

3333
## Adding a New Adapter
3434

35-
1. Create `src/devscontext/adapters/your_source.py`:
36-
- Extend the `Adapter` base class
37-
- Implement `fetch_context(task_id)` and `health_check()`
38-
- Add any source-specific methods (e.g., `search()`)
35+
1. **Create adapter file** `src/devscontext/adapters/your_source.py`:
36+
- Extend the `Adapter` base class from `plugins/base.py`
37+
- Set class attributes: `name`, `source_type`, `config_schema`
38+
- Implement required methods:
39+
- `fetch_task_context(task_id, ticket=None) -> SourceContext`
40+
- `search(query, max_results) -> list[SearchResult]`
41+
- `health_check() -> bool`
42+
- Optionally implement `close()` and `format_for_synthesis()`
3943

40-
2. Add config model to `src/devscontext/config.py`
44+
2. **Add config model** to `src/devscontext/models.py`:
45+
- Create Pydantic model with `enabled`, `primary` fields
46+
- Add to `SourcesConfig`
4147

42-
3. Wire into `src/devscontext/core.py`:
43-
- Add adapter initialization
44-
- Include in fetch/search flows
48+
3. **Register in plugin registry** `src/devscontext/plugins/registry.py`:
49+
- Add to `register_builtin_plugins()` method
50+
- Add loading logic in `load_from_config()`
4551

46-
4. Add tests in `tests/test_your_source.py`
52+
4. **Add tests** in `tests/test_your_source.py`
4753

48-
See `adapters/jira.py` as reference.
54+
See `adapters/slack.py` as a complete reference for communication sources.
55+
56+
For full details, see [docs/plugins.md](docs/plugins.md).
57+
58+
## Plugin Development
59+
60+
DevsContext uses a plugin system for extensibility:
61+
62+
- **Adapters**: Fetch context from data sources
63+
- **Synthesis Plugins**: Process and combine context
64+
65+
External plugins can be published as pip packages using entry points.
66+
See [docs/plugins.md](docs/plugins.md) for the complete guide.
67+
68+
## Testing Adapters
69+
70+
```bash
71+
# Unit tests (no API keys needed)
72+
pytest tests/test_your_source.py
73+
74+
# Test with real API (integration)
75+
devscontext test --task YOUR-123
76+
```
77+
78+
## Testing Pre-processing Agent
79+
80+
```bash
81+
# Process a single ticket
82+
devscontext agent process TEST-123
83+
84+
# Check storage status
85+
devscontext agent status
86+
```
4987

5088
## Code Quality
5189

README.md

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,42 +80,81 @@ Then in Claude Code:
8080

8181
## Supported Sources
8282

83-
| Source | What's Fetched |
84-
|--------|----------------|
85-
| **Jira** | Ticket details, comments, linked issues, acceptance criteria |
86-
| **Fireflies** | Meeting transcripts, decisions, action items |
87-
| **Local Docs** | Architecture docs, coding standards, ADRs |
83+
| Source | What's Fetched | Status |
84+
|--------|----------------|--------|
85+
| **Jira** | Ticket details, comments, linked issues, acceptance criteria | Stable |
86+
| **Fireflies** | Meeting transcripts, decisions, action items | Stable |
87+
| **Local Docs** | Architecture docs, coding standards, ADRs | Stable |
88+
| **Slack** | Channel discussions, threads, decisions | New |
89+
| **Gmail** | Email threads related to tickets | New |
8890

89-
Coming soon: Linear, Notion, Confluence, Slack threads
91+
Coming soon: Linear, Notion, Confluence
92+
93+
## Pre-processing Agent
94+
95+
Build context proactively before developers pick up tickets:
96+
97+
```bash
98+
# Start the agent (polls Jira for ready tickets)
99+
devscontext agent start
100+
101+
# Single run for CI/cron
102+
devscontext agent run-once
103+
104+
# Check pre-built context status
105+
devscontext agent status
106+
```
107+
108+
Configure in `.devscontext.yaml`:
109+
110+
```yaml
111+
agents:
112+
preprocessor:
113+
enabled: true
114+
jira_status: "Ready for Development"
115+
jira_project: "PROJ"
116+
```
117+
118+
See [docs/pre-processing.md](docs/pre-processing.md) for the full guide.
119+
120+
## Plugin System
121+
122+
DevsContext uses a plugin architecture for adapters and synthesis:
123+
124+
- **Adapters**: Fetch context from sources (Jira, Slack, docs, etc.)
125+
- **Synthesis Plugins**: Combine context (LLM, template, passthrough)
126+
127+
See [docs/plugins.md](docs/plugins.md) for creating custom plugins.
90128
91129
## Configuration
92130
93131
DevsContext uses `.devscontext.yaml` in your project root:
94132

95133
```yaml
96-
adapters:
134+
sources:
97135
jira:
98136
enabled: true
99137
base_url: "https://your-company.atlassian.net"
100138
email: "${JIRA_EMAIL}"
101139
api_token: "${JIRA_API_TOKEN}"
102140
103-
fireflies:
104-
enabled: false # Optional
105-
api_key: "${FIREFLIES_API_KEY}"
106-
107-
local_docs:
141+
docs:
108142
enabled: true
109143
paths:
110144
- "./docs"
111145
- "./CLAUDE.md"
112146
147+
slack:
148+
enabled: true
149+
bot_token: "${SLACK_BOT_TOKEN}"
150+
channels: ["engineering", "payments-team"]
151+
113152
synthesis:
114153
provider: "anthropic"
115-
model: "claude-3-haiku-20240307"
154+
model: "claude-haiku-4-5"
116155
```
117156

118-
See [.devscontext.yaml.example](.devscontext.yaml.example) for all options.
157+
Full configuration reference: [docs/configuration.md](docs/configuration.md)
119158

120159
## How It Works
121160

0 commit comments

Comments
 (0)