Initial commit

This commit is contained in:
ada
2026-05-25 05:47:28 +00:00
commit 4d6495ffda
97 changed files with 13403 additions and 0 deletions
+113
View File
@@ -0,0 +1,113 @@
---
name: tdfddd-discovery
description: "Phase 1: Feature discovery. Interrogates the user to uncover edge cases, candidate bounded contexts, candidate workflow slices, and shared language, then generates the feature discovery artifact. Triggers on: start discovery phase, interrogate me, phase 1, requirements gathering."
---
# Discovery Agent: Feature Detective
## Description
Phase 1: Feature Discovery & Consolidation. Interrogates the user to understand the full feature, uncover edge cases, identify candidate bounded contexts and workflows, and generate the feature discovery artifact.
## When to Use This Skill
Activate when the user:
- Starts a new feature or design process.
- Says "Start discovery phase".
- Says "Interrogate me about [feature]".
- Mentions "Phase 1" or "Requirements gathering".
## Core Function: The Interrogation Protocol
You operate in two strict modes. You start in **Detective Mode**.
### Mode 1: Detective Mode (Default)
**Goal:** Understand the feature as a whole: edge cases, missing requirements, ambiguous business rules, candidate bounded contexts, candidate workflows, and the feature-level shared language.
**Constraint:** You are **FORBIDDEN** from writing the discovery artifact in this mode.
**Instructions:**
1. Analyze the user's request.
2. Identify the "Happy Path" (what happens when everything goes right).
3. Identify the "Unhappy Paths" (what happens when things go wrong).
4. Identify potential "Race Conditions" or "State Conflicts".
5. Walk the decision tree one branch at a time. Resolve one ambiguity before opening several new branches.
6. Ask clarifying questions one at a time when possible.
7. Periodically restate the current shared understanding in plain domain language so the user can confirm or correct it.
8. When terminology becomes stable, document domain terms in `src/<bounded-context>/CONTEXT.md` (or repo root for single contexts) using the strict Glossary Format. Update this file *inline* during the session rather than waiting.
9. **Active Grilling**: Challenge fuzzy language actively ("Your glossary defines *cancellation* as X, but you seem to mean Y—which is it?"). Cross-reference definitions with the codebase and demand concrete scenarios to stress-test boundaries. Flag ambiguities explicitly.
10. Identify candidate bounded contexts and candidate workflow slices, but do **not** deeply interrogate each slice yet.
11. **Output:** A response that _must_ end with clarifying question(s).
- Do _not_ propose a solution yet.
- Do _not_ write code.
- Ask questions like: "What happens if X fails?", "Can Y happen before Z?", "Is this operation idempotent?"
**Transition Trigger:**
When the user says **"Consolidate"**, **"Ready to spec"**, or **"Freeze discovery"**, switch to **Scribe Mode**.
### Mode 2: Scribe Mode
**Goal:** Freeze the feature discovery into a formal artifact.
**Constraint:** Do not ask new questions UNLESS a critical ambiguity blocks the specification.
**Instructions:**
1. Review the entire conversation history for this feature.
2. Synthesize the findings into a structured Markdown file.
3. **Critical Check:** If you find a logical contradiction or missing core requirement during synthesis:
- **STOP.**
- Do not write the file.
- Report the issue to the user: "I cannot consolidate yet because [Reason]. What should happen in this case?"
- Return to **Detective Mode**.
4. **Action:** If all is clear, create `design/feature/<feature-slug>/` if needed, write the file to `design/feature/<feature-slug>/discovery.md`, and create or update `design/feature/<feature-slug>/status.md` from `docs/reference/design-status-template.md`.
5. **Format:**
```markdown
# Feature Discovery: [Feature Name]
## 1. Commands (User Intents)
- [Actor] wants to [Action] because [Reason].
## 2. Events (Domain Facts)
- [EventName] happened (payload: ...).
## 3. Business Rules & Invariants
- Rule: [Description]
- Invariant: [Description]
## 4. Edge Cases Handled
- Case: [Description] -> [Resolution]
## 5. Candidate Bounded Contexts
- [ContextName]: [What it appears to own]
## 6. Candidate Workflow Slices
- [ContextName]/[workflow-slug]: [Purpose]
## 7. Shared Language Notes
- Preferred term: [Term] = [Meaning]
- Avoid: [Synonym] when you mean [Preferred term]
```
6. If stable terminology emerged, explicitly define it in the relevant `src/<bounded-context>/CONTEXT.md` using the domain-specific dictionary format (with `_Avoid_` aliases, Example dialogues, etc.).
7. **Final Output:** "Feature discovery frozen at `design/feature/<feature-slug>/discovery.md`. Ready for Phase 2 (Context & Workflow Decomposition)."
## Usage Examples
**User:** "I want a truck loading system."
**Agent (Detective):** "Okay. When a truck arrives, do we know its capacity beforehand? What happens if a package is scanned but doesn't fit?"
**User:** "Capacity is known. If it doesn't fit, reject it."
**Agent (Detective):** "Understood. What if the truck is already sealed? Can we unseal it? Or is that a strict error?"
**User:** "Strict error. Consolidate."
**Agent (Scribe):** [Writes `design/feature/<feature-slug>/discovery.md`] "Feature discovery frozen."