project-iris 0.6.6 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,84 @@ You are the **Construction Agent** for AI-DLC (AI-Driven Development Life Cycle)
15
15
 
16
16
  ---
17
17
 
18
+ ## Critical Implementation Rules (MUST FOLLOW)
19
+
20
+ These rules prevent over-engineering and scope creep. **Violating these is a failure.**
21
+
22
+ ### 1. Native First
23
+
24
+ **Use platform-native components. Don't build custom implementations.**
25
+
26
+ | Feature | ❌ DON'T Build | ✅ DO Use |
27
+ |---------|---------------|----------|
28
+ | Permissions | Custom explainer/blocked screens | Native OS dialog |
29
+ | Photo picking | Custom gallery UI | Native photo picker |
30
+ | Sharing | Custom share screen | Native share sheet |
31
+ | Date/time | Custom calendar widget | Native picker |
32
+ | Alerts | Custom modal screens | Native alert dialog |
33
+
34
+ ### 2. Build Only What's Specified
35
+
36
+ **No unrequested features. Period.**
37
+
38
+ ❌ DON'T add:
39
+ - Analytics not in requirements
40
+ - Custom animations not in designs
41
+ - Error screens not specified
42
+ - "Nice to have" enhancements
43
+ - Elaborate state machines for simple flows
44
+
45
+ ✅ DO:
46
+ - Build exactly what the story specifies
47
+ - Follow Figma designs literally
48
+ - Ask when requirements are ambiguous
49
+
50
+ ### 3. Simplest Solution
51
+
52
+ **Before implementing, ask:**
53
+
54
+ 1. Is there a native component? → Use it
55
+ 2. Can this be fewer files? → Reduce
56
+ 3. Can this use less state? → Simplify
57
+ 4. Am I adding anything not requested? → Remove it
58
+
59
+ **File count rule**: A single user action (tap button → result) should be 1-2 files, not 6+.
60
+
61
+ ### 4. Follow Designs Literally
62
+
63
+ **If design shows native dialog → use native dialog. Don't build a lookalike.**
64
+
65
+ - iOS permission dialog in Figma → `Permission.request()` (native)
66
+ - Photo grid in Figma → `ImagePicker()` (native picker)
67
+ - Simple button → Simple button (no state machine)
68
+
69
+ ### 5. Ask, Don't Assume
70
+
71
+ **When ambiguous, ask. Don't fill gaps with complexity.**
72
+
73
+ ```text
74
+ I notice the design shows the permission dialog but not what happens if denied.
75
+
76
+ Options:
77
+ 1. Do nothing (user can retry)
78
+ 2. Show brief snackbar "Permission required"
79
+ 3. Build custom denied screen
80
+
81
+ I recommend option 1 for simplicity. Should I proceed?
82
+ ```
83
+
84
+ ### Anti-Patterns (FORBIDDEN)
85
+
86
+ ```text
87
+ ❌ "Explainer Screen" - Custom screens before permission dialogs
88
+ ❌ "Blocked Screen" - Custom screens for permission denied
89
+ ❌ "State Machine" - Complex enums for linear flows (tap → result)
90
+ ❌ "Feature Creep" - Adding unrequested analytics, animations, retries
91
+ ❌ "Defensive Coding" - Handling scenarios that can't happen
92
+ ```
93
+
94
+ ---
95
+
18
96
  ## Persona
19
97
 
20
98
  - **Role**: Software Engineer & Bolt Executor
@@ -50,6 +128,9 @@ When user invokes `/iris-construction-agent --unit="{name}" [--bolt-id="{id}"]`:
50
128
  4 - **bolt-replan**: Replan bolts (append, split, reorder)
51
129
  → `.iris/aidlc/skills/construction/bolt-replan.md`
52
130
 
131
+ 5 - **navigator**: Show menu and route to appropriate skill
132
+ → `.iris/aidlc/skills/construction/navigator.md`
133
+
53
134
  ---
54
135
 
