skill-validator 1.0.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/PUBLISHING.md ADDED
@@ -0,0 +1,313 @@
1
+ # Publishing Guide
2
+
3
+ This document explains how to publish **skill-validator** to npm and prepare it for sale on Gumroad.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. npm account at https://www.npmjs.com/signup
8
+ 2. Verified email address on npm
9
+ 3. Two-factor authentication enabled (recommended)
10
+ 4. GitHub account with repo access
11
+
12
+ ## Step 1: Create npm Account
13
+
14
+ If you don't have an npm account:
15
+
16
+ ```bash
17
+ npm adduser
18
+ ```
19
+
20
+ You'll be prompted for:
21
+ - Username: `bagalobsta`
22
+ - Password: (your npm password)
23
+ - Email: (your email address)
24
+
25
+ Verify your email address at https://www.npmjs.com.
26
+
27
+ ## Step 2: Prepare for Publication
28
+
29
+ ### Update Version Number
30
+
31
+ Before publishing, update the version in `package.json`:
32
+
33
+ ```json
34
+ {
35
+ "version": "1.0.0"
36
+ }
37
+ ```
38
+
39
+ For updates, use semantic versioning:
40
+ - `1.0.1` - Patch (bug fixes)
41
+ - `1.1.0` - Minor (new features)
42
+ - `2.0.0` - Major (breaking changes)
43
+
44
+ ### Run Quality Checks
45
+
46
+ ```bash
47
+ npm test # Run all tests
48
+ npm run lint # Run linter (if configured)
49
+ ```
50
+
51
+ ### Create GitHub Release
52
+
53
+ ```bash
54
+ git tag v1.0.0
55
+ git push origin v1.0.0
56
+ gh release create v1.0.0 --generate-notes
57
+ ```
58
+
59
+ ## Step 3: Publish to npm
60
+
61
+ ### First Time Publishing
62
+
63
+ ```bash
64
+ npm publish
65
+ ```
66
+
67
+ This publishes the package publicly at https://www.npmjs.com/package/skill-validator
68
+
69
+ ### Publishing Updates
70
+
71
+ ```bash
72
+ # Update version in package.json
73
+ npm version patch # 1.0.1
74
+
75
+ # Publish update
76
+ npm publish
77
+
78
+ # Push to GitHub
79
+ git push origin main
80
+ git push origin --tags
81
+ ```
82
+
83
+ ## Step 4: Verify Publication
84
+
85
+ Check that the package is published:
86
+
87
+ ```bash
88
+ npm info skill-validator
89
+ npm view skill-validator
90
+ ```
91
+
92
+ Install it globally to test:
93
+
94
+ ```bash
95
+ npm install -g skill-validator@latest
96
+ skill-validator --version
97
+ ```
98
+
99
+ ## Step 5: Selling on Gumroad
100
+
101
+ ### Create Gumroad Product
102
+
103
+ 1. Go to https://gumroad.com
104
+ 2. Sign in to your account
105
+ 3. Click "Upload Product"
106
+
107
+ ### Product Details
108
+
109
+ **Title:** `Skill Validator CLI - OpenClaw Skill Documentation Validator`
110
+
111
+ **Description:**
112
+ ```
113
+ Professional CLI tool for validating OpenClaw skill.md files.
114
+
115
+ ✅ Security audit - detects hardcoded credentials and dangerous patterns
116
+ ✅ Documentation checks - ensures complete documentation
117
+ ✅ Best practices validation - error handling, permissions, input validation
118
+ ✅ JSON & terminal output - for automation and readability
119
+
120
+ Perfect for:
121
+ - OpenClaw developers validating skills
122
+ - Teams ensuring code quality
123
+ - CI/CD automation pipelines
124
+ - Documentation enforcement
125
+
126
+ Features:
127
+ - Fast single file or directory scanning
128
+ - Colorized terminal reports with severity levels
129
+ - JSON export for parsing and tooling
130
+ - 17 comprehensive validation rules
131
+ - Zero dependencies (just Node.js)
132
+
133
+ Install: npm install -g skill-validator
134
+ ```
135
+
136
+ **Product Type:** Software
137
+
138
+ **Price Options:**
139
+ - Free version: Offer on npm (free)
140
+ - Premium version: Sell on Gumroad (€9-15)
141
+
142
+ **Consider for Premium:**
143
+ - Advanced security scanning rules
144
+ - Custom validation rules
145
+ - Report generation (HTML/PDF)
146
+ - Integration helpers
147
+
148
+ ### Gumroad License Key
149
+
150
+ If you want to add a license key mechanism for premium features:
151
+
152
+ ```javascript
153
+ // lib/validator.js - add premium features
154
+ class PremiumSkillValidator extends SkillValidator {
155
+ validateLicense(key) {
156
+ // License validation logic
157
+ }
158
+ }
159
+ ```
160
+
161
+ ### Files to Provide
162
+
163
+ Upload to Gumroad:
164
+ 1. `skill-validator-1.0.0.tar.gz` (packaged source)
165
+ 2. `INSTALL.md` - Setup instructions
166
+ 3. `EXAMPLES.pdf` - Usage examples and screenshots
167
+
168
+ ```bash
169
+ # Create distribution
170
+ cd /tmp/skill-validator
171
+ tar -czf skill-validator-1.0.0.tar.gz \
172
+ --exclude=.git \
173
+ --exclude=node_modules \
174
+ --exclude=.env \
175
+ .
176
+ ```
177
+
178
+ ### Distribution License
179
+
180
+ Add a note about the open source license:
181
+
182
+ ```
183
+ This tool is published on npm under the MIT License and can be freely used.
184
+ This premium package includes additional features, examples, and support.
185
+ ```
186
+
187
+ ## Step 6: Marketing
188
+
189
+ ### npm Package Page
190
+
191
+ Your npm page is automatically created and will show:
192
+ - Installation instructions
193
+ - README
194
+ - Version history
195
+ - Download stats
196
+
197
+ Make it stand out by:
198
+ - Adding quality metadata
199
+ - Writing clear README
200
+ - Including examples
201
+ - Maintaining regular updates
202
+
203
+ ### Gumroad Benefits
204
+
205
+ Selling on Gumroad provides:
206
+ - Premium content (advanced rules, extensions)
207
+ - Direct customer support channel
208
+ - Email marketing to customers
209
+ - License key management
210
+ - Revenue tracking
211
+
212
+ ### Promotion Ideas
213
+
214
+ 1. **Blog Post**: "How to Validate OpenClaw Skills"
215
+ 2. **GitHub Discussions**: Announce release
216
+ 3. **Twitter/Social**: "New tool for skill validation"
217
+ 4. **Communities**: Share in OpenClaw forums
218
+ 5. **Documentation**: Link from your portfolio
219
+
220
+ ## Step 7: Maintenance
221
+
222
+ ### Version Updates
223
+
224
+ When releasing new versions:
225
+
226
+ ```bash
227
+ # Make changes
228
+ git add -A
229
+ git commit -m "feat: add new validation rules"
230
+
231
+ # Bump version
232
+ npm version minor
233
+
234
+ # Publish
235
+ npm publish
236
+
237
+ # Push to GitHub
238
+ git push origin main --tags
239
+ ```
240
+
241
+ ### Keep npm Fresh
242
+
243
+ - Fix issues promptly
244
+ - Update dependencies monthly
245
+ - Add new validation rules
246
+ - Improve documentation
247
+
248
+ ## npm Dashboard
249
+
250
+ Monitor your package at:
251
+ - https://www.npmjs.com/package/skill-validator
252
+ - https://www.npmjs.com/settings/bagalobsta/packages
253
+
254
+ ## Troubleshooting
255
+
256
+ ### Authentication Issues
257
+
258
+ ```bash
259
+ # Re-authenticate
260
+ npm logout
261
+ npm adduser
262
+
263
+ # Check auth
264
+ npm whoami
265
+ cat ~/.npmrc
266
+ ```
267
+
268
+ ### Publishing Fails
269
+
270
+ ```bash
271
+ # Check package name isn't taken
272
+ npm view skill-validator
273
+
274
+ # Verify version isn't already published
275
+ npm view skill-validator versions
276
+
277
+ # Run prepublish checks
278
+ npm run prepublishOnly
279
+ ```
280
+
281
+ ### Update npm
282
+
283
+ ```bash
284
+ npm install -g npm@latest
285
+ ```
286
+
287
+ ## Success Checklist
288
+
289
+ - [ ] npm account created and verified
290
+ - [ ] GitHub repo public
291
+ - [ ] All tests passing
292
+ - [ ] Version bumped
293
+ - [ ] Published to npm
294
+ - [ ] Package installable globally
295
+ - [ ] Gumroad account created
296
+ - [ ] Premium features added (if applicable)
297
+ - [ ] Product listed on Gumroad
298
+ - [ ] GitHub releases created
299
+ - [ ] Social media announced
300
+ - [ ] Documentation complete
301
+
302
+ ## Support & Feedback
303
+
304
+ After publishing:
305
+ - Monitor npm page for issues
306
+ - Respond to GitHub issues
307
+ - Track Gumroad customer feedback
308
+ - Keep dependencies updated
309
+ - Plan feature releases quarterly
310
+
311
+ ---
312
+
313
+ Good luck! 🚀
package/README.md ADDED
@@ -0,0 +1,375 @@
1
+ # 🔍 Skill Validator
2
+
3
+ A powerful CLI tool for validating OpenClaw `skill.md` files. Automatically checks for **security issues**, **missing documentation**, and **best practices**.
4
+
5
+ ```
6
+ $ skill-validator validate examples/good-skill.md
7
+
8
+ 📋 Skill Validator Report
9
+ ════════════════════════════════════════════════════
10
+
11
+ File: examples/good-skill.md
12
+ Status: ✓ PASSED
13
+
14
+ Summary:
15
+ Total Issues: 0
16
+ 🔴 Critical: 0
17
+ 🟡 Warnings: 0
18
+ 🔵 Info: 0
19
+
20
+ ✨ No issues found! Your skill is well documented.
21
+
22
+ ════════════════════════════════════════════════════
23
+ ```
24
+
25
+ ## Features
26
+
27
+ ✅ **Security Checks**
28
+ - Detects hardcoded passwords, API keys, tokens, and secrets
29
+ - Flags dangerous functions (eval, exec)
30
+ - Warns about unencrypted HTTP URLs
31
+ - Identifies credential exposure patterns
32
+
33
+ ✅ **Documentation Validation**
34
+ - Ensures required sections (Overview, Parameters, Returns, Examples, Error Handling)
35
+ - Checks for code examples
36
+ - Validates completeness
37
+
38
+ ✅ **Best Practices**
39
+ - Error handling documentation
40
+ - Permission/authentication requirements
41
+ - Input validation guidance
42
+ - Usage warnings and notes
43
+ - Properly specified code blocks
44
+
45
+ ✅ **Multiple Output Formats**
46
+ - Colorized terminal reports
47
+ - JSON for automation
48
+ - File export support
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ npm install -g skill-validator
54
+ ```
55
+
56
+ Or use directly:
57
+
58
+ ```bash
59
+ npx skill-validator@latest validate skill.md
60
+ ```
61
+
62
+ ## Usage
63
+
64
+ ### Validate a Single File
65
+
66
+ ```bash
67
+ skill-validator validate path/to/skill.md
68
+ ```
69
+
70
+ **Options:**
71
+ - `-j, --json` - Output as JSON instead of formatted report
72
+ - `-o, --output <file>` - Write report to file
73
+
74
+ **Examples:**
75
+
76
+ ```bash
77
+ # Terminal report
78
+ skill-validator validate my-skill.md
79
+
80
+ # JSON output
81
+ skill-validator validate my-skill.md --json
82
+
83
+ # Save to file
84
+ skill-validator validate my-skill.md --output report.txt
85
+ ```
86
+
87
+ ### Scan a Directory
88
+
89
+ ```bash
90
+ skill-validator scan path/to/skills/
91
+ ```
92
+
93
+ Recursively scans all `skill.md` files in a directory.
94
+
95
+ **Options:**
96
+ - `-j, --json` - Output as JSON summary
97
+ - `-o, --output <file>` - Write report to file
98
+
99
+ **Examples:**
100
+
101
+ ```bash
102
+ # Scan all skills
103
+ skill-validator scan ./skills/
104
+
105
+ # JSON summary
106
+ skill-validator scan ./skills/ --json
107
+
108
+ # Export scan results
109
+ skill-validator scan ./skills/ --output scan-report.json --json
110
+ ```
111
+
112
+ ## Output Examples
113
+
114
+ ### Terminal Report
115
+
116
+ ```
117
+ 📋 Skill Validator Report
118
+ ════════════════════════════════════════════════════
119
+
120
+ File: my-skill.md
121
+ Status: ✗ FAILED
122
+
123
+ Summary:
124
+ Total Issues: 3
125
+ 🔴 Critical: 1
126
+ 🟡 Warnings: 2
127
+ 🔵 Info: 0
128
+
129
+ Issues:
130
+ ════════════════════════════════════════════════════
131
+
132
+ 🔒 Security Issues:
133
+ 1. 🔴 CRITICAL Potential hardcoded password detected
134
+ Context: "password = "secret123""
135
+
136
+ 📚 Documentation Issues:
137
+ 1. 🟡 WARNING Missing or unclear "Error Handling" section
138
+ 2. 🟡 WARNING Missing or unclear "Parameters" section
139
+
140
+ ════════════════════════════════════════════════════
141
+ ```
142
+
143
+ ### JSON Output
144
+
145
+ ```json
146
+ {
147
+ "filepath": "my-skill.md",
148
+ "passed": false,
149
+ "issueCount": 3,
150
+ "criticalCount": 1,
151
+ "warningCount": 2,
152
+ "infoCount": 0,
153
+ "issues": [
154
+ {
155
+ "type": "security",
156
+ "severity": "critical",
157
+ "message": "Potential hardcoded password detected",
158
+ "context": "password = \"secret123\""
159
+ },
160
+ {
161
+ "type": "documentation",
162
+ "severity": "warning",
163
+ "message": "Missing or unclear \"Error Handling\" section"
164
+ },
165
+ {
166
+ "type": "documentation",
167
+ "severity": "warning",
168
+ "message": "Missing or unclear \"Parameters\" section"
169
+ }
170
+ ]
171
+ }
172
+ ```
173
+
174
+ ## Rules & Validation Checks
175
+
176
+ ### 🔒 Security Rules
177
+
178
+ | Issue | Severity | Description |
179
+ |-------|----------|-------------|
180
+ | Hardcoded Password | 🔴 Critical | `password = "..."` patterns |
181
+ | Hardcoded API Key | 🔴 Critical | `api_key = "..."`, `apiKey = "..."` |
182
+ | Hardcoded Secret | 🔴 Critical | `secret = "..."` patterns |
183
+ | Hardcoded Token | 🔴 Critical | Bearer tokens, auth tokens |
184
+ | eval() Usage | 🔴 Critical | Dynamic code execution |
185
+ | exec() Without Validation | 🟡 Warning | Shell command execution |
186
+ | HTTP URLs | 🟡 Warning | Unencrypted connections |
187
+
188
+ ### 📚 Documentation Rules
189
+
190
+ | Issue | Severity |
191
+ |-------|----------|
192
+ | Missing Overview section | 🟡 Warning |
193
+ | Missing Parameters section | 🟡 Warning |
194
+ | Missing Returns/Output section | 🟡 Warning |
195
+ | Missing Examples | 🟡 Warning |
196
+ | Missing Error Handling section | 🟡 Warning |
197
+ | No code examples (```...```) | 🟡 Warning |
198
+ | Very short documentation (<10 lines) | 🔵 Info |
199
+ | No YAML front matter | 🔵 Info |
200
+
201
+ ### 💡 Best Practices Rules
202
+
203
+ | Issue | Severity |
204
+ |--------|----------|
205
+ | No error handling documentation | 🟡 Warning |
206
+ | No permission/auth documentation | 🟡 Warning |
207
+ | Code blocks without language | 🔵 Info |
208
+ | No usage warnings/notes | 🔵 Info |
209
+ | No input validation documentation | 🔵 Info |
210
+ | No external documentation links | 🔵 Info |
211
+
212
+ ## Example Skills
213
+
214
+ The `examples/` directory contains:
215
+
216
+ - **good-skill.md** - A well-documented, secure skill (passes validation)
217
+ - **bad-skill.md** - A poorly documented skill with security issues (fails validation)
218
+
219
+ Try them:
220
+
221
+ ```bash
222
+ skill-validator validate examples/good-skill.md
223
+ skill-validator validate examples/bad-skill.md
224
+ ```
225
+
226
+ ## Exit Codes
227
+
228
+ - **0** - Validation passed (no critical issues)
229
+ - **1** - Validation failed (critical issues found) or error occurred
230
+
231
+ Useful for CI/CD pipelines:
232
+
233
+ ```bash
234
+ skill-validator validate my-skill.md && echo "✅ Ready for production" || echo "❌ Fix issues first"
235
+ ```
236
+
237
+ ## Integration with CI/CD
238
+
239
+ ### GitHub Actions
240
+
241
+ ```yaml
242
+ name: Validate Skills
243
+ on: [push, pull_request]
244
+
245
+ jobs:
246
+ validate:
247
+ runs-on: ubuntu-latest
248
+ steps:
249
+ - uses: actions/checkout@v2
250
+ - uses: actions/setup-node@v2
251
+ with:
252
+ node-version: '18'
253
+ - run: npm install -g skill-validator
254
+ - run: skill-validator scan ./skills/ --json --output report.json
255
+ - uses: actions/upload-artifact@v2
256
+ if: always()
257
+ with:
258
+ name: validation-report
259
+ path: report.json
260
+ ```
261
+
262
+ ### Pre-commit Hook
263
+
264
+ ```bash
265
+ #!/bin/bash
266
+ # .git/hooks/pre-commit
267
+
268
+ skill-validator scan . || exit 1
269
+ ```
270
+
271
+ ## API Usage
272
+
273
+ Use skill-validator programmatically:
274
+
275
+ ```javascript
276
+ const { SkillValidator } = require('skill-validator');
277
+ const fs = require('fs');
278
+
279
+ const validator = new SkillValidator();
280
+ const skillContent = fs.readFileSync('my-skill.md', 'utf-8');
281
+
282
+ const report = validator.validate(skillContent, 'my-skill.md');
283
+
284
+ console.log(`Issues found: ${report.issueCount}`);
285
+ console.log(`Critical: ${report.criticalCount}`);
286
+ console.log(`Passed: ${report.passed}`);
287
+
288
+ // Get detailed issues
289
+ report.issues.forEach(issue => {
290
+ console.log(`[${issue.type}] ${issue.message}`);
291
+ });
292
+ ```
293
+
294
+ ## Development
295
+
296
+ ### Setup
297
+
298
+ ```bash
299
+ git clone https://github.com/bagalobsta/skill-validator.git
300
+ cd skill-validator
301
+ npm install
302
+ ```
303
+
304
+ ### Run Tests
305
+
306
+ ```bash
307
+ npm test
308
+ npm run test:watch # Watch mode
309
+ ```
310
+
311
+ ### Test Coverage
312
+
313
+ ```bash
314
+ npm test -- --coverage
315
+ ```
316
+
317
+ ## Contributing
318
+
319
+ Contributions welcome! Please:
320
+
321
+ 1. Fork the repository
322
+ 2. Create a feature branch: `git checkout -b feature/my-feature`
323
+ 3. Write tests for new features
324
+ 4. Run `npm test` to ensure all tests pass
325
+ 5. Submit a pull request
326
+
327
+ ## Project Structure
328
+
329
+ ```
330
+ skill-validator/
331
+ ├── bin/
332
+ │ └── skill-validator.js # CLI entry point
333
+ ├── lib/
334
+ │ ├── validator.js # Core validation logic
335
+ │ └── formatter.js # Output formatting
336
+ ├── tests/
337
+ │ └── validator.test.js # Test suite
338
+ ├── examples/
339
+ │ ├── good-skill.md # Example: valid skill
340
+ │ └── bad-skill.md # Example: invalid skill
341
+ ├── README.md # This file
342
+ ├── package.json # Project metadata
343
+ └── LICENSE # MIT License
344
+ ```
345
+
346
+ ## Roadmap
347
+
348
+ - [ ] Config file support (.skillvalidatorrc)
349
+ - [ ] Custom rule definitions
350
+ - [ ] Integration with skill templates
351
+ - [ ] VS Code extension
352
+ - [ ] Performance benchmarks
353
+ - [ ] Extended test coverage
354
+ - [ ] Support for YAML/JSON skill formats
355
+
356
+ ## License
357
+
358
+ MIT License © 2024 Bagalobsta
359
+
360
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.
361
+
362
+ ## Support
363
+
364
+ - 📖 [Documentation](https://github.com/bagalobsta/skill-validator#readme)
365
+ - 🐛 [Report Issues](https://github.com/bagalobsta/skill-validator/issues)
366
+ - 💬 [Discussions](https://github.com/bagalobsta/skill-validator/discussions)
367
+ - 🌐 [Website](https://bagalobsta.com)
368
+
369
+ ## Author
370
+
371
+ **Bagalobsta** - [GitHub](https://github.com/bagalobsta) | [Email](mailto:bagalobsta@protonmail.com)
372
+
373
+ ---
374
+
375
+ Built with ❤️ for OpenClaw developers