Skip to content

Commit 3b7139d

Browse files
committed
feat: improve interactive input
1 parent 33919a6 commit 3b7139d

File tree

4 files changed

+128
-37
lines changed

4 files changed

+128
-37
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ Want just the essentials? Copy these:
5858
- **Windsurf**: Copy `.windsurf/` folder
5959
- **Kiro**: Copy `.kiro/` folder
6060

61-
### Activation
62-
After copying files, **start a new chat** in your editor. The rules activate automatically.
61+
### Rule Activation
62+
- Close and reopen project (optional but recommended)
63+
- Start a new chat
64+
- Prompt your agent to "Read workspace rules"
65+
66+
**First Time Expectation:** Once rules are read, the user persona creation workflow should be triggered to create your `user-persona.spec.md`
6367

6468
## 👤 User Persona System
6569

rules/interactive-input.rules.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,56 @@ echo "Rate: 100%, %d items, %s status. Choice: "
144144

145145
---
146146

147-
## 🔧 OPERATING SYSTEM DETECTION
147+
## 🔍 CRITICAL DISTINCTION: DISPLAY TEXT vs INTERACTIVE INPUT
148+
149+
**AGENTS MUST UNDERSTAND THE DIFFERENCE:**
150+
151+
### 📺 DISPLAY-ONLY TEXT
152+
**Purpose**: Show information, status, or messages WITHOUT expecting user input
153+
**Format**: Simple `echo` commands
154+
**Requirements**:
155+
- **MANDATORY**: Must end with "Press Enter to continue" or "Type what you'd like to change"
156+
- **MANDATORY**: Must use `read` to wait for user acknowledgment before proceeding
157+
- **NO INPUT CAPTURE**: User response is not stored or processed
158+
159+
**EXAMPLE - DISPLAY ONLY** (DO NOT EXECUTE - FOR REFERENCE ONLY):
160+
```bash
161+
echo -e "\n\n✅ TASK COMPLETED\n\nI have successfully implemented the requested feature.\n\nPress Enter to continue or type what you'd like to change: "; read acknowledgment
162+
```
163+
164+
### 🎯 INTERACTIVE INPUT
165+
**Purpose**: Ask questions and CAPTURE user responses for decision-making
166+
**Format**: Interactive `echo` with `read` and confirmation
167+
**Requirements**:
168+
- **MANDATORY**: Must capture user input with `read answer`
169+
- **MANDATORY**: Must confirm selection with `echo "You selected: $answer"`
170+
- **MANDATORY**: Must include 2 leading empty lines
171+
- **INPUT PROCESSING**: User response is stored and used for logic
172+
173+
**EXAMPLE - INTERACTIVE INPUT** (DO NOT EXECUTE - FOR REFERENCE ONLY):
174+
```bash
175+
echo -e "\n\nChoose your option (1/2/3): "; read answer; echo "You selected: $answer"
176+
```
177+
178+
### 🚨 CRITICAL VIOLATIONS
179+
- **DISPLAY AS INTERACTIVE**: Using display text format for questions that need answers
180+
- **INTERACTIVE AS DISPLAY**: Using interactive format for simple information display
181+
- **MISSING ACKNOWLEDGMENT**: Display text without "Press Enter" or user acknowledgment
182+
- **MISSING CONFIRMATION**: Interactive input without "You selected" confirmation
183+
184+
### 🔄 KEY BEHAVIORAL DIFFERENCE
185+
186+
**DISPLAY-ONLY TEXT BEHAVIOR:**
187+
- **Empty Input (Enter/Exit)**: Agent CONTINUES with tasks - this is expected behavior
188+
- **User Types Something**: Agent PROCESSES that input as feedback/modifications
189+
- **Purpose**: Allow user to acknowledge completion OR provide feedback
190+
191+
**INTERACTIVE INPUT BEHAVIOR:**
192+
- **Empty Input**: Agent CAN ask user to provide input again (validation)
193+
- **User Types Something**: Agent PROCESSES that input as the answer to the question
194+
- **Purpose**: Capture specific user decisions for logic flow
195+
196+
---
148197

