一键导入
web-service-scaffold
Use only when explicitly invoked as $web-service-scaffold to run the bundled web-service scaffold script.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use only when explicitly invoked as $web-service-scaffold to run the bundled web-service scaffold script.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | web-service-scaffold |
| description | Use only when explicitly invoked as $web-service-scaffold to run the bundled web-service scaffold script. |
Turn a web-service request into a copied baseline scaffold. The scaffold is a
platform baseline, not a full product implementation. This global skill owns
web-service defaults; the global AGENTS.md does not.
.git/, run git init; otherwise preserve
and extend the existing repository.Use the current working directory as the target repository root.
Use this skill's bundled script as the scaffold implementation. It takes the target repository root and the service name as arguments:
bash scripts/install_project_codex.sh <target-root> <service-name>
That path is relative to this skill's own directory, which the loader reports when it opens the skill — not to the target repository, which has no scaffold script of its own until the baseline is copied.
First action after extracting the service name: run the bundled script.
Do not read checklist, markup contract, companion skills, package files, or repository tree before running the script for a scaffold-only request.
The script creates the Git repository when .git/ is absent, installs the
project contract, copies the complete baseline root from
assets/baseline/root, substitutes service placeholders, generates the local
apps/<service>/docker/.env from the committed docker/env.defaults
template, and creates the initial scaffold suite/report/summary.
assets/baseline/root is the source of truth. It includes root AGENTS.md,
.codex/skills, monorepo config, service source, Docker files, docs, and
scaffold test artifacts. Do not copy AGENTS.md or .codex through a
separate path.
Do not hand-create baseline scaffold files that already exist under
assets/baseline/root.
Do not run npm install, npm run build, npm test, npm run deploy,
browser checks, or git commit after the scaffold script unless the user
explicitly asks for verification, deployment, or commit.
Do not generate project files outside a Git repository.
One service = one app module.
App shape: src/server + src/front.
One service app = one generated domain package:
apps/<service> pairs with packages/<service>_domain.
The generated domain package uses src/common, src/server, and src/front.
Apps may depend on packages; packages must never depend on apps.
App modules own framework lifecycle and orchestration. Domain rules, invariants, and framework-independent product logic belong in the paired domain package, not in additional domain packages.
The scaffold hands back a project that is ready to build. The installer runs
npm ci against the committed package-lock.json as its last step, so the
service compiles and deploys without a separate setup instruction.
This is deliberate rather than incidental: leaving the install to the first deploy only moves the wait somewhere less expected, and a scaffold that cannot compile is not finished. The install is also what produces the workspace link, which npm writes with an absolute target and no copy could carry.
The installer writes the deploy install marker afterwards, so the first
npm run deploy reports phase=install status=skipped reason=up-to-date
rather than installing twice.
The lockfile it installs from is regenerated with:
bash scripts/update-baseline-lockfile.sh
Run that after changing any dependency in a baseline manifest.
Shipping an already-installed node_modules in the baseline was tried and
rejected. It is roughly 1.8x faster and works offline, but it puts 7257
third-party files under version control, and secret scanning refuses the commit
outright - test fixtures inside those packages contain token-shaped strings.
assets/baseline/root is the only reference implementation of the skills it
ships. Every rule those skills state must be true of a freshly scaffolded
project, and every bundled verifier must pass against it. That is what makes
the baseline general rather than a copy of one past project.
After changing anything under assets/, run the guard:
bash scripts/check-baseline.sh
It installs the baseline into a throwaway directory and proves: no absolute
paths, no foreign package manager, no host Node version gate, no hardcoded
port, no product-specific identifier from
references/denied-identifiers.txt, every placeholder substituted, AGENTS.md
routing matching the installed skills exactly, every bundled verifier clean,
the deploy entrypoint owned by the project, every script parsing, and the copy
being runnable as delivered - installed tree, lockfile, workspace link, and
install marker all present.
When a project-specific name is found in the baseline, delete it and add it to
references/denied-identifiers.txt so the same leak cannot return silently.
AGENTS.md.AGENTS.md and .codex/skills from
assets/baseline/root together with the rest of the baseline.workspaces for apps/* and packages/*, package-lock.json committed, and dependency changes through npm commands after the scaffold when requested.yarn.lock, .yarnrc.yml, pnpm-lock.yaml, or pnpm-workspace.yaml.npm run deploy, but do not execute it during fast scaffold unless explicitly requested.AGENTS.md copied from assets/baseline/root.AGENTS.md includes the direct-code abstraction budget: no one-line
private helpers, no single-use helper chains, no nested helper decomposition
without concrete duplication or a meaningful boundary, and no namespace-only
classes..codex/skills/ contains the web-service companion skill set copied from
assets/baseline/root/.codex/skills.assets/baseline/root by the script in one
pass, not reauthored manually.apps/<service> exists and is wired.packages/<service>_domain exists, is wired as the app's single domain
package dependency, and exposes src/common, src/server, and src/front.For a scaffold request, completion is the successful return of this skill's
scripts/install_project_codex.sh "$PWD" <service-name>
plus the script's own required-file checks and generated scaffold
suite/report/summary. Stop there. Do not run dependency install, build, tests,
deploy, browser checks, or commit unless the user explicitly asks for those
actions.
Enforce the repository Docker contract: Docker-first runtime, one root docker-compose.yml, module-owned Docker assets, apps service-module to container mapping, isolated networking, Docker socket passthrough for container-spawning services, a standard npm deploy entrypoint, and runtime-only Dockerfiles that copy prebuilt local dist artifacts instead of building the project. Use when defining compose services, Dockerfiles, networks, volumes, env_file wiring, deploy scripts, Docker socket access, or container ownership.
Run headless browser smoke and E2E tests for a web service. Use when verifying rendered web UI, checking browser errors, creating Playwright-style scenarios, collecting screenshots, or testing a deployed or local service through Chromium.
Enforce that every user-visible string comes from a translated resource key, never a literal in the view. Covers the flat dotted-key resource files per language, the required language set, and the per-folder static key map that keeps a component's resource surface small. Use when writing or reviewing any view, component, label, message, aria-label, or user-facing text.
Enforce the repository monorepo contract: TypeScript latest stable, Turbo plus npm workspaces, exact versions, repository package reuse, package and app boundaries, service-module shape, dist manifest targets, env-schema usage, deploy-script conventions, and React plus shadcn/ui plus Express wiring. Use when creating or reviewing packages, app service modules, package.json, tsconfig, workspace imports, env handling, frontend and backend integration, or monorepo configuration.
Enforce the repository package documentation contract as a navigable dependency graph. Use when creating or updating package README, docs pages, navigation tables, architecture router, API docs, usage docs, constraints, blast-radius/consumer records, internals, decisions, or testing docs. Docs exist so a later model drills down from task to edit target with minimal context and sees blast radius before editing. Keep content terse; keep only repo-specific contracts, paths, edges, intent, and decisions.
Use when designing, implementing, reviewing, or refactoring a React front end. Enforces Model Render — the screen is a projection of a pure in-memory model that lives outside React; React state is only an update trigger (never the source of truth); each component subscribes to the smallest model slice it reads. Prevents state-as-source-of-truth coupling, immutable-copy churn, lifecycle leaks, root/global-state ownership, prop/listener meshes, poor partial rendering, and fake refactors that only relocate complexity.