Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .ai-rules/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- **Clarification Phase** for PLAN mode (`rules/clarification-guide.md`)
- Optional phase triggered when AI detects ambiguous requirements
- Sequential Q&A with progress indicator (Question N/M format)
- Multiple-choice questions preferred for easy response
- Ambiguity assessment checklist (6 categories, triggers on 2+ unclear)
- Question count guidelines (2-7 questions based on complexity)
- Korean/English output format support
- Updated `rules/core.md` with Clarification Phase section

### Planned
- Real-world usage testing across all 6 AI tools
- Performance metrics collection
Expand Down
10 changes: 9 additions & 1 deletion .ai-rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This directory contains shared coding rules and guidelines used across multiple
├── README.md # This file - overview and usage guide
├── rules/ # Common coding rules (AI-agnostic)
│ ├── core.md # Workflow modes (PLAN/ACT/EVAL), communication
│ ├── clarification-guide.md # Clarification Phase guidelines for PLAN mode
│ ├── project.md # Tech stack, architecture, project context
│ └── augmented-coding.md # TDD principles, code quality standards
├── agents/ # Specialist agent definitions (JSON)
Expand Down Expand Up @@ -40,10 +41,16 @@ All AI coding assistants share the same:
### 1. `rules/core.md` - Workflow & Communication

**Workflow Modes:**
- **PLAN**: Define implementation plan without making changes
- **PLAN**: Define implementation plan (includes optional Clarification Phase)
- **ACT**: Execute the plan and make code changes
- **EVAL**: Analyze results and propose improvements

**Clarification Phase (Optional in PLAN):**
- Triggers when AI detects ambiguous requirements (2+ unclear items)
- Sequential Q&A with progress indicator (Question N/M)
- Multiple-choice questions preferred for easy response
- See `rules/clarification-guide.md` for detailed guidelines

**Key Principles:**
- Start in PLAN mode by default
- Move to ACT when user types `ACT`
Expand Down Expand Up @@ -218,6 +225,7 @@ When rules conflict between common rules and tool-specific configurations:
## Further Reading

- **Workflow Details**: `rules/core.md`
- **Clarification Phase**: `rules/clarification-guide.md`
- **Project Setup**: `rules/project.md`
- **TDD & Quality**: `rules/augmented-coding.md`
- **Agent System**: `agents/README.md`
Expand Down
138 changes: 138 additions & 0 deletions .ai-rules/rules/clarification-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Clarification Question Guidelines

Guidelines for AI to generate contextual clarification questions during PLAN MODE.

---

## When to Start Clarification Phase

Start Clarification Phase when any of the following ambiguities are detected:

- **Scope unclear** - Which modules, components, or users are affected?
- **Priority ambiguous** - What is must-have vs nice-to-have?
- **Constraints not specified** - Technical or business limitations?
- **Edge cases undefined** - How to handle errors or exceptions?
- **Integration points unclear** - Relationship with existing systems?

**Skip Clarification Phase when:**
- Requirements are detailed and unambiguous
- User provides comprehensive specification document
- User explicitly requests: "Skip clarification" or "Just create the plan"

---

## Ambiguity Assessment Checklist

Use this checklist to determine if Clarification Phase is needed:

| Check | Question | If unclear → Ask about |
|-------|----------|------------------------|
| [ ] | Is the **scope** defined? (which files, modules, users) | Scope |
| [ ] | Are **priorities** clear? (must-have vs nice-to-have) | Priority |
| [ ] | Are **constraints** known? (tech stack, compatibility) | Constraints |
| [ ] | Are **edge cases** specified? (errors, empty states) | Expected Behavior |
| [ ] | Are **non-functional requirements** defined? (performance, security) | Non-functional |
| [ ] | Is **integration** with existing code clear? | Integration |

**Rule:** If 2+ items are unclear → Start Clarification Phase

---

## Question Format Rules

1. **Single Question** - Ask only ONE question per message
2. **Progress Indicator** - Show "Question N/M" format (estimate M, adjust as needed)
3. **Multiple-Choice First** - Provide A/B/C options when possible
4. **Custom Input** - Always allow user's own input option
5. **Language** - Follow agent's `communication.language` setting; if not set, detect from user's input language

