Skip to content

Commit 822af65

Browse files
author
Brian Casel
committed
Improved discover-standards Q&A workflow
1 parent e3398ea commit 822af65

File tree

1 file changed

+84
-10
lines changed

1 file changed

+84
-10
lines changed

commands/agent-os/discover-standards.md

Lines changed: 84 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Which area should we focus on for discovering standards? (Pick one, or suggest a
3636

3737
Wait for user response before proceeding.
3838

39-
### Step 2: Analyze the Area
39+
### Step 2: Analyze & Present Findings
4040

4141
Once an area is determined:
4242

@@ -47,7 +47,7 @@ Once an area is determined:
4747
- **Tribal** — Things a new developer wouldn't know without being told
4848
- **Consistent** — Patterns repeated across multiple files
4949

50-
3. Use AskUserQuestion to present findings:
50+
3. Use AskUserQuestion to present findings and let user select:
5151

5252
```
5353
I analyzed [area] and found these potential standards worth documenting:
@@ -56,7 +56,7 @@ I analyzed [area] and found these potential standards worth documenting:
5656
2. **Error Codes** — Custom error codes like AUTH_001, DB_002 with specific meanings
5757
3. **Pagination Pattern** — Cursor-based pagination with consistent param names
5858
59-
Would you like to document any of these? You can also suggest other standards for this area.
59+
Which would you like to document?
6060
6161
Options:
6262
- "Yes, all of them"
@@ -65,24 +65,32 @@ Options:
6565
- "Skip this area"
6666
```
6767

68-
### Step 3: Deep Dive on Each Standard
68+
Wait for user selection before proceeding.
6969

70-
For each standard the user wants to document, ask 1-2 targeted questions to understand the reasoning. Use AskUserQuestion for each.
70+
### Step 3: Ask Why, Then Draft Each Standard
7171

72-
Example questions (adapt based on the specific standard):
72+
**IMPORTANT:** For each selected standard, you MUST complete this full loop before moving to the next standard:
73+
74+
1. **Ask 1-2 clarifying questions** about the "why" behind the pattern. Use your AskUserQuestion tool for this.
75+
2. **Wait for user response**
76+
3. **Draft the standard** incorporating their answer
77+
4. **Confirm with user** before creating the file
78+
5. **Create the file** if approved
79+
80+
Example questions to ask (adapt based on the specific standard):
7381

7482
- "What problem does this pattern solve? Why not use the default/common approach?"
7583
- "Are there exceptions where this pattern shouldn't be used?"
7684
- "What's the most common mistake a developer or agent makes with this?"
7785

78-
Keep this brief. The goal is capturing the "why" behind the pattern, not exhaustive documentation.
86+
**Do NOT batch all questions upfront.** Process one standard at a time through the full loop.
7987

80-
### Step 4: Write the Standards
88+
### Step 4: Create the Standard File
8189

82-
For each standard:
90+
For each standard (after completing Step 3's Q&A):
8391

8492
1. Determine the appropriate folder (create if needed):
85-
- `api/`, `database/`, `frontend/`, `backend/`, `testing/`, `global/`
93+
- `api/`, `database/`, `javascript/`, `css/`, `backend/`, `testing/`, `global/`
8694

8795
2. Check if a related standard file already exists — append to it if so
8896

@@ -110,6 +118,7 @@ Create this file? (yes / edit: [your changes] / skip)
110118
```
111119

112120
4. Create or update the file in `agent-os/standards/[folder]/`
121+
5. **Then repeat Steps 3-4 for the next selected standard**
113122

114123
### Step 5: Update the Index
115124

@@ -185,3 +194,68 @@ Use error codes: `AUTH_001`, `DB_001`, `VAL_001`
185194
When an error occurs in our application, we have established a consistent pattern for how errors should be formatted and returned to the client. This helps maintain consistency across our API and makes it easier for frontend developers to handle errors appropriately...
186195
[continues for 3 more paragraphs]
187196
```
197+
198+
## Example: Full Loop for One Standard
199+
200+
Here's how to process a single standard through the complete workflow:
201+
202+
**1. Present findings (Step 2):**
203+
```
204+
I found these patterns in your API code:
205+
1. **Response Envelope** — All responses use { success, data, error }
206+
2. **Error Codes** — Custom codes like AUTH_001
207+
208+
Which would you like to document?
209+
```
210+
211+
User: "Both"
212+
213+
**2. Ask why for first standard (Step 3):**
214+
```
215+
For the Response Envelope pattern:
216+
- What problem does this solve? Why not return raw data?
217+
- Are there any endpoints that don't use this pattern?
218+
```
219+
220+
User: "We use it so the frontend always knows where to find the data. All endpoints use it, no exceptions."
221+
222+
**3. Draft first standard (Step 3 continued):**
223+
```
224+
Here's the draft for api/response-envelope.md:
225+
226+
---
227+
# Response Envelope
228+
229+
All API responses use this structure:
230+
\`\`\`json
231+
{ "success": true, "data": { ... } }
232+
{ "success": false, "error": { ... } }
233+
\`\`\`
234+
235+
- Frontend always checks `success` first, then reads `data` or `error`
236+
- No exceptions — every endpoint uses this format
237+
---
238+
239+
Create this file?
240+
```
241+
242+
User: "Yes"
243+
244+
**4. Create file, then move to next standard:**
245+
246+
[Create the file]
247+
248+
**5. Ask why for second standard (back to Step 3):**
249+
```
250+
For the Error Codes pattern:
251+
- What's the naming convention for codes?
252+
- Where should new error codes be documented?
253+
```
254+
255+
User: "Format is AREA_NUMBER like AUTH_001. We keep a list in the wiki."
256+
257+
**6. Draft second standard, confirm, create file...**
258+
259+
[Continue until all selected standards are done]
260+
261+
**Key point:** Complete the full ask → draft → confirm → create cycle for each standard before starting the next one.

0 commit comments

Comments
 (0)