@atlashub/smartstack-cli 1.13.2 → 1.14.0

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.
Files changed (210) hide show
  1. package/.documentation/agents.html +1 -1
  2. package/.documentation/apex.html +1 -1
  3. package/.documentation/business-analyse.html +1 -1
  4. package/.documentation/cli-commands.html +3 -3
  5. package/.documentation/commands.html +1 -1
  6. package/.documentation/efcore.html +1 -1
  7. package/.documentation/gitflow.html +1 -1
  8. package/.documentation/hooks.html +1 -1
  9. package/.documentation/index.html +1 -1
  10. package/.documentation/init.html +3 -3
  11. package/.documentation/installation.html +1001 -352
  12. package/.documentation/ralph-loop.html +1 -1
  13. package/.documentation/test-web.html +1 -1
  14. package/README.md +88 -20
  15. package/dist/index.js +276 -85
  16. package/dist/index.js.map +1 -1
  17. package/package.json +1 -1
  18. package/templates/agents/code-reviewer.md +163 -0
  19. package/templates/agents/efcore/db-deploy.md +25 -7
  20. package/templates/agents/efcore/db-reset.md +31 -10
  21. package/templates/agents/efcore/db-status.md +22 -5
  22. package/templates/agents/efcore/migration.md +69 -19
  23. package/templates/agents/gitflow/cleanup.md +8 -1
  24. package/templates/agents/gitflow/commit.md +7 -5
  25. package/templates/agents/gitflow/finish.md +6 -4
  26. package/templates/agents/gitflow/pr.md +8 -1
  27. package/templates/agents/gitflow/start.md +1 -1
  28. package/templates/commands/check-version.md +267 -0
  29. package/templates/commands/efcore/_shared.md +30 -1
  30. package/templates/commands/efcore/db-reset.md +18 -6
  31. package/templates/commands/gitflow/OPTIMIZATIONS.md +206 -0
  32. package/templates/commands/refactor.md +164 -0
  33. package/templates/project/DependencyInjection.Application.cs.template +25 -0
  34. package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
  35. package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
  36. package/templates/project/ExampleEntity.cs.template +116 -0
  37. package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
  38. package/templates/project/ExampleService.cs.template +146 -0
  39. package/templates/project/ExtensionsDbContext.cs.template +41 -0
  40. package/templates/project/IExtensionsDbContext.cs.template +22 -0
  41. package/templates/project/Program.cs.template +47 -0
  42. package/templates/project/README.md +79 -0
  43. package/templates/ralph/README.md +10 -8
  44. package/templates/ralph/ralph.config.yaml +2 -2
  45. package/templates/skills/_shared.md +44 -44
  46. package/templates/skills/ai-prompt/SKILL.md +55 -55
  47. package/templates/skills/apex/SKILL.md +235 -0
  48. package/templates/skills/apex/steps/step-00-init.md +203 -0
  49. package/templates/skills/apex/steps/step-01-analyze.md +210 -0
  50. package/templates/skills/apex/steps/step-02-plan.md +217 -0
  51. package/templates/skills/apex/steps/step-03-execute.md +178 -0
  52. package/templates/skills/apex/steps/step-04-validate.md +217 -0
  53. package/templates/skills/apex/steps/step-05-examine.md +207 -0
  54. package/templates/skills/apex/steps/step-06-resolve.md +181 -0
  55. package/templates/skills/apex/steps/step-07-tests.md +206 -0
  56. package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
  57. package/templates/skills/apex/templates/00-context.md +46 -0
  58. package/templates/skills/apex/templates/01-analyze.md +63 -0
  59. package/templates/skills/apex/templates/02-plan.md +63 -0
  60. package/templates/skills/apex/templates/03-execute.md +34 -0
  61. package/templates/skills/apex/templates/04-validate.md +61 -0
  62. package/templates/skills/apex/templates/05-examine.md +58 -0
  63. package/templates/skills/apex/templates/06-resolve.md +39 -0
  64. package/templates/skills/apex/templates/07-tests.md +56 -0
  65. package/templates/skills/apex/templates/08-run-tests.md +41 -0
  66. package/templates/skills/apex/templates/README.md +69 -0
  67. package/templates/skills/application/SKILL.md +50 -50
  68. package/templates/skills/application/templates-backend.md +25 -25
  69. package/templates/skills/application/templates-frontend.md +43 -43
  70. package/templates/skills/application/templates-i18n.md +29 -29
  71. package/templates/skills/application/templates-seed.md +77 -77
  72. package/templates/skills/business-analyse/SKILL.md +223 -0
  73. package/templates/skills/business-analyse/_shared.md +258 -0
  74. package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
  75. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
  76. package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
  77. package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
  78. package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
  79. package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
  80. package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
  81. package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
  82. package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
  83. package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
  84. package/templates/skills/business-analyse/questionnaire.md +177 -177
  85. package/templates/skills/business-analyse/react/components.md +340 -0
  86. package/templates/skills/business-analyse/react/i18n-template.md +245 -0
  87. package/templates/skills/business-analyse/react/schema.md +151 -0
  88. package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
  89. package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
  90. package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
  91. package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
  92. package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
  93. package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
  94. package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
  95. package/templates/skills/business-analyse/templates/00-context.md +105 -0
  96. package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
  97. package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
  98. package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
  99. package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
  100. package/templates/skills/business-analyse/templates-frd.md +217 -217
  101. package/templates/skills/business-analyse/templates-react.md +26 -26
  102. package/templates/skills/controller/SKILL.md +141 -92
  103. package/templates/skills/controller/postman-templates.md +15 -15
  104. package/templates/skills/controller/steps/step-00-init.md +191 -0
  105. package/templates/skills/controller/steps/step-01-analyze.md +146 -0
  106. package/templates/skills/controller/steps/step-02-plan.md +176 -0
  107. package/templates/skills/controller/steps/step-03-generate.md +219 -0
  108. package/templates/skills/controller/steps/step-04-perms.md +219 -0
  109. package/templates/skills/controller/steps/step-05-validate.md +107 -0
  110. package/templates/skills/controller/templates.md +77 -77
  111. package/templates/skills/documentation/SKILL.md +79 -79
  112. package/templates/skills/feature-full/SKILL.md +38 -38
  113. package/templates/skills/gitflow/SKILL.md +277 -0
  114. package/templates/{commands → skills}/gitflow/_shared.md +20 -20
  115. package/templates/skills/gitflow/phases/abort.md +173 -0
  116. package/templates/skills/gitflow/phases/cleanup.md +226 -0
  117. package/templates/skills/gitflow/phases/status.md +178 -0
  118. package/templates/skills/gitflow/steps/step-commit.md +255 -0
  119. package/templates/skills/gitflow/steps/step-finish.md +255 -0
  120. package/templates/skills/gitflow/steps/step-init.md +209 -0
  121. package/templates/skills/gitflow/steps/step-merge.md +225 -0
  122. package/templates/skills/gitflow/steps/step-plan.md +208 -0
  123. package/templates/skills/gitflow/steps/step-pr.md +235 -0
  124. package/templates/skills/gitflow/steps/step-start.md +234 -0
  125. package/templates/skills/gitflow/steps/step-sync.md +200 -0
  126. package/templates/skills/gitflow/templates/config.json +53 -0
  127. package/templates/skills/notification/SKILL.md +51 -51
  128. package/templates/skills/ralph-loop/SKILL.md +228 -0
  129. package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
  130. package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
  131. package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
  132. package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
  133. package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
  134. package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
  135. package/templates/skills/review-code/SKILL.md +219 -0
  136. package/templates/skills/review-code/references/clean-code-principles.md +140 -0
  137. package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
  138. package/templates/skills/review-code/references/feedback-patterns.md +149 -0
  139. package/templates/skills/review-code/references/security-checklist.md +127 -0
  140. package/templates/skills/ui-components/SKILL.md +54 -54
  141. package/templates/skills/workflow/SKILL.md +46 -46
  142. package/templates/commands/ai-prompt.md +0 -315
  143. package/templates/commands/apex/1-analyze.md +0 -100
  144. package/templates/commands/apex/2-plan.md +0 -145
  145. package/templates/commands/apex/3-execute.md +0 -171
  146. package/templates/commands/apex/4-examine.md +0 -116
  147. package/templates/commands/apex/5-tasks.md +0 -209
  148. package/templates/commands/apex.md +0 -76
  149. package/templates/commands/application/create.md +0 -362
  150. package/templates/commands/application/templates-backend.md +0 -463
  151. package/templates/commands/application/templates-frontend.md +0 -517
  152. package/templates/commands/application/templates-i18n.md +0 -478
  153. package/templates/commands/application/templates-seed.md +0 -362
  154. package/templates/commands/application.md +0 -303
  155. package/templates/commands/business-analyse/0-orchestrate.md +0 -156
  156. package/templates/commands/business-analyse/1-init.md +0 -99
  157. package/templates/commands/business-analyse/2-discover.md +0 -143
  158. package/templates/commands/business-analyse/3-analyse.md +0 -106
  159. package/templates/commands/business-analyse/4-specify.md +0 -133
  160. package/templates/commands/business-analyse/5-validate.md +0 -132
  161. package/templates/commands/business-analyse/6-handoff.md +0 -157
  162. package/templates/commands/business-analyse/7-doc-html.md +0 -103
  163. package/templates/commands/business-analyse/_shared.md +0 -176
  164. package/templates/commands/business-analyse/bug.md +0 -118
  165. package/templates/commands/business-analyse/change-request.md +0 -144
  166. package/templates/commands/business-analyse/hotfix.md +0 -116
  167. package/templates/commands/business-analyse.md +0 -121
  168. package/templates/commands/controller/create.md +0 -216
  169. package/templates/commands/controller/postman-templates.md +0 -528
  170. package/templates/commands/controller/templates.md +0 -600
  171. package/templates/commands/controller.md +0 -337
  172. package/templates/commands/create/agent.md +0 -138
  173. package/templates/commands/create/command.md +0 -166
  174. package/templates/commands/create/hook.md +0 -234
  175. package/templates/commands/create/plugin.md +0 -329
  176. package/templates/commands/create/project.md +0 -508
  177. package/templates/commands/create/skill.md +0 -199
  178. package/templates/commands/create.md +0 -220
  179. package/templates/commands/documentation/module.md +0 -202
  180. package/templates/commands/documentation/templates.md +0 -432
  181. package/templates/commands/documentation.md +0 -190
  182. package/templates/commands/epct.md +0 -69
  183. package/templates/commands/explain.md +0 -186
  184. package/templates/commands/feature-full.md +0 -267
  185. package/templates/commands/gitflow/1-init.md +0 -188
  186. package/templates/commands/gitflow/10-start.md +0 -190
  187. package/templates/commands/gitflow/11-finish.md +0 -382
  188. package/templates/commands/gitflow/12-cleanup.md +0 -103
  189. package/templates/commands/gitflow/13-sync.md +0 -216
  190. package/templates/commands/gitflow/14-rebase.md +0 -251
  191. package/templates/commands/gitflow/2-status.md +0 -122
  192. package/templates/commands/gitflow/3-commit.md +0 -209
  193. package/templates/commands/gitflow/4-plan.md +0 -174
  194. package/templates/commands/gitflow/5-exec.md +0 -202
  195. package/templates/commands/gitflow/6-abort.md +0 -121
  196. package/templates/commands/gitflow/7-pull-request.md +0 -176
  197. package/templates/commands/gitflow/8-review.md +0 -113
  198. package/templates/commands/gitflow/9-merge.md +0 -157
  199. package/templates/commands/gitflow.md +0 -128
  200. package/templates/commands/implement.md +0 -663
  201. package/templates/commands/init.md +0 -567
  202. package/templates/commands/mcp-integration.md +0 -330
  203. package/templates/commands/notification.md +0 -129
  204. package/templates/commands/oneshot.md +0 -57
  205. package/templates/commands/quickstart.md +0 -154
  206. package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
  207. package/templates/commands/ralph-loop/help.md +0 -126
  208. package/templates/commands/ralph-loop/ralph-loop.md +0 -120
  209. package/templates/commands/review.md +0 -106
  210. package/templates/commands/workflow.md +0 -193