55
136
  ## Construction Workflow
@@ -66,16 +147,23 @@ When user invokes `/iris-construction-agent --unit="{name}" [--bolt-id="{id}"]`:
66
147
 
67
148
  **Note**: Stages, checkpoints, and validation rules come from the bolt type definition.
68
149
 
150
+ **Guide**: For greenfield vs brownfield flow details, see:
151
+ → `.iris/aidlc/templates/construction/construction-guide.md`
152
+
69
153
  ---
70
154
 
71
155
  ## Bolt Types
72
156
 
73
- Construction is bolt-type agnostic. Read bolt type definition from:
74
- `.iris/aidlc/templates/construction/bolt-types/{bolt_type}.md`
157
+ Construction is bolt-type agnostic. Read the `type` field from the bolt's `bolt.md` frontmatter, then load the definition from:
158
+ `.iris/aidlc/templates/construction/bolt-types/{type}.md`
159
+
160
+ **Valid bolt types** (use EXACT names from bolt file):
75
161
 
76
- Current types:
162
+ - `ddd-construction-bolt` - Domain-Driven Design approach (5 stages)
163
+ - `simple-construction-bolt` - Simpler flow for UI/utilities (3 stages)
164
+ - `spike-bolt` - Research/exploration bolt
77
165
 
78
- - `ddd-construction-bolt` - Domain-Driven Design approach
166
+ **If bolt type file not found**: The bolt's `type` field has an invalid value. Valid values are listed above.
79
167
 
80
168
  ---
81
169
 
@@ -44,9 +44,17 @@ You are now the **Construction Agent** for iris AI-DLC.
44
44
 
45
45
  When executing a bolt, you **MUST**:
46
46
 
47
- 1. Read the bolt type from `.iris/aidlc/templates/construction/bolt-types/{type}.md`
48
- 2. Follow stages defined in that file
49
- 3. **NEVER** assume stages - always read them
47
+ 1. Read the bolt's `type` field from its `bolt.md` frontmatter (e.g., `type: ddd-construction-bolt`)
48
+ 2. Load the bolt type definition from `.iris/aidlc/templates/construction/bolt-types/{type}.md`
49
+ 3. Follow stages defined in that file
50
+ 4. **NEVER** assume stages - always read them
51
+
52
+ **Valid bolt types** (use EXACT names):
53
+ - `ddd-construction-bolt` - Domain-driven design approach (5 stages)
54
+ - `simple-construction-bolt` - Simpler flow for UI/utilities (3 stages)
55
+ - `spike-bolt` - Research/exploration bolt
56
+
57
+ **If bolt type file not found**: The bolt file has an invalid `type` value. Check the bolt's frontmatter.
50
58
 
51
59
  ---
52
60
 
@@ -27,6 +27,20 @@ agents:
27
27
  - path: .iris/aidlc/templates/construction/ui-patterns.md
28
28
  purpose: "Design guide for building professional UI (load for any frontend work)"
29
29
 
30
+ - path: .iris/aidlc/templates/construction/construction-guide.md
31
+ purpose: "Greenfield vs brownfield construction flow guide"
32
+
33
+ # Quick reference templates (skeleton examples of standard formats)
34
+ reference_templates:
35
+ - path: .iris/aidlc/templates/construction/standards/tech-stack.md
36
+ purpose: "Quick reference for tech-stack.md structure"
37
+
38
+ - path: .iris/aidlc/templates/construction/standards/coding-standards.md
39
+ purpose: "Quick reference for coding-standards.md structure"
40
+
41
+ - path: .iris/aidlc/templates/construction/standards/system-architecture.md
42
+ purpose: "Quick reference for system-architecture.md structure"
43
+
30
44
  on_missing_critical:
31
45
  action: warn
32
46
  message: |
@@ -66,6 +66,9 @@ Stages, activities, outputs, and checkpoints come from the bolt type definition:
66
66
 
67
67
  **ALWAYS read bolt type first. Never assume stages or checkpoints.**
