sqlew 4.3.0 → 4.3.1

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 (47) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +268 -269
  3. package/assets/claude-md-snippets/plan-mode-integration.md +50 -48
  4. package/assets/config.example.toml +120 -282
  5. package/dist/cli.js +54 -54
  6. package/dist/cli.js.map +1 -1
  7. package/dist/init-skills.d.ts +8 -4
  8. package/dist/init-skills.d.ts.map +1 -1
  9. package/dist/init-skills.js +50 -27
  10. package/dist/init-skills.js.map +1 -1
  11. package/dist/tools/context/actions/has-updates.d.ts.map +1 -1
  12. package/dist/tools/context/actions/has-updates.js +0 -4
  13. package/dist/tools/context/actions/has-updates.js.map +1 -1
  14. package/dist/tools/files/help/example.d.ts.map +1 -1
  15. package/dist/tools/files/help/example.js +11 -0
  16. package/dist/tools/files/help/example.js.map +1 -1
  17. package/dist/tools/files/help/help.d.ts.map +1 -1
  18. package/dist/tools/files/help/help.js +11 -0
  19. package/dist/tools/files/help/help.js.map +1 -1
  20. package/dist/tools/suggest/actions/by-context.d.ts.map +1 -1
  21. package/dist/tools/suggest/actions/by-context.js +5 -15
  22. package/dist/tools/suggest/actions/by-context.js.map +1 -1
  23. package/dist/tools/suggest/actions/by-key.d.ts.map +1 -1
  24. package/dist/tools/suggest/actions/by-key.js +5 -15
  25. package/dist/tools/suggest/actions/by-key.js.map +1 -1
  26. package/dist/tools/suggest/actions/by-tags.d.ts.map +1 -1
  27. package/dist/tools/suggest/actions/by-tags.js +5 -15
  28. package/dist/tools/suggest/actions/by-tags.js.map +1 -1
  29. package/dist/tools/suggest/actions/constraint-by-context.d.ts +1 -1
  30. package/dist/tools/suggest/actions/constraint-by-context.d.ts.map +1 -1
  31. package/dist/tools/suggest/actions/constraint-by-context.js +9 -16
  32. package/dist/tools/suggest/actions/constraint-by-context.js.map +1 -1
  33. package/dist/tools/suggest/actions/constraint-by-tags.d.ts +1 -1
  34. package/dist/tools/suggest/actions/constraint-by-tags.d.ts.map +1 -1
  35. package/dist/tools/suggest/actions/constraint-by-tags.js +11 -17
  36. package/dist/tools/suggest/actions/constraint-by-tags.js.map +1 -1
  37. package/dist/tools/suggest/actions/constraint-by-text.d.ts +1 -1
  38. package/dist/tools/suggest/actions/constraint-by-text.d.ts.map +1 -1
  39. package/dist/tools/suggest/actions/constraint-by-text.js +6 -15
  40. package/dist/tools/suggest/actions/constraint-by-text.js.map +1 -1
  41. package/dist/types.d.ts +0 -228
  42. package/dist/types.d.ts.map +1 -1
  43. package/dist/utils/suggest-helpers.d.ts +82 -0
  44. package/dist/utils/suggest-helpers.d.ts.map +1 -0
  45. package/dist/utils/suggest-helpers.js +93 -0
  46. package/dist/utils/suggest-helpers.js.map +1 -0
  47. package/package.json +1 -1
@@ -1,48 +1,50 @@
1
- ## Plan Mode Integration
2
-
3
- ### Decision & Constraint Recording Format
4
-
5
- When writing plans, use these formats to record decisions and constraints.
6
- They will be **auto-detected on ExitPlanMode** and registered as draft in sqlew.
7
-
8
- **Decision format:**
9
- ```markdown
10
- ### 📌 Decision: [key/path]
11
- - **Value**: Description of the decision
12
- - **Layer**: presentation | business | data | infrastructure | cross-cutting
13
- - **Tags**: tag1, tag2 (optional)
14
- ```
15
-
16
- **Constraint format:**
17
- ```markdown
18
- ### 🚫 Constraint: [category]
19
- - **Rule**: Description of the constraint
20
- - **Priority**: critical | high | medium | low
21
- - **Tags**: tag1, tag2 (optional)
22
- ```
23
-
24
- Category options: `architecture` | `security` | `code-style` | `performance`
25
-
26
- ### With Claude Code Hooks (Recommended)
27
-
28
- If you've run `sqlew init --hooks`, sqlew integration is **fully automatic**:
29
- - Related decisions are auto-suggested before Task execution
30
- - Plan files are auto-tracked with unique IDs
31
- - 📌/🚫 patterns are auto-detected and registered as draft
32
- - Decisions are auto-saved when code is edited
33
- - Status updates to `in_review` when all tasks complete
34
- - Status updates to `implemented` after git merge/rebase
35
-
36
- ### Manual Usage (Without Hooks)
37
-
38
- When `<system-reminder>Plan mode is active</system-reminder>` appears:
39
-
40
- **Research Phase:**
41
- - `/sqlew search for <topic>` - find related decisions
42
- - `/sqlew show remaining tasks` - check active tasks
43
-
44
- **Final Plan Phase:**
45
- - `/sqlew record <decision>` - record key architectural decisions
46
- - `/sqlew create task <description>` - create implementation tasks
47
-
48
- **Quick Reference**: `.claude/skills/sqlew-decision-format/SKILL.md`
1
+ ## Plan Mode Integration
2
+
3
+ ### REQUIRED: Decision & Constraint Recording
4
+
5
+ **When writing plans, you MUST include the following sections:**
6
+
7
+ 1. **📌 Decisions** - Technology choices, architecture patterns, implementation approaches
8
+ 2. **🚫 Constraints** - Rules, restrictions, limitations, prohibited patterns from user requirements
9
+
10
+ **IMPORTANT**: If the user mentions any restrictions, prohibitions, or "don't use X", these MUST be recorded as 🚫 Constraints.
11
+
12
+ ---
13
+
14
+ **Decision format (REQUIRED for any technical choice):**
15
+
16
+ ```markdown
17
+ ### 📌 Decision: [key/path]
18
+ - **Value**: Description of the decision
19
+ - **Layer**: presentation | business | data | infrastructure | cross-cutting
20
+ - **Tags**: tag1, tag2 (optional)
21
+ ```
22
+
23
+ **Constraint format (REQUIRED when user specifies restrictions):**
24
+
25
+ ```markdown
26
+ ### 🚫 Constraint: [category]
27
+ - **Rule**: Description of the constraint
28
+ - **Priority**: critical | high | medium | low
29
+ - **Tags**: tag1, tag2 (optional)
30
+ ```
31
+
32
+ Category options: `architecture` | `security` | `code-style` | `performance`
33
+
34
+ ---
35
+
36
+ ### With Claude Code Hooks (Recommended)
37
+
38
+ If you've run `sqlew --hooks`, sqlew integration is **fully automatic**:
39
+
40
+ - 📌/🚫 patterns are auto-detected and registered as draft on ExitPlanMode
41
+ - Related decisions are auto-suggested before Task execution
42
+ - Decisions are auto-saved when code is edited
43
+
44
+ ### Manual Usage (Without Hooks)
45
+
46
+ **Research Phase:**
47
+ - `/sqlew search for <topic>` - find related decisions
48
+
49
+ **Final Plan Phase:**
50
+ - `/sqlew record <decision>` - record key architectural decisions
@@ -1,282 +1,120 @@
1
- # sqlew Configuration File
2
- # Copy this file to .sqlew/config.toml and customize as needed
3
- #
4
- # Priority: CLI arguments > config.toml > database m_config > defaults
5
- # Documentation: docs/CONFIGURATION.md
6
-
7
- # ============================================================================
8
- # Database Settings
9
- # ============================================================================
10
- [database]
11
- # SQLite Configuration (default, local development)
12
- # Database file path (relative to project root or absolute)
13
- # Default: ".sqlew/sqlew.db"
14
- # path = ".sqlew/custom.db"
15
- # path = "/absolute/path/to/database.db"
16
-
17
- # PostgreSQL/MySQL/MariaDB Configuration (multi-agent production)
18
- # Uncomment and configure for remote database access
19
- # type = "postgres" # or "mysql" (also works with MariaDB 10.5+)
20
-
21
- # Connection settings (required for postgres/mysql/mariadb)
22
- # IMPORTANT: Database must already exist! User does NOT need CREATE DATABASE privilege.
23
- # [database.connection]
24
- # host = "localhost"
25
- # port = 5432 # PostgreSQL: 5432, MySQL/MariaDB: 3306
26
- # database = "sqlew" # Must be created beforehand!
27
-
28
- # Authentication settings (required for postgres/mysql/mariadb)
29
- # Required user privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, DROP, REFERENCES
30
- # [database.auth]
31
- # type = "direct" # Options: "direct", "ssh", "aws-iam", "gcp-iam"
32
- # user = "postgres" # or mysql_user, etc.
33
- # password = "your-password"
34
-
35
- # SSL/TLS Configuration (optional, for encrypted connections)
36
- # [database.auth.ssl]
37
- # ca = "/path/to/ca-cert.pem" # or inline certificate content
38
- # cert = "/path/to/client-cert.pem" # for mutual TLS
39
- # key = "/path/to/client-key.pem" # for mutual TLS
40
- # rejectUnauthorized = true # set to false for self-signed certs (not recommended for production)
41
-
42
- # SSH Tunnel Configuration (when type = "ssh")
43
- # Used for bastion host / jump server access
44
- # [database.auth.ssh]
45
- # host = "bastion.example.com"
46
- # port = 22
47
- # username = "deploy"
48
- # privateKeyPath = "/home/user/.ssh/id_rsa" # or use password
49
- # password = "ssh-password" # alternative to privateKeyPath
50
- # passphrase = "key-passphrase" # if private key is encrypted
51
- # timeout = 30000 # SSH connection timeout in ms
52
- # keepalive = true
53
- # keepaliveInterval = 10000
54
- # localPort = 50000 # auto-allocated from 50000-60000 if not specified
55
-
56
- # ============================================================================
57
- # Auto-Deletion Settings
58
- # ============================================================================
59
- [autodelete]
60
- # Skip weekends when calculating retention periods
61
- # When true: 24 hours on Monday = previous Friday (skips Sat/Sun)
62
- # When false: 24 hours = exactly 24 hours ago
63
- # Default: false
64
- ignore_weekend = false
65
-
66
- # Message retention period in hours (1-720)
67
- # Messages older than this are automatically deleted
68
- # Default: 24 (1 day)
69
- message_hours = 24
70
-
71
- # File change history retention in days (1-365)
72
- # File changes older than this are automatically deleted
73
- # Default: 7 (1 week)
74
- file_history_days = 7
75
-
76
- # ============================================================================
77
- # Debug Logging Settings (v3.5.4)
78
- # ============================================================================
79
- [debug]
80
- # Debug log file path (optional)
81
- # When set, enables detailed debug logging for troubleshooting
82
- # Environment variable SQLEW_DEBUG takes precedence over this setting
83
- # Default: not set (logging disabled)
84
- # log_path = "/home/user/.sqlew/debug.log"
85
- # log_path = ".sqlew/debug.log"
86
-
87
- # Log level for debug output (case-insensitive)
88
- # Levels: "error", "warn", "info", "debug"
89
- # error: Only errors
90
- # warn: Errors and warnings
91
- # info: Errors, warnings, and informational messages
92
- # debug: All messages including debug details
93
- # Default: "info"
94
- # log_level = "info"
95
-
96
- # ============================================================================
97
- # Task Management Settings
98
- # ============================================================================
99
- [tasks]
100
- # Auto-archive done tasks after N days (1-365)
101
- # Tasks in 'done' status older than this are moved to 'archived'
102
- # Keeps task list clean while preserving history
103
- # Default: 2 (48 hours)
104
- auto_archive_done_days = 2
105
-
106
- # Stale detection threshold for 'in_progress' tasks (hours, 1-168)
107
- # Tasks stuck in 'in_progress' longer than this → move to 'waiting_review'
108
- # Helps recover from interrupted AI sessions
109
- # Default: 2 (2 hours)
110
- stale_hours_in_progress = 2
111
-
112
- # Stale detection threshold for 'waiting_review' tasks (hours, 1-720)
113
- # Tasks stuck in 'waiting_review' longer than this → move back to 'todo'
114
- # Prevents abandoned reviews from blocking workflow
115
- # Default: 24 (1 day)
116
- stale_hours_waiting_review = 24
117
-
118
- # Enable automatic stale detection
119
- # When true: Runs stale detection on startup and before task operations
120
- # When false: Stale detection disabled (manual only)
121
- # Default: true
122
- auto_stale_enabled = true
123
-
124
- # ============================================================================
125
- # VCS-Aware Auto-Complete Settings (v3.5.2)
126
- # ============================================================================
127
- [vcs]
128
- # Auto-complete tasks when files are staged (git add)
129
- # When true: waiting_review → done when files are staged
130
- # When false: Manual task completion required
131
- # Default: true
132
- git_auto_complete_on_stage = true
133
-
134
- # Auto-archive tasks when files are committed (git commit)
135
- # When true: done → archived when files are committed
136
- # When false: Manual task archiving required
137
- # Default: true
138
- git_auto_archive_on_commit = true
139
-
140
- # Require ALL watched files to be staged for auto-completion
141
- # When true: All files must be staged to trigger waiting_review → done
142
- # When false: At least one file staged is sufficient
143
- # Default: true
144
- require_all_files_staged = true
145
-
146
- # Require ALL watched files to be committed for auto-archiving
147
- # When true: All files must be committed to trigger done → archived
148
- # When false: At least one file committed is sufficient
149
- # Default: true
150
- require_all_files_committed_for_archive = true
151
-
152
- # ============================================================================
153
- # Specialized Agents Settings
154
- # ============================================================================
155
- [agents]
156
- # Which specialized agents to enable for your project
157
- # Set to false to skip agents you don't need (reduces token consumption)
158
- # Install by manually copying files from assets/sample-agents/ to ~/.claude/agents/
159
- # Note: Agents are only loaded into Claude Code conversations, not the MCP server
160
-
161
- # Scrum Master: Multi-agent coordination, task management, sprint planning
162
- # Token cost: ~12KB per conversation when loaded in Claude Code
163
- # Use when: Coordinating complex features, managing dependencies, tracking progress
164
- # Default: true
165
- scrum_master = true
166
-
167
- # Researcher: Query decisions, analyze patterns, investigate context
168
- # Token cost: ~14KB per conversation when loaded in Claude Code
169
- # Use when: Understanding past decisions, onboarding new members, sprint retrospectives
170
- # Default: true
171
- researcher = true
172
-
173
- # Architect: Document decisions, enforce constraints, maintain standards
174
- # Token cost: ~20KB per conversation when loaded in Claude Code
175
- # Use when: Making architectural choices, establishing rules, validating compliance
176
- # Default: true
177
- architect = true
178
-
179
- # Example: Minimal installation (only Scrum Master for task management)
180
- # [agents]
181
- # scrum_master = true
182
- # researcher = false
183
- # architect = false
184
-
185
- # Token Impact Examples:
186
- # - All 3 agents: ~46KB loaded per conversation (scrum 12KB + researcher 14KB + architect 20KB)
187
- # - Scrum + Architect: ~32KB (30% reduction)
188
- # - Scrum only: ~12KB (74% reduction)
189
-
190
-
191
- # ============================================================================
192
- # Slash Commands Settings
193
- # ============================================================================
194
- [commands]
195
- # Which slash commands to install on server startup
196
- # Set to false to skip commands you don't need
197
-
198
- # /sqlew: Unified natural language interface for decisions and tasks
199
- # Usage: /sqlew <what you want to do>
200
- # Examples:
201
- # /sqlew show remaining tasks
202
- # /sqlew search for auth decisions
203
- # /sqlew record that we use PostgreSQL 15
204
- # Default: true
205
- sqlew = true
206
-
207
- # ============================================================================
208
- # Example Configurations
209
- # ============================================================================
210
-
211
- # Example 1: PostgreSQL with Direct Authentication + SSL
212
- # [database]
213
- # type = "postgres"
214
- # [database.connection]
215
- # host = "db.example.com"
216
- # port = 5432
217
- # database = "sqlew_production"
218
- # [database.auth]
219
- # type = "direct"
220
- # user = "postgres"
221
- # password = "secure-password"
222
- # [database.auth.ssl]
223
- # ca = "/path/to/ca-cert.pem"
224
- # rejectUnauthorized = true
225
-
226
- # Example 2: PostgreSQL through SSH Tunnel
227
- # [database]
228
- # type = "postgres"
229
- # [database.connection]
230
- # host = "db.internal.example.com"
231
- # port = 5432
232
- # database = "sqlew_production"
233
- # [database.auth]
234
- # type = "ssh"
235
- # user = "postgres"
236
- # password = "db-password"
237
- # [database.auth.ssh]
238
- # host = "bastion.example.com"
239
- # username = "deploy"
240
- # privateKeyPath = "/home/user/.ssh/id_rsa"
241
-
242
- # Example 3: MySQL with SSL and SSH
243
- # [database]
244
- # type = "mysql"
245
- # [database.connection]
246
- # host = "mysql.internal.example.com"
247
- # port = 3306
248
- # database = "sqlew_db"
249
- # [database.auth]
250
- # type = "ssh"
251
- # user = "mysql_user"
252
- # password = "db-password"
253
- # [database.auth.ssl]
254
- # ca = "-----BEGIN CERTIFICATE-----\nMIIE...\n-----END CERTIFICATE-----"
255
- # rejectUnauthorized = true
256
- # [database.auth.ssh]
257
- # host = "jump.example.com"
258
- # port = 22
259
- # username = "deploy"
260
- # privateKeyPath = "/home/user/.ssh/deploy_key"
261
- # passphrase = "key-passphrase"
262
- # localPort = 53306
263
-
264
- # Aggressive cleanup (development)
265
- # [autodelete]
266
- # message_hours = 1
267
- # file_history_days = 1
268
- # [tasks]
269
- # auto_archive_done_days = 1
270
-
271
- # Conservative cleanup (production)
272
- # [autodelete]
273
- # message_hours = 168 # 7 days
274
- # file_history_days = 30
275
- # [tasks]
276
- # auto_archive_done_days = 7
277
-
278
- # Weekend-aware workflow (for developers)
279
- # [autodelete]
280
- # ignore_weekend = true
281
- # message_hours = 48
282
- # file_history_days = 14
1
+ # sqlew Configuration File
2
+ # Copy this file to .sqlew/config.toml and customize as needed
3
+ #
4
+ # Priority: CLI arguments > config.toml > database m_config > defaults
5
+ # Documentation: docs/CONFIGURATION.md
6
+
7
+ # ============================================================================
8
+ # Database Settings
9
+ # ============================================================================
10
+ [database]
11
+ # SQLite Configuration (default, local development)
12
+ # Database file path (relative to project root or absolute)
13
+ # Default: ".sqlew/sqlew.db"
14
+ # path = ".sqlew/custom.db"
15
+ # path = "/absolute/path/to/database.db"
16
+
17
+ # PostgreSQL/MySQL/MariaDB Configuration (multi-agent production)
18
+ # Uncomment and configure for remote database access
19
+ # type = "postgres" # or "mysql" (also works with MariaDB 10.5+)
20
+
21
+ # Connection settings (required for postgres/mysql/mariadb)
22
+ # IMPORTANT: Database must already exist! User does NOT need CREATE DATABASE privilege.
23
+ # [database.connection]
24
+ # host = "localhost"
25
+ # port = 5432 # PostgreSQL: 5432, MySQL/MariaDB: 3306
26
+ # database = "sqlew" # Must be created beforehand!
27
+
28
+ # Authentication settings (required for postgres/mysql/mariadb)
29
+ # Required user privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, DROP, REFERENCES
30
+ # [database.auth]
31
+ # user = "postgres" # or mysql_user, etc.
32
+ # password = "your-password"
33
+
34
+
35
+ # ============================================================================
36
+ # Debug Logging Settings (v3.5.4)
37
+ # ============================================================================
38
+ [debug]
39
+ # Debug log file path (optional)
40
+ # When set, enables detailed debug logging for troubleshooting
41
+ # Environment variable SQLEW_DEBUG takes precedence over this setting
42
+ # Default: not set (logging disabled)
43
+ # log_path = "/home/user/.sqlew/debug.log"
44
+ # log_path = ".sqlew/debug.log"
45
+
46
+ # Log level for debug output (case-insensitive)
47
+ # Levels: "error", "warn", "info", "debug"
48
+ # error: Only errors
49
+ # warn: Errors and warnings
50
+ # info: Errors, warnings, and informational messages
51
+ # debug: All messages including debug details
52
+ # Default: "info"
53
+ # log_level = "info"
54
+
55
+
56
+ # ============================================================================
57
+ # Specialized Agents Settings (DEPRECATED)
58
+ # ============================================================================
59
+ [agents]
60
+ # DEPRECATED: With Claude Opus 4.5's improved capabilities, specialized agents
61
+ # are no longer necessary. The base model now handles coordination, research,
62
+ # and architectural decisions effectively without additional agent overhead.
63
+ #
64
+ # These settings are preserved for backward compatibility but all agents are
65
+ # disabled by default. Will be removed in v5.0.
66
+
67
+ # Scrum Master: Multi-agent coordination (DEPRECATED)
68
+ # Default: false
69
+ scrum_master = false
70
+
71
+ # Researcher: Query decisions, analyze patterns (DEPRECATED)
72
+ # Default: false
73
+ researcher = false
74
+
75
+ # Architect: Document decisions, enforce constraints (DEPRECATED)
76
+ # Default: false
77
+ architect = false
78
+
79
+
80
+ # ============================================================================
81
+ # Slash Commands Settings
82
+ # ============================================================================
83
+ [commands]
84
+ # Which slash commands to install on server startup
85
+ # Set to false to skip commands you don't need
86
+
87
+ # /sqlew: Unified natural language interface for decisions and tasks
88
+ # Usage: /sqlew <what you want to do>
89
+ # Examples:
90
+ # /sqlew show remaining tasks
91
+ # /sqlew search for auth decisions
92
+ # /sqlew record that we use PostgreSQL 15
93
+ # Default: true
94
+ sqlew = true
95
+
96
+ # ============================================================================
97
+ # Example Configurations
98
+ # ============================================================================
99
+
100
+ # Example 1: PostgreSQL with SSL
101
+ # [database]
102
+ # type = "postgres"
103
+ # [database.connection]
104
+ # host = "db.example.com"
105
+ # port = 5432
106
+ # database = "sqlew_production"
107
+ # [database.auth]
108
+ # user = "postgres"
109
+ # password = "secure-password"
110
+
111
+ # Example 2: MySQL/MariaDB
112
+ # [database]
113
+ # type = "mysql"
114
+ # [database.connection]
115
+ # host = "mysql.example.com"
116
+ # port = 3306
117
+ # database = "sqlew_db"
118
+ # [database.auth]
119
+ # user = "mysql_user"
120
+ # password = "db-password"
package/dist/cli.js CHANGED
@@ -16,7 +16,7 @@ import { saveCommand } from './cli/hooks/save.js';
16
16
  import { checkCompletionCommand } from './cli/hooks/check-completion.js';
17
17
  import { markDoneCommand } from './cli/hooks/mark-done.js';
18
18
  import { initHooksCommand } from './cli/hooks/init-hooks.js';
19
- import { initializeSkills, initializeClaudeMd, initializeGitignore } from './init-skills.js';
19
+ import { initializeSkills, initializeRules, initializeGitignore } from './init-skills.js';
20
20
  import { onSubagentStopCommand } from './cli/hooks/on-subagent-stop.js';
21
21
  import { onStopCommand } from './cli/hooks/on-stop.js';
22
22
  import { onEnterPlanCommand } from './cli/hooks/on-enter-plan.js';
@@ -109,54 +109,54 @@ function formatTable(data, headers) {
109
109
  * Show help message
110
110
  */
111
111
  function showHelp() {
112
- console.log(`
113
- sqlew CLI - Query and database migration tool for mcp-sqlew
114
-
115
- USAGE:
116
- sqlew <command> [options]
117
- sqlew --init # One-shot project setup (recommended)
118
-
119
- COMMANDS:
120
- Setup:
121
- --init One-shot initialization (Skills + CLAUDE.md + Hooks + gitignore)
122
- init --hooks Initialize Claude Code and Git hooks only
123
-
124
- Database:
125
- db:dump Generate SQL dump for database migration (schema + data)
126
- db:export Export project data to JSON format (data-only, for append-import)
127
- db:import Import project data from JSON export (append to existing database)
128
-
129
- Claude Code Hooks (v4.1.0+):
130
- suggest Find related decisions (PreToolUse hook for Task)
131
- track-plan Track plan files (PreToolUse hook for Write)
132
- save Save decisions on code edit (PostToolUse hook for Edit|Write)
133
- check-completion Check task completion (PostToolUse hook for TodoWrite)
134
- mark-done Mark decisions as implemented (Git hooks or manual)
135
-
136
- Plan Mode Hooks (v4.2.0+):
137
- on-enter-plan Inject TOML template (PostToolUse hook for EnterPlanMode)
138
- on-exit-plan Prompt TOML documentation (PostToolUse hook for ExitPlanMode)
139
- on-subagent-stop Process Plan agent completion (SubagentStop hook)
140
- on-stop Process main agent stop (Stop hook)
141
-
142
- OPTIONS:
143
- --init Initialize all sqlew integrations
144
- --help Show this help message
145
-
146
- EXAMPLES:
147
- # Full project setup (Skills, CLAUDE.md, Hooks, gitignore)
148
- sqlew --init
149
-
150
- # Initialize only hooks
151
- sqlew init --hooks
152
-
153
- # Generate MySQL dump for database migration
154
- npm run db:dump -- mysql -o dump-mysql.sql
155
-
156
- For more information on commands, run:
157
- npm run db:dump -- --help
158
- npm run db:export -- --help
159
- npm run db:import -- --help
112
+ console.log(`
113
+ sqlew CLI - Query and database migration tool for mcp-sqlew
114
+
115
+ USAGE:
116
+ sqlew <command> [options]
117
+ sqlew --init # One-shot project setup (recommended)
118
+
119
+ COMMANDS:
120
+ Setup:
121
+ --init One-shot initialization (Skills + CLAUDE.md + Hooks + gitignore)
122
+ init --hooks Initialize Claude Code and Git hooks only
123
+
124
+ Database:
125
+ db:dump Generate SQL dump for database migration (schema + data)
126
+ db:export Export project data to JSON format (data-only, for append-import)
127
+ db:import Import project data from JSON export (append to existing database)
128
+
129
+ Claude Code Hooks (v4.1.0+):
130
+ suggest Find related decisions (PreToolUse hook for Task)
131
+ track-plan Track plan files (PreToolUse hook for Write)
132
+ save Save decisions on code edit (PostToolUse hook for Edit|Write)
133
+ check-completion Check task completion (PostToolUse hook for TodoWrite)
134
+ mark-done Mark decisions as implemented (Git hooks or manual)
135
+
136
+ Plan Mode Hooks (v4.2.0+):
137
+ on-enter-plan Inject TOML template (PostToolUse hook for EnterPlanMode)
138
+ on-exit-plan Prompt TOML documentation (PostToolUse hook for ExitPlanMode)
139
+ on-subagent-stop Process Plan agent completion (SubagentStop hook)
140
+ on-stop Process main agent stop (Stop hook)
141
+
142
+ OPTIONS:
143
+ --init Initialize all sqlew integrations
144
+ --help Show this help message
145
+
146
+ EXAMPLES:
147
+ # Full project setup (Skills, CLAUDE.md, Hooks, gitignore)
148
+ sqlew --init
149
+
150
+ # Initialize only hooks
151
+ sqlew init --hooks
152
+
153
+ # Generate MySQL dump for database migration
154
+ npm run db:dump -- mysql -o dump-mysql.sql
155
+
156
+ For more information on commands, run:
157
+ npm run db:dump -- --help
158
+ npm run db:export -- --help
159
+ npm run db:import -- --help
160
160
  `);
161
161
  }
162
162
  // ============================================================================
@@ -251,14 +251,14 @@ async function initAllCommand() {
251
251
  catch (error) {
252
252
  console.log(` ✗ Skills failed: ${error instanceof Error ? error.message : String(error)}`);
253
253
  }
254
- // 2. Initialize CLAUDE.md
255
- console.log('[2/4] Updating CLAUDE.md...');
254
+ // 2. Initialize .claude/rules/
255
+ console.log('[2/4] Setting up .claude/rules/...');
256
256
  try {
257
- initializeClaudeMd(projectPath);
258
- console.log(' ✓ CLAUDE.md updated');
257
+ initializeRules(projectPath);
258
+ console.log(' ✓ Plan mode integration rule installed');
259
259
  }
260
260
  catch (error) {
261
- console.log(` ✗ CLAUDE.md failed: ${error instanceof Error ? error.message : String(error)}`);
261
+ console.log(` ✗ Rules setup failed: ${error instanceof Error ? error.message : String(error)}`);
262
262
  }
263
263
  // 3. Initialize Hooks
264
264
  console.log('[3/4] Setting up Claude Code Hooks...');