/tGD:tgd-definefrom tGD
Start spec-driven development — write a structured specification before writing code
Ships in tGD. Installing the plugin adds it to Claude Code.
🛑 Pre-flight: Environment Check
$TGD_DIR/CONTEXT.md exists (or .codegraph/ is present)./tgd-map first."tGD/ symlink in project root. If missing, check $TGD_DIR env var. If neither exists: STOP — run /tgd-map first.Run the spec-driven-development skill. Write a PRD (product requirements document) covering objectives, commands, structure, code style, testing strategy, and boundaries before any code is written.
This is the DEFINE phase. The full pipeline is:
Feature Name Resolution (Selection Protocol) — Analyze the user's request first. Extract the core action + object (e.g., "user login" → action: login, object: user). Then propose 3 distinct kebab-case <feature-name> options that directly reflect the user's intent:
user-login)authenticate-user)auth-flow)Wait for the user to select one by number or provide their own before proceeding. Once locked, create $TGD_DIR/<feature-name>/.
🌿 Git Branch Setup — If on main/master, create and switch to feature/<feature-name> (git checkout -b feature/user-login).
interview-me — if the ask is underspecified, extract what the user actually wants
idea-refine — if the concept is vague, stress-test and expand options
spec-driven-development — write the structured spec (PRD + SPEC)
Multi-Repo Tagging: If CONTEXT.md lists multiple repos, SPEC.md MUST be tagged by repo:
## Backend (my-project-backend)
### API Contracts
- POST /api/auth/login → ...
## Frontend (my-project-frontend)
### Components
- LoginForm.tsx → ...
Each section header uses ## <repo-name> so tasks can be traced to their target repo.
Phase 1.5: UI Design Gate (MANDATORY CHECK via Selection Protocol) After writing SPEC.md, you MUST ask the user: "Does this feature have a UI component requiring DESIGN.md?" Format: "1. Yes (Generate design) 2. No (Backend only)"
sketch skill to generate 2-3 HTML prototype variants in $TGD_DIR/<feature-name>/prototype/Use interview-me first if the ask is underspecified. Use idea-refine if you have a rough concept but it's not concrete yet.
After completing the spec, verify the outputs.
Verification Gate:
$TGD_DIR/ directory exists$TGD_DIR/<feature-name>/PRD.md exists and is non-empty$TGD_DIR/<feature-name>/SPEC.md exists and is non-emptyfeature/<feature-name>$TGD_DIR/<feature-name>/DESIGN.md exists with Component Tree$TGD_DIR/<feature-name>/prototype/ contains at least 2 HTML variantsIf verification passes, suggest the next step: /tgd-plan to decompose it into tasks.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
7 commands in this plugin
/tgd-developTgd DevelopDevelop — implement with fresh subagents per task and two-stage review/tgd-mapStep 1: Context DiscoveryMap — scan and understand the existing project context before making changes/tgd-planTask 1: [my-project-backend] Create auth endpointPlan — decompose specs into small, verifiable tasks with acceptance criteria/tgd-reviewTgd ReviewReview before merge — improve code health/tgd-shipTgd ShipShip to production — faster is safer/tgd-verifyTgd VerifyVerify — prove it works with debugging and test pyramidnpx claudepluginhub openclawyhwang-hub/tgd-agent --plugin tGD