@fro.bot/systematic 2.2.0 → 2.3.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 (52) hide show
  1. package/agents/document-review/adversarial-document-reviewer.md +87 -0
  2. package/agents/review/adversarial-reviewer.md +107 -0
  3. package/agents/review/cli-agent-readiness-reviewer.md +443 -0
  4. package/agents/review/cli-readiness-reviewer.md +69 -0
  5. package/agents/review/previous-comments-reviewer.md +64 -0
  6. package/agents/review/project-standards-reviewer.md +80 -0
  7. package/package.json +1 -1
  8. package/skills/ce-compound/assets/resolution-template.md +90 -0
  9. package/skills/ce-compound/references/schema.yaml +222 -0
  10. package/skills/ce-compound/references/yaml-schema.md +87 -0
  11. package/skills/ce-compound-refresh/assets/resolution-template.md +90 -0
  12. package/skills/ce-compound-refresh/references/schema.yaml +222 -0
  13. package/skills/ce-compound-refresh/references/yaml-schema.md +87 -0
  14. package/skills/{ce-review-beta → ce-review}/references/findings-schema.json +8 -7
  15. package/skills/ce-review/references/persona-catalog.md +67 -0
  16. package/skills/ce-review/references/resolve-base.sh +94 -0
  17. package/skills/{ce-review-beta → ce-review}/references/review-output-template.md +36 -3
  18. package/skills/ce-review/references/subagent-template.md +84 -0
  19. package/skills/claude-permissions-optimizer/scripts/extract-commands.mjs +2 -2
  20. package/skills/claude-permissions-optimizer/scripts/normalize.mjs +8 -8
  21. package/skills/document-review/references/findings-schema.json +109 -0
  22. package/skills/document-review/references/review-output-template.md +89 -0
  23. package/skills/document-review/references/subagent-template.md +57 -0
  24. package/skills/git-clean-gone-branches/SKILL.md +63 -0
  25. package/skills/git-clean-gone-branches/scripts/clean-gone +48 -0
  26. package/skills/git-commit/SKILL.md +103 -0
  27. package/skills/git-commit-push-pr/SKILL.md +419 -0
  28. package/skills/onboarding/SKILL.md +407 -0
  29. package/skills/onboarding/scripts/inventory.mjs +1043 -0
  30. package/skills/resolve-pr-feedback/SKILL.md +374 -0
  31. package/skills/resolve-pr-feedback/scripts/get-pr-comments +104 -0
  32. package/skills/resolve-pr-feedback/scripts/get-thread-for-comment +58 -0
  33. package/skills/resolve-pr-feedback/scripts/reply-to-pr-thread +33 -0
  34. package/skills/{resolve-pr-parallel → resolve-pr-feedback}/scripts/resolve-pr-thread +0 -0
  35. package/skills/todo-create/SKILL.md +109 -0
  36. package/skills/todo-resolve/SKILL.md +68 -0
  37. package/skills/todo-triage/SKILL.md +70 -0
  38. package/skills/ce-review-beta/SKILL.md +0 -506
  39. package/skills/ce-review-beta/references/persona-catalog.md +0 -50
  40. package/skills/ce-review-beta/references/subagent-template.md +0 -56
  41. package/skills/file-todos/SKILL.md +0 -231
  42. package/skills/resolve-pr-parallel/SKILL.md +0 -96
  43. package/skills/resolve-pr-parallel/scripts/get-pr-comments +0 -68
  44. package/skills/resolve-todo-parallel/SKILL.md +0 -68
  45. package/skills/triage/SKILL.md +0 -312
  46. package/skills/workflows-brainstorm/SKILL.md +0 -11
  47. package/skills/workflows-compound/SKILL.md +0 -10
  48. package/skills/workflows-plan/SKILL.md +0 -10
  49. package/skills/workflows-review/SKILL.md +0 -10
  50. package/skills/workflows-work/SKILL.md +0 -10
  51. /package/skills/{ce-review-beta → ce-review}/references/diff-scope.md +0 -0
  52. /package/skills/{file-todos → todo-create}/assets/todo-template.md +0 -0
@@ -0,0 +1,407 @@
1
+ ---
2
+ name: onboarding
3
+ description: "Generate or regenerate ONBOARDING.md to help new contributors understand a codebase. Use when the user asks to 'create onboarding docs', 'generate ONBOARDING.md', 'document this project for new developers', 'write onboarding documentation', 'vonboard', 'vonboarding', 'prepare this repo for a new contributor', 'refresh the onboarding doc', or 'update ONBOARDING.md'. Also use when someone needs to onboard a new team member and wants a written artifact, or when a codebase lacks onboarding documentation and the user wants to generate one."
4
+ ---
5
+
6
+ # Generate Onboarding Document
7
+
8
+ Crawl a repository and generate `ONBOARDING.md` at the repo root -- a document that helps new contributors understand the codebase without requiring the creator to explain it.
9
+
10
+ Onboarding is a general problem in software, but it is more acute in fast-moving codebases where code is written faster than documentation -- whether through AI-assisted development, rapid prototyping, or simply a team that ships faster than it documents. This skill reconstructs the mental model from the code itself.
11
+
12
+ This skill always regenerates the document from scratch. It does not read or diff a previous version. If `ONBOARDING.md` already exists, it is overwritten.
13
+
14
+ ## Core Principles
15
+
16
+ 1. **Write for humans first** -- Clear prose that a new developer can read and understand. Agent utility is a side effect of good human writing, not a separate goal.
17
+ 2. **Show, don't just tell** -- Use ASCII diagrams for architecture and flow, markdown tables for structured information, and backtick formatting for all file paths, commands, and code references.
18
+ 3. **Six sections, each earning its place** -- Every section answers a question a new contributor will ask in their first hour. No speculative sections. Section 2 may be skipped for pure infrastructure with no consuming audience, producing five sections.
19
+ 4. **State what you can observe, not what you must infer** -- Do not fabricate design rationale or assess fragility. If the code doesn't reveal why a decision was made, don't guess.
20
+ 5. **Never include secrets** -- The onboarding document is committed to the repository. Never include API keys, tokens, passwords, connection strings with credentials, or any other secret values. Reference environment variable *names* (`STRIPE_SECRET_KEY`), never their *values*. If a `.env` file contains actual secrets, extract only the variable names.
21
+ 6. **Link, don't duplicate** -- When existing documentation covers a topic well, link to it inline rather than re-explaining.
22
+
23
+ ## Execution Flow
24
+
25
+ ### Phase 1: Gather Inventory
26
+
27
+ Run the bundled inventory script (`scripts/inventory.mjs`) to get a structural map of the repository without reading every file:
28
+
29
+ ```bash
30
+ node scripts/inventory.mjs --root .
31
+ ```
32
+
33
+ Parse the JSON output. This provides:
34
+ - Project name, languages, frameworks, package manager, test framework
35
+ - Directory structure (top-level + one level into source directories)
36
+ - Entry points per detected ecosystem
37
+ - Available scripts/commands
38
+ - Existing documentation files (with first-heading titles for triage)
39
+ - Test infrastructure
40
+ - Infrastructure and external dependencies (env files, docker services, detected integrations)
41
+ - Monorepo structure (if applicable)
42
+
43
+ If the script fails or returns an error field, report the issue to the user and stop. Do not attempt to write `ONBOARDING.md` from incomplete data.
44
+
45
+ ### Phase 2: Read Key Files
46
+
47
+ Guided by the inventory, read files that are essential for understanding the codebase. Use the native file-read tool (not shell commands).
48
+
49
+ **What to read and why:**
50
+
51
+ Read files in parallel batches where there are no dependencies between them. For example, batch README.md, entry points, and AGENTS.md/AGENTS.md together in a single turn since none depend on each other's content.
52
+
53
+ Only read files whose content is needed to write the six sections with concrete, specific detail. The inventory already provides structure, languages, frameworks, scripts, and entry point paths -- don't re-read files just to confirm what the inventory already says. Different repos need different amounts of reading; a small CLI tool might need 4 files, a complex monorepo might need 20. Let the sections drive what you read, not an arbitrary count.
54
+
55
+ **Priority order:**
56
+
57
+ 1. **README.md** (if exists) -- for project purpose and setup instructions
58
+ 2. **Primary entry points** -- the files listed in `entryPoints` from the inventory. These reveal what the application does when it starts.
59
+ 3. **Route/controller files** -- look for `routes/`, `app/controllers/`, `src/routes/`, `src/api/`, or similar directories from the inventory structure. Read the main route file to understand the primary flow.
60
+ 4. **Configuration files that reveal architecture and external dependencies** -- `docker-compose.yml`, `.env.example`, `.env.sample`, database config, `next.config.*`, `vite.config.*`, or similar. Only read these if they exist in the inventory. **Never read `.env` itself** -- only `.env.example` or `.env.sample` templates. Extract variable names only, never values.
61
+ 5. **AGENTS.md or AGENTS.md** (if exists) -- for project conventions and patterns already documented.
62
+ 6. **Discovered documentation** -- the inventory's `docs` list includes each file's title (first heading). Use those titles to decide which docs are relevant to the five sections without reading them first. Only read the full content of docs whose titles indicate direct relevance. Skip dated brainstorm/plan files unless the focus hint specifically calls for them.
63
+
64
+ Do not read files speculatively. Every file read should be justified by the inventory output and traceable to a section that needs it.
65
+
66
+ ### Phase 3: Write ONBOARDING.md
67
+
68
+ Synthesize the inventory data and key file contents into the sections defined below. Write the file to the repo root.
69
+
70
+ **Title**: Use `# {Project Name} Onboarding Guide` as the document heading. Derive the project name from the inventory. Do not use the filename as a heading.
71
+
72
+ **Writing style -- the document should read like a knowledgeable teammate explaining the project over coffee, not like generated documentation.**
73
+
74
+ Voice and tone:
75
+ - Write in second person ("you") -- speak directly to the new contributor
76
+ - Use active voice and present tense: "The router dispatches requests to handlers" not "Requests are dispatched by the router to handlers"
77
+ - Be direct. Lead sentences with what matters, not with setup: "Run `bun dev` to start the server" not "In order to start the development server, you will need to run the following command"
78
+ - Match the formality of the codebase. A scrappy prototype gets casual prose. An enterprise system gets more precise language. Read the README and existing docs for tone cues.
79
+
80
+ Clarity:
81
+ - Every sentence should teach the reader something or tell them what to do. Cut any sentence that doesn't.
82
+ - Prefer concrete over abstract: "`src/services/billing.ts` charges the customer's card" not "The billing module handles payment-related business logic"
83
+ - When introducing a term, define it immediately in context. Don't make the reader scroll to a glossary.
84
+ - Use the simplest word that's accurate. "Use" not "utilize." "Start" not "initialize." "Send" not "transmit."
85
+
86
+ What to avoid:
87
+ - Filler and throat-clearing: "It's important to note that", "As mentioned above", "In this section we will"
88
+ - Vague summarization: "This module handles various aspects of..." -- say specifically what it does
89
+ - Hedge words when stating facts: "This essentially serves as", "This is basically" -- if you know what it does, say it plainly
90
+ - Superlatives and marketing language: "robust", "powerful", "comprehensive", "seamless"
91
+ - Meta-commentary about the document itself: "This document aims to..." -- just do the thing
92
+
93
+ **Formatting requirements -- apply consistently throughout:**
94
+ - Use backticks for all file names (`package.json`), paths (`src/routes/`), commands (`bun test`), function/class names, environment variables, and technical terms
95
+ - Use markdown headers (`##`) for each section
96
+ - Use ASCII diagrams and markdown tables where specified below
97
+ - Use bold for emphasis sparingly
98
+ - Keep paragraphs short -- 2-4 sentences
99
+
100
+ **Section separators** -- Insert a horizontal rule (`---`) between each `##` section. These documents are dense and benefit from strong visual breaks when scanning.
101
+
102
+ **Width constraint for code blocks -- 80 columns max.** Markdown code blocks render with `white-space: pre` and never wrap, so wide lines cause horizontal scrolling on GitHub, tablets, and narrow viewports. Tables are fine -- markdown renderers wrap them. Apply these rules to all content inside ``` fences:
103
+
104
+ - **ASCII architecture diagrams**: Stack boxes vertically instead of laying them out horizontally. Never place more than 2 boxes on the same horizontal line, and keep each box label under 20 characters. This caps diagrams at ~60 chars wide.
105
+ - **Flow diagrams**: Keep file path + annotation under 80 chars. If a description is too long, move it to a line below or shorten it.
106
+ - **Directory trees**: Keep inline `# comments` under 30 characters. Prefer brief role descriptions ("Editor plugins") over exhaustive lists ("marks, heatmap, suggestions, collab cursors, etc.").
107
+
108
+ #### Section 1: What Is This?
109
+
110
+ Answer: What does this project do, who is it for, and what problem does it solve?
111
+
112
+ Draw from `README.md`, manifest descriptions (e.g., `package.json` description field), and what the entry points reveal about the application's purpose.
113
+
114
+ If the project's purpose cannot be clearly determined from the code, state that plainly: "This project's purpose is not documented. Based on the code structure, it appears to be..."
115
+
116
+ Keep to 1-3 paragraphs.
117
+
118
+ #### Section 2: How It's Used
119
+
120
+ Answer: What does it look like to be on the consuming side of this project?
121
+
122
+ Before a contributor can reason about architecture, they need to understand what the project *does* from the outside. This section bridges "what is this" (Section 1) and "how is it built" (Section 3). The audience for this section -- like the rest of the document -- is a new developer on the team. The goal is to show them what the product looks like from the consumer's perspective so the architecture and code flows in later sections make intuitive sense.
123
+
124
+ Title this section in the output based on who consumes the project:
125
+
126
+ - **End-user product** (web app, mobile app, consumer tool) -- Title: **"User Experience"**. Describe what the user sees and the primary workflows (e.g., "sign up, create a project, invite collaborators, see real-time updates"). Draw from routes, entry points, and README.
127
+ - **Developer tool** (SDK, library, dev CLI, framework) -- Title: **"Developer Experience"**. Describe how a developer consumes the tool: installation, a minimal usage example showing the primary API surface, and the 2-3 most common commands or patterns. This is distinct from Section 6 (Developer Guide), which covers contributing to *this codebase* -- this section covers *using* what the codebase produces.
128
+ - **Both** (platform with a consumer-facing product AND a developer API/SDK) -- Title: **"User and Developer Experience"**. Cover both perspectives, starting with the end-user experience and then the developer-facing surface.
129
+
130
+ Keep to 1-3 paragraphs or a short flow per audience. If comprehensive user or developer docs exist, link to them and summarize the key workflows in a sentence each. Do not duplicate existing documentation.
131
+
132
+ Skip this section only for codebases with no consuming audience (pure infrastructure, internal deployment tooling with no direct interaction).
133
+
134
+ ---
135
+
136
+ #### Section 3: How Is It Organized?
137
+
138
+ Answer: What is the architecture, what are the key modules, how do they connect, and what does the system depend on externally?
139
+
140
+ This section covers both the **internal structure** and the **system boundary** -- what the application talks to outside itself.
141
+
142
+ **System architecture** -- There are two kinds of diagrams that help a new contributor, and the system's complexity determines whether to use one or both:
143
+
144
+ 1. **Architecture diagram** -- Components, how they connect, and what protocols or transports they use. A developer looks at this to understand where code lives and how pieces talk to each other. Label edges with interaction types (HTTP, WebSocket, bridge, queue, etc.). Start with user-facing surfaces at the top, internal plumbing in the middle, and data stores and external services at the bottom.
145
+
146
+ 2. **User interaction flow** -- The logical journey a user takes through the product. Not about infrastructure, but about what happens from the user's perspective -- the sequence of actions and what the system does in response.
147
+
148
+ **When to use one vs. both:**
149
+ - For straightforward systems (single web app, CLI tool, simple API), the architecture diagram already tells the user's story -- one diagram is enough. The request path through the components *is* the user flow.
150
+ - For multi-surface products (native app + web + API, or systems with multiple distinct user types), include both. The architecture diagram shows the developer how the pieces are wired; the user interaction flow shows the logical product experience across those pieces. These are different lenses on the same system.
151
+
152
+ Use vertical stacking to keep diagrams under 80 columns.
153
+
154
+ Architecture diagram example:
155
+
156
+ ```
157
+ User / Browser
158
+ |
159
+ | HTTP / WebSocket
160
+ v
161
+ +------------------+ bridge +------------------+
162
+ | Browser Client |<----------->| Native macOS App |
163
+ | (Vite bundle) | | (Swift/WKWebView)|
164
+ +--------+---------+ +--------+---------+
165
+ | |
166
+ | WebSocket | bridge
167
+ v v
168
+ +------------------------------------------+
169
+ | Express Server |
170
+ | routes -> services -> models |
171
+ +--------------------+---------------------+
172
+ |
173
+ | SQL / Yjs sync
174
+ v
175
+ +--------------+
176
+ | SQLite + Yjs |
177
+ +--------------+
178
+ ```
179
+
180
+ User interaction flow example (same system, different lens):
181
+
182
+ ```
183
+ User opens app
184
+ |
185
+ v
186
+ Writes/edits document
187
+ (Milkdown editor)
188
+ |
189
+ v
190
+ Changes sync in real-time
191
+ (Yjs CRDT)
192
+ | \
193
+ v v
194
+ Document persists Other connected
195
+ to SQLite clients see edits
196
+ |
197
+ v
198
+ User shares doc
199
+ -> generates link
200
+ |
201
+ v
202
+ Recipient opens
203
+ in browser client
204
+ ```
205
+
206
+ Skip both for simple projects (single-purpose libraries, CLI tools) where the directory tree already tells the whole story.
207
+
208
+ **Internal structure** -- Include an ASCII directory tree showing the high-level layout:
209
+
210
+ ```
211
+ project-name/
212
+ src/
213
+ routes/ # HTTP route handlers
214
+ services/ # Business logic
215
+ models/ # Data layer
216
+ tests/ # Test suite
217
+ config/ # Environment and app configuration
218
+ ```
219
+
220
+ Annotate directories with a brief comment explaining their role. Only include directories that matter -- skip build artifacts, config files, and boilerplate.
221
+
222
+ When there are distinct modules or components with clear responsibilities, present them in a table:
223
+
224
+ ```
225
+ | Module | Responsibility |
226
+ |--------|---------------|
227
+ | `src/routes/` | HTTP request handling and routing |
228
+ | `src/services/` | Core business logic |
229
+ | `src/models/` | Database models and queries |
230
+ ```
231
+
232
+ Describe how the modules connect -- what calls what, where data flows between them.
233
+
234
+ **External dependencies and integrations** -- Surface everything the system talks to outside its own codebase. This is often the biggest blocker for new contributors trying to run the project. Look for signals in:
235
+ - `docker-compose.yml` (databases, caches, message queues)
236
+ - Environment variable references in config files or `.env.example`
237
+ - Import statements for client libraries (database drivers, API SDKs, cloud storage)
238
+ - The inventory's detected frameworks (e.g., Prisma implies a database)
239
+
240
+ Present as a table when there are multiple dependencies:
241
+
242
+ ```
243
+ | Dependency | What it's used for | Configured via |
244
+ |-----------|-------------------|---------------|
245
+ | PostgreSQL | Primary data store | `DATABASE_URL` |
246
+ | Redis | Session cache and job queue | `REDIS_URL` |
247
+ | Stripe API | Payment processing | `STRIPE_SECRET_KEY` |
248
+ | S3 | File uploads | `AWS_*` env vars |
249
+ ```
250
+
251
+ If no external dependencies are detected, state that: "This project appears self-contained with no external service dependencies."
252
+
253
+ #### Section 4: Key Concepts and Abstractions
254
+
255
+ Answer: What vocabulary and patterns does someone need to understand to talk about this codebase?
256
+
257
+ This section covers two things:
258
+
259
+ **Domain terms** -- The project-specific vocabulary: entity names, API resource names, database tables, configuration concepts, and jargon that a new reader would not immediately recognize.
260
+
261
+ **Architectural abstractions** -- The structural patterns in the codebase that shape how code is organized and how a contributor should think about making changes. These are especially important in codebases where the original author may not have consciously chosen these patterns -- they may have been introduced by an AI or adopted from a template without documentation.
262
+
263
+ Examples of architectural abstractions worth surfacing:
264
+ - "Business logic lives in the service layer (`src/services/`), not in route handlers"
265
+ - "Authentication runs through middleware in `src/middleware/auth.ts` before every protected route"
266
+ - "Database access uses the repository pattern -- each model has a corresponding repository class"
267
+ - "Background jobs are defined in `src/jobs/` and dispatched through a Redis-backed queue"
268
+
269
+ Present both domain terms and abstractions in a single table:
270
+
271
+ ```
272
+ | Concept | What it means in this codebase |
273
+ |---------|-------------------------------|
274
+ | `Widget` | The primary entity users create and manage |
275
+ | `Pipeline` | A sequence of processing steps applied to incoming data |
276
+ | Service layer | Business logic in `src/services/`, not handlers |
277
+ | Middleware chain | Requests flow through `src/middleware/` first |
278
+ ```
279
+
280
+ Aim for 5-15 entries. Include only concepts that would confuse a new reader or that represent non-obvious architectural decisions. Skip universally understood terms.
281
+
282
+ #### Section 5: Primary Flows
283
+
284
+ Answer: What happens when the main things this app does actually happen?
285
+
286
+ Trace one flow per distinct surface or user type. A "surface" is a meaningfully different entry path into the system -- a native app, a web UI, an API consumer, a CLI user. Each flow should reveal parts of the architecture that previous flows didn't cover. Stop when the next flow would mostly retrace files already shown.
287
+
288
+ For a simple library or CLI, that's one flow. For a full-stack app with a web UI and an API, that's two. For a product with native + web + agent surfaces, that's three. Let the architecture drive the count, not an arbitrary number.
289
+
290
+ Include an ASCII flow diagram for the most important flow:
291
+
292
+ ```
293
+ User Request
294
+ |
295
+ v
296
+ src/routes/widgets.ts
297
+ validates input, extracts params
298
+ |
299
+ v
300
+ src/services/widget.ts
301
+ applies business rules, calls DB
302
+ |
303
+ v
304
+ src/models/widget.ts
305
+ persists to PostgreSQL
306
+ |
307
+ v
308
+ Response (201 Created)
309
+ ```
310
+
311
+ At each step, reference the specific file path. Keep file path + annotation under 80 characters -- put the annotation on the next line if needed (as shown above).
312
+
313
+ Additional flows can use a numbered list instead of a full diagram if the first diagram already establishes the structural pattern.
314
+
315
+ #### Section 6: Developer Guide
316
+
317
+ Answer: How do I set up the project, run it, and make common changes?
318
+
319
+ Cover these areas:
320
+
321
+ 1. **Setup** -- Prerequisites, install steps, environment config. Draw from README and the inventory's scripts. Format commands in code blocks:
322
+ ```
323
+ bun install
324
+ cp .env.example .env
325
+ bun dev
326
+ ```
327
+
328
+ 2. **Running and testing** -- How to start the dev server, run tests, lint. Use the inventory's detected scripts.
329
+
330
+ 3. **Common change patterns** -- Where to go for the 2-3 most common types of changes. For example:
331
+ - "To add a new API endpoint, create a route handler in `src/routes/` and register it in `src/routes/index.ts`"
332
+ - "To add a new database model, create a file in `src/models/` and run `bun migrate`"
333
+
334
+ 4. **Key files to start with** (for complex projects) -- A table mapping areas of the codebase to specific entry-point files with a brief "why start here" note. This gives a new contributor a concrete reading list instead of staring at a large directory tree. For example:
335
+
336
+ ```
337
+ | Area | File | Why |
338
+ |------|------|-----|
339
+ | Editor core | `src/editor/index.ts` | All editor wiring |
340
+ | Data model | `src/formats/marks.ts` | The annotation system everything builds on |
341
+ | Server entry | `server/index.ts` | Express app setup and route mounting |
342
+ ```
343
+
344
+ Skip this for projects with fewer than ~10 source files where the directory tree is already a sufficient reading list.
345
+
346
+ 5. **Practical tips** (for complex projects) -- If the codebase has areas that are particularly large, complex, or have non-obvious gotchas, surface them as brief contributor tips. These communicate real situational awareness that helps a new contributor avoid pitfalls. For example:
347
+ - "The editor module is ~450KB. Most behavior is wired through plugins in `src/editor/plugins/` -- understand the plugin architecture before making editor changes."
348
+ - "The collab subsystem has many guards and epoch checks. Read the test names to understand what invariants are maintained."
349
+
350
+ Skip this for simple projects where the codebase is small enough to hold in your head.
351
+
352
+ #### Inline Documentation Links
353
+
354
+ While writing each section, check whether any file from the inventory's `docs` list is directly relevant to what the section explains. If so, link inline:
355
+
356
+ > Authentication uses token-based middleware -- see [`docs/solutions/auth-pattern.md`](docs/solutions/auth-pattern.md) for the full pattern.
357
+
358
+ Do not create a separate references or further-reading section. If no relevant docs exist for a section, the section stands alone -- do not mention their absence.
359
+
360
+ ### Phase 4: Quality Check
361
+
362
+ Before writing the file, verify:
363
+
364
+ - [ ] Every section answers its question without padding or filler
365
+ - [ ] No secrets, API keys, tokens, passwords, or credential values anywhere in the document
366
+ - [ ] No fabricated design rationale ("we chose X because...")
367
+ - [ ] No fragility or risk assessments
368
+ - [ ] File paths referenced in the document correspond to real files from the inventory
369
+ - [ ] All file names, paths, commands, code references, and technical terms use backtick formatting
370
+ - [ ] Document title uses "# {Project Name} Onboarding Guide" format, not the filename
371
+ - [ ] System-level architecture diagram included for multi-surface projects (skipped for simple libraries/CLIs)
372
+ - [ ] All code block content (diagrams, trees, flow traces) fits within 80 columns
373
+ - [ ] ASCII diagrams are present in the architecture and/or primary flow sections
374
+ - [ ] One flow per distinct surface or user type (architecture drives the count, not an arbitrary number)
375
+ - [ ] External dependencies and integrations are surfaced in the architecture section (or explicitly noted as absent)
376
+ - [ ] Tables are used for module responsibilities, domain terms/abstractions, and external dependencies
377
+ - [ ] Markdown styling is consistent throughout (headers, bold, code blocks, tables)
378
+ - [ ] Existing docs are linked inline only where directly relevant
379
+ - [ ] Writing is direct and concrete -- no filler, no hedge words, no meta-commentary about the document
380
+ - [ ] Tone matches the codebase (casual for scrappy projects, precise for enterprise)
381
+ - [ ] "How It's Used" section present with title adapted to audience (User Experience / Developer Experience / both), skipped only for pure infrastructure with no consuming audience
382
+ - [ ] Architecture diagram has labeled edges (protocols/transports) and includes a user interaction flow diagram when the system has multiple surfaces or user types
383
+
384
+ Write the file to the repo root as `ONBOARDING.md`.
385
+
386
+ ### Phase 5: Present Result
387
+
388
+ After writing, inform the user that `ONBOARDING.md` has been generated. Offer next steps using the platform's blocking question tool when available (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present numbered options in chat.
389
+
390
+ Options:
391
+ 1. Open the file for review
392
+ 2. Share to Proof
393
+ 3. Done
394
+
395
+ Based on selection:
396
+ - **Open for review** -> Open `ONBOARDING.md` using the current platform's file-open or editor mechanism
397
+ - **Share to Proof** -> Upload the document:
398
+ ```bash
399
+ CONTENT=$(cat ONBOARDING.md)
400
+ TITLE="Onboarding: <project name from inventory>"
401
+ RESPONSE=$(curl -s -X POST https://www.proofeditor.ai/share/markdown \
402
+ -H "Content-Type: application/json" \
403
+ -d "$(jq -n --arg title "$TITLE" --arg markdown "$CONTENT" --arg by "ai:compound" '{title: $title, markdown: $markdown, by: $by}')")
404
+ PROOF_URL=$(echo "$RESPONSE" | jq -r '.tokenUrl')
405
+ ```
406
+ Display `View & collaborate in Proof: <PROOF_URL>` if successful, then return to the options
407
+ - **Done** -> No further action