external/tgd-skills/tgd-rules/SKILL.md
Core tGD rules that MUST be followed at all times — the Verification Iron Law, per-phase tone, the Command Closing Report, and human sign-off. Load this at the start of every tGD session (the session-start meta-skill tgd-router points here) and whenever a command references it. Do not skip, do not rationalize exceptions.
npx skillsauth add seikaikyo/dash-skills tgd-rulesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Core rules that MUST be followed at all times in every tGD session. These rules enforce evidence-based verification, prevent rationalization, and maintain workflow integrity across all 7 lifecycle phases.
tgd-router, injected by the hook/plugin platforms) and the generated session preamble (Pi/Hermes) both direct you to load this skill first/tgd-* lifecycle commandsA collection of skills for Claude.ai and Claude Code for senior software engineers. Skills are packaged instructions and scripts that extend Claude and your coding agents capabilities.
Several commands run gate scripts that live in the tGD repo clone itself ($TGD_REPO_ROOT/scripts/…) — NOT in $TGD_DIR, which holds artifacts only. Resolve it once, in this order:
$TGD_REPO_ROOT, if set.~/tGD — the default clone location from the install instructions.python3 -c "import os;print(os.path.realpath(os.path.expanduser('~/.claude/skills/tgd-rules')))"
→ strip the trailing /skills/tgd-rules to get the repo root. (Codex/OpenCode/Gemini/Pi link the whole folder as skills/tGD — realpath it and strip /skills.)If none resolves to a directory containing scripts/generate-mirrors.py, STOP and tell the user the tGD clone can't be located — do NOT skip a gate because its script "wasn't found".
7 commands, each a full pipeline. Commands are defined in .claude/commands/, .gemini/commands/, .opencode/commands/, .codex/prompts/, and .pi/prompts/.
| Command | Phase | Pipeline | Artifacts |
|---------|-------|----------|-----------|
| /tgd-map | Map | tgd-context-engineering → codegraph init → understand (MANDATORY) | CONTEXT.md + .scans/<repo>/ |
| /tgd-define | Define | tgd-interview-me → tgd-idea-refine → tgd-spec-driven-development → tgd-sketch (if UI) | PRD.md · SPEC.md · DESIGN.md + prototype/ (if UI) — interview/ideation outputs are conversational and absorbed into PRD.md, not saved as files |
| /tgd-plan | Plan | tgd-planning-and-task-breakdown | TASKS.md (+ TRACKING-PLAN.md entries if PRD §6 names new events) |
| /tgd-develop | Develop | tgd-context-engineering → tgd-source-driven-development → (tgd-subagent-driven-development OR tgd-incremental-implementation) → tgd-test-driven-development → tgd-verification-before-completion | Code + Tests (on feature/<name> branch) |
| /tgd-verify | Verify | tgd-debugging-and-error-recovery → tgd-test-driven-development → tgd-agent-browser (if UI) | TEST-REPORT.md |
| /tgd-review | Review | tgd-code-review-and-quality → tgd-code-simplification (+ tgd-security-and-hardening, tgd-performance-optimization when relevant) | REVIEW.md · decisions/ADR-*.md (if architectural) |
| /tgd-release | Release | tgd-shipping-and-launch (+ tgd-ci-cd-and-automation, tgd-deprecation-and-migration, tgd-documentation-and-adrs when relevant) | CHANGELOG.md · REGRESSION-CATALOG.md (if [R] tasks) · METRICS.md (unless PRD §6 is signed-off N/A) |
All artifacts live under $TGD_DIR/<feature-name>/. See each command file for full pipeline steps, gates, and sign-off requirements.
If the user types a command, invoke it. If they use natural language, map their intent to the right skill automatically.
Use these commands in order. Do not skip phases:
/tgd-map → Understand the project/tgd-define → Write PRD + SPEC/tgd-plan → Break into tasks (Zero-Context Rule)/tgd-develop → Build with subagents or incremental/tgd-verify → Run all tests, prove it works/tgd-review → Code quality + simplification/tgd-release → Deploy with confidenceFor every request:
skill toolThese thoughts are WRONG. If you catch yourself thinking any of these, STOP and follow the rule instead:
| Rationalization | Reality | |---|---| | "This is too small for a skill" | It isn't. Check for a skill first. | | "I can just quickly implement this" | No. Follow the workflow. | | "Should work now" | RUN the verification. | | "I'm confident" | Confidence ≠ evidence. | | "Just this once" | No exceptions. Ever. | | "Looks correct to me" | Visual inspection ≠ verification. | | "Tests passed last time" | Run them again, fresh. | | "I'm tired" | Exhaustion ≠ excuse. | | "The user is waiting" | Lying is worse than delay. | | "I can't spawn a subagent, so I'll skip this step" | Subagents move where work runs, never whether it runs. If you can't delegate, do it inline. Skipping is a verification failure, not a degraded mode. |
Correct behavior:
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
Before claiming any work is complete, fixed, or passing:
| ❌ Forbidden | ✅ Required |
|---|---|
| "Should pass now" | npm test → "34/34 pass" |
| "Looks correct" | git diff → show actual changes |
| "I'm confident" | Run command, show exit 0 |
| "Tests pass" (without running) | Run tests THIS message, show output |
| "Done! before verification" | Verification output FIRST, then "Done!" |
This is non-negotiable. Violating the letter of this rule is violating the spirit.
MANDATORY SELECTION PROTOCOL (All Platforms) When you need the user to pick an option (Feature Name, Design Variant, etc.), DO NOT use open-ended questions. ALWAYS provide a numbered/bulleted list and ask the user to reply with the number or letter.
| Context | Bad Question | Good (Selection Protocol) |
|---|---|---|
| Naming | "What should we name this feature?" | "Pick a name: 1. user-login 2. auth-flow 3. sign-in-module (or type your own)" |
| Design | "Which design do you like?" | "Pick a direction: A (Conservative), B (Strong-fit), C (Divergent)" |
| UI Gate | "Is this a UI feature?" | "Does this feature have a UI component? 1. Yes (Generate design) 2. No (Backend only)" |
This ensures the user can reply with a simple "1" or "B" instead of typing a paragraph.
Before saying "done", "complete", or "fixed":
Each lifecycle phase has a distinct communication tone. Follow these when responding during that phase.
| Phase | Tone | Characteristics | Example |
|-------|------|-----------------|---------|
| MAP | Technical Analyst | Precise, objective, data-driven | "CodeGraph shows 42 modules across 3 packages. Entry points: main.ts, cli.ts" |
| DEFINE | Guided Explorer | Question-heavy, option-based, no assumptions | "Which scenario fits? 1. User auth 2. API key 3. OAuth SSO" |
| PLAN | Structured List-maker | Task-oriented, clear boundaries, verifiable | "Task 1: Create schema → Verify: npm test passes" |
| DEVELOP | Minimal Implementer | Code-first, minimal prose | "Modified src/auth.ts:42. Running tests..." |
| VERIFY | Strict Zero-Tolerance | Evidence-only, no hedging | "Tests failed: 3/34. Exit code 1. Must fix." |
| REVIEW | Critical Constructive | Problem + solution paired | "Line 45 has race condition. Suggest mutex." |
| Release | Cautious Process | Checklists, risk assessment | "Pre-deploy: ✅ tests ✅ build ⚠️ migration pending" |
Rules:
End every lifecycle command with a short, scannable summary — it is the part the human actually reads. Do not paste the raw - [ ] Verification Gate checklist at them; that is your self-check, not a report. Collapse it. Three parts:
✅ 全數通過 or ❌ N 項未過. List individual checks only when they failed, one line each with the concrete reason.❌ … 未通過.Suggested shape (adapt it; this is guidance, not a rigid template):
✅ /tgd-verify 完成
📦 產出 TEST-REPORT.md — 142 passed / 0 failed, coverage 87%
🔎 檢查 ✅ 全數通過(tests · coverage · ac-trace · regression-gate)
➡️ 下一步 /tgd-review — 檢查程式碼品質
/tgd-map's Step 8 Final Report is the fuller, enforced instance of this same shape.
tGD has three human roles. Each artifact has a ## Sign-off section at the bottom — review results live inside the artifact, not in a separate file.
| Role | Focus | Primary Touchpoints | |------|-------|---------------------| | PM | Product direction & acceptance | Define (PRD.md), Release (final sign-off) | | DEV | Implementation quality | Plan (TASKS.md), Develop (code), Review | | QA | Test quality & coverage | Verify (TEST-REPORT.md), Review (REVIEW.md) |
Sign-off rules:
## Sign-off section- [x] **PM**: Approved — YYYY-MM-DD — comment- [x] **PM**: Rejected — YYYY-MM-DD — reason[x] **ROLE**: Approved line format is RESERVED for ## Sign-off sections. In-document approvals elsewhere (e.g. the PRD §6 metrics N/A sign-off) MUST use different wording (Approved N/A — PM (name), date — reason) — /tgd-release's gate reads only the ## Sign-off section, and reserving the format keeps any sign-off search unambiguous[x] in required role lines before proceeding (Gate 3)[x]Async workflow: Agent runs all phases but blocks at Release until sign-offs are complete. Humans review on their own schedule — no real-time blocking.
This repo has three composable layers. They have different jobs and should not be confused:
skills/<name>/SKILL.md) — workflows with steps and exit criteria. The how. Mandatory hops when an intent matches.agents/<role>.md) — roles with a perspective and an output format. The who..claude/commands/*.md) — user-facing entry points. The when. The orchestration layer.Composition rule: the user (or a slash command) is the orchestrator. Personas do not invoke other personas. A persona may invoke skills.
The only multi-persona orchestration pattern this repo endorses is parallel fan-out with a merge step — used by /tgd-review (mandatory for high-stakes features) to run code-reviewer, security-auditor, and test-engineer concurrently and synthesize their reports into REVIEW.md. Do not build a "router" persona that decides which other persona to call; that's the job of slash commands and intent mapping.
See agents/README.md for the decision matrix and references/orchestration-patterns.md for the full pattern catalog.
Claude Code interop: the personas in agents/ work as Claude Code subagents (auto-discovered from this plugin's agents/ directory) and as Agent Teams teammates (referenced by name when spawning). Two platform constraints align with our rules: subagents cannot spawn other subagents, and teams cannot nest. Plugin agents silently ignore the hooks, mcpServers, and permissionMode frontmatter fields.
.codegraph/ exists in project root)If the project has a .codegraph/ directory, USE IT. These commands are fast (< 1s) and prevent blind spots:
| Situation | Command | Why |
|---|---|---|
| Starting any code task | codegraph context "<task>" --no-code | Find entry points before touching files |
| Before changing a function | codegraph callers "<symbol>" | Know who depends on it |
| Before refactoring | codegraph impact "<symbol>" | Assess blast radius |
| Before committing | codegraph affected <changed files> | Run only relevant tests |
If .codegraph/ does NOT exist, skip silently. Do not suggest installing it unprompted.
understand skill is available)For deeper architectural understanding, especially on unfamiliar codebases:
| PDLC Phase | Situation | Command | Why |
|---|---|---|---|
| 🗺️ Map | First time exploring a project | understand skill | Build full knowledge graph + dashboard |
| 📐 Define | Need business domain mapping | understand-domain skill | Map code to business processes |
| 📋 Plan | Planning a large refactor | understand-diff skill | Visualize impact of proposed changes |
| 🔨 Develop | Working on unfamiliar code | understand skill | Understand before you modify |
| 🔍 Verify | Confirming change impact | understand-diff skill | Verify no missed dependencies |
| 👀 Review | Reviewing large changes | understand-diff skill | Full blast radius before approval |
| 🗺️ Map | Onboarding a new team member | understand-onboard skill | Guided tour of the architecture |
Use CodeGraph for fast symbol queries, Understand-Anything for deep comprehension. They complement each other.
development
拋棄式 HTML mockup 比稿:產出 2 到 3 個設計立場不同的變體(密度 / 版式 / 強調軸,不是換色),各附取捨說明,最後給有立場的對比結論。適用:「畫個草圖」「比較 A 版 B 版」「先看方向再做」「給我看幾種做法」。要 production 元件或設計已定案時不適用。
tools
需求不明時的意圖萃取訪談:一次一題、每題附上自己的猜測、聽出「真正想要 vs 覺得應該要」,直到能預測使用者反應(約 95% 信心)才動工。適用:需求缺少對象 / 動機 / 成功標準 / 約束,或使用者點名「訪談我」「先確認一下」「我們確定嗎」。明確自足的指示、純資訊查詢、機械性操作不適用。
development
對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。
testing
Reference for writing and editing agent skills well — the vocabulary and principles that make a skill predictable. Consult when authoring, reviewing, or pruning a SKILL.md.