developer-ai 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.
Files changed (105) hide show
  1. package/README.md +241 -0
  2. package/bin/developer-ai.js +2 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +219 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/config/index.d.ts +7 -0
  8. package/dist/config/index.d.ts.map +1 -0
  9. package/dist/config/index.js +82 -0
  10. package/dist/config/index.js.map +1 -0
  11. package/dist/config/schema.d.ts +115 -0
  12. package/dist/config/schema.d.ts.map +1 -0
  13. package/dist/config/schema.js +29 -0
  14. package/dist/config/schema.js.map +1 -0
  15. package/dist/constants.d.ts +8 -0
  16. package/dist/constants.d.ts.map +1 -0
  17. package/dist/constants.js +8 -0
  18. package/dist/constants.js.map +1 -0
  19. package/dist/core/agent.d.ts +38 -0
  20. package/dist/core/agent.d.ts.map +1 -0
  21. package/dist/core/agent.js +155 -0
  22. package/dist/core/agent.js.map +1 -0
  23. package/dist/core/system-prompt.d.ts +6 -0
  24. package/dist/core/system-prompt.d.ts.map +1 -0
  25. package/dist/core/system-prompt.js +44 -0
  26. package/dist/core/system-prompt.js.map +1 -0
  27. package/dist/core/types.d.ts +42 -0
  28. package/dist/core/types.d.ts.map +1 -0
  29. package/dist/core/types.js +6 -0
  30. package/dist/core/types.js.map +1 -0
  31. package/dist/index.d.ts +15 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +12 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/mcp/client.d.ts +13 -0
  36. package/dist/mcp/client.d.ts.map +1 -0
  37. package/dist/mcp/client.js +202 -0
  38. package/dist/mcp/client.js.map +1 -0
  39. package/dist/providers/ollama.d.ts +13 -0
  40. package/dist/providers/ollama.d.ts.map +1 -0
  41. package/dist/providers/ollama.js +60 -0
  42. package/dist/providers/ollama.js.map +1 -0
  43. package/dist/providers/openai.d.ts +9 -0
  44. package/dist/providers/openai.d.ts.map +1 -0
  45. package/dist/providers/openai.js +40 -0
  46. package/dist/providers/openai.js.map +1 -0
  47. package/dist/skills/loader.d.ts +25 -0
  48. package/dist/skills/loader.d.ts.map +1 -0
  49. package/dist/skills/loader.js +93 -0
  50. package/dist/skills/loader.js.map +1 -0
  51. package/dist/tests/tools.test.d.ts +2 -0
  52. package/dist/tests/tools.test.d.ts.map +1 -0
  53. package/dist/tests/tools.test.js +170 -0
  54. package/dist/tests/tools.test.js.map +1 -0
  55. package/dist/tools/index.d.ts +5 -0
  56. package/dist/tools/index.d.ts.map +1 -0
  57. package/dist/tools/index.js +19 -0
  58. package/dist/tools/index.js.map +1 -0
  59. package/dist/tools/list-files.d.ts +3 -0
  60. package/dist/tools/list-files.d.ts.map +1 -0
  61. package/dist/tools/list-files.js +60 -0
  62. package/dist/tools/list-files.js.map +1 -0
  63. package/dist/tools/read-file.d.ts +3 -0
  64. package/dist/tools/read-file.d.ts.map +1 -0
  65. package/dist/tools/read-file.js +46 -0
  66. package/dist/tools/read-file.js.map +1 -0
  67. package/dist/tools/registry.d.ts +24 -0
  68. package/dist/tools/registry.d.ts.map +1 -0
  69. package/dist/tools/registry.js +37 -0
  70. package/dist/tools/registry.js.map +1 -0
  71. package/dist/tools/run-command.d.ts +3 -0
  72. package/dist/tools/run-command.d.ts.map +1 -0
  73. package/dist/tools/run-command.js +114 -0
  74. package/dist/tools/run-command.js.map +1 -0
  75. package/dist/tools/search-text.d.ts +3 -0
  76. package/dist/tools/search-text.d.ts.map +1 -0
  77. package/dist/tools/search-text.js +103 -0
  78. package/dist/tools/search-text.js.map +1 -0
  79. package/dist/tools/utils.d.ts +6 -0
  80. package/dist/tools/utils.d.ts.map +1 -0
  81. package/dist/tools/utils.js +14 -0
  82. package/dist/tools/utils.js.map +1 -0
  83. package/dist/tools/web-search.d.ts +3 -0
  84. package/dist/tools/web-search.d.ts.map +1 -0
  85. package/dist/tools/web-search.js +80 -0
  86. package/dist/tools/web-search.js.map +1 -0
  87. package/dist/tools/write-file.d.ts +3 -0
  88. package/dist/tools/write-file.d.ts.map +1 -0
  89. package/dist/tools/write-file.js +66 -0
  90. package/dist/tools/write-file.js.map +1 -0
  91. package/package.json +54 -0
  92. package/skills/accessibility/SKILL.md +496 -0
  93. package/skills/api-design/SKILL.md +419 -0
  94. package/skills/code-review/SKILL.md +267 -0
  95. package/skills/debugging/SKILL.md +332 -0
  96. package/skills/documentation/SKILL.md +496 -0
  97. package/skills/error-handling/SKILL.md +504 -0
  98. package/skills/git-workflow/SKILL.md +448 -0
  99. package/skills/human-like-coding/SKILL.md +400 -0
  100. package/skills/performance-optimization/SKILL.md +412 -0
  101. package/skills/prompt-engineering/SKILL.md +362 -0
  102. package/skills/refactoring/SKILL.md +457 -0
  103. package/skills/security-audit/SKILL.md +453 -0
  104. package/skills/testing-strategy/SKILL.md +501 -0
  105. package/skills/webapp-testing/SKILL.md +309 -0
