You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run `project-detect.sh` to discover test suites, CI configuration, and project conventions. Note which understanding areas are already answered by the detection output so you can skip or confirm rather than ask from scratch.
@@ -73,6 +99,11 @@ cat > "$SCRATCHPAD" <<EOF
73
99
## Auto-detected
74
100
Stack: $STACK_OUT
75
101
Detection output: $DETECT_OUT
102
+
package.json: ${PACKAGE_JSON:+present}
103
+
pyproject.toml: ${PYPROJECT:+present}
104
+
.husky/ pre-commit hook: ${HUSKY_HOOK:+present}
105
+
CI workflow filenames: ${CI_WORKFLOWS:-none found}
I'll ask about the areas where I need more context. This should take 5–10 minutes.
131
+
Does this look right, or is anything missing?
97
132
```
98
133
134
+
Wait for the user to confirm or correct before continuing. Update the scratchpad with any corrections, then proceed to Phase 2 for areas still needing clarification.
**Goal:** Fill gaps in the 7 understanding areas through focused, conversational questions.
140
+
**Goal:** Fill gaps in the 7 understanding areas through focused, conversational questions. Present detected configuration for confirmation rather than asking open-ended discovery questions.
104
141
105
142
### Dialogue Rules
106
143
107
144
**One question at a time** — never present multiple questions in a single message. Pick the most important unknown and ask about it.
108
145
109
-
**Prefer multiple-choice questions**over open-ended when possible — they're faster to answer and produce more consistent results.
146
+
**Confirmation over discovery**— when detection already answered an area, present the detected value and ask the user to confirm or correct it. Do not ask from scratch.
110
147
111
148
**Skip confirmed areas** — if detection already answered an area with confidence, confirm briefly ("I see you're using pytest — is that the main test runner?") rather than asking from scratch.
112
149
113
150
**Use "Tell me more about..."** to go deeper when an answer is vague or incomplete.
114
151
152
+
**No rigid menus** — use open-ended questions with natural follow-ups rather than lettered option lists. Ask what the user does, not which letter they pick.
153
+
115
154
### Question Guide by Area
116
155
117
156
Work through each area in the checklist order, but adapt based on what detection already found.
@@ -120,79 +159,68 @@ Work through each area in the checklist order, but adapt based on what detection
120
159
121
160
Ask about: primary language and version, framework (if any), package manager, runtime target.
122
161
123
-
Example question:
162
+
If `package.json` was found, present the detected Node/JavaScript stack for confirmation:
163
+
```
164
+
I see a package.json — it looks like this is a [framework] project using Node [version]. Is that right? What version are you targeting, and is there anything about the runtime or package manager I should know?
165
+
```
166
+
167
+
If `pyproject.toml` was found, present the detected Python stack for confirmation:
168
+
```
169
+
I see a pyproject.toml — it looks like a Python project. What version are you targeting, and are you using poetry, pip, or something else?
170
+
```
171
+
172
+
For unknown stacks, ask openly:
124
173
```
125
-
I detected this looks like a Python project. Which version are you targeting?
126
-
a) Python 3.11
127
-
b) Python 3.12
128
-
c) Python 3.13
129
-
d) Other (please specify)
174
+
What language and runtime is this project built on? And what's the primary framework or library, if any?
130
175
```
131
176
132
177
#### 2. commands
133
178
134
179
Ask about: how to run tests, how to start the dev server, how to lint/format, any project-specific Makefile targets.
135
180
136
-
Example question:
181
+
Present detected test directories for confirmation:
137
182
```
138
-
How do you run the test suite locally?
139
-
a) make test
140
-
b) pytest / poetry run pytest
141
-
c) npm test / yarn test
142
-
d) Other (please describe)
183
+
I found these test directories: [TEST_DIRS]. How do you actually run the test suite — is there a make target, a script, or do you run the test runner directly?
143
184
```
144
185
145
186
#### 3. architecture
146
187
147
188
Ask about: top-level module layout, key service boundaries, any notable design patterns (event sourcing, CQRS, hexagonal, etc.), where the main entry point is.
148
189
149
-
Example question:
190
+
Ask openly:
150
191
```
151
-
How would you describe the top-level structure?
152
-
a) Monolith — single deployable unit
153
-
b) Monorepo — multiple packages/services in one repo
154
-
c) Microservices — separate repos per service
155
-
d) Plugin architecture — core + extension plugins
192
+
How would you describe the top-level structure of this project — is it a single deployable unit, a monorepo, or something else? What's the main entry point?
156
193
```
157
194
158
195
#### 4. infrastructure
159
196
160
197
Ask about: where it runs (cloud provider, on-prem, local-only), databases used, external services or APIs it calls, how secrets are managed.
161
198
162
-
Example question:
199
+
Ask openly:
163
200
```
164
-
Where does this project run in production?
165
-
a) AWS
166
-
b) GCP / Google Cloud
167
-
c) Azure
168
-
d) Local / self-hosted
169
-
e) No production deployment yet
201
+
Where does this project run in production, and what external services or databases does it depend on? How are secrets managed?
170
202
```
171
203
172
204
#### 5. CI
173
205
174
-
Ask about: which CI provider, what gates must pass before merge, whether there are separate fast/slow test pipelines, deployment pipeline stages.
206
+
List the actual `.github/workflows/*.yml` filenames discovered in Step 1. Use those filenames to confirm the CI workflow name rather than asking the user to type it from memory.
207
+
208
+
```
209
+
I found these workflow filenames: [CI_WORKFLOWS]. Which one is your primary CI gate — the one that runs on pull requests?
210
+
```
175
211
176
-
Example question:
212
+
If no workflows were found:
177
213
```
178
-
Which CI system does this project use?
179
-
a) GitHub Actions
180
-
b) CircleCI
181
-
c) GitLab CI
182
-
d) Jenkins
183
-
e) No CI configured yet
214
+
I don't see any CI workflows yet. What CI system are you planning to use, if any?
184
215
```
185
216
186
217
#### 6. design
187
218
188
219
Ask about: whether there is a UI layer, which framework/library is used, any established design system, accessibility targets.
189
220
190
-
Example question:
221
+
Ask openly:
191
222
```
192
-
Does this project have a UI/frontend layer?
193
-
a) Yes — web UI (ask follow-up about framework)
194
-
b) Yes — native/mobile UI
195
-
c) No — it's a backend service or CLI tool
223
+
Does this project have a UI or frontend layer? If so, what framework are you using and is there an established design system?
@@ -211,24 +239,30 @@ c) No — it's a backend service or CLI tool
211
239
212
240
5.**Visual language**: "Describe the intended visual feel in 3 adjectives. (e.g., 'Trustworthy, Dense, Clinical' or 'Playful, Round, Airy')"
213
241
214
-
6.**Accessibility**: "Is the target accessibility standard WCAG AA or AAA?"
242
+
6.**Accessibility**: "What's your target accessibility standard — WCAG AA, WCAG AAA, or something else?"
215
243
216
244
After completing these design questions, append findings to the scratchpad under a `## Design (Extended)` section.
217
245
218
246
#### 7. enforcement
219
247
220
248
Ask about: linting tools, commit message conventions, pre-commit hooks in use, code review requirements, test coverage policies.
221
249
222
-
Example question:
250
+
Present detected hooks for confirmation:
223
251
```
224
-
Which enforcement tools are active?
225
-
a) Pre-commit hooks (e.g., ruff, eslint, husky)
226
-
b) CI lint gate only
227
-
c) Code review required before merge
228
-
d) All of the above
229
-
e) None / minimal enforcement
252
+
I see [.husky/pre-commit present / .pre-commit-config.yaml present / no hooks detected]. What enforcement tools are active — any linters, commit message conventions, or code review requirements a new contributor would need to know?
230
253
```
231
254
255
+
#### 8. Jira Bridge
256
+
257
+
Ask whether the project uses Jira and, if so, confirm the project key:
258
+
259
+
```
260
+
Does this project use Jira for issue tracking? If so, what's the Jira project key (e.g., "MYAPP" or "DSO")?
261
+
Note: credentials (JIRA_URL, JIRA_USER, JIRA_API_TOKEN) stay as environment variables — only the project key goes in config.
262
+
```
263
+
264
+
If the user provides a Jira project key, write `jira.project_key=<KEY>` to `.claude/dso-config.conf`. The Jira Bridge connects DSO to Jira via the `JIRA_URL` environment variable.
265
+
232
266
### Phase 2 Gate
233
267
234
268
When all 7 areas have at least a basic answer recorded in the scratchpad, ask:
@@ -374,12 +408,82 @@ This file is intentionally brief — it records what was learned during onboardi
374
408
375
409
After writing `.claude/project-understanding.md`, generate a starter `.claude/dso-config.conf` from the conversation findings. This file configures DSO for the host project.
376
410
377
-
**Key categories to populate** (flat `KEY=VALUE` format):
411
+
#### Detect and Merge with Existing Config
412
+
413
+
Before writing any values, check whether a `.claude/dso-config.conf` already exists:
# Detect existing config — merge new keys, do NOT overwrite existing values
419
+
EXISTING_CONTENT=$(cat "$EXISTING_CONFIG")
420
+
fi
421
+
```
422
+
423
+
If an existing dso-config.conf is found, merge the new keys into it rather than overwriting. Only add keys that are not already present. Existing config values take precedence — do not overwrite them unless the user explicitly confirms the new value.
424
+
425
+
#### Required Config Keys
426
+
427
+
Generate all of the following config keys (flat `KEY=VALUE` format). For each key that cannot be auto-detected, apply the fallback behavior described below.
428
+
429
+
**DSO plugin location** (required):
430
+
```
431
+
# Absolute path to the DSO plugin directory (resolved via realpath or git rev-parse)
Generate from the detected source and test directories. The value is semicolon-delimited — multiple glob patterns separated by `;` with no spaces around the semicolons.
472
+
473
+
**CI workflow name** (confirmed from actual workflow filenames):
474
+
475
+
Use the workflow filenames discovered in Phase 1 (`$CI_WORKFLOWS`) to confirm the `ci.workflow_name`. Present the actual filenames rather than asking the user to type a name from memory:
476
+
```
477
+
# CI workflow filename confirmation
478
+
ci.workflow_name=<filename confirmed from .github/workflows/ scan>
When a config key cannot be auto-detected and the user does not provide a value, apply this fallback priority:
498
+
499
+
1.**Prompt user** — ask one focused question to get the value
500
+
2.**Documented default** — if a well-known default exists (e.g., `tickets.directory=.tickets-tracker`), use it and note it was defaulted
501
+
3.**Omit with explanatory comment** — if no default is safe to assume, omit the key and add an explanatory comment in the config file:
502
+
503
+
```
504
+
# commands.validate — could not be auto-detected; set to your validation command
505
+
# Example: commands.validate=make test
506
+
```
507
+
508
+
Never silently skip a required key — always leave a comment so the user knows what to fill in.
509
+
391
510
#### Ticket prefix derivation
392
511
393
512
Derive the `tickets.prefix` from the project name by taking the first letter of each hyphen- or underscore-separated word and uppercasing them. For example:
@@ -410,10 +529,9 @@ When the conversation reveals **no `.github/workflows/` files exist**, offer exa
410
529
```
411
530
I don't see any CI workflows yet. Would you like me to create starter workflows?
412
531
I can generate:
413
-
a) ci.yml — fast-gate tests on pull requests
414
-
b) ci-slow.yml — slow/integration tests on push to main
415
-
c) Both
416
-
d) Skip — I'll set up CI manually
532
+
- ci.yml — fast-gate tests on pull requests
533
+
- ci-slow.yml — slow/integration tests on push to main
534
+
- both, or skip if you plan to set up CI manually
417
535
418
536
Accepted examples will be auto-populated into dso-config.conf and generated
419
537
via ci-generator.sh using the test suites discovered during onboarding.
@@ -483,5 +601,5 @@ If the user says no or wants to continue manually, summarize what was learned an
0 commit comments