Skip to content

Commit 2691ae2

Browse files
committed
docs: expand CONTRIBUTING.md
1 parent c0874cb commit 2691ae2

1 file changed

Lines changed: 46 additions & 22 deletions

File tree

CONTRIBUTING.md

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,74 @@
11
# Contributing to DevsContext
22

3-
Thanks for your interest in contributing!
4-
53
## Development Setup
64

75
```bash
86
git clone https://github.com/anthropics/devscontext.git
97
cd devscontext
8+
python -m venv venv
9+
source venv/bin/activate
1010
pip install -e ".[dev]"
1111
```
1212

13+
Configure for local testing:
14+
```bash
15+
cp .devscontext.yaml.example .devscontext.yaml
16+
# Edit .devscontext.yaml with your Jira URL
17+
export JIRA_EMAIL="you@company.com"
18+
export JIRA_API_TOKEN="your-token"
19+
```
20+
1321
## Running Tests
1422

23+
Unit tests (no API keys needed):
24+
```bash
25+
pytest tests/ --ignore=tests/test_integration.py
26+
```
27+
28+
Integration tests (requires real API keys):
1529
```bash
16-
pytest tests/
30+
pytest tests/test_integration.py
1731
```
1832

19-
## Code Style
33+
## Adding a New Adapter
34+
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()`)
39+
40+
2. Add config model to `src/devscontext/config.py`
2041

21-
We use ruff for linting and formatting:
42+
3. Wire into `src/devscontext/core.py`:
43+
- Add adapter initialization
44+
- Include in fetch/search flows
2245

46+
4. Add tests in `tests/test_your_source.py`
47+
48+
See `adapters/jira.py` as reference.
49+
50+
## Code Quality
51+
52+
Before submitting:
2353
```bash
2454
ruff check .
2555
ruff format .
2656
mypy src/
57+
pytest tests/ --ignore=tests/test_integration.py
2758
```
2859

29-
## Pull Requests
30-
31-
1. Fork the repo and create a branch from `main`
32-
2. Add tests for any new functionality
33-
3. Ensure tests pass and code is formatted
34-
4. Submit a PR with a clear description
60+
Requirements:
61+
- Type hints on all functions
62+
- Pydantic models for data structures
63+
- Tests for new functionality
3564

36-
## Adding a New Adapter
37-
38-
Adapters live in `src/devscontext/adapters/`. To add a new source:
39-
40-
1. Create `adapters/your_source.py` extending `Adapter` base class
41-
2. Implement `fetch_context()`, `health_check()`, and any source-specific methods
42-
3. Add configuration model to `config.py`
43-
4. Wire into `DevsContextCore` in `core.py`
44-
5. Add tests in `tests/test_your_source.py`
65+
## Pull Requests
4566

46-
See `adapters/jira.py` as a reference implementation.
67+
1. Fork and create a branch from `main`
68+
2. Make your changes with tests
69+
3. Ensure all checks pass
70+
4. Open a PR describing what and why
4771

4872
## Questions?
4973

50-
Open an issue or start a discussion.
74+
Open an issue.

0 commit comments

Comments
 (0)