|
| 1 | +# python-substack maintainer instructions |
| 2 | + |
| 3 | +## Project |
| 4 | + |
| 5 | +This repository is a Python 3.10+ library, CLI, and optional MCP server for |
| 6 | +creating and managing Substack drafts from Markdown. Poetry owns dependencies, |
| 7 | +packaging, scripts, and the lock file. The public package is `python-substack`. |
| 8 | + |
| 9 | +Read the relevant implementation, tests, and documentation before editing. |
| 10 | +Keep changes focused and preserve existing public interfaces, defaults, JSON |
| 11 | +keys, environment variables, console scripts, and MCP tool signatures through |
| 12 | +the 1.x series as required by `docs/compatibility.md`. |
| 13 | + |
| 14 | +## Development |
| 15 | + |
| 16 | +- Use the existing style and the simplest working implementation. |
| 17 | +- Add a regression test for every bug fix and offline tests for new behavior. |
| 18 | +- Update user-facing documentation and `CHANGELOG.md` for behavior changes. |
| 19 | +- Do not edit `poetry.lock` unless dependency declarations change. |
| 20 | +- Never expose or commit `.env` contents, passwords, cookies, credentials, |
| 21 | + tokens, captured request headers, or local service-account files. |
| 22 | +- Preserve user changes in a dirty worktree. Do not reset, restore, or delete |
| 23 | + unrelated work. |
| 24 | + |
| 25 | +Install and validate with: |
| 26 | + |
| 27 | +```bash |
| 28 | +poetry install --all-extras |
| 29 | +poetry run pytest -q -m "not live" --strict-markers |
| 30 | +poetry run pre-commit run --all-files |
| 31 | +``` |
| 32 | + |
| 33 | +Live tests call Substack and create disposable drafts. Run them only after the |
| 34 | +maintainer explicitly authorizes the live operation and confirms suitable test |
| 35 | +credentials. Live tests must never publish, and their drafts must be removed. |
| 36 | + |
| 37 | +## Releases |
| 38 | + |
| 39 | +Follow `docs/releasing.md` exactly. Use `/release:prepare X.Y.Z` to prepare a |
| 40 | +candidate and `/release:verify` to validate it. |
| 41 | + |
| 42 | +- Keep both version files unchanged during ordinary development. |
| 43 | +- For a release candidate, synchronize `pyproject.toml` and |
| 44 | + `substack/__init__.py`, prepend `CHANGELOG.md`, and add |
| 45 | + `docs/releases/X.Y.Z.md` using only verified changes. |
| 46 | +- Treat the Git tag, GitHub release, and built distributions as one immutable |
| 47 | + release. Never reuse a published version. |
| 48 | +- Do not commit, tag, push, create a GitHub release, publish to PyPI, run live |
| 49 | + tests, or announce a release without explicit maintainer authorization for |
| 50 | + that action. |
| 51 | +- Never bypass a failing check. Report the failure and preserve its output. |
| 52 | +- Publish only from the exact commit that passed CI, using tag `vX.Y.Z`. |
| 53 | + |
| 54 | +At handoff, state files changed, checks run, checks not run, and any external |
| 55 | +actions still requiring maintainer approval. |
0 commit comments