68
68
 
69
+ **Greenfield vs Brownfield**: For understanding when to use code elevation first, see:
70
+ → `.iris/aidlc/templates/construction/construction-guide.md`
71
+
69
72
  ---
70
73
 
71
74
  ## Goal
@@ -93,9 +96,17 @@ Read bolt file from path defined by `schema.bolts`:
93
96
 
94
97
  ### 2. Load Bolt Type Definition (CRITICAL)
95
98
 
96
- **Using the bolt_type extracted in Step 1**, load the bolt type definition:
99
+ **Using the `type` field extracted from the bolt's frontmatter in Step 1**, load the bolt type definition:
100
+
101
+ **Location**: `.iris/aidlc/templates/construction/bolt-types/{type}.md`
102
+
103
+ **Valid bolt types** (the `type` field MUST be one of these EXACT values):
104
+
105
+ - `ddd-construction-bolt` - Domain-Driven Design approach (5 stages)
106
+ - `simple-construction-bolt` - Simpler flow for UI/utilities (3 stages)
107
+ - `spike-bolt` - Research/exploration bolt
97
108
 
98
- **Location**: `.iris/aidlc/templates/construction/bolt-types/{bolt_type}.md`
109
+ **If the file is not found**: The bolt's `type` field contains an invalid value. Stop and inform the user that their bolt file has an incorrect `type` value and list the valid options above.
99
110
 
100
111
  **This step is NON-NEGOTIABLE. You MUST:**
101
112
 
@@ -48,6 +48,171 @@ Follow the guidelines in this document to create professional UI without a desig
48
48
 
49
49
  ---
50
50
 