149198
**CRITICAL EXECUTION RULE**: When user input is required, you **MUST EXECUTE** the interactive command using the `run_command` tool, **NEVER** display it as text or code block.
150199

@@ -309,8 +358,9 @@ echo -e "\n\nBall color: "; read color; echo -e "\n\nSize (small/medium/large):
309358

310359
1. **Early Clarification** - Ask questions at task start, resolve ambiguities before coding
311360
2. **Feature Scope Verification** - MUST confirm before adding ANY feature not explicitly requested
312-
3. **Provide Rationale** - Always explain why questions matter, help weigh trade-offs
313-
4. **Respect User Decisions** - User choice is final, no exceptions
361+
3. **Display Text Acknowledgment** - ALL display-only text MUST require user acknowledgment before proceeding
362+
4. **Provide Rationale** - Always explain why questions matter, help weigh trade-offs
363+
5. **Respect User Decisions** - User choice is final, no exceptions
314364
5. **Document Decisions** - Ask before codifying new standards
315365
6. **File Content Verification** - Re-read all relevant files before making implementation decisions
316366
7. **Fresh Content Protocol** - Never base interactive questions on stale file content or cached understanding
@@ -343,6 +393,11 @@ echo -e "\n\nBall color: "; read color; echo -e "\n\nSize (small/medium/large):
343393
- [ ] Validated implementation scope matches user request?
344394
- [ ] Asked if user wants modifications?
345395

396+
**For ALL display-only text:**
397+
- [ ] Included "Press Enter to continue" or "Type what you'd like to change"?
398+
- [ ] Used `read` to wait for user acknowledgment?
399+
- [ ] Avoided proceeding without user acknowledgment?
400+
346401
**REFACTORING-SPECIFIC CHECKLIST:**
347402
- [ ] Preserved ALL original functionality?
348403
- [ ] Maintained existing component behavior?

rules/user-persona.rules.md

Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
This file defines how coding agents should adapt their communication style and interaction approach based on the user's experience level and preferences.
66

7-
**VIOLATION ENFORCEMENT:** All violations of rules in this file are subject to the universal violation enforcement system defined in [rules/violation-enforcement.rules.md](./violation-enforcement.rules.md).
7+
**VIOLATION ENFORCEMENT:** All violations of rules in this file are subject to the universal violation enforcement system defined in [`violation-enforcement.rules.md`](./violation-enforcement.rules.md).
88

99
---
1010

1111
## MANDATORY USER PERSONA SETUP
1212

1313
**CRITICAL REQUIREMENT: CODING AGENTS MUST HAVE A USER PERSONA SPEC IN MEMORY**
1414

15-
**ENFORCEMENT PRECEDENCE:** This workflow can ONLY be initiated AFTER completing the enforcement requirements defined in [rules/index.rules.md](./index.rules.md) - Enforcement Requirements. Rule reading takes absolute precedence.
15+
**ENFORCEMENT PRECEDENCE:** This workflow can ONLY be initiated AFTER completing the enforcement requirements defined in [`index.rules.md`](./index.rules.md) - Enforcement Requirements. Rule reading takes absolute precedence.
1616

1717
**BEFORE ANY CODING SESSION, AGENTS MUST:**
1818

19-
1. **CHECK FOR PERSONA SPEC:** Look for `specs/user-persona.spec.md`
19+
1. **CHECK FOR PERSONA SPEC:** Look for [`specs/user-persona.spec.md`](../specs/user-persona.spec.md)
2020
2. **FORCE PERSONA SETUP:** If no spec exists, STOP and initiate persona setup workflow
2121
3. **LOAD PERSONA:** Read and apply persona settings to all interactions
2222
4. **NEVER ASSUME:** Do not assume any default persona - always require explicit setup
@@ -26,47 +26,74 @@ This file defines how coding agents should adapt their communication style and i
2626
## PERSONA DETECTION WORKFLOW
2727

