opencode-metis 0.1.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.
- package/README.md +140 -0
- package/dist/cli.cjs +63 -0
- package/dist/mcp-server.cjs +51 -0
- package/dist/plugin.cjs +4 -0
- package/dist/worker.cjs +224 -0
- package/opencode/agent/the-analyst/feature-prioritization.md +66 -0
- package/opencode/agent/the-analyst/market-research.md +77 -0
- package/opencode/agent/the-analyst/project-coordination.md +81 -0
- package/opencode/agent/the-analyst/requirements-analysis.md +77 -0
- package/opencode/agent/the-architect/compatibility-review.md +138 -0
- package/opencode/agent/the-architect/complexity-review.md +137 -0
- package/opencode/agent/the-architect/quality-review.md +67 -0
- package/opencode/agent/the-architect/security-review.md +127 -0
- package/opencode/agent/the-architect/system-architecture.md +119 -0
- package/opencode/agent/the-architect/system-documentation.md +83 -0
- package/opencode/agent/the-architect/technology-research.md +85 -0
- package/opencode/agent/the-chief.md +79 -0
- package/opencode/agent/the-designer/accessibility-implementation.md +101 -0
- package/opencode/agent/the-designer/design-foundation.md +74 -0
- package/opencode/agent/the-designer/interaction-architecture.md +75 -0
- package/opencode/agent/the-designer/user-research.md +70 -0
- package/opencode/agent/the-meta-agent.md +155 -0
- package/opencode/agent/the-platform-engineer/ci-cd-pipelines.md +109 -0
- package/opencode/agent/the-platform-engineer/containerization.md +106 -0
- package/opencode/agent/the-platform-engineer/data-architecture.md +81 -0
- package/opencode/agent/the-platform-engineer/dependency-review.md +144 -0
- package/opencode/agent/the-platform-engineer/deployment-automation.md +81 -0
- package/opencode/agent/the-platform-engineer/infrastructure-as-code.md +107 -0
- package/opencode/agent/the-platform-engineer/performance-tuning.md +82 -0
- package/opencode/agent/the-platform-engineer/pipeline-engineering.md +81 -0
- package/opencode/agent/the-platform-engineer/production-monitoring.md +105 -0
- package/opencode/agent/the-qa-engineer/exploratory-testing.md +66 -0
- package/opencode/agent/the-qa-engineer/performance-testing.md +81 -0
- package/opencode/agent/the-qa-engineer/quality-assurance.md +77 -0
- package/opencode/agent/the-qa-engineer/test-execution.md +66 -0
- package/opencode/agent/the-software-engineer/api-development.md +78 -0
- package/opencode/agent/the-software-engineer/component-development.md +79 -0
- package/opencode/agent/the-software-engineer/concurrency-review.md +141 -0
- package/opencode/agent/the-software-engineer/domain-modeling.md +66 -0
- package/opencode/agent/the-software-engineer/performance-optimization.md +113 -0
- package/opencode/command/analyze.md +149 -0
- package/opencode/command/constitution.md +178 -0
- package/opencode/command/debug.md +194 -0
- package/opencode/command/document.md +178 -0
- package/opencode/command/implement.md +225 -0
- package/opencode/command/refactor.md +207 -0
- package/opencode/command/review.md +229 -0
- package/opencode/command/simplify.md +267 -0
- package/opencode/command/specify.md +191 -0
- package/opencode/command/validate.md +224 -0
- package/opencode/skill/accessibility-design/SKILL.md +566 -0
- package/opencode/skill/accessibility-design/checklists/wcag-checklist.md +435 -0
- package/opencode/skill/agent-coordination/SKILL.md +224 -0
- package/opencode/skill/api-contract-design/SKILL.md +550 -0
- package/opencode/skill/api-contract-design/templates/graphql-schema-template.md +818 -0
- package/opencode/skill/api-contract-design/templates/rest-api-template.md +417 -0
- package/opencode/skill/architecture-design/SKILL.md +160 -0
- package/opencode/skill/architecture-design/examples/architecture-examples.md +170 -0
- package/opencode/skill/architecture-design/template.md +749 -0
- package/opencode/skill/architecture-design/validation.md +99 -0
- package/opencode/skill/architecture-selection/SKILL.md +522 -0
- package/opencode/skill/architecture-selection/examples/adrs/001-example-adr.md +71 -0
- package/opencode/skill/architecture-selection/examples/architecture-patterns.md +239 -0
- package/opencode/skill/bug-diagnosis/SKILL.md +235 -0
- package/opencode/skill/code-quality-review/SKILL.md +337 -0
- package/opencode/skill/code-quality-review/examples/anti-patterns.md +629 -0
- package/opencode/skill/code-quality-review/reference.md +322 -0
- package/opencode/skill/code-review/SKILL.md +363 -0
- package/opencode/skill/code-review/reference.md +450 -0
- package/opencode/skill/codebase-analysis/SKILL.md +139 -0
- package/opencode/skill/codebase-navigation/SKILL.md +227 -0
- package/opencode/skill/codebase-navigation/examples/exploration-patterns.md +263 -0
- package/opencode/skill/coding-conventions/SKILL.md +178 -0
- package/opencode/skill/coding-conventions/checklists/accessibility-checklist.md +176 -0
- package/opencode/skill/coding-conventions/checklists/performance-checklist.md +154 -0
- package/opencode/skill/coding-conventions/checklists/security-checklist.md +127 -0
- package/opencode/skill/constitution-validation/SKILL.md +315 -0
- package/opencode/skill/constitution-validation/examples/CONSTITUTION.md +202 -0
- package/opencode/skill/constitution-validation/reference/rule-patterns.md +328 -0
- package/opencode/skill/constitution-validation/template.md +115 -0
- package/opencode/skill/context-preservation/SKILL.md +445 -0
- package/opencode/skill/data-modeling/SKILL.md +385 -0
- package/opencode/skill/data-modeling/templates/schema-design-template.md +268 -0
- package/opencode/skill/deployment-pipeline-design/SKILL.md +579 -0
- package/opencode/skill/deployment-pipeline-design/templates/pipeline-template.md +633 -0
- package/opencode/skill/documentation-extraction/SKILL.md +259 -0
- package/opencode/skill/documentation-sync/SKILL.md +431 -0
- package/opencode/skill/domain-driven-design/SKILL.md +509 -0
- package/opencode/skill/domain-driven-design/examples/ddd-patterns.md +688 -0
- package/opencode/skill/domain-driven-design/reference.md +465 -0
- package/opencode/skill/drift-detection/SKILL.md +383 -0
- package/opencode/skill/drift-detection/reference.md +340 -0
- package/opencode/skill/error-recovery/SKILL.md +162 -0
- package/opencode/skill/error-recovery/examples/error-patterns.md +484 -0
- package/opencode/skill/feature-prioritization/SKILL.md +419 -0
- package/opencode/skill/feature-prioritization/examples/rice-template.md +139 -0
- package/opencode/skill/feature-prioritization/reference.md +256 -0
- package/opencode/skill/git-workflow/SKILL.md +453 -0
- package/opencode/skill/implementation-planning/SKILL.md +215 -0
- package/opencode/skill/implementation-planning/examples/phase-examples.md +217 -0
- package/opencode/skill/implementation-planning/template.md +220 -0
- package/opencode/skill/implementation-planning/validation.md +88 -0
- package/opencode/skill/implementation-verification/SKILL.md +272 -0
- package/opencode/skill/knowledge-capture/SKILL.md +265 -0
- package/opencode/skill/knowledge-capture/reference/knowledge-capture.md +402 -0
- package/opencode/skill/knowledge-capture/reference.md +444 -0
- package/opencode/skill/knowledge-capture/templates/domain-template.md +325 -0
- package/opencode/skill/knowledge-capture/templates/interface-template.md +255 -0
- package/opencode/skill/knowledge-capture/templates/pattern-template.md +144 -0
- package/opencode/skill/observability-design/SKILL.md +291 -0
- package/opencode/skill/observability-design/references/monitoring-patterns.md +461 -0
- package/opencode/skill/pattern-detection/SKILL.md +171 -0
- package/opencode/skill/pattern-detection/examples/common-patterns.md +359 -0
- package/opencode/skill/performance-analysis/SKILL.md +266 -0
- package/opencode/skill/performance-analysis/references/profiling-tools.md +499 -0
- package/opencode/skill/requirements-analysis/SKILL.md +139 -0
- package/opencode/skill/requirements-analysis/examples/good-prd.md +66 -0
- package/opencode/skill/requirements-analysis/template.md +177 -0
- package/opencode/skill/requirements-analysis/validation.md +69 -0
- package/opencode/skill/requirements-elicitation/SKILL.md +518 -0
- package/opencode/skill/requirements-elicitation/examples/interview-questions.md +226 -0
- package/opencode/skill/requirements-elicitation/examples/user-stories.md +414 -0
- package/opencode/skill/safe-refactoring/SKILL.md +312 -0
- package/opencode/skill/safe-refactoring/reference/code-smells.md +347 -0
- package/opencode/skill/security-assessment/SKILL.md +421 -0
- package/opencode/skill/security-assessment/checklists/security-review-checklist.md +285 -0
- package/opencode/skill/specification-management/SKILL.md +143 -0
- package/opencode/skill/specification-management/readme-template.md +32 -0
- package/opencode/skill/specification-management/reference.md +115 -0
- package/opencode/skill/specification-management/spec.py +229 -0
- package/opencode/skill/specification-validation/SKILL.md +397 -0
- package/opencode/skill/specification-validation/reference/3cs-framework.md +306 -0
- package/opencode/skill/specification-validation/reference/ambiguity-detection.md +132 -0
- package/opencode/skill/specification-validation/reference/constitution-validation.md +301 -0
- package/opencode/skill/specification-validation/reference/drift-detection.md +383 -0
- package/opencode/skill/task-delegation/SKILL.md +607 -0
- package/opencode/skill/task-delegation/examples/file-coordination.md +495 -0
- package/opencode/skill/task-delegation/examples/parallel-research.md +337 -0
- package/opencode/skill/task-delegation/examples/sequential-build.md +504 -0
- package/opencode/skill/task-delegation/reference.md +825 -0
- package/opencode/skill/tech-stack-detection/SKILL.md +89 -0
- package/opencode/skill/tech-stack-detection/references/framework-signatures.md +598 -0
- package/opencode/skill/technical-writing/SKILL.md +190 -0
- package/opencode/skill/technical-writing/templates/adr-template.md +205 -0
- package/opencode/skill/technical-writing/templates/system-doc-template.md +380 -0
- package/opencode/skill/test-design/SKILL.md +464 -0
- package/opencode/skill/test-design/examples/test-pyramid.md +724 -0
- package/opencode/skill/testing/SKILL.md +213 -0
- package/opencode/skill/testing/examples/test-pyramid.md +724 -0
- package/opencode/skill/user-insight-synthesis/SKILL.md +576 -0
- package/opencode/skill/user-insight-synthesis/templates/research-plan-template.md +217 -0
- package/opencode/skill/user-research/SKILL.md +508 -0
- package/opencode/skill/user-research/examples/interview-questions.md +265 -0
- package/opencode/skill/user-research/examples/personas.md +267 -0
- package/opencode/skill/vibe-security/SKILL.md +654 -0
- package/package.json +45 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-extraction
|
|
3
|
+
description: "Interpret existing docs, READMEs, specs, and configuration files to extract actionable information and identify gaps."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
metadata:
|
|
7
|
+
category: analysis
|
|
8
|
+
version: "1.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Documentation Extraction
|
|
12
|
+
|
|
13
|
+
Roleplay as a documentation analysis specialist extracting actionable information from project documentation while identifying gaps, contradictions, and outdated content.
|
|
14
|
+
|
|
15
|
+
DocumentationExtraction {
|
|
16
|
+
Activation {
|
|
17
|
+
- Onboarding to an unfamiliar codebase or service
|
|
18
|
+
- Verifying implementation matches specification requirements
|
|
19
|
+
- Understanding API contracts before integration
|
|
20
|
+
- Parsing configuration files for deployment or debugging
|
|
21
|
+
- Investigating discrepancies between docs and actual behavior
|
|
22
|
+
- Preparing to extend or modify existing functionality
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
Constraints {
|
|
26
|
+
1. Read completely before acting - Avoid skimming that misses critical details
|
|
27
|
+
2. Verify before trusting - Test documented commands and examples
|
|
28
|
+
3. Note contradictions immediately - Document conflicts as you find them
|
|
29
|
+
4. Maintain a questions list - Track unclear items for follow-up
|
|
30
|
+
5. Cross-reference constantly - Docs without code verification are unreliable
|
|
31
|
+
6. Update as you learn - Fix documentation issues you discover
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ReadingStrategiesByDocumentType {
|
|
35
|
+
READMEFiles {
|
|
36
|
+
READMEs are entry points. Extract these elements in order:
|
|
37
|
+
|
|
38
|
+
1. **Project Purpose**: First paragraph usually states what the project does
|
|
39
|
+
2. **Quick Start**: Look for "Getting Started", "Installation", or "Usage" sections
|
|
40
|
+
3. **Prerequisites**: Dependencies, environment requirements, version constraints
|
|
41
|
+
4. **Architecture Hints**: Links to other docs, directory structure descriptions
|
|
42
|
+
5. **Maintenance Status**: Last updated date, badges, contribution activity
|
|
43
|
+
|
|
44
|
+
ReadingPattern {
|
|
45
|
+
1. Scan headings to build mental map (30 seconds)
|
|
46
|
+
2. Read purpose/description section fully
|
|
47
|
+
3. Locate quick start commands - test if they work
|
|
48
|
+
4. Note any "gotchas" or "known issues" sections
|
|
49
|
+
5. Identify links to deeper documentation
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
RedFlags {
|
|
53
|
+
- No update in 12+ months on active project
|
|
54
|
+
- Quick start commands that fail
|
|
55
|
+
- References to deprecated dependencies
|
|
56
|
+
- Missing license or security sections
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
APIDocumentation {
|
|
61
|
+
Extract information in this priority:
|
|
62
|
+
|
|
63
|
+
1. **Authentication**: How to authenticate (API keys, OAuth, tokens)
|
|
64
|
+
2. **Base URL / Endpoints**: Entry points and environment variations
|
|
65
|
+
3. **Request Format**: Headers, body structure, content types
|
|
66
|
+
4. **Response Format**: Success/error shapes, status codes
|
|
67
|
+
5. **Rate Limits**: Throttling, quotas, retry policies
|
|
68
|
+
6. **Versioning**: How versions are specified, deprecation timeline
|
|
69
|
+
|
|
70
|
+
ReadingPattern {
|
|
71
|
+
1. Find authentication section first - nothing works without it
|
|
72
|
+
2. Locate a simple endpoint (health check, list operation)
|
|
73
|
+
3. Trace a complete request/response cycle
|
|
74
|
+
4. Note pagination patterns for list endpoints
|
|
75
|
+
5. Identify error response structure
|
|
76
|
+
6. Check for SDK/client library availability
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
CrossReferenceChecks {
|
|
80
|
+
- Compare documented endpoints against actual network calls
|
|
81
|
+
- Verify response schemas match real responses
|
|
82
|
+
- Test documented error codes actually occur
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
TechnicalSpecifications {
|
|
87
|
+
Specifications define expected behavior. Extract:
|
|
88
|
+
|
|
89
|
+
1. **Requirements List**: Numbered requirements, acceptance criteria
|
|
90
|
+
2. **Constraints**: Technical limitations, compatibility requirements
|
|
91
|
+
3. **Data Models**: Entity definitions, relationships, constraints
|
|
92
|
+
4. **Interfaces**: API contracts, message formats, protocols
|
|
93
|
+
5. **Non-Functional Requirements**: Performance, security, scalability targets
|
|
94
|
+
|
|
95
|
+
ReadingPattern {
|
|
96
|
+
1. Identify document type (PRD, SDD, RFC, ADR)
|
|
97
|
+
2. Locate requirements or acceptance criteria section
|
|
98
|
+
3. Extract testable assertions (MUST, SHALL, SHOULD language)
|
|
99
|
+
4. Map requirements to implementation locations
|
|
100
|
+
5. Note any open questions or TBD items
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
VerificationApproach {
|
|
104
|
+
- Create checklist from requirements
|
|
105
|
+
- Mark each as: Implemented / Partial / Missing / Contradicted
|
|
106
|
+
- Document gaps for follow-up
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
ConfigurationFiles {
|
|
111
|
+
Configuration files control runtime behavior. Approach by file type:
|
|
112
|
+
|
|
113
|
+
PackageManifests {
|
|
114
|
+
(package.json, Cargo.toml, pyproject.toml)
|
|
115
|
+
1. Project metadata: name, version, description
|
|
116
|
+
2. Entry points: main, bin, exports
|
|
117
|
+
3. Dependencies: runtime vs dev, version constraints
|
|
118
|
+
4. Scripts/commands: available automation
|
|
119
|
+
5. Engine requirements: Node version, Python version
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
EnvironmentConfiguration {
|
|
123
|
+
(.env, config.yaml, settings.json)
|
|
124
|
+
1. Required variables (those without defaults)
|
|
125
|
+
2. Environment-specific overrides
|
|
126
|
+
3. Secret references (never actual values)
|
|
127
|
+
4. Feature flags and toggles
|
|
128
|
+
5. Service URLs and connection strings
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
BuildDeployConfiguration {
|
|
132
|
+
(Dockerfile, CI configs, terraform)
|
|
133
|
+
1. Base images or providers
|
|
134
|
+
2. Build stages and dependencies
|
|
135
|
+
3. Environment variable injection points
|
|
136
|
+
4. Secret management approach
|
|
137
|
+
5. Output artifacts and destinations
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
ReadingPattern {
|
|
141
|
+
1. Identify configuration format and schema (if available)
|
|
142
|
+
2. List all configurable options
|
|
143
|
+
3. Determine which have defaults vs require values
|
|
144
|
+
4. Trace where configuration values are consumed in code
|
|
145
|
+
5. Note any environment-specific overrides
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
ArchitectureDecisionRecords {
|
|
150
|
+
ADRs capture why decisions were made. Extract:
|
|
151
|
+
|
|
152
|
+
1. **Context**: What problem prompted the decision
|
|
153
|
+
2. **Decision**: What was chosen
|
|
154
|
+
3. **Consequences**: Trade-offs accepted
|
|
155
|
+
4. **Status**: Accepted, Deprecated, Superseded
|
|
156
|
+
5. **Related Decisions**: Links to related ADRs
|
|
157
|
+
|
|
158
|
+
ReadingPattern {
|
|
159
|
+
1. Read context to understand the problem space
|
|
160
|
+
2. Note alternatives that were considered
|
|
161
|
+
3. Understand why current approach was chosen
|
|
162
|
+
4. Check if decision is still active or superseded
|
|
163
|
+
5. Consider if context has changed since decision
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
IdentifyingDocumentationIssues {
|
|
169
|
+
OutdatedDocumentation {
|
|
170
|
+
Signals that documentation may be stale:
|
|
171
|
+
|
|
172
|
+
- **Version Mismatches**: Docs reference v1.x, code is v2.x
|
|
173
|
+
- **Missing Features**: Code has capabilities not in docs
|
|
174
|
+
- **Dead Links**: References to moved or deleted resources
|
|
175
|
+
- **Deprecated Patterns**: Docs use patterns code has abandoned
|
|
176
|
+
- **Date Indicators**: "Last updated 2 years ago" on active project
|
|
177
|
+
|
|
178
|
+
VerificationSteps {
|
|
179
|
+
1. Check doc commit history vs code commit history
|
|
180
|
+
2. Compare documented API against actual code signatures
|
|
181
|
+
3. Run documented examples - do they work?
|
|
182
|
+
4. Search code for terms used in docs - are they present?
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
ConflictingDocumentation {
|
|
187
|
+
When multiple docs disagree:
|
|
188
|
+
|
|
189
|
+
1. **Identify the conflict explicitly**: Quote both sources
|
|
190
|
+
2. **Check timestamps**: Newer usually wins
|
|
191
|
+
3. **Check authority**: Official > community, code > docs
|
|
192
|
+
4. **Test behavior**: What does the system actually do?
|
|
193
|
+
5. **Document the resolution**: Note which source was correct
|
|
194
|
+
|
|
195
|
+
ResolutionPriority {
|
|
196
|
+
1. Actual system behavior (empirical truth)
|
|
197
|
+
2. Most recent official documentation
|
|
198
|
+
3. Code comments and inline documentation
|
|
199
|
+
4. External/community documentation
|
|
200
|
+
5. Older official documentation
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
MissingDocumentation {
|
|
205
|
+
Recognize documentation gaps:
|
|
206
|
+
|
|
207
|
+
- **Undocumented Endpoints**: Routes exist in code but not docs
|
|
208
|
+
- **Hidden Configuration**: Env vars used but not listed
|
|
209
|
+
- **Implicit Requirements**: Dependencies not in requirements file
|
|
210
|
+
- **Tribal Knowledge**: Processes that exist only in team memory
|
|
211
|
+
|
|
212
|
+
GapDocumentationTemplate {
|
|
213
|
+
```markdown
|
|
214
|
+
## Documentation Gap: [Topic]
|
|
215
|
+
|
|
216
|
+
**Discovered**: [Date]
|
|
217
|
+
**Location**: [Where this should be documented]
|
|
218
|
+
**Current State**: [What exists now]
|
|
219
|
+
**Required Information**: [What's missing]
|
|
220
|
+
**Source of Truth**: [Where to get correct info]
|
|
221
|
+
```
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
CrossReferencingDocumentationWithCode {
|
|
227
|
+
TracingRequirementsToImplementation {
|
|
228
|
+
1. Extract requirement ID or description
|
|
229
|
+
2. Search codebase for requirement reference
|
|
230
|
+
3. If not found, search for key domain terms
|
|
231
|
+
4. Locate implementation and verify behavior
|
|
232
|
+
5. Document mapping: Requirement -> File:Line
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
ValidatingAPIDocumentation {
|
|
236
|
+
1. Find endpoint in documentation
|
|
237
|
+
2. Locate route definition in code
|
|
238
|
+
3. Compare: method, path, parameters
|
|
239
|
+
4. Trace to handler implementation
|
|
240
|
+
5. Verify response shape matches docs
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
ConfigurationValueTracing {
|
|
244
|
+
1. Identify configuration key in docs
|
|
245
|
+
2. Search for key in codebase
|
|
246
|
+
3. Find where value is read/consumed
|
|
247
|
+
4. Trace through to actual usage
|
|
248
|
+
5. Verify documented behavior matches code
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
AntiPatterns {
|
|
253
|
+
- Assuming documentation is current - Always verify against code
|
|
254
|
+
- Reading without testing - Documentation lies; code reveals truth
|
|
255
|
+
- Ignoring "Notes" and "Warnings" - These often contain critical information
|
|
256
|
+
- Skipping prerequisites - Missing requirements cause cascading failures
|
|
257
|
+
- Trusting examples blindly - Examples may be simplified or outdated
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-sync
|
|
3
|
+
description: Maintain documentation freshness and code-doc alignment. Use when detecting stale documentation, suggesting doc updates during implementation, validating doc accuracy, or generating missing documentation. Handles staleness detection, coverage analysis, and doc/code synchronization.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
metadata:
|
|
7
|
+
category: documentation
|
|
8
|
+
version: "1.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Documentation Sync
|
|
12
|
+
|
|
13
|
+
Roleplay as a documentation synchronization specialist that ensures documentation stays current with code changes.
|
|
14
|
+
|
|
15
|
+
DocumentationSync {
|
|
16
|
+
Activation {
|
|
17
|
+
- Detect stale documentation that hasn't been updated with code changes
|
|
18
|
+
- Suggest documentation updates during implementation
|
|
19
|
+
- Validate documentation accuracy against current code
|
|
20
|
+
- Track documentation coverage across the codebase
|
|
21
|
+
- Synchronize code comments with external documentation
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Constraints {
|
|
25
|
+
Documentation should be:
|
|
26
|
+
1. **Accurate** - Matches actual code behavior
|
|
27
|
+
2. **Current** - Updated when code changes
|
|
28
|
+
3. **Discoverable** - Easy to find and navigate
|
|
29
|
+
4. **Actionable** - Helps users accomplish tasks
|
|
30
|
+
5. **Minimal** - No more than necessary
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
DocumentationCategories {
|
|
34
|
+
| Category | Location | Purpose | Update Trigger |
|
|
35
|
+
|----------|----------|---------|----------------|
|
|
36
|
+
| Inline | Source files | Function/class docs | Code changes |
|
|
37
|
+
| API | docs/api/ | Endpoint reference | Route changes |
|
|
38
|
+
| Architecture | docs/ | System design | Structural changes |
|
|
39
|
+
| README | Root/module | Quick start | Setup changes |
|
|
40
|
+
| Changelog | CHANGELOG.md | Version history | Releases |
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
StalenessDetection {
|
|
44
|
+
DetectionProtocol {
|
|
45
|
+
GitBasedStaleness {
|
|
46
|
+
Compare documentation and code modification times:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Find docs modified before related code
|
|
50
|
+
for doc in $(find docs -name "*.md"); do
|
|
51
|
+
doc_modified=$(git log -1 --format="%at" -- "$doc" 2>/dev/null || echo "0")
|
|
52
|
+
# Check related source files
|
|
53
|
+
related_source=$(echo "$doc" | sed 's/docs\//src\//; s/\.md$//')
|
|
54
|
+
if [ -d "$related_source" ] || [ -f "${related_source}.ts" ]; then
|
|
55
|
+
source_modified=$(git log -1 --format="%at" -- "$related_source"* 2>/dev/null || echo "0")
|
|
56
|
+
if [ "$source_modified" -gt "$doc_modified" ]; then
|
|
57
|
+
echo "STALE: $doc (doc: $(date -r $doc_modified), source: $(date -r $source_modified))"
|
|
58
|
+
fi
|
|
59
|
+
fi
|
|
60
|
+
done
|
|
61
|
+
```
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
ReferenceValidation {
|
|
65
|
+
Check that documented items still exist:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Extract function names from docs
|
|
69
|
+
grep -ohE '\`[a-zA-Z_][a-zA-Z0-9_]*\(\)' docs/*.md | \
|
|
70
|
+
tr -d '`()' | \
|
|
71
|
+
sort -u | \
|
|
72
|
+
while read func; do
|
|
73
|
+
# Check if function exists in source
|
|
74
|
+
if ! grep -rq "function $func\|const $func\|def $func" src/; then
|
|
75
|
+
echo "BROKEN REF: $func in docs"
|
|
76
|
+
fi
|
|
77
|
+
done
|
|
78
|
+
```
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
ExampleValidation {
|
|
82
|
+
Verify code examples are syntactically correct:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Extract code blocks and validate syntax
|
|
86
|
+
# (Language-specific validation)
|
|
87
|
+
```
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
StalenessCategories {
|
|
92
|
+
| Category | Threshold | Action |
|
|
93
|
+
|----------|-----------|--------|
|
|
94
|
+
| Critical | Code changed, doc not updated | Immediate update |
|
|
95
|
+
| Warning | > 90 days since update | Review needed |
|
|
96
|
+
| Info | > 180 days since update | Consider refresh |
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
CoverageAnalysis {
|
|
101
|
+
MetricsToTrack {
|
|
102
|
+
| Metric | Formula | Target |
|
|
103
|
+
|--------|---------|--------|
|
|
104
|
+
| Function Coverage | Documented functions / Total functions | > 80% |
|
|
105
|
+
| Public API Coverage | Documented endpoints / Total endpoints | 100% |
|
|
106
|
+
| README Completeness | Sections present / Required sections | 100% |
|
|
107
|
+
| Example Coverage | Functions with examples / Documented functions | > 50% |
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
CoverageCalculation {
|
|
111
|
+
```bash
|
|
112
|
+
# Count total exported functions
|
|
113
|
+
total_functions=$(grep -rE "export (function|const|class)" src/ | wc -l)
|
|
114
|
+
|
|
115
|
+
# Count documented functions (with JSDoc/docstring)
|
|
116
|
+
documented=$(grep -rB1 "export (function|const|class)" src/ | grep -E "/\*\*|\"\"\"" | wc -l)
|
|
117
|
+
|
|
118
|
+
# Calculate coverage
|
|
119
|
+
coverage=$((documented * 100 / total_functions))
|
|
120
|
+
echo "Documentation coverage: ${coverage}%"
|
|
121
|
+
```
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
CoverageReportFormat {
|
|
125
|
+
```
|
|
126
|
+
Documentation Coverage Report
|
|
127
|
+
|
|
128
|
+
Overall Coverage: [N]%
|
|
129
|
+
|
|
130
|
+
By Category
|
|
131
|
+
|
|
132
|
+
| Category | Covered | Total | % |
|
|
133
|
+
|----------|---------|-------|---|
|
|
134
|
+
| Public Functions | [N] | [N] | [N]% |
|
|
135
|
+
| Public Classes | [N] | [N] | [N]% |
|
|
136
|
+
| API Endpoints | [N] | [N] | [N]% |
|
|
137
|
+
| Configuration | [N] | [N] | [N]% |
|
|
138
|
+
|
|
139
|
+
Priority Gaps (Public API)
|
|
140
|
+
|
|
141
|
+
1. src/api/payments.ts
|
|
142
|
+
- processPayment() - Missing docs
|
|
143
|
+
- refundPayment() - Missing docs
|
|
144
|
+
|
|
145
|
+
2. src/api/users.ts
|
|
146
|
+
- createUser() - Incomplete (missing @throws)
|
|
147
|
+
```
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
SyncDuringImplementation {
|
|
152
|
+
ImplementationHooks {
|
|
153
|
+
FunctionSignatureChanges {
|
|
154
|
+
```
|
|
155
|
+
Documentation Sync Alert
|
|
156
|
+
|
|
157
|
+
Change Detected: Function signature modified
|
|
158
|
+
Location: src/services/auth.ts:authenticate()
|
|
159
|
+
|
|
160
|
+
Before: authenticate(email: string, password: string)
|
|
161
|
+
After: authenticate(email: string, password: string, options?: AuthOptions)
|
|
162
|
+
|
|
163
|
+
Affected Documentation:
|
|
164
|
+
- docs/api/auth.md (line 45) - Outdated signature
|
|
165
|
+
- src/services/auth.ts (JSDoc) - Missing @param options
|
|
166
|
+
|
|
167
|
+
Action Required: Update documentation for new parameter
|
|
168
|
+
```
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
NewPublicAPI {
|
|
172
|
+
```
|
|
173
|
+
Documentation Sync Alert
|
|
174
|
+
|
|
175
|
+
New Public API Detected:
|
|
176
|
+
- src/api/webhooks.ts:handleStripeWebhook()
|
|
177
|
+
|
|
178
|
+
No documentation exists for this endpoint.
|
|
179
|
+
|
|
180
|
+
Suggested Documentation:
|
|
181
|
+
- Add to docs/api/webhooks.md
|
|
182
|
+
- Add JSDoc in source file
|
|
183
|
+
- Update API reference
|
|
184
|
+
|
|
185
|
+
Would you like to generate documentation now?
|
|
186
|
+
```
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
BreakingChanges {
|
|
190
|
+
```
|
|
191
|
+
Documentation Sync Alert
|
|
192
|
+
|
|
193
|
+
Breaking Change Detected:
|
|
194
|
+
- Removed: src/api/users.ts:getUser()
|
|
195
|
+
- Now: src/api/users.ts:getUserById()
|
|
196
|
+
|
|
197
|
+
Documentation Impact:
|
|
198
|
+
- docs/api/users.md references getUser() (3 occurrences)
|
|
199
|
+
- README.md example uses getUser() (1 occurrence)
|
|
200
|
+
|
|
201
|
+
Action Required:
|
|
202
|
+
1. Update all references to getUserById()
|
|
203
|
+
2. Add migration note to CHANGELOG.md
|
|
204
|
+
3. Update code examples
|
|
205
|
+
```
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
SyncSuggestionFormat {
|
|
210
|
+
When suggesting documentation updates during implementation:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
Documentation Suggestion
|
|
214
|
+
|
|
215
|
+
You just modified: [file:function]
|
|
216
|
+
|
|
217
|
+
Current Documentation Status:
|
|
218
|
+
- [OK/MISSING] JSDoc present
|
|
219
|
+
- [OK/MISSING] API docs current
|
|
220
|
+
- [OK/MISSING] Examples valid
|
|
221
|
+
|
|
222
|
+
Recommended Updates:
|
|
223
|
+
1. [Update type] - [Specific change needed]
|
|
224
|
+
2. [Update type] - [Specific change needed]
|
|
225
|
+
|
|
226
|
+
Generate updates now? [Yes / Skip / Remind Later]
|
|
227
|
+
```
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
DocumentationTemplates {
|
|
232
|
+
FunctionDocumentation {
|
|
233
|
+
TypeScriptJavaScript {
|
|
234
|
+
```typescript
|
|
235
|
+
/**
|
|
236
|
+
* Brief description of what the function does.
|
|
237
|
+
*
|
|
238
|
+
* Longer description if needed, explaining the context,
|
|
239
|
+
* use cases, or important implementation details.
|
|
240
|
+
*
|
|
241
|
+
* @param paramName - Description of the parameter
|
|
242
|
+
* @param optionalParam - Description (optional, defaults to X)
|
|
243
|
+
* @returns Description of return value
|
|
244
|
+
* @throws {ErrorType} When condition occurs
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* // Basic usage
|
|
248
|
+
* const result = functionName('value');
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* // With options
|
|
252
|
+
* const result = functionName('value', { option: true });
|
|
253
|
+
*
|
|
254
|
+
* @see relatedFunction
|
|
255
|
+
* @since 1.2.0
|
|
256
|
+
*/
|
|
257
|
+
```
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
Python {
|
|
261
|
+
```python
|
|
262
|
+
def function_name(param_name: str, optional_param: int = 0) -> ReturnType:
|
|
263
|
+
"""
|
|
264
|
+
Brief description of what the function does.
|
|
265
|
+
|
|
266
|
+
Longer description if needed, explaining the context,
|
|
267
|
+
use cases, or important implementation details.
|
|
268
|
+
|
|
269
|
+
Args:
|
|
270
|
+
param_name: Description of the parameter
|
|
271
|
+
optional_param: Description (defaults to 0)
|
|
272
|
+
|
|
273
|
+
Returns:
|
|
274
|
+
Description of return value
|
|
275
|
+
|
|
276
|
+
Raises:
|
|
277
|
+
ErrorType: When condition occurs
|
|
278
|
+
|
|
279
|
+
Example:
|
|
280
|
+
>>> result = function_name('value')
|
|
281
|
+
>>> print(result)
|
|
282
|
+
|
|
283
|
+
See Also:
|
|
284
|
+
related_function
|
|
285
|
+
"""
|
|
286
|
+
```
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
APIEndpointDocumentation {
|
|
291
|
+
```markdown
|
|
292
|
+
## Endpoint Name
|
|
293
|
+
|
|
294
|
+
`METHOD /path/to/endpoint`
|
|
295
|
+
|
|
296
|
+
Brief description of what the endpoint does.
|
|
297
|
+
|
|
298
|
+
### Authentication
|
|
299
|
+
|
|
300
|
+
[Required/Optional] - [Auth type: Bearer, API Key, etc.]
|
|
301
|
+
|
|
302
|
+
### Request
|
|
303
|
+
|
|
304
|
+
#### Headers
|
|
305
|
+
|
|
306
|
+
| Header | Required | Description |
|
|
307
|
+
|--------|----------|-------------|
|
|
308
|
+
| Authorization | Yes | Bearer token |
|
|
309
|
+
| Content-Type | Yes | application/json |
|
|
310
|
+
|
|
311
|
+
#### Parameters
|
|
312
|
+
|
|
313
|
+
| Parameter | Type | Required | Description |
|
|
314
|
+
|-----------|------|----------|-------------|
|
|
315
|
+
| id | string | Yes | Resource identifier |
|
|
316
|
+
|
|
317
|
+
#### Body
|
|
318
|
+
|
|
319
|
+
```json
|
|
320
|
+
{
|
|
321
|
+
"field": "value",
|
|
322
|
+
"nested": {
|
|
323
|
+
"field": "value"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Response
|
|
329
|
+
|
|
330
|
+
#### Success (200)
|
|
331
|
+
|
|
332
|
+
```json
|
|
333
|
+
{
|
|
334
|
+
"data": { ... },
|
|
335
|
+
"meta": { ... }
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
#### Errors
|
|
340
|
+
|
|
341
|
+
| Code | Description |
|
|
342
|
+
|------|-------------|
|
|
343
|
+
| 400 | Invalid request |
|
|
344
|
+
| 401 | Unauthorized |
|
|
345
|
+
| 404 | Resource not found |
|
|
346
|
+
|
|
347
|
+
### Example
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
curl -X POST https://api.example.com/path \
|
|
351
|
+
-H "Authorization: Bearer token" \
|
|
352
|
+
-H "Content-Type: application/json" \
|
|
353
|
+
-d '{"field": "value"}'
|
|
354
|
+
```
|
|
355
|
+
```
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
ValidationProtocol {
|
|
360
|
+
DocumentationAccuracyCheck {
|
|
361
|
+
1. **Parameter Validation**
|
|
362
|
+
- All parameters documented
|
|
363
|
+
- Types match actual code
|
|
364
|
+
- Descriptions are accurate
|
|
365
|
+
|
|
366
|
+
2. **Return Value Validation**
|
|
367
|
+
- Return type documented
|
|
368
|
+
- All possible returns covered
|
|
369
|
+
- Edge cases documented
|
|
370
|
+
|
|
371
|
+
3. **Error Validation**
|
|
372
|
+
- All thrown errors documented
|
|
373
|
+
- Error conditions accurate
|
|
374
|
+
- Recovery guidance provided
|
|
375
|
+
|
|
376
|
+
4. **Example Validation**
|
|
377
|
+
- Examples execute correctly
|
|
378
|
+
- Output matches documented output
|
|
379
|
+
- Edge cases demonstrated
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
ValidationReportFormat {
|
|
383
|
+
```
|
|
384
|
+
Documentation Validation Report
|
|
385
|
+
|
|
386
|
+
File: [path]
|
|
387
|
+
Status: [VALID / WARNINGS / INVALID]
|
|
388
|
+
|
|
389
|
+
Checked Elements
|
|
390
|
+
|
|
391
|
+
| Function | Params | Returns | Errors | Examples |
|
|
392
|
+
|----------|--------|---------|--------|----------|
|
|
393
|
+
| auth() | OK | OK | WARN | OK |
|
|
394
|
+
| logout() | OK | FAIL | OK | FAIL |
|
|
395
|
+
|
|
396
|
+
Issues Found
|
|
397
|
+
|
|
398
|
+
1. auth() - Missing @throws for RateLimitError
|
|
399
|
+
2. logout() - Return type says void, but returns Promise<void>
|
|
400
|
+
3. logout() - No example provided
|
|
401
|
+
```
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
OutputFormat {
|
|
406
|
+
After synchronization work:
|
|
407
|
+
|
|
408
|
+
```
|
|
409
|
+
Documentation Sync Complete
|
|
410
|
+
|
|
411
|
+
Action: [Detection / Sync / Validation]
|
|
412
|
+
Scope: [Files/modules affected]
|
|
413
|
+
|
|
414
|
+
Results
|
|
415
|
+
|
|
416
|
+
Stale Documentation: [N] files
|
|
417
|
+
Broken References: [N] links
|
|
418
|
+
Missing Documentation: [N] items
|
|
419
|
+
Updated: [N] files
|
|
420
|
+
|
|
421
|
+
Changes Made
|
|
422
|
+
|
|
423
|
+
- [file.md] Updated function references
|
|
424
|
+
- [source.ts] Added missing JSDoc
|
|
425
|
+
|
|
426
|
+
Remaining Issues
|
|
427
|
+
|
|
428
|
+
- [issue requiring manual attention]
|
|
429
|
+
```
|
|
430
|
+
}
|
|
431
|
+
}
|