sqlew 4.0.5 → 4.1.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 (217) hide show
  1. package/CHANGELOG.md +1817 -1782
  2. package/README.md +409 -468
  3. package/assets/claude-md-snippets/plan-mode-integration.md +17 -6
  4. package/assets/config.example.toml +282 -284
  5. package/assets/sample-agents/README.md +36 -40
  6. package/assets/sample-agents/sqlew-architect.md +321 -322
  7. package/assets/sample-agents/sqlew-researcher.md +292 -293
  8. package/assets/sample-agents/sqlew-scrum-master.md +286 -287
  9. package/assets/sample-commands/README.md +56 -57
  10. package/assets/sample-skills/sqlew-plan-guidance/SKILL.md +33 -26
  11. package/dist/cli/hooks/check-completion.d.ts +19 -0
  12. package/dist/cli/hooks/check-completion.d.ts.map +1 -0
  13. package/dist/cli/hooks/check-completion.js +104 -0
  14. package/dist/cli/hooks/check-completion.js.map +1 -0
  15. package/dist/cli/hooks/init-hooks.d.ts +35 -0
  16. package/dist/cli/hooks/init-hooks.d.ts.map +1 -0
  17. package/dist/cli/hooks/init-hooks.js +425 -0
  18. package/dist/cli/hooks/init-hooks.js.map +1 -0
  19. package/dist/cli/hooks/mark-done.d.ts +25 -0
  20. package/dist/cli/hooks/mark-done.d.ts.map +1 -0
  21. package/dist/cli/hooks/mark-done.js +128 -0
  22. package/dist/cli/hooks/mark-done.js.map +1 -0
  23. package/dist/cli/hooks/plan-id-utils.d.ts +83 -0
  24. package/dist/cli/hooks/plan-id-utils.d.ts.map +1 -0
  25. package/dist/cli/hooks/plan-id-utils.js +183 -0
  26. package/dist/cli/hooks/plan-id-utils.js.map +1 -0
  27. package/dist/cli/hooks/save.d.ts +23 -0
  28. package/dist/cli/hooks/save.d.ts.map +1 -0
  29. package/dist/cli/hooks/save.js +90 -0
  30. package/dist/cli/hooks/save.js.map +1 -0
  31. package/dist/cli/hooks/stdin-parser.d.ts +139 -0
  32. package/dist/cli/hooks/stdin-parser.d.ts.map +1 -0
  33. package/dist/cli/hooks/stdin-parser.js +127 -0
  34. package/dist/cli/hooks/stdin-parser.js.map +1 -0
  35. package/dist/cli/hooks/suggest.d.ts +19 -0
  36. package/dist/cli/hooks/suggest.d.ts.map +1 -0
  37. package/dist/cli/hooks/suggest.js +157 -0
  38. package/dist/cli/hooks/suggest.js.map +1 -0
  39. package/dist/cli/hooks/track-plan.d.ts +36 -0
  40. package/dist/cli/hooks/track-plan.d.ts.map +1 -0
  41. package/dist/cli/hooks/track-plan.js +152 -0
  42. package/dist/cli/hooks/track-plan.js.map +1 -0
  43. package/dist/cli.d.ts.map +1 -1
  44. package/dist/cli.js +56 -16
  45. package/dist/cli.js.map +1 -1
  46. package/dist/config/global-config.d.ts +187 -0
  47. package/dist/config/global-config.d.ts.map +1 -0
  48. package/dist/config/global-config.js +206 -0
  49. package/dist/config/global-config.js.map +1 -0
  50. package/dist/config/loader.d.ts +42 -0
  51. package/dist/config/loader.d.ts.map +1 -1
  52. package/dist/config/loader.js +96 -0
  53. package/dist/config/loader.js.map +1 -1
  54. package/dist/constants.d.ts +4 -0
  55. package/dist/constants.d.ts.map +1 -1
  56. package/dist/constants.js +10 -0
  57. package/dist/constants.js.map +1 -1
  58. package/dist/database/migrations/v4/20251126000000_v4_bootstrap.js +59 -59
  59. package/dist/database/migrations/v4/20251126000000_v4_bootstrap.js.map +1 -1
  60. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js +33 -33
  61. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js.map +1 -1
  62. package/dist/database/migrations/v4/20251127000000_add_rejected_status.js +7 -7
  63. package/dist/database/migrations/v4/20251127000000_add_rejected_status.js.map +1 -1
  64. package/dist/database/migrations/v4/20251127000001_update_task_move_help.js +11 -11
  65. package/dist/database/migrations/v4/20251127000001_update_task_move_help.js.map +1 -1
  66. package/dist/database/migrations/v4/20251127000002_v4_seed_help_system.js +10 -10
  67. package/dist/database/migrations/v4/20251127000002_v4_seed_help_system.js.map +1 -1
  68. package/dist/database/migrations/v4/20251127000003_add_task_notes_column.js +7 -7
  69. package/dist/database/migrations/v4/20251127000003_add_task_notes_column.js.map +1 -1
  70. package/dist/database/migrations/v4/20251128000000_drop_all_views.js +8 -8
  71. package/dist/database/migrations/v4/20251128000000_drop_all_views.js.map +1 -1
  72. package/dist/database/operations/queries.d.ts.map +1 -1
  73. package/dist/database/operations/queries.js +11 -2
  74. package/dist/database/operations/queries.js.map +1 -1
  75. package/dist/index.js +4 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/init-agents.js +0 -1
  78. package/dist/init-agents.js.map +1 -1
  79. package/dist/init-skills.d.ts +4 -3
  80. package/dist/init-skills.d.ts.map +1 -1
  81. package/dist/init-skills.js +10 -3
  82. package/dist/init-skills.js.map +1 -1
  83. package/dist/server/setup.d.ts +8 -0
  84. package/dist/server/setup.d.ts.map +1 -1
  85. package/dist/server/setup.js +141 -21
  86. package/dist/server/setup.js.map +1 -1
  87. package/dist/sync-agents.d.ts.map +1 -1
  88. package/dist/sync-agents.js +48 -3
  89. package/dist/sync-agents.js.map +1 -1
  90. package/dist/sync-commands.d.ts.map +1 -1
  91. package/dist/sync-commands.js +43 -3
  92. package/dist/sync-commands.js.map +1 -1
  93. package/dist/tools/constraints/actions/get.d.ts.map +1 -1
  94. package/dist/tools/constraints/actions/get.js +5 -8
  95. package/dist/tools/constraints/actions/get.js.map +1 -1
  96. package/dist/tools/constraints/help/help.d.ts.map +1 -1
  97. package/dist/tools/constraints/help/help.js +1 -6
  98. package/dist/tools/constraints/help/help.js.map +1 -1
  99. package/dist/tools/context/actions/get.d.ts.map +1 -1
  100. package/dist/tools/context/actions/get.js.map +1 -1
  101. package/dist/tools/context/actions/search-layer.d.ts.map +1 -1
  102. package/dist/tools/context/actions/search-layer.js +5 -3
  103. package/dist/tools/context/actions/search-layer.js.map +1 -1
  104. package/dist/tools/context/actions/set-from-policy.d.ts +2 -1
  105. package/dist/tools/context/actions/set-from-policy.d.ts.map +1 -1
  106. package/dist/tools/context/actions/set-from-policy.js.map +1 -1
  107. package/dist/tools/context/help/help.d.ts.map +1 -1
  108. package/dist/tools/context/help/help.js +1 -7
  109. package/dist/tools/context/help/help.js.map +1 -1
  110. package/dist/tools/context/internal/queries.d.ts.map +1 -1
  111. package/dist/tools/context/internal/queries.js +5 -2
  112. package/dist/tools/context/internal/queries.js.map +1 -1
  113. package/dist/tools/context/types.d.ts +1 -1
  114. package/dist/tools/context/types.d.ts.map +1 -1
  115. package/dist/tools/files/actions/get.d.ts.map +1 -1
  116. package/dist/tools/files/actions/get.js +4 -6
  117. package/dist/tools/files/actions/get.js.map +1 -1
  118. package/dist/tools/files/help/help.d.ts.map +1 -1
  119. package/dist/tools/files/help/help.js +1 -6
  120. package/dist/tools/files/help/help.js.map +1 -1
  121. package/dist/tools/suggest/help/constraint-help.d.ts.map +1 -1
  122. package/dist/tools/suggest/help/constraint-help.js +0 -2
  123. package/dist/tools/suggest/help/constraint-help.js.map +1 -1
  124. package/dist/tools/suggest/internal/constraint-queries.d.ts.map +1 -1
  125. package/dist/tools/suggest/internal/constraint-queries.js +12 -5
  126. package/dist/tools/suggest/internal/constraint-queries.js.map +1 -1
  127. package/dist/tools/suggest/internal/queries.js +2 -2
  128. package/dist/tools/suggest/internal/queries.js.map +1 -1
  129. package/dist/tools/tasks/help/help.d.ts.map +1 -1
  130. package/dist/tools/tasks/help/help.js +0 -6
  131. package/dist/tools/tasks/help/help.js.map +1 -1
  132. package/dist/tools/tasks/help/use-case.d.ts.map +1 -1
  133. package/dist/tools/tasks/help/use-case.js +0 -1
  134. package/dist/tools/tasks/help/use-case.js.map +1 -1
  135. package/dist/tools/tasks/watcher/status.d.ts.map +1 -1
  136. package/dist/tools/tasks/watcher/status.js +5 -1
  137. package/dist/tools/tasks/watcher/status.js.map +1 -1
  138. package/dist/types/decision/params.d.ts +7 -6
  139. package/dist/types/decision/params.d.ts.map +1 -1
  140. package/dist/types/decision/templates.d.ts +3 -2
  141. package/dist/types/decision/templates.d.ts.map +1 -1
  142. package/dist/types/view-entities.d.ts +2 -1
  143. package/dist/types/view-entities.d.ts.map +1 -1
  144. package/dist/types.d.ts +19 -11
  145. package/dist/types.d.ts.map +1 -1
  146. package/dist/types.js +4 -1
  147. package/dist/types.js.map +1 -1
  148. package/dist/utils/enum-converter.d.ts +72 -0
  149. package/dist/utils/enum-converter.d.ts.map +1 -0
  150. package/dist/utils/enum-converter.js +76 -0
  151. package/dist/utils/enum-converter.js.map +1 -0
  152. package/dist/utils/hook-queue.d.ts +81 -0
  153. package/dist/utils/hook-queue.d.ts.map +1 -0
  154. package/dist/utils/hook-queue.js +156 -0
  155. package/dist/utils/hook-queue.js.map +1 -0
  156. package/dist/utils/project-root.d.ts +9 -2
  157. package/dist/utils/project-root.d.ts.map +1 -1
  158. package/dist/utils/project-root.js +16 -2
  159. package/dist/utils/project-root.js.map +1 -1
  160. package/dist/utils/tag-parser.d.ts.map +1 -1
  161. package/dist/utils/tag-parser.js +6 -0
  162. package/dist/utils/tag-parser.js.map +1 -1
  163. package/dist/utils/universal-knex.js +3 -3
  164. package/dist/utils/universal-knex.js.map +1 -1
  165. package/dist/utils/validators.d.ts +1 -1
  166. package/dist/utils/validators.d.ts.map +1 -1
  167. package/dist/utils/validators.js +1 -1
  168. package/dist/utils/validators.js.map +1 -1
  169. package/dist/utils/vcs-adapter.d.ts +44 -0
  170. package/dist/utils/vcs-adapter.d.ts.map +1 -1
  171. package/dist/utils/vcs-adapter.js +88 -0
  172. package/dist/utils/vcs-adapter.js.map +1 -1
  173. package/dist/utils/view-queries.d.ts.map +1 -1
  174. package/dist/utils/view-queries.js +9 -19
  175. package/dist/utils/view-queries.js.map +1 -1
  176. package/dist/watcher/base-watcher.d.ts +69 -0
  177. package/dist/watcher/base-watcher.d.ts.map +1 -0
  178. package/dist/watcher/base-watcher.js +130 -0
  179. package/dist/watcher/base-watcher.js.map +1 -0
  180. package/dist/watcher/index.d.ts +3 -0
  181. package/dist/watcher/index.d.ts.map +1 -1
  182. package/dist/watcher/index.js +2 -0
  183. package/dist/watcher/index.js.map +1 -1
  184. package/dist/watcher/queue-watcher.d.ts +64 -0
  185. package/dist/watcher/queue-watcher.d.ts.map +1 -0
  186. package/dist/watcher/queue-watcher.js +187 -0
  187. package/dist/watcher/queue-watcher.js.map +1 -0
  188. package/docs/ADR_CONCEPTS.md +140 -0
  189. package/docs/CONFIGURATION.md +922 -925
  190. package/docs/CROSS_DATABASE.md +153 -0
  191. package/docs/DATABASE_AUTH.md +70 -356
  192. package/docs/HOOKS_GUIDE.md +159 -0
  193. package/docs/SLASH_COMMANDS.md +329 -337
  194. package/docs/TASK_SYSTEM_DEPRECATED.md +88 -0
  195. package/docs/changelogs/CHANGELOG_ARCHIVE_v3.4_and_older.md +293 -296
  196. package/docs/cli/DATA_EXPORT_IMPORT.md +699 -700
  197. package/docs/cli/README.md +276 -277
  198. package/package.json +123 -124
  199. package/docs/ACCEPTANCE_CRITERIA.md +0 -625
  200. package/docs/AI_AGENT_GUIDE.md +0 -299
  201. package/docs/ARCHITECTURE.md +0 -167
  202. package/docs/AUTO_FILE_TRACKING.md +0 -841
  203. package/docs/BATCH_VALIDATION.md +0 -617
  204. package/docs/BEST_PRACTICES.md +0 -168
  205. package/docs/CONSTRAINT_INTELLIGENCE.md +0 -339
  206. package/docs/DECISION_CONTEXT.md +0 -697
  207. package/docs/DECISION_INTELLIGENCE.md +0 -605
  208. package/docs/GIT_AWARE_AUTO_COMPLETE.md +0 -646
  209. package/docs/MIGRATION_GUIDE_V3.9.0.md +0 -371
  210. package/docs/SHARED_CONCEPTS.md +0 -225
  211. package/docs/SPECIALIZED_AGENTS.md +0 -126
  212. package/docs/TASK_ACTIONS.md +0 -1177
  213. package/docs/TASK_OVERVIEW.md +0 -452
  214. package/docs/TASK_PRUNING.md +0 -594
  215. package/docs/TOOL_REFERENCE.md +0 -1077
  216. package/docs/TOOL_SELECTION.md +0 -83
  217. package/docs/WORKFLOWS.md +0 -941
package/README.md CHANGED
@@ -1,468 +1,409 @@
1
- # sqlew
2
- ![sqlew_logo](assets/sqlew-logo.png)
3
-
4
- [![npm version](https://img.shields.io/npm/v/sqlew.svg)](https://www.npmjs.com/package/sqlew)
5
- [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
-
7
- > **ADR (Architecture Decision Record) for AI Agents** – An MCP server that enables AI agents to create, query, and maintain architecture decision records in a structured SQL database
8
-
9
- ## 🚀 Quick Start: /sqlew Command
10
-
11
- **The `/sqlew` command is the easiest way to use sqlew!** Just type `/sqlew` in Claude Code with natural language input.
12
-
13
- ### Most Common Uses
14
-
15
- ```bash
16
- # Show status and get suggestions
17
- /sqlew
18
-
19
- # Record a decision
20
- /sqlew record we use PostgreSQL 15 for production database
21
-
22
- # Search past decisions
23
- /sqlew search why we chose Knex for migrations
24
-
25
- # List remaining tasks
26
- /sqlew show remaining tasks
27
-
28
- # Plan a new feature (breakdown into tasks)
29
- /sqlew plan implementing user authentication
30
- ```
31
-
32
- The `/sqlew` command automatically detects your intent (search, record, list, execute, task creation) and invokes the appropriate MCP tools.
33
-
34
- ---
35
-
36
- ## What is sqlew?
37
-
38
- **sqlew** is a Model Context Protocol (MCP) server that brings ADR (Architecture Decision Record) capabilities to AI agents through a shared SQL-backed repository.
39
-
40
- ### The Problem: AI Agents Lack Decision Memory
41
- Every AI session starts with zero context. Agents must re-learn architectural decisions, can reintroduce previously rejected patterns, and have no systematic way to understand WHY past choices were made.
42
-
43
- Traditional ADR approaches use Markdown files scattered across repositories. While human-readable, this format creates challenges for AI agents:
44
- - **No structured querying** – AI must read entire files to find relevant decisions
45
- - **Context explosion** Token costs grow linearly with decision history
46
- - **No duplicate detection** – AI cannot easily identify similar or conflicting decisions
47
- - **Poor discoverability** – Finding related decisions requires full-text search across many files
48
-
49
- ### *sqlew* brings structured ADR to AI agents
50
- sqlew transforms ADR from static documentation into a **queryable, AI-native decision database**:
51
-
52
- - **Structured records** – Decisions stored as relational data with metadata, tags, and relationships
53
- - **Efficient querying** AI agents retrieve only relevant decisions via SQL queries
54
- - **Smart suggestions** Three-tier similarity system detects duplicate or related decisions
55
- - **Constraint tracking** – Architectural rules and principles as first-class entities
56
- - **Task integration** – Link decisions to implementation tasks and affected files
57
-
58
- > *This software does not send any data to external networks. We NEVER collect any data or usage statistics. Please use it with complete security.*
59
-
60
- ## Concept: ADR (Architecture Decision Record) for AI Agents
61
-
62
- **Architecture Decision Records (ADR)** document the architectural decisions made on a project, including context, consequences, and alternatives considered. sqlew extends this proven pattern to AI agents.
63
-
64
- ### Core ADR Concepts in sqlew
65
-
66
- **Decisions** capture architectural choices with full context:
67
- - **What** was decided (the decision itself)
68
- - **Why** it was chosen (rationale, trade-offs)
69
- - **What else** was considered (alternatives rejected)
70
- - **Impact** on the system (consequences, affected components)
71
-
72
- **Constraints** define architectural principles and rules:
73
- - **Performance requirements** (response time limits, throughput goals)
74
- - **Technology choices** ("must use PostgreSQL", "avoid microservices")
75
- - **Coding standards** ("async/await only", "no any types")
76
- - **Security policies** (authentication patterns, data handling rules)
77
-
78
- **Implementation tracking** connects decisions to reality:
79
- - **Tasks** link decisions to actual implementation work
80
- - **File tracking** shows which code was affected by decisions
81
- - **Status evolution** tracks decision lifecycle (draft active deprecated)
82
-
83
- ### Why SQL for ADR?
84
-
85
- Traditional text-based ADR forces AI to:
86
- - Read complete files even for simple queries
87
- - Parse unstructured text to find relationships
88
- - Manually detect duplicate or conflicting decisions
89
-
90
- sqlew's **SQL-backed ADR repository** enables AI to:
91
- - Query by layer, tags, status in milliseconds (2-50ms)
92
- - Join decisions with constraints, tasks, and files
93
- - Leverage similarity algorithms to prevent duplicates
94
- - Scale to thousands of decisions without context explosion
95
-
96
- **Token efficiency**: 60-75% reduction compared to reading Markdown ADRs
97
-
98
- ### Why RDBMS + MCP for ADR?
99
-
100
- **RDBMS (Relational Database)** provides efficient structured queries:
101
- - **Indexed searches** – Find decisions by tags/layers in milliseconds, not seconds
102
- - **JOIN operations** Query related decisions, constraints, and tasks in a single operation
103
- - **Transaction support** – ACID guarantees ensure data integrity across concurrent AI agents
104
- - **Scalability** – Handle thousands of ADRs without performance degradation
105
-
106
- **MCP (Model Context Protocol)** enables seamless AI integration:
107
- - **Direct tool access** – AI agents call ADR operations as native functions
108
- - **Token efficiency** Retrieve only required data, avoiding full-file reads
109
- - **Type safety** – Structured parameters prevent errors and guide correct usage
110
- - **Cross-session persistence** – ADRs survive beyond individual chat sessions
111
-
112
- **Together**: AI agents gain SQL-powered ADR capabilities without managing databases directly.
113
-
114
- ## Why Use sqlew?
115
-
116
- ### 🏛️ ADR Made AI-Native
117
- Traditional ADR approaches weren't designed for AI agents. sqlew reimagines ADR for the AI era:
118
-
119
- | Traditional ADR (Markdown) | sqlew ADR (SQL) |
120
- |---------------------------|-----------------|
121
- | Read entire files | Query specific decisions |
122
- | Manual duplicate checking | Automatic similarity detection |
123
- | Text parsing required | Structured, typed data |
124
- | Linear token scaling | Constant-time lookups |
125
- | File-based organization | Relational queries with JOINs |
126
-
127
- ### 🎯 Key Benefits for AI-Driven Development
128
-
129
- #### 📚 **Persistent Architectural Memory**
130
- - **Zero context loss** – AI agents remember every architectural decision across sessions
131
- - **Rationale preservation** Never forget WHY a decision was made, not just WHAT
132
- - **Alternative tracking** – Document rejected options to prevent circular debates
133
- - **Evolution history** – See how decisions changed over time with full version history
134
-
135
- #### 🛡️ **Prevent Architectural Drift**
136
- - **Constraint enforcement** – Define architectural rules once, AI follows them forever
137
- - **Pattern consistency** – AI generates code matching established patterns automatically
138
- - **Anti-pattern prevention** – Document "what NOT to do" as enforceable constraints
139
- - **Regression prevention** – AI won't reintroduce previously rejected approaches
140
-
141
- #### 🔍 **Intelligent Decision Discovery**
142
- - **Similarity detection** – AI identifies duplicate or related decisions before creating new ones
143
- - **Context-aware search** – Query by layer, tags, or relationships to find relevant decisions
144
- - **Impact analysis** Trace which files and tasks are affected by each decision
145
- - **Conflict detection** – Find decisions that contradict or supersede each other
146
-
147
- #### 📊 **Implementation Transparency**
148
- - **Decision-to-task linking** Track implementation status of architectural choices
149
- - **File impact tracking** – See exactly which code implements each decision
150
- - **Status lifecycle** – Draft → Active → Deprecated → Superseded transitions
151
- - **Progress visibility** Monitor which ADRs are implemented, which are pending
152
-
153
- #### ⚡ **Extreme Efficiency**
154
- - **60-75% token reduction** – Query only relevant decisions instead of reading all ADRs
155
- - **Millisecond queries** – 2-50ms response times even with thousands of decisions
156
- - **Scalable architecture** – Perform well with large decision histories
157
- - **Production-ready** 495/495 tests passing (100%), battle-tested on real projects
158
-
159
- ---
160
-
161
- **Technical Features**: 8 MCP tools (5 core: decision, constraint, task, file, suggest + 3 utility: help, example, use_case), three-tier similarity detection (0-100 point scoring), ACID transaction support, multi-database backend (SQLite/PostgreSQL/MySQL), metadata-driven organization with layers and tags
162
-
163
- See [docs/DECISION_CONTEXT.md](docs/DECISION_CONTEXT.md) for ADR data model details.
164
-
165
- ### 🔖Kanban-style AI Scrum
166
- ![kanban-style task management](assets/kanban-visualizer.png)
167
-
168
- (This visualizer is not included in this package)
169
-
170
- ## Installation
171
-
172
- ### Requirements
173
- - Node.js 20.0.0 or higher
174
- - npm or npx
175
-
176
- ### Quick Install
177
-
178
- on `.mcp.json` in your project's root, add these lines:
179
-
180
- ```json
181
- {
182
- "mcpServers": {
183
- "sqlew": {
184
- "command": "npx",
185
- "args": ["sqlew"]
186
- }
187
- }
188
- }
189
- ```
190
- **Recommend to restart claude after initialize**
191
-
192
- The first time, sqlew initializes database, installs custom agents and slash commands. But agents and commands are not loaded in this time. So, please exit claude once, and restart claude again.
193
-
194
- It's Ready!
195
-
196
- **⚠️Note**: Global install (`npm install -g`) is **not recommended** because sqlew requires an independent settings per project. Each project should maintain its own context database in `.sqlew/sqlew.db`.
197
-
198
- **Custom database path:** Add path as argument: `"args": ["sqlew", "/path/to/db.db"]`
199
- **Default location:** `.sqlew/sqlew.db`
200
-
201
- **⚠️ Not Supported:** Junie AI cannot use relative paths in MCP server configurations, which makes it incompatible with sqlew's project-based database model. Each project requires its own isolated database at `.sqlew/sqlew.db`, but Junie AI's global MCP configuration cannot handle per-project database paths.
202
-
203
- ## Configuration
204
-
205
- ### Database Support
206
-
207
- sqlew supports multiple database backends for different deployment scenarios:
208
-
209
- | Database | Use Case | Status |
210
- |----------|----------------------------------------------|-------------|
211
- | **SQLite** | Personal or small projects | ✅ Default |
212
- | **MySQL 8.0 / MariaDB 10+** | Production, shared environments, remote work | ✅ Supported |
213
- | **PostgreSQL 12+** | Production, shared environments, remote work | ✅ Supported |
214
-
215
- Of course, it also works with Docker RDB instances.
216
-
217
- ### Optional Config File
218
-
219
- On first run, `.sqlew/config.toml` will be created for persistent settings:
220
-
221
- **SQLite (Default):**
222
- ```toml
223
- [database]
224
- path = ".sqlew/custom.db"
225
-
226
- [autodelete]
227
- ignore_weekend = true
228
- message_hours = 48
229
- ```
230
-
231
- **PostgreSQL:**
232
- ```toml
233
- [database]
234
- type = "postgres"
235
-
236
- [database.connection]
237
- host = "localhost"
238
- port = 5432
239
- database = "sqlew_db"
240
-
241
- [database.auth]
242
- type = "direct"
243
- user = "sqlew_user"
244
- password = "secret"
245
- ```
246
-
247
- **MySQL/MariaDB:**
248
- ```toml
249
- [database]
250
- type = "mysql"
251
-
252
- [database.connection]
253
- host = "localhost"
254
- port = 3306
255
- database = "sqlew_db"
256
-
257
- [database.auth]
258
- type = "direct"
259
- user = "sqlew_user"
260
- password = "secret"
261
- ```
262
-
263
- Also `.sqlew/config.example.toml` is created for reference.
264
-
265
- **Settings Priority:** CLI args > config.toml > database defaults
266
-
267
- See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for all options and validation rules.
268
-
269
- ### CLI Configuration (Recommended)
270
-
271
- Configuration is managed via **`.sqlew/config.toml`** file and **CLI arguments only**. The MCP `config` tool has been removed for simplicity.
272
-
273
- **Why CLI-only configuration?**
274
- - **No drift:** Single source of truth (config file)
275
- - **Version control:** Commit config to git, share with team
276
- - **Clear documentation:** Config file documents project requirements
277
- - **Type safety:** TOML validation catches errors at startup
278
-
279
- **Common CLI arguments:**
280
- ```bash
281
- # Custom database path
282
- npx sqlew /path/to/database.db
283
-
284
- # Auto-deletion settings
285
- npx sqlew --autodelete-message-hours=48
286
- npx sqlew --autodelete-file-history-days=30
287
- npx sqlew --autodelete-ignore-weekend
288
-
289
- # Custom config file
290
- npx sqlew --config-path=.sqlew/custom.toml
291
- ```
292
-
293
- For persistent settings, edit `.sqlew/config.toml` instead of using CLI arguments.
294
-
295
- ## Quick Start
296
-
297
- install it, launch claude, exit claude and launch Claude again.
298
-
299
- ### Basic Usage
300
-
301
- You'll never need to call it manually, I recommend to call this tool via prompt.
302
-
303
- ```
304
- read sqlew usecases, and plan implementation of feature X using sqlew.
305
- ```
306
-
307
- or invoke Specialized Agent
308
-
309
- ```
310
- /sqw-plan implementation of feature X .
311
- ```
312
-
313
- Specialized Agents use sqlew more efficiently.
314
-
315
- ---
316
-
317
- **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.
318
-
319
- ### Advanced: Direct MCP Tool Access
320
-
321
- Power users can still call MCP tools directly. See [Available Tools](#available-tools) section below.
322
-
323
- ### Available Tools
324
-
325
- #### Core ADR Tools
326
-
327
- | Tool | Purpose | Example Use |
328
- |------|---------|------------|
329
- | **decision** | Record architectural decisions with context | "We chose PostgreSQL over MongoDB (ACID requirement)" |
330
- | **constraint** | Define architectural rules and principles | "All API endpoints must use /v2/ prefix" |
331
- | **task** | Track implementation of decisions | "Implement JWT authentication" |
332
- | **file** | Track code changes linked to decisions | "Modified auth.ts per security ADR" |
333
- | **suggest** | Find similar decisions, prevent duplicates | Duplicate detection, similarity search |
334
-
335
- #### Utility Tools
336
-
337
- | Tool | Purpose | Example Use |
338
- |------|---------|------------|
339
- | **help** | Query action documentation and parameters | Get decision.set parameters |
340
- | **example** | Browse code examples by tool/action | Find task.create examples |
341
- | **use_case** | Complete workflow scenarios | Multi-step ADR workflows |
342
-
343
-
344
- ## Documentation
345
-
346
- Each tool supports `action: "help"` for full documentation and `action: "example"` for comprehensive usage examples.
347
-
348
- And `action: "use_case"` shows how to use the tool in a real-world scenario.
349
-
350
- ### On-Demand Documentation
351
-
352
- All tools support:
353
- - `action: "help"` - Parameter reference and descriptions
354
- - `action: "example"` - Usage scenarios and examples
355
- - `action: "use_case"` - Real-world usage examples
356
-
357
- ### For AI Agents
358
-
359
- **Essential Guides:**
360
- - [Tool Selection](docs/TOOL_SELECTION.md) - Decision tree, when to use each tool
361
- - [Workflows](docs/WORKFLOWS.md) - Multi-step examples, multi-agent coordination
362
- - [Tool Reference](docs/TOOL_REFERENCE.md) - Parameters, batch operations, templates
363
- - [Best Practices](docs/BEST_PRACTICES.md) - Common errors, troubleshooting
364
-
365
- **Task System:**
366
- - [Task Overview](docs/TASK_OVERVIEW.md) - Lifecycle, status transitions
367
- - [Task Actions](docs/TASK_ACTIONS.md) - All actions with examples
368
- - [Task Dependencies](docs/TASK_DEPENDENCIES.md) - Blocking relationships
369
- - [Task Linking](docs/TASK_LINKING.md) - Link to decisions/constraints/files
370
- - [Task Migration](docs/TASK_MIGRATION.md) - Migrate from decision-based tracking
371
-
372
- **Advanced Features:**
373
- - [Decision Intelligence](docs/DECISION_INTELLIGENCE.md) - Three-tier duplicate detection (v3.9.0)
374
- - [Decision Context](docs/DECISION_CONTEXT.md) - Rich decision documentation
375
- - [Auto File Tracking](docs/AUTO_FILE_TRACKING.md) - Zero-token task management
376
- - [Acceptance Criteria](docs/ACCEPTANCE_CRITERIA.md) - All check types
377
-
378
- **Reference:**
379
- - [Shared Concepts](docs/SHARED_CONCEPTS.md) - Layer definitions, enum values
380
- - [Configuration](docs/CONFIGURATION.md) - Config file setup, all options
381
- - [Architecture](docs/ARCHITECTURE.md) - Technical architecture
382
-
383
- ### Advanced Usage
384
-
385
- - [Configuration Guide](docs/CONFIGURATION.md) - TOML config file setup
386
- - [CLI Mode Overview](docs/cli/README.md) - Database migration, export/import commands
387
- - [Building from Source](docs/ARCHITECTURE.md#development) - Setup instructions
388
- - [Migration Guides](docs/MIGRATION_v2.md) - Version upgrade guides
389
-
390
- ## Use Cases
391
-
392
- ### ADR-Driven Development with AI
393
- - **Architecture Evolution** – Document major architectural decisions with full context and alternatives
394
- - **Pattern Standardization** – Establish coding patterns as constraints, enforce via AI code generation
395
- - **Technical Debt Tracking** – Record temporary decisions with deprecation paths and future plans
396
- - **Onboarding Acceleration** – New AI sessions instantly understand architectural history
397
-
398
- ### Cross-Session AI Workflows
399
- - **Multi-Session Projects** – AI maintains context across days/weeks without re-reading documentation
400
- - **Multi-Agent Coordination** – Multiple AI agents share architectural understanding through ADR database
401
- - **Breaking Change Management** – Document API changes, deprecations, and migration paths systematically
402
- - **Refactoring Guidance** – AI references past decisions to maintain architectural consistency during refactors
403
-
404
- ### Real-World Examples
405
- ```bash
406
- # Document an architectural decision with alternatives
407
- /sqlew record we use PostgreSQL over MongoDB. MongoDB was rejected due to lack of ACID transactions for our financial data requirements.
408
-
409
- # Search for past decisions before making new ones
410
- /sqlew search why did we choose JWT authentication
411
-
412
- # Create constraint to guide AI code generation
413
- /sqlew add constraint all API endpoints must use /v2/ prefix for versioning
414
-
415
- # Plan implementation of a decision
416
- /sqlew plan implementing the PostgreSQL connection pool with pgBouncer
417
- ```
418
-
419
- See [docs/WORKFLOWS.md](docs/WORKFLOWS.md) for detailed multi-step examples.
420
-
421
- ## Performance
422
-
423
- - **Query speed**: 2-50ms
424
- - **Concurrent agents**: 5+ simultaneous
425
- - **Storage efficiency**: ~140 bytes per decision
426
- - **Token savings**: 60-75% in typical projects
427
-
428
- ## Support
429
-
430
- Support development via [GitHub Sponsors](https://github.com/sponsors/sin5ddd) - One-time or monthly options available.
431
-
432
- ## Version
433
-
434
- Current version: **4.0.2**
435
- See [CHANGELOG.md](CHANGELOG.md) for release history.
436
-
437
- **What's New in v4.0.2:**
438
- - **Unified CLI Entry Point** - `npx sqlew db:export` works directly (no `npm install` required)
439
- - **Cross-DB Migration via JSON Only** - SQL dump no longer supports cross-database conversion
440
- - **Node.js 20+ Required** - Updated minimum version requirement
441
-
442
- **What's New in v4.0.0:**
443
- - **Schema Refactoring** - Unified v4_ table prefix, agent system completely removed
444
- - **Clean Schema** - No legacy columns, optimized for Decision & Constraint repository
445
- - **Improved Migration System** - Reorganized v3/v4 directories
446
-
447
- See [docs/DECISION_INTELLIGENCE.md](docs/DECISION_INTELLIGENCE.md) for details on the suggest tool.
448
-
449
- ## License
450
-
451
- Apache License 2.0 - Free for commercial and personal use. See [LICENSE](LICENSE) for details.
452
-
453
- ## Links
454
-
455
- - [npm package](https://www.npmjs.com/package/sqlew)
456
- - [GitHub repository](https://github.com/sin5ddd/mcp-sqlew)
457
- - [Model Context Protocol](https://modelcontextprotocol.io/)
458
-
459
- ## Support & Documentation
460
-
461
- - Issues: [GitHub Issues](https://github.com/sin5ddd/mcp-sqlew/issues)
462
- - Docs: [docs/](docs/) directory
463
-
464
- ## Acknowledgments
465
-
466
- Built with [Model Context Protocol SDK](https://github.com/modelcontextprotocol/sdk), [better-sqlite3](https://github.com/WiseLibs/better-sqlite3), and TypeScript.
467
-
468
- **Author**: sin5ddd
1
+ # sqlew
2
+ ![sqlew_logo](assets/sqlew-logo.png)
3
+
4
+ [![npm version](https://img.shields.io/npm/v/sqlew.svg)](https://www.npmjs.com/package/sqlew)
5
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
+
7
+ > **ADR (Architecture Decision Record) for AI Agents** – An MCP server that enables AI agents to create, query, and maintain architecture decision records in a structured SQL database
8
+
9
+ ## 🚀 Quick Start
10
+
11
+ ### 1. Install globally (Recommended)
12
+
13
+ ```bash
14
+ npm install -g sqlew
15
+ ```
16
+
17
+ ### 2. Add to your MCP config
18
+
19
+ Add to `.mcp.json` in your project root:
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "sqlew": {
25
+ "command": "sqlew"
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ ### 3. Initialize hooks
32
+
33
+ ```bash
34
+ sqlew init --hooks
35
+ ```
36
+
37
+ ### 4. Just use Plan Mode!
38
+
39
+ **That's it!** Now every time you:
40
+ 1. Create a plan in Claude Code
41
+ 2. Get user approval (ExitPlanMode)
42
+
43
+ Your architectural decisions are **automatically recorded** as ADR knowledge.
44
+
45
+ No special commands needed. Just plan your work normally, and sqlew captures the decisions in the background.
46
+
47
+ ### Optional: /sqlew command
48
+
49
+ For manual queries and explicit decision recording:
50
+
51
+ ```bash
52
+ /sqlew # Show status
53
+ /sqlew search auth # Search past decisions
54
+ /sqlew record use Redis # Record a decision manually
55
+ ```
56
+
57
+ ---
58
+
59
+ ## What is sqlew?
60
+
61
+ **sqlew** is a Model Context Protocol (MCP) server that brings ADR (Architecture Decision Record) capabilities to AI agents through a shared SQL-backed repository.
62
+
63
+ ### The Problem: AI Agents Lack Decision Memory
64
+ Every AI session starts with zero context. Agents must re-learn architectural decisions, can reintroduce previously rejected patterns, and have no systematic way to understand WHY past choices were made.
65
+
66
+ Traditional ADR approaches use Markdown files scattered across repositories. While human-readable, this format creates challenges for AI agents:
67
+ - **No structured querying** AI must read entire files to find relevant decisions
68
+ - **Context explosion** Token costs grow linearly with decision history
69
+ - **No duplicate detection** AI cannot easily identify similar or conflicting decisions
70
+ - **Poor discoverability** Finding related decisions requires full-text search across many files
71
+
72
+ ### *sqlew* brings structured ADR to AI agents
73
+ sqlew transforms ADR from static documentation into a **queryable, AI-native decision database**:
74
+
75
+ - **Structured records** Decisions stored as relational data with metadata, tags, and relationships
76
+ - **Efficient querying** AI agents retrieve only relevant decisions via SQL queries
77
+ - **Smart suggestions** – Three-tier similarity system detects duplicate or related decisions
78
+ - **Constraint tracking** Architectural rules and principles as first-class entities
79
+ - **Auto-capture** Claude Code Hooks automatically record decisions from Plan Mode
80
+
81
+ > *This software does not send any data to external networks. We NEVER collect any data or usage statistics. Please use it with complete security.*
82
+
83
+ ## Why sqlew?
84
+
85
+ AI agents automatically accumulate project knowledge through Plan Mode. Decisions are stored in SQL for efficient querying.
86
+
87
+ **Perfect for:**
88
+ - 🏢 Large-scale projects with many architectural decisions
89
+ - 🔧 Long-term maintenance where context must persist across sessions
90
+ - 👥 Team environments where multiple AI agents share knowledge
91
+
92
+ **Key benefits:**
93
+ - **60-75% token reduction** vs reading Markdown ADRs
94
+ - 🔍 **Millisecond queries** (2-50ms) even with thousands of decisions
95
+ - 🛡️ **Duplicate prevention** via similarity detection
96
+ - 📚 **Persistent memory** across all AI sessions
97
+
98
+ See [ADR Concepts](docs/ADR_CONCEPTS.md) for detailed architecture.
99
+
100
+ ---
101
+
102
+ **Technical Features**: 7 MCP tools (4 core: decision, constraint, file, suggest + 3 utility: help, example, use_case), three-tier similarity detection (0-100 point scoring), ACID transaction support, multi-database backend (SQLite/PostgreSQL/MySQL), metadata-driven organization with layers and tags
103
+
104
+
105
+ ## Installation
106
+
107
+ ### Requirements
108
+ - Node.js 20.0.0 or higher
109
+ - npm or npx
110
+
111
+ ### Recommended: Global Install
112
+
113
+ ```bash
114
+ npm install -g sqlew
115
+ ```
116
+
117
+ > **Why global install?** Claude Code Hooks call `sqlew` directly from shell. Global install ensures hooks work correctly without npx overhead.
118
+
119
+ Then add to `.mcp.json` in your project root:
120
+
121
+ ```json
122
+ {
123
+ "mcpServers": {
124
+ "sqlew": {
125
+ "command": "sqlew"
126
+ }
127
+ }
128
+ }
129
+ ```
130
+
131
+ ### Alternative: npx (No Install)
132
+
133
+ ```json
134
+ {
135
+ "mcpServers": {
136
+ "sqlew": {
137
+ "command": "npx",
138
+ "args": ["sqlew"]
139
+ }
140
+ }
141
+ }
142
+ ```
143
+
144
+ **Note**: First run initializes the database. Restart Claude Code to load the MCP server.
145
+
146
+ Each project maintains its own context database in `.sqlew/sqlew.db`.
147
+
148
+ **Custom database path:** Add path as argument: `"args": ["sqlew", "/path/to/db.db"]`
149
+ **Default location:** `.sqlew/sqlew.db`
150
+
151
+ **⚠️ Not Supported:** Junie AI cannot use relative paths in MCP server configurations, which makes it incompatible with sqlew's project-based database model. Each project requires its own isolated database at `.sqlew/sqlew.db`, but Junie AI's global MCP configuration cannot handle per-project database paths.
152
+
153
+ ## Configuration
154
+
155
+ ### Database Support
156
+
157
+ sqlew supports multiple database backends for different deployment scenarios:
158
+
159
+ | Database | Use Case | Status |
160
+ |----------|----------------------------------------------|-------------|
161
+ | **SQLite** | Personal or small projects | Default |
162
+ | **MySQL 8.0 / MariaDB 10+** | Production, shared environments, remote work | ✅ Supported |
163
+ | **PostgreSQL 12+** | Production, shared environments, remote work | ✅ Supported |
164
+
165
+ Of course, it also works with Docker RDB instances.
166
+
167
+ ### Optional Config File
168
+
169
+ On first run, `.sqlew/config.toml` will be created for persistent settings:
170
+
171
+ **SQLite (Default):**
172
+ ```toml
173
+ [database]
174
+ path = ".sqlew/custom.db"
175
+
176
+ [autodelete]
177
+ ignore_weekend = true
178
+ message_hours = 48
179
+ ```
180
+
181
+ **PostgreSQL:**
182
+ ```toml
183
+ [database]
184
+ type = "postgres"
185
+
186
+ [database.connection]
187
+ host = "localhost"
188
+ port = 5432
189
+ database = "sqlew_db"
190
+
191
+ [database.auth]
192
+ type = "direct"
193
+ user = "sqlew_user"
194
+ password = "secret"
195
+ ```
196
+
197
+ **MySQL/MariaDB:**
198
+ ```toml
199
+ [database]
200
+ type = "mysql"
201
+
202
+ [database.connection]
203
+ host = "localhost"
204
+ port = 3306
205
+ database = "sqlew_db"
206
+
207
+ [database.auth]
208
+ type = "direct"
209
+ user = "sqlew_user"
210
+ password = "secret"
211
+ ```
212
+
213
+ Also `.sqlew/config.example.toml` is created for reference.
214
+
215
+ **Settings Priority:** CLI args > config.toml > database defaults
216
+
217
+ See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for all options and validation rules.
218
+
219
+ ### CLI Configuration (Recommended)
220
+
221
+ Configuration is managed via **`.sqlew/config.toml`** file and **CLI arguments only**. The MCP `config` tool has been removed for simplicity.
222
+
223
+ **Why CLI-only configuration?**
224
+ - **No drift:** Single source of truth (config file)
225
+ - **Version control:** Commit config to git, share with team
226
+ - **Clear documentation:** Config file documents project requirements
227
+ - **Type safety:** TOML validation catches errors at startup
228
+
229
+ **Common CLI arguments:**
230
+ ```bash
231
+ # Custom database path
232
+ npx sqlew /path/to/database.db
233
+
234
+ # Auto-deletion settings
235
+ npx sqlew --autodelete-message-hours=48
236
+ npx sqlew --autodelete-file-history-days=30
237
+ npx sqlew --autodelete-ignore-weekend
238
+
239
+ # Custom config file
240
+ npx sqlew --config-path=.sqlew/custom.toml
241
+ ```
242
+
243
+ For persistent settings, edit `.sqlew/config.toml` instead of using CLI arguments.
244
+
245
+ ## Quick Start
246
+
247
+ install it, launch claude, exit claude and launch Claude again.
248
+
249
+ ### Basic Usage
250
+
251
+ You'll never need to call it manually, I recommend to call this tool via prompt.
252
+
253
+ ```
254
+ read sqlew usecases, and plan implementation of feature X using sqlew.
255
+ ```
256
+
257
+ or invoke Specialized Agent
258
+
259
+ ```
260
+ /sqw-plan implementation of feature X .
261
+ ```
262
+
263
+ Specialized Agents use sqlew more efficiently.
264
+
265
+ ---
266
+
267
+ **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.
268
+
269
+ ### Advanced: Direct MCP Tool Access
270
+
271
+ Power users can still call MCP tools directly. See [Available Tools](#available-tools) section below.
272
+
273
+ ### Available Tools
274
+
275
+ #### Core ADR Tools
276
+
277
+ | Tool | Purpose | Example Use |
278
+ |------|---------|------------|
279
+ | **decision** | Record architectural decisions with context | "We chose PostgreSQL over MongoDB (ACID requirement)" |
280
+ | **constraint** | Define architectural rules and principles | "All API endpoints must use /v2/ prefix" |
281
+ | **file** | Track code changes linked to decisions | "Modified auth.ts per security ADR" |
282
+ | **suggest** | Find similar decisions, prevent duplicates | Duplicate detection, similarity search |
283
+
284
+ #### Utility Tools
285
+
286
+ | Tool | Purpose | Example Use |
287
+ |------|---------|------------|
288
+ | **help** | Query action documentation and parameters | Get decision.set parameters |
289
+ | **example** | Browse code examples by tool/action | Find task.create examples |
290
+ | **use_case** | Complete workflow scenarios | Multi-step ADR workflows |
291
+
292
+
293
+ ## Documentation
294
+
295
+ Each tool supports `action: "help"` for full documentation and `action: "example"` for comprehensive usage examples.
296
+
297
+ And `action: "use_case"` shows how to use the tool in a real-world scenario.
298
+
299
+ ### On-Demand Documentation
300
+
301
+ All tools support:
302
+ - `action: "help"` - Parameter reference and descriptions
303
+ - `action: "example"` - Usage scenarios and examples
304
+ - `action: "use_case"` - Real-world usage examples
305
+
306
+ ### For AI Agents
307
+
308
+ **Essential Guides:**
309
+
310
+ **Advanced Features:**
311
+ - [Hooks Guide](docs/HOOKS_GUIDE.md) - Claude Code Hooks integration
312
+ - [Cross Database](docs/CROSS_DATABASE.md) - Multi-database support
313
+
314
+ **Reference:**
315
+ - [Configuration](docs/CONFIGURATION.md) - Config file setup, all options
316
+
317
+ ### Advanced Usage
318
+
319
+ - [Configuration Guide](docs/CONFIGURATION.md) - TOML config file setup
320
+ - [CLI Mode Overview](docs/cli/README.md) - Database migration, export/import commands
321
+ - [Migration Guides](docs/MIGRATION_v2.md) - Version upgrade guides
322
+
323
+ ## Use Cases
324
+
325
+ ### ADR-Driven Development with AI
326
+ - **Architecture Evolution** – Document major architectural decisions with full context and alternatives
327
+ - **Pattern Standardization** Establish coding patterns as constraints, enforce via AI code generation
328
+ - **Technical Debt Tracking** – Record temporary decisions with deprecation paths and future plans
329
+ - **Onboarding Acceleration** New AI sessions instantly understand architectural history
330
+
331
+ ### Cross-Session AI Workflows
332
+ - **Multi-Session Projects** AI maintains context across days/weeks without re-reading documentation
333
+ - **Multi-Agent Coordination** Multiple AI agents share architectural understanding through ADR database
334
+ - **Breaking Change Management** – Document API changes, deprecations, and migration paths systematically
335
+ - **Refactoring Guidance** – AI references past decisions to maintain architectural consistency during refactors
336
+
337
+ ### Real-World Examples
338
+ ```bash
339
+ # Document an architectural decision with alternatives
340
+ /sqlew record we use PostgreSQL over MongoDB. MongoDB was rejected due to lack of ACID transactions for our financial data requirements.
341
+
342
+ # Search for past decisions before making new ones
343
+ /sqlew search why did we choose JWT authentication
344
+
345
+ # Create constraint to guide AI code generation
346
+ /sqlew add constraint all API endpoints must use /v2/ prefix for versioning
347
+
348
+ # Plan implementation of a decision
349
+ /sqlew plan implementing the PostgreSQL connection pool with pgBouncer
350
+ ```
351
+
352
+
353
+ ## Performance
354
+
355
+ - **Query speed**: 2-50ms
356
+ - **Concurrent agents**: 5+ simultaneous
357
+ - **Storage efficiency**: ~140 bytes per decision
358
+ - **Token savings**: 60-75% in typical projects
359
+
360
+ ## Support
361
+
362
+ Support development via [GitHub Sponsors](https://github.com/sponsors/sin5ddd) - One-time or monthly options available.
363
+
364
+ ## Version
365
+
366
+ Current version: **4.1.0**
367
+ See [CHANGELOG.md](CHANGELOG.md) for release history.
368
+
369
+ **What's New in v4.1.0:**
370
+ - **Claude Code Hooks Integration** - File Queue Architecture for async decision operations
371
+ - **Hook Commands** - `suggest`, `track-plan`, `save`, `check-completion`, `mark-done`
372
+ - **QueueWatcher** - Monitors `.sqlew/queue/pending.json` for hook operations
373
+ - **PostgreSQL Compatibility** - GROUP_CONCAT string_agg, GROUP BY strictness fixes
374
+ - **Cross-DB Verified** - SQLite, MySQL, MariaDB, PostgreSQL all tested
375
+
376
+ **What's New in v4.0.5:**
377
+ - **License Change** - Apache License 2.0 (from AGPL-3.0)
378
+
379
+ **What's New in v4.0.2:**
380
+ - **Unified CLI Entry Point** - `npx sqlew db:export` works directly (no `npm install` required)
381
+ - **Cross-DB Migration via JSON Only** - SQL dump no longer supports cross-database conversion
382
+ - **Node.js 20+ Required** - Updated minimum version requirement
383
+
384
+ See [docs/HOOKS_GUIDE.md](docs/HOOKS_GUIDE.md) for Claude Code Hooks details.
385
+
386
+ ## License
387
+
388
+ Apache License 2.0 - Free for commercial and personal use. See [LICENSE](LICENSE) for details.
389
+
390
+ ## Links
391
+
392
+ - [npm package](https://www.npmjs.com/package/sqlew)
393
+ - [GitHub repository](https://github.com/sin5ddd/mcp-sqlew)
394
+ - [Model Context Protocol](https://modelcontextprotocol.io/)
395
+
396
+ ## Support & Documentation
397
+
398
+ - Issues: [GitHub Issues](https://github.com/sin5ddd/mcp-sqlew/issues)
399
+ - Docs: [docs/](docs/) directory
400
+
401
+ ## Acknowledgments
402
+
403
+ Built with [Model Context Protocol SDK](https://github.com/modelcontextprotocol/sdk), [better-sqlite3](https://github.com/WiseLibs/better-sqlite3), and TypeScript.
404
+
405
+ **Author**: sin5ddd
406
+
407
+ ---
408
+
409
+ <!-- Git Hooks Integration Test: 2025-12-22 - This line tests post-merge hook triggering mark-done --auto -->