From cfec67dc28decb5f4eb01006fa2482c379e53c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Gana=20Obreg=C3=B3n?= Date: Fri, 27 Mar 2026 23:01:48 +0000 Subject: [PATCH] feat(sdd): implement spec-to-tracker bridge and root tracker id generation (#23802) --- .../builtin/sdd/commands/spec/create.toml | 12 +++++++++--- .../builtin/sdd/commands/spec/setup.toml | 14 ++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/core/src/extensions/builtin/sdd/commands/spec/create.toml b/packages/core/src/extensions/builtin/sdd/commands/spec/create.toml index bc6fc7cd43..cccfe7f9d9 100644 --- a/packages/core/src/extensions/builtin/sdd/commands/spec/create.toml +++ b/packages/core/src/extensions/builtin/sdd/commands/spec/create.toml @@ -137,12 +137,18 @@ PLAN MODE PROTOCOL: Parts of this process run within Plan Mode. While in Plan Mo ### 2.4 Create Spec Artifacts and Update Main Plan 1. **Check for existing spec name:** Before generating a new Spec ID, resolve the **Spec Directory** by reading `.gemini/specs/index.md`. List all existing spec directories in that resolved path. Extract the short names from these spec IDs (e.g., ``shortname_YYYYMMDD`` -> `shortname`). If the proposed short name for the new spec (derived from the initial description) matches an existing short name, halt the `newSpec` creation. Explain that a spec with that name already exists and suggest choosing a different name or resuming the existing spec. -2. **Generate Spec ID:** Create a unique Spec ID (e.g., ``shortname_YYYYMMDD``). -3. **Create Directory:** Create a new directory for the specs: `//`. -4. **Create `metadata.json`:** Create a metadata file at `//metadata.json` with content like: +2. **Generate Spec ID:** Create a unique Spec ID (e.g., `shortname_YYYYMMDD`). +3. **Generate Root Tracker ID:** Use the `tracker_create_task` tool to create a root task for this spec. + - **type:** `epic` + - **title:** A concise but highly descriptive title summarizing the spec (e.g., "Feature: Implement User Authentication Flow"). + - **description:** A detailed explanation of the spec's purpose and scope, providing context beyond the title. + - **Record the returned Task ID** (this is the `root_tracker_id`). +4. **Create Directory:** Create a new directory for the specs: `//`. +5. **Create `metadata.json`:** Create a metadata file at `//metadata.json` with content like: ```json { "spec_id": "", + "root_tracker_id": "", "type": "feature", // or "bug", "chore", etc. "status": "new", // or in_progress, completed, cancelled "created_at": "YYYY-MM-DDTHH:MM:SSZ", diff --git a/packages/core/src/extensions/builtin/sdd/commands/spec/setup.toml b/packages/core/src/extensions/builtin/sdd/commands/spec/setup.toml index c4d6510a91..65891c7570 100644 --- a/packages/core/src/extensions/builtin/sdd/commands/spec/setup.toml +++ b/packages/core/src/extensions/builtin/sdd/commands/spec/setup.toml @@ -517,11 +517,17 @@ PLAN MODE PROTOCOL: This setup process runs entirely within Plan Mode. While in - **CRITICAL: Inject Phase Completion Tasks.** You MUST read the `.gemini/specs/workflow.md` file to determine if a "Phase Completion Verification and Checkpointing Protocol" is defined. If this protocol exists, then for each **Phase** that you generate in `plan.md`, you MUST append a final meta-task to that phase. The format for this meta-task is: `- [ ] Task: SDD - User Manual Verification '' (Protocol in workflow.md)`. You MUST replace `` with the actual name of the phase. c. **Create Spec Artifacts:** i. **Generate and Store Spec ID:** Create a unique Spec ID from the spec description using format `shortname_YYYYMMDD` and store it. You MUST use this exact same ID for all subsequent steps for this spec. - ii. **Create Single Directory:** Resolve the **Spec Directory** by reading `.gemini/specs/index.md` and create a single new directory: `//`. - iii. **Create `metadata.json`:** In the new directory, create a `metadata.json` file with the correct structure and content, using the stored Spec ID. An example is: + ii. **Generate Root Tracker ID:** Use the `tracker_create_task` tool to create a root task for this spec. + - **type:** `epic` + - **title:** A concise but highly descriptive title summarizing the spec (e.g., "Feature: Implement User Authentication Flow"). + - **description:** A detailed explanation of the spec's purpose and scope, providing context beyond the title. + - **Record the returned Task ID** (this is the `root_tracker_id`). + iii. **Create Single Directory:** Resolve the **Spec Directory** by reading `.gemini/specs/index.md` and create a single new directory: `//`. + iv. **Create `metadata.json`:** In the new directory, create a `metadata.json` file with the correct structure and content, using the stored Spec ID. An example is: - ```json { "spec_id": "", + "root_tracker_id": "", "type": "feature", // or "bug" "status": "new", // or in_progress, completed, cancelled "created_at": "YYYY-MM-DDTHH:MM:SSZ", @@ -530,8 +536,8 @@ PLAN MODE PROTOCOL: This setup process runs entirely within Plan Mode. While in } ``` Populate fields with actual values. Use the current timestamp. - iv. **Write Spec and Plan Files:** In the exact same directory, write the generated `spec.md` and `plan.md` files. - v. **Write Index File:** In the exact same directory, write `index.md` with content: + v. **Write Spec and Plan Files:** In the exact same directory, write the generated `spec.md` and `plan.md` files. + vi. **Write Index File:** In the exact same directory, write `index.md` with content: ```markdown # Spec Context