@@ -0,0 +1,496 @@
1
+ ---
2
+ name: documentation
3
+ description: Guide for writing effective technical documentation. Use when creating README files, API docs, code comments, architecture docs, or onboarding guides. Covers documentation structure, writing style, and best practices for different doc types.
4
+ ---
5
+
6
+ # Documentation Skill
7
+
8
+ This skill provides guidance for creating clear, useful, and maintainable technical documentation.
9
+
10
+ ## Overview
11
+
12
+ Good documentation is essential for project success. It helps users understand your code, enables team collaboration, and reduces support burden.
13
+
14
+ ## README Structure
15
+
16
+ ### Essential Sections
17
+
18
+ ```markdown
19
+ # Project Name
20
+
21
+ Brief one-line description of what the project does.
22
+
23
+ ## Features
24
+
25
+ - Feature 1
26
+ - Feature 2
27
+ - Feature 3
28
+
29
+ ## Quick Start
30
+
31
+ \`\`\`bash
32
+ npm install
33
+ npm start
34
+ \`\`\`
35
+
36
+ ## Installation
37
+
38
+ Detailed installation instructions...
39
+
40
+ ## Usage
41
+
42
+ Basic usage examples...
43
+
44
+ ## API Reference
45
+
46
+ Link to API docs or brief reference...
47
+
48
+ ## Configuration
49
+
50
+ Environment variables and config options...
51
+
52
+ ## Contributing
53
+
54
+ How to contribute to the project...
55
+
56
+ ## License
57
+
58
+ MIT License
59
+ ```
60
+
61
+ ### Good README Example
62
+
63
+ ```markdown
64
+ # TaskFlow
65
+
66
+ A lightweight task management CLI for developers who hate context switching.
67
+
68
+ ## Features
69
+
70
+ - 🚀 Fast - Start tracking in < 1 second
71
+ - 📝 Simple - No complex setup required
72
+ - 🔄 Syncs - Works with GitHub Issues
73
+ - 💻 CLI-first - Designed for terminal lovers
74
+
75
+ ## Quick Start
76
+
77
+ \`\`\`bash
78
+ # Install globally
79
+ npm install -g taskflow
80
+
81
+ # Initialize in your project
82
+ taskflow init
83
+
84
+ # Add your first task
85
+ taskflow add "Fix login bug" --priority high
86
+ \`\`\`
87
+
88
+ ## Installation
89
+
90
+ ### Prerequisites
91
+ - Node.js 18+
92
+ - npm or yarn
93
+
94
+ ### Install
95
+ \`\`\`bash
96
+ npm install -g taskflow
97
+ \`\`\`
98
+
99
+ ## Usage
100
+
101
+ ### Create a Task
102
+ \`\`\`bash
103
+ taskflow add "Task description" [options]
104
+
105
+ Options:
106
+ --priority, -p Set priority (low, medium, high)
107
+ --due, -d Set due date (YYYY-MM-DD)
108
+ --tag, -t Add tags (comma-separated)
109
+ \`\`\`
110
+
111
+ ### List Tasks
112
+ \`\`\`bash
113
+ taskflow list # All tasks
114
+ taskflow list --priority high
115
+ taskflow list --tag bug
116
+ \`\`\`
117
+
118
+ ### Complete a Task
119
+ \`\`\`bash
120
+ taskflow done <task-id>
121
+ \`\`\`
122
+
123
+ ## Configuration
124
+
125
+ Create `.taskflowrc` in your project root:
126
+
127
+ \`\`\`json
128
+ {
129
+ "defaultPriority": "medium",
130
+ "syncWithGitHub": true,
131
+ "githubRepo": "username/repo"
132
+ }
133
+ \`\`\`
134
+
135
+ ### Environment Variables
136
+
137
+ | Variable | Description | Default |
138
+ |----------|-------------|---------|
139
+ | TASKFLOW_HOME | Config directory | ~/.taskflow |
140
+ | GITHUB_TOKEN | GitHub API token | - |
141
+
142
+ ## Contributing
143
+
144
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
145
+
146
+ ## License
147
+
148
+ MIT © Your Name
149
+ ```
150
+
151
+ ## Code Comments
152
+
153
+ ### When to Comment
154
+
155
+ **Comment WHY, not WHAT**
156
+ ```javascript
157
+ // BAD - describes what code does
158
+ // Loop through users
159
+ for (const user of users) {
160
+
161
+ }
162
+
163
+ // GOOD - explains why
164
+ // Process users in batches to avoid memory issues
165
+ // with large datasets (>10k users)
166
+ for (const user of users) {
167
+
168
+ }
169
+ ```
170
+
171
+ **Comment Complex Logic**
172
+ ```javascript
173
+ // Calculate discount based on loyalty tier and purchase history
174
+ // Tier 1: 5% base + 1% per year (max 10%)
175
+ // Tier 2: 10% base + 1% per year (max 20%)
176
+ // Tier 3: 15% base + 2% per year (max 30%)
177
+ function calculateDiscount(customer) {
178
+ const baseDiscount = [5, 10, 15][customer.tier - 1];
179
+ const yearlyBonus = customer.tier === 3 ? 2 : 1;
180
+ const maxDiscount = [10, 20, 30][customer.tier - 1];
181
+
182
+ return Math.min(
183
+ baseDiscount + (customer.yearsActive * yearlyBonus),
184
+ maxDiscount
185
+ );
186
+ }
187
+ ```
188
+
189
+ **Comment Non-Obvious Decisions**
190
+ ```javascript
191
+ // Using Map instead of Object here because we need
192
+ // to preserve insertion order for the UI display
193
+ const orderedItems = new Map();
194
+ ```
195
+
196
+ ### JSDoc Comments
197
+
198
+ ```javascript
199
+ /**
200
+ * Calculates the total price including tax and discounts.
201
+ *
202
+ * @param {Object} order - The order object
203
+ * @param {number} order.subtotal - Order subtotal before tax
204
+ * @param {number} order.taxRate - Tax rate as decimal (e.g., 0.08)
205
+ * @param {number} [order.discount=0] - Discount amount to apply
206
+ * @returns {number} The final total price
207
+ * @throws {Error} If subtotal is negative
208
+ *
209
+ * @example
210
+ * calculateTotal({ subtotal: 100, taxRate: 0.08, discount: 10 })
211
+ * // Returns: 98.00
212
+ */
213
+ function calculateTotal({ subtotal, taxRate, discount = 0 }) {
214
+ if (subtotal < 0) {
215
+ throw new Error('Subtotal cannot be negative');
216
+ }
217
+
218
+ const taxAmount = subtotal * taxRate;
219
+ return subtotal + taxAmount - discount;
220
+ }
221
+ ```
222
+
223
+ ### TypeScript Documentation
224
+
225
+ ```typescript
226
+ /**
227
+ * User account information.
228
+ */
229
+ interface User {
230
+ /** Unique identifier */
231
+ id: string;
232
+
233
+ /** User's display name */
234
+ name: string;
235
+
236
+ /** Email address (must be verified) */
237
+ email: string;
238
+
239
+ /** Account creation timestamp */
240
+ createdAt: Date;
241
+
242
+ /**
243
+ * User's role in the system.
244
+ * @default 'user'
245
+ */
246
+ role: 'admin' | 'moderator' | 'user';
247
+ }
248
+ ```
249
+
250
+ ## API Documentation
251
+
252
+ ### Endpoint Documentation
253
+
254
+ ```markdown
255
+ ## Create User
256
+
257
+ Creates a new user account.
258
+
259
+ ### Request
260
+
261
+ `POST /api/v1/users`
262
+
263
+ #### Headers
264
+
265
+ | Name | Required | Description |
266
+ |------|----------|-------------|
267
+ | Authorization | Yes | Bearer token |
268
+ | Content-Type | Yes | Must be `application/json` |
269
+
270
+ #### Body
271
+
272
+ \`\`\`json
273
+ {
274
+ "name": "John Doe",
275
+ "email": "john@example.com",
276
+ "password": "securepassword123"
277
+ }
278
+ \`\`\`
279
+
280
+ | Field | Type | Required | Description |
281
+ |-------|------|----------|-------------|
282
+ | name | string | Yes | User's full name (2-100 chars) |
283
+ | email | string | Yes | Valid email address |
284
+ | password | string | Yes | Min 8 chars, 1 number, 1 special |
285
+
286
+ ### Response
287
+
288
+ #### Success (201 Created)
289
+
290
+ \`\`\`json
291
+ {
292
+ "id": "usr_abc123",
293
+ "name": "John Doe",
294
+ "email": "john@example.com",
295
+ "createdAt": "2024-01-15T10:30:00Z"
296
+ }
297
+ \`\`\`
298
+
299
+ #### Errors
300
+
301
+ | Status | Code | Description |
302
+ |--------|------|-------------|
303
+ | 400 | INVALID_REQUEST | Missing or invalid fields |
304
+ | 409 | EMAIL_EXISTS | Email already registered |
305
+ | 422 | VALIDATION_ERROR | Validation failed |
306
+
307
+ ### Example
308
+
309
+ \`\`\`bash
310
+ curl -X POST https://api.example.com/v1/users \
311
+ -H "Authorization: Bearer your-token" \
312
+ -H "Content-Type: application/json" \
313
+ -d '{"name": "John Doe", "email": "john@example.com", "password": "pass123!"}'
314
+ \`\`\`
315
+ ```
316
+
317
+ ## Architecture Documentation
318
+
319
+ ### Architecture Decision Records (ADR)
320
+
321
+ ```markdown
322
+ # ADR 001: Use PostgreSQL for Primary Database
323
+
324
+ ## Status
325
+ Accepted
326
+
327
+ ## Context
328
+ We need to choose a primary database for the application.
329
+ Requirements:
330
+ - ACID compliance for financial transactions
331
+ - Support for complex queries
332
+ - Scalability to 10M+ records
333
+ - Strong ecosystem and tooling
334
+
335
+ ## Decision
336
+ We will use PostgreSQL as our primary database.
337
+
338
+ ## Consequences
339
+
340
+ ### Positive
341
+ - Proven reliability for financial applications
342
+ - Excellent query performance with proper indexing
343
+ - Rich feature set (JSON support, full-text search)
344
+ - Strong community and documentation
345
+
346
+ ### Negative
347
+ - Requires more operational expertise than managed solutions
348
+ - Schema migrations need careful planning
349
+ - May need read replicas for high read workloads
350
+
351
+ ## Alternatives Considered
352
+
353
+ ### MySQL
354
+ - Rejected: Less robust for complex transactions
355
+ - Would work but PostgreSQL has better feature set
356
+
357
+ ### MongoDB
358
+ - Rejected: Need strong consistency for financial data
359
+ - Document model doesn't fit our relational data well
360
+ ```
361
+
362
+ ### Component Documentation
363
+
364
+ ```markdown
365
+ # Authentication Service
366
+
367
+ ## Overview
368
+
369
+ Handles user authentication and authorization across the platform.
370
+
371
+ ## Architecture
372
+
373
+ \`\`\`
374
+ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐
375
+ │ Client │────▶│ Auth API │────▶│ Database │
376
+ └─────────────┘ └──────────────┘ └─────────────┘
377
+
378
+
379
+ ┌──────────────┐
380
+ │ Redis │
381
+ │ (Sessions) │
382
+ └──────────────┘
383
+ \`\`\`
384
+
385
+ ## Components
386
+
387
+ ### AuthController
388
+ Handles HTTP requests for login, logout, and token refresh.
389
+
390
+ ### TokenService
391
+ Manages JWT creation, validation, and refresh.
392
+
393
+ ### UserRepository
394
+ Database operations for user authentication.
395
+
396
+ ## API Endpoints
397
+
398
+ | Method | Path | Description |
399
+ |--------|------|-------------|
400
+ | POST | /auth/login | Authenticate user |
401
+ | POST | /auth/logout | Invalidate session |
402
+ | POST | /auth/refresh | Refresh access token |
403
+
404
+ ## Configuration
405
+
406
+ | Variable | Description | Required |
407
+ |----------|-------------|----------|
408
+ | JWT_SECRET | Secret for signing tokens | Yes |
409
+ | JWT_EXPIRY | Token expiration time | Yes |
410
+ | REDIS_URL | Redis connection URL | Yes |
411
+
412
+ ## Security Considerations
413
+
414
+ - Tokens expire after 15 minutes
415
+ - Refresh tokens stored in httpOnly cookies
416
+ - Failed login attempts rate-limited
417
+ - Sessions invalidated on password change
418
+ ```
419
+
420
+ ## Writing Style Guide
421
+
422
+ ### Be Concise
423
+ ```markdown
424
+ # BAD
425
+ In order to facilitate the installation process, you will need
426
+ to execute the following command in your terminal application.
427
+
428
+ # GOOD
429
+ Install with:
430
+ \`\`\`bash
431
+ npm install package-name
432
+ \`\`\`
433
+ ```
434
+
435
+ ### Use Active Voice
436
+ ```markdown
437
+ # BAD
438
+ The configuration file should be modified by the user.
439
+
440
+ # GOOD
441
+ Modify the configuration file:
442
+ ```
443
+
444
+ ### Be Specific
445
+ ```markdown
446
+ # BAD
447
+ This may cause issues.
448
+
449
+ # GOOD
450
+ This causes a memory leak when processing more than 1000 items.
451
+ ```
452
+
453
+ ### Use Examples
454
+ ```markdown
455
+ # BAD
456
+ Pass the options object to configure.
457
+
458
+ # GOOD
459
+ Configure with options:
460
+ \`\`\`javascript
461
+ configure({
462
+ timeout: 5000,
463
+ retries: 3,
464
+ debug: true
465
+ });
466
+ \`\`\`
467
+ ```
468
+
469
+ ## Documentation Checklist
470
+
471
+ ### README
472
+ - [ ] Clear project description
473
+ - [ ] Quick start guide
474
+ - [ ] Installation instructions
475
+ - [ ] Basic usage examples
476
+ - [ ] Configuration options
477
+ - [ ] Contributing guidelines
478
+
479
+ ### Code Comments
480
+ - [ ] Complex logic explained
481
+ - [ ] Why, not what
482
+ - [ ] Public APIs documented
483
+ - [ ] Examples included
484
+
485
+ ### API Docs
486
+ - [ ] All endpoints documented
487
+ - [ ] Request/response formats
488
+ - [ ] Error codes explained
489
+ - [ ] Authentication documented
490
+ - [ ] Examples provided
491
+
492
+ ### Architecture
493
+ - [ ] System overview
494
+ - [ ] Component relationships
495
+ - [ ] Key decisions documented
496
+ - [ ] Security considerations