new-project
Initialize a new or existing project with Claude Forge — PRD, ADR seeds, populated reference docs (01-09), and a seeded task registry. Use when starting a project, bootstrapping project docs, or adding the framework to an existing codebase. NOT for adding a single feature (/new-feature) or upgrading framework versions (/migrate).
- License 许可
- MIT
- 最近更新
- 2026-10-23
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- new-project
- hooks
- { "PostToolUse": [ { "hooks": [ { "type": "command", "command": "python3 $CLAUDE_PROJECT_DIR/.claude/hooks/validators/skills/new_project_prd.py" } ], "matcher": "Write" } ] }
- description
- Initialize a new or existing project with Claude Forge — PRD, ADR seeds, populated reference docs (01-09), and a seeded task registry. Use when starting a project, bootstrapping project docs, or adding the framework to an existing codebase. NOT for adding a single feature (/new-feature) or upgrading framework versions (/migrate).
02 资源文件 3
- 参考文档DOCS.md3.0 KB
- 参考文档EXAMPLE.md4.0 KB
- 参考文档SEEDING.md4.0 KB
03 SKILL.md 正文
New Project Skill
Take a project from idea (or existing code) to a working Forge state: PRD, ADRs, populated 4-tier reference docs, and the PRD's work seeded into the forge task registry (docs/tasks/registry.json, the one task system, drained by /run-epic) so /reflect resume T001 can start immediately.
Flow: Setup → Discovery → PRD → CONFIRM #1 → ADRs → reference docs → CONFIRM #2 → task seeding → summary.
Index
| File or section | Read when… |
|---|---|
DOCS.md |
Phases 2–5, 8 — discovery checklist, PRD/ADR Task-tool prompts, reference-doc source map, summary template |
SEEDING.md |
Phase 6 — proposed-tasks table, registry skeleton JSON, epic add / task add examples, category codes |
EXAMPLE.md |
First greenfield run, or a run stalled (PRD stuck, cancelled, half-seeded registry) |
| See Also (bottom) | Templates and neighbouring skills this one hands off to |
Modes
/new-project "project description" # Greenfield — interview the user, then build docs
/new-project --current # Existing codebase — read the code FIRST, confirm findings, then build docs
--current rule: discovery starts by reading the codebase (dependency files, structure, commands, docs, CI config) and presents detected stack, name, conventions and entry points for user confirmation before writing anything. The PRD reflects current state + planned enhancements; reference docs describe what the code actually is.
Confirmation Points (exactly two)
- After Discovery + PRD — user reviews the PRD before architecture work builds on it.
- Before task seeding — user reviews the proposed epic/task breakdown before the registry is written.
No other ceremony or checkpoint banners.
Phase 1 — Setup (quick, mostly idempotent)
- Verify the framework is installed (
.claude/withscripts/forge/forge.pypresent). If not, stop and point atinstall.sh— installation is not this skill's job. - Placeholder
CLAUDE.md→ populate fromtemplates/CLAUDE.template.md. Fill Verifying your work from commands the repo actually runs, each run once to record its healthy output line (quiet reporters). A command you could not run stays a bracketed placeholder, never guessed. - Ensure
.claude/memories/{sessions/active,sessions/completed},progress-notes.md,general.mdanddocs/project-memory/exist. git init+ initial commit if not already a repo.
Existing docs/prd.md or populated registry → re-run: report what exists, offer to resume from the first gap.
Phase 2 — Discovery
Ask targeted questions. Greenfield: interview the user. --current: confirm what the code says; ask only what it can't answer.
Cover what, who (and who is NOT a user), stack, constraints and data sensitivity (checklist: DOCS.md), plus:
- Privacy — ask verbatim: "Does this handle personal data, children's data, or health data?" → if yes, flag
rules/privacy.mdas an active directive for all subsequent work on this project and record the answer in the PRD's constraints.
Capture explicit non-goals — Out of Scope keeps task seeding honest. 4-8 questions is normal; don't re-ask what's answered.
Phase 3 — PRD
Generate docs/prd.md from templates/prd.md.
- Keep the four
##sections the validator requires: Vision, Goals, User Stories, Success Criteria (alternative headers accepted — seehooks/validators/skills/new_project_prd.py). The validator fires on every Write while this skill is active and reports missing sections asadditionalContext, not by blocking; read it and act on it. - Fill Non-Goals / Out of Scope from Discovery. Record the privacy answer under constraints.
docs/prd.mdis a Tier 2 master document — downstream docs defer to it.
For substantial projects, delegate drafting to project-manager via the Task tool (prompt: DOCS.md); write it inline for small ones.
CONFIRM #1: present the PRD summary (goals, personas, story count, non-goals); user approves or amends before anything builds on it.
Phase 4 — ADR Seeds
For each real stack/architecture choice the PRD implies, seed an ADR from templates/adr-template.md into .claude/reference/06-architecture-decisions.md (Nygard shape: Status / Context / Decision / Consequences / Alternatives). Seed only decisions actually being made (frontend, API style, database, auth, deploy target).
An ADR with an empty Context is worse than no ADR — if the choice is genuinely open, record it as a TODO(user) in reference/02 instead of fabricating a decision. For multi-service or unfamiliar-stack projects, delegate to architect (prompt: DOCS.md).
Security review (conditional): if the project involves auth, payments, sensitive/personal data, or compliance requirements, have @security-boss review the auth/data ADRs — validate token/session strategy, define the threat model (assets / actors / vectors / mitigations) in reference/08-security-model.md, and update reference/03-security-auth-and-access.md. Unmitigated concerns get flagged to the user, not buried.
Phase 5 — Populate Reference Docs (4-tier)
For each reference/0N-*.template.md (01-09):
- Copy to the active name (drop
.template), then delete the.template.mdoriginal — only active documents remain, so templates and content never get confused. - Populate from the PRD, ADRs, and (in
--currentmode) the codebase — per-doc sources in DOCS.md. - Honest TODO markers where the user must decide: write
TODO(user): <the specific open question>— never invent content to make a doc look finished. A visible gap is recoverable; fabricated "truth" in a Tier 2 doc poisons every later session, because Tier 2 wins conflicts.
Phase 6 — Task Seeding
Break the PRD into epics (typically 2-5) and atomic tasks. Seed the tasks the PRD actually implies — typically 10-30 for a real MVP; no count floors. Each task must fit one session; split anything bigger and wire the pieces with --deps.
CONFIRM #2: present the proposed breakdown (ID / Epic / Name / Deps / Scope table — SEEDING.md) BEFORE writing anything. User approves or edits. Then, in this order:
- Create the registry skeleton — the forge CLI errors if
docs/tasks/registry.jsondoesn't exist. Authoring the empty skeleton (settings only, JSON in SEEDING.md) is the one sanctioned hand-write. - Create each epic via
forge epic add— before its tasks;forge task addraisesEpicNotFoundfor an epic that isn't in the registry. Then enrich each generated body (## Summary,## Tasks); edit body sections only — the frontmatter belongs to forge. - Add each task via
forge task add— never hand-edit the registry for tasks. Do NOT pass--no-file. Fill--scope-dirs/--scope-fileshonestly (they power lock-time conflict detection);--isafor E3+ tasks; no circular dependencies. Examples and flag notes: SEEDING.md. - Fill in task bodies — objective, requirements, acceptance criteria from the PRD breakdown. Edit the body only; never hand-set frontmatter
status:(the consistency-banner hook reverts it to the registry). - Verify before declaring done:
forge task lsshows every task,forge task ls --readyis non-empty, and every registryfilepath exists on disk (forge task reconcile-fileswith no flag dry-runs the check).
Use --category (codes in SEEDING.md) for priority ordering — security/data first, polish last; no per-category quotas.
Phase 7 — Optional Specialist Scaffold
If the project has a deep recurring domain (a specific WMS, a proprietary API, a design system), offer python3 .claude/scripts/forge/forge.py specialist add <name> --domain "...". Skip silently if no domain warrants one.
Phase 8 — Summary + Next Step
Present a compact summary (template: DOCS.md) ending Next: /reflect resume T001. Commit everything (docs/, .claude/reference/, registry, epic/task files) with a clear message, e.g. chore: initialize project — PRD, ADRs, reference docs, task registry.
Key Rules
- One task system. The forge registry is the only tracker — no feature database, no parallel lists, no per-task TodoWrite mandates.
See Also
templates/prd.md,templates/adr-template.md,templates/task.md,templates/isa.md(epic bodies come fromforge epic add, not a template)/reflect(resume seeded tasks),/run-epic(drain an epic),scripts/forge/forge.py(task-state CLI)
Project-specific overrides: if SKILL.local.md exists in this directory, read it — it is consumer-owned, survives framework refresh, and wins on conflict. A sidecar that relaxes a gate defined above must state how to prove the gate is wrong in that case. Doctrine: rules/framework-vs-project-root.md.
04 同仓库更多 Skills
wizard
Generates an interactive bash wizard that walks a human through steps only they can perform — opens each URL, says what to click and copy, captures values (hidden entry for secrets), writes .env and GitHub secrets, confirms before irreversible actions. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
vet-idea
Vets an idea, decision, or plan BEFORE it is built. Runs a single model through five fixed adversarial advisor roles, a peer-review pass, and a chairman synthesis that emits a halt-capable GO / NO-GO / RECONSIDER verdict. Advisory and non-mutating — outputs a report, never writes task state. Use when an idea, feature, or costly hard-to-reverse decision is of uncertain worth and the question is whether to build it at all. NOT FOR settled work (bug fixes, approved features) or for shaping how to build it (the ISA Interview workflow).
triage-incident
Production incident triage — from "something is broken for users" to fixed, verified, and learned-from. Pulls the error signal (Sentry/logs/user report), reproduces before touching code, routes the fix through /fix-bug's prod fast path, and closes with a postmortem entry. Use when something is broken for users in production — an outage, data corruption, a Sentry spike, or a crash-rate alert. NOT FOR bugs found in development (use /fix-bug directly) or CI failures (use /diagnose-ci).
setup-review-bot
Configures a repo's AI code reviewers — the post-PR mention bot and the pre-push local reviewer — and writes the AGENTS.md the reviewers read. Interviews the user for what the reviewer should weight, then sets git config forge.reviewBot / forge.localReview and populates AGENTS.md at the project root. Use when a repo has no reviewer configured, when review findings are consistently off-target, or when onboarding a new project.
security-review
Portable security review for a feature, endpoint, or change before it ships. Orchestrates the existing OWASP review (@security-boss) and secrets scan (security_secrets validator), then adds the pass they miss — an explicit business-logic-flaw walkthrough (IDOR, race/TOCTOU, state-machine bypass, privilege escalation, price/quantity tampering). Advisory and non-mutating — produces a findings report; real findings are filed as tasks. Use when a change touching money, access control, or multi-step state is about to ship, or when the auth looks fine but the flow could be abused. NOT FOR SAST or dependency-CVE scanning (consumer CI owns those).
run-epic
Autonomously drains every open task in a single epic. Pulls ready tasks via the forge CLI, executes the work in-context using the matching discipline (fix-bug / new-feature / refactor), files newly-discovered work as follow-up tasks without stopping to ask, opens a PR per completed task via /create-pr, and repeats until the epic has zero ready/in-progress/pending tasks. Use when the user says `/run-epic E##`, "run epic autonomously", "finish all remaining tasks for epic X", or "drive epic X to completion".