autosnippet 3.0.3 → 3.0.6
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/README.md +85 -240
- package/dashboard/dist/assets/{icons-Cdq22n2i.js → icons-eQ_rWCus.js} +97 -102
- package/dashboard/dist/assets/index-B3Nnkdxi.js +133 -0
- package/dashboard/dist/assets/index-BFNDAqh3.css +1 -0
- package/dashboard/dist/index.html +3 -3
- package/lib/core/AstAnalyzer.js +2 -2
- package/lib/core/ast/ensure-grammars.js +2 -0
- package/lib/core/ast/index.js +8 -0
- package/lib/core/ast/lang-rust.js +695 -0
- package/lib/core/discovery/PythonDiscoverer.js +3 -0
- package/lib/core/discovery/RustDiscoverer.js +467 -0
- package/lib/core/discovery/index.js +3 -0
- package/lib/core/enhancement/django-enhancement.js +169 -3
- package/lib/core/enhancement/fastapi-enhancement.js +149 -3
- package/lib/core/enhancement/go-grpc-enhancement.js +4 -0
- package/lib/core/enhancement/go-web-enhancement.js +6 -0
- package/lib/core/enhancement/index.js +5 -0
- package/lib/core/enhancement/langchain-enhancement.js +233 -0
- package/lib/core/enhancement/ml-enhancement.js +265 -0
- package/lib/core/enhancement/nextjs-enhancement.js +219 -0
- package/lib/core/enhancement/node-server-enhancement.js +178 -4
- package/lib/core/enhancement/react-enhancement.js +165 -4
- package/lib/core/enhancement/rust-tokio-enhancement.js +231 -0
- package/lib/core/enhancement/rust-web-enhancement.js +256 -0
- package/lib/core/enhancement/spring-enhancement.js +2 -0
- package/lib/core/enhancement/vue-enhancement.js +143 -2
- package/lib/external/ai/AiProvider.js +45 -6
- package/lib/external/mcp/handlers/bootstrap/skills.js +2 -0
- package/lib/external/mcp/handlers/bootstrap.js +33 -9
- package/lib/external/mcp/handlers/guard.js +42 -0
- package/lib/http/routes/candidates.js +7 -1
- package/lib/service/chat/ChatAgent.js +1 -0
- package/lib/service/chat/tools.js +5 -1
- package/lib/service/guard/ComplianceReporter.js +20 -7
- package/lib/service/guard/GuardCheckEngine.js +156 -5
- package/lib/service/guard/SourceFileCollector.js +15 -0
- package/package.json +28 -6
- package/skills/autosnippet-coldstart/SKILL.md +4 -2
- package/skills/autosnippet-concepts/SKILL.md +5 -3
- package/skills/autosnippet-reference-rust/SKILL.md +401 -0
- package/skills/autosnippet-structure/SKILL.md +1 -1
- package/templates/recipes-setup/README.md +2 -2
- package/templates/recipes-setup/_template.md +1 -1
- package/dashboard/dist/assets/index-ClkyPkDX.js +0 -133
- package/dashboard/dist/assets/index-t4QrJwv1.css +0 -1
package/README.md
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# AutoSnippet
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Capture code patterns, best practices, and architecture decisions as a structured knowledge base.
|
|
8
|
-
Then let Cursor, Copilot, Trae, Qoder, Xcode, and VS Code generate code that follows *your* standards.
|
|
5
|
+
Extract code patterns from your codebase into a knowledge base, and serve them to AI coding assistants in your IDE — so generated code actually follows your team's conventions.
|
|
9
6
|
|
|
10
7
|
[](https://www.npmjs.com/package/autosnippet)
|
|
11
8
|
[](https://github.com/GxFn/AutoSnippet/blob/main/LICENSE)
|
|
@@ -17,56 +14,38 @@ Then let Cursor, Copilot, Trae, Qoder, Xcode, and VS Code generate code that fol
|
|
|
17
14
|
|
|
18
15
|
---
|
|
19
16
|
|
|
20
|
-
##
|
|
17
|
+
## Why
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
Copilot and Cursor don't know how your team writes code. They'll generate something that works, but it won't look like yours — wrong naming, wrong patterns, wrong abstractions. You end up rewriting the AI's output or explaining the same conventions in every PR review.
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
AutoSnippet fixes this. It scans your codebase, extracts the patterns that matter (with your approval), and makes them available to any AI tool via [MCP](https://modelcontextprotocol.io/). Next time Cursor generates code, it actually follows your conventions.
|
|
25
22
|
|
|
26
23
|
```
|
|
27
|
-
Your
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
↓
|
|
33
|
-
Code generated following YOUR standards
|
|
24
|
+
Your code → AI extracts patterns → You review → Knowledge base
|
|
25
|
+
↓
|
|
26
|
+
Cursor / Copilot / VS Code / Xcode
|
|
27
|
+
↓
|
|
28
|
+
AI follows your patterns
|
|
34
29
|
```
|
|
35
30
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
| Concept | Description |
|
|
39
|
-
|---------|-------------|
|
|
40
|
-
| **Recipe** | The atomic unit of knowledge — a code pattern + explanation + metadata. Stored as Markdown in `AutoSnippet/recipes/`, cached in SQLite for fast retrieval |
|
|
41
|
-
| **Candidate** | A pending knowledge entry awaiting human review — from AI scans, manual submission, or bootstrap. Promoted to Recipe after approval |
|
|
42
|
-
| **Guard** | Code compliance engine — checks source files against knowledge-derived rules at file, target, or project scope |
|
|
43
|
-
| **Skill** | Agent instruction sets (18 built-in) — guide AI agents to correctly invoke knowledge base operations |
|
|
44
|
-
| **Bootstrap** | Cold-start engine — 9-dimension heuristic scan + dual-agent AI analysis, generating dozens of candidates in one pass |
|
|
45
|
-
|
|
46
|
-
## Quick Start
|
|
31
|
+
## Get Started
|
|
47
32
|
|
|
48
33
|
```bash
|
|
49
|
-
# Install globally
|
|
50
34
|
npm install -g autosnippet
|
|
51
35
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
asd
|
|
55
|
-
|
|
56
|
-
# Cold-start: scan your codebase and extract patterns
|
|
57
|
-
asd coldstart # 9-dimension AI analysis → Candidates
|
|
58
|
-
|
|
59
|
-
# Launch Dashboard to review and manage knowledge
|
|
60
|
-
asd ui # Web dashboard + API server
|
|
36
|
+
cd your-project
|
|
37
|
+
asd setup # workspace + DB + IDE configs (Cursor, VS Code, Trae, Qoder)
|
|
38
|
+
asd coldstart # scans your code, generates pattern candidates
|
|
39
|
+
asd ui # open the dashboard to review what was found
|
|
61
40
|
```
|
|
62
41
|
|
|
63
|
-
|
|
42
|
+
That's it. After you approve some candidates, they become **Recipes** — structured knowledge entries that your IDE's AI can query in real time.
|
|
64
43
|
|
|
65
44
|
## How It Works
|
|
66
45
|
|
|
67
46
|
```
|
|
68
47
|
┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐
|
|
69
|
-
│ ① Setup │──→ │ ② Cold
|
|
48
|
+
│ ① Setup │──→ │ ② Cold │──→ │ ③ Target │──→ │ ④ Revie │──→ │ ⑤ IDE │
|
|
70
49
|
│ asd setup │ │ Start │ │ Scan │ │ Dashboard │ │ Delivery │
|
|
71
50
|
└────────────┘ └────────────┘ └────────────┘ └────────────┘ └─────┬──────┘
|
|
72
51
|
│
|
|
@@ -78,250 +57,116 @@ asd ui # Web dashboard + API server
|
|
|
78
57
|
└────────────┘ └────────────┘
|
|
79
58
|
```
|
|
80
59
|
|
|
81
|
-
1.
|
|
82
|
-
2.
|
|
83
|
-
3. **
|
|
84
|
-
4. **
|
|
85
|
-
5. **
|
|
86
|
-
6. **AI Generation** — IDE AI assistants query the knowledge base and generate code following your team's patterns
|
|
87
|
-
7. **Continuous Capture** — File watchers detect new patterns, creating a feedback loop
|
|
88
|
-
|
|
89
|
-
## Features
|
|
90
|
-
|
|
91
|
-
### 🔍 Multi-Strategy Search Engine
|
|
92
|
-
|
|
93
|
-
4-layer retrieval funnel with 5 search modes:
|
|
94
|
-
|
|
95
|
-
| Layer | Strategy | Purpose |
|
|
96
|
-
|-------|----------|---------|
|
|
97
|
-
| L1 | Inverted Index + BM25 | Fast keyword recall with CJK support |
|
|
98
|
-
| L2 | Cross-Encoder Reranker | AI-powered semantic reranking |
|
|
99
|
-
| L2.5 | Coarse Ranker (E-E-A-T) | 5-dimension quality scoring |
|
|
100
|
-
| L3 | Multi-Signal Ranker | 6-signal weighted ranking (relevance, authority, recency, popularity, difficulty, seasonality) |
|
|
60
|
+
1. **`asd setup`** — Creates the workspace, SQLite DB, MCP configs for your IDEs, installs the VS Code extension.
|
|
61
|
+
2. **`asd coldstart`** — Scans your codebase from multiple angles (architecture, naming, error handling, etc.). Produces **Candidates** — pattern drafts for you to review.
|
|
62
|
+
3. **Review in Dashboard** — Approve, edit, or reject. Approved candidates become Recipes.
|
|
63
|
+
4. **IDE picks them up** — Via MCP, Cursor Rules, or Agent Skills. When AI generates code, it checks your Recipes first.
|
|
64
|
+
5. **Keep going** — As you write new code, scan again. The knowledge base grows with your project.
|
|
101
65
|
|
|
102
|
-
|
|
66
|
+
You can also scan specific modules with `asd ais <target>`. Better yet, just describe what you want in Cursor using natural language — the AI will automatically invoke the knowledge base to scan and submit patterns for you.
|
|
103
67
|
|
|
104
|
-
|
|
105
|
-
|----------|-------|
|
|
106
|
-
| Google Gemini | Native tool calling + structured output |
|
|
107
|
-
| OpenAI | GPT-4o, GPT-4, etc. |
|
|
108
|
-
| Claude (Anthropic) | Native tool calling |
|
|
109
|
-
| DeepSeek | OpenAI-compatible |
|
|
110
|
-
| Ollama | Local models, no API key needed |
|
|
111
|
-
| Mock | Auto-fallback when no AI configured |
|
|
68
|
+
## What's in the Box
|
|
112
69
|
|
|
113
|
-
|
|
70
|
+
**Pattern extraction** — AI reads your code, identifies reusable patterns, and structures them as Recipes with code, explanation, metadata, and usage guidelines. Supports ObjC, Swift, TypeScript, JavaScript, Python, Java, Kotlin, Go, Ruby (9 languages via Tree-sitter AST).
|
|
114
71
|
|
|
115
|
-
|
|
72
|
+
**Search** — BM25 keyword matching → semantic reranking → quality scoring → multi-signal ranking. Works in Chinese and English.
|
|
116
73
|
|
|
117
|
-
|
|
118
|
-
- **3 scopes**: file / target / project
|
|
119
|
-
- **CI/CD ready**: `asd guard:ci` with Quality Gate, `asd guard:staged` for pre-commit hooks
|
|
120
|
-
- **Rule learning**: Auto-suggest rules from violation patterns (14-day effectiveness tracking)
|
|
121
|
-
- **Feedback loop**: Guard violations → Recipe usage confirmation
|
|
74
|
+
**Guard** — Regex and AST-based compliance rules derived from your Recipes. Run on files, modules, or the whole project. Hooks into CI with `asd guard:ci` and git pre-commit with `asd guard:staged`.
|
|
122
75
|
|
|
123
|
-
|
|
76
|
+
**Dashboard** — Web UI (`asd ui`) for everything: browsing Recipes, reviewing Candidates, AI chat, knowledge graph visualization, Guard reports, module explorer, project wiki generation, and LLM config.
|
|
124
77
|
|
|
125
|
-
|
|
78
|
+
**IDE integration** — MCP server (works with Cursor, VS Code, Qoder, Trae), VS Code extension (search, directives, CodeLens, Guard), Xcode support (file watcher, auto-insertion, snippet sync).
|
|
126
79
|
|
|
127
|
-
|
|
128
|
-
- **AI Chat** — ReAct-loop conversation with 54 internal tools
|
|
129
|
-
- **Knowledge Graph** — Visual relationship explorer
|
|
130
|
-
- **Guard Dashboard** — Rule management, violation tracking, compliance reports
|
|
131
|
-
- **SPM / Module Explorer** — Dependency analysis across language ecosystems
|
|
132
|
-
- **Wiki Generator** — Auto-generated project documentation with Mermaid diagrams
|
|
133
|
-
- **Bootstrap Progress** — Real-time 9-dimension progress with time estimates
|
|
134
|
-
- **Skills Manager** — Browse, create, and manage agent skills
|
|
135
|
-
- **LLM Config** — Visual AI provider/model/key configuration
|
|
80
|
+
**AI providers** — Google Gemini, OpenAI, Claude, DeepSeek, Ollama (local), with auto-fallback between them. Or no AI at all — the knowledge base works without it.
|
|
136
81
|
|
|
137
|
-
|
|
82
|
+
## File Directives
|
|
138
83
|
|
|
139
|
-
|
|
84
|
+
Write these in any source file:
|
|
140
85
|
|
|
141
|
-
Works with any MCP-compatible IDE (Cursor, VS Code Copilot, Qoder, Trae):
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
# Automatically configured by asd setup
|
|
145
|
-
# Or manually: asd setup:mcp
|
|
146
86
|
```
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
#### VS Code Extension
|
|
151
|
-
|
|
152
|
-
Installed automatically by `asd setup`. Features:
|
|
153
|
-
|
|
154
|
-
- **Search & Insert** — `Cmd+Shift+F5` opens QuickPick with code preview, inserts at cursor
|
|
155
|
-
- **Directive Detection** — Auto-detects `// as:s`, `// as:c`, `// as:a` directives on save
|
|
156
|
-
- **CodeLens** — Inline action buttons above directives
|
|
157
|
-
- **Guard Audit** — Run compliance checks on files or entire project
|
|
158
|
-
- **Create Candidate** — Submit selected code as a knowledge candidate
|
|
159
|
-
- **Status Bar** — Real-time API server connection indicator
|
|
160
|
-
|
|
161
|
-
#### Xcode Integration
|
|
162
|
-
|
|
163
|
-
- **File Watcher** — `asd watch` monitors files for `// as:` directives
|
|
164
|
-
- **Auto-Insertion** — osascript-driven code insertion preserving Undo history
|
|
165
|
-
- **Header Management** — Automatic `#import`/`@import` deduplication with SPM-aware decisions
|
|
166
|
-
- **Snippet Sync** — Export recipes as native Xcode `.codesnippet` files
|
|
167
|
-
|
|
168
|
-
### 📝 File Directives
|
|
169
|
-
|
|
170
|
-
Write directives as comments in any source file:
|
|
171
|
-
|
|
172
|
-
```objc
|
|
173
|
-
// as:s network request timeout → Search & insert matching recipe
|
|
174
|
-
// as:c → Create candidate from surrounding code
|
|
175
|
-
// as:c -c → Create candidate from clipboard
|
|
176
|
-
// as:a → Run Guard audit on this file
|
|
177
|
-
// as:include "MyHeader.h" → ObjC header import
|
|
178
|
-
// as:import UIKit → Module import
|
|
87
|
+
// as:s network timeout Search recipes and insert the match
|
|
88
|
+
// as:c Create a candidate from surrounding code
|
|
89
|
+
// as:a Run Guard audit on this file
|
|
179
90
|
```
|
|
180
91
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
Tree-sitter powered code intelligence:
|
|
184
|
-
|
|
185
|
-
| Language | Capabilities |
|
|
186
|
-
|----------|-------------|
|
|
187
|
-
| Objective-C, Swift | Full: classes, protocols, categories, extensions, design patterns |
|
|
188
|
-
| TypeScript, JavaScript, TSX | Classes, functions, React components, imports |
|
|
189
|
-
| Python | Classes, functions, decorators, imports |
|
|
190
|
-
| Java, Kotlin | Classes, interfaces, annotations |
|
|
191
|
-
| Go | Structs, interfaces, functions |
|
|
192
|
-
|
|
193
|
-
Plus 11 framework enhancement packs (React, Vue, Spring, Django, FastAPI, gRPC, Android, etc.).
|
|
194
|
-
|
|
195
|
-
### 🏛️ Constitution & Governance
|
|
196
|
-
|
|
197
|
-
Three-layer permission model:
|
|
198
|
-
|
|
199
|
-
1. **Capability Layer** — `git push --dry-run` probes write access (physical signal)
|
|
200
|
-
2. **Role Layer** — 3 roles (developer / external_agent / chat_agent) with permission matrix
|
|
201
|
-
3. **Governance Layer** — 4 inviolable rules enforced by Constitution engine
|
|
202
|
-
|
|
203
|
-
Every write operation passes through the Gateway: role check → constitution rules → audit log.
|
|
204
|
-
|
|
205
|
-
### 🧠 Agent Memory (4 Tiers)
|
|
206
|
-
|
|
207
|
-
| Tier | Scope | Persistent | Purpose |
|
|
208
|
-
|------|-------|-----------|---------|
|
|
209
|
-
| Working Memory | Session | No | Scratchpad + context compression |
|
|
210
|
-
| Episodic Memory | Cross-dimension | No | Discovery sharing between bootstrap dimensions |
|
|
211
|
-
| Project Semantic Memory | Project | SQLite | Permanent facts, insights, preferences (importance scoring + TTL) |
|
|
212
|
-
| Tool Result Cache | Cross-dimension | No | Deduplication of tool calls |
|
|
92
|
+
The VS Code extension and `asd watch` (Xcode) pick these up automatically.
|
|
213
93
|
|
|
214
|
-
## CLI
|
|
94
|
+
## CLI
|
|
215
95
|
|
|
216
|
-
| Command |
|
|
96
|
+
| Command | What it does |
|
|
217
97
|
|---------|-------------|
|
|
218
|
-
| `asd setup` |
|
|
219
|
-
| `asd coldstart` |
|
|
220
|
-
| `asd ais [target]` |
|
|
221
|
-
| `asd ui` |
|
|
222
|
-
| `asd watch` | Start Xcode file watcher for directives |
|
|
98
|
+
| `asd setup` | Init workspace, DB, IDE configs |
|
|
99
|
+
| `asd coldstart` | Full codebase scan → candidates |
|
|
100
|
+
| `asd ais [target]` | Scan a specific module |
|
|
101
|
+
| `asd ui` | Dashboard + API server |
|
|
223
102
|
| `asd search <query>` | Search knowledge base |
|
|
224
|
-
| `asd guard <file>` | Run
|
|
225
|
-
| `asd guard:ci` | CI
|
|
226
|
-
| `asd guard:staged` |
|
|
227
|
-
| `asd
|
|
228
|
-
| `asd
|
|
229
|
-
| `asd
|
|
230
|
-
| `asd
|
|
231
|
-
| `asd status` | Check environment health |
|
|
103
|
+
| `asd guard <file>` | Run compliance check |
|
|
104
|
+
| `asd guard:ci` | CI mode with quality gate |
|
|
105
|
+
| `asd guard:staged` | Pre-commit hook |
|
|
106
|
+
| `asd watch` | Xcode file watcher |
|
|
107
|
+
| `asd sync` | Sync recipe markdown → DB |
|
|
108
|
+
| `asd upgrade` | Update IDE integrations |
|
|
109
|
+
| `asd status` | Health check |
|
|
232
110
|
|
|
233
|
-
##
|
|
111
|
+
## Project Structure
|
|
112
|
+
|
|
113
|
+
After `asd setup`, your project gets:
|
|
234
114
|
|
|
235
115
|
```
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
│
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
│ Service Layer │
|
|
247
|
-
│ SearchEngine │ KnowledgeService │ GuardEngine │ Chat │
|
|
248
|
-
│ Bootstrap │ WikiGenerator │ Skills │ SPM │
|
|
249
|
-
└────────────────────────┬────────────────────────────────┘
|
|
250
|
-
│
|
|
251
|
-
┌────────────────────────┴────────────────────────────────┐
|
|
252
|
-
│ Core Layer │
|
|
253
|
-
│ AstAnalyzer (9 lang) │ KnowledgeGraph │ CodeEntityGraph│
|
|
254
|
-
│ RetrievalFunnel │ QualityScorer │ ConfidenceRouter│
|
|
255
|
-
└────────────────────────┬────────────────────────────────┘
|
|
256
|
-
│
|
|
257
|
-
┌────────────────────────┴────────────────────────────────┐
|
|
258
|
-
│ Infrastructure Layer │
|
|
259
|
-
│ SQLite │ VectorStore │ EventBus │ AuditLog │ Gateway │
|
|
260
|
-
│ DI Container (40+ services) │ Constitution │ PathGuard │
|
|
261
|
-
└─────────────────────────────────────────────────────────┘
|
|
116
|
+
your-project/
|
|
117
|
+
├── AutoSnippet/ # Knowledge data (git-tracked)
|
|
118
|
+
│ ├── recipes/ # Approved patterns (Markdown)
|
|
119
|
+
│ ├── candidates/ # Pending review
|
|
120
|
+
│ └── skills/ # Project-specific agent instructions
|
|
121
|
+
├── .autosnippet/ # Runtime cache (gitignored)
|
|
122
|
+
│ ├── autosnippet.db # SQLite
|
|
123
|
+
│ └── context/ # Vector index
|
|
124
|
+
├── .cursor/mcp.json # Cursor MCP config
|
|
125
|
+
└── .vscode/mcp.json # VS Code MCP config
|
|
262
126
|
```
|
|
263
127
|
|
|
264
|
-
|
|
128
|
+
Recipes are Markdown files. SQLite is a read cache. If the DB breaks, `asd sync` rebuilds it.
|
|
265
129
|
|
|
266
|
-
|
|
130
|
+
## Configuration
|
|
267
131
|
|
|
268
|
-
|
|
132
|
+
Put a `.env` in your project root, or use Dashboard → LLM Config:
|
|
269
133
|
|
|
270
134
|
```env
|
|
271
|
-
# Pick one (
|
|
272
|
-
ASD_GOOGLE_API_KEY
|
|
273
|
-
ASD_OPENAI_API_KEY
|
|
274
|
-
ASD_CLAUDE_API_KEY
|
|
275
|
-
ASD_DEEPSEEK_API_KEY
|
|
135
|
+
# Pick one (multiple = auto-fallback)
|
|
136
|
+
ASD_GOOGLE_API_KEY=...
|
|
137
|
+
ASD_OPENAI_API_KEY=...
|
|
138
|
+
ASD_CLAUDE_API_KEY=...
|
|
139
|
+
ASD_DEEPSEEK_API_KEY=...
|
|
276
140
|
|
|
277
|
-
# Or
|
|
141
|
+
# Or run local
|
|
278
142
|
ASD_AI_PROVIDER=ollama
|
|
279
143
|
ASD_AI_MODEL=llama3
|
|
280
144
|
```
|
|
281
145
|
|
|
282
|
-
|
|
146
|
+
## Architecture
|
|
283
147
|
|
|
284
148
|
```
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
│
|
|
289
|
-
|
|
290
|
-
│
|
|
291
|
-
|
|
292
|
-
│
|
|
293
|
-
|
|
294
|
-
│ └── context/ # Vector index cache
|
|
295
|
-
├── .cursor/ # Cursor IDE integration
|
|
296
|
-
│ ├── mcp.json
|
|
297
|
-
│ ├── rules/
|
|
298
|
-
│ └── skills/
|
|
299
|
-
└── .vscode/ # VS Code integration
|
|
300
|
-
├── mcp.json # MCP server config
|
|
301
|
-
└── extensions.json # Recommended extensions
|
|
149
|
+
IDE Layer Cursor · VS Code · Trae · Qoder · Xcode · Dashboard
|
|
150
|
+
│
|
|
151
|
+
MCP Server + HTTP API
|
|
152
|
+
│
|
|
153
|
+
Service Layer Search · Knowledge · Guard · Chat · Bootstrap · Wiki
|
|
154
|
+
│
|
|
155
|
+
Core Layer AST (9 lang) · KnowledgeGraph · RetrievalFunnel · QualityScorer
|
|
156
|
+
│
|
|
157
|
+
Infrastructure SQLite · VectorStore · EventBus · AuditLog · DI Container (40+)
|
|
302
158
|
```
|
|
303
159
|
|
|
304
|
-
## Security
|
|
305
|
-
|
|
306
|
-
- **PathGuard**: 2-layer boundary protection — blocks writes outside project root + whitelist-only allowed paths
|
|
307
|
-
- **Constitution**: 4 inviolable rules enforced on every write operation
|
|
308
|
-
- **Audit Trail**: Full audit logging with 90-day TTL auto-cleanup
|
|
309
|
-
- **No External Calls in postinstall**: Build scripts are purely local (macOS Swift compilation)
|
|
310
|
-
- **Gateway**: Every mutation goes through role verification → constitution check → audit log
|
|
311
|
-
|
|
312
160
|
## Requirements
|
|
313
161
|
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
162
|
+
- Node.js ≥ 20
|
|
163
|
+
- macOS recommended (Xcode features need it; everything else is cross-platform)
|
|
164
|
+
- better-sqlite3 (bundled)
|
|
317
165
|
|
|
318
166
|
## Contributing
|
|
319
167
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
1. Run `npm test` before submitting
|
|
323
|
-
2. Follow existing code patterns (ESM, domain-driven structure)
|
|
324
|
-
3. Guard rules and knowledge entries go through the standard review process
|
|
168
|
+
1. `npm test` before submitting
|
|
169
|
+
2. Follow existing patterns (ESM, domain-driven structure)
|
|
325
170
|
|
|
326
171
|
## License
|
|
327
172
|
|