sqlew 4.0.1 → 4.0.3

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 (109) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +29 -113
  3. package/assets/claude-md-snippets/plan-mode-integration.md +13 -0
  4. package/assets/sample-commands/sqlew.md +144 -0
  5. package/assets/sample-skills/sqlew-plan-guidance/SKILL.md +55 -0
  6. package/dist/cli/db-dump.d.ts +4 -0
  7. package/dist/cli/db-dump.d.ts.map +1 -1
  8. package/dist/cli/db-dump.js +89 -114
  9. package/dist/cli/db-dump.js.map +1 -1
  10. package/dist/cli/db-export.d.ts +1 -0
  11. package/dist/cli/db-export.d.ts.map +1 -1
  12. package/dist/cli/db-export.js +46 -80
  13. package/dist/cli/db-export.js.map +1 -1
  14. package/dist/cli/db-import.d.ts +1 -0
  15. package/dist/cli/db-import.d.ts.map +1 -1
  16. package/dist/cli/db-import.js +52 -90
  17. package/dist/cli/db-import.js.map +1 -1
  18. package/dist/cli.d.ts +10 -1
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +57 -59
  21. package/dist/cli.js.map +1 -1
  22. package/dist/database/migrations/v4/20251127000002_v4_seed_help_system.d.ts.map +1 -1
  23. package/dist/database/migrations/v4/20251127000002_v4_seed_help_system.js +7 -4
  24. package/dist/database/migrations/v4/20251127000002_v4_seed_help_system.js.map +1 -1
  25. package/dist/database/operations/inserts.d.ts.map +1 -1
  26. package/dist/database/operations/inserts.js +7 -0
  27. package/dist/database/operations/inserts.js.map +1 -1
  28. package/dist/index.d.ts +4 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +70 -48
  31. package/dist/index.js.map +1 -1
  32. package/dist/init-commands.d.ts +5 -2
  33. package/dist/init-commands.d.ts.map +1 -1
  34. package/dist/init-commands.js +36 -175
  35. package/dist/init-commands.js.map +1 -1
  36. package/dist/init-skills.d.ts +19 -0
  37. package/dist/init-skills.d.ts.map +1 -0
  38. package/dist/init-skills.js +104 -0
  39. package/dist/init-skills.js.map +1 -0
  40. package/dist/server/setup.d.ts.map +1 -1
  41. package/dist/server/setup.js +9 -0
  42. package/dist/server/setup.js.map +1 -1
  43. package/dist/tests/database/testing-config.d.ts +4 -0
  44. package/dist/tests/database/testing-config.d.ts.map +1 -1
  45. package/dist/tests/database/testing-config.js +1 -1
  46. package/dist/tests/database/testing-config.js.map +1 -1
  47. package/dist/tests/docker/native/test-harness.d.ts +56 -1
  48. package/dist/tests/docker/native/test-harness.d.ts.map +1 -1
  49. package/dist/tests/docker/native/test-harness.js +221 -5
  50. package/dist/tests/docker/native/test-harness.js.map +1 -1
  51. package/dist/tests/unit/case-insensitive-validator.test.d.ts +14 -0
  52. package/dist/tests/unit/case-insensitive-validator.test.d.ts.map +1 -0
  53. package/dist/tests/unit/case-insensitive-validator.test.js +390 -0
  54. package/dist/tests/unit/case-insensitive-validator.test.js.map +1 -0
  55. package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts +2 -0
  56. package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts.map +1 -0
  57. package/dist/tests/unit/utils/case-insensitive-validator.test.js +97 -0
  58. package/dist/tests/unit/utils/case-insensitive-validator.test.js.map +1 -0
  59. package/dist/tools/context/actions/create-policy.d.ts.map +1 -1
  60. package/dist/tools/context/actions/create-policy.js +5 -1
  61. package/dist/tools/context/actions/create-policy.js.map +1 -1
  62. package/dist/tools/tasks/actions/get.d.ts.map +1 -1
  63. package/dist/tools/tasks/actions/get.js +1 -4
  64. package/dist/tools/tasks/actions/get.js.map +1 -1
  65. package/dist/tools/tasks/internal/task-queries.d.ts.map +1 -1
  66. package/dist/tools/tasks/internal/task-queries.js +2 -8
  67. package/dist/tools/tasks/internal/task-queries.js.map +1 -1
  68. package/dist/types.d.ts +10 -6
  69. package/dist/types.d.ts.map +1 -1
  70. package/dist/utils/case-insensitive-validator.d.ts +102 -0
  71. package/dist/utils/case-insensitive-validator.d.ts.map +1 -0
  72. package/dist/utils/case-insensitive-validator.js +144 -0
  73. package/dist/utils/case-insensitive-validator.js.map +1 -0
  74. package/dist/utils/exporter/export.d.ts +22 -7
  75. package/dist/utils/exporter/export.d.ts.map +1 -1
  76. package/dist/utils/exporter/export.js +33 -49
  77. package/dist/utils/exporter/export.js.map +1 -1
  78. package/dist/utils/importer/import.js +64 -27
  79. package/dist/utils/importer/import.js.map +1 -1
  80. package/dist/utils/importer/master-tables.d.ts +3 -1
  81. package/dist/utils/importer/master-tables.d.ts.map +1 -1
  82. package/dist/utils/importer/master-tables.js +7 -29
  83. package/dist/utils/importer/master-tables.js.map +1 -1
  84. package/dist/utils/sql-dump/core/generate-dump.d.ts.map +1 -1
  85. package/dist/utils/sql-dump/core/generate-dump.js +25 -5
  86. package/dist/utils/sql-dump/core/generate-dump.js.map +1 -1
  87. package/dist/utils/sql-dump/core/index-export.d.ts +3 -2
  88. package/dist/utils/sql-dump/core/index-export.d.ts.map +1 -1
  89. package/dist/utils/sql-dump/core/index-export.js +9 -9
  90. package/dist/utils/sql-dump/core/index-export.js.map +1 -1
  91. package/dist/utils/sql-dump/schema/indexes.d.ts +14 -0
  92. package/dist/utils/sql-dump/schema/indexes.d.ts.map +1 -1
  93. package/dist/utils/sql-dump/schema/indexes.js +81 -15
  94. package/dist/utils/sql-dump/schema/indexes.js.map +1 -1
  95. package/dist/utils/sql-dump/schema/tables.d.ts +4 -1
  96. package/dist/utils/sql-dump/schema/tables.d.ts.map +1 -1
  97. package/dist/utils/sql-dump/schema/tables.js +81 -51
  98. package/dist/utils/sql-dump/schema/tables.js.map +1 -1
  99. package/docs/SLASH_COMMANDS.md +192 -478
  100. package/docs/SPECIALIZED_AGENTS.md +81 -43
  101. package/docs/cli/DATABASE_MIGRATION.md +62 -58
  102. package/docs/cli/DATA_EXPORT_IMPORT.md +403 -103
  103. package/docs/cli/README.md +95 -45
  104. package/package.json +4 -6
  105. package/assets/sample-commands/sqw-documentor.md +0 -204
  106. package/assets/sample-commands/sqw-plan.md +0 -348
  107. package/assets/sample-commands/sqw-research.md +0 -359
  108. package/assets/sample-commands/sqw-review.md +0 -377
  109. package/assets/sample-commands/sqw-scrum.md +0 -457
package/CHANGELOG.md CHANGED
@@ -7,6 +7,133 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [4.0.3] - 2025-12-04
11
+
12
+ ### Added
13
+
14
+ **Unified `/sqlew` Slash Command**
15
+
16
+ - Consolidated all slash commands (`/sqw-plan`, `/sqw-scrum`, `/sqw-research`, etc.) into single `/sqlew` command
17
+ - Natural language interface with automatic intent detection
18
+ - 6-level intent priority: List/Status → Search → Record → Update → Execute → Task Creation
19
+ - Supports both English and Japanese keywords
20
+ - Removed custom agent definitions (sqlew-architect, scrum-master, sqlew-researcher)
21
+
22
+ **Usage Examples:**
23
+ ```bash
24
+ /sqlew # Show status and suggest next action
25
+ /sqlew show remaining tasks # List/Status intent
26
+ /sqlew search for auth decisions # Search intent
27
+ /sqlew record that we use JWT # Record intent
28
+ /sqlew execute pending tasks # Execute intent
29
+ ```
30
+
31
+ ### Fixed
32
+
33
+ **v4_task_details JOIN Bug**
34
+
35
+ - Fixed `task.get` action failing with "no such column: td.project_id" error
36
+ - Root cause: `v4_task_details` table has only `task_id` as PK, not `project_id`
37
+ - Removed invalid `.andOn('t.project_id', '=', 'td.project_id')` from JOIN conditions
38
+ - Affected files: `task-queries.ts`, `get.ts`
39
+
40
+ ### Changed
41
+
42
+ **Documentation Updates**
43
+
44
+ - Rewrote `CLAUDE.md` with unified `/sqlew` command section
45
+ - Updated `README.md` Quick Start to use `/sqlew`
46
+ - Rewrote `docs/SLASH_COMMANDS.md` as Unified /sqlew Command Guide
47
+ - Marked `docs/SPECIALIZED_AGENTS.md` as deprecated with migration guide
48
+
49
+ ---
50
+
51
+ ## [4.0.2] - 2025-11-28
52
+
53
+ ### BREAKING CHANGES
54
+
55
+ **SQL Dump No Longer Supports Cross-Database Format Conversion**
56
+
57
+ The `db:dump` command now generates SQL for the **same database type only**. Cross-database migrations (e.g., SQLite → MySQL) must use JSON export/import instead.
58
+
59
+ **Migration Required:**
60
+ ```bash
61
+ # ❌ Old approach (no longer supported)
62
+ npx sqlew db:dump mysql backup.sql # Cross-DB conversion removed
63
+
64
+ # ✅ New approach: Use JSON for cross-database migration
65
+ npx sqlew db:export backup.json # Export to JSON
66
+ npx sqlew db:import backup.json # Import to target database
67
+ ```
68
+
69
+ **Rationale:**
70
+ - SQL syntax differences between databases caused data corruption issues
71
+ - Case-insensitive pattern matching failed in certain scenarios
72
+ - JSON format is database-agnostic and handles all data types correctly
73
+
74
+ **Node.js 20+ Required**
75
+
76
+ Minimum Node.js version updated from 18.0.0 to 20.0.0.
77
+
78
+ ### Added
79
+
80
+ **Unified CLI Entry Point**
81
+
82
+ - `npx sqlew db:export`, `npx sqlew db:import`, `npx sqlew db:dump` now work directly
83
+ - No `npm install` required - just use `npx sqlew <command>`
84
+ - CLI commands and MCP server mode unified under single `sqlew` entry point
85
+ - Removed separate `sqlew-cli` binary
86
+
87
+ ### Fixed
88
+
89
+ **Case-Insensitive Validation for Master Records**
90
+
91
+ - Added case-insensitive duplicate detection when registering new records
92
+ - Prevents duplicate entries like "MyTag" and "mytag" from being created
93
+ - Applies to tags, scopes, layers, and other master table entries
94
+ - New utility: `src/utils/case-insensitive-validator.ts`
95
+
96
+ **SQLite to MySQL SQL Dump Case-Sensitivity Bug**
97
+
98
+ - Fixed regex pattern matching that failed with case variations
99
+ - SQL dump now correctly handles mixed-case identifiers
100
+ - Enhanced schema table export for better compatibility
101
+
102
+ ### Changed
103
+
104
+ **Export Version Tracking**
105
+
106
+ - Export JSON now includes proper version metadata
107
+ - Version information helps with import compatibility checks
108
+ - Clearer error messages when importing incompatible versions
109
+
110
+ **CLI Documentation Update**
111
+
112
+ - Updated `docs/cli/README.md` with JSON-first migration workflow
113
+ - Added clear guidance on when to use `db:dump` vs `db:export`/`db:import`
114
+ - Improved comparison table for migration scenarios
115
+
116
+ ### Added
117
+
118
+ **Case-Insensitive Validator Utility**
119
+
120
+ - New `src/utils/case-insensitive-validator.ts` for consistent validation
121
+ - Comprehensive test suite: `src/tests/unit/utils/case-insensitive-validator.test.ts`
122
+ - Reusable across all master table operations
123
+
124
+ ### Migration Notes
125
+
126
+ **Backward Compatibility:**
127
+ - Existing databases unaffected
128
+ - JSON export/import workflows unchanged
129
+ - SQL dumps for same-database-type operations still work
130
+
131
+ **Action Required:**
132
+ - Update any scripts that use `db:dump` for cross-database migrations
133
+ - Switch to `db:export`/`db:import` for SQLite ↔ MySQL ↔ PostgreSQL migrations
134
+
135
+ ---
136
+
10
137
  ## [4.0.1] - 2025-11-28
11
138
 
12
139
  ### Removed
package/README.md CHANGED
@@ -96,7 +96,7 @@ See [docs/TASK_OVERVIEW.md](docs/TASK_OVERVIEW.md) and [docs/DECISION_CONTEXT.md
96
96
  ## Installation
97
97
 
98
98
  ### Requirements
99
- - Node.js 18.0.0 or higher
99
+ - Node.js 20.0.0 or higher
100
100
  - npm or npx
101
101
 
102
102
  ### Quick Install
@@ -119,27 +119,30 @@ The first time, sqlew initializes database, installs custom agents and slash com
119
119
 
120
120
  It's Ready!
121
121
 
122
- ## 🚀 Quick Start: Slash Commands (Recommended)
122
+ ## 🚀 Quick Start: /sqlew Command
123
123
 
124
- **Slash commands are the easiest way to use sqlew!** Just type `/sqw-` in Claude Code to see available commands.
124
+ **The `/sqlew` command is the easiest way to use sqlew!** Just type `/sqlew` in Claude Code with natural language input.
125
125
 
126
- ### Most Common Commands
126
+ ### Most Common Uses
127
127
 
128
128
  ```bash
129
- # Plan a new feature (architecture + tasks)
130
- /sqw-plan "Implement user authentication"
129
+ # Show status and get suggestions
130
+ /sqlew
131
131
 
132
- # Record a decision (like meeting minutes)
133
- /sqw-secretary "Use PostgreSQL 15 for production database"
134
-
135
- # Implement a feature (creates tasks AND coordinates agents to build it!)
136
- /sqw-scrum implement JWT authentication
132
+ # Record a decision
133
+ /sqlew record we use PostgreSQL 15 for production database
137
134
 
138
135
  # Search past decisions
139
- /sqw-research "Why did we choose Knex for migrations?"
136
+ /sqlew search why we chose Knex for migrations
137
+
138
+ # List remaining tasks
139
+ /sqlew show remaining tasks
140
+
141
+ # Plan a new feature (breakdown into tasks)
142
+ /sqlew plan implementing user authentication
140
143
  ```
141
144
 
142
- **All 6 commands** are installed automatically on first run. See [Slash Commands](#slash-commands) section below for complete guide.
145
+ The `/sqlew` command automatically detects your intent (search, record, list, execute, task creation) and invokes the appropriate MCP tools.
143
146
 
144
147
  ---
145
148
 
@@ -262,100 +265,9 @@ or invoke Specialized Agent
262
265
 
263
266
  Specialized Agents use sqlew more efficiently.
264
267
 
265
- ## Specialized Agents
266
-
267
- sqlew provides three specialized agents for efficient multi-agent coordination in Claude Code:
268
-
269
- | Agent | Purpose | Token Cost | Use When |
270
- |-------|---------|------------|----------|
271
- | **Scrum Master** | Multi-agent coordination, task management, sprint planning | 12KB/conversation | Coordinating complex features, managing dependencies, tracking progress |
272
- | **Researcher** | Query decisions, analyze patterns, investigate context | 14KB/conversation | Understanding past decisions, onboarding new members, sprint retrospectives |
273
- | **Architect** | Document decisions, enforce constraints, maintain standards | 20KB/conversation | Making architectural choices, establishing rules, validating compliance |
274
-
275
- ### Detailed Installation
276
-
277
- **By default, all three specialized agents are automatically installed** to your project's `.claude/agents/` directory on first run.
278
-
279
- To disable specific agents, create `.sqlew/config.toml`:
280
-
281
- ```toml
282
- [agents]
283
- scrum_master = true # Coordination specialist (12KB)
284
- researcher = false # Disable this agent
285
- architect = true # Documentation specialist (20KB)
286
- ```
287
-
288
- **Note**: Set an agent to `false` in the config file to prevent it from being installed.
289
-
290
- **Usage**: Invoke agents with the `@` prefix: `@sqlew-scrum-master`, `@sqlew-researcher`, `@sqlew-architect`
291
-
292
- **Recommendation**: Use all three agents together - they're complementary specialists (46KB total).
293
-
294
- **Token Optimization** (if needed): Disable unused agents in config.
295
- Savings: Scrum + Architect = 32KB (30%) | Scrum only = 12KB (74%)
296
-
297
- **See [docs/SPECIALIZED_AGENTS.md](docs/SPECIALIZED_AGENTS.md) for complete installation guide, usage examples, and customization.**
298
-
299
- ## Slash Commands
300
-
301
- **🎯 Recommended for Human Users** - Slash commands provide guided workflows that are easier than raw MCP tool calls.
302
-
303
- Installed automatically to `.claude/commands/` on server startup. Just type `/sqw-` in Claude Code to get started!
304
-
305
- ### Available Commands
306
-
307
- | Command | What It Does | Perfect For |
308
- |---------|--------------|-------------|
309
- | **`/sqw-plan`** | Complete feature planning (architecture + tasks) | Starting new features, planning sprints |
310
- | **`/sqw-secretary`** | Record decisions like meeting minutes | Documenting team decisions, capturing context |
311
- | **`/sqw-scrum`** | Create tasks AND coordinate agents to implement them | Actually building features end-to-end |
312
- | **`/sqw-documentor`** | Document architectural decisions with full context | Design reviews, architecture documentation |
313
- | **`/sqw-research`** | Search past decisions and analyze patterns | Onboarding, understanding past choices |
314
- | **`/sqw-review`** | Validate code/design against decisions & constraints | Code reviews, ensuring consistency |
315
-
316
- ### Why Use Slash Commands?
317
-
318
- ✅ **Guided workflows** - Commands prompt you through the process
319
- ✅ **Agent coordination** - Automatically invokes the right agents
320
- ✅ **Error handling** - Built-in validation and helpful error messages
321
- ✅ **Mode detection** - `/sqw-scrum plan` manages tasks, `/sqw-scrum implement` builds code
322
- ✅ **No MCP knowledge needed** - Just describe what you want in plain English
323
-
324
- ### Quick Examples
325
-
326
- ```bash
327
- # Starting a new feature
328
- /sqw-plan Add OAuth2 social login with Google and GitHub
329
- # → Architect documents decisions, Scrum creates tasks
330
-
331
- # Recording a decision from today's meeting
332
- /sqw-secretary Team decided to use PostgreSQL 15 for production
333
- # → Saves with context, checks for duplicates
334
-
335
- # Actually implementing a feature (game changer!)
336
- /sqw-scrum implement JWT authentication
337
- # → Creates tasks, coordinates agents, writes code, runs tests
338
-
339
- # Finding out why something was done
340
- /sqw-research Why did we choose Knex over Prisma?
341
- # → Searches decisions, shows rationale and tradeoffs
342
- ```
343
-
344
- ### Configuration
345
-
346
- All commands install by default. Customize in `.sqlew/config.toml`:
347
-
348
- ```toml
349
- [commands]
350
- plan = true # Feature planning
351
- secretary = true # Record decisions
352
- scrum = true # Task management + execution
353
- documentor = true # Architecture docs
354
- research = true # Search history
355
- review = true # Code/design validation
356
- ```
268
+ ---
357
269
 
358
- **📚 Complete Guide**: [docs/SLASH_COMMANDS.md](docs/SLASH_COMMANDS.md) - Usage patterns, customization, examples
270
+ **Note**: The `/sqlew` command supersedes the previous multi-command system (`/sqw-plan`, `/sqw-scrum`, etc.). All functionality is now available through the unified `/sqlew` interface with automatic intent detection.
359
271
 
360
272
  ### Advanced: Direct MCP Tool Access
361
273
 
@@ -441,16 +353,20 @@ Support development via [GitHub Sponsors](https://github.com/sponsors/sin5ddd) -
441
353
 
442
354
  ## Version
443
355
 
444
- Current version: **3.9.0**
356
+ Current version: **4.0.2**
445
357
  See [CHANGELOG.md](CHANGELOG.md) for release history.
446
358
 
447
- **What's New in v3.9.0:**
448
- - **Decision Intelligence System** - Three-tier duplicate detection (35-44 gentle nudge, 45-59 hard block, 60+ auto-update)
449
- - **New `suggest` Tool** - Find similar decisions by key, tags, or context
450
- - **Policy-Based Auto-Triggering** - Automatic suggestions when `suggest_similar=1`
451
- - **Enhanced Metadata** - Auto-update responses include `duplicate_reason`, `version_info`, `update_command`
359
+ **What's New in v4.0.2:**
360
+ - **Unified CLI Entry Point** - `npx sqlew db:export` works directly (no `npm install` required)
361
+ - **Cross-DB Migration via JSON Only** - SQL dump no longer supports cross-database conversion
362
+ - **Node.js 20+ Required** - Updated minimum version requirement
363
+
364
+ **What's New in v4.0.0:**
365
+ - **Schema Refactoring** - Unified v4_ table prefix, agent system completely removed
366
+ - **Clean Schema** - No legacy columns, optimized for Decision & Constraint repository
367
+ - **Improved Migration System** - Reorganized v3/v4 directories
452
368
 
453
- See [docs/DECISION_INTELLIGENCE.md](docs/DECISION_INTELLIGENCE.md) for details.
369
+ See [docs/DECISION_INTELLIGENCE.md](docs/DECISION_INTELLIGENCE.md) for details on the suggest tool.
454
370
 
455
371
  ## License
456
372
 
@@ -0,0 +1,13 @@
1
+ ## Plan Mode Integration
2
+
3
+ When `<system-reminder>Plan mode is active</system-reminder>` appears:
4
+
5
+ ### Phase 1 (Research) - Check existing context:
6
+ - `mcp__sqlew__suggest action="by_tags"` - find related decisions
7
+ - `mcp__sqlew__task action="list" status="in_progress"` - check active tasks
8
+
9
+ ### Phase 4 (Final Plan) - Record outcomes:
10
+ - `mcp__sqlew__decision action="set"` - record key architectural decisions
11
+ - `mcp__sqlew__task action="create_batch"` - create implementation tasks
12
+
13
+ **Quick Reference**: `.claude/skills/sqw-plan-guidance/SKILL.md`
@@ -0,0 +1,144 @@
1
+ ---
2
+ allowed-tools: mcp__sqlew, Task, Read, Glob
3
+ description: sqlew context manager - natural language interface for decisions and tasks
4
+ argument-hint: <what you want to do in natural language>
5
+ ---
6
+
7
+ ## sqlew Context Manager
8
+
9
+ You are an intelligent interface for the sqlew MCP server. Analyze user input and execute appropriate actions automatically.
10
+
11
+ **Input**: $ARGUMENTS
12
+
13
+ ---
14
+
15
+ ## If No Arguments Provided
16
+
17
+ Execute status check and suggest next action:
18
+
19
+ ### Step 1: Gather Current Status
20
+
21
+ 1. **Check plan files**: Use Glob to find `.claude/plans/*.md`
22
+ 2. **List decisions**: `mcp__sqlew__decision action="list" limit=5`
23
+ 3. **List tasks**: `mcp__sqlew__task action="list"`
24
+
25
+ ### Step 2: Analyze and Respond
26
+
27
+ Based on the gathered information:
28
+
29
+ | Situation | Action |
30
+ |-----------|--------|
31
+ | Plan exists & No tasks in sqlew | Ask: "Found plan. Create tasks from it?" |
32
+ | Pending/in_progress tasks exist | Ask: "N tasks remaining. Execute them?" → If yes, run parallel |
33
+ | No plan & Tasks exist | Show task status, suggest next action |
34
+ | Nothing exists | Show usage guide |
35
+
36
+ ### Step 3: If User Approves Task Execution
37
+
38
+ 1. Get pending tasks: `mcp__sqlew__task action="list" status="pending"`
39
+ 2. For each task, launch a subagent using Task tool
40
+ 3. After completion, update status: `mcp__sqlew__task action="move" task_id=X status="done"`
41
+
42
+ ---
43
+
44
+ ## If Arguments Provided
45
+
46
+ Analyze the input and determine intent. **CHECK IN THIS ORDER** (priority matters):
47
+
48
+ ### 1. List/Status Intent (CHECK FIRST - highest priority)
49
+ **Keywords**: list, show, status, what, overview, remaining, current, existing, left, pending tasks
50
+
51
+ **Japanese Keywords**: 残り, 残タスク, 書き出, 一覧, 確認, 見せて, 表示
52
+
53
+ **Note**: If input mentions "remaining tasks", "task list", "show tasks" → This is List/Status, NOT Task creation
54
+
55
+ **Action**:
56
+ 1. `mcp__sqlew__decision action="list" limit=10`
57
+ 2. `mcp__sqlew__task action="list"`
58
+ 3. Format as overview
59
+
60
+ ### 2. Search Intent
61
+ **Keywords**: search, find, look for, about, related, explore
62
+
63
+ **Japanese Keywords**: 検索, 探して, 調べて
64
+
65
+ **Action**:
66
+ 1. Extract search term from input
67
+ 2. `mcp__sqlew__suggest action="by_tags" tags=["term"]`
68
+ 3. `mcp__sqlew__decision action="search_tags" tags=["term"]`
69
+ 4. Format and display results
70
+
71
+ ### 3. Record Intent
72
+ **Keywords**: record, add, save, register, decide, decided, decision
73
+
74
+ **Japanese Keywords**: 記録, 登録, 保存
75
+
76
+ **Action**:
77
+ 1. Extract key, value, and rationale from input
78
+ 2. Check for duplicates: `mcp__sqlew__suggest action="check_duplicate" key="key"`
79
+ 3. If no duplicate: `mcp__sqlew__decision action="set" key="key" value="value" rationale="rationale"`
80
+ 4. Confirm what was recorded
81
+
82
+ ### 4. Update Intent
83
+ **Keywords**: update, change, modify, revise
84
+
85
+ **Japanese Keywords**: 更新, 変更, 修正
86
+
87
+ **Action**:
88
+ 1. Extract key and new value from input
89
+ 2. Get existing: `mcp__sqlew__decision action="get" key="key"`
90
+ 3. Update: `mcp__sqlew__decision action="set" key="key" value="new_value"`
91
+ 4. Show before/after
92
+
93
+ ### 5. Execute Intent
94
+ **Keywords**: execute, run, do, proceed, continue, finish
95
+
96
+ **Japanese Keywords**: 実行, 進めて, 続けて, やって
97
+
98
+ **Action**:
99
+ 1. Get pending tasks: `mcp__sqlew__task action="list" status="pending"`
100
+ 2. Confirm with user before execution
101
+ 3. Launch parallel subagents for each task using Task tool
102
+ 4. Update completed tasks to "done"
103
+
104
+ ### 6. Task Creation Intent (CHECK LAST - explicit creation only)
105
+ **Keywords**: create task, make task, breakdown, plan tasks, generate tasks
106
+
107
+ **Japanese Keywords**: タスク作成, タスクを作って, 洗い出し, タスク化
108
+
109
+ **IMPORTANT**: Only trigger this if there's an EXPLICIT creation verb. Do NOT trigger for:
110
+ - "remaining tasks" / "残タスク" → List/Status
111
+ - "task list" / "タスク一覧" → List/Status
112
+ - "show tasks" / "タスクを見せて" → List/Status
113
+
114
+ **Action**:
115
+ 1. Read current plan file if exists
116
+ 2. Parse plan into tasks
117
+ 3. `mcp__sqlew__task action="create_batch" tasks=[...]`
118
+ 4. Confirm what was created
119
+
120
+ ---
121
+
122
+ ## Parallel Task Execution
123
+
124
+ When executing remaining tasks:
125
+
126
+ ```
127
+ For each pending task:
128
+ 1. Use Task tool with subagent_type="general-purpose"
129
+ 2. Provide task description as prompt
130
+ 3. Wait for completion
131
+ 4. Update task status to "done"
132
+ ```
133
+
134
+ Launch multiple Task tools in a single message for parallel execution.
135
+
136
+ ---
137
+
138
+ ## Response Guidelines
139
+
140
+ - Be concise and actionable
141
+ - Always show what was done
142
+ - Suggest logical next step
143
+ - Use bullet points for clarity
144
+ - If uncertain about intent, ask for clarification
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: sqlew-plan-guidance
3
+ description: |
4
+ Quick reference for sqlew MCP tools.
5
+ Provides usage patterns for Plan mode integration.
6
+ ---
7
+
8
+ ## Quick Reference
9
+
10
+ ### Research (Check Existing Context)
11
+
12
+ ```typescript
13
+ mcp__sqlew__suggest action="by_tags" tags=["tag"]
14
+ mcp__sqlew__decision action="search_tags" tags=["tag"]
15
+ mcp__sqlew__task action="list" status="in_progress"
16
+ ```
17
+
18
+ ### Decision Recording
19
+
20
+ ```typescript
21
+ mcp__sqlew__decision action="set"
22
+ key="decision-key"
23
+ value="chosen approach"
24
+ rationale="why this decision was made"
25
+ alternatives_considered="what other options were evaluated"
26
+ tradeoffs="benefits and drawbacks"
27
+ ```
28
+
29
+ ### Task Creation
30
+
31
+ ```typescript
32
+ mcp__sqlew__task action="create_batch" tasks=[
33
+ { title: "Task title", layer: "business", priority: 3, file_actions: [...] }
34
+ ]
35
+ ```
36
+
37
+ ### Constraint Management
38
+
39
+ ```typescript
40
+ mcp__sqlew__constraint action="add"
41
+ category="architecture"
42
+ description="rule description"
43
+ priority=3
44
+ ```
45
+
46
+ ## Tool Selection Guide
47
+
48
+ | Purpose | Tool | Action |
49
+ |---------|------|--------|
50
+ | Find related decisions | suggest | by_tags, by_key |
51
+ | Check for duplicates | suggest | check_duplicate |
52
+ | Record decision | decision | set |
53
+ | Create tasks | task | create, create_batch |
54
+ | Add constraint | constraint | add |
55
+ | List tasks | task | list |
@@ -18,6 +18,10 @@ interface DbDumpArgs {
18
18
  export declare function showDbDumpHelp(): void;
19
19
  /**
20
20
  * Parse command-line arguments for db:dump
21
+ *
22
+ * Supports:
23
+ * - Positional: `db:dump mysql dump.sql`
24
+ * - key=value format: `db:dump to=mysql from=sqlite` (npm/PowerShell friendly)
21
25
  */
22
26
  export declare function parseDbDumpArgs(args: string[]): DbDumpArgs;
23
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"db-dump.d.ts","sourceRoot":"","sources":["../../src/cli/db-dump.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGrG,UAAU,UAAU;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;IACzC,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA2ErC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAiD1D;AA0HD;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAsKnE;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjE"}
1
+ {"version":3,"file":"db-dump.d.ts","sourceRoot":"","sources":["../../src/cli/db-dump.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGrG,UAAU,UAAU;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;IACzC,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8CrC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA2C1D;AA0HD;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAwKnE;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjE"}