sqlew 5.0.6 → 5.0.8

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 (54) hide show
  1. package/README.md +100 -242
  2. package/dist/cli/hooks/on-prompt.d.ts +22 -4
  3. package/dist/cli/hooks/on-prompt.d.ts.map +1 -1
  4. package/dist/cli/hooks/on-prompt.js +63 -14
  5. package/dist/cli/hooks/on-prompt.js.map +1 -1
  6. package/dist/cli/hooks/pr-adr.d.ts +22 -0
  7. package/dist/cli/hooks/pr-adr.d.ts.map +1 -0
  8. package/dist/cli/hooks/pr-adr.js +72 -0
  9. package/dist/cli/hooks/pr-adr.js.map +1 -0
  10. package/dist/cli/hooks/stdin-parser.d.ts +11 -0
  11. package/dist/cli/hooks/stdin-parser.d.ts.map +1 -1
  12. package/dist/cli/hooks/stdin-parser.js +20 -0
  13. package/dist/cli/hooks/stdin-parser.js.map +1 -1
  14. package/dist/cli/hooks/track-plan.d.ts.map +1 -1
  15. package/dist/cli/hooks/track-plan.js +2 -1
  16. package/dist/cli/hooks/track-plan.js.map +1 -1
  17. package/dist/cli.d.ts.map +1 -1
  18. package/dist/cli.js +8 -1
  19. package/dist/cli.js.map +1 -1
  20. package/dist/config/global-config.d.ts +2 -0
  21. package/dist/config/global-config.d.ts.map +1 -1
  22. package/dist/config/global-config.js.map +1 -1
  23. package/dist/index.js +10 -35
  24. package/dist/index.js.map +1 -1
  25. package/dist/server/tool-handlers.d.ts +3 -3
  26. package/dist/server/tool-handlers.d.ts.map +1 -1
  27. package/dist/server/tool-handlers.js +4 -4
  28. package/dist/server/tool-handlers.js.map +1 -1
  29. package/dist/server/tool-registration.d.ts +18 -0
  30. package/dist/server/tool-registration.d.ts.map +1 -0
  31. package/dist/server/tool-registration.js +42 -0
  32. package/dist/server/tool-registration.js.map +1 -0
  33. package/dist/server/tool-registry.d.ts +8 -3
  34. package/dist/server/tool-registry.d.ts.map +1 -1
  35. package/dist/server/tool-registry.js +15 -263
  36. package/dist/server/tool-registry.js.map +1 -1
  37. package/dist/server/tool-schemas.d.ts +141 -0
  38. package/dist/server/tool-schemas.d.ts.map +1 -0
  39. package/dist/server/tool-schemas.js +160 -0
  40. package/dist/server/tool-schemas.js.map +1 -0
  41. package/docs/ADR_CONCEPTS.md +66 -58
  42. package/docs/CLI_USAGE.md +472 -0
  43. package/docs/CONFIGURATION.md +152 -922
  44. package/docs/CROSS_DATABASE.md +1 -88
  45. package/docs/DATABASE_AUTH.md +24 -47
  46. package/docs/HOOKS_GUIDE.md +40 -112
  47. package/docs/MIGRATION_TO_SAAS.md +1 -1
  48. package/package.json +3 -2
  49. package/docs/HOW_TO_UNINSTALL.md +0 -199
  50. package/docs/MIGRATION_CLEANUP_GUIDE.md +0 -212
  51. package/docs/SLASH_COMMANDS.md +0 -329
  52. package/docs/cli/DATABASE_MIGRATION.md +0 -290
  53. package/docs/cli/DATA_EXPORT_IMPORT.md +0 -701
  54. package/docs/cli/README.md +0 -276
@@ -1,212 +0,0 @@
1
- # v4 to v5 Migration Cleanup Guide
2
-
3
- This guide lists the **specific files** that were auto-generated by sqlew v4 (`sqlew --init`, `sqlew --hooks`). Delete only these files - other files in the same directories may have been created by you or other tools.
4
-
5
- ## What Changed in v5
6
-
7
- | Feature | v4 (Legacy) | v5 (Plugin) |
8
- |---------|-------------|-------------|
9
- | Installation | `sqlew --init` per project | `sqlew-plugin` via Claude Plugin marketplace |
10
- | Skills/Hooks | `.claude/hooks/`, `.claude/skills/` | Managed by plugin |
11
- | Agents | `.claude/agents/` | Removed (Agent system deprecated) |
12
- | Rules | `.claude/rules/` | Global `~/.claude/rules/sqlew/` |
13
- | Commands | `.claude/commands/` | Global `~/.claude/commands/` |
14
-
15
- ---
16
-
17
- ## Files to Delete (v4 Auto-Generated)
18
-
19
- ### Agents (Added by sqlew v3.x, deprecated in v4.0.0)
20
-
21
- These agent definition files were created by early sqlew versions:
22
-
23
- | File | Description |
24
- |------|-------------|
25
- | `.claude/agents/parallel-orchestrator.md` | Parallel task orchestration agent |
26
- | `.claude/agents/sqlew-architect.md` | Architecture decision agent |
27
- | `.claude/agents/sqlew-researcher.md` | Context research agent |
28
- | `.claude/agents/sqlew-scrum-master.md` | Task management agent |
29
-
30
- ### Commands (Added by `sqlew --init`)
31
-
32
- | File | Description |
33
- |------|-------------|
34
- | `.claude/commands/sqlew.md` | `/sqlew` slash command definition |
35
-
36
- **Note**: Now managed globally at `~/.claude/commands/sqlew.md` by the plugin.
37
-
38
- ### Hooks (Added by `sqlew --hooks`)
39
-
40
- | File | Description |
41
- |------|-------------|
42
- | `.claude/hooks/check-ast-grep.mjs` | AST pattern validation hook |
43
- | `.claude/hooks/check-db-path.mjs` | Database path guardrail hook |
44
- | `.claude/hooks/check-migration.mjs` | Migration file protection hook |
45
- | `.claude/hooks/check-prod-db.mjs` | Production DB protection hook |
46
-
47
- **Note**: Now managed by sqlew-plugin.
48
-
49
- ### Rules (Added by `sqlew --init`)
50
-
51
- | File | Description |
52
- |------|-------------|
53
- | `.claude/rules/plan-mode-integration.md` | Plan mode decision format guide |
54
-
55
- **Note**: Now managed globally at `~/.claude/rules/sqlew/plan-mode-integration.md`.
56
-
57
- ### Skills (Added by `sqlew --init`)
58
-
59
- | Directory | Description |
60
- |-----------|-------------|
61
- | `.claude/skills/sqlew-plan-guidance/` | Plan mode quick reference |
62
- | `.claude/skills/sqlew-decision-format/` | Decision format guide |
63
-
64
- **Note**: Now managed globally:
65
- - `~/.claude/skills/sqlew-plan-guidance/`
66
- - `~/.claude/skills/plan-decision-format/`
67
-
68
- ---
69
-
70
- ## settings.json Modification
71
-
72
- Remove hook entries that reference the deleted `.claude/hooks/*.mjs` files.
73
-
74
- **Before (v4):**
75
- ```json
76
- {
77
- "hooks": {
78
- "PreToolUse": [
79
- {
80
- "matcher": "Edit|Write|MultiEdit",
81
- "hooks": [
82
- { "command": "node .claude/hooks/check-migration.mjs" },
83
- { "command": "node .claude/hooks/check-ast-grep.mjs" }
84
- ]
85
- },
86
- {
87
- "matcher": "Bash",
88
- "hooks": [
89
- { "command": "node .claude/hooks/check-db-path.mjs" },
90
- { "command": "node .claude/hooks/check-prod-db.mjs" }
91
- ]
92
- }
93
- ]
94
- }
95
- }
96
- ```
97
-
98
- **After (v5):**
99
- Remove the PreToolUse entries that reference `.claude/hooks/`. The plugin handles these automatically.
100
-
101
- ---
102
-
103
- ## Complete File List
104
-
105
- Copy-paste ready deletion commands for v4 auto-generated files:
106
-
107
- ```bash
108
- # Windows (PowerShell)
109
- Remove-Item .claude\agents\parallel-orchestrator.md -ErrorAction SilentlyContinue
110
- Remove-Item .claude\agents\sqlew-architect.md -ErrorAction SilentlyContinue
111
- Remove-Item .claude\agents\sqlew-researcher.md -ErrorAction SilentlyContinue
112
- Remove-Item .claude\agents\sqlew-scrum-master.md -ErrorAction SilentlyContinue
113
- Remove-Item .claude\commands\sqlew.md -ErrorAction SilentlyContinue
114
- Remove-Item .claude\hooks\check-ast-grep.mjs -ErrorAction SilentlyContinue
115
- Remove-Item .claude\hooks\check-db-path.mjs -ErrorAction SilentlyContinue
116
- Remove-Item .claude\hooks\check-migration.mjs -ErrorAction SilentlyContinue
117
- Remove-Item .claude\hooks\check-prod-db.mjs -ErrorAction SilentlyContinue
118
- Remove-Item .claude\rules\plan-mode-integration.md -ErrorAction SilentlyContinue
119
- Remove-Item -Recurse .claude\skills\sqlew-plan-guidance -ErrorAction SilentlyContinue
120
- Remove-Item -Recurse .claude\skills\sqlew-decision-format -ErrorAction SilentlyContinue
121
- ```
122
-
123
- ```bash
124
- # Unix/macOS/Linux
125
- rm -f .claude/agents/parallel-orchestrator.md
126
- rm -f .claude/agents/sqlew-architect.md
127
- rm -f .claude/agents/sqlew-researcher.md
128
- rm -f .claude/agents/sqlew-scrum-master.md
129
- rm -f .claude/commands/sqlew.md
130
- rm -f .claude/hooks/check-ast-grep.mjs
131
- rm -f .claude/hooks/check-db-path.mjs
132
- rm -f .claude/hooks/check-migration.mjs
133
- rm -f .claude/hooks/check-prod-db.mjs
134
- rm -f .claude/rules/plan-mode-integration.md
135
- rm -rf .claude/skills/sqlew-plan-guidance
136
- rm -rf .claude/skills/sqlew-decision-format
137
- ```
138
-
139
- ---
140
-
141
- ## Verification
142
-
143
- After cleanup, verify your setup:
144
-
145
- 1. **Check plugin is installed:**
146
- ```bash
147
- # In Claude Code
148
- /plugin list
149
- # Should show: sqlew-plugin@sqlew-plugin
150
- ```
151
-
152
- 2. **Check global rules exist:**
153
- ```bash
154
- # Windows
155
- dir %USERPROFILE%\.claude\rules\sqlew\
156
-
157
- # Unix/macOS
158
- ls ~/.claude/rules/sqlew/
159
- ```
160
-
161
- 3. **Test /sqlew command:**
162
- ```bash
163
- # In Claude Code
164
- /sqlew
165
- # Should show status without errors
166
- ```
167
-
168
- 4. **Verify no duplicate hooks:**
169
- - Open `.claude/settings.json`
170
- - Ensure no references to `.claude/hooks/*.mjs`
171
-
172
- ---
173
-
174
- ## Troubleshooting
175
-
176
- ### Error: "Cannot find module '.claude/hooks/check-*.mjs'"
177
-
178
- **Cause**: `settings.json` still references deleted hook files.
179
-
180
- **Solution**: Remove the PreToolUse hooks section from `.claude/settings.json`.
181
-
182
- ### /sqlew command not found
183
-
184
- **Cause**: Plugin not installed or global command not registered.
185
-
186
- **Solution**:
187
- ```bash
188
- /plugin install sqlew-plugin
189
- # Restart Claude Code
190
- ```
191
-
192
- ### Decisions not being captured automatically
193
-
194
- **Cause**: Plugin hooks not active.
195
-
196
- **Solution**:
197
- 1. Ensure plugin is installed at user level (not project level)
198
- 2. Restart Claude Code
199
- 3. Check `~/.claude/settings.json` for `enabledPlugins`
200
-
201
- ---
202
-
203
- ## Summary
204
-
205
- | Category | Files to Delete |
206
- |----------|-----------------|
207
- | **Agents** | `parallel-orchestrator.md`, `sqlew-architect.md`, `sqlew-researcher.md`, `sqlew-scrum-master.md` |
208
- | **Commands** | `sqlew.md` |
209
- | **Hooks** | `check-ast-grep.mjs`, `check-db-path.mjs`, `check-migration.mjs`, `check-prod-db.mjs` |
210
- | **Rules** | `plan-mode-integration.md` |
211
- | **Skills** | `sqlew-plan-guidance/`, `sqlew-decision-format/` |
212
- | **settings.json** | Remove PreToolUse entries referencing `.claude/hooks/` |
@@ -1,329 +0,0 @@
1
- # Unified /sqlew Command Guide
2
-
3
- **🎯 Recommended Interface**
4
-
5
- The `/sqlew` command is the PRIMARY way to interact with sqlew. It provides a natural language interface with automatic intent detection that is easier than raw MCP tool calls.
6
-
7
- ## Why Use /sqlew?
8
-
9
- ✅ **Natural language input** - Describe what you want, it figures out the intent
10
- ✅ **Single command** - `/sqlew` handles all operations (search, record, list, execute, plan)
11
- ✅ **Automatic intent detection** - Recognizes search, record, update, execute, task creation
12
- ✅ **Error handling** - Built-in validation and helpful error messages
13
- ✅ **No MCP knowledge needed** - Just describe what you want in plain English
14
-
15
- ## Quick Start
16
-
17
- ```bash
18
- # Show current status and suggested next actions
19
- /sqlew
20
-
21
- # Search for decisions
22
- /sqlew search why we chose Knex for migrations
23
-
24
- # Record a decision
25
- /sqlew record we use PostgreSQL 15 for production database
26
-
27
- # List remaining tasks
28
- /sqlew show remaining tasks
29
-
30
- # Create tasks from a plan
31
- /sqlew plan implementing user authentication
32
- ```
33
-
34
- ---
35
-
36
- ## Intent Detection System
37
-
38
- The `/sqlew` command analyzes your input and executes in this priority order:
39
-
40
- ### 1. List/Status Intent (Highest Priority)
41
-
42
- **Keywords**: list, show, status, remaining, current, pending, what, overview, existing, left, 確認, 見せて, 表示, 一覧
43
-
44
- **Use when you want to**:
45
- - See all decisions
46
- - Check remaining tasks
47
- - Get current status
48
- - View what exists in the database
49
-
50
- **Examples**:
51
- ```bash
52
- /sqlew
53
- /sqlew show remaining tasks
54
- /sqlew what decisions do we have
55
- /sqlew list all constraints
56
- ```
57
-
58
- **Actions executed**:
59
- - Lists recent decisions
60
- - Shows task status summary
61
- - Provides suggestions for next steps
62
-
63
- ---
64
-
65
- ### 2. Search Intent
66
-
67
- **Keywords**: search, find, look for, about, related, explore, 検索, 探して, 調べて
68
-
69
- **Use when you want to**:
70
- - Find related decisions
71
- - Search for past context
72
- - Understand why something was decided
73
- - Explore related patterns
74
-
75
- **Examples**:
76
- ```bash
77
- /sqlew search why we chose PostgreSQL
78
- /sqlew find authentication decisions
79
- /sqlew look for API design decisions
80
- ```
81
-
82
- **Actions executed**:
83
- - Queries decision tags and keys
84
- - Shows related context
85
- - Displays decision rationale
86
-
87
- ---
88
-
89
- ### 3. Record Intent
90
-
91
- **Keywords**: record, add, save, register, decide, decided, decision, 記録, 登録, 保存
92
-
93
- **Use when you want to**:
94
- - Capture a new decision
95
- - Record meeting minutes
96
- - Document a choice made during development
97
- - Add a new constraint
98
-
99
- **Examples**:
100
- ```bash
101
- /sqlew record we decided to use JWT for authentication
102
- /sqlew add PostgreSQL 15 as our production database
103
- /sqlew save that we use async/await pattern
104
- ```
105
-
106
- **Actions executed**:
107
- - Checks for duplicates
108
- - Records decision with context
109
- - Suggests related decisions
110
-
111
- ---
112
-
113
- ### 4. Update Intent
114
-
115
- **Keywords**: update, change, modify, revise, 更新, 変更, 修正
116
-
117
- **Use when you want to**:
118
- - Modify an existing decision
119
- - Change a constraint
120
- - Revise previous context
121
-
122
- **Examples**:
123
- ```bash
124
- /sqlew update authentication to use OAuth2 instead
125
- /sqlew modify database choice to PostgreSQL 14
126
- /sqlew revise API response format
127
- ```
128
-
129
- **Actions executed**:
130
- - Retrieves existing decision
131
- - Updates with new information
132
- - Shows before/after changes
133
-
134
- ---
135
-
136
- ### 5. Execute Intent
137
-
138
- **Keywords**: execute, run, do, proceed, continue, finish, 実行, 進めて, 続けて, やって
139
-
140
- **Use when you want to**:
141
- - Start implementing pending tasks
142
- - Continue work from previous session
143
- - Execute next steps
144
-
145
- **Examples**:
146
- ```bash
147
- /sqlew execute
148
- /sqlew run pending tasks
149
- /sqlew proceed with implementation
150
- /sqlew continue from where we left off
151
- ```
152
-
153
- **Actions executed**:
154
- - Lists pending tasks
155
- - Coordinates implementation
156
- - Updates task status
157
-
158
- ---
159
-
160
- ### 6. Task Creation Intent (Lowest Priority - Explicit Only)
161
-
162
- **Keywords**: create task, make task, breakdown, plan tasks, generate tasks, タスク作成, タスクを作って, 洗い出し
163
-
164
- **IMPORTANT**: Only triggers for EXPLICIT creation verbs. Does NOT trigger for:
165
- - "remaining tasks" → List/Status intent instead
166
- - "task list" → List/Status intent instead
167
- - "show tasks" → List/Status intent instead
168
-
169
- **Use when you want to**:
170
- - Break down a feature into tasks
171
- - Create an implementation plan
172
- - Generate task breakdown
173
-
174
- **Examples**:
175
- ```bash
176
- /sqlew create tasks for user authentication feature
177
- /sqlew breakdown OAuth2 implementation into tasks
178
- /sqlew plan implementing password reset feature
179
- ```
180
-
181
- **Actions executed**:
182
- - Parses input into tasks
183
- - Creates task records with dependencies
184
- - Provides task summary
185
-
186
- ---
187
-
188
- ## Common Use Cases
189
-
190
- ### Planning a Feature
191
-
192
- ```bash
193
- # Step 1: Get current status
194
- /sqlew
195
-
196
- # Step 2: Record architectural decision
197
- /sqlew record we will use JWT for authentication with 24h expiry
198
-
199
- # Step 3: Create implementation tasks
200
- /sqlew plan implementing JWT authentication
201
- ```
202
-
203
- ### Onboarding to a Project
204
-
205
- ```bash
206
- # Get overview
207
- /sqlew
208
-
209
- # Explore decisions
210
- /sqlew search authentication decisions
211
- /sqlew search database architecture
212
-
213
- # Check current work
214
- /sqlew show remaining tasks
215
- ```
216
-
217
- ### During Implementation
218
-
219
- ```bash
220
- # Record decisions made
221
- /sqlew record we added Redis cache for performance
222
-
223
- # Check related past decisions
224
- /sqlew search caching decisions
225
-
226
- # Update status
227
- /sqlew continue with next task
228
- ```
229
-
230
- ---
231
-
232
- ## Advanced: Direct MCP Tool Access
233
-
234
- **Note**: For most use cases, the `/sqlew` command is sufficient and preferred.
235
-
236
- Power users can still call MCP tools directly via the tool interface:
237
-
238
- ```
239
- mcp__sqlew__decision action="list"
240
- mcp__sqlew__task action="list"
241
- mcp__sqlew__decision action="search_tags" tags=["authentication"]
242
- ```
243
-
244
-
245
- ---
246
-
247
- ## Configuration
248
-
249
- The `/sqlew` command is configured in `.sqlew/config.toml`:
250
-
251
- ```toml
252
- [sqlew]
253
- # Default enabled - no configuration needed
254
- ```
255
-
256
- ---
257
-
258
- ## Troubleshooting
259
-
260
- ### Command not recognized
261
-
262
- **Symptom**: `/sqlew` appears as unrecognized command
263
-
264
- **Solution**:
265
- 1. Restart Claude Code after installation
266
- 2. Verify `.claude/commands/sqlew.md` exists
267
- 3. Check MCP server is running (check console for errors)
268
-
269
- ### Wrong intent detected
270
-
271
- **Symptom**: Command executes wrong action
272
-
273
- **Solution**:
274
- - Use more explicit keywords
275
- - Example: Instead of `/sqlew tasks`, use `/sqlew show remaining tasks`
276
-
277
- ### Need more details
278
-
279
- **Symptom**: Result seems incomplete
280
-
281
- **Solution**:
282
- - Try searching directly: `/sqlew search <topic>`
283
- - Or list all: `/sqlew show what we have`
284
-
285
- ---
286
-
287
- ## Performance Considerations
288
-
289
- ### Token Usage
290
-
291
- The `/sqlew` command is designed for token efficiency:
292
- - **List/Status**: ~2-5KB (minimal queries)
293
- - **Search**: ~3-8KB (depending on results)
294
- - **Record**: ~2-6KB (single write operation)
295
- - **Execute**: ~5-15KB (task coordination)
296
-
297
- ---
298
-
299
- ## Related Documentation
300
-
301
-
302
- ---
303
-
304
- ## Version History
305
-
306
- ### v4.1.0 (Current)
307
-
308
- - **Major Change**: Unified `/sqlew` command replaces multiple slash commands
309
- - **New**: Automatic intent detection (6 intent types)
310
- - **New**: Natural language interface
311
- - **Removed**: Legacy slash commands (`/sqw-plan`, `/sqw-scrum`, `/sqw-secretary`, etc.)
312
- - **Removed**: Custom agent definitions (replaced with unified command)
313
-
314
- ### v4.0.0
315
-
316
- - Slash commands released (`/sqw-plan`, `/sqw-secretary`, `/sqw-scrum`, etc.)
317
- - Agent system refactored (agents completely removed from database in v4.0)
318
-
319
- ---
320
-
321
- ## See Also
322
-
323
-
324
- ---
325
-
326
- ## Contributing
327
-
328
- Found a bug or have a suggestion? Please report at:
329
- https://github.com/sqlew-io/sqlew/issues