2828
### Step 1: Check for Existing Persona
29-
```
30-
IF specs/user-persona.spec.md EXISTS:
31-
READ persona specifications
32-
LOAD into memory for session
33-
CONTINUE with adapted approach
34-
ELSE:
35-
INITIATE persona setup workflow (Step 2)
36-
```
29+
30+
**MANDATORY REQUIREMENT:** Agent MUST check for [`specs/user-persona.spec.md`](../specs/user-persona.spec.md) before ANY coding session.
31+
32+
**IF PERSONA EXISTS:**
33+
- READ persona specifications immediately
34+
- LOAD into memory for current session
35+
- CONTINUE with persona-adapted communication approach (Step 1: PERSONA ASSIMILATION of [`core-principles.rules.md`](./core-principles.rules.md))
36+
37+
**IF PERSONA MISSING:**
38+
- **CRITICAL STOP:** Agent MUST NOT proceed with coding
39+
- **MANDATORY ACTION:** Initiate persona setup workflow (Step 2)
40+
- **VIOLATION:** Proceeding without persona = CRITICAL FAILURE
3741

3842
### Step 2: Present Persona Options
39-
```
40-
READ specs/user-personas/ directory to discover available predefined options
41-
PRESENT available options:
42-
1. Predefined personas (list discovered options from directory)
43-
2. Custom persona option
4443

45-
WAIT for user selection following **USE `run_command` TOOL** for all questions - **MUST FOLLOW** [rules/interactive-input.rules.md](./interactive-input.rules.md) for context on using run_command tool
44+
**MANDATORY ACTIONS:**
45+
1. **READ DIRECTORY:** Scan [`specs/user-personas/`](../specs/user-personas/) for available predefined personas
46+
2. **PRESENT OPTIONS:** Use MANDATORY interactive input format per [`interactive-input.rules.md`](./interactive-input.rules.md)
47+
3. **CAPTURE SELECTION:** Store user choice for processing
48+
49+
**CRITICAL REQUIREMENT:** MUST use run_command tool with proper interactive format:
50+
51+
**EXAMPLE FORMAT (DO NOT EXECUTE - FOR REFERENCE ONLY):**
52+
```bash
53+
echo -e "\n\n🔧 PERSONA SETUP REQUIRED\n\n[persona options]\n\nWhich option best describes you? (Enter 1-6): "; read answer; echo "You selected: $answer"
4654
```
4755

56+
**⚠️ IMPORTANT:** This is ONLY an example of the expected format structure. Agents MUST follow the complete interactive input workflow detailed in [`interactive-input.rules.md`](./interactive-input.rules.md) for proper implementation.
57+
58+
**VIOLATION:** Using echo without read capture = CRITICAL FAILURE
59+
4860
### Step 3: Handle User Selection
49-
```
50-
IF user selects predefined persona:
51-
COPY selected persona to specs/user-persona.spec.md
52-
LOAD persona settings
53-
CONTINUE with session
5461

55-
IF user selects custom option:
56-
INITIATE interactive persona creation (Step 4)
57-
```
62+
**FOR PREDEFINED PERSONA SELECTION:**
63+
- **COPY PERSONA:** Transfer selected persona file to [`specs/user-persona.spec.md`](../specs/user-persona.spec.md)
64+
- **LOAD SETTINGS:** Import persona specifications into memory
65+
- **CONTINUE SESSION:** Proceed with persona-adapted approach (Step 1: PERSONA ASSIMILATION of [`core-principles.rules.md`](./core-principles.rules.md))
66+
67+
**FOR CUSTOM PERSONA REQUEST:**
68+
- **INITIATE CREATION:** Begin interactive persona creation workflow (Step 4)
69+
- **FOLLOW TEMPLATE:** Use structured approach for consistency
5870

5971
### Step 4: Interactive Persona Creation
60-
```
61-
READ rules/templates/persona.template.md for required fields and structure
62-
ASK user questions based on persona template following **USE `run_command` TOOL** for all questions - **MUST FOLLOW** [rules/interactive-input.rules.md](./interactive-input.rules.md) for context on using run_command tool:
72+
73+
**MANDATORY PREPARATION:**
74+
1. **READ TEMPLATE:** Load [`rules/templates/persona.template.md`](./templates/persona.template.md) for required fields
75+
2. **STRUCTURE QUESTIONS:** Base all questions on template requirements
76+
3. **USE INTERACTIVE FORMAT:** Follow [`interactive-input.rules.md`](./interactive-input.rules.md) exactly
77+
78+
**CRITICAL REQUIREMENT:** Each question MUST use run_command tool with proper format:
79+
80+
**EXAMPLE FORMAT** (DO NOT EXECUTE - FOR REFERENCE ONLY):
81+
echo -e "\n\n[Question]: "; read answer; echo "You selected: $answer"
82+
83+
**⚠️ IMPORTANT:** This is ONLY an example of the expected format structure. Agents MUST follow the complete interactive input workflow detailed in [`interactive-input.rules.md`](./interactive-input.rules.md) for proper implementation, including proper `run_command` tool usage, user input capture with `read`, response confirmation, and all formatting and execution requirements.
84+
85+
**REQUIRED QUESTIONS:**
6386
1. Role (their primary job function)
6487
2. Experience Level (none, enthusiast, beginner, intermediate, senior, expert)
6588

