Copilot Guide¶
This project welcomes AI assistance to accelerate development while maintaining quality. Use these prompt patterns and expectations.
Prompt Patterns¶
- "Write unit tests for
indicators/divergence.pycovering 2- and 3-point cases. Use small synthetic OHLC fixtures." - "Create integration tests for
stockcharts-rsi-divergenceCLI that write outputs to a temp dir and validate CSV headers. Mock yfinance downloads." - "Add MkDocs section to
docs/index.mdshowing 'Try It' commands for screening and plotting." - "Refactor helper functions in
pivots.pyto improve testability without changing public APIs."
Expectations¶
- Tests first: propose tests, then implement minimal code to pass.
- Mock external services: do not perform network calls in tests.
- Keep patches surgical: avoid formatting unrelated files.
- Update docs when adding flags or changing behavior.
Common Mocks¶
yfinance.download: return a deterministic DataFrame with columnsOpen,High,Low,Close,Volume.- File system: use
tempfile.TemporaryDirectory()in tests; avoid writing outside temp paths.
Checklists¶
- [ ] Unit tests added
- [ ] Integration tests added/mocked
- [ ] Docs updated
- [ ] CI passes locally
Useful Commands¶
pytest -q --maxfail=1 --disable-warnings
mkdocs build --strict
mkdocs serve