@skillkit/resources 1.8.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/dist/index.js ADDED
@@ -0,0 +1,991 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ // src/agents/index.ts
9
+ import { readFileSync, existsSync, mkdirSync, writeFileSync } from "fs";
10
+ import { join, dirname } from "path";
11
+ import { fileURLToPath } from "url";
12
+ import { homedir } from "os";
13
+
14
+ // src/agents/manifest.ts
15
+ var BUNDLED_AGENTS = [
16
+ {
17
+ id: "architect",
18
+ name: "Architect",
19
+ description: "Software architecture specialist for system design, scalability, and technical decision-making",
20
+ category: "planning",
21
+ model: "opus",
22
+ tools: ["Read", "Grep", "Glob"],
23
+ tags: ["architecture", "design", "planning", "scalability"],
24
+ version: "1.0.0"
25
+ },
26
+ {
27
+ id: "build-error-resolver",
28
+ name: "Build Error Resolver",
29
+ description: "Build and TypeScript error resolution specialist. Fixes build/type errors with minimal diffs",
30
+ category: "development",
31
+ model: "sonnet",
32
+ tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"],
33
+ tags: ["build", "typescript", "errors", "debugging"],
34
+ version: "1.0.0"
35
+ },
36
+ {
37
+ id: "code-reviewer",
38
+ name: "Code Reviewer",
39
+ description: "Expert code review specialist. Reviews code for quality, security, and maintainability",
40
+ category: "review",
41
+ model: "sonnet",
42
+ tools: ["Read", "Grep", "Glob", "Bash"],
43
+ tags: ["review", "quality", "best-practices"],
44
+ version: "1.0.0"
45
+ },
46
+ {
47
+ id: "doc-updater",
48
+ name: "Documentation Updater",
49
+ description: "Documentation and codemap specialist. Updates codemaps, READMEs, and guides",
50
+ category: "documentation",
51
+ model: "sonnet",
52
+ tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"],
53
+ tags: ["documentation", "readme", "guides"],
54
+ version: "1.0.0"
55
+ },
56
+ {
57
+ id: "e2e-runner",
58
+ name: "E2E Test Runner",
59
+ description: "End-to-end testing specialist using Playwright. Generates, maintains, and runs E2E tests",
60
+ category: "testing",
61
+ model: "sonnet",
62
+ tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"],
63
+ tags: ["testing", "e2e", "playwright", "automation"],
64
+ version: "1.0.0"
65
+ },
66
+ {
67
+ id: "planner",
68
+ name: "Implementation Planner",
69
+ description: "Expert planning specialist for complex features and refactoring. Creates step-by-step plans",
70
+ category: "planning",
71
+ model: "opus",
72
+ tools: ["Read", "Grep", "Glob"],
73
+ tags: ["planning", "design", "architecture"],
74
+ version: "1.0.0"
75
+ },
76
+ {
77
+ id: "refactor-cleaner",
78
+ name: "Refactor & Clean",
79
+ description: "Dead code cleanup and consolidation specialist. Removes unused code and duplicates",
80
+ category: "refactoring",
81
+ model: "sonnet",
82
+ tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"],
83
+ tags: ["refactoring", "cleanup", "dead-code"],
84
+ version: "1.0.0"
85
+ },
86
+ {
87
+ id: "security-reviewer",
88
+ name: "Security Reviewer",
89
+ description: "Security vulnerability detection and remediation specialist. OWASP Top 10, secrets, injection",
90
+ category: "security",
91
+ model: "opus",
92
+ tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"],
93
+ tags: ["security", "vulnerabilities", "owasp", "audit"],
94
+ version: "1.0.0"
95
+ },
96
+ {
97
+ id: "tdd-guide",
98
+ name: "TDD Guide",
99
+ description: "Test-Driven Development specialist. Write tests first, then implement minimal code to pass",
100
+ category: "testing",
101
+ model: "sonnet",
102
+ tools: ["Read", "Write", "Edit", "Bash", "Grep"],
103
+ tags: ["testing", "tdd", "unit-tests", "coverage"],
104
+ version: "1.0.0"
105
+ }
106
+ ];
107
+ var AGENT_MANIFEST = {
108
+ version: 1,
109
+ agents: BUNDLED_AGENTS
110
+ };
111
+
112
+ // src/agents/index.ts
113
+ var __filename = fileURLToPath(import.meta.url);
114
+ var __dirname = dirname(__filename);
115
+ function getTemplatesDir() {
116
+ return join(__dirname, "..", "..", "templates", "agents");
117
+ }
118
+ function getBundledAgents() {
119
+ return BUNDLED_AGENTS;
120
+ }
121
+ function getBundledAgent(id) {
122
+ return BUNDLED_AGENTS.find((a) => a.id === id) || null;
123
+ }
124
+ function getBundledAgentsByCategory(category) {
125
+ return BUNDLED_AGENTS.filter((a) => a.category === category);
126
+ }
127
+ function getBundledAgentIds() {
128
+ return BUNDLED_AGENTS.map((a) => a.id);
129
+ }
130
+ function getAgentTemplate(id) {
131
+ const agent = getBundledAgent(id);
132
+ if (!agent) return null;
133
+ const templatePath = join(getTemplatesDir(), `${id}.md`);
134
+ try {
135
+ if (existsSync(templatePath)) {
136
+ return readFileSync(templatePath, "utf-8");
137
+ }
138
+ return null;
139
+ } catch {
140
+ return null;
141
+ }
142
+ }
143
+ function installBundledAgent(id, options = {}) {
144
+ const agent = getBundledAgent(id);
145
+ if (!agent) {
146
+ return {
147
+ success: false,
148
+ agentId: id,
149
+ path: "",
150
+ message: `Bundled agent not found: ${id}`
151
+ };
152
+ }
153
+ const template = getAgentTemplate(id);
154
+ if (!template) {
155
+ return {
156
+ success: false,
157
+ agentId: id,
158
+ path: "",
159
+ message: `Template not found for agent: ${id}`
160
+ };
161
+ }
162
+ let targetDir;
163
+ if (options.targetDir) {
164
+ targetDir = options.targetDir;
165
+ } else if (options.global) {
166
+ targetDir = join(homedir(), ".claude", "agents");
167
+ } else {
168
+ targetDir = join(process.cwd(), ".claude", "agents");
169
+ }
170
+ const targetPath = join(targetDir, `${id}.md`);
171
+ if (existsSync(targetPath) && !options.force) {
172
+ return {
173
+ success: false,
174
+ agentId: id,
175
+ path: targetPath,
176
+ message: `Agent already exists: ${targetPath}. Use --force to overwrite.`
177
+ };
178
+ }
179
+ try {
180
+ if (!existsSync(targetDir)) {
181
+ mkdirSync(targetDir, { recursive: true });
182
+ }
183
+ writeFileSync(targetPath, template);
184
+ return {
185
+ success: true,
186
+ agentId: id,
187
+ path: targetPath,
188
+ message: `Installed agent: ${agent.name}`
189
+ };
190
+ } catch (error) {
191
+ return {
192
+ success: false,
193
+ agentId: id,
194
+ path: targetPath,
195
+ message: `Failed to install agent: ${error instanceof Error ? error.message : "Unknown error"}`
196
+ };
197
+ }
198
+ }
199
+ function getInstalledAgentIds(searchDirs) {
200
+ const dirs = searchDirs || [
201
+ join(process.cwd(), ".claude", "agents"),
202
+ join(homedir(), ".claude", "agents")
203
+ ];
204
+ const installed = /* @__PURE__ */ new Set();
205
+ for (const dir of dirs) {
206
+ if (existsSync(dir)) {
207
+ try {
208
+ const files = __require("fs").readdirSync(dir);
209
+ for (const file of files) {
210
+ if (file.endsWith(".md")) {
211
+ installed.add(file.replace(".md", ""));
212
+ }
213
+ }
214
+ } catch {
215
+ continue;
216
+ }
217
+ }
218
+ }
219
+ return Array.from(installed);
220
+ }
221
+ function getAvailableAgents(searchDirs) {
222
+ const installed = new Set(getInstalledAgentIds(searchDirs));
223
+ return BUNDLED_AGENTS.filter((a) => !installed.has(a.id));
224
+ }
225
+ function isAgentInstalled(id, searchDirs) {
226
+ return getInstalledAgentIds(searchDirs).includes(id);
227
+ }
228
+
229
+ // src/commands/manifest.ts
230
+ var COMMAND_TEMPLATES = [
231
+ {
232
+ id: "tdd",
233
+ name: "TDD Workflow",
234
+ description: "Test-Driven Development workflow: RED \u2192 GREEN \u2192 REFACTOR",
235
+ category: "testing",
236
+ trigger: "/tdd",
237
+ agent: "tdd-guide",
238
+ prompt: `Start TDD workflow for the requested feature or fix.
239
+
240
+ Follow the RED \u2192 GREEN \u2192 REFACTOR cycle:
241
+
242
+ 1. **RED**: Write a failing test that describes the expected behavior
243
+ 2. **GREEN**: Write the minimum code needed to pass the test
244
+ 3. **REFACTOR**: Improve the code while keeping tests green
245
+
246
+ Guidelines:
247
+ - One test at a time
248
+ - Tests should be small and focused
249
+ - Commit after each GREEN phase
250
+ - Keep refactoring incremental
251
+
252
+ Start by asking: What behavior should we test first?`,
253
+ examples: [
254
+ "/tdd add validation to user form",
255
+ "/tdd implement search functionality"
256
+ ]
257
+ },
258
+ {
259
+ id: "plan",
260
+ name: "Implementation Planning",
261
+ description: "Create a detailed implementation plan before coding",
262
+ category: "planning",
263
+ trigger: "/plan",
264
+ agent: "planner",
265
+ prompt: `Create an implementation plan for the requested feature or change.
266
+
267
+ Include:
268
+ 1. Requirements analysis
269
+ 2. Current state assessment
270
+ 3. Proposed approach with alternatives
271
+ 4. Step-by-step implementation tasks
272
+ 5. Risk assessment and mitigations
273
+ 6. Verification criteria
274
+
275
+ Wait for plan approval before any implementation.`,
276
+ examples: [
277
+ "/plan add user authentication",
278
+ "/plan refactor payment module"
279
+ ]
280
+ },
281
+ {
282
+ id: "e2e",
283
+ name: "E2E Test Generation",
284
+ description: "Generate and run end-to-end tests with Playwright",
285
+ category: "testing",
286
+ trigger: "/e2e",
287
+ agent: "e2e-runner",
288
+ prompt: `Generate E2E tests for the specified user journey.
289
+
290
+ Process:
291
+ 1. Analyze the user flow to test
292
+ 2. Generate Playwright test code
293
+ 3. Run the test
294
+ 4. Capture screenshots/videos if needed
295
+ 5. Report results
296
+
297
+ Focus on testing critical user paths with reliable selectors.`,
298
+ examples: [
299
+ "/e2e test user login flow",
300
+ "/e2e test checkout process"
301
+ ]
302
+ },
303
+ {
304
+ id: "learn",
305
+ name: "Extract Learnings",
306
+ description: "Extract reusable patterns from the current session",
307
+ category: "learning",
308
+ trigger: "/learn",
309
+ prompt: `Analyze the current session and extract reusable patterns.
310
+
311
+ Look for:
312
+ 1. Error fixes that could apply to similar situations
313
+ 2. Workarounds for library/framework quirks
314
+ 3. Effective debugging approaches
315
+ 4. Project-specific conventions discovered
316
+
317
+ Format each learning as:
318
+ - Problem: What issue was encountered
319
+ - Solution: How it was resolved
320
+ - Context: When this applies
321
+ - Example: Code snippet if relevant
322
+
323
+ Ask for approval before saving patterns.`,
324
+ examples: [
325
+ "/learn from this debugging session",
326
+ "/learn extract patterns from recent fixes"
327
+ ]
328
+ },
329
+ {
330
+ id: "build-fix",
331
+ name: "Build Error Resolution",
332
+ description: "Fix build errors with minimal changes",
333
+ category: "development",
334
+ trigger: "/build-fix",
335
+ agent: "build-error-resolver",
336
+ prompt: `Fix the current build/type errors.
337
+
338
+ Process:
339
+ 1. Run the build to capture all errors
340
+ 2. Analyze each error's root cause
341
+ 3. Apply minimal fixes (no refactoring)
342
+ 4. Verify the build passes
343
+ 5. Run tests to ensure no regressions
344
+
345
+ Focus on getting the build green quickly with the smallest possible changes.`,
346
+ examples: [
347
+ "/build-fix",
348
+ "/build-fix typescript errors"
349
+ ]
350
+ },
351
+ {
352
+ id: "code-review",
353
+ name: "Code Review",
354
+ description: "Review code changes for quality and security",
355
+ category: "review",
356
+ trigger: "/code-review",
357
+ agent: "code-reviewer",
358
+ prompt: `Review the specified code changes.
359
+
360
+ Check for:
361
+ 1. Correctness and edge cases
362
+ 2. Security vulnerabilities
363
+ 3. Performance issues
364
+ 4. Code quality and maintainability
365
+ 5. Test coverage
366
+
367
+ Provide actionable feedback prioritized by severity.`,
368
+ examples: [
369
+ "/code-review recent changes",
370
+ "/code-review src/auth/"
371
+ ]
372
+ },
373
+ {
374
+ id: "security-review",
375
+ name: "Security Review",
376
+ description: "Audit code for security vulnerabilities",
377
+ category: "review",
378
+ trigger: "/security-review",
379
+ agent: "security-reviewer",
380
+ prompt: `Perform a security audit of the specified code.
381
+
382
+ Check for:
383
+ 1. OWASP Top 10 vulnerabilities
384
+ 2. Hardcoded secrets or credentials
385
+ 3. Input validation issues
386
+ 4. Authentication/authorization flaws
387
+ 5. Data exposure risks
388
+
389
+ Report findings with severity and remediation steps.`,
390
+ examples: [
391
+ "/security-review",
392
+ "/security-review src/api/"
393
+ ]
394
+ },
395
+ {
396
+ id: "checkpoint",
397
+ name: "Create Checkpoint",
398
+ description: "Create a verification checkpoint for current state",
399
+ category: "workflow",
400
+ trigger: "/checkpoint",
401
+ prompt: `Create a checkpoint to verify the current implementation state.
402
+
403
+ 1. Summarize changes made so far
404
+ 2. Run all relevant tests
405
+ 3. Check build status
406
+ 4. Note any pending issues
407
+ 5. Save context for potential recovery
408
+
409
+ This helps ensure work can be resumed or rolled back if needed.`,
410
+ examples: [
411
+ "/checkpoint before major refactor",
412
+ "/checkpoint feature complete"
413
+ ]
414
+ },
415
+ {
416
+ id: "verify",
417
+ name: "Verification Loop",
418
+ description: "Run comprehensive verification of recent changes",
419
+ category: "workflow",
420
+ trigger: "/verify",
421
+ prompt: `Run verification loop for recent changes.
422
+
423
+ Steps:
424
+ 1. Type check (tsc --noEmit)
425
+ 2. Lint check (eslint)
426
+ 3. Unit tests
427
+ 4. Build verification
428
+ 5. Integration tests (if applicable)
429
+
430
+ Report status and any failures that need attention.`,
431
+ examples: [
432
+ "/verify",
433
+ "/verify all"
434
+ ]
435
+ },
436
+ {
437
+ id: "cleanup",
438
+ name: "Code Cleanup",
439
+ description: "Remove dead code and consolidate duplicates",
440
+ category: "development",
441
+ trigger: "/cleanup",
442
+ agent: "refactor-cleaner",
443
+ prompt: `Analyze and clean up the codebase.
444
+
445
+ 1. Run dead code analysis (knip, ts-prune)
446
+ 2. Identify unused exports and dependencies
447
+ 3. Find duplicate code patterns
448
+ 4. Remove with verification
449
+ 5. Update imports as needed
450
+
451
+ Make incremental changes with tests passing at each step.`,
452
+ examples: [
453
+ "/cleanup",
454
+ "/cleanup src/utils/"
455
+ ]
456
+ }
457
+ ];
458
+ var COMMAND_MANIFEST = {
459
+ version: 1,
460
+ commands: COMMAND_TEMPLATES
461
+ };
462
+
463
+ // src/commands/index.ts
464
+ function getCommandTemplates() {
465
+ return COMMAND_TEMPLATES;
466
+ }
467
+ function getCommandTemplate(id) {
468
+ return COMMAND_TEMPLATES.find((c) => c.id === id) || null;
469
+ }
470
+ function getCommandByTrigger(trigger) {
471
+ const normalizedTrigger = trigger.startsWith("/") ? trigger : `/${trigger}`;
472
+ return COMMAND_TEMPLATES.find((c) => c.trigger === normalizedTrigger) || null;
473
+ }
474
+ function getCommandTemplatesByCategory(category) {
475
+ return COMMAND_TEMPLATES.filter((c) => c.category === category);
476
+ }
477
+ function getCommandTemplateIds() {
478
+ return COMMAND_TEMPLATES.map((c) => c.id);
479
+ }
480
+ function getCommandTriggers() {
481
+ return COMMAND_TEMPLATES.map((c) => c.trigger);
482
+ }
483
+
484
+ // src/profiles/manifest.ts
485
+ var BUILTIN_PROFILES = [
486
+ {
487
+ name: "dev",
488
+ description: "Active development mode",
489
+ focus: "Implementation speed and working solutions",
490
+ behaviors: [
491
+ "Prefer working code over perfect code",
492
+ "Quick iterations with frequent testing",
493
+ "Minimize context switching",
494
+ "Focus on the current task"
495
+ ],
496
+ priorities: ["Functionality", "Simplicity", "Testability", "Speed"],
497
+ preferredTools: ["Edit", "Write", "Bash", "Read"],
498
+ injectedContext: `You are in DEVELOPMENT mode. Focus on:
499
+ - Getting working code quickly
500
+ - Writing minimal tests for new functionality
501
+ - Keeping changes small and focused
502
+ - Committing frequently`
503
+ },
504
+ {
505
+ name: "review",
506
+ description: "Code review mode",
507
+ focus: "Quality, security, and maintainability",
508
+ behaviors: [
509
+ "Thorough analysis before suggesting changes",
510
+ "Security-first mindset",
511
+ "Consider edge cases and failure modes",
512
+ "Provide constructive feedback"
513
+ ],
514
+ priorities: ["Security", "Code quality", "Best practices", "Maintainability"],
515
+ preferredTools: ["Read", "Grep", "Glob"],
516
+ avoidTools: ["Edit", "Write"],
517
+ injectedContext: `You are in REVIEW mode. Focus on:
518
+ - Identifying potential bugs and security issues
519
+ - Checking code against best practices
520
+ - Verifying test coverage
521
+ - Suggesting improvements without making changes`
522
+ },
523
+ {
524
+ name: "research",
525
+ description: "Exploration and discovery mode",
526
+ focus: "Understanding and analysis",
527
+ behaviors: [
528
+ "Deep exploration of codebase",
529
+ "Document findings thoroughly",
530
+ "Consider multiple approaches",
531
+ "Ask clarifying questions"
532
+ ],
533
+ priorities: ["Understanding", "Documentation", "Options analysis", "Learning"],
534
+ preferredTools: ["Read", "Grep", "Glob", "WebSearch", "WebFetch"],
535
+ avoidTools: ["Edit", "Write"],
536
+ injectedContext: `You are in RESEARCH mode. Focus on:
537
+ - Understanding the codebase structure
538
+ - Finding relevant documentation
539
+ - Exploring different approaches
540
+ - Creating summaries of findings`
541
+ },
542
+ {
543
+ name: "security",
544
+ description: "Security audit mode",
545
+ focus: "Vulnerability detection and hardening",
546
+ behaviors: [
547
+ "Assume hostile input",
548
+ "Check all authentication and authorization",
549
+ "Look for common vulnerability patterns",
550
+ "Verify encryption and data protection"
551
+ ],
552
+ priorities: ["Security", "Data protection", "Authentication", "Authorization"],
553
+ preferredTools: ["Read", "Grep", "Glob", "Bash"],
554
+ injectedContext: `You are in SECURITY AUDIT mode. Focus on:
555
+ - OWASP Top 10 vulnerabilities
556
+ - Authentication and authorization flaws
557
+ - Data exposure risks
558
+ - Injection vulnerabilities
559
+ - Secrets and credentials in code`
560
+ }
561
+ ];
562
+ var PROFILE_MANIFEST = {
563
+ version: 1,
564
+ profiles: BUILTIN_PROFILES
565
+ };
566
+
567
+ // src/profiles/index.ts
568
+ function getBuiltinProfiles() {
569
+ return BUILTIN_PROFILES;
570
+ }
571
+ function getBuiltinProfile(name) {
572
+ return BUILTIN_PROFILES.find((p) => p.name === name) || null;
573
+ }
574
+ function getProfileNames() {
575
+ return BUILTIN_PROFILES.map((p) => p.name);
576
+ }
577
+ function isValidProfileName(name) {
578
+ return getProfileNames().includes(name);
579
+ }
580
+ function getProfileContext(name) {
581
+ const profile = getBuiltinProfile(name);
582
+ return profile?.injectedContext || null;
583
+ }
584
+
585
+ // src/guidelines/manifest.ts
586
+ var BUILTIN_GUIDELINES = [
587
+ {
588
+ id: "security",
589
+ name: "Security Guidelines",
590
+ description: "Security best practices and vulnerability prevention",
591
+ category: "security",
592
+ priority: 10,
593
+ enabled: true,
594
+ scope: "global",
595
+ content: `## Security Guidelines
596
+
597
+ ### Input Validation
598
+ - Validate all user input on the server side
599
+ - Use allowlists over denylists when possible
600
+ - Sanitize data before use in queries, commands, or output
601
+
602
+ ### Authentication & Authorization
603
+ - Never store passwords in plain text
604
+ - Use secure session management
605
+ - Implement proper authorization checks on every endpoint
606
+ - Use HTTPS for all communications
607
+
608
+ ### Data Protection
609
+ - Encrypt sensitive data at rest and in transit
610
+ - Never log sensitive information
611
+ - Use environment variables for secrets
612
+ - Implement proper access controls
613
+
614
+ ### Common Vulnerabilities to Prevent
615
+ - SQL Injection: Use parameterized queries
616
+ - XSS: Encode output, use CSP headers
617
+ - CSRF: Use anti-CSRF tokens
618
+ - Command Injection: Avoid shell commands with user input`
619
+ },
620
+ {
621
+ id: "code-style",
622
+ name: "Code Style Guidelines",
623
+ description: "Code formatting and style conventions",
624
+ category: "code-style",
625
+ priority: 7,
626
+ enabled: true,
627
+ scope: "global",
628
+ content: `## Code Style Guidelines
629
+
630
+ ### Naming Conventions
631
+ - Use descriptive, meaningful names
632
+ - camelCase for variables and functions
633
+ - PascalCase for classes and types
634
+ - SCREAMING_SNAKE_CASE for constants
635
+
636
+ ### Code Organization
637
+ - One concept per file
638
+ - Group related code together
639
+ - Keep files under 300 lines when practical
640
+ - Use barrel exports (index.ts) for public APIs
641
+
642
+ ### Functions
643
+ - Single responsibility principle
644
+ - Keep functions under 30 lines when practical
645
+ - Use early returns to reduce nesting
646
+ - Avoid side effects in pure functions
647
+
648
+ ### Comments
649
+ - Don't comment obvious code
650
+ - Explain "why" not "what"
651
+ - Keep comments up to date
652
+ - Use JSDoc for public APIs`
653
+ },
654
+ {
655
+ id: "testing",
656
+ name: "Testing Guidelines",
657
+ description: "Testing best practices and coverage requirements",
658
+ category: "testing",
659
+ priority: 8,
660
+ enabled: true,
661
+ scope: "global",
662
+ content: `## Testing Guidelines
663
+
664
+ ### Test Coverage
665
+ - Aim for 80%+ code coverage
666
+ - 100% coverage for critical paths
667
+ - Don't sacrifice quality for coverage metrics
668
+
669
+ ### Test Structure
670
+ - Arrange, Act, Assert (AAA) pattern
671
+ - One concept per test
672
+ - Descriptive test names that explain behavior
673
+ - Independent tests (no shared state)
674
+
675
+ ### Test Types
676
+ - Unit tests for business logic
677
+ - Integration tests for component interactions
678
+ - E2E tests for critical user flows
679
+
680
+ ### Test Quality
681
+ - Tests should be deterministic
682
+ - Fast execution (< 100ms for unit tests)
683
+ - Easy to understand and maintain
684
+ - Test behavior, not implementation`
685
+ },
686
+ {
687
+ id: "git",
688
+ name: "Git Workflow Guidelines",
689
+ description: "Version control best practices",
690
+ category: "git",
691
+ priority: 6,
692
+ enabled: true,
693
+ scope: "global",
694
+ content: `## Git Workflow Guidelines
695
+
696
+ ### Commits
697
+ - Write clear, concise commit messages
698
+ - Use conventional commits format
699
+ - One logical change per commit
700
+ - Don't commit generated files or secrets
701
+
702
+ ### Branches
703
+ - Use feature branches
704
+ - Keep branches short-lived
705
+ - Delete branches after merge
706
+ - Protect main/master branch
707
+
708
+ ### Pull Requests
709
+ - Keep PRs focused and small
710
+ - Write meaningful descriptions
711
+ - Request reviews from appropriate people
712
+ - Address all review comments
713
+
714
+ ### Commit Message Format
715
+ \`\`\`
716
+ <type>(<scope>): <description>
717
+
718
+ [optional body]
719
+
720
+ [optional footer]
721
+ \`\`\`
722
+
723
+ Types: feat, fix, docs, style, refactor, test, chore`
724
+ },
725
+ {
726
+ id: "performance",
727
+ name: "Performance Guidelines",
728
+ description: "Performance optimization best practices",
729
+ category: "performance",
730
+ priority: 5,
731
+ enabled: true,
732
+ scope: "global",
733
+ content: `## Performance Guidelines
734
+
735
+ ### General Principles
736
+ - Measure before optimizing
737
+ - Optimize critical paths first
738
+ - Consider time/space tradeoffs
739
+ - Profile in production-like environments
740
+
741
+ ### Database
742
+ - Use indexes appropriately
743
+ - Avoid N+1 queries
744
+ - Paginate large result sets
745
+ - Cache frequently accessed data
746
+
747
+ ### Frontend
748
+ - Minimize bundle size
749
+ - Lazy load when appropriate
750
+ - Optimize images and assets
751
+ - Use efficient rendering patterns
752
+
753
+ ### Backend
754
+ - Use connection pooling
755
+ - Implement appropriate caching
756
+ - Async operations where beneficial
757
+ - Monitor and alert on performance`
758
+ }
759
+ ];
760
+ var GUIDELINE_MANIFEST = {
761
+ version: 1,
762
+ guidelines: BUILTIN_GUIDELINES
763
+ };
764
+
765
+ // src/guidelines/index.ts
766
+ function getBuiltinGuidelines() {
767
+ return BUILTIN_GUIDELINES;
768
+ }
769
+ function getBuiltinGuideline(id) {
770
+ return BUILTIN_GUIDELINES.find((g) => g.id === id) || null;
771
+ }
772
+ function getGuidelinesByCategory(category) {
773
+ return BUILTIN_GUIDELINES.filter((g) => g.category === category);
774
+ }
775
+ function getGuidelineIds() {
776
+ return BUILTIN_GUIDELINES.map((g) => g.id);
777
+ }
778
+ function getGuidelineContent(id) {
779
+ const guideline = getBuiltinGuideline(id);
780
+ return guideline?.content || null;
781
+ }
782
+ function getEnabledGuidelines() {
783
+ return BUILTIN_GUIDELINES.filter((g) => g.enabled);
784
+ }
785
+ function getGuidelinesSortedByPriority() {
786
+ return [...BUILTIN_GUIDELINES].sort((a, b) => b.priority - a.priority);
787
+ }
788
+
789
+ // src/hooks/manifest.ts
790
+ var HOOK_TEMPLATES = [
791
+ {
792
+ id: "typescript-check",
793
+ name: "TypeScript Type Check",
794
+ description: "Run TypeScript type checking before commits",
795
+ category: "quality",
796
+ event: "commit:pre",
797
+ command: "npx tsc --noEmit",
798
+ timeout: 6e4,
799
+ blocking: true
800
+ },
801
+ {
802
+ id: "eslint-check",
803
+ name: "ESLint Check",
804
+ description: "Run ESLint on staged files before commits",
805
+ category: "quality",
806
+ event: "commit:pre",
807
+ command: 'files=$(git diff --cached --name-only --diff-filter=d | grep -E "\\.(js|ts|jsx|tsx)$"); [ -z "$files" ] || npx eslint --fix $files',
808
+ timeout: 6e4,
809
+ blocking: true
810
+ },
811
+ {
812
+ id: "prettier-format",
813
+ name: "Prettier Format",
814
+ description: "Format staged files with Prettier before commits",
815
+ category: "quality",
816
+ event: "commit:pre",
817
+ command: "npx prettier --write $(git diff --cached --name-only --diff-filter=d)",
818
+ timeout: 3e4,
819
+ blocking: false
820
+ },
821
+ {
822
+ id: "test-on-save",
823
+ name: "Run Tests on Save",
824
+ description: "Run related tests when test files are saved",
825
+ category: "quality",
826
+ event: "file:save",
827
+ matcher: "**/*.test.{ts,tsx,js,jsx}",
828
+ command: "npx vitest run {{file}}",
829
+ timeout: 12e4,
830
+ blocking: false
831
+ },
832
+ {
833
+ id: "security-scan",
834
+ name: "Security Scan",
835
+ description: "Scan for security vulnerabilities before commits",
836
+ category: "security",
837
+ event: "commit:pre",
838
+ command: "npm audit --audit-level=high",
839
+ timeout: 6e4,
840
+ blocking: true
841
+ },
842
+ {
843
+ id: "secret-detection",
844
+ name: "Secret Detection",
845
+ description: "Detect secrets in staged files before commits",
846
+ category: "security",
847
+ event: "commit:pre",
848
+ command: 'files=$(git diff --cached --name-only --diff-filter=d); [ -z "$files" ] || npx secretlint $files',
849
+ timeout: 3e4,
850
+ blocking: true
851
+ },
852
+ {
853
+ id: "build-check",
854
+ name: "Build Check",
855
+ description: "Verify build succeeds before commits",
856
+ category: "quality",
857
+ event: "commit:pre",
858
+ command: "npm run build",
859
+ timeout: 3e5,
860
+ blocking: true
861
+ },
862
+ {
863
+ id: "session-summary",
864
+ name: "Session Summary",
865
+ description: "Generate session summary on session end",
866
+ category: "productivity",
867
+ event: "session:end",
868
+ command: 'echo "Session ended at $(date)" >> ~/.skillkit/sessions/$(date +%Y-%m-%d).log',
869
+ timeout: 5e3,
870
+ blocking: false
871
+ },
872
+ {
873
+ id: "auto-commit-message",
874
+ name: "Auto Commit Message",
875
+ description: "Generate conventional commit message",
876
+ category: "workflow",
877
+ event: "commit:pre",
878
+ command: "git diff --cached --stat",
879
+ timeout: 5e3,
880
+ blocking: false
881
+ },
882
+ {
883
+ id: "notify-build-fail",
884
+ name: "Build Failure Notification",
885
+ description: "Notify on build failure",
886
+ category: "workflow",
887
+ event: "build:fail",
888
+ command: 'echo "Build failed at $(date)" | tee -a ~/.skillkit/build.log',
889
+ timeout: 5e3,
890
+ blocking: false
891
+ },
892
+ {
893
+ id: "test-coverage-check",
894
+ name: "Test Coverage Check",
895
+ description: "Verify test coverage meets threshold before commits",
896
+ category: "quality",
897
+ event: "commit:pre",
898
+ command: `npm test -- --coverage --coverageThreshold='{"global":{"statements":80}}'`,
899
+ timeout: 18e4,
900
+ blocking: true
901
+ },
902
+ {
903
+ id: "dependency-check",
904
+ name: "Dependency Check",
905
+ description: "Check for outdated dependencies on session start",
906
+ category: "productivity",
907
+ event: "session:start",
908
+ command: "npm outdated || true",
909
+ timeout: 3e4,
910
+ blocking: false
911
+ }
912
+ ];
913
+ var HOOK_TEMPLATE_MANIFEST = {
914
+ version: 1,
915
+ templates: HOOK_TEMPLATES
916
+ };
917
+
918
+ // src/hooks/index.ts
919
+ function getHookTemplates() {
920
+ return HOOK_TEMPLATES;
921
+ }
922
+ function getHookTemplate(id) {
923
+ return HOOK_TEMPLATES.find((t) => t.id === id) || null;
924
+ }
925
+ function getHookTemplatesByCategory(category) {
926
+ return HOOK_TEMPLATES.filter((t) => t.category === category);
927
+ }
928
+ function getHookTemplatesByEvent(event) {
929
+ return HOOK_TEMPLATES.filter((t) => t.event === event);
930
+ }
931
+ function getHookTemplateIds() {
932
+ return HOOK_TEMPLATES.map((t) => t.id);
933
+ }
934
+ function formatHookCommand(template, variables) {
935
+ let command = template.command;
936
+ const vars = { ...template.variables, ...variables };
937
+ for (const [key, value] of Object.entries(vars)) {
938
+ command = command.replace(new RegExp(`\\{\\{${key}\\}\\}`, "g"), value);
939
+ }
940
+ return command;
941
+ }
942
+
943
+ // src/index.ts
944
+ var RESOURCES_VERSION = "2.0.0";
945
+ export {
946
+ AGENT_MANIFEST,
947
+ BUILTIN_GUIDELINES,
948
+ BUILTIN_PROFILES,
949
+ BUNDLED_AGENTS,
950
+ COMMAND_MANIFEST,
951
+ COMMAND_TEMPLATES,
952
+ GUIDELINE_MANIFEST,
953
+ HOOK_TEMPLATES,
954
+ HOOK_TEMPLATE_MANIFEST,
955
+ PROFILE_MANIFEST,
956
+ RESOURCES_VERSION,
957
+ formatHookCommand,
958
+ getAgentTemplate,
959
+ getAvailableAgents,
960
+ getBuiltinGuideline,
961
+ getBuiltinGuidelines,
962
+ getBuiltinProfile,
963
+ getBuiltinProfiles,
964
+ getBundledAgent,
965
+ getBundledAgentIds,
966
+ getBundledAgents,
967
+ getBundledAgentsByCategory,
968
+ getCommandByTrigger,
969
+ getCommandTemplate,
970
+ getCommandTemplateIds,
971
+ getCommandTemplates,
972
+ getCommandTemplatesByCategory,
973
+ getCommandTriggers,
974
+ getEnabledGuidelines,
975
+ getGuidelineContent,
976
+ getGuidelineIds,
977
+ getGuidelinesByCategory,
978
+ getGuidelinesSortedByPriority,
979
+ getHookTemplate,
980
+ getHookTemplateIds,
981
+ getHookTemplates,
982
+ getHookTemplatesByCategory,
983
+ getHookTemplatesByEvent,
984
+ getInstalledAgentIds,
985
+ getProfileContext,
986
+ getProfileNames,
987
+ installBundledAgent,
988
+ isAgentInstalled,
989
+ isValidProfileName
990
+ };
991
+ //# sourceMappingURL=index.js.map