@@ -0,0 +1,151 @@
1
+ # TypeScript Schema - FRD Data Types
2
+
3
+ > **Usage:** TypeScript interfaces for FRD documentation
4
+ > **Loaded in:** step-06-doc-html.md
5
+
6
+ ---
7
+
8
+ ## Type Definitions
9
+
10
+ ```typescript
11
+ // web/smartstack-web/src/pages/docs/business/{app}/{module}/types.ts
12
+
13
+ /**
14
+ * Use Case definition from FRD
15
+ */
16
+ export interface UseCase {
17
+ /** Unique identifier (e.g., "UC-001") */
18
+ id: string;
19
+ /** Use case name */
20
+ name: string;
21
+ /** Primary actor role */
22
+ actor: string;
23
+ /** Required permission path */
24
+ permission: string;
25
+ /** Brief description */
26
+ description: string;
27
+ }
28
+
29
+ /**
30
+ * Business Rule from BRD
31
+ */
32
+ export interface BusinessRule {
33
+ /** Unique identifier (e.g., "BR-001") */
34
+ id: string;
35
+ /** Rule description */
36
+ rule: string;
37
+ /** Category: Validation, Calculation, Workflow, Security, Data */
38
+ category: 'Validation' | 'Calculation' | 'Workflow' | 'Security' | 'Data';
39
+ /** MoSCoW priority */
40
+ priority: 'Must' | 'Should' | 'Could';
41
+ }
42
+
43
+ /**
44
+ * Permission definition
45
+ */
46
+ export interface Permission {
47
+ /** Full permission path (e.g., "business.sales.orders.read") */
48
+ path: string;
49
+ /** Human-readable description */
50
+ description: string;
51
+ /** Roles that have this permission */
52
+ roles: string[];
53
+ }
54
+
55
+ /**
56
+ * Complete FRD data structure
57
+ */
58
+ export interface FrdData {
59
+ /** Feature identifier (e.g., "FEAT-001") */
60
+ featureId: string;
61
+ /** Module name in PascalCase */
62
+ moduleName: string;
63
+ /** Application name in PascalCase */
64
+ applicationName: string;
65
+ /** Document version */
66
+ version: string;
67
+ /** List of use cases */
68
+ useCases: UseCase[];
69
+ /** List of business rules */
70
+ businessRules: BusinessRule[];
71
+ /** List of permissions */
72
+ permissions: Permission[];
73
+ }
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Data File Template
79
+
80
+ ```typescript
81
+ // web/smartstack-web/src/pages/docs/business/{app}/{module}/frdData.ts
82
+
83
+ import type { FrdData } from './types';
84
+
85
+ /**
86
+ * FRD data extracted from 3-functional-specification.md
87
+ * Generated by /business-analyse:6-doc-html
88
+ */
89
+ export const frdData: FrdData = {
90
+ featureId: '{{feature_id}}',
91
+ moduleName: '{{module_name}}',
92
+ applicationName: '{{application_name}}',
93
+ version: '1.0',
94
+
95
+ useCases: [
96
+ {
97
+ id: 'UC-001',
98
+ name: '{{use_case_name}}',
99
+ actor: '{{actor}}',
100
+ permission: 'business.{{app}}.{{module}}.{{action}}',
101
+ description: '{{description}}'
102
+ }
103
+ // Add more use cases...
104
+ ],
105
+
106
+ businessRules: [
107
+ {
108
+ id: 'BR-001',
109
+ rule: '{{rule_description}}',
110
+ category: 'Validation',
111
+ priority: 'Must'
112
+ }
113
+ // Add more business rules...
114
+ ],
115
+
116
+ permissions: [
117
+ {
118
+ path: 'business.{{app}}.{{module}}.read',
119
+ description: 'View {{module}} data',
120
+ roles: ['Admin', 'Manager', 'User', 'ReadOnly']
121
+ },
122
+ {
123
+ path: 'business.{{app}}.{{module}}.create',
124
+ description: 'Create new {{module}}',
125
+ roles: ['Admin', 'Manager']
126
+ },
127
+ {
128
+ path: 'business.{{app}}.{{module}}.update',
129
+ description: 'Update existing {{module}}',
130
+ roles: ['Admin', 'Manager']
131
+ },
132
+ {
133
+ path: 'business.{{app}}.{{module}}.delete',
134
+ description: 'Delete {{module}}',
135
+ roles: ['Admin']
136
+ }
137
+ ]
138
+ };
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Index Export
144
+
145
+ ```typescript
146
+ // web/smartstack-web/src/pages/docs/business/{app}/{module}/index.ts
147
+
148
+ export { {ModuleName}FrdDocPage } from './FrdDocPage';
149
+ export type { FrdData, UseCase, BusinessRule, Permission } from './types';
150
+ export { frdData } from './frdData';
151
+ ```
@@ -0,0 +1,293 @@
1
+ ---
2
+ name: step-00-init
3
+ description: Initialize Business Analysis - Parse flags, create structure, setup state
4
+ model: haiku
5
+ next_step: steps/step-01-discover.md
6
+ ---
7
+
8
+ <objective>
9
+ Parse command-line flags, create feature directory structure, and initialize state variables for the Business Analysis workflow.
10
+ </objective>
11
+
12
+ <defaults>
13
+ ```yaml
14
+ auto_mode: false
15
+ save_mode: true # BA always saves by default
16
+ economy_mode: false
17
+ context: business # BA is RESTRICTED to business context
18
+ ```
19
+ </defaults>
20
+
21
+ ## EXECUTION SEQUENCE
22
+
23
+ ### 1. Parse Flags and Input
24
+
25
+ **Step 1: Load defaults**
26
+ ```
27
+ {auto_mode} = false
28
+ {save_mode} = true
29
+ {economy_mode} = false
30
+ {context} = "business"
31
+ ```
32
+
33
+ **Step 2: Parse user input and override defaults:**
34
+
35
+ Enable flags (lowercase - turn ON):
36
+ - `-a` or `--auto` -> `{auto_mode}` = true
37
+ - `-s` or `--save` -> `{save_mode}` = true (already default)
38
+ - `-e` or `--economy` -> `{economy_mode}` = true
39
+
40
+ Disable flags (UPPERCASE - turn OFF):
41
+ - `-A` or `--no-auto` -> `{auto_mode}` = false
42
+ - `-S` or `--no-save` -> `{save_mode}` = false
43
+ - `-E` or `--no-economy` -> `{economy_mode}` = false
44
+
45
+ Other:
46
+ - `-r` or `--resume` -> `{resume_task}` = <next argument>
47
+ - `-i` or `--interactive` -> `{interactive_mode}` = true
48
+
49
+ **Step 3: Extract feature description**
50
+ After removing flags, remaining text becomes `{feature_description}`
51
+
52
+ ---
53
+
54
+ ### 2. Check Resume Mode
55
+
56
+ **ONLY execute if `{resume_task}` is set!**
57
+
58
+ If `{resume_task}` is set:
59
+ 1. Search for matching feature in `.business-analyse/`
60
+ ```bash
61
+ find .business-analyse -type d -name "*{resume_task}*" 2>/dev/null | head -1
62
+ ```
63
+ 2. If found: Read `00-context.md` to restore state variables
64
+ 3. Find last completed step (look for "Status: Complete" in progress table)
65
+ 4. Load next incomplete step
66
+ 5. **STOP** - do not continue with fresh init
67
+
68
+ If NOT found:
69
+ - Display error: "Feature {resume_task} not found"
70
+ - List available features for selection
71
+ - Exit or prompt for new task
72
+
73
+ ---
74
+
75
+ ### 3. Interactive Mode (if -i flag)
76
+
77
+ If `{interactive_mode}` = true:
78
+
79
+ Use AskUserQuestion with these questions:
80
+
81
+ ```json
82
+ {
83
+ "questions": [
84
+ {
85
+ "question": "What execution mode do you prefer?",
86
+ "header": "Mode",
87
+ "options": [
88
+ {"label": "Autonomous (-a)", "description": "No confirmations, smooth execution"},
89
+ {"label": "Interactive", "description": "Confirmation at each step"}
90
+ ],
91
+ "multiSelect": false
92
+ },
93
+ {
94
+ "question": "Use economy mode (without subagents)?",
95
+ "header": "Economy",
96
+ "options": [
97
+ {"label": "No (Recommended)", "description": "Better quality with subagents"},
98
+ {"label": "Yes (-e)", "description": "Token savings, lower quality"}
99
+ ],
100
+ "multiSelect": false
101
+ }
102
+ ]
103
+ }
104
+ ```
105
+
106
+ ---
107
+
108
+ ### 4. Validate Business Context
109
+
110
+ **CRITICAL: BA is RESTRICTED to 'business' context only!**
111
+
112
+ ```
113
+ IF {context} IN ['platform', 'personal', 'system'] THEN
114
+ DISPLAY ERROR:
115
+ "Business Analysis is restricted to 'business' context only.
116
+ Platform/Personal/System modules use different processes.
117
+ Contact: support@atlshub.ch"
118
+ EXIT
119
+ END IF
120
+ ```
121
+
122
+ ---
123
+
124
+ ### 5. Determine Application and Module
125
+
126
+ Ask user to specify:
127
+
128
+ ```json
129
+ {
130
+ "questions": [
131
+ {
132
+ "question": "Which business application to target?",
133
+ "header": "Application",
134
+ "options": [
135
+ {"label": "New application", "description": "Create a new business application"},
136
+ {"label": "Existing application", "description": "Add a module to an existing application"}
137
+ ],
138
+ "multiSelect": false
139
+ }
140
+ ]
141
+ }
142
+ ```
143
+
144
+ If "Existing application":
145
+ - Scan `.business-analyse/business/` for existing applications
146
+ - Present list for selection
147
+
148
+ Store in:
149
+ - `{application_name}` - PascalCase (e.g., "Sales", "HR", "Inventory")
150
+ - `{module_name}` - PascalCase (e.g., "Clients", "Orders", "Products")
151
+
152
+ ---
153
+
154
+ ### 6. Generate Feature ID
155
+
156
+ ```bash
157
+ # Read last ID from config
158
+ LAST_ID=$(grep -oP '"lastFeatureId":\s*\K\d+' .business-analyse/config.json 2>/dev/null || echo "0")
159
+
160
+ # Increment
161
+ NEW_ID=$((LAST_ID + 1))
162
+
163
+ # Format as FEAT-NNN
164
+ {feature_id} = printf "FEAT-%03d" $NEW_ID
165
+ ```
166
+
167
+ ---
168
+
169
+ ### 7. Create Output Structure
170
+
171
+ **Create directory structure:**
172
+
173
+ ```
174
+ .business-analyse/
175
+ ├── config.json # Global config (update lastFeatureId)
176
+ └── business/
177
+ └── {application_name}/
178
+ └── modules/
179
+ └── {module_name}/
180
+ └── features/
181
+ └── {feature_id}/
182
+ ├── 00-context.md # State + progress
183
+ └── tracking/
184
+ ├── changes/
185
+ ├── bugs/
186
+ └── hotfixes/
187
+ ```
188
+
189
+ **Set output_dir:**
190
+ ```
191
+ {output_dir} = .business-analyse/business/{application_name}/modules/{module_name}/features/{feature_id}
192
+ ```
193
+
194
+ ---
195
+
196
+ ### 8. Write 00-context.md
197
+
198
+ Create initial context file with state variables:
199
+
200
+ ```markdown
201
+ # Business Analysis: {{feature_id}}
202
+
203
+ **Created:** {{timestamp}}
204
+ **Feature:** {{feature_description}}
205
+ **Application:** business/{{application_name}}/{{module_name}}
206
+
207
+ ## Configuration
208
+
209
+ | Setting | Value |
210
+ |---------|-------|
211
+ | Auto mode | {{auto_mode}} |
212
+ | Save mode | {{save_mode}} |
213
+ | Economy mode | {{economy_mode}} |
214
+
215
+ ## Progress
216
+
217
+ | Step | Status | Started | Completed |
218
+ |------|--------|---------|-----------|
219
+ | 00-init | Complete | {{timestamp}} | {{timestamp}} |
220
+ | 01-discover | Pending | - | - |
221
+ | 02-analyse | Pending | - | - |
222
+ | 03-specify | Pending | - | - |
223
+ | 04-validate | Pending | - | - |
224
+ | 05-handoff | Pending | - | - |
225
+ | 06-doc-html | Pending | - | - |
226
+
227
+ ## State Variables
228
+
229
+ | Variable | Value |
230
+ |----------|-------|
231
+ | feature_id | {{feature_id}} |
232
+ | feature_description | {{feature_description}} |
233
+ | application_name | {{application_name}} |
234
+ | module_name | {{module_name}} |
235
+ | context | business |
236
+ | permission_base | business.{{application_name}}.{{module_name}} |
237
+
238
+ ## Acceptance Criteria
239
+
240
+ To be defined in step-01-discover.
241
+
242
+ ---
243
+
244
+ ## Notes
245
+
246
+ (Add notes during analysis)
247
+ ```
248
+
249
+ ---
250
+
251
+ ### 9. Update Global Config
252
+
253
+ Update `.business-analyse/config.json`:
254
+
255
+ ```json
256
+ {
257
+ "project": "{ProjectName}",
258
+ "lastFeatureId": {NEW_ID},
259
+ "context": "business",
260
+ "standards": ["BABOK-v3", "IEEE-830"],
261
+ "contact": "support@atlshub.ch"
262
+ }
263
+ ```
264
+
265
+ ---
266
+
267
+ ### 10. Display Summary and Load Next Step
268
+
269
+ **Display:**
270
+ ```
271
+ INIT - {{feature_id}}
272
+ ├── Application: business/{{application_name}}
273
+ ├── Module: {{module_name}}
274
+ ├── Output: {{output_dir}}
275
+ ├── Mode: {{auto_mode ? "Autonomous" : "Interactive"}}
276
+ └── Next: step-01-discover (ULTRATHINK elicitation)
277
+ ```
278
+
279
+ **Load next step:**
280
+ ```
281
+ Read and execute: steps/step-01-discover.md
282
+ ```
283
+
284
+ ---
285
+
286
+ ## OUTPUT
287
+
288
+ This step produces:
289
+ - `.business-analyse/config.json` (updated)
290
+ - `{output_dir}/00-context.md` (created)
291
+ - `{output_dir}/tracking/` directories (created)
292
+
293
+ State variables persisted for next steps.
@@ -0,0 +1,267 @@
1
+ ---
2
+ name: step-01-discover
3
+ description: Discovery phase - Elicitation with ULTRATHINK (load questionnaire progressively)
4
+ model: opus
5
+ prev_step: steps/step-00-init.md
6
+ next_step: steps/step-02-analyse.md
7
+ ---
8
+
9
+ <objective>
10
+ Conduct comprehensive requirements elicitation using ULTRATHINK mode.
11
+ Load questionnaire categories progressively based on feature type.
12
+ </objective>
13
+
14
+ <ultrathink>
15
+ ULTRATHINK MODE ACTIVE - Critical thinking required:
16
+ - Consider ALL edge cases before formulating questions
17
+ - Challenge EVERY stakeholder assumption
18
+ - Anticipate UNEXPRESSED needs
19
+ - Validate completeness before proceeding
20
+ - DO NOT accept vague answers
21
+ - DO NOT skip question categories
22
+ </ultrathink>
23
+
24
+ ## EXECUTION SEQUENCE
25
+
26
+ ### 1. Read Current State
27
+
28
+ Read `{output_dir}/00-context.md` to restore:
29
+ - `{feature_id}`
30
+ - `{feature_description}`
31
+ - `{application_name}`
32
+ - `{module_name}`
33
+ - `{auto_mode}`
34
+ - `{economy_mode}`
35
+
36
+ Update progress: `01-discover` -> "In Progress"
37
+
38
+ ---
39
+
40
+ ### 2. Determine Feature Type
41
+
42
+ Analyze `{feature_description}` to categorize:
43
+
44
+ | Type | Indicators | Load Categories |
45
+ |------|------------|-----------------|
46
+ | **Data-centric** | "management", "CRUD", "entity", "data" | 01, 02, 03, 04, 06 |
47
+ | **Integration** | "API", "sync", "import", "export", "external" | 01, 02, 03, 05, 06 |
48
+ | **UI-centric** | "screen", "form", "dashboard", "interface" | 01, 02, 03, 06, 07 |
49
+ | **Workflow** | "process", "validation", "workflow", "steps" | 01, 02, 03, 06, 09 |
50
+ | **Reporting** | "report", "export", "statistics", "KPI" | 01, 02, 03, 04, 08 |
51
+ | **Full module** | "module", "complete", "feature" | ALL categories |
52
+
53
+ Store: `{feature_type}`
54
+
55
+ ---
56
+
57
+ ### 3. Load Questionnaire Categories (Progressive)
58
+
59
+ **IMPORTANT: Load ONLY relevant categories to minimize context!**
60
+
61
+ #### Always load (core):
62
+ ```
63
+ Read: questionnaire/01-context.md # ~50 lines
64
+ Read: questionnaire/02-stakeholders.md # ~40 lines
65
+ Read: questionnaire/03-scope.md # ~35 lines
66
+ Read: questionnaire/06-security.md # ~30 lines (minimal)
67
+ ```
68
+
69
+ #### Conditional loading based on feature_type:
70
+ ```
71
+ IF {feature_type} = "Data-centric" OR "Full module":
72
+ Read: questionnaire/04-data.md # ~45 lines
73
+
74
+ IF {feature_type} = "Integration" OR "Full module":
75
+ Read: questionnaire/05-integrations.md # ~30 lines
76
+
77
+ IF {feature_type} = "UI-centric" OR "Full module":
78
+ Read: questionnaire/07-ui.md # ~20 lines
79
+
80
+ IF {feature_type} = "Reporting" OR performance-critical:
81
+ Read: questionnaire/08-performance.md # ~25 lines
82
+
83
+ IF {feature_type} = "Workflow" OR constraints exist:
84
+ Read: questionnaire/09-constraints.md # ~25 lines
85
+
86
+ IF documentation required:
87
+ Read: questionnaire/10-documentation.md # ~20 lines
88
+ ```
89
+
90
+ **Maximum context per discovery: ~150-200 lines** (vs 283 lines before)
91
+
92
+ ---
93
+
94
+ ### 4. Conduct Elicitation
95
+
96
+ #### 4.1 Category 1: Business Context (ALWAYS)
97
+
98
+ Ask questions from `01-context.md`:
99
+ - Q1.1: Business problem to solve?
100
+ - Q1.2: Current situation (AS-IS)?
101
+ - Q1.3: Target situation (TO-BE)?
102
+ - Q1.4: Measurable KPIs?
103
+ - Q1.5-Q1.8: Business value questions
104
+
105
+ **ULTRATHINK checkpoint:**
106
+ - Is the problem clearly defined?
107
+ - Are success criteria measurable?
108
+ - What happens if NOT developed?
109
+
110
+ #### 4.2 Category 2: Stakeholders (ALWAYS)
111
+
112
+ Ask questions from `02-stakeholders.md`:
113
+ - Q2.1-Q2.4: Identification
114
+ - Q2.5-Q2.8: Needs per role
115
+
116
+ **ULTRATHINK checkpoint:**
117
+ - All user types identified?
118
+ - Pain points documented per role?
119
+ - Decision maker confirmed?
120
+
121
+ #### 4.3 Category 3: Scope (ALWAYS)
122
+
123
+ Ask questions from `03-scope.md`:
124
+ - Q3.1-Q3.4: MoSCoW prioritization
125
+ - Q3.5-Q3.8: Process flows
126
+
127
+ **ULTRATHINK checkpoint:**
128
+ - Must-Have vs Should-Have clear?
129
+ - Exclusions explicit?
130
+ - Main flow documented?
131
+
132
+ #### 4.4 Additional Categories (CONDITIONAL)
133
+
134
+ For each loaded category, conduct targeted elicitation.
135
+ Document responses with:
136
+ - Source (who answered)
137
+ - Confidence level (Confirmed/To validate/Hypothesis)
138
+ - Follow-up questions
139
+
140
+ ---
141
+
142
+ ### 5. Explore Codebase (if economy_mode = false)
143
+
144
+ **Launch parallel exploration agents:**
145
+
146
+ ```
147
+ Agent 1: Existing patterns
148
+ "Search for similar modules in src/SmartStack.Domain/Entities/
149
+ and src/SmartStack.Application/Features/ to understand patterns"
150
+
151
+ Agent 2: Related integrations
152
+ "Search for existing APIs and integrations that this module
153
+ might need to connect with"
154
+
155
+ Agent 3: UI patterns (if UI-centric)
156
+ "Search for similar pages in web/smartstack-web/src/pages/business/
157
+ to understand React patterns"
158
+ ```
159
+
160
+ If `{economy_mode}` = true:
161
+ - Use direct Glob/Grep tools only
162
+ - Read 3-5 most relevant files
163
+ - Skip subagents
164
+
165
+ ---
166
+
167
+ ### 6. Synthesize Discovery
168
+
169
+ Compile all findings into structured format:
170
+
171
+ ```markdown
172
+ # Discovery - {feature_id} {feature_description}
173
+
174
+ > **Module:** business/{application_name}/{module_name}
175
+ > **Version:** 1.0
176
+ > **Date:** {timestamp}
177
+ > **Author:** Business Analyst (Claude)
178
+
179
+ ## 1. Business Context
180
+
181
+ ### 1.1 Need Description
182
+ {Synthesized from Q1.1-Q1.4}
183
+
184
+ ### 1.2 Current Problem
185
+ {From Q1.2}
186
+
187
+ ### 1.3 Expected Value
188
+ {From Q1.5-Q1.7, quantified if possible}
189
+
190
+ ## 2. Stakeholders
191
+
192
+ | Role | Function | Involvement | Decision Level |
193
+ |------|----------|-------------|-----------------|
194
+ {Table from Q2.x responses}
195
+
196
+ ## 3. Scope
197
+
198
+ ### 3.1 In Scope (Must-Have)
199
+ {From Q3.1}
200
+
201
+ ### 3.2 Should-Have
202
+ {From Q3.2}
203
+
204
+ ### 3.3 Out of Scope
205
+ {From Q3.4 - EXPLICIT exclusions}
206
+
207
+ ## 4. Open Questions
208
+
209
+ | # | Question | Answer | Status |
210
+ |---|----------|--------|--------|
211
+ {Any unresolved questions}
212
+
213
+ ## 5. Identified Constraints
214
+
215
+ | Type | Constraint | Impact |
216
+ |------|------------|--------|
217
+ {From loaded constraint categories}
218
+
219
+ ## 6. Acceptance Criteria (Inferred)
220
+
221
+ - [ ] AC-001: {criterion 1}
222
+ - [ ] AC-002: {criterion 2}
223
+ ...
224
+ ```
225
+
226
+ ---
227
+
228
+ ### 7. Save Output
229
+
230
+ Write to: `{output_dir}/1-discovery.md`
231
+
232
+ Update `00-context.md`:
233
+ - Progress: `01-discover` -> "Complete"
234
+ - Add acceptance criteria to state
235
+
236
+ ---
237
+
238
+ ### 8. Display Summary and Load Next Step
239
+
240
+ **Display:**
241
+ ```
242
+ DISCOVERY - {feature_id}
243
+ ├── Status: Complete
244
+ ├── Categories loaded: {list of loaded categories}
245
+ ├── Questions answered: {count}
246
+ ├── Open questions: {count}
247
+ ├── Output: {output_dir}/1-discovery.md
248
+ └── Next: step-02-analyse (BRD formalization)
249
+ ```
250
+
251
+ **If NOT auto_mode:**
252
+ Ask: "Proceed with business rules analysis?"
253
+
254
+ **Load next step:**
255
+ ```
256
+ Read and execute: steps/step-02-analyse.md
257
+ ```
258
+
259
+ ---
260
+
261
+ ## OUTPUT
262
+
263
+ This step produces:
264
+ - `{output_dir}/1-discovery.md` (created)
265
+ - `{output_dir}/00-context.md` (updated with AC)
266
+
267
+ Questionnaire categories loaded: **~150-200 lines max** (70% reduction)