Skip to content

Add new-service skill to scaffold and wire up services - #4

Merged
sovikroy merged 1 commit into
mainfrom
claude/sweet-ride-afrlli
Nov 4, 2026
Merged

sovikroy merged 1 commit into
mainfrom
claude/sweet-ride-afrlli

Conversation

@sovikroy

@sovikroy sovikroy commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a Claude Code project skill, new-service, that creates a new HTTP service or background worker under apps/ and wires it into the monorepo.

  • .claude/skills/new-service/SKILL.md: the steps Claude follows:
    1. Work out the service's name, kind (HTTP or worker), what it does and how it talks to other services.
    2. Put data shared between services into packages/contracts first.
    3. Run the scaffold script.
    4. Write the logic, keeping routes separate from business logic and using fakes in tests, as the existing services do.
    5. Write tests.
    6. Run ruff, mypy, pytest and uv lock --check.
    7. Update ARCHITECTURE.md and README.md.
    8. Commit everything together.
  • .claude/skills/new-service/scripts/scaffold.py (standard library only):
    • creates apps/<name>/ with its pyproject.toml, Dockerfile (HTTP services also get EXPOSE and a /health HEALTHCHECK), src/ and starter tests
    • adds the service to ruff known-first-party and mypy mypy_path in the root pyproject.toml
    • adds an entry to compose.yaml, using the next free port and connecting it to Redis when it uses the broker
    • rejects invalid names, members that already exist, and events or topics that contracts doesn't export
    • has --dry-run to preview changes
  • ARCHITECTURE.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.py finds 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 check and ruff format --check pass
  • strict mypy passes
  • pytest passes (34 tests)
  • uv lock --check passes
  • the error cases were rejected correctly: an invalid name, an existing member and an unknown contract

Testing 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 build because there's no Docker daemon in the test environment. The generated Dockerfile matches the existing ones apart from the names.


Generated by Claude Code

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
@sovikroy
sovikroy merged commit cc118ab into main Nov 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants