solvdex 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 (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +274 -0
  3. package/dist/hooks/error-lookup.d.ts +4 -0
  4. package/dist/hooks/error-lookup.d.ts.map +1 -0
  5. package/dist/hooks/error-lookup.js +92 -0
  6. package/dist/hooks/error-lookup.js.map +1 -0
  7. package/dist/hooks/post-task.d.ts +15 -0
  8. package/dist/hooks/post-task.d.ts.map +1 -0
  9. package/dist/hooks/post-task.js +246 -0
  10. package/dist/hooks/post-task.js.map +1 -0
  11. package/dist/hooks/prompt-enrich.d.ts +16 -0
  12. package/dist/hooks/prompt-enrich.d.ts.map +1 -0
  13. package/dist/hooks/prompt-enrich.js +141 -0
  14. package/dist/hooks/prompt-enrich.js.map +1 -0
  15. package/dist/hooks/session-start-cli.d.ts +3 -0
  16. package/dist/hooks/session-start-cli.d.ts.map +1 -0
  17. package/dist/hooks/session-start-cli.js +81 -0
  18. package/dist/hooks/session-start-cli.js.map +1 -0
  19. package/dist/hooks/session-start.d.ts +4 -0
  20. package/dist/hooks/session-start.d.ts.map +1 -0
  21. package/dist/hooks/session-start.js +134 -0
  22. package/dist/hooks/session-start.js.map +1 -0
  23. package/dist/src/audit.d.ts +63 -0
  24. package/dist/src/audit.d.ts.map +1 -0
  25. package/dist/src/audit.js +229 -0
  26. package/dist/src/audit.js.map +1 -0
  27. package/dist/src/cache.d.ts +54 -0
  28. package/dist/src/cache.d.ts.map +1 -0
  29. package/dist/src/cache.js +167 -0
  30. package/dist/src/cache.js.map +1 -0
  31. package/dist/src/config.d.ts +52 -0
  32. package/dist/src/config.d.ts.map +1 -0
  33. package/dist/src/config.js +175 -0
  34. package/dist/src/config.js.map +1 -0
  35. package/dist/src/entry.d.ts +154 -0
  36. package/dist/src/entry.d.ts.map +1 -0
  37. package/dist/src/entry.js +469 -0
  38. package/dist/src/entry.js.map +1 -0
  39. package/dist/src/errors.d.ts +65 -0
  40. package/dist/src/errors.d.ts.map +1 -0
  41. package/dist/src/errors.js +121 -0
  42. package/dist/src/errors.js.map +1 -0
  43. package/dist/src/frontmatter.d.ts +28 -0
  44. package/dist/src/frontmatter.d.ts.map +1 -0
  45. package/dist/src/frontmatter.js +111 -0
  46. package/dist/src/frontmatter.js.map +1 -0
  47. package/dist/src/index.d.ts +35 -0
  48. package/dist/src/index.d.ts.map +1 -0
  49. package/dist/src/index.js +188 -0
  50. package/dist/src/index.js.map +1 -0
  51. package/dist/src/maturity.d.ts +31 -0
  52. package/dist/src/maturity.d.ts.map +1 -0
  53. package/dist/src/maturity.js +96 -0
  54. package/dist/src/maturity.js.map +1 -0
  55. package/dist/src/quality.d.ts +23 -0
  56. package/dist/src/quality.d.ts.map +1 -0
  57. package/dist/src/quality.js +236 -0
  58. package/dist/src/quality.js.map +1 -0
  59. package/dist/src/search.d.ts +35 -0
  60. package/dist/src/search.d.ts.map +1 -0
  61. package/dist/src/search.js +263 -0
  62. package/dist/src/search.js.map +1 -0
  63. package/dist/src/similarity.d.ts +42 -0
  64. package/dist/src/similarity.d.ts.map +1 -0
  65. package/dist/src/similarity.js +111 -0
  66. package/dist/src/similarity.js.map +1 -0
  67. package/dist/src/stats.d.ts +56 -0
  68. package/dist/src/stats.d.ts.map +1 -0
  69. package/dist/src/stats.js +198 -0
  70. package/dist/src/stats.js.map +1 -0
  71. package/dist/src/templates.d.ts +63 -0
  72. package/dist/src/templates.d.ts.map +1 -0
  73. package/dist/src/templates.js +347 -0
  74. package/dist/src/templates.js.map +1 -0
  75. package/dist/src/transfer.d.ts +92 -0
  76. package/dist/src/transfer.d.ts.map +1 -0
  77. package/dist/src/transfer.js +215 -0
  78. package/dist/src/transfer.js.map +1 -0
  79. package/dist/src/types.d.ts +270 -0
  80. package/dist/src/types.d.ts.map +1 -0
  81. package/dist/src/types.js +153 -0
  82. package/dist/src/types.js.map +1 -0
  83. package/dist/src/validate.d.ts +90 -0
  84. package/dist/src/validate.d.ts.map +1 -0
  85. package/dist/src/validate.js +295 -0
  86. package/dist/src/validate.js.map +1 -0
  87. package/hooks/error-lookup.ts +110 -0
  88. package/hooks/hooks.json +49 -0
  89. package/hooks/post-task.ts +309 -0
  90. package/hooks/prompt-enrich.ts +162 -0
  91. package/hooks/session-start-cli.ts +96 -0
  92. package/hooks/session-start.ts +159 -0
  93. package/package.json +40 -0
  94. package/scripts/error-lookup.py +64 -0
  95. package/scripts/post-task.py +60 -0
  96. package/scripts/prompt-enrich.py +64 -0
  97. package/scripts/session-start.py +64 -0
  98. package/skills/wiki/SKILL.md +61 -0
  99. package/skills/wiki-add/SKILL.md +90 -0
  100. package/skills/wiki-browse/SKILL.md +108 -0
  101. package/skills/wiki-capture/SKILL.md +265 -0
  102. package/skills/wiki-explorer/SKILL.md +223 -0
  103. package/skills/wiki-export/SKILL.md +101 -0
  104. package/skills/wiki-fix/SKILL.md +86 -0
  105. package/skills/wiki-flag/SKILL.md +47 -0
  106. package/skills/wiki-import/SKILL.md +128 -0
  107. package/skills/wiki-init/SKILL.md +72 -0
  108. package/skills/wiki-scan/SKILL.md +98 -0
  109. package/skills/wiki-search/SKILL.md +86 -0
  110. package/skills/wiki-stats/SKILL.md +129 -0
  111. package/skills/wiki-status/SKILL.md +78 -0
  112. package/skills/wiki-test-trigger/SKILL.md +173 -0
  113. package/skills/wiki-validate/SKILL.md +62 -0
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: wiki-status
3
+ description: Show Solvdex wiki health statistics. Quick overview of entries by category and health issues.
4
+ user-invocable: true
5
+ disable-model-invocation: false
6
+ ---
7
+
8
+ # Solvdex Status
9
+
10
+ Display wiki health and statistics.
11
+
12
+ ## Implementation
13
+
14
+ ```typescript
15
+ import { wikiExists, listEntries, validateWiki, DEFAULT_CATEGORIES } from 'solvdex';
16
+
17
+ const projectRoot = process.cwd();
18
+
19
+ if (!wikiExists(projectRoot)) {
20
+ console.log('No wiki found. Run `/wiki init` first.');
21
+ return;
22
+ }
23
+
24
+ const entries = listEntries(projectRoot);
25
+ const report = validateWiki(projectRoot);
26
+
27
+ // Get project name from package.json or directory
28
+ const projectName = getProjectName(projectRoot);
29
+
30
+ console.log(`# Wiki Status: ${projectName}`);
31
+ console.log('');
32
+ console.log('## Entries');
33
+ console.log(` Total: ${report.total}`);
34
+ console.log(` Active: ${report.active}`);
35
+ console.log(` Flagged: ${report.flagged}`);
36
+ console.log(` Deprecated: ${report.deprecated}`);
37
+ console.log(` Stubs: ${report.stubs}`);
38
+ console.log('');
39
+ console.log('## By Category');
40
+ for (const category of DEFAULT_CATEGORIES) {
41
+ const count = entries.filter(e => e.category === category).length;
42
+ console.log(` ${category}: ${count}`);
43
+ }
44
+ console.log('');
45
+ console.log('## Health');
46
+ if (report.issues.length === 0) {
47
+ console.log(' All entries healthy');
48
+ } else {
49
+ console.log(` ${report.issues.length} issues found`);
50
+ console.log(' Run `/wiki validate` for details');
51
+ }
52
+ ```
53
+
54
+ ## Output
55
+
56
+ ```
57
+ # Solvdex Status: my-project
58
+
59
+ ## Entries
60
+ Total: 18
61
+ Active: 15
62
+ Flagged: 2
63
+ Deprecated: 1
64
+ Stubs: 4
65
+
66
+ ## By Category
67
+ issues: 6
68
+ patterns: 4
69
+ gotchas: 2
70
+ testing: 2
71
+ docs: 1
72
+ security: 2
73
+ performance: 1
74
+
75
+ ## Health
76
+ 2 issues found
77
+ Run `/wiki validate` for details
78
+ ```
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: wiki-test-trigger
3
+ description: Test trigger patterns against sample text to verify error matching.
4
+ argument-hint: <pattern> <test-text> | --all <test-text>
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Solvdex Test Trigger
10
+
11
+ Test regex trigger patterns to verify they match expected error messages.
12
+
13
+ ## Arguments
14
+
15
+ - `pattern`: The regex pattern to test (without delimiters)
16
+ - `test-text`: The sample text to test against
17
+ - `--all`: Test against all wiki triggers
18
+
19
+ ## Implementation
20
+
21
+ ```typescript
22
+ import { wikiExists, searchWiki, matchTrigger, listEntries } from 'solvdex';
23
+
24
+ const projectRoot = process.cwd();
25
+ const args = $ARGUMENTS.split(' ').filter(Boolean);
26
+
27
+ // Parse args - support quoted strings
28
+ const pattern = args[0];
29
+ const testText = args.slice(1).join(' ');
30
+
31
+ if (!pattern) {
32
+ console.log('Usage: /wiki test-trigger <pattern> <test-text>');
33
+ console.log('');
34
+ console.log('Examples:');
35
+ console.log(' /wiki test-trigger "ETIMEDOUT.*postgres" "Error: ETIMEDOUT connecting to postgres"');
36
+ console.log(' /wiki test-trigger "cannot find module" "Error: Cannot find module \'./config\'"');
37
+ console.log('');
38
+ console.log('Or test against all wiki triggers:');
39
+ console.log(' /wiki test-trigger --all "your error message here"');
40
+ return;
41
+ }
42
+
43
+ console.log('# Trigger Pattern Test\n');
44
+
45
+ // Test against all wiki triggers
46
+ if (pattern === '--all') {
47
+ if (!testText && !args[1]) {
48
+ console.log('Provide text to test: /wiki test-trigger --all "error message"');
49
+ return;
50
+ }
51
+
52
+ const searchText = args.slice(1).join(' ');
53
+ console.log(`Testing: "${searchText}"\n`);
54
+
55
+ if (!wikiExists(projectRoot)) {
56
+ console.log('No wiki found. Run `/wiki init` first.');
57
+ return;
58
+ }
59
+
60
+ const entries = await listEntries(projectRoot);
61
+ const entriesWithTriggers = entries.filter(e => e.frontmatter.trigger);
62
+
63
+ console.log(`## Checking ${entriesWithTriggers.length} triggers...\n`);
64
+
65
+ let matchCount = 0;
66
+ for (const entry of entriesWithTriggers) {
67
+ const trigger = entry.frontmatter.trigger;
68
+ try {
69
+ const regex = new RegExp(trigger, 'i');
70
+ if (regex.test(searchText)) {
71
+ matchCount++;
72
+ console.log(`### MATCH: ${entry.frontmatter.title}`);
73
+ console.log(` Pattern: ${trigger}`);
74
+ console.log(` Path: ${entry.path}`);
75
+ console.log(` Confidence: ${entry.frontmatter.confidence}`);
76
+ console.log('');
77
+ }
78
+ } catch (e) {
79
+ console.log(` Warning: Invalid regex in ${entry.path}: ${trigger}`);
80
+ }
81
+ }
82
+
83
+ if (matchCount === 0) {
84
+ console.log('No triggers matched the input text.');
85
+ } else {
86
+ console.log(`---\nTotal matches: ${matchCount}`);
87
+ }
88
+ return;
89
+ }
90
+
91
+ // Test single pattern
92
+ console.log(`Pattern: ${pattern}`);
93
+ console.log(`Test text: ${testText || '(empty)'}`);
94
+ console.log('');
95
+
96
+ try {
97
+ const regex = new RegExp(pattern, 'i');
98
+ const matches = testText ? regex.test(testText) : false;
99
+
100
+ console.log('## Results');
101
+ console.log(` Valid regex: Yes`);
102
+ console.log(` Matches: ${matches ? 'Yes' : 'No'}`);
103
+
104
+ if (matches && testText) {
105
+ const match = testText.match(regex);
106
+ console.log(` Matched text: "${match[0]}"`);
107
+ if (match.length > 1) {
108
+ console.log(' Capture groups:');
109
+ for (let i = 1; i < match.length; i++) {
110
+ console.log(` $${i}: "${match[i]}"`);
111
+ }
112
+ }
113
+ }
114
+
115
+ // Suggest improvements
116
+ console.log('\n## Tips');
117
+ if (!pattern.includes('.*')) {
118
+ console.log(' - Use .* for flexible matching between words');
119
+ }
120
+ if (pattern === pattern.toLowerCase() && !pattern.includes('(?i)')) {
121
+ console.log(' - Pattern is case-insensitive by default (flag: i)');
122
+ }
123
+ } catch (error) {
124
+ console.log('## Results');
125
+ console.log(` Valid regex: No`);
126
+ console.log(` Error: ${error.message}`);
127
+ console.log('');
128
+ console.log('## Common fixes');
129
+ console.log(' - Escape special chars: . \\ ^ $ * + ? { } [ ] ( ) |');
130
+ console.log(' - Use \\. to match literal dots');
131
+ console.log(' - Use \\( and \\) for literal parentheses');
132
+ }
133
+ ```
134
+
135
+ ## Output - Single Pattern
136
+
137
+ ```
138
+ # Trigger Pattern Test
139
+
140
+ Pattern: ETIMEDOUT.*postgres
141
+ Test text: Error: ETIMEDOUT connecting to postgres at 10.0.0.1
142
+
143
+ ## Results
144
+ Valid regex: Yes
145
+ Matches: Yes
146
+ Matched text: "ETIMEDOUT connecting to postgres"
147
+
148
+ ## Tips
149
+ - Pattern is case-insensitive by default (flag: i)
150
+ ```
151
+
152
+ ## Output - Test All Triggers
153
+
154
+ ```
155
+ # Trigger Pattern Test
156
+
157
+ Testing: "Error: ETIMEDOUT connecting to postgres"
158
+
159
+ ## Checking 8 triggers...
160
+
161
+ ### MATCH: Database Connection Timeout
162
+ Pattern: ETIMEDOUT.*postgres
163
+ Path: issues/database-timeout.md
164
+ Confidence: 80
165
+
166
+ ### MATCH: Connection Pool Exhausted
167
+ Pattern: (ETIMEDOUT|ECONNREFUSED).*database
168
+ Path: issues/connection-pool.md
169
+ Confidence: 70
170
+
171
+ ---
172
+ Total matches: 2
173
+ ```
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: wiki-validate
3
+ description: Check Solvdex wiki for issues like broken references, stale content, and low confidence entries.
4
+ user-invocable: true
5
+ disable-model-invocation: false
6
+ ---
7
+
8
+ # Validate Solvdex Wiki
9
+
10
+ Check all entries for issues like broken references and stale content.
11
+
12
+ ## Implementation
13
+
14
+ ```typescript
15
+ import { validateWiki, wikiExists } from 'solvdex';
16
+
17
+ const projectRoot = process.cwd();
18
+
19
+ if (!wikiExists(projectRoot)) {
20
+ console.log('No wiki found. Run `/wiki init` first.');
21
+ return;
22
+ }
23
+
24
+ const report = validateWiki(projectRoot);
25
+
26
+ console.log('# Solvdex Validation Report');
27
+ console.log('');
28
+ console.log(`Total entries: ${report.total}`);
29
+ console.log(`Active: ${report.active} | Flagged: ${report.flagged} | Deprecated: ${report.deprecated}`);
30
+ console.log('');
31
+
32
+ if (report.issues.length === 0) {
33
+ console.log('No issues found. All entries healthy.');
34
+ } else {
35
+ console.log(`Found ${report.issues.length} issues:\n`);
36
+ for (const issue of report.issues) {
37
+ console.log(`[${issue.type}] ${issue.entryPath}`);
38
+ console.log(` ${issue.message}`);
39
+ }
40
+ console.log('');
41
+ console.log('Use `/wiki fix <entry>` to address flagged entries.');
42
+ }
43
+ ```
44
+
45
+ ## Output
46
+
47
+ ```
48
+ # Solvdex Validation Report
49
+
50
+ Total entries: 12
51
+ Active: 10 | Flagged: 1 | Deprecated: 1
52
+
53
+ Found 2 issues:
54
+
55
+ [stub] issues/auth-timeout.md
56
+ Entry is a stub - needs content
57
+
58
+ [low_confidence] patterns/api-retry.md
59
+ Confidence is 20 - needs verification
60
+
61
+ Use `/wiki fix <entry>` to address flagged entries.
62
+ ```