### Question Count Guidelines

| Request Complexity | Recommended Questions |
|--------------------|----------------------|
| Simple feature | 2-3 questions |
| Standard feature | 3-5 questions |
| Complex feature | 5-7 questions |

**Best Practice:** Start with estimated count, adjust as conversation progresses. Avoid exceeding 7 questions.

---

## Question Categories

Use these categories as reference when generating questions. Adapt to specific context.

| Category | Focus Areas |
|----------|-------------|
| **Scope** | Feature boundary, affected modules, user roles |
| **Priority** | Core requirements vs optional features, MVP definition |
| **Constraints** | Technical limits, dependencies, compatibility, deadlines |
| **Expected Behavior** | Edge cases, error handling, default values |
| **Non-functional** | Performance, security, accessibility requirements |
| **Integration** | Existing code relations, data flow, API dependencies |

---

## Output Format

### During Clarification (English)

```markdown
## Clarification Phase

### Question 1/3

**[Category] clarification needed:**

[Question text adapted to context]

- **A)** [Option 1]
- **B)** [Option 2]
- **C)** [Option 3]

> Select your answer (A/B/C) or share your own input.
```

### During Clarification (Korean)

```markdown
## Clarification Phase

### 질문 1/3

**[카테고리]에 대한 확인이 필요합니다:**

[컨텍스트에 맞게 조정된 질문]

- **A)** [선택지 1]
- **B)** [선택지 2]
- **C)** [선택지 3]

> 답변을 선택해주세요 (A/B/C) 또는 다른 의견이 있으시면 말씀해주세요.
```

### After All Questions

```markdown
## 수집된 정보 요약

| 항목 | 결정 사항 |
|------|----------|
| 범위 | [사용자 선택] |
| 우선순위 | [사용자 선택] |
| 제약조건 | [사용자 선택] |
| ... | ... |

이 내용이 맞나요? 확인해주시면 PLAN 수립을 시작하겠습니다.
```

---

## Handling Special Cases

| Situation | Response |
|-----------|----------|
| User answers "I'm not sure" / "잘 모르겠어요" | Present default recommendation with rationale, ask for confirmation |
| User wants to skip a question | Note that AI will use best judgment, continue to next question |
| User provides unexpected answer | Acknowledge the input, incorporate into understanding, continue |
| User asks to skip all questions | Proceed to PLAN creation, note assumptions made |
38 changes: 38 additions & 0 deletions .ai-rules/rules/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,44 @@ PLAN → (user: ACT) → ACT → PLAN → (user: EVAL) → EVAL → Improved PLA
**Purpose:**
Create actionable implementation plans following TDD and augmented coding principles

---

### Clarification Phase (Optional)

**Purpose:**
Resolve ambiguous requirements through sequential Q&A before creating a plan.

**Trigger Condition:**
- AI assesses user request for ambiguity
- If unclear scope, constraints, priority, or expected behavior detected → Start Clarification Phase
- If requirements are already clear → Skip directly to Plan creation

**Phase Rules:**
1. **Single Question Rule** - Ask only ONE question per message
2. **Progress Indicator** - Display "Question N/M" format (estimate M, adjust as needed)
3. **Multiple-Choice First** - Provide A/B/C options whenever possible
4. **Custom Input Allowed** - Always allow "Other" option for user's own input
5. **Language Setting** - Follow agent's `communication.language` setting; if not set, detect from user's input language

**Question Flow:**
1. Analyze request → Identify ambiguous points → Estimate question count
2. Present Question 1/N (multiple-choice format)
3. Wait for user response
4. Continue until all clarifications complete
5. Summarize all collected information in a table
6. Get user confirmation ("Yes" / request modification)
7. Proceed to Plan creation with clarified requirements

**Skip Conditions:**
- User explicitly requests to skip: "Skip clarification" or "Just create the plan"
- Requirements are detailed and unambiguous
- User provides comprehensive specification document

**Reference:**
See `.ai-rules/rules/clarification-guide.md` for detailed question guidelines.

---

**What PLAN does (with Primary Developer Agent):**

1. **Analyze Requirements** (via Primary Developer Agent)
Expand Down
Loading