docworks 0.15.0 → 0.17.0-next.1
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/LICENSE +21 -0
- package/README.md +104 -22
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +4 -4
- package/dist/providers/index.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Caio Pizzol
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ DocWorks tests documentation the way developers actually use it - by having AI s
|
|
|
27
27
|
|
|
28
28
|
## Configuration
|
|
29
29
|
|
|
30
|
+
See [`schema.yaml`](./schema.yaml) for the complete configuration schema with validation rules.
|
|
31
|
+
|
|
30
32
|
### Simple Questions
|
|
31
33
|
|
|
32
34
|
```yaml
|
|
@@ -38,7 +40,7 @@ questions:
|
|
|
38
40
|
- What are the rate limits?
|
|
39
41
|
- Where are code examples?
|
|
40
42
|
|
|
41
|
-
provider: openai
|
|
43
|
+
provider: openai # Currently only OpenAI supported
|
|
42
44
|
model: gpt-4o-mini
|
|
43
45
|
```
|
|
44
46
|
|
|
@@ -61,6 +63,28 @@ provider: openai
|
|
|
61
63
|
model: gpt-4o-mini
|
|
62
64
|
```
|
|
63
65
|
|
|
66
|
+
### Configurable Thresholds
|
|
67
|
+
|
|
68
|
+
Set pass/fail criteria to match your documentation maturity:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
source: https://docs.yourcompany.com
|
|
72
|
+
|
|
73
|
+
# Global threshold - fail if less than 85% questions are answerable
|
|
74
|
+
threshold: 85
|
|
75
|
+
|
|
76
|
+
journeys:
|
|
77
|
+
authentication:
|
|
78
|
+
threshold: 100 # Critical path - must be perfect
|
|
79
|
+
questions:
|
|
80
|
+
- How do I get API keys?
|
|
81
|
+
- How do I authenticate?
|
|
82
|
+
|
|
83
|
+
examples: # Uses global 85% threshold
|
|
84
|
+
- Where are code samples?
|
|
85
|
+
- Are there tutorials?
|
|
86
|
+
```
|
|
87
|
+
|
|
64
88
|
## Rich Feedback
|
|
65
89
|
|
|
66
90
|
Instead of simple YES/NO, get actionable insights:
|
|
@@ -72,40 +96,59 @@ Instead of simple YES/NO, get actionable insights:
|
|
|
72
96
|
Missing:
|
|
73
97
|
- API key generation steps
|
|
74
98
|
- Token refresh documentation
|
|
99
|
+
|
|
100
|
+
Journey: authentication
|
|
101
|
+
Score: 75% (Threshold: 100%)
|
|
102
|
+
❌ FAILED - Below required threshold
|
|
75
103
|
```
|
|
76
104
|
|
|
77
|
-
##
|
|
105
|
+
## CI/CD Integration
|
|
78
106
|
|
|
79
|
-
|
|
107
|
+
### Progressive Validation
|
|
108
|
+
|
|
109
|
+
Different thresholds for different environments:
|
|
80
110
|
|
|
81
111
|
```yaml
|
|
82
112
|
# .github/workflows/docs.yml
|
|
83
113
|
name: Documentation Validation
|
|
84
|
-
on: [pull_request]
|
|
114
|
+
on: [pull_request, push]
|
|
85
115
|
|
|
86
116
|
jobs:
|
|
87
|
-
validate:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
117
|
+
validate-pr:
|
|
118
|
+
if: github.event_name == 'pull_request'
|
|
119
|
+
runs-on: ubuntu-latest
|
|
120
|
+
steps:
|
|
121
|
+
- uses: actions/checkout@v3
|
|
122
|
+
|
|
123
|
+
- name: Validate PR docs (lenient)
|
|
124
|
+
run: npx docworks check --threshold 70
|
|
125
|
+
env:
|
|
126
|
+
DOCWORKS_SOURCE: https://preview-${{ github.event.pull_request.number }}.docs.example.com
|
|
127
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
97
128
|
|
|
129
|
+
validate-production:
|
|
130
|
+
if: github.ref == 'refs/heads/main'
|
|
98
131
|
runs-on: ubuntu-latest
|
|
99
132
|
steps:
|
|
100
133
|
- uses: actions/checkout@v3
|
|
101
|
-
|
|
134
|
+
|
|
135
|
+
- name: Validate production docs (strict)
|
|
136
|
+
run: npx docworks check --threshold 95
|
|
102
137
|
env:
|
|
103
|
-
|
|
104
|
-
MODEL: ${{ matrix.model }}
|
|
138
|
+
DOCWORKS_SOURCE: https://docs.example.com
|
|
105
139
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
106
|
-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
107
140
|
```
|
|
108
141
|
|
|
142
|
+
## Supported Providers
|
|
143
|
+
|
|
144
|
+
| Provider | Status | Models |
|
|
145
|
+
| --------- | -------------- | ---------------------------------- |
|
|
146
|
+
| OpenAI | ✅ Supported | gpt-4o, gpt-4o-mini |
|
|
147
|
+
| Anthropic | 🚧 Coming Soon | claude-3.7-sonnet, claude-4-sonnet |
|
|
148
|
+
| Google | 🚧 Coming Soon | gemini-pro |
|
|
149
|
+
|
|
150
|
+
**Want to add a provider?** PRs welcome! See [`src/providers/index.ts`](./src/providers/index.ts).
|
|
151
|
+
|
|
109
152
|
## Supported Documentation
|
|
110
153
|
|
|
111
154
|
- **Public docs** - Any site with [llms.txt](https://llmstxt.org)
|
|
@@ -117,23 +160,62 @@ jobs:
|
|
|
117
160
|
# Initialize config
|
|
118
161
|
docworks init
|
|
119
162
|
|
|
120
|
-
# Validate all journeys
|
|
163
|
+
# Validate all journeys (uses config threshold or defaults to 100%)
|
|
121
164
|
docworks check
|
|
122
165
|
|
|
166
|
+
# Override threshold via command line
|
|
167
|
+
docworks check --threshold 80
|
|
168
|
+
|
|
123
169
|
# Test specific journey
|
|
124
170
|
docworks check --journey authentication
|
|
125
171
|
|
|
126
|
-
# Output as JSON
|
|
172
|
+
# Output as JSON (includes threshold data)
|
|
127
173
|
docworks check --format json
|
|
128
174
|
```
|
|
129
175
|
|
|
176
|
+
## Exit Codes
|
|
177
|
+
|
|
178
|
+
- `0` - All thresholds met ✅
|
|
179
|
+
- `1` - Below threshold ❌
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Strict validation - fail on any missing docs
|
|
183
|
+
docworks check --threshold 100
|
|
184
|
+
|
|
185
|
+
# Allow 20% missing during initial setup
|
|
186
|
+
docworks check --threshold 80
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Progressive Adoption
|
|
190
|
+
|
|
191
|
+
Start lenient and increase strictness as your documentation improves:
|
|
192
|
+
|
|
193
|
+
1. **Initial Setup** - `threshold: 60` (allow gaps while building)
|
|
194
|
+
2. **Development** - `threshold: 80` (most questions answered)
|
|
195
|
+
3. **Staging** - `threshold: 90` (nearly complete)
|
|
196
|
+
4. **Production** - `threshold: 95-100` (comprehensive docs)
|
|
197
|
+
|
|
198
|
+
## Requirements
|
|
199
|
+
|
|
200
|
+
- Node.js 16+
|
|
201
|
+
- OpenAI API key with web search capabilities
|
|
202
|
+
|
|
203
|
+
## Contributing
|
|
204
|
+
|
|
205
|
+
Contributions welcome! We're especially looking for:
|
|
206
|
+
|
|
207
|
+
- Additional provider implementations (Anthropic, Google)
|
|
208
|
+
- Documentation platform integrations
|
|
209
|
+
- Journey templates for common use cases
|
|
210
|
+
|
|
130
211
|
## Why DocWorks?
|
|
131
212
|
|
|
132
213
|
- **Real-world testing** - AI navigates docs like developers do
|
|
214
|
+
- **Configurable strictness** - Match your documentation maturity
|
|
133
215
|
- **Actionable feedback** - Know exactly what to fix
|
|
134
|
-
- **CI/CD ready** -
|
|
216
|
+
- **CI/CD ready** - Different thresholds for PR vs production
|
|
135
217
|
- **Progressive** - Start simple, add complexity as needed
|
|
136
218
|
|
|
137
219
|
## License
|
|
138
220
|
|
|
139
|
-
MIT
|
|
221
|
+
MIT - See [LICENSE](./LICENSE) for details
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAoCrD,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAoCrD,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,CAAC,CAkE3B"}
|
package/dist/providers/index.js
CHANGED
|
@@ -83,10 +83,10 @@ Instructions:
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
// Future providers - PRs welcome!
|
|
87
|
+
case 'anthropic':
|
|
88
|
+
case 'google':
|
|
89
|
+
throw new Error(`${provider} provider coming soon. Currently only 'openai' is supported.`);
|
|
90
90
|
default:
|
|
91
91
|
throw new Error(`Unknown provider: ${provider}`);
|
|
92
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAG3B,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE,aAAsB;IAC5B,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC;aAC/B;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sBAAsB;aACpC;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,6BAA6B;aAC3C;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;aACjC;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;gBACvB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,mDAAmD;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