Repository navigation
Add new-service skill to scaffold and wire up services - #4
Merged
Merged
Conversation
Adds a Claude Code project skill (.claude/skills/new-service) that walks through creating an HTTP service or worker: contracts first, scaffold, implement with the repo's layering, test, verify and update docs. scripts/scaffold.py (stdlib only) generates apps/<name>/ (pyproject, Dockerfile, src, tests), registers it in ruff known-first-party and mypy mypy_path, and adds a compose.yaml entry. Validated end to end: generated services pass ruff, ruff format, strict mypy and pytest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SE2PhHbNwAr33LePyqTcyc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Claude Code project skill,
new-service, that creates a new HTTP service or background worker underapps/and wires it into the monorepo..claude/skills/new-service/SKILL.md: the steps Claude follows:packages/contractsfirst.uv lock --check.ARCHITECTURE.mdandREADME.md..claude/skills/new-service/scripts/scaffold.py(standard library only):apps/<name>/with itspyproject.toml, Dockerfile (HTTP services also getEXPOSEand a/healthHEALTHCHECK),src/and starter testsknown-first-partyand mypymypy_pathin the rootpyproject.tomlcompose.yaml, using the next free port and connecting it to Redis when it uses the brokercontractsdoesn't export--dry-runto preview changesARCHITECTURE.md: "Adding a new service" now points to the skill and the script. The manual steps are still there.CI needs no changes, because
scripts/ci/affected.pyfinds new workspace members on its own.Testing
In a throwaway copy of the repo, I generated an HTTP service with
--broker, a plain HTTP service and a worker. With those added:ruff checkandruff format --checkpassmypypassespytestpasses (34 tests)uv lock --checkpassesTesting found one bug, now fixed: test filenames must be unique across the repo or mypy fails, so generated tests are named
test_<pkg>.py.I couldn't run
docker buildbecause there's no Docker daemon in the test environment. The generated Dockerfile matches the existing ones apart from the names.Generated by Claude Code