66-
CREATE specs/user-persona.spec.md with responses
67-
LOAD persona settings
68-
CONTINUE with session
69-
```
89+
**VIOLATION:** Using echo without read capture = CRITICAL FAILURE
90+
**ENFORCEMENT:** Follow [`interactive-input.rules.md`](./interactive-input.rules.md) exactly - NO exceptions
91+
92+
**COMPLETION ACTIONS:**
93+
1. **GENERATE SPEC:** Create persona specification from user responses
94+
2. **SAVE FILE:** Write to [`specs/user-persona.spec.md`](../specs/user-persona.spec.md)
95+
3. **LOAD PERSONA:** Import settings into memory
96+
4. **CONTINUE SESSION:** Proceed with persona-adapted approach
7097

7198
---
7299

rules/violation-enforcement.rules.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151
34. **Acting on files before completing mandatory rule reading** → 🚨 EMERGENCY STOP immediately, acknowledge CRITICAL precedence violation, complete rule reading first *(See: [index.rules.md](./index.rules.md) - Enforcement Requirements)*
5252
35. **Triggering workflows before reading all required rules** → 🚨 EMERGENCY STOP immediately, acknowledge CRITICAL workflow violation, complete rule reading before any workflow *(See: [index.rules.md](./index.rules.md) - Enforcement Requirements)*
5353
36. **Failing to queue and prioritize multiple workflows after rule reading** → 🚨 EMERGENCY STOP immediately, acknowledge CRITICAL queuing violation, implement systematic workflow processing *(See: [index.rules.md](./index.rules.md) - Enforcement Requirements)*
54+
37. **Using echo without read capture during persona setup** → 🚨 EMERGENCY STOP immediately, acknowledge CRITICAL interactive input violation, restart with proper format *(See: [user-persona.rules.md](./user-persona.rules.md) - Interactive Input Violations)*
55+
38. **Displaying persona questions as text instead of executing** → 🚨 EMERGENCY STOP immediately, acknowledge CRITICAL execution failure, use run_command tool *(See: [user-persona.rules.md](./user-persona.rules.md) - Interactive Input Violations)*
56+
39. **Missing 2 leading empty lines in persona setup commands** → 🚨 EMERGENCY STOP immediately, acknowledge CRITICAL formatting violation, add proper formatting *(See: [user-persona.rules.md](./user-persona.rules.md) - Interactive Input Violations)*
57+
40. **Using display text without user acknowledgment** → 🚨 EMERGENCY STOP immediately, acknowledge CRITICAL acknowledgment violation, add "Press Enter to continue" *(See: [interactive-input.rules.md](./interactive-input.rules.md) - Display Text vs Interactive Input)*
58+
41. **Proceeding after display text without waiting for user** → 🚨 EMERGENCY STOP immediately, acknowledge CRITICAL flow violation, wait for user acknowledgment *(See: [interactive-input.rules.md](./interactive-input.rules.md) - Display Text vs Interactive Input)*
5459

5560
---
5661

0 commit comments

Comments
 (0)