lunar-skills 1.0.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/.gemini/skills/anti-ai-ui-developer/SKILL.md +18 -0
- package/.gemini/skills/auto-idea-to-product/SKILL.md +29 -0
- package/.gemini/skills/master-app-builder/SKILL.md +26 -0
- package/.gemini/skills/master-orchestrator/SKILL.md +14 -0
- package/.gemini/skills/qa-circuit-breaker/SKILL.md +25 -0
- package/.gemini/skills/security-architect/SKILL.md +21 -0
- package/.gemini/skills/skills-manager/SKILL.md +8 -0
- package/.gemini/skills/system-architecture-diagrammer/SKILL.md +14 -0
- package/README.md +45 -0
- package/bin/cli.js +16 -0
- package/data/cards.json +91 -0
- package/data/milestones/MILESTONE-001.json +102 -0
- package/data/milestones/MILESTONE-002.json +91 -0
- package/data/milestones/MILESTONE-003.json +105 -0
- package/data/milestones/MILESTONE-004.json +112 -0
- package/data/milestones/MILESTONE-005.json +112 -0
- package/data/milestones/MILESTONE-006.json +112 -0
- package/data/milestones/MILESTONE-007.json +112 -0
- package/docs/adr/ADR-001.md +31 -0
- package/docs/adr/ADR-002.md +28 -0
- package/docs/api/api-architecture.md +70 -0
- package/docs/api/authentication-flow.md +31 -0
- package/docs/api/data-flow.md +21 -0
- package/docs/architecture/dependency-diagram.md +37 -0
- package/docs/architecture/feature-tree.md +35 -0
- package/docs/architecture/folder-structure.md +81 -0
- package/docs/architecture/module-diagram.md +43 -0
- package/docs/architecture/package-diagram.md +26 -0
- package/docs/architecture/system-architecture.md +42 -0
- package/docs/architecture.html +193 -0
- package/docs/database/database.md +67 -0
- package/docs/deployment/deployment.md +26 -0
- package/docs/infrastructure/cicd.md +26 -0
- package/docs/infrastructure/infrastructure.md +21 -0
- package/docs/infrastructure/logging.md +24 -0
- package/docs/infrastructure/monitoring.md +18 -0
- package/docs/security/security.md +35 -0
- package/docs/workflow/sequence-card-creation.md +26 -0
- package/docs/workflow/sequence-compaction.md +25 -0
- package/docs/workflow/sequence-scope-validation.md +20 -0
- package/index.html +540 -0
- package/package.json +38 -0
- package/scripts/card-manager.js +162 -0
- package/scripts/circuit-breaker.js +32 -0
- package/scripts/install-skills.js +60 -0
- package/scripts/mock-server.js +29 -0
- package/scripts/scope-enforcer.js +80 -0
- package/scripts/verify-system.js +88 -0
- package/src/index.js +102 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 9. Sequence Diagram - Hierarchical Compaction Workflow
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## 🗂 9.2 Sequence Diagram: 10-to-1 Hierarchical Card Compaction
|
|
6
|
+
|
|
7
|
+
```mermaid
|
|
8
|
+
sequenceDiagram
|
|
9
|
+
autonumber
|
|
10
|
+
participant Engine as card-manager.js (Compaction Engine)
|
|
11
|
+
participant CardsFile as data/cards.json
|
|
12
|
+
participant MilestoneDir as data/milestones/
|
|
13
|
+
participant ReportDir as data/reports/
|
|
14
|
+
|
|
15
|
+
Engine->>CardsFile: Check completed cards count
|
|
16
|
+
CardsFile-->>Engine: Returns 10 Completed Cards
|
|
17
|
+
Engine->>Engine: Generate milestoneId ("MILESTONE-001")
|
|
18
|
+
Engine->>MilestoneDir: Write MILESTONE-001.json (Contains 10 Cards)
|
|
19
|
+
Engine->>CardsFile: Purge 10 compacted cards (Keep active cards < 10)
|
|
20
|
+
|
|
21
|
+
Engine->>MilestoneDir: Check total Milestone JSON files
|
|
22
|
+
MilestoneDir-->>Engine: Returns 10 Milestone Files
|
|
23
|
+
Engine->>Engine: Generate reportId ("MASTER_EXECUTIVE_REPORT_001")
|
|
24
|
+
Engine->>ReportDir: Write MASTER_EXECUTIVE_REPORT_001.md (100 Cards Macro Summary)
|
|
25
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 9. Sequence Diagram - Scope Validation Workflow
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## 🛡 9.3 Sequence Diagram: Scope Boundary Check & Action Violation Blocker
|
|
6
|
+
|
|
7
|
+
```mermaid
|
|
8
|
+
sequenceDiagram
|
|
9
|
+
autonumber
|
|
10
|
+
actor Subagent as AI Subagent
|
|
11
|
+
participant Engine as card-manager.js
|
|
12
|
+
participant Guard as scope-enforcer.js (Scope Guard)
|
|
13
|
+
|
|
14
|
+
Subagent->>Engine: modifyFileWithScopeCheck("CARD-002", "payment-gateway.js")
|
|
15
|
+
Engine->>Engine: Retrieve Card scope ("SCOPE_DIAGRAM")
|
|
16
|
+
Engine->>Guard: validateAction("SCOPE_DIAGRAM", "payment-gateway.js")
|
|
17
|
+
Guard->>Guard: Check allowedPaths for SCOPE_DIAGRAM
|
|
18
|
+
Guard-->>Engine: { allowed: false, status: "SCOPE_VIOLATION_BLOCKED" }
|
|
19
|
+
Engine-->>Subagent: BLOCK ACTION & Log: "[BẢO VỆ SCOPE] Hành động bị CHẶN!"
|
|
20
|
+
```
|
package/index.html
ADDED
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="vi">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>ENTERPRISE SYSTEM ARCHITECTURE & DOCUMENTATION DASHBOARD</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@700;900&family=Plus+Jakarta+Sans:wght@400;600;700&family=Space+Grotesk:wght@500;700&display=swap" rel="stylesheet">
|
|
10
|
+
|
|
11
|
+
<!-- Mermaid.js v10 CDN for Rendering All 18 Architectural Diagrams -->
|
|
12
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
|
|
13
|
+
<script>
|
|
14
|
+
mermaid.initialize({
|
|
15
|
+
startOnLoad: true,
|
|
16
|
+
theme: 'dark',
|
|
17
|
+
themeVariables: {
|
|
18
|
+
darkMode: true,
|
|
19
|
+
background: '#080c18',
|
|
20
|
+
primaryColor: '#00ff66',
|
|
21
|
+
primaryTextColor: '#ffffff',
|
|
22
|
+
primaryBorderColor: '#00ff66',
|
|
23
|
+
lineColor: '#00f0ff',
|
|
24
|
+
secondaryColor: '#162036',
|
|
25
|
+
tertiaryColor: '#0e1424'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
:root {
|
|
32
|
+
--bg-dark: #050811;
|
|
33
|
+
--bg-card: #0e1424;
|
|
34
|
+
--accent-neon: #00ff66;
|
|
35
|
+
--accent-cyan: #00f0ff;
|
|
36
|
+
--accent-magenta: #ff0055;
|
|
37
|
+
--text-main: #ffffff;
|
|
38
|
+
--text-muted: #94a3b8;
|
|
39
|
+
--border-sharp: 1px solid rgba(0, 255, 102, 0.25);
|
|
40
|
+
--font-mono: 'Space Grotesk', monospace;
|
|
41
|
+
--font-title: 'Outfit', sans-serif;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
45
|
+
|
|
46
|
+
body {
|
|
47
|
+
background-color: var(--bg-dark);
|
|
48
|
+
color: var(--text-main);
|
|
49
|
+
font-family: 'Plus Jakarta Sans', sans-serif;
|
|
50
|
+
padding: 2rem;
|
|
51
|
+
line-height: 1.6;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.header-dashboard {
|
|
55
|
+
max-width: 1440px;
|
|
56
|
+
margin: 0 auto 2rem auto;
|
|
57
|
+
border-bottom: var(--border-sharp);
|
|
58
|
+
padding-bottom: 1.5rem;
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
align-items: flex-end;
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
gap: 1rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.header-dashboard h1 {
|
|
67
|
+
font-family: var(--font-title);
|
|
68
|
+
font-size: 2.2rem;
|
|
69
|
+
letter-spacing: 2px;
|
|
70
|
+
text-transform: uppercase;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.header-dashboard h1 span { color: var(--accent-neon); }
|
|
74
|
+
|
|
75
|
+
.tag-badge {
|
|
76
|
+
font-family: var(--font-mono);
|
|
77
|
+
background: rgba(0, 255, 102, 0.15);
|
|
78
|
+
color: var(--accent-neon);
|
|
79
|
+
border: 1px solid var(--accent-neon);
|
|
80
|
+
padding: 4px 12px;
|
|
81
|
+
font-size: 0.8rem;
|
|
82
|
+
letter-spacing: 1px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Navigation Tabs Bar */
|
|
86
|
+
.tab-bar {
|
|
87
|
+
max-width: 1440px;
|
|
88
|
+
margin: 0 auto 2rem auto;
|
|
89
|
+
display: flex;
|
|
90
|
+
gap: 0.8rem;
|
|
91
|
+
flex-wrap: wrap;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.tab-btn {
|
|
95
|
+
background: var(--bg-card);
|
|
96
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
97
|
+
color: var(--text-muted);
|
|
98
|
+
font-family: var(--font-mono);
|
|
99
|
+
font-size: 0.85rem;
|
|
100
|
+
padding: 0.6rem 1.4rem;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
text-transform: uppercase;
|
|
103
|
+
letter-spacing: 1px;
|
|
104
|
+
transition: all 0.2s;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.tab-btn.active, .tab-btn:hover {
|
|
108
|
+
background: rgba(0, 255, 102, 0.1);
|
|
109
|
+
color: var(--accent-neon);
|
|
110
|
+
border-color: var(--accent-neon);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.tab-content {
|
|
114
|
+
display: none;
|
|
115
|
+
max-width: 1440px;
|
|
116
|
+
margin: 0 auto;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.tab-content.active {
|
|
120
|
+
display: block;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.grid-container {
|
|
124
|
+
display: grid;
|
|
125
|
+
grid-template-columns: repeat(auto-fit, minmax(680px, 1fr));
|
|
126
|
+
gap: 2rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.doc-card {
|
|
130
|
+
background: var(--bg-card);
|
|
131
|
+
border: var(--border-sharp);
|
|
132
|
+
padding: 1.8rem;
|
|
133
|
+
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.doc-title {
|
|
139
|
+
font-family: var(--font-mono);
|
|
140
|
+
font-size: 1.05rem;
|
|
141
|
+
color: var(--accent-cyan);
|
|
142
|
+
letter-spacing: 1px;
|
|
143
|
+
margin-bottom: 1.2rem;
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: space-between;
|
|
147
|
+
border-bottom: 1px solid rgba(255,255,255,0.08);
|
|
148
|
+
padding-bottom: 0.6rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.doc-link {
|
|
152
|
+
font-size: 0.75rem;
|
|
153
|
+
color: var(--accent-neon);
|
|
154
|
+
text-decoration: none;
|
|
155
|
+
border: 1px solid var(--accent-neon);
|
|
156
|
+
padding: 2px 8px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.mermaid-box {
|
|
160
|
+
flex: 1;
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
justify-content: center;
|
|
164
|
+
background: #080c18;
|
|
165
|
+
border: 1px dashed rgba(0, 255, 102, 0.2);
|
|
166
|
+
padding: 1.5rem;
|
|
167
|
+
overflow: auto;
|
|
168
|
+
min-height: 280px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Quick Specs Table */
|
|
172
|
+
.table-sharp {
|
|
173
|
+
width: 100%;
|
|
174
|
+
border-collapse: collapse;
|
|
175
|
+
font-family: var(--font-mono);
|
|
176
|
+
font-size: 0.85rem;
|
|
177
|
+
margin-top: 1rem;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.table-sharp th, .table-sharp td {
|
|
181
|
+
padding: 8px 12px;
|
|
182
|
+
border: 1px solid rgba(255,255,255,0.08);
|
|
183
|
+
text-align: left;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.table-sharp th {
|
|
187
|
+
background: #060a14;
|
|
188
|
+
color: var(--accent-neon);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
footer {
|
|
192
|
+
max-width: 1440px;
|
|
193
|
+
margin: 3rem auto 0 auto;
|
|
194
|
+
text-align: center;
|
|
195
|
+
font-family: var(--font-mono);
|
|
196
|
+
font-size: 0.8rem;
|
|
197
|
+
color: var(--text-muted);
|
|
198
|
+
border-top: 1px solid rgba(255,255,255,0.05);
|
|
199
|
+
padding-top: 1.5rem;
|
|
200
|
+
}
|
|
201
|
+
</style>
|
|
202
|
+
</head>
|
|
203
|
+
<body>
|
|
204
|
+
|
|
205
|
+
<header class="header-dashboard">
|
|
206
|
+
<div>
|
|
207
|
+
<span class="tag-badge">ENTERPRISE TECHNICAL SPECIFICATION SUITE</span>
|
|
208
|
+
<h1>MASTER ARCHITECTURE INDEX <span>DASHBOARD</span></h1>
|
|
209
|
+
</div>
|
|
210
|
+
<div style="font-family: var(--font-mono); color: var(--text-muted); font-size: 0.85rem;">
|
|
211
|
+
DOCS INDEX: <span style="color: var(--accent-neon);">18 MANDATORY SECTIONS GENERATED</span>
|
|
212
|
+
</div>
|
|
213
|
+
</header>
|
|
214
|
+
|
|
215
|
+
<!-- Interactive Navigation Tabs -->
|
|
216
|
+
<div class="tab-bar">
|
|
217
|
+
<button class="tab-btn active" onclick="switchTab('tab-arch')">🏗 1. Kiến Trúc & Module</button>
|
|
218
|
+
<button class="tab-btn" onclick="switchTab('tab-data')">🗄 2. Dữ Liệu & API Flow</button>
|
|
219
|
+
<button class="tab-btn" onclick="switchTab('tab-workflow')">🔄 3. Sơ Đồ Tuần Tự Workflow</button>
|
|
220
|
+
<button class="tab-btn" onclick="switchTab('tab-security')">🛡 4. Bảo Mật & ADR Decisions</button>
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
<!-- TAB 1: KIẾN TRÚC & MODULE -->
|
|
224
|
+
<div id="tab-arch" class="tab-content active">
|
|
225
|
+
<div class="grid-container">
|
|
226
|
+
|
|
227
|
+
<!-- System Architecture Graph -->
|
|
228
|
+
<div class="doc-card">
|
|
229
|
+
<div class="doc-title">
|
|
230
|
+
<span>🏗 SYSTEM ARCHITECTURE (system-architecture.md)</span>
|
|
231
|
+
<a href="docs/architecture/system-architecture.md" class="doc-link">DOC MD ↗</a>
|
|
232
|
+
</div>
|
|
233
|
+
<div class="mermaid-box">
|
|
234
|
+
<pre class="mermaid">
|
|
235
|
+
graph TD
|
|
236
|
+
User["👤 User / Terminal Prompt"] --> APIServer["Native HTTP Server (src/index.js:3000)"]
|
|
237
|
+
APIServer --> CardManager["Card Manager Engine (scripts/card-manager.js)"]
|
|
238
|
+
CardManager --> ScopeGuard["Scope Enforcer Guard (scripts/scope-enforcer.js)"]
|
|
239
|
+
|
|
240
|
+
subgraph Storage_Tier ["3-Tier File Persistence"]
|
|
241
|
+
CardManager --> Level0["Level 0: cards.json (< 10 Active)"]
|
|
242
|
+
Level0 -->|10-in-1 Compaction| Level1["Level 1: data/milestones/MILESTONE-001.json"]
|
|
243
|
+
Level1 -->|100-in-1 Compaction| Level2["Level 2: data/reports/MASTER_REPORT_001.md"]
|
|
244
|
+
end
|
|
245
|
+
</pre>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<!-- Folder Structure & Packages -->
|
|
250
|
+
<div class="doc-card">
|
|
251
|
+
<div class="doc-title">
|
|
252
|
+
<span>🌳 FOLDER STRUCTURE & PACKAGES (folder-structure.md)</span>
|
|
253
|
+
<a href="docs/architecture/folder-structure.md" class="doc-link">DOC MD ↗</a>
|
|
254
|
+
</div>
|
|
255
|
+
<div class="mermaid-box">
|
|
256
|
+
<pre class="mermaid">
|
|
257
|
+
graph TD
|
|
258
|
+
Root["/ (Root Project)"] --> Gemini[".gemini/skills/ (AI Skills)"]
|
|
259
|
+
Root --> Data["data/ (JSON & Markdown Storage)"]
|
|
260
|
+
Root --> Scripts["scripts/ (Engine & Scope Guard)"]
|
|
261
|
+
Root --> Src["src/ (Native HTTP Server)"]
|
|
262
|
+
Root --> Docs["docs/ (Architectural Specs)"]
|
|
263
|
+
|
|
264
|
+
Scripts --> CardMgr["card-manager.js"]
|
|
265
|
+
Scripts --> ScopeEnf["scope-enforcer.js"]
|
|
266
|
+
Src --> IndexJS["index.js"]
|
|
267
|
+
</pre>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<!-- Package Architecture -->
|
|
272
|
+
<div class="doc-card">
|
|
273
|
+
<div class="doc-title">
|
|
274
|
+
<span>📦 PACKAGE ARCHITECTURE (package-diagram.md)</span>
|
|
275
|
+
<a href="docs/architecture/package-diagram.md" class="doc-link">DOC MD ↗</a>
|
|
276
|
+
</div>
|
|
277
|
+
<div class="mermaid-box">
|
|
278
|
+
<pre class="mermaid">
|
|
279
|
+
graph TD
|
|
280
|
+
Client["Client / User / Terminal"] -->|HTTP / CLI| Controller["Controller (src/index.js)"]
|
|
281
|
+
Controller -->|Delegates Logic| Service["Service Engine (scripts/card-manager.js)"]
|
|
282
|
+
Service -->|Validates Scope| Guard["Scope Guard (scripts/scope-enforcer.js)"]
|
|
283
|
+
Service -->|Persists Data| Storage["Storage Layer (data/cards.json)"]
|
|
284
|
+
</pre>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<!-- Feature Tree -->
|
|
289
|
+
<div class="doc-card">
|
|
290
|
+
<div class="doc-title">
|
|
291
|
+
<span>🌲 FEATURE TREE (feature-tree.md)</span>
|
|
292
|
+
<a href="docs/architecture/feature-tree.md" class="doc-link">DOC MD ↗</a>
|
|
293
|
+
</div>
|
|
294
|
+
<div class="mermaid-box">
|
|
295
|
+
<pre class="mermaid">
|
|
296
|
+
graph TD
|
|
297
|
+
Root["PROACTIVE AI SKILL SYSTEM"] --> F1["Card Management"]
|
|
298
|
+
Root --> F2["Scope Boundary Guard"]
|
|
299
|
+
Root --> F3["Hierarchical Compaction"]
|
|
300
|
+
Root --> F4["Visual System Diagrammer"]
|
|
301
|
+
|
|
302
|
+
F1 --> F1_1["Auto-Create Card"]
|
|
303
|
+
F2 --> F2_1["Scope Rule Matrix"]
|
|
304
|
+
F3 --> F3_1["10-in-1 Milestone Nén"]
|
|
305
|
+
F4 --> F4_1["Mermaid Graph index.html"]
|
|
306
|
+
</pre>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<!-- TAB 2: DỮ LIỆU & API FLOW -->
|
|
314
|
+
<div id="tab-data" class="tab-content">
|
|
315
|
+
<div class="grid-container">
|
|
316
|
+
|
|
317
|
+
<!-- Database ERD -->
|
|
318
|
+
<div class="doc-card">
|
|
319
|
+
<div class="doc-title">
|
|
320
|
+
<span>🗄 DATABASE SCHEMA ERD (database.md)</span>
|
|
321
|
+
<a href="docs/database/database.md" class="doc-link">DOC MD ↗</a>
|
|
322
|
+
</div>
|
|
323
|
+
<div class="mermaid-box">
|
|
324
|
+
<pre class="mermaid">
|
|
325
|
+
erDiagram
|
|
326
|
+
CARD {
|
|
327
|
+
string id PK
|
|
328
|
+
string prompt
|
|
329
|
+
string scope FK
|
|
330
|
+
string status
|
|
331
|
+
string createdAt
|
|
332
|
+
}
|
|
333
|
+
MILESTONE {
|
|
334
|
+
string milestoneId PK
|
|
335
|
+
int totalCardsCompacted
|
|
336
|
+
}
|
|
337
|
+
MASTER_REPORT {
|
|
338
|
+
string reportId PK
|
|
339
|
+
}
|
|
340
|
+
CARD ||--o{ MILESTONE : "10 cards -> 1 milestone"
|
|
341
|
+
MILESTONE ||--o{ MASTER_REPORT : "10 milestones -> 1 report"
|
|
342
|
+
</pre>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
<!-- Data Flow -->
|
|
347
|
+
<div class="doc-card">
|
|
348
|
+
<div class="doc-title">
|
|
349
|
+
<span>🌊 END-TO-END DATA FLOW (data-flow.md)</span>
|
|
350
|
+
<a href="docs/api/data-flow.md" class="doc-link">DOC MD ↗</a>
|
|
351
|
+
</div>
|
|
352
|
+
<div class="mermaid-box">
|
|
353
|
+
<pre class="mermaid">
|
|
354
|
+
graph TD
|
|
355
|
+
UserPrompt["1. User Prompt"] --> API["2. API Server (src/index.js)"]
|
|
356
|
+
API --> CardMgr["3. Card Manager"]
|
|
357
|
+
CardMgr --> ScopeGuard["4. Scope Enforcer"]
|
|
358
|
+
ScopeGuard --> Level0["5. cards.json (Level 0)"]
|
|
359
|
+
Level0 --> Compactor["6. Compaction Engine"]
|
|
360
|
+
Compactor --> Level1["7. MILESTONE-xxx.json (Level 1)"]
|
|
361
|
+
Level1 --> Level2["8. MASTER_REPORT-xxx.md (Level 2)"]
|
|
362
|
+
</pre>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
|
|
366
|
+
<!-- API Architecture -->
|
|
367
|
+
<div class="doc-card" style="grid-column: 1 / -1;">
|
|
368
|
+
<div class="doc-title">
|
|
369
|
+
<span>🌐 API ENDPOINTS SPECIFICATION (api-architecture.md)</span>
|
|
370
|
+
<a href="docs/api/api-architecture.md" class="doc-link">DOC MD ↗</a>
|
|
371
|
+
</div>
|
|
372
|
+
<table class="table-sharp">
|
|
373
|
+
<thead>
|
|
374
|
+
<tr>
|
|
375
|
+
<th>METHOD</th>
|
|
376
|
+
<th>ENDPOINT</th>
|
|
377
|
+
<th>DESCRIPTION</th>
|
|
378
|
+
<th>PAYLOAD / RESPONSE</th>
|
|
379
|
+
</tr>
|
|
380
|
+
</thead>
|
|
381
|
+
<tbody>
|
|
382
|
+
<tr>
|
|
383
|
+
<td><span style="color:var(--accent-neon);">GET</span></td>
|
|
384
|
+
<td><code>/api/health</code></td>
|
|
385
|
+
<td>Healthcheck uptime probe</td>
|
|
386
|
+
<td><code>{ status: "UP", timestamp: "..." }</code></td>
|
|
387
|
+
</tr>
|
|
388
|
+
<tr>
|
|
389
|
+
<td><span style="color:var(--accent-neon);">GET</span></td>
|
|
390
|
+
<td><code>/api/cards</code></td>
|
|
391
|
+
<td>Get active task cards array</td>
|
|
392
|
+
<td><code>{ status: "SUCCESS", cards: [...] }</code></td>
|
|
393
|
+
</tr>
|
|
394
|
+
<tr>
|
|
395
|
+
<td><span style="color:var(--accent-cyan);">POST</span></td>
|
|
396
|
+
<td><code>/api/cards</code></td>
|
|
397
|
+
<td>Create new task card from prompt</td>
|
|
398
|
+
<td><code>{ prompt: "...", category: "..." }</code></td>
|
|
399
|
+
</tr>
|
|
400
|
+
<tr>
|
|
401
|
+
<td><span style="color:var(--accent-neon);">GET</span></td>
|
|
402
|
+
<td><code>/index.html</code></td>
|
|
403
|
+
<td>Serve Visual Architecture Dashboard</td>
|
|
404
|
+
<td><code>HTML5 Static Dashboard</code></td>
|
|
405
|
+
</tr>
|
|
406
|
+
</tbody>
|
|
407
|
+
</table>
|
|
408
|
+
</div>
|
|
409
|
+
|
|
410
|
+
</div>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
<!-- TAB 3: SƠ ĐỒ TUẦN TỰ WORKFLOW -->
|
|
414
|
+
<div id="tab-workflow" class="tab-content">
|
|
415
|
+
<div class="grid-container">
|
|
416
|
+
|
|
417
|
+
<!-- Sequence: Card Creation -->
|
|
418
|
+
<div class="doc-card">
|
|
419
|
+
<div class="doc-title">
|
|
420
|
+
<span>🔄 CARD CREATION SEQUENCE (sequence-card-creation.md)</span>
|
|
421
|
+
<a href="docs/workflow/sequence-card-creation.md" class="doc-link">DOC MD ↗</a>
|
|
422
|
+
</div>
|
|
423
|
+
<div class="mermaid-box">
|
|
424
|
+
<pre class="mermaid">
|
|
425
|
+
sequenceDiagram
|
|
426
|
+
actor User as User / Terminal
|
|
427
|
+
participant Server as src/index.js
|
|
428
|
+
participant Engine as card-manager.js
|
|
429
|
+
participant Guard as scope-enforcer.js
|
|
430
|
+
participant Storage as data/cards.json
|
|
431
|
+
|
|
432
|
+
User->>Server: POST /api/cards
|
|
433
|
+
Server->>Engine: processUserPrompt()
|
|
434
|
+
Engine->>Engine: detectScopeFromPrompt()
|
|
435
|
+
Engine->>Guard: validateAction()
|
|
436
|
+
Guard-->>Engine: SCOPE_PASSED
|
|
437
|
+
Engine->>Storage: Save Card IN_PROGRESS
|
|
438
|
+
Engine-->>Server: Return Card
|
|
439
|
+
Server-->>User: 201 Created
|
|
440
|
+
</pre>
|
|
441
|
+
</div>
|
|
442
|
+
</div>
|
|
443
|
+
|
|
444
|
+
<!-- Sequence: Scope Validation -->
|
|
445
|
+
<div class="doc-card">
|
|
446
|
+
<div class="doc-title">
|
|
447
|
+
<span>🛡 SCOPE VALIDATION SEQUENCE (sequence-scope-validation.md)</span>
|
|
448
|
+
<a href="docs/workflow/sequence-scope-validation.md" class="doc-link">DOC MD ↗</a>
|
|
449
|
+
</div>
|
|
450
|
+
<div class="mermaid-box">
|
|
451
|
+
<pre class="mermaid">
|
|
452
|
+
sequenceDiagram
|
|
453
|
+
actor Subagent as AI Subagent
|
|
454
|
+
participant Engine as card-manager.js
|
|
455
|
+
participant Guard as scope-enforcer.js
|
|
456
|
+
|
|
457
|
+
Subagent->>Engine: modifyFileWithScopeCheck("payment.js")
|
|
458
|
+
Engine->>Guard: validateAction("SCOPE_DIAGRAM", "payment.js")
|
|
459
|
+
Guard-->>Engine: SCOPE_VIOLATION_BLOCKED
|
|
460
|
+
Engine-->>Subagent: BLOCK ACTION & Log Exception ⛔
|
|
461
|
+
</pre>
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
|
|
465
|
+
</div>
|
|
466
|
+
</div>
|
|
467
|
+
|
|
468
|
+
<!-- TAB 4: BẢO MẬT & ADR DECISIONS -->
|
|
469
|
+
<div id="tab-security" class="tab-content">
|
|
470
|
+
<div class="grid-container">
|
|
471
|
+
|
|
472
|
+
<!-- Security Architecture -->
|
|
473
|
+
<div class="doc-card">
|
|
474
|
+
<div class="doc-title">
|
|
475
|
+
<span>🛡 SECURITY ARCHITECTURE (security.md)</span>
|
|
476
|
+
<a href="docs/security/security.md" class="doc-link">DOC MD ↗</a>
|
|
477
|
+
</div>
|
|
478
|
+
<div class="mermaid-box">
|
|
479
|
+
<pre class="mermaid">
|
|
480
|
+
graph TD
|
|
481
|
+
UserAction["User / AI Action Request"] --> ScopeGuard["scope-enforcer.js"]
|
|
482
|
+
ScopeGuard --> PathCheck{"File in Scope Allowed Paths?"}
|
|
483
|
+
PathCheck -->|No| Blocked["SCOPE_VIOLATION_BLOCKED ⛔"]
|
|
484
|
+
PathCheck -->|Yes| TraversalCheck{"Path Traversal Safe?"}
|
|
485
|
+
TraversalCheck -->|Yes| Allowed["SCOPE_PASSED ✅"]
|
|
486
|
+
</pre>
|
|
487
|
+
</div>
|
|
488
|
+
</div>
|
|
489
|
+
|
|
490
|
+
<!-- Architecture Decision Records (ADRs) -->
|
|
491
|
+
<div class="doc-card">
|
|
492
|
+
<div class="doc-title">
|
|
493
|
+
<span>📜 ARCHITECTURE DECISION RECORDS (ADR-001 & ADR-002)</span>
|
|
494
|
+
<a href="docs/adr/ADR-001.md" class="doc-link">ADR-001 ↗</a>
|
|
495
|
+
<a href="docs/adr/ADR-002.md" class="doc-link">ADR-002 ↗</a>
|
|
496
|
+
</div>
|
|
497
|
+
<table class="table-sharp">
|
|
498
|
+
<thead>
|
|
499
|
+
<tr>
|
|
500
|
+
<th>ADR ID</th>
|
|
501
|
+
<th>DECISION TITLE</th>
|
|
502
|
+
<th>STATUS</th>
|
|
503
|
+
<th>REASON / BENEFIT</th>
|
|
504
|
+
</tr>
|
|
505
|
+
</thead>
|
|
506
|
+
<tbody>
|
|
507
|
+
<tr>
|
|
508
|
+
<td><strong>ADR-001</strong></td>
|
|
509
|
+
<td>Loại bỏ Docker & SQL chọn Nén Thẻ Phân Cấp 3 Tầng</td>
|
|
510
|
+
<td><span style="color:var(--accent-neon);">APPROVED</span></td>
|
|
511
|
+
<td>Giúp bộ Skill siêu nhẹ 100%, 0 dependency, không tốn tài nguyên server.</td>
|
|
512
|
+
</tr>
|
|
513
|
+
<tr>
|
|
514
|
+
<td><strong>ADR-002</strong></td>
|
|
515
|
+
<td>Khóa Ranh Giới Scope (Strict Scope Enforcer Guard)</td>
|
|
516
|
+
<td><span style="color:var(--accent-neon);">APPROVED</span></td>
|
|
517
|
+
<td>Chống AI lan man, bảo vệ Token Budget và ngăn đè hỏng code khác scope.</td>
|
|
518
|
+
</tr>
|
|
519
|
+
</tbody>
|
|
520
|
+
</table>
|
|
521
|
+
</div>
|
|
522
|
+
|
|
523
|
+
</div>
|
|
524
|
+
</div>
|
|
525
|
+
|
|
526
|
+
<footer>
|
|
527
|
+
MASTER SYSTEM ARCHITECTURE VISUAL INDEX DASHBOARD // GENERATED IN INDEX.HTML
|
|
528
|
+
</footer>
|
|
529
|
+
|
|
530
|
+
<script>
|
|
531
|
+
function switchTab(tabId) {
|
|
532
|
+
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('active'));
|
|
533
|
+
document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active'));
|
|
534
|
+
|
|
535
|
+
event.target.classList.add('active');
|
|
536
|
+
document.getElementById(tabId).classList.add('active');
|
|
537
|
+
}
|
|
538
|
+
</script>
|
|
539
|
+
</body>
|
|
540
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lunar-skills",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Lunar Proactive AI Skill System & Hierarchical 10-in-1 Compaction Engine for AI Agents & CLI Workflows",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"lunar-skills": "bin/cli.js",
|
|
8
|
+
"lunar-verify": "scripts/verify-system.js"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/ThanhluanGif/skills.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/ThanhluanGif/skills/issues"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/ThanhluanGif/skills#readme",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"postinstall": "node scripts/install-skills.js",
|
|
20
|
+
"start": "node src/index.js",
|
|
21
|
+
"dev": "node src/index.js",
|
|
22
|
+
"test": "node scripts/verify-system.js",
|
|
23
|
+
"verify": "node scripts/verify-system.js",
|
|
24
|
+
"cards": "node scripts/card-manager.js"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"lunar",
|
|
28
|
+
"lunar-skills",
|
|
29
|
+
"proactive-ai",
|
|
30
|
+
"compaction-engine",
|
|
31
|
+
"gemini-cli",
|
|
32
|
+
"antigravity",
|
|
33
|
+
"scope-guard",
|
|
34
|
+
"vibe-coding"
|
|
35
|
+
],
|
|
36
|
+
"author": "Thanh Luan Gif (ThanhluanGif)",
|
|
37
|
+
"license": "ISC"
|
|
38
|
+
}
|