Identifies ambiguities in requirements and architecture through structured questions, helping clarify implementation plans before coding begins
Systematically identifies ambiguities in requirements and architecture through structured questions, helping clarify implementation plans before coding begins.
/plugin marketplace add mei28/claude-code/plugin install mei28-dig-dig@mei28/claude-codeBefore starting implementation, systematically identify ambiguities in requirements, architecture, and design through structured questions across multiple categories. This prevents wasted effort from unclear specifications.
Automatically read project context files to understand standards and conventions:
# Read project documentation and standards
Read CLAUDE.md
Read README.md
Read docs/architecture.md
Read docs/api-standards.md
Analyze the user's request to identify what information is present and what's missing.
Identify unclear points across these categories:
For each identified ambiguity, formulate specific questions with:
Present all questions organized by category for user to address.
Questions about system structure and design patterns:
Example Questions:
#### Architecture: Service Layer Structure
**Context**: The user authentication feature needs to interact with the database and external OAuth providers.
**Ambiguity**: How should the authentication service be structured?
**Options**:
1. Single AuthService with all logic
2. Separate services: AuthService, OAuthService, TokenService
3. Repository pattern with domain services
**Impact**: Affects testability, maintainability, and future extensibility
**Recommendation**: Based on CLAUDE.md preference for clean architecture, option 2 (separate services) is suggested for better separation of concerns.
**Question**: Which service structure do you prefer for the authentication feature?
Questions about data flow and state:
Example Questions:
#### Data: User Session State
**Context**: User authentication state needs to be accessible across the application.
**Ambiguity**: How should user session state be managed?
**Options**:
1. React Context API
2. Redux store
3. Zustand lightweight store
4. localStorage with custom hook
**Impact**: Affects bundle size, complexity, and developer experience
**Question**: What state management approach do you want for user sessions?
Questions about API design and external integrations:
Example Questions:
#### API: Endpoint Design
**Context**: New user profile update functionality needed.
**Ambiguity**: What should the API endpoint structure be?
**Options**:
1. PATCH /api/users/:id (partial update)
2. PUT /api/users/:id (full replacement)
3. POST /api/users/:id/update (RPC-style)
4. Multiple specific endpoints (e.g., /api/users/:id/email, /api/users/:id/name)
**Impact**: Affects API consistency and client implementation
**Recommendation**: Based on existing API using RESTful conventions, option 1 (PATCH) is most consistent.
**Question**: Should we follow the existing PATCH pattern or use a different approach?
Questions about user interface and experience:
Example Questions:
#### UI/UX: Error Display
**Context**: Form validation errors need to be shown to users.
**Ambiguity**: How should validation errors be displayed?
**Options**:
1. Inline below each field
2. Toast notification
3. Modal dialog
4. Summary at top of form
**Impact**: Affects user experience and accessibility
**Question**: What error display pattern do you prefer? (Consider existing patterns in the app)
Questions about testing strategy:
Questions about security and access control:
Questions about performance requirements:
Questions about deployment and monitoring:
Present findings in this structured format:
# Dig Analysis Report
## Summary
- Request: [User's original request]
- Context Files Read: CLAUDE.md, README.md, architecture.md
- Ambiguities Found: [Number] across [Number] categories
- Recommendations: [Number] based on existing standards
## Questions by Category
### Architecture & Design ([Number] questions)
#### 1. [Question Title]
**Context**: [Why this matters]
**Ambiguity**: [What's unclear]
**Options**:
1. [Option 1]
2. [Option 2]
...
**Impact**: [How this affects implementation]
**Recommendation**: [Suggested approach if clear from standards]
**Question**: [Specific question for user]
---
### Data & State Management ([Number] questions)
[Similar structure]
---
[Continue for all relevant categories]
## Next Steps
Once these questions are answered, I can:
1. Create a detailed implementation plan
2. Identify specific files to modify
3. Outline test requirements
4. Estimate implementation scope
Please answer the questions above, or let me know if you'd like to discuss any category in more detail.
Before Planning:
User: Add user authentication
Assistant: Let me use /dig to clarify requirements first
[Runs dig analysis]
[User answers questions]
Assistant: Now entering plan mode with clear requirements
With EnterPlanMode:
1. Run /dig to clarify ambiguities
2. User provides answers
3. Use EnterPlanMode with complete context
4. Implement with confidence
User: "Add a dark mode toggle to the application"
Dig Analysis:
# Dig Analysis Report
## Summary
- Request: Add dark mode toggle to application
- Context Files Read: CLAUDE.md, README.md, src/styles/theme.ts
- Ambiguities Found: 8 across 4 categories
- Recommendations: 3 based on existing theme system
## Questions by Category
### Architecture & Design (3 questions)
#### 1. Theme Management Architecture
**Context**: Application uses styled-components with a theme provider.
**Ambiguity**: How should dark mode be integrated with existing theme system?
**Options**:
1. Extend existing theme with dark variants
2. Create separate dark theme object
3. Use CSS variables for dynamic switching
**Impact**: Affects theme consistency and switching performance
**Recommendation**: Option 1 extends existing pattern in src/styles/theme.ts
**Question**: Should we extend the existing theme or create a separate dark theme?
#### 2. Persistence Location
**Context**: User preferences need to be saved.
**Ambiguity**: Where should dark mode preference be stored?
**Options**:
1. localStorage (client-side only)
2. User profile in database (synced across devices)
3. Both (localStorage with backend sync)
**Impact**: Affects user experience across devices
**Question**: Should dark mode preference sync across user's devices?
### UI/UX & User Interface (3 questions)
#### 3. Toggle Placement
**Context**: Application has a top navigation bar and settings page.
**Ambiguity**: Where should the dark mode toggle be located?
**Options**:
1. Top navigation bar (always visible)
2. Settings page only
3. Both locations
**Impact**: Affects discoverability and user convenience
**Question**: Where should users access the dark mode toggle?
#### 4. Transition Animation
**Context**: Instant theme switches can be jarring.
**Ambiguity**: Should there be a transition animation when switching modes?
**Options**:
1. Instant switch (no animation)
2. Fade transition (200-300ms)
3. Color transition on all elements
**Impact**: Affects perceived polish and performance
**Recommendation**: Existing animations use 200ms transitions
**Question**: Should mode switching be animated?
### Implementation Details (2 questions)
#### 5. Default Mode
**Context**: First-time users haven't set a preference.
**Ambiguity**: What should be the default theme mode?
**Options**:
1. Always light mode
2. Respect system preference (prefers-color-scheme)
3. Auto-detect based on time of day
**Impact**: Affects first impression for new users
**Recommendation**: Modern best practice is option 2 (system preference)
**Question**: Should we respect system dark mode preference by default?
## Next Steps
Once these questions are answered, I can:
1. Create implementation plan for theme system extension
2. Identify files to modify (theme.ts, ThemeProvider, etc.)
3. Design toggle component
4. Plan persistence implementation
5. Outline test cases
Please answer the questions above to proceed with implementation.
❌ Don't:
✅ Do:
EnterPlanMode: Use after dig analysis to create detailed plan/review: Code review after implementationAskUserQuestion: Can be used during dig analysis for immediate clarification