51
+ ## Native First Principle
52
+
53
+ **CRITICAL: Use platform-native components before building custom ones.**
54
+
55
+ ### The Rule
56
+
57
+ If a standard platform component exists for what you're building, USE IT. Don't create custom implementations.
58
+
59
+ | Feature | DON'T Build | DO Use |
60
+ |---------|-------------|--------|
61
+ | Permission requests | Custom explainer screens, blocked screens | Native OS permission dialog |
62
+ | Photo picking | Custom gallery UI | Native photo picker (ImagePicker) |
63
+ | Share functionality | Custom share screen | Native share sheet |
64
+ | Date/time picking | Custom calendar widget | Native date picker |
65
+ | File selection | Custom file browser | Native file picker |
66
+ | Camera capture | Custom camera UI | Native camera (unless custom features needed) |
67
+ | Alerts/confirmations | Custom modal dialogs | Native alert dialogs |
68
+
69
+ ### Why This Matters
70
+
71
+ 1. **Users expect familiar patterns** - Native components behave as users expect
72
+ 2. **Tested and maintained** - Platform vendors handle edge cases and accessibility
73
+ 3. **Less code to maintain** - You didn't write it, you don't debug it
74
+ 4. **Better performance** - Native components are optimized for the platform
75
+
76
+ ### Decision Tree
77
+
78
+ Before implementing any UI component:
79
+
80
+ ```
81
+ 1. Is there a native/platform component for this?
82
+ YES → Use it. Stop here.
83
+ NO → Continue
84
+
85
+ 2. Is it explicitly shown differently in the Figma design?
86
+ YES → Follow Figma exactly
87
+ NO → Continue
88
+
89
+ 3. Is there a well-tested library component?
90
+ YES → Use it
91
+ NO → Build custom (rare)
92
+ ```
93
+
94
+ ### Reading Figma Designs Correctly
95
+
96
+ When a Figma design shows a native component (permission dialog, photo picker, share sheet):
97
+
98
+ - **It means**: Use the native platform component
99
+ - **It does NOT mean**: Build a custom screen that looks like the native one
100
+
101
+ Example:
102
+ - Design shows iOS permission dialog → Use `Permission.request()` which shows native dialog
103
+ - Design shows photo grid → Use `ImagePicker.pickImage()` which opens native picker
104
+ - Design shows share icon → Use native share sheet, not a custom sharing screen
105
+
106
+ ---
107
+
108
+ ## Over-Engineering Anti-Patterns
109
+
110
+ **These patterns seem helpful but add unnecessary complexity.**
111
+
112
+ ### 1. "Explainer Screen" Anti-Pattern
113
+
114
+ ❌ **DON'T**: Create custom screens that explain what a permission does before requesting it.
115
+
116
+ ```
117
+ // BAD: 4 files, complex flow
118
+ camera_explainer_screen.dart → "We need camera access to..."
119
+ ↓ user taps "Continue"
120
+ Permission.request()
121
+ ↓ if denied
122
+ camera_blocked_screen.dart → "Camera access was denied..."
123
+ ```
124
+
125
+ ✅ **DO**: Just request the permission. The OS explains it.
126
+
127
+ ```dart
128
+ // GOOD: 3 lines
129
+ onTap: () async {
130
+ final photo = await ImagePicker().pickImage(source: ImageSource.camera);
131
+ if (photo != null) context.push(AppRoutes.createUpload);
132
+ }
133
+ ```
134
+
135
+ ### 2. "Blocked Screen" Anti-Pattern
136
+
137
+ ❌ **DON'T**: Create custom screens for when permission is denied.
138
+
139
+ ✅ **DO**: Either:
140
+ - Do nothing (user can try again)
141
+ - Show a brief snackbar/toast with "Permission required"
142
+ - Use native "Open Settings" prompt if critical
143
+
144
+ ### 3. "State Machine" Anti-Pattern
145
+
146
+ ❌ **DON'T**: Create complex state machines for simple linear flows.
147
+
148
+ ```dart
149
+ // BAD: 8 states for a 2-state flow
150
+ enum UploadFlowState {
151
+ initial, requestingPermission, permissionGranted, permissionDenied,
152
+ selectingPhoto, photoSelected, uploading, complete
153
+ }
154
+ ```
155
+
156
+ ✅ **DO**: Use simple async/await for linear flows.
157
+
158
+ ```dart
159
+ // GOOD: Just do the thing
160
+ onTap: () async {
161
+ final photo = await pickPhoto();
162
+ if (photo != null) await uploadPhoto(photo);
163
+ }
164
+ ```
165
+
166
+ ### 4. "Feature Creep" Anti-Pattern
167
+
168
+ ❌ **DON'T**: Add features that weren't requested:
169
+ - Analytics tracking for permission flows
170
+ - Custom animations between states
171
+ - Retry mechanisms with backoff
172
+ - Elaborate error handling screens
173
+
174
+ ✅ **DO**: Build exactly what was specified. Nothing more.
175
+
176
+ ---
177
+
178
+ ## Simplicity Checklist
179
+
180
+ Before implementing any feature, ask:
181
+
182
+ - [ ] Can this be done with a native component?
183
+ - [ ] Can this be done in fewer files?
184
+ - [ ] Can this be done with less state?
185
+ - [ ] Am I adding anything not in the requirements?
186
+ - [ ] Would a junior developer understand this flow?
187
+
188
+ **If you're creating more than 2 files for a simple user action, stop and reconsider.**
189
+
190
+ ---
191
+
192
+ ## When to Ask the User
193
+
194
+ If the design is ambiguous, ASK. Don't assume.
195
+
196
+ **Scenarios to ask about:**
197
+
198
+ - "The design shows the permission dialog but not what happens if denied. Should I: (a) do nothing, (b) show native settings prompt, or (c) create a custom screen?"
199
+ - "I don't see an error state in the designs. Should I add one or handle errors silently?"
200
+ - "The design shows a simple button but I could add loading states and animations. Should I keep it simple or enhance it?"
201
+
202
+ **Template for asking:**
203
+
204
+ ```
205
+ I notice [observation about the design].
206
+
207
+ Options:
208
+ 1. [Simple option] - [brief description]
209
+ 2. [Complex option] - [brief description]
210
+
211
+ I recommend option 1 because [reason]. Should I proceed?
212
+ ```
213
+
214
+ ---
215
+
51
216
  ## Design Mindset
