new-service
Scaffold a new service (one Worker serving SPA + API, with contracts + D1) from the example_service template.
- License 许可
- MIT
- 最近更新
- 2026-09-07
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- new-service
- description
- Scaffold a new service (one Worker serving SPA + API, with contracts + D1) from the example_service template.
03 SKILL.md 正文
Scaffold the service name supplied by the user, following specs/README.md and AGENTS.md. If no name was supplied, ask for it. Confirm the plan before large changes (absolute rule #10: no unapproved arch/library decisions).
- Specify first: copy
specs/_service-templatetospecs/<service-name>, fill in00_service-spec.md(boundary, entity, API surface, owned D1). - Contract: add
packages/contracts/src/<service-name>.ts(Zod schemas) and export fromindex.ts. - Service: copy
services/example_servicetoservices/<service-name>(minusdist,node_modules,.wrangler,worker-configuration.d.ts,migrations/*). Rename: package to@app/<service-name>, D1database_nameto the service name (underscores OK), wranglernameto the hyphenated form (Worker names are DNS labels — e.g. direxample_service→ nameexample-service), dev/e2e ports to unused ones. Copy.dev.vars.exampletoo and runmake dev-vars. Replace theitementity (worker routes, Drizzle schema, web UI) with the new domain's. Write tests first (services/example_service/testas a model). - DB:
pnpm --filter @app/<service-name> db:generatethendb:migrate:local; add acloudflare_d1_database+ output ininfra/terraform/cloudflare. - UI: follow
docs/frontend/DESIGN_RULE.md— produce the pass-1 token plan in text before writing JSX. Do NOT copy the ledger look from example_service; apply the process, not the visual. - Wire the platform services: add the new D1 to
services/opsmonitoring (one row inopsTargets()+MYNAME_DB_IDvar + Bindings) so it gets backups + capacity + health checks. If admin should sync orgs to this service instead of the scaffold, swap admin'sEXAMPLE_SERVICEbinding target. - Verify:
pnpm install, thenpnpm check(must be green) andpnpm --filter @app/<service-name> e2e. Add@app/<service-name>to the deploy + e2e matrices in.github/workflows/ci.yml(example_service itself is never deployed — your service takes its place).
04 同仓库更多 Skills
patent-search
典拠(patent_research)の待ち行列から先行技術調査の仕事を 1 つ拾い、構成要件ごとに検索式を組んで公報を探し、見つけた段落を典拠として積む。
patent-draft
典拠(patent_research)の待ち行列から明細書ドラフトの仕事を拾い、施行規則の見出し構造に沿って明細書の下書きを起こす。
patent-assess
典拠(patent_research)の待ち行列から特許性の判断の仕事を拾い、照合済みの典拠だけを根拠に、新規性と進歩性を審査基準の型で論じる。
design-select
Use when creating a new screen or significantly changing a UI's look. Presents 2-3 design candidates as clickable HTML mockups in the user's browser (local preview server), lets the user pick one, then implements the winner per DESIGN_RULE.
check
Run the full check (lint + typecheck + test with coverage) and fix failures until green.