Extract code from the current app into the scottycore package, cut a new scottycore release, bump the app to it, reinstall, rewrite imports, and run the app's tests. Use when working in any Scotty-family app and a piece of code belongs in the shared scottycore library. Accepts a path (file, dir, or file::function).
Extract code from the app you're currently working in into scottycore, release it as a new scottycore version, then update the current app to use the published package. Full round-trip in ~60 seconds. Version-disciplined — no editable installs, no shortcuts that hide drift.
/promote <path>
<path> is relative to the current app's repo root. Examples:
src/scottyscribe/middleware/rate_limit.py — whole filesrc/scottyscribe/util/ids.py::new_uuid — single functionsrc/scottyscribe/middleware/ — whole directorygrep -q 'scottycore @ git+' pyproject.toml — must match. If not, abort: "not a scottycore-using app"./script/scottycoretest -d /script/scottycore/.gittest -f ~/.config/forgejo-token. If missing, abort with setup instructions.Read the path the user specified. Also grep nearby files for:
tests/ has a test for this path, include it in the extraction)Emit two diffs to the user:
Scottycore side (to be created):
scottycore/<category>/<name>.py. Categories: middleware, util, notify, security, services/<domain>. Pick the most natural one; ask the user if ambiguous.ScribeRateLimiter → RateLimiter, etc.)tests/<category>/test_<name>.pyscottycore/<category>/__init__.py updated with a re-export if there isn't one alreadyApp side (to be modified):
from scottycore.<category>.<name> import <Public>Show both diffs clearly. Then ask:
Proceed with extraction? (y/N)
If the user declines, abort — no writes anywhere.
Read /script/scottycore/pyproject.toml — find version = "X.Y.Z".
Derive bump from the nature of the extraction:
feat:): 0.1.1 → 0.2.0refactor:): 0.1.1 → 0.1.2feat!:): 0.1.1 → 1.0.0Default to minor+feat: for extractions. Show the proposed commit message: