opencode-skills-collection 3.0.46 → 3.0.48

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 (78) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +15 -1
  2. package/bundled-skills/2slides-ppt-generator/SKILL.md +1 -1
  3. package/bundled-skills/2slides-ppt-generator/scripts/create_pdf_slides.py +2 -1
  4. package/bundled-skills/2slides-ppt-generator/scripts/generate_narration.py +2 -1
  5. package/bundled-skills/2slides-ppt-generator/scripts/generate_slides.py +13 -7
  6. package/bundled-skills/accint-solve/SKILL.md +205 -0
  7. package/bundled-skills/android-cli/SKILL.md +239 -0
  8. package/bundled-skills/android-cli/references/interact.md +83 -0
  9. package/bundled-skills/android-cli/references/journeys.md +105 -0
  10. package/bundled-skills/android-dev/references/hybrid.md +7 -4
  11. package/bundled-skills/android-dev/references/react-native.md +5 -2
  12. package/bundled-skills/atlas-contract/SKILL.md +4 -4
  13. package/bundled-skills/atlas-ledger/SKILL.md +10 -7
  14. package/bundled-skills/bun-development/SKILL.md +1 -1
  15. package/bundled-skills/cloud-penetration-testing/SKILL.md +1 -1
  16. package/bundled-skills/codebase-to-wordpress-converter/SKILL.md +1 -0
  17. package/bundled-skills/codex-fable5/SKILL.md +154 -0
  18. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  19. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  20. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  21. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  22. package/bundled-skills/docs/users/bundles.md +1 -1
  23. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  24. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  25. package/bundled-skills/docs/users/getting-started.md +1 -1
  26. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  27. package/bundled-skills/docs/users/usage.md +4 -4
  28. package/bundled-skills/docs/users/visual-guide.md +4 -4
  29. package/bundled-skills/dos-verify-done-claims/SKILL.md +173 -0
  30. package/bundled-skills/ecl-harness-engineer/LICENSE +21 -0
  31. package/bundled-skills/ecl-harness-engineer/SKILL.md +714 -0
  32. package/bundled-skills/ecl-harness-engineer/agents/analyzer.md +119 -0
  33. package/bundled-skills/ecl-harness-engineer/agents/auditor.md +212 -0
  34. package/bundled-skills/ecl-harness-engineer/agents/creator-config.md +343 -0
  35. package/bundled-skills/ecl-harness-engineer/agents/creator-docs.md +201 -0
  36. package/bundled-skills/ecl-harness-engineer/agents/creator-linters.md +123 -0
  37. package/bundled-skills/ecl-harness-engineer/references/adapters/adapter-schema.md +204 -0
  38. package/bundled-skills/ecl-harness-engineer/references/adapters/generic.md +156 -0
  39. package/bundled-skills/ecl-harness-engineer/references/adapters/go.md +212 -0
  40. package/bundled-skills/ecl-harness-engineer/references/adapters/java.md +205 -0
  41. package/bundled-skills/ecl-harness-engineer/references/adapters/python.md +225 -0
  42. package/bundled-skills/ecl-harness-engineer/references/adapters/rust.md +220 -0
  43. package/bundled-skills/ecl-harness-engineer/references/adapters/typescript.md +245 -0
  44. package/bundled-skills/ecl-harness-engineer/references/architecture-diagrams.md +420 -0
  45. package/bundled-skills/ecl-harness-engineer/references/audit-templates.md +649 -0
  46. package/bundled-skills/ecl-harness-engineer/references/capability-registry.md +485 -0
  47. package/bundled-skills/ecl-harness-engineer/references/darwin-eval-prompts.md +373 -0
  48. package/bundled-skills/ecl-harness-engineer/references/documentation-templates.md +741 -0
  49. package/bundled-skills/ecl-harness-engineer/references/durability-patterns.md +423 -0
  50. package/bundled-skills/ecl-harness-engineer/references/ecl-harness.md +1431 -0
  51. package/bundled-skills/ecl-harness-engineer/references/environment-config-guide.md +534 -0
  52. package/bundled-skills/ecl-harness-engineer/references/environment-detection-guide.md +751 -0
  53. package/bundled-skills/ecl-harness-engineer/references/eval-templates.md +377 -0
  54. package/bundled-skills/ecl-harness-engineer/references/gc-templates.md +798 -0
  55. package/bundled-skills/ecl-harness-engineer/references/greenfield-templates.md +1385 -0
  56. package/bundled-skills/ecl-harness-engineer/references/linter-templates.md +448 -0
  57. package/bundled-skills/ecl-harness-engineer/references/observability-templates.md +315 -0
  58. package/bundled-skills/efficient-web-research/SKILL.md +320 -0
  59. package/bundled-skills/environment-setup-guide/SKILL.md +2 -2
  60. package/bundled-skills/evolution/SKILL.md +1 -1
  61. package/bundled-skills/gitops-workflow/SKILL.md +1 -1
  62. package/bundled-skills/linkerd-patterns/SKILL.md +1 -1
  63. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +504 -1317
  64. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +2 -2
  65. package/bundled-skills/lovable-cleanup/SKILL.md +416 -0
  66. package/bundled-skills/monopoly/SKILL.md +397 -0
  67. package/bundled-skills/monopoly/patterns/SKILL.md +331 -0
  68. package/bundled-skills/monopoly/scale-benchmarks/SKILL.md +174 -0
  69. package/bundled-skills/monopoly/security-checklist/SKILL.md +69 -0
  70. package/bundled-skills/monopoly/tech-matrix/SKILL.md +268 -0
  71. package/bundled-skills/pagespeed-enhancer/SKILL.md +579 -0
  72. package/bundled-skills/polis-protocol/SKILL.md +6 -3
  73. package/bundled-skills/sharp-coder/SKILL.md +131 -0
  74. package/bundled-skills/unship/SKILL.md +11 -5
  75. package/bundled-skills/uv-package-manager/resources/implementation-playbook.md +1 -1
  76. package/bundled-skills/varlock/SKILL.md +2 -2
  77. package/package.json +1 -1
  78. package/skills_index.json +314 -4
@@ -0,0 +1,741 @@
1
+ # Documentation Templates
2
+
3
+ Templates for creating the documentation architecture. Following DeepWiki principles:
4
+ every claim is grounded in source code, diagrams are auto-generated from analysis, and
5
+ navigation uses a consistent numbered hierarchy.
6
+
7
+ ## Table of Contents
8
+
9
+ - [Numbered Section Convention](#numbered-section-convention)
10
+ - [Source Citation Convention](#source-citation-convention)
11
+ - [AGENTS.md Template](#agentsmd-template)
12
+ - [STATUS.md Template](#statusmd-template)
13
+ - [ARCHITECTURE.md Template](#architecturemd-template)
14
+ - [DEVELOPMENT.md Template](#developmentmd-template)
15
+ - [QUALITY.md Template](#qualitymd-template)
16
+ - [Design Document Template](#design-document-template)
17
+ - [API Reference Template](#api-reference-template)
18
+ - [Reference Document Template](#reference-document-template)
19
+
20
+ ---
21
+
22
+ ## Numbered Section Convention
23
+
24
+ All documentation uses a hierarchical numbered section system. This enables stable cross-references
25
+ between documents and makes navigation predictable for both humans and agents.
26
+
27
+ **Rules:**
28
+ 1. Top-level sections use single numbers: `## 1`, `## 2`, `## 3`
29
+ 2. Sub-sections use decimals: `### 1.1`, `### 1.2`, `### 2.1`
30
+ 3. Cross-references use the section number: "See [2.3 Data Flow](#23-data-flow)"
31
+ 4. Every project's docs share the same numbering scheme per document type
32
+
33
+ This matters because agents navigating documentation need stable anchors. If you renumber,
34
+ links break. If you don't number at all, cross-references become vague. Numbered sections
35
+ also let agents quickly locate specific information — "jump to section 3.2" is unambiguous.
36
+
37
+ ---
38
+
39
+ ## Source Citation Convention
40
+
41
+ Every technical statement in the documentation should cite its source code location. This is
42
+ what makes the documentation trustworthy and verifiable. When docs say "the auth module uses
43
+ JWT tokens", it should point to the exact file and line range where that happens.
44
+
45
+ **Format:**
46
+ ```
47
+ > Sources: [`internal/auth/jwt.go:25-48`](), [`internal/types/token.go:10-15`]()
48
+ ```
49
+
50
+ **Rules:**
51
+ 1. Place source citations after each major claim, table, or diagram
52
+ 2. Use the format `file:line` or `file:line-range`
53
+ 3. Group related sources on a single `> Sources:` line
54
+ 4. For generated diagrams, cite the files that were analyzed to produce the diagram
55
+ 5. When source files change, regenerate the citation (this is what keeps docs honest)
56
+
57
+ **Why this matters**: When an agent reads "Layer 0 packages cannot import core/", it needs
58
+ to know *where* that rule is enforced (in `scripts/lint-deps.go:42`) so it can verify the
59
+ claim and understand what happens when the rule is broken.
60
+
61
+ ---
62
+
63
+ ## AGENTS.md Template
64
+
65
+ ```markdown
66
+ # [Project Name] Agent Guide
67
+
68
+ This file is the project entry map for AI agents. It should make the target project
69
+ understandable before describing harness workflow.
70
+
71
+ ## 1 Project Snapshot
72
+
73
+ - **What it is**: [One sentence from README/source analysis: product/system purpose and audience]
74
+ - **Core workflow**: [Main user/system flow in one line]
75
+ - **Runtime shape**: [Frontend/backend/CLI/library/services and primary tech stack]
76
+ - **Start here**: [Architecture](docs/ARCHITECTURE.md), [Development](docs/DEVELOPMENT.md), [ECL](docs/ECL.md)
77
+
78
+ ## 2 Core Workflow / Domain Model
79
+
80
+ | Concept / Step | Source | What Agents Need To Know |
81
+ |----------------|--------|--------------------------|
82
+ | [Real workflow step or entity] | `[actual path]` | [Short project-specific meaning] |
83
+ | [Real workflow step or entity] | `[actual path]` | [Short project-specific meaning] |
84
+ | [Real workflow step or entity] | `[actual path]` | [Short project-specific meaning] |
85
+
86
+ ## 3 Where To Work
87
+
88
+ | Section | Document | Description |
89
+ |---------|----------|-------------|
90
+ | 3.1 | [System Architecture](docs/ARCHITECTURE.md) | Layer hierarchy, data flow, critical files |
91
+ | 3.2 | [Relevant Design Doc](docs/design/[component].md) | [Project-specific component purpose] |
92
+ | 3.3 | [API / Interface Reference](docs/references/api.md) | Public routes, commands, or module interfaces |
93
+ | 3.4 | [Configuration](docs/references/configuration.md) | Runtime env vars and service dependencies |
94
+
95
+ ## 4 Context Loading
96
+
97
+ 1. Read this file.
98
+ 2. Read [ECL](docs/ECL.md) for change lifecycle and context rules.
99
+ 3. If `harness/changes/active/summary.md` exists, read active change summary/spec/plan/tasks/reviews before any task-specific docs.
100
+ 4. If no active change exists and `harness/evolution/pending.md` exists, read it before ordinary resume work.
101
+ 5. If no active change exists and no pending evolution exists, read [Status](docs/STATUS.md) for recent handoff context.
102
+ 6. Read `README.md` for product/domain context when present.
103
+ 7. Read the relevant architecture/design/reference doc for the task.
104
+ 8. Create or update an ECL change before implementation for APIs, database schema, architecture, permissions, cross-module behavior, multi-file changes, or other non-trivial work.
105
+
106
+ ## 5 Development Commands
107
+
108
+ \`\`\`bash
109
+ [project-specific build command]
110
+ [project-specific test command]
111
+ [project-specific lint command]
112
+ [project-specific harness check command]
113
+ \`\`\`
114
+
115
+ See [Development Setup](docs/DEVELOPMENT.md) for complete reference.
116
+
117
+ ## 6 Verification
118
+
119
+ | Change Type | Minimum Verification |
120
+ |-------------|----------------------|
121
+ | [Frontend/UI or equivalent] | [project-specific command/test] |
122
+ | [Backend/API or equivalent] | [project-specific command/test] |
123
+ | [Schema/config/migration] | [project-specific command/test] |
124
+ | Harness/docs/scripts | [harness check command] |
125
+
126
+ ## 7 Safety Boundaries
127
+
128
+ - Agents may modify business/application code when the user's task requires it.
129
+ - Do not edit secrets, local env files, generated build outputs, dependency folders, uploads, or unrelated user changes.
130
+ - Active ECL change constraints are the current task source of truth and override generic project guidance and `docs/STATUS.md` for that task.
131
+ - Do not overwrite active ECL change context; park or close it through the harness script first.
132
+ - Do not hand-edit generated indexes such as `harness/changes/INDEX.json`.
133
+
134
+ ---
135
+
136
+ **Note**: This file is a project navigation map (~100 lines). Details live in linked documents.
137
+ ```
138
+
139
+ ---
140
+
141
+ ## STATUS.md Template
142
+
143
+ Use `docs/STATUS.md` as a lightweight handoff file. It should be short enough to read after
144
+ `AGENTS.md` and `docs/ECL.md` when no active change exists. It is not a replacement for
145
+ `harness/changes`.
146
+
147
+ ```markdown
148
+ # Project Status
149
+
150
+ > If `harness/changes/active/summary.md` exists, active change files are the current task
151
+ > source of truth and override this file.
152
+
153
+ ## 1 Current Active Work
154
+
155
+ - Active change: none
156
+ - Current phase: none
157
+ - Owner/context: [human/agent/session note if useful]
158
+
159
+ ## 2 Last Completed Change
160
+
161
+ - Archive summary: `harness/changes/archive/YYYY-MM-DD-slug/summary.md`
162
+ - Outcome: [one sentence]
163
+ - Validation: [latest relevant gate result]
164
+
165
+ ## 3 Next Recommended Work
166
+
167
+ - [Specific next step or "No pending handoff work."]
168
+
169
+ ## 4 Known Risks / Blockers
170
+
171
+ - [Risk, blocker, or "None known."]
172
+
173
+ ## 5 Quality Gate State
174
+
175
+ | Gate | Last Known State | Notes |
176
+ |------|------------------|-------|
177
+ | Harness | [pass/fail/unknown] | [command or reason] |
178
+ | Lint/type/test/build | [pass/fail/unknown] | [command or reason] |
179
+
180
+ ## 6 Resume Context
181
+
182
+ 1. Read `AGENTS.md`.
183
+ 2. Read `docs/ECL.md`.
184
+ 3. If an active change exists, read active change files and stop treating this file as authority.
185
+ 4. If no active change exists and `harness/evolution/pending.md` exists, handle pending harness evolution before ordinary resume work unless the user task is urgent.
186
+ 5. If continuing recent work, read the archive summary listed above.
187
+ 6. Use `harness/changes/INDEX.json` to find older related changes by module, file, tag, or failure.
188
+
189
+ ## 7 History Loading Rule
190
+
191
+ - Do not load all archive history by default.
192
+ - Start with the selected archived `summary.md`.
193
+ - Read archived spec/plan/tasks/reviews only for explicit resume, debugging, review, or failure analysis.
194
+ ```
195
+
196
+ Close-change update rule:
197
+ - Before `harness-change close`, update STATUS with completed work, validation, risks, and next step.
198
+ - After close, update STATUS with the final archive summary path.
199
+ - If `harness/evolution/pending.md` was generated and no active work remains, list harness evolution as the next recommended work.
200
+ - Run the harness lint command after the STATUS and INDEX updates.
201
+ - CI/hooks may validate STATUS, but must not auto-write it.
202
+
203
+ ---
204
+
205
+ ## ARCHITECTURE.md Template
206
+
207
+ This is the most important technical document. It should read like a DeepWiki architecture page:
208
+ grounded in source, with Mermaid diagrams, and specific file+line references.
209
+
210
+ ```markdown
211
+ # Architecture
212
+
213
+ > Last regenerated: YYYY-MM-DD
214
+ > Source analysis: [\`go.mod\`](), [\`cmd/\`](), [\`internal/\`]()
215
+
216
+ ## 1 Overview
217
+
218
+ [One paragraph: what this project does, who uses it, and the core architectural pattern.
219
+ For example: "This is a CLI tool that processes X. It follows a layered architecture with
220
+ strict dependency direction enforcement."]
221
+
222
+ ## 2 System Architecture
223
+
224
+ ### 2.1 Package Dependency Graph
225
+
226
+ \`\`\`mermaid
227
+ graph TD
228
+ subgraph "Layer 3 — Entry Points"
229
+ CMD[cmd/]
230
+ end
231
+ subgraph "Layer 2 — Business Logic"
232
+ CORE[internal/core/]
233
+ end
234
+ subgraph "Layer 1 — Utilities"
235
+ UTIL[internal/utils/]
236
+ end
237
+ subgraph "Layer 0 — Types"
238
+ TYPES[internal/types/]
239
+ end
240
+
241
+ CMD --> CORE
242
+ CORE --> UTIL
243
+ UTIL --> TYPES
244
+ CORE --> TYPES
245
+
246
+ style TYPES fill:#e8f5e9
247
+ style UTIL fill:#e3f2fd
248
+ style CORE fill:#fff3e0
249
+ style CMD fill:#f3e5f5
250
+ \`\`\`
251
+
252
+ > Sources: [\`go.mod\`](), [\`cmd/root.go:1-15\`](), [\`internal/core/core.go:1-10\`]()
253
+
254
+ ### 2.2 Layer Hierarchy
255
+
256
+ | Layer | Packages | Can Import | Cannot Import |
257
+ |-------|----------|------------|---------------|
258
+ | L0 | \`internal/types/\` | stdlib only | anything internal |
259
+ | L1 | \`internal/utils/\` | L0 | L2, L3 |
260
+ | L2 | \`internal/core/\` | L0, L1 | L3 |
261
+ | L3 | \`cmd/\` | L0, L1, L2 | — |
262
+
263
+ > Enforced by: [\`scripts/lint-deps.go\`]()
264
+
265
+ ### 2.3 Forbidden Dependencies
266
+
267
+ These are not style suggestions — they are mechanically enforced by the linter:
268
+
269
+ - \`internal/types/\` must not import any internal package
270
+ - \`internal/core/\` must not import \`cmd/\`
271
+ - Peer packages at the same layer must not import each other
272
+
273
+ > Enforced by: [\`scripts/lint-deps.go:30-45\`]()
274
+
275
+ ## 3 Core Components
276
+
277
+ ### 3.1 [Component A Name]
278
+
279
+ **Purpose**: [what it does in one sentence]
280
+ **Location**: \`internal/core/component_a.go\`
281
+ **Lines**: ~XXX
282
+
283
+ \`\`\`mermaid
284
+ classDiagram
285
+ class ComponentA {
286
+ <<interface>>
287
+ +Method1(ctx context.Context) error
288
+ +Method2(input Input) (Output, error)
289
+ }
290
+ note for ComponentA "Defined in internal/core/component_a.go:18"
291
+ \`\`\`
292
+
293
+ **Key Types:**
294
+
295
+ | Type | File | Line | Purpose |
296
+ |------|------|------|---------|
297
+ | \`ComponentA\` | \`internal/core/component_a.go\` | 18 | Main interface |
298
+ | \`componentAImpl\` | \`internal/core/component_a.go\` | 35 | Default implementation |
299
+ | \`ComponentAConfig\` | \`internal/types/config.go\` | 22 | Configuration options |
300
+
301
+ > Sources: [\`internal/core/component_a.go:18-65\`](), [\`internal/types/config.go:22-30\`]()
302
+
303
+ ### 3.2 [Component B Name]
304
+
305
+ [Same structure as 3.1]
306
+
307
+ ## 4 Data Flow
308
+
309
+ ### 4.1 Primary Request Flow
310
+
311
+ \`\`\`mermaid
312
+ sequenceDiagram
313
+ participant User
314
+ participant CLI as CLI (cmd/root.go)
315
+ participant Core as Core (internal/core/)
316
+ participant Store as Storage (internal/storage/)
317
+
318
+ User->>CLI: command args
319
+ CLI->>Core: Process(args)
320
+ Core->>Store: Read/Write data
321
+ Store-->>Core: Result
322
+ Core-->>CLI: Output
323
+ CLI-->>User: Display
324
+ \`\`\`
325
+
326
+ > Sources: [\`cmd/root.go:42-58\`](), [\`internal/core/processor.go:15-33\`]()
327
+
328
+ ### 4.2 Error Handling Flow
329
+
330
+ \`\`\`
331
+ User Input → Validate → Process → Output
332
+ ↓ ↓
333
+ ValidationErr ProcessErr
334
+ ↓ ↓
335
+ Error Response (with typed error code)
336
+ \`\`\`
337
+
338
+ > See [3.2 Error Codes](references/error-codes.md) for the complete error taxonomy.
339
+
340
+ ## 5 Critical Files
341
+
342
+ | File | Lines | Purpose | Key Exports |
343
+ |------|-------|---------|-------------|
344
+ | \`main.go\` | ~15 | Entry point | \`main()\` |
345
+ | \`cmd/root.go\` | ~80 | CLI structure | \`Execute()\` |
346
+ | \`internal/types/types.go\` | ~100 | Type definitions | \`Config\`, \`Result\`, \`Error\` |
347
+ | \`internal/core/core.go\` | ~200 | Business logic | \`Process()\`, \`Validate()\` |
348
+
349
+ ## 6 Key Design Decisions
350
+
351
+ | # | Decision | Rationale | Alternatives Considered |
352
+ |---|----------|-----------|------------------------|
353
+ | 1 | [Decision A] | [Why this was chosen] | [What else was considered] |
354
+ | 2 | [Decision B] | [Why this was chosen] | [What else was considered] |
355
+ | 3 | [Decision C] | [Why this was chosen] | [What else was considered] |
356
+
357
+ ## 7 Module & Dependencies
358
+
359
+ \`\`\`
360
+ module [module-path]
361
+ go X.XX
362
+ \`\`\`
363
+
364
+ **External Dependencies:**
365
+
366
+ | Dependency | Version | Purpose |
367
+ |------------|---------|---------|
368
+ | \`dep-a\` | v1.2.3 | [Purpose] |
369
+ | \`dep-b\` | v4.5.6 | [Purpose] |
370
+
371
+ > Sources: [\`go.mod\`](), [\`go.sum\`]()
372
+
373
+ ## See Also
374
+
375
+ - [2.2 Component A Design](design/component-a.md)
376
+ - [2.3 Component B Design](design/component-b.md)
377
+ - [3.1 API Catalog](references/api.md)
378
+ ```
379
+
380
+ ---
381
+
382
+ ## DEVELOPMENT.md Template
383
+
384
+ ```markdown
385
+ # Development Setup
386
+
387
+ ## 1 Prerequisites
388
+
389
+ - Language runtime X.XX+
390
+ - Build tool Y
391
+ - Dependencies Z
392
+
393
+ ## 2 Quick Start
394
+
395
+ \`\`\`bash
396
+ # Clone and setup
397
+ git clone <repo>
398
+ cd <project>
399
+
400
+ # Install dependencies
401
+ make deps
402
+
403
+ # Build
404
+ make build
405
+
406
+ # Test
407
+ make test
408
+ \`\`\`
409
+
410
+ ## 3 Build Commands
411
+
412
+ | Command | Description | Duration |
413
+ |---------|-------------|----------|
414
+ | \`make build\` | Build for current platform | ~5s |
415
+ | \`make test\` | Run all tests | ~30s |
416
+ | \`make lint\` | Run all linters | ~10s |
417
+ | \`make lint-arch\` | Run architecture linters | ~5s |
418
+ | \`make clean\` | Clean build artifacts | ~1s |
419
+
420
+ ## 4 Test Commands
421
+
422
+ | Command | Description | Scope |
423
+ |---------|-------------|-------|
424
+ | \`make test\` | All tests | Full |
425
+ | \`go test -v ./path/...\` | Specific package | Package |
426
+ | \`go test -run TestX ./\` | Specific test | Single |
427
+
428
+ ## 5 Project Structure
429
+
430
+ \`\`\`
431
+ .
432
+ ├── cmd/ — CLI commands (Layer 3)
433
+ ├── internal/
434
+ │ ├── core/ — Business logic (Layer 2)
435
+ │ ├── types/ — Type definitions (Layer 0)
436
+ │ └── utils/ — Utilities (Layer 1)
437
+ ├── docs/ — Documentation
438
+ ├── scripts/ — Linters and tooling
439
+ ├── harness/ — Eval & quality
440
+ └── tests/ — Test fixtures
441
+ \`\`\`
442
+
443
+ ## 6 Configuration
444
+
445
+ | Config File | Location | Purpose |
446
+ |-------------|----------|---------|
447
+ | User config | \`~/.project/config.json\` | Per-user settings |
448
+ | Project config | \`.project/config.json\` | Project-wide settings |
449
+
450
+ ## 7 Environment Variables
451
+
452
+ | Variable | Default | Required | Description |
453
+ |----------|---------|----------|-------------|
454
+ | \`API_KEY\` | — | Yes | API authentication |
455
+ | \`DEBUG\` | \`false\` | No | Enable debug mode |
456
+ | \`LOG_LEVEL\` | \`info\` | No | Logging verbosity |
457
+ ```
458
+
459
+ ---
460
+
461
+ ## QUALITY.md Template
462
+
463
+ ```markdown
464
+ # Quality Standards
465
+
466
+ Golden principles enforced by \`scripts/lint-quality.go\`.
467
+
468
+ ## 1 Structured Logging
469
+
470
+ > Enforced by: [\`scripts/lint-quality.go:28-45\`]()
471
+
472
+ \`\`\`go
473
+ // ✓ Good — structured, parseable, queryable
474
+ logger.Info("operation completed", zap.String("key", value))
475
+
476
+ // ✗ Bad — unstructured, hard to parse
477
+ log.Printf("operation completed: %v", value)
478
+ \`\`\`
479
+
480
+ ## 2 Error Handling
481
+
482
+ ### 2.1 Use Typed Errors
483
+ \`\`\`go
484
+ // ✓ Good — typed, machine-readable
485
+ return NewError(ErrCodeNotFound, "resource not found")
486
+
487
+ // ✗ Bad — stringly typed
488
+ return fmt.Errorf("not found")
489
+ \`\`\`
490
+
491
+ ### 2.2 Wrap with Context
492
+ \`\`\`go
493
+ // ✓ Good — preserves error chain
494
+ return fmt.Errorf("reading config: %w", err)
495
+
496
+ // ✗ Bad — loses context
497
+ return err
498
+ \`\`\`
499
+
500
+ ## 3 File Size Limits
501
+
502
+ > Enforced by: [\`scripts/lint-quality.go:50-62\`]()
503
+
504
+ - Maximum **1000 lines** per file
505
+ - Split large files into focused modules
506
+ - When a file approaches 800 lines, plan the split
507
+
508
+ ## 4 Naming Conventions
509
+
510
+ | Category | Convention | Example |
511
+ |----------|-----------|---------|
512
+ | Types | PascalCase | \`UserConfig\` |
513
+ | Exported Functions | PascalCase | \`NewConfig()\` |
514
+ | Unexported Functions | camelCase | \`parseInput()\` |
515
+ | Constants | PascalCase | \`MaxRetries\` |
516
+ | Packages | lowercase | \`config\`, \`auth\` |
517
+
518
+ ## 5 Enforcement
519
+
520
+ \`\`\`bash
521
+ make lint-arch # Run all architecture linters
522
+ \`\`\`
523
+
524
+ See [\`scripts/lint-quality.go\`]() for the complete set of enforced rules.
525
+ ```
526
+
527
+ ---
528
+
529
+ ## Design Document Template
530
+
531
+ Design documents go deeper than the architecture overview. Each one covers a single component
532
+ with enough detail for an agent to understand the component's role, modify it correctly,
533
+ and verify the modification is sound.
534
+
535
+ ```markdown
536
+ # [Component Name]
537
+
538
+ > Last updated: YYYY-MM-DD
539
+ > Primary source: [\`path/to/main/file.go\`]()
540
+
541
+ ## 1 Overview
542
+
543
+ [What this component does and why it exists. One paragraph max.]
544
+
545
+ ## 2 Architecture
546
+
547
+ ### 2.1 Component Diagram
548
+
549
+ \`\`\`mermaid
550
+ graph TD
551
+ A[Public API] --> B[Internal Logic]
552
+ B --> C[Storage]
553
+ B --> D[External Service]
554
+ \`\`\`
555
+
556
+ > Sources: [\`internal/core/component.go\`]()
557
+
558
+ ### 2.2 Key Interfaces
559
+
560
+ \`\`\`go
561
+ // Defined in internal/core/component.go:18
562
+ type Component interface {
563
+ Method1() Result
564
+ Method2(input Input) (Output, error)
565
+ }
566
+ \`\`\`
567
+
568
+ > Sources: [\`internal/core/component.go:18-24\`]()
569
+
570
+ ### 2.3 Key Types
571
+
572
+ | Type | File | Line | Fields | Purpose |
573
+ |------|------|------|--------|---------|
574
+ | \`componentImpl\` | \`component.go\` | 35 | \`field1\`, \`field2\` | Default implementation |
575
+ | \`ComponentConfig\` | \`types.go\` | 22 | \`timeout\`, \`retries\` | Configuration |
576
+
577
+ > Sources: [\`internal/core/component.go:35-50\`](), [\`internal/types/types.go:22-28\`]()
578
+
579
+ ## 3 Execution Flow
580
+
581
+ \`\`\`mermaid
582
+ sequenceDiagram
583
+ participant Caller
584
+ participant Comp as Component
585
+ participant Dep as Dependency
586
+
587
+ Caller->>Comp: Method1()
588
+ Comp->>Dep: FetchData()
589
+ Dep-->>Comp: Data
590
+ Comp-->>Caller: Result
591
+ \`\`\`
592
+
593
+ > Sources: [\`internal/core/component.go:55-72\`]()
594
+
595
+ ## 4 Configuration
596
+
597
+ | Option | Type | Default | Validation | Description |
598
+ |--------|------|---------|------------|-------------|
599
+ | \`timeout\` | \`time.Duration\` | \`30s\` | > 0 | Request timeout |
600
+ | \`retries\` | \`int\` | \`3\` | 0-10 | Max retry count |
601
+
602
+ > Sources: [\`internal/types/config.go:15-25\`]()
603
+
604
+ ## 5 Error Handling
605
+
606
+ | Error | Code | When | Recovery |
607
+ |-------|------|------|----------|
608
+ | \`ErrNotFound\` | 1001 | Resource doesn't exist | Return 404 |
609
+ | \`ErrTimeout\` | 1002 | Request exceeded timeout | Retry with backoff |
610
+
611
+ ## 6 Usage Examples
612
+
613
+ \`\`\`go
614
+ // Basic usage
615
+ comp := NewComponent(config)
616
+ result, err := comp.Method1()
617
+ if err != nil {
618
+ // Handle typed error
619
+ }
620
+ \`\`\`
621
+
622
+ ## 7 Testing
623
+
624
+ | Test File | Coverage | What It Tests |
625
+ |-----------|----------|---------------|
626
+ | \`component_test.go\` | 85% | Core logic, edge cases |
627
+ | \`component_integration_test.go\` | 70% | End-to-end with dependencies |
628
+
629
+ ## See Also
630
+
631
+ - [Architecture Overview](../ARCHITECTURE.md#31-component-name) — Section 3.1
632
+ - [Related Component](related.md) — How it interacts with this component
633
+ ```
634
+
635
+ ---
636
+
637
+ ## API Reference Template
638
+
639
+ For projects with a public API surface (HTTP, gRPC, library, CLI).
640
+
641
+ ```markdown
642
+ # API Reference
643
+
644
+ > Auto-generated from source analysis on YYYY-MM-DD
645
+
646
+ ## 1 Summary
647
+
648
+ | Endpoint / Function | Method | Purpose |
649
+ |---------------------|--------|---------|
650
+ | \`/api/v1/users\` | GET | List users |
651
+ | \`/api/v1/users/:id\` | GET | Get user by ID |
652
+ | \`/api/v1/users\` | POST | Create user |
653
+ | \`NewClient(cfg)\` | — | Create API client |
654
+
655
+ ## 2 Endpoints
656
+
657
+ ### 2.1 List Users
658
+
659
+ \`\`\`
660
+ GET /api/v1/users?page=1&limit=20
661
+ \`\`\`
662
+
663
+ **Parameters:**
664
+
665
+ | Name | Type | Required | Default | Description |
666
+ |------|------|----------|---------|-------------|
667
+ | \`page\` | int | No | 1 | Page number |
668
+ | \`limit\` | int | No | 20 | Items per page |
669
+
670
+ **Response:**
671
+
672
+ \`\`\`json
673
+ {
674
+ "users": [{"id": "abc", "name": "Alice"}],
675
+ "total": 42,
676
+ "page": 1
677
+ }
678
+ \`\`\`
679
+
680
+ > Handler: [\`api/handlers/user.go:25-48\`]()
681
+ > Types: [\`internal/types/user.go:10-18\`]()
682
+
683
+ ### 2.2 Get User
684
+
685
+ [Same structure]
686
+
687
+ ## 3 Error Responses
688
+
689
+ | Status | Code | Message | When |
690
+ |--------|------|---------|------|
691
+ | 400 | \`INVALID_INPUT\` | "Invalid request body" | Malformed JSON |
692
+ | 404 | \`NOT_FOUND\` | "Resource not found" | ID doesn't exist |
693
+ | 500 | \`INTERNAL\` | "Internal server error" | Unexpected failure |
694
+
695
+ > Error types defined in: [\`internal/types/errors.go:12-35\`]()
696
+ ```
697
+
698
+ ---
699
+
700
+ ## Reference Document Template
701
+
702
+ ```markdown
703
+ # [Reference Name]
704
+
705
+ > Last updated: YYYY-MM-DD
706
+ > Extracted from: [\`path/to/source\`]()
707
+
708
+ ## 1 Overview
709
+
710
+ Complete reference for [topic].
711
+
712
+ ## 2 Summary Table
713
+
714
+ | Item | Constant | Category | File | Line | Description |
715
+ |------|----------|----------|------|------|-------------|
716
+ | A | \`ConstA\` | Cat1 | \`types.go\` | 15 | Does X |
717
+ | B | \`ConstB\` | Cat2 | \`types.go\` | 22 | Does Y |
718
+
719
+ ## 3 Details
720
+
721
+ ### 3.1 Item A
722
+
723
+ [Detailed description]
724
+
725
+ \`\`\`go
726
+ // From types.go:15
727
+ const ConstA = "value"
728
+ \`\`\`
729
+
730
+ > Sources: [\`internal/types/types.go:15\`]()
731
+
732
+ ### 3.2 Item B
733
+
734
+ [Detailed description]
735
+
736
+ > Sources: [\`internal/types/types.go:22\`]()
737
+
738
+ ## See Also
739
+
740
+ - [Related Reference](related.md)
741
+ ```