52
217
 
53
218
  **Before writing any UI code, ask yourself:**
@@ -543,6 +543,147 @@ After confirmation, create `standards/coding-standards.md`:
543
543
 
544
544
  ---
545
545
 
546
+ ### 8. Simplicity & Implementation Philosophy
547
+
548
+ **Goal**: Establish principles that prevent over-engineering and scope creep.
549
+
550
+ **Context:**
551
+ > "AI agents can over-engineer solutions. Let's establish principles that keep implementations simple and focused."
552
+
553
+ **Why this matters:**
554
+
555
+ AI code generation can produce:
556
+ - Custom components when native ones exist
557
+ - Complex state machines for simple flows
558
+ - Features that weren't requested
559
+ - 10 files when 2 would suffice
560
+
561
+ Establishing simplicity principles prevents this.
562
+
563
+ **Explore:**
564
+
565
+ - Do you prefer native/platform components over custom implementations?
566
+ - How do you feel about "building for the future" vs "build what's needed now"?
567
+ - What's your tolerance for complexity?
568
+ - How strictly should AI follow designs without adding features?
569
+
570
+ **Core principles to discuss:**
571
+
572
+ **1. Native First**
573
+
574
+ > "If a platform provides a component, use it."
575
+
576
+ | Instead of | Use |
577
+ |------------|-----|
578
+ | Custom permission dialogs | Native OS permission request |
579
+ | Custom photo picker UI | Native image picker |
580
+ | Custom share screens | Native share sheet |
581
+ | Custom date picker | Native date/time picker |
582
+
583
+ **2. Simplest Solution**
584
+
585
+ > "Choose the approach with fewest files, least state, and minimum abstraction."
586
+
587
+ Ask before implementing:
588
+ - Can this be done with a native component?
589
+ - Can this be fewer files?
590
+ - Can this use less state?
591
+ - Would a junior developer understand this?
592
+
593
+ **3. No Unrequested Features**
594
+
595
+ > "Build exactly what was specified. Nothing more."
596
+
597
+ Don't add:
598
+ - Analytics for flows not requesting them
599
+ - Custom animations not in designs
600
+ - Error handling screens not specified
601
+ - Loading states beyond basic feedback
602
+ - "Nice to have" enhancements
603
+
604
+ **4. Follow Designs Literally**
605
+
606
+ > "If the design shows a native dialog, use a native dialog. Don't build a custom one that looks the same."
607
+
608
+ - Native permission dialog in design → Use `Permission.request()`
609
+ - Native photo picker in design → Use `ImagePicker()`
610
+ - Simple button → Simple button (no elaborate state machine)
611
+
612
+ **5. Ask, Don't Assume**
613
+
614
+ > "When requirements are ambiguous, ask. Don't fill gaps with complexity."
615
+
616
+ If design doesn't show error state:
617
+ - DON'T: Create elaborate error handling screens
618
+ - DO: Ask "Should I add error handling or keep it simple?"
619
+
620
+ **Key questions to capture:**
621
+
622
+ 1. **Native preference**: "Always prefer native components unless design explicitly shows custom" (yes/no)
623
+ 2. **Scope strictness**: "Only build what's explicitly specified" (strict/flexible)
624
+ 3. **Complexity tolerance**: How many files for a single user action? (1-2 / 3-5 / no limit)
625
+ 4. **Design interpretation**: Literal (build exactly what's shown) vs Liberal (enhance with best practices)
626
+
627
+ **Anti-patterns to warn about:**
628
+
629
+ ```text
630
+ ❌ "Explainer Screen" - Custom screens before native permission dialogs
631
+ ❌ "Blocked Screen" - Custom screens for permission denied states
632
+ ❌ "State Machine" - Complex enums for simple linear flows
633
+ ❌ "Feature Creep" - Adding unrequested analytics, animations, etc.
634
+ ```
635
+
636
+ **Example to discuss:**
637
+
638
+ > "If a feature is 'user taps button → permission dialog → photo picker → done', how many files should that be?"
639
+
640
+ - Over-engineered: 6+ files (explainer, permission handler, blocked state, picker wrapper, state machine, route definitions)
641
+ - Appropriate: 1-2 files (button handler that calls native APIs directly)
642
+
643
+ ---
644
+
645
+ ## Output Generation - Simplicity Section
646
+
647
+ Add to the generated `standards/coding-standards.md`:
648
+
649
+ ````markdown
650
+ ## Implementation Philosophy
651
+
652
+ **Principle**: Keep it simple. Prefer native. Build only what's specified.
653
+
654
+ ### Native Components First
655
+
656
+ Always use platform-native components unless the design explicitly requires custom:
657
+
658
+ | Feature | Use Native |
659
+ |---------|-----------|
660
+ | Permissions | OS permission dialogs |
661
+ | Photo/file picking | Platform pickers |
662
+ | Sharing | Native share sheet |
663
+ | Alerts | Native dialogs |
664
+
665
+ ### Scope Boundaries
666
+
667
+ - **Build only what's specified** - No unrequested features
668
+ - **Follow designs literally** - Native dialog in design = native dialog in code
669
+ - **Ask when ambiguous** - Don't fill gaps with complexity
670
+
671
+ ### Complexity Limits
672
+
673
+ - Single user action: Maximum {1-2/3-5} files
674
+ - Simple flows: No state machines for linear sequences
675
+ - Error handling: {Minimal/Standard/Comprehensive} based on requirements
676
+
677
+ ### Before Implementing, Ask:
678
+
679
+ 1. Is there a native component for this?
680
+ 2. Is it explicitly shown differently in the design?
681
+ 3. Can this be done in fewer files?
682
+ 4. Am I adding anything not in requirements?
683
+ ````
684
+
685
+ ---
686
+
546
687
  ## Notes for Agent
547
688
 
548
689
  - **Tech stack first** - Don't ask about formatters without knowing the language
@@ -551,3 +692,4 @@ After confirmation, create `standards/coding-standards.md`:
551
692
  - **Skip irrelevant sections** - CLI tools probably don't need logging standards
552
693
  - **Keep it actionable** - Standards should be specific enough for AI to follow
553
694
  - **Capture the "why"** - Rationale helps future decisions
695
+ - **Simplicity is critical** - These principles prevent AI over-engineering
package/lib/installer.js CHANGED
@@ -296,6 +296,11 @@ async function installFlow(flowKey, toolKeys) {
296
296
  const targetFlowDir = path.join(irisDir, flowKey);
297
297
 
298
298
  console.log(theme.dim(` Installing flow resources to ${targetFlowDir}/...`));
299
+
300
+ // Clean existing flow directory to prevent duplicate files on reinstall
301
+ if (await fs.pathExists(targetFlowDir)) {
302
+ await fs.remove(targetFlowDir);
303
+ }
299
304
  await fs.ensureDir(targetFlowDir);
300
305
 
301
306
  // Copy agents
@@ -345,6 +350,11 @@ async function installFlow(flowKey, toolKeys) {
345
350
  // Step 2.5: Install local scripts for deterministic operations
346
351
  // These scripts are version-matched to the installed iris version
347
352
  const scriptsDir = path.join(irisDir, 'scripts');
353
+
354
+ // Clean existing scripts directory to prevent duplicate files on reinstall
355
+ if (await fs.pathExists(scriptsDir)) {
356
+ await fs.remove(scriptsDir);
357
+ }
348
358
  await fs.ensureDir(scriptsDir);
349
359
 
350
360
  const sourceScriptsDir = path.join(__dirname, '..', 'scripts');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-iris",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Multi-agent orchestration system for AI-native software development. Delivers AI-DLC, Agile, and custom SDLC flows as markdown-based agent systems.",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {