sqlew 4.0.4 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1805 -1762
- package/LICENSE +177 -39
- package/NOTICE +24 -0
- package/README.md +409 -390
- package/assets/claude-md-snippets/plan-mode-integration.md +17 -6
- package/assets/config.example.toml +282 -284
- package/assets/sample-agents/README.md +36 -40
- package/assets/sample-agents/sqlew-architect.md +321 -322
- package/assets/sample-agents/sqlew-researcher.md +292 -293
- package/assets/sample-agents/sqlew-scrum-master.md +286 -287
- package/assets/sample-commands/README.md +56 -57
- package/assets/sample-skills/sqlew-plan-guidance/SKILL.md +33 -26
- package/dist/cli/hooks/check-completion.d.ts +19 -0
- package/dist/cli/hooks/check-completion.d.ts.map +1 -0
- package/dist/cli/hooks/check-completion.js +104 -0
- package/dist/cli/hooks/check-completion.js.map +1 -0
- package/dist/cli/hooks/init-hooks.d.ts +35 -0
- package/dist/cli/hooks/init-hooks.d.ts.map +1 -0
- package/dist/cli/hooks/init-hooks.js +425 -0
- package/dist/cli/hooks/init-hooks.js.map +1 -0
- package/dist/cli/hooks/mark-done.d.ts +25 -0
- package/dist/cli/hooks/mark-done.d.ts.map +1 -0
- package/dist/cli/hooks/mark-done.js +128 -0
- package/dist/cli/hooks/mark-done.js.map +1 -0
- package/dist/cli/hooks/plan-id-utils.d.ts +83 -0
- package/dist/cli/hooks/plan-id-utils.d.ts.map +1 -0
- package/dist/cli/hooks/plan-id-utils.js +183 -0
- package/dist/cli/hooks/plan-id-utils.js.map +1 -0
- package/dist/cli/hooks/save.d.ts +23 -0
- package/dist/cli/hooks/save.d.ts.map +1 -0
- package/dist/cli/hooks/save.js +90 -0
- package/dist/cli/hooks/save.js.map +1 -0
- package/dist/cli/hooks/stdin-parser.d.ts +139 -0
- package/dist/cli/hooks/stdin-parser.d.ts.map +1 -0
- package/dist/cli/hooks/stdin-parser.js +127 -0
- package/dist/cli/hooks/stdin-parser.js.map +1 -0
- package/dist/cli/hooks/suggest.d.ts +19 -0
- package/dist/cli/hooks/suggest.d.ts.map +1 -0
- package/dist/cli/hooks/suggest.js +157 -0
- package/dist/cli/hooks/suggest.js.map +1 -0
- package/dist/cli/hooks/track-plan.d.ts +36 -0
- package/dist/cli/hooks/track-plan.d.ts.map +1 -0
- package/dist/cli/hooks/track-plan.js +152 -0
- package/dist/cli/hooks/track-plan.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -16
- package/dist/cli.js.map +1 -1
- package/dist/config/global-config.d.ts +187 -0
- package/dist/config/global-config.d.ts.map +1 -0
- package/dist/config/global-config.js +206 -0
- package/dist/config/global-config.js.map +1 -0
- package/dist/config/loader.d.ts +42 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +96 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -1
- package/dist/database/operations/queries.d.ts.map +1 -1
- package/dist/database/operations/queries.js +11 -2
- package/dist/database/operations/queries.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/init-agents.js +0 -1
- package/dist/init-agents.js.map +1 -1
- package/dist/init-skills.d.ts +4 -3
- package/dist/init-skills.d.ts.map +1 -1
- package/dist/init-skills.js +10 -3
- package/dist/init-skills.js.map +1 -1
- package/dist/server/setup.d.ts +8 -0
- package/dist/server/setup.d.ts.map +1 -1
- package/dist/server/setup.js +141 -21
- package/dist/server/setup.js.map +1 -1
- package/dist/sync-agents.d.ts.map +1 -1
- package/dist/sync-agents.js +48 -3
- package/dist/sync-agents.js.map +1 -1
- package/dist/sync-commands.d.ts.map +1 -1
- package/dist/sync-commands.js +43 -3
- package/dist/sync-commands.js.map +1 -1
- package/dist/tools/constraints/actions/get.d.ts.map +1 -1
- package/dist/tools/constraints/actions/get.js +5 -8
- package/dist/tools/constraints/actions/get.js.map +1 -1
- package/dist/tools/constraints/help/help.d.ts.map +1 -1
- package/dist/tools/constraints/help/help.js +1 -6
- package/dist/tools/constraints/help/help.js.map +1 -1
- package/dist/tools/context/actions/get.d.ts.map +1 -1
- package/dist/tools/context/actions/get.js.map +1 -1
- package/dist/tools/context/actions/search-layer.d.ts.map +1 -1
- package/dist/tools/context/actions/search-layer.js +5 -3
- package/dist/tools/context/actions/search-layer.js.map +1 -1
- package/dist/tools/context/actions/set-from-policy.d.ts +2 -1
- package/dist/tools/context/actions/set-from-policy.d.ts.map +1 -1
- package/dist/tools/context/actions/set-from-policy.js.map +1 -1
- package/dist/tools/context/help/help.d.ts.map +1 -1
- package/dist/tools/context/help/help.js +1 -7
- package/dist/tools/context/help/help.js.map +1 -1
- package/dist/tools/context/internal/queries.d.ts.map +1 -1
- package/dist/tools/context/internal/queries.js +5 -2
- package/dist/tools/context/internal/queries.js.map +1 -1
- package/dist/tools/context/types.d.ts +1 -1
- package/dist/tools/context/types.d.ts.map +1 -1
- package/dist/tools/files/actions/get.d.ts.map +1 -1
- package/dist/tools/files/actions/get.js +4 -6
- package/dist/tools/files/actions/get.js.map +1 -1
- package/dist/tools/files/help/help.d.ts.map +1 -1
- package/dist/tools/files/help/help.js +1 -6
- package/dist/tools/files/help/help.js.map +1 -1
- package/dist/tools/suggest/help/constraint-help.d.ts.map +1 -1
- package/dist/tools/suggest/help/constraint-help.js +0 -2
- package/dist/tools/suggest/help/constraint-help.js.map +1 -1
- package/dist/tools/suggest/internal/constraint-queries.d.ts.map +1 -1
- package/dist/tools/suggest/internal/constraint-queries.js +12 -5
- package/dist/tools/suggest/internal/constraint-queries.js.map +1 -1
- package/dist/tools/suggest/internal/queries.js +2 -2
- package/dist/tools/suggest/internal/queries.js.map +1 -1
- package/dist/tools/tasks/help/help.d.ts.map +1 -1
- package/dist/tools/tasks/help/help.js +0 -6
- package/dist/tools/tasks/help/help.js.map +1 -1
- package/dist/tools/tasks/help/use-case.d.ts.map +1 -1
- package/dist/tools/tasks/help/use-case.js +0 -1
- package/dist/tools/tasks/help/use-case.js.map +1 -1
- package/dist/tools/tasks/watcher/status.d.ts.map +1 -1
- package/dist/tools/tasks/watcher/status.js +5 -1
- package/dist/tools/tasks/watcher/status.js.map +1 -1
- package/dist/types/decision/params.d.ts +7 -6
- package/dist/types/decision/params.d.ts.map +1 -1
- package/dist/types/decision/templates.d.ts +3 -2
- package/dist/types/decision/templates.d.ts.map +1 -1
- package/dist/types/view-entities.d.ts +2 -1
- package/dist/types/view-entities.d.ts.map +1 -1
- package/dist/types.d.ts +19 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/enum-converter.d.ts +72 -0
- package/dist/utils/enum-converter.d.ts.map +1 -0
- package/dist/utils/enum-converter.js +76 -0
- package/dist/utils/enum-converter.js.map +1 -0
- package/dist/utils/hook-queue.d.ts +81 -0
- package/dist/utils/hook-queue.d.ts.map +1 -0
- package/dist/utils/hook-queue.js +156 -0
- package/dist/utils/hook-queue.js.map +1 -0
- package/dist/utils/project-root.d.ts +9 -2
- package/dist/utils/project-root.d.ts.map +1 -1
- package/dist/utils/project-root.js +16 -2
- package/dist/utils/project-root.js.map +1 -1
- package/dist/utils/tag-parser.d.ts.map +1 -1
- package/dist/utils/tag-parser.js +6 -0
- package/dist/utils/tag-parser.js.map +1 -1
- package/dist/utils/validators.d.ts +1 -1
- package/dist/utils/validators.d.ts.map +1 -1
- package/dist/utils/validators.js +1 -1
- package/dist/utils/validators.js.map +1 -1
- package/dist/utils/vcs-adapter.d.ts +44 -0
- package/dist/utils/vcs-adapter.d.ts.map +1 -1
- package/dist/utils/vcs-adapter.js +88 -0
- package/dist/utils/vcs-adapter.js.map +1 -1
- package/dist/utils/view-queries.d.ts.map +1 -1
- package/dist/utils/view-queries.js +9 -19
- package/dist/utils/view-queries.js.map +1 -1
- package/dist/watcher/base-watcher.d.ts +69 -0
- package/dist/watcher/base-watcher.d.ts.map +1 -0
- package/dist/watcher/base-watcher.js +130 -0
- package/dist/watcher/base-watcher.js.map +1 -0
- package/dist/watcher/index.d.ts +3 -0
- package/dist/watcher/index.d.ts.map +1 -1
- package/dist/watcher/index.js +2 -0
- package/dist/watcher/index.js.map +1 -1
- package/dist/watcher/queue-watcher.d.ts +64 -0
- package/dist/watcher/queue-watcher.d.ts.map +1 -0
- package/dist/watcher/queue-watcher.js +187 -0
- package/dist/watcher/queue-watcher.js.map +1 -0
- package/docs/ADR_CONCEPTS.md +140 -0
- package/docs/CONFIGURATION.md +922 -925
- package/docs/CROSS_DATABASE.md +153 -0
- package/docs/DATABASE_AUTH.md +70 -356
- package/docs/HOOKS_GUIDE.md +159 -0
- package/docs/SLASH_COMMANDS.md +329 -337
- package/docs/TASK_SYSTEM_DEPRECATED.md +88 -0
- package/docs/changelogs/CHANGELOG_ARCHIVE_v3.4_and_older.md +293 -296
- package/docs/cli/DATA_EXPORT_IMPORT.md +699 -700
- package/docs/cli/README.md +276 -277
- package/package.json +123 -119
- package/docs/ACCEPTANCE_CRITERIA.md +0 -625
- package/docs/AI_AGENT_GUIDE.md +0 -198
- package/docs/ARCHITECTURE.md +0 -167
- package/docs/AUTO_FILE_TRACKING.md +0 -841
- package/docs/BATCH_VALIDATION.md +0 -617
- package/docs/BEST_PRACTICES.md +0 -168
- package/docs/CONSTRAINT_INTELLIGENCE.md +0 -339
- package/docs/DECISION_CONTEXT.md +0 -675
- package/docs/DECISION_INTELLIGENCE.md +0 -605
- package/docs/GIT_AWARE_AUTO_COMPLETE.md +0 -646
- package/docs/MIGRATION_GUIDE_V3.9.0.md +0 -371
- package/docs/SHARED_CONCEPTS.md +0 -225
- package/docs/SPECIALIZED_AGENTS.md +0 -126
- package/docs/TASK_ACTIONS.md +0 -1177
- package/docs/TASK_OVERVIEW.md +0 -452
- package/docs/TASK_PRUNING.md +0 -594
- package/docs/TOOL_REFERENCE.md +0 -1077
- package/docs/TOOL_SELECTION.md +0 -83
- package/docs/WORKFLOWS.md +0 -941
package/docs/AI_AGENT_GUIDE.md
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
# AI Agent Guide for MCP sqlew
|
|
2
|
-
|
|
3
|
-
**Quick Reference for Claude Code and other AI agents using sqlew (v4.0.0+)**
|
|
4
|
-
|
|
5
|
-
## Most Important Rule
|
|
6
|
-
|
|
7
|
-
**ALWAYS include the `action` parameter in EVERY tool call.** This is the #1 cause of errors.
|
|
8
|
-
|
|
9
|
-
```javascript
|
|
10
|
-
// WRONG - Missing action
|
|
11
|
-
{
|
|
12
|
-
key: "some_key",
|
|
13
|
-
value: "some value"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// CORRECT - action parameter present
|
|
17
|
-
{
|
|
18
|
-
action: "set",
|
|
19
|
-
key: "some_key",
|
|
20
|
-
value: "some value"
|
|
21
|
-
}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Quick Start
|
|
27
|
-
|
|
28
|
-
### Basic Decision Workflow
|
|
29
|
-
|
|
30
|
-
```javascript
|
|
31
|
-
// 1. Set a decision
|
|
32
|
-
{
|
|
33
|
-
action: "set",
|
|
34
|
-
key: "auth_method",
|
|
35
|
-
value: "jwt",
|
|
36
|
-
layer: "business",
|
|
37
|
-
tags: ["security", "authentication"]
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// 2. Get the decision
|
|
41
|
-
{
|
|
42
|
-
action: "get",
|
|
43
|
-
key: "auth_method"
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// 3. List decisions with filters
|
|
47
|
-
{
|
|
48
|
-
action: "list",
|
|
49
|
-
status: "active",
|
|
50
|
-
layer: "business"
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## When to Use Each Tool
|
|
57
|
-
|
|
58
|
-
| Tool | Use For | Key Feature |
|
|
59
|
-
|------|---------|-------------|
|
|
60
|
-
| **decision** | Recording choices made | Version history tracking |
|
|
61
|
-
| **constraint** | Requirements & rules | Category-based organization |
|
|
62
|
-
| **task** | Work tracking (TODO) | Kanban status, dependencies |
|
|
63
|
-
| **file** | File change tracking | Layer-based organization |
|
|
64
|
-
| **stats** | Metrics & cleanup | Aggregated views |
|
|
65
|
-
|
|
66
|
-
### Decision vs Constraint vs Task
|
|
67
|
-
|
|
68
|
-
| Concept | Definition | Example |
|
|
69
|
-
|---------|------------|---------|
|
|
70
|
-
| **Decision** | A choice that WAS made | "We chose JWT authentication" |
|
|
71
|
-
| **Constraint** | A requirement that MUST be followed | "Response time must be <100ms" |
|
|
72
|
-
| **Task** | Work that NEEDS to be done | "Implement JWT authentication" |
|
|
73
|
-
|
|
74
|
-
### Quick Scenario
|
|
75
|
-
|
|
76
|
-
```javascript
|
|
77
|
-
// 1. Record decision
|
|
78
|
-
{ action: "set", key: "api_change", value: "Moved to /v2/users", layer: "presentation", tags: ["api"] }
|
|
79
|
-
|
|
80
|
-
// 2. Add constraint
|
|
81
|
-
{ action: "add", category: "architecture", constraint_text: "All API endpoints must include version prefix", layer: "presentation" }
|
|
82
|
-
|
|
83
|
-
// 3. Create task
|
|
84
|
-
{ action: "create", title: "Migrate clients to /v2/users", layer: "presentation", tags: ["migration"] }
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Common Errors & Solutions
|
|
90
|
-
|
|
91
|
-
### Error: "Unknown action: undefined"
|
|
92
|
-
|
|
93
|
-
**Cause**: Missing `action` parameter
|
|
94
|
-
|
|
95
|
-
```javascript
|
|
96
|
-
// WRONG
|
|
97
|
-
{ key: "some_key", value: "some value" }
|
|
98
|
-
|
|
99
|
-
// CORRECT
|
|
100
|
-
{ action: "set", key: "some_key", value: "some value" }
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Error: "Invalid layer"
|
|
104
|
-
|
|
105
|
-
**Valid layers** (9 total):
|
|
106
|
-
- `presentation`, `business`, `data`, `infrastructure`, `cross-cutting`
|
|
107
|
-
- `documentation`, `planning`, `coordination`, `review`
|
|
108
|
-
|
|
109
|
-
### Error: "Invalid status"
|
|
110
|
-
|
|
111
|
-
**Valid decision statuses**: `active`, `deprecated`, `draft`
|
|
112
|
-
|
|
113
|
-
**Valid task statuses**: `pending`, `in_progress`, `blocked`, `on_hold`, `completed`
|
|
114
|
-
|
|
115
|
-
### Error: "Batch operations are limited to 50 items maximum"
|
|
116
|
-
|
|
117
|
-
**Solution**: Split into multiple batches of ≤50 items each
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Key Parameters Quick Reference
|
|
122
|
-
|
|
123
|
-
### decision tool
|
|
124
|
-
|
|
125
|
-
| Action | Required | Optional |
|
|
126
|
-
|--------|----------|----------|
|
|
127
|
-
| **set** | action, key, value, layer | version, status, tags, scopes |
|
|
128
|
-
| **get** | action, key | version |
|
|
129
|
-
| **list** | action | status, layer, tags, limit |
|
|
130
|
-
|
|
131
|
-
### task tool
|
|
132
|
-
|
|
133
|
-
| Action | Required | Optional |
|
|
134
|
-
|--------|----------|----------|
|
|
135
|
-
| **create** | action, title | description, priority, layer, tags, status |
|
|
136
|
-
| **move** | action, task_id, status | - |
|
|
137
|
-
| **list** | action | status, layer, tags, limit |
|
|
138
|
-
|
|
139
|
-
### constraint tool
|
|
140
|
-
|
|
141
|
-
| Action | Required | Optional |
|
|
142
|
-
|--------|----------|----------|
|
|
143
|
-
| **add** | action, category, constraint_text | priority, layer, tags |
|
|
144
|
-
| **get** | action | category, layer, active_only |
|
|
145
|
-
|
|
146
|
-
> **Full parameter reference**: See [TOOL_REFERENCE.md](TOOL_REFERENCE.md)
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## Best Practices Summary
|
|
151
|
-
|
|
152
|
-
1. **Always include `action` parameter** - #1 error source
|
|
153
|
-
2. **Use `atomic: false` for batch operations** - Avoid all-or-nothing failures
|
|
154
|
-
3. **Always specify `layer`** - Required for organization
|
|
155
|
-
4. **Use meaningful tags** - Critical for searchability
|
|
156
|
-
5. **Use `status` (not `new_status`)** for task.move action
|
|
157
|
-
|
|
158
|
-
> **Detailed best practices**: See [BEST_PRACTICES.md](BEST_PRACTICES.md)
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## Built-In Documentation
|
|
163
|
-
|
|
164
|
-
All tools provide built-in help with zero token cost:
|
|
165
|
-
|
|
166
|
-
```javascript
|
|
167
|
-
// Get detailed help for any tool
|
|
168
|
-
{ action: "help" }
|
|
169
|
-
|
|
170
|
-
// Get comprehensive examples
|
|
171
|
-
{ action: "example" }
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## Related Documentation
|
|
177
|
-
|
|
178
|
-
| Document | Content |
|
|
179
|
-
|----------|---------|
|
|
180
|
-
| [TOOL_REFERENCE.md](TOOL_REFERENCE.md) | Complete parameter reference |
|
|
181
|
-
| [WORKFLOWS.md](WORKFLOWS.md) | Multi-step workflow examples |
|
|
182
|
-
| [BEST_PRACTICES.md](BEST_PRACTICES.md) | Detailed best practices |
|
|
183
|
-
| [DECISION_INTELLIGENCE.md](DECISION_INTELLIGENCE.md) | Decision duplicate detection |
|
|
184
|
-
| [CONSTRAINT_INTELLIGENCE.md](CONSTRAINT_INTELLIGENCE.md) | Constraint duplicate detection |
|
|
185
|
-
| [BATCH_VALIDATION.md](BATCH_VALIDATION.md) | Batch operations guide |
|
|
186
|
-
| [ARCHITECTURE.md](ARCHITECTURE.md) | System architecture |
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## Most Common Mistakes
|
|
191
|
-
|
|
192
|
-
1. **Missing `action` parameter** ← #1 error!
|
|
193
|
-
2. Invalid layer/status values
|
|
194
|
-
3. Forgetting to specify `layer` when setting decisions
|
|
195
|
-
4. Using `atomic: true` by default in batch operations
|
|
196
|
-
5. Using `new_status` instead of `status` for task.move
|
|
197
|
-
|
|
198
|
-
**When in doubt**: Call `{action: "help"}` or `{action: "example"}`!
|
package/docs/ARCHITECTURE.md
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
# sqlew Architecture Documentation
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
sqlew (SQL Efficient Workflow) is an MCP server designed to achieve **72% token reduction** in context sharing between Claude Code agents through intelligent database design and metadata-driven architecture. **Version 4.0.0** introduces a major schema refactoring with unified v4_ table prefix and action-based MCP tool architecture.
|
|
6
|
-
|
|
7
|
-
## Core Design Principles
|
|
8
|
-
|
|
9
|
-
### 1. Token Efficiency Strategy
|
|
10
|
-
|
|
11
|
-
The 72% token reduction is achieved through five key strategies:
|
|
12
|
-
|
|
13
|
-
| Strategy | Description | Savings |
|
|
14
|
-
|----------|-------------|---------|
|
|
15
|
-
| **ID-Based Normalization** | Store strings once in master tables, reference by integer IDs | ~50% |
|
|
16
|
-
| **Integer Enums** | Replace string values with integers (status, priority, etc.) | 70-75% |
|
|
17
|
-
| **Pre-Aggregated Views** | Eliminate need for multiple joins in client code | ~85% |
|
|
18
|
-
| **Type-Based Separation** | Separate tables for numeric vs string values | ~50% |
|
|
19
|
-
| **Automatic Cleanup** | Prevent database bloat via triggers | N/A |
|
|
20
|
-
|
|
21
|
-
### 2. Metadata-Driven Classification
|
|
22
|
-
|
|
23
|
-
sqlew organizes data through five metadata dimensions:
|
|
24
|
-
|
|
25
|
-
| Dimension | Purpose | Example |
|
|
26
|
-
|-----------|---------|---------|
|
|
27
|
-
| **Tags** | Flexible cross-cutting categorization | authentication, security, api |
|
|
28
|
-
| **Layers** | Architecture layer organization (9 layers) | business, data, infrastructure |
|
|
29
|
-
| **Scopes** | Module/component-level organization | user-service, api-gateway |
|
|
30
|
-
| **Versions** | Automatic version history tracking | 1.0.0, 1.1.0 |
|
|
31
|
-
| **Priority** | Importance levels (1-4) | low, medium, high, critical |
|
|
32
|
-
|
|
33
|
-
### 3. Layer System (v4.0)
|
|
34
|
-
|
|
35
|
-
9 layers organized by file requirement:
|
|
36
|
-
|
|
37
|
-
**FILE_REQUIRED (6 layers):**
|
|
38
|
-
- presentation, business, data, infrastructure, cross-cutting, documentation
|
|
39
|
-
|
|
40
|
-
**FILE_OPTIONAL (3 layers):**
|
|
41
|
-
- planning, coordination, review
|
|
42
|
-
|
|
43
|
-
### 4. Data Integrity
|
|
44
|
-
|
|
45
|
-
- **Foreign Key Constraints**: All relationships enforced via SQLite
|
|
46
|
-
- **Transaction Guarantees**: ACID properties, WAL mode for concurrency
|
|
47
|
-
- **Auto-Registration Pattern**: Master records auto-created on first use
|
|
48
|
-
|
|
49
|
-
## Database Schema (v4.0)
|
|
50
|
-
|
|
51
|
-
All tables use unified `v4_` prefix. For detailed schema, see `src/database/migrations/v4/`.
|
|
52
|
-
|
|
53
|
-
### Master Tables (Normalization)
|
|
54
|
-
|
|
55
|
-
| Table | Purpose |
|
|
56
|
-
|-------|---------|
|
|
57
|
-
| `v4_files` | Normalize file paths |
|
|
58
|
-
| `v4_context_keys` | Normalize decision keys |
|
|
59
|
-
| `v4_layers` | Architecture layers (9 seeded) |
|
|
60
|
-
| `v4_tags` | Categorization tags (10 seeded, auto-expandable) |
|
|
61
|
-
| `v4_scopes` | Module/component scopes |
|
|
62
|
-
| `v4_constraint_categories` | Constraint types (performance, architecture, security) |
|
|
63
|
-
| `v4_task_statuses` | Task status types (pending, in_progress, completed, blocked, on_hold) |
|
|
64
|
-
| `v4_config` | Configuration storage |
|
|
65
|
-
|
|
66
|
-
### Transaction Tables (Core Data)
|
|
67
|
-
|
|
68
|
-
| Table | Purpose |
|
|
69
|
-
|-------|---------|
|
|
70
|
-
| `v4_decisions` | Store decisions with layer, status, version |
|
|
71
|
-
| `v4_decision_history` | Version history for all decision changes |
|
|
72
|
-
| `v4_decision_context` | Decision context (rationale, alternatives, tradeoffs) |
|
|
73
|
-
| `v4_file_changes` | Track file modifications with layer |
|
|
74
|
-
| `v4_constraints` | Project constraints with priority |
|
|
75
|
-
| `v4_tasks` | Task management with kanban-style status |
|
|
76
|
-
|
|
77
|
-
### Relationship Tables
|
|
78
|
-
|
|
79
|
-
| Table | Purpose |
|
|
80
|
-
|-------|---------|
|
|
81
|
-
| `v4_decision_tags` | Decision ↔ Tags (many-to-many) |
|
|
82
|
-
| `v4_decision_scopes` | Decision ↔ Scopes (many-to-many) |
|
|
83
|
-
| `v4_task_file_links` | Task ↔ Files with action types |
|
|
84
|
-
| `v4_task_dependencies` | Task dependencies with circular detection |
|
|
85
|
-
|
|
86
|
-
### Pre-Aggregated Views
|
|
87
|
-
|
|
88
|
-
| View | Purpose |
|
|
89
|
-
|------|---------|
|
|
90
|
-
| `v4_tagged_decisions` | Decisions with all metadata (tags, layers, scopes) |
|
|
91
|
-
| `v4_layer_summary` | Per-layer aggregated statistics |
|
|
92
|
-
| `v4_recent_file_changes` | Recent file changes with metadata |
|
|
93
|
-
| `v4_tagged_constraints` | Constraints with category and layer |
|
|
94
|
-
| `v4_task_board` | Kanban-style task view with dependencies |
|
|
95
|
-
|
|
96
|
-
## MCP Tool Architecture
|
|
97
|
-
|
|
98
|
-
### Action-Based Tool System (v4.0)
|
|
99
|
-
|
|
100
|
-
6 consolidated action-based MCP tools:
|
|
101
|
-
|
|
102
|
-
| Tool | Purpose | Key Actions |
|
|
103
|
-
|------|---------|-------------|
|
|
104
|
-
| **decision** | Decision context management | set, get, list, search, versions |
|
|
105
|
-
| **file** | File change tracking | record, get, check_lock |
|
|
106
|
-
| **constraint** | Constraint management | add, get, deactivate |
|
|
107
|
-
| **task** | Task management with dependencies | create, update, move, link, list |
|
|
108
|
-
| **help** | Documentation queries | query_action, query_tool, workflow_hints |
|
|
109
|
-
| **suggest** | Decision intelligence | by_key, by_tags, check_duplicate |
|
|
110
|
-
|
|
111
|
-
All tools support `action: "help"` for in-tool documentation.
|
|
112
|
-
|
|
113
|
-
## Performance Characteristics
|
|
114
|
-
|
|
115
|
-
### Query Performance
|
|
116
|
-
|
|
117
|
-
| Operation | Avg Time |
|
|
118
|
-
|-----------|----------|
|
|
119
|
-
| decision.set | 2-5 ms |
|
|
120
|
-
| decision.get | 5-15 ms |
|
|
121
|
-
| file.record | 2-4 ms |
|
|
122
|
-
| task.create | 3-7 ms |
|
|
123
|
-
|
|
124
|
-
### Database Size
|
|
125
|
-
|
|
126
|
-
- **Empty:** ~28 KB (schema + seed data)
|
|
127
|
-
- **Growth Rate:** ~140 bytes/decision (linear)
|
|
128
|
-
|
|
129
|
-
### Concurrent Access
|
|
130
|
-
|
|
131
|
-
- **WAL Mode:** Enabled for read/write concurrency
|
|
132
|
-
- **Busy Timeout:** 5000ms
|
|
133
|
-
|
|
134
|
-
## File Structure
|
|
135
|
-
|
|
136
|
-
| Component | Location |
|
|
137
|
-
|-----------|----------|
|
|
138
|
-
| MCP Server | `src/index.ts` |
|
|
139
|
-
| Database Init | `src/database/initialization/` |
|
|
140
|
-
| Migrations | `src/database/migrations/v4/` |
|
|
141
|
-
| Tool Implementations | `src/tools/` |
|
|
142
|
-
| Types | `src/types.ts` |
|
|
143
|
-
| Constants | `src/constants.ts` |
|
|
144
|
-
|
|
145
|
-
## Known Limitations
|
|
146
|
-
|
|
147
|
-
1. **No Semantic Search:** Delegated to specialized tools like Serena
|
|
148
|
-
2. **Single Project Scope:** Not multi-tenant
|
|
149
|
-
3. **No Authentication:** Trust-based (local MCP server)
|
|
150
|
-
4. **No Network Access:** Offline-only operation
|
|
151
|
-
|
|
152
|
-
## Version History
|
|
153
|
-
|
|
154
|
-
| Version | Key Changes |
|
|
155
|
-
|---------|-------------|
|
|
156
|
-
| **v4.0.0** | Unified v4_ prefix, agent system removed, 6 action-based tools, 9 layers |
|
|
157
|
-
| v3.9.0 | Decision Intelligence System, suggestion policies |
|
|
158
|
-
| v3.8.0 | Layer expansion (5→9), file_actions parameter |
|
|
159
|
-
| v3.0.0 | Kanban task system, 7-tool consolidation |
|
|
160
|
-
| v2.0 | Action-based API, 96% token reduction |
|
|
161
|
-
|
|
162
|
-
## Related Documentation
|
|
163
|
-
|
|
164
|
-
- [SHARED_CONCEPTS.md](SHARED_CONCEPTS.md) - Common concepts across tools
|
|
165
|
-
- [TOOL_REFERENCE.md](TOOL_REFERENCE.md) - Complete tool parameter reference
|
|
166
|
-
- [CONFIGURATION.md](CONFIGURATION.md) - Configuration options
|
|
167
|
-
- [TASK_OVERVIEW.md](TASK_OVERVIEW.md) - Task management overview
|