|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thanks for helping improve `context-profiler`. |
| 4 | + |
| 5 | +## Development Setup |
| 6 | + |
| 7 | +```bash |
| 8 | +git clone https://github.com/Turdot/context-profiler.git |
| 9 | +cd context-profiler |
| 10 | +pip install -e . |
| 11 | +``` |
| 12 | + |
| 13 | +For tests, this repository uses `pytest`: |
| 14 | + |
| 15 | +```bash |
| 16 | +PYTHONPATH=src uv run --with pytest pytest tests/test_smoke.py -v |
| 17 | +``` |
| 18 | + |
| 19 | +## Project Boundaries |
| 20 | + |
| 21 | +`context-profiler` analyzes traces; it does not fetch or replay them. |
| 22 | + |
| 23 | +Prefer changes that improve one of these surfaces: |
| 24 | + |
| 25 | +- supported input formats |
| 26 | +- validation and schema guidance for agents |
| 27 | +- context/token analyzers |
| 28 | +- machine-readable diagnosis output |
| 29 | +- HTML report clarity |
| 30 | +- Agent Skills / plugin distribution |
| 31 | + |
| 32 | +Avoid adding provider-specific fetch clients unless there is a strong reason. Agents can use existing CLIs, SDKs, or APIs to fetch traces and pass the result to `context-profiler`. |
| 33 | + |
| 34 | +## Adding a Format |
| 35 | + |
| 36 | +When adding a new input format: |
| 37 | + |
| 38 | +1. Add format metadata in `src/context_profiler/formats.py`. |
| 39 | +2. Include `input_kind`, `confidence`, `analysis_scope`, `limitations`, and `agent_conversion_guidance`. |
| 40 | +3. Add parser/normalizer code in `src/context_profiler/adapters/` or an adjacent focused module. |
| 41 | +4. Add a small synthetic fixture under `tests/fixtures/`. |
| 42 | +5. Add smoke tests for `validate`, `normalize`, `diagnose`, and `analyze --html` if applicable. |
| 43 | + |
| 44 | +## Adding an Analyzer |
| 45 | + |
| 46 | +Analyzers should produce evidence, not overconfident claims. |
| 47 | + |
| 48 | +Good analyzer outputs: |
| 49 | + |
| 50 | +- stable issue codes |
| 51 | +- token counts |
| 52 | +- request/message indices |
| 53 | +- tool names |
| 54 | +- artifact keys |
| 55 | +- confidence and limitations when heuristic |
| 56 | + |
| 57 | +Avoid vague warnings without evidence. |
| 58 | + |
| 59 | +## Agent Skill Changes |
| 60 | + |
| 61 | +Canonical public skills live under `skills/`. |
| 62 | + |
| 63 | +Do not put product-distribution skills under `.agents/skills/` or `.claude/skills/`; those paths are for project-local agent behavior. |
| 64 | + |
| 65 | +If you add or rename skills, update: |
| 66 | + |
| 67 | +- `.plugin/plugin.json` |
| 68 | +- `.claude-plugin/marketplace.json` |
| 69 | +- `README.md` |
| 70 | +- tests covering the distribution files |
0 commit comments