add-skill-kit 3.2.5 → 3.2.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 +179 -119
- package/bin/lib/commands/install.js +53 -14
- package/package.json +2 -2
- package/lib/agent-cli/lib/auto_preview.py +0 -148
- package/lib/agent-cli/lib/checklist.py +0 -222
- package/lib/agent-cli/lib/session_manager.py +0 -120
- package/lib/agent-cli/lib/verify_all.py +0 -327
package/README.md
CHANGED
|
@@ -1,149 +1,222 @@
|
|
|
1
|
-
#
|
|
1
|
+
# add-skill-kit
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **CLI installer for Agent Skill Kit - FAANG-grade AI skills, workflows, and agents**
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/add-skill-kit)
|
|
6
|
+
[](https://www.npmjs.com/package/add-skill-kit)
|
|
7
|
+
[](https://github.com/agentskillkit/add-skill-kit)
|
|
7
8
|
[](LICENSE)
|
|
8
9
|
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
### ⚡ Từ 0 → Production-Ready Trong 30 Giây
|
|
12
|
+
## ⚡ Installation
|
|
14
13
|
|
|
15
14
|
```bash
|
|
16
15
|
npx -y add-skill-kit agentskillkit/agent-skills
|
|
17
16
|
```
|
|
18
17
|
|
|
19
|
-
**
|
|
20
|
-
- 40+ skills chuyên môn
|
|
21
|
-
- 20 specialist agents
|
|
22
|
-
- 11 workflows có sẵn
|
|
23
|
-
- **✅ Agent CLI (`npx agent`) đã sẵn sàng**
|
|
18
|
+
**That's it!** One command installs everything:
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
| Component | Count | Description |
|
|
21
|
+
|-----------|-------|-------------|
|
|
22
|
+
| **Skills** | 49 | FAANG-grade coding skills |
|
|
23
|
+
| **Workflows** | 26 | `/think`, `/build`, `/autopilot`, etc. |
|
|
24
|
+
| **Agents** | 25 | Specialist AI agents |
|
|
25
|
+
| **Rules** | GEMINI.md | AI behavior configuration |
|
|
26
|
+
| **Scripts** | 25 | JavaScript automation scripts |
|
|
27
|
+
| **Commands** | `kit` | CLI management tool |
|
|
28
|
+
| **Commands** | `agent` | Interactive learning (optional) |
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
- ❌ Tìm kiếm prompts tốt trên internet
|
|
29
|
-
- ❌ Copy-paste vào từng project
|
|
30
|
-
- ❌ Maintain nhiều phiên bản khác nhau
|
|
30
|
+
---
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
- ✅ **1 source of truth** - Cập nhật trung tâm, mọi project đều nhận
|
|
34
|
-
- ✅ **Symlink install** - Không duplicate files
|
|
35
|
-
- ✅ **Version control** - Rollback bất cứ lúc nào
|
|
32
|
+
## 🎯 What This CLI Does
|
|
36
33
|
|
|
37
|
-
###
|
|
34
|
+
### 1. Fetches Skills from GitHub
|
|
38
35
|
|
|
39
36
|
```bash
|
|
40
|
-
#
|
|
41
|
-
npx
|
|
37
|
+
# Install from any GitHub repo
|
|
38
|
+
npx -y add-skill-kit <owner>/<repo>
|
|
39
|
+
|
|
40
|
+
# Examples:
|
|
41
|
+
npx -y add-skill-kit agentskillkit/agent-skills # Official skills
|
|
42
|
+
npx -y add-skill-kit myteam/company-skills # Custom skills
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Interactive Installation
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
┌───────────────────────────────────────────┐
|
|
49
|
+
│ 🛠️ Agent Skill Kit Installer │
|
|
50
|
+
├───────────────────────────────────────────┤
|
|
51
|
+
│ ◆ Select skills to install │
|
|
52
|
+
│ ◆ Choose install scope │
|
|
53
|
+
│ ◆ Configure AutoLearn (optional) │
|
|
54
|
+
│ ◆ Auto-install dependencies │
|
|
55
|
+
└───────────────────────────────────────────┘
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Creates Ready-to-Use Structure
|
|
42
59
|
|
|
43
|
-
# Từ nay AI sẽ nhớ mãi và không lặp lại
|
|
44
60
|
```
|
|
61
|
+
your-project/
|
|
62
|
+
├── .agent/
|
|
63
|
+
│ ├── GEMINI.md # AI Rules
|
|
64
|
+
│ ├── skills/ # 49 Skills
|
|
65
|
+
│ ├── workflows/ # 26 Workflows
|
|
66
|
+
│ ├── agents/ # 25 Agents
|
|
67
|
+
│ ├── knowledge/ # Learning memory
|
|
68
|
+
│ ├── config/ # Configuration
|
|
69
|
+
│ ├── scripts-js/ # Automation
|
|
70
|
+
│ └── metrics/ # Tracking
|
|
71
|
+
│
|
|
72
|
+
├── kit.cmd / kit # CLI wrapper
|
|
73
|
+
└── agent.cmd / agent # AutoLearn (optional)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 🔧 CLI Options
|
|
79
|
+
|
|
80
|
+
### Install Scope
|
|
81
|
+
|
|
82
|
+
| Option | Location | Best For |
|
|
83
|
+
|--------|----------|----------|
|
|
84
|
+
| **Project** | `.agent/` in current project | Single project |
|
|
85
|
+
| **Global** | `~/.gemini/antigravity/` | All projects |
|
|
86
|
+
|
|
87
|
+
### AutoLearn (Optional)
|
|
88
|
+
|
|
89
|
+
When prompted "Install AutoLearn?":
|
|
90
|
+
|
|
91
|
+
| Choice | Effect |
|
|
92
|
+
|--------|--------|
|
|
93
|
+
| **Yes** | Installs `agent` command for interactive learning |
|
|
94
|
+
| **No** | Core functionality works perfectly, just no `agent` CLI |
|
|
95
|
+
|
|
96
|
+
> **Note:** Choosing "No" does NOT affect workflows, skills, or agents.
|
|
45
97
|
|
|
46
98
|
---
|
|
47
99
|
|
|
48
|
-
##
|
|
100
|
+
## 📦 Commands After Installation
|
|
49
101
|
|
|
50
|
-
###
|
|
102
|
+
### `kit` Command (Always Available)
|
|
51
103
|
|
|
52
104
|
```bash
|
|
53
|
-
#
|
|
54
|
-
|
|
105
|
+
kit list # List all installed skills
|
|
106
|
+
kit validate # Validate skill structure
|
|
107
|
+
kit info <skill> # Show skill details
|
|
108
|
+
kit doctor # Check system health
|
|
109
|
+
kit cache status # View cache usage
|
|
110
|
+
kit cache clear # Clear cache
|
|
111
|
+
```
|
|
55
112
|
|
|
56
|
-
|
|
57
|
-
|
|
113
|
+
### `agent` Command (If AutoLearn Installed)
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
agent # Launch dashboard
|
|
117
|
+
agent learn # Teach patterns
|
|
118
|
+
agent recall # Scan violations
|
|
119
|
+
agent stats # View statistics
|
|
120
|
+
agent watch # Real-time monitor
|
|
58
121
|
```
|
|
59
122
|
|
|
60
|
-
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 🚀 Usage Examples
|
|
126
|
+
|
|
127
|
+
### Install Official Skills
|
|
61
128
|
|
|
62
129
|
```bash
|
|
63
|
-
|
|
64
|
-
|
|
130
|
+
npx -y add-skill-kit agentskillkit/agent-skills
|
|
131
|
+
```
|
|
65
132
|
|
|
66
|
-
|
|
67
|
-
add-skill-kit update
|
|
133
|
+
### Install Specific Skill
|
|
68
134
|
|
|
69
|
-
|
|
70
|
-
add-skill-kit
|
|
135
|
+
```bash
|
|
136
|
+
npx -y add-skill-kit agentskillkit/agent-skills/react-architect
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Install to Global Location
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npx -y add-skill-kit agentskillkit/agent-skills --global
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Force Reinstall
|
|
71
146
|
|
|
72
|
-
|
|
73
|
-
add-skill-kit
|
|
147
|
+
```bash
|
|
148
|
+
npx -y add-skill-kit agentskillkit/agent-skills --force
|
|
74
149
|
```
|
|
75
150
|
|
|
76
151
|
---
|
|
77
152
|
|
|
78
|
-
##
|
|
153
|
+
## 🗂️ What Gets Installed
|
|
79
154
|
|
|
80
|
-
|
|
81
|
-
|---------|---------------|---------------------|
|
|
82
|
-
| **Install time** | 30 giây | 30+ phút |
|
|
83
|
-
| **Cập nhật** | 1 lệnh | Manual mỗi file |
|
|
84
|
-
| **Consistency** | 100% đồng bộ | Dễ sai lệch |
|
|
85
|
-
| **Rollback** | ✅ Built-in | ❌ Manual backup |
|
|
86
|
-
| **Integrity check** | ✅ Merkle hash | ❌ Không có |
|
|
87
|
-
| **Self-learning** | ✅ Knowledge base | ❌ Không có |
|
|
155
|
+
### Complete Structure
|
|
88
156
|
|
|
89
|
-
|
|
157
|
+
```
|
|
158
|
+
.agent/
|
|
159
|
+
├── GEMINI.md # Supreme AI Rules
|
|
160
|
+
├── ARCHITECTURE.md # System Overview
|
|
161
|
+
├── CONTINUOUS_EXECUTION_POLICY.md # Autopilot Rules
|
|
162
|
+
├── WORKFLOW_CHAINS.md # Workflow Patterns
|
|
163
|
+
│
|
|
164
|
+
├── skills/ # 49 Skills
|
|
165
|
+
│ ├── auto-learner/
|
|
166
|
+
│ ├── react-architect/
|
|
167
|
+
│ ├── typescript-expert/
|
|
168
|
+
│ ├── debug-pro/
|
|
169
|
+
│ ├── studio/
|
|
170
|
+
│ └── ... (44 more)
|
|
171
|
+
│
|
|
172
|
+
├── workflows/ # 26 Workflows
|
|
173
|
+
│ ├── think.md
|
|
174
|
+
│ ├── build.md
|
|
175
|
+
│ ├── autopilot.md
|
|
176
|
+
│ └── ... (23 more)
|
|
177
|
+
│
|
|
178
|
+
├── agents/ # 25 Agents
|
|
179
|
+
│ ├── frontend-specialist.md
|
|
180
|
+
│ ├── backend-specialist.md
|
|
181
|
+
│ └── ... (23 more)
|
|
182
|
+
│
|
|
183
|
+
├── knowledge/ # Learning Memory
|
|
184
|
+
│ └── lessons-learned.yaml
|
|
185
|
+
│
|
|
186
|
+
├── config/ # Configuration
|
|
187
|
+
├── scripts-js/ # 25 JS Scripts
|
|
188
|
+
└── metrics/ # Performance
|
|
189
|
+
```
|
|
90
190
|
|
|
91
|
-
|
|
191
|
+
### Dependencies Auto-Installed
|
|
92
192
|
|
|
93
|
-
|
|
193
|
+
```bash
|
|
194
|
+
npm install # Node.js dependencies
|
|
195
|
+
```
|
|
94
196
|
|
|
95
|
-
|
|
96
|
-
|---------|-----------|
|
|
97
|
-
| `install` / `add` / `i` | Cài đặt skills từ GitHub |
|
|
98
|
-
| `uninstall` / `remove` / `rm` | Gỡ cài đặt |
|
|
99
|
-
| `update` | Cập nhật skills |
|
|
100
|
-
| `list` / `ls` | Liệt kê skills |
|
|
101
|
-
| `verify` | Kiểm tra integrity |
|
|
102
|
-
| `doctor` | Health check |
|
|
103
|
-
| `validate` / `check` | Validate spec |
|
|
104
|
-
| `analyze` | Phân tích skill |
|
|
105
|
-
| `info` / `show` | Thông tin skill |
|
|
106
|
-
| `lock` | Lock file |
|
|
107
|
-
| `cache` | Quản lý cache |
|
|
197
|
+
---
|
|
108
198
|
|
|
109
|
-
|
|
199
|
+
## 🔗 Related Packages
|
|
110
200
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
- **Merkle verification** - Đảm bảo integrity
|
|
201
|
+
| Package | Purpose |
|
|
202
|
+
|---------|---------|
|
|
203
|
+
| [agent-skills](https://github.com/agentskillkit/agent-skills) | Main skills repository |
|
|
204
|
+
| [add-skill-kit](https://www.npmjs.com/package/add-skill-kit) | This CLI installer |
|
|
116
205
|
|
|
117
|
-
|
|
206
|
+
---
|
|
118
207
|
|
|
119
|
-
|
|
208
|
+
## 📈 Version History
|
|
120
209
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### ⚡ 11 Slash Commands Có Sẵn
|
|
134
|
-
| Command | Chức năng |
|
|
135
|
-
|---------|-----------|
|
|
136
|
-
| `/brainstorm` | Khám phá options trước khi code |
|
|
137
|
-
| `/create` | Tạo features/apps mới |
|
|
138
|
-
| `/debug` | Debug có hệ thống |
|
|
139
|
-
| `/deploy` | Deploy production |
|
|
140
|
-
| `/enhance` | Thêm/cập nhật features |
|
|
141
|
-
| `/orchestrate` | Điều phối multi-agents |
|
|
142
|
-
| `/plan` | Lập kế hoạch task |
|
|
143
|
-
| `/preview` | Quản lý dev server |
|
|
144
|
-
| `/status` | Xem tiến độ project |
|
|
145
|
-
| `/test` | Tạo và chạy tests |
|
|
146
|
-
| `/ui-ux-pro-max` | Thiết kế UI chuyên sâu |
|
|
210
|
+
**v3.2.5 (Current)**
|
|
211
|
+
- ✅ 100% JavaScript - No Python required
|
|
212
|
+
- ✅ AutoLearn made optional
|
|
213
|
+
- ✅ Complete installation (config, scripts-js, metrics, policy docs)
|
|
214
|
+
- ✅ Improved error messages
|
|
215
|
+
- ✅ Wrapper scripts for `kit` and `agent`
|
|
216
|
+
|
|
217
|
+
**v3.2.0**
|
|
218
|
+
- Migrated all scripts to JavaScript
|
|
219
|
+
- Added `kit` CLI command
|
|
147
220
|
|
|
148
221
|
---
|
|
149
222
|
|
|
@@ -157,34 +230,21 @@ cd add-skill-kit
|
|
|
157
230
|
# Install dependencies
|
|
158
231
|
npm install
|
|
159
232
|
|
|
160
|
-
# Run
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
# Run linting
|
|
164
|
-
npm run lint
|
|
233
|
+
# Run locally
|
|
234
|
+
node bin/kit.js install agentskillkit/agent-skills
|
|
165
235
|
```
|
|
166
236
|
|
|
167
237
|
---
|
|
168
238
|
|
|
169
|
-
##
|
|
170
|
-
|
|
171
|
-
- Node.js 18+
|
|
172
|
-
- Git (để clone repositories)
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## 🔗 Links
|
|
239
|
+
## 📄 License
|
|
177
240
|
|
|
178
|
-
-
|
|
179
|
-
- [NPM Package](https://www.npmjs.com/package/add-skill-kit)
|
|
180
|
-
- [Issues](https://github.com/agentskillkit/add-skill-kit/issues)
|
|
241
|
+
MIT - Free for all projects.
|
|
181
242
|
|
|
182
243
|
---
|
|
183
244
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
MIT - Sử dụng tự do.
|
|
245
|
+
**⚡ add-skill-kit v3.2.5**
|
|
246
|
+
*One command. Complete AI setup.*
|
|
187
247
|
|
|
188
248
|
---
|
|
189
249
|
|
|
190
|
-
|
|
250
|
+
**[GitHub](https://github.com/agentskillkit/add-skill-kit) • [npm](https://www.npmjs.com/package/add-skill-kit) • [Issues](https://github.com/agentskillkit/add-skill-kit/issues)**
|
|
@@ -523,6 +523,58 @@ export async function run(spec) {
|
|
|
523
523
|
knowledgeInstalled = true;
|
|
524
524
|
}
|
|
525
525
|
|
|
526
|
+
// Install config/ if it exists (required for skill configuration)
|
|
527
|
+
const configDir = path.join(baseAgentDir, "config");
|
|
528
|
+
const targetConfigDir = path.join(WORKSPACE, "..", "config");
|
|
529
|
+
let configInstalled = false;
|
|
530
|
+
|
|
531
|
+
if (fs.existsSync(configDir) && !fs.existsSync(targetConfigDir)) {
|
|
532
|
+
fs.cpSync(configDir, targetConfigDir, { recursive: true });
|
|
533
|
+
step("Installed config/");
|
|
534
|
+
configInstalled = true;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// Install scripts-js/ if it exists (required for skill operations)
|
|
538
|
+
const scriptsJsDir = path.join(baseAgentDir, "scripts-js");
|
|
539
|
+
const targetScriptsJsDir = path.join(WORKSPACE, "..", "scripts-js");
|
|
540
|
+
let scriptsJsInstalled = false;
|
|
541
|
+
|
|
542
|
+
if (fs.existsSync(scriptsJsDir) && !fs.existsSync(targetScriptsJsDir)) {
|
|
543
|
+
fs.cpSync(scriptsJsDir, targetScriptsJsDir, { recursive: true });
|
|
544
|
+
step("Installed scripts-js/");
|
|
545
|
+
scriptsJsInstalled = true;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// Install metrics/ if it exists (for agent performance tracking)
|
|
549
|
+
const metricsDir = path.join(baseAgentDir, "metrics");
|
|
550
|
+
const targetMetricsDir = path.join(WORKSPACE, "..", "metrics");
|
|
551
|
+
let metricsInstalled = false;
|
|
552
|
+
|
|
553
|
+
if (fs.existsSync(metricsDir) && !fs.existsSync(targetMetricsDir)) {
|
|
554
|
+
fs.cpSync(metricsDir, targetMetricsDir, { recursive: true });
|
|
555
|
+
step("Installed metrics/");
|
|
556
|
+
metricsInstalled = true;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// Install additional policy documents
|
|
560
|
+
const policyDocs = [
|
|
561
|
+
"CONTINUOUS_EXECUTION_POLICY.md",
|
|
562
|
+
"WORKFLOW_CHAINS.md"
|
|
563
|
+
];
|
|
564
|
+
let policyDocsInstalled = 0;
|
|
565
|
+
|
|
566
|
+
for (const doc of policyDocs) {
|
|
567
|
+
const docSrc = path.join(baseAgentDir, doc);
|
|
568
|
+
const docDest = path.join(WORKSPACE, "..", doc);
|
|
569
|
+
if (fs.existsSync(docSrc) && !fs.existsSync(docDest)) {
|
|
570
|
+
fs.copyFileSync(docSrc, docDest);
|
|
571
|
+
policyDocsInstalled++;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
if (policyDocsInstalled > 0) {
|
|
575
|
+
step(`Installed ${policyDocsInstalled} policy docs`);
|
|
576
|
+
}
|
|
577
|
+
|
|
526
578
|
// Install rules if they exist
|
|
527
579
|
const rulesDir = path.join(baseAgentDir, "rules");
|
|
528
580
|
const targetRulesDir = path.join(WORKSPACE, "..", "rules");
|
|
@@ -743,20 +795,7 @@ export async function run(spec) {
|
|
|
743
795
|
step(c.dim("Run manually: npm install"));
|
|
744
796
|
}
|
|
745
797
|
|
|
746
|
-
//
|
|
747
|
-
const pythonReqPath = path.join(WORKSPACE, "..", "skills", "requirements.txt");
|
|
748
|
-
if (fs.existsSync(pythonReqPath)) {
|
|
749
|
-
stepLine();
|
|
750
|
-
const pySpinner = spinner();
|
|
751
|
-
pySpinner.start("Installing Python dependencies (PyYAML, etc.)");
|
|
752
|
-
try {
|
|
753
|
-
await execAsync(`pip install -r "${pythonReqPath}"`, { timeout: 120000 });
|
|
754
|
-
pySpinner.stop("Python dependencies installed");
|
|
755
|
-
} catch (e) {
|
|
756
|
-
pySpinner.stop(c.yellow("Python dependencies skipped"));
|
|
757
|
-
step(c.dim(`Run manually: pip install -r .agent/skills/requirements.txt`));
|
|
758
|
-
}
|
|
759
|
-
}
|
|
798
|
+
// Python dependencies no longer needed - all scripts migrated to JS
|
|
760
799
|
|
|
761
800
|
stepLine();
|
|
762
801
|
console.log(` ${c.cyan("Done!")}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "add-skill-kit",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"description": "Enterprise-grade Agent Skill Manager with Antigravity Skills support, Progressive Disclosure detection, and semantic routing validation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "agentskillkit <agentskillkit@gmail.com>",
|
|
@@ -75,4 +75,4 @@
|
|
|
75
75
|
"prettier": "^3.2.5",
|
|
76
76
|
"vitest": "^4.0.18"
|
|
77
77
|
}
|
|
78
|
-
}
|
|
78
|
+
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Auto Preview - Agent Skill Kit
|
|
4
|
-
==============================
|
|
5
|
-
Manages (start/stop/status) the local development server for previewing the application.
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
python .agent/scripts/auto_preview.py start [port]
|
|
9
|
-
python .agent/scripts/auto_preview.py stop
|
|
10
|
-
python .agent/scripts/auto_preview.py status
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
import os
|
|
14
|
-
import sys
|
|
15
|
-
import time
|
|
16
|
-
import json
|
|
17
|
-
import signal
|
|
18
|
-
import argparse
|
|
19
|
-
import subprocess
|
|
20
|
-
from pathlib import Path
|
|
21
|
-
|
|
22
|
-
AGENT_DIR = Path(".agent")
|
|
23
|
-
PID_FILE = AGENT_DIR / "preview.pid"
|
|
24
|
-
LOG_FILE = AGENT_DIR / "preview.log"
|
|
25
|
-
|
|
26
|
-
def get_project_root():
|
|
27
|
-
return Path(".").resolve()
|
|
28
|
-
|
|
29
|
-
def is_running(pid):
|
|
30
|
-
try:
|
|
31
|
-
os.kill(pid, 0)
|
|
32
|
-
return True
|
|
33
|
-
except OSError:
|
|
34
|
-
return False
|
|
35
|
-
|
|
36
|
-
def get_start_command(root):
|
|
37
|
-
pkg_file = root / "package.json"
|
|
38
|
-
if not pkg_file.exists():
|
|
39
|
-
return None
|
|
40
|
-
|
|
41
|
-
with open(pkg_file, 'r') as f:
|
|
42
|
-
data = json.load(f)
|
|
43
|
-
|
|
44
|
-
scripts = data.get("scripts", {})
|
|
45
|
-
if "dev" in scripts:
|
|
46
|
-
return ["npm", "run", "dev"]
|
|
47
|
-
elif "start" in scripts:
|
|
48
|
-
return ["npm", "start"]
|
|
49
|
-
return None
|
|
50
|
-
|
|
51
|
-
def start_server(port=3000):
|
|
52
|
-
if PID_FILE.exists():
|
|
53
|
-
try:
|
|
54
|
-
pid = int(PID_FILE.read_text().strip())
|
|
55
|
-
if is_running(pid):
|
|
56
|
-
print(f"⚠️ Preview already running (PID: {pid})")
|
|
57
|
-
return
|
|
58
|
-
except:
|
|
59
|
-
pass # Invalid PID file
|
|
60
|
-
|
|
61
|
-
root = get_project_root()
|
|
62
|
-
cmd = get_start_command(root)
|
|
63
|
-
|
|
64
|
-
if not cmd:
|
|
65
|
-
print("❌ No 'dev' or 'start' script found in package.json")
|
|
66
|
-
sys.exit(1)
|
|
67
|
-
|
|
68
|
-
# Add port env var if needed (simple heuristic)
|
|
69
|
-
env = os.environ.copy()
|
|
70
|
-
env["PORT"] = str(port)
|
|
71
|
-
|
|
72
|
-
print(f"🚀 Starting preview on port {port}...")
|
|
73
|
-
|
|
74
|
-
with open(LOG_FILE, "w") as log:
|
|
75
|
-
process = subprocess.Popen(
|
|
76
|
-
cmd,
|
|
77
|
-
cwd=str(root),
|
|
78
|
-
stdout=log,
|
|
79
|
-
stderr=log,
|
|
80
|
-
env=env,
|
|
81
|
-
shell=True # Required for npm on windows often, or consistent path handling
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
PID_FILE.write_text(str(process.pid))
|
|
85
|
-
print(f"✅ Preview started! (PID: {process.pid})")
|
|
86
|
-
print(f" Logs: {LOG_FILE}")
|
|
87
|
-
print(f" URL: http://localhost:{port}")
|
|
88
|
-
|
|
89
|
-
def stop_server():
|
|
90
|
-
if not PID_FILE.exists():
|
|
91
|
-
print("ℹ️ No preview server found.")
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
try:
|
|
95
|
-
pid = int(PID_FILE.read_text().strip())
|
|
96
|
-
if is_running(pid):
|
|
97
|
-
# Try gentle kill first
|
|
98
|
-
os.kill(pid, signal.SIGTERM) if sys.platform != 'win32' else subprocess.call(['taskkill', '/F', '/T', '/PID', str(pid)])
|
|
99
|
-
print(f"🛑 Preview stopped (PID: {pid})")
|
|
100
|
-
else:
|
|
101
|
-
print("ℹ️ Process was not running.")
|
|
102
|
-
except Exception as e:
|
|
103
|
-
print(f"❌ Error stopping server: {e}")
|
|
104
|
-
finally:
|
|
105
|
-
if PID_FILE.exists():
|
|
106
|
-
PID_FILE.unlink()
|
|
107
|
-
|
|
108
|
-
def status_server():
|
|
109
|
-
running = False
|
|
110
|
-
pid = None
|
|
111
|
-
url = "Unknown"
|
|
112
|
-
|
|
113
|
-
if PID_FILE.exists():
|
|
114
|
-
try:
|
|
115
|
-
pid = int(PID_FILE.read_text().strip())
|
|
116
|
-
if is_running(pid):
|
|
117
|
-
running = True
|
|
118
|
-
# Heuristic for URL, strictly we should save it
|
|
119
|
-
url = "http://localhost:3000"
|
|
120
|
-
except:
|
|
121
|
-
pass
|
|
122
|
-
|
|
123
|
-
print("\n=== Preview Status ===")
|
|
124
|
-
if running:
|
|
125
|
-
print(f"✅ Status: Running")
|
|
126
|
-
print(f"🔢 PID: {pid}")
|
|
127
|
-
print(f"🌐 URL: {url} (Likely)")
|
|
128
|
-
print(f"📝 Logs: {LOG_FILE}")
|
|
129
|
-
else:
|
|
130
|
-
print("⚪ Status: Stopped")
|
|
131
|
-
print("===================\n")
|
|
132
|
-
|
|
133
|
-
def main():
|
|
134
|
-
parser = argparse.ArgumentParser()
|
|
135
|
-
parser.add_argument("action", choices=["start", "stop", "status"])
|
|
136
|
-
parser.add_argument("port", nargs="?", default="3000")
|
|
137
|
-
|
|
138
|
-
args = parser.parse_args()
|
|
139
|
-
|
|
140
|
-
if args.action == "start":
|
|
141
|
-
start_server(int(args.port))
|
|
142
|
-
elif args.action == "stop":
|
|
143
|
-
stop_server()
|
|
144
|
-
elif args.action == "status":
|
|
145
|
-
status_server()
|
|
146
|
-
|
|
147
|
-
if __name__ == "__main__":
|
|
148
|
-
main()
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Master Checklist Runner - Agent Skill Kit
|
|
4
|
-
==========================================
|
|
5
|
-
|
|
6
|
-
Orchestrates all validation scripts in priority order.
|
|
7
|
-
Use this for incremental validation during development.
|
|
8
|
-
|
|
9
|
-
Usage:
|
|
10
|
-
python scripts/checklist.py . # Run core checks
|
|
11
|
-
python scripts/checklist.py . --url <URL> # Include performance checks
|
|
12
|
-
|
|
13
|
-
Priority Order:
|
|
14
|
-
P0: Security Scan (vulnerabilities, secrets)
|
|
15
|
-
P1: Lint & Type Check (code quality)
|
|
16
|
-
P2: Schema Validation (if database exists)
|
|
17
|
-
P3: Test Runner (unit/integration tests)
|
|
18
|
-
P4: UX Audit (psychology laws, accessibility)
|
|
19
|
-
P5: SEO Check (meta tags, structure)
|
|
20
|
-
P6: Performance (lighthouse - requires URL)
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
import sys
|
|
24
|
-
import subprocess
|
|
25
|
-
import argparse
|
|
26
|
-
from pathlib import Path
|
|
27
|
-
from typing import List, Tuple, Optional
|
|
28
|
-
|
|
29
|
-
# ANSI colors for terminal output
|
|
30
|
-
class Colors:
|
|
31
|
-
HEADER = '\033[95m'
|
|
32
|
-
BLUE = '\033[94m'
|
|
33
|
-
CYAN = '\033[96m'
|
|
34
|
-
GREEN = '\033[92m'
|
|
35
|
-
YELLOW = '\033[93m'
|
|
36
|
-
RED = '\033[91m'
|
|
37
|
-
ENDC = '\033[0m'
|
|
38
|
-
BOLD = '\033[1m'
|
|
39
|
-
|
|
40
|
-
def print_header(text: str):
|
|
41
|
-
print(f"\n{Colors.BOLD}{Colors.CYAN}{'='*60}{Colors.ENDC}")
|
|
42
|
-
print(f"{Colors.BOLD}{Colors.CYAN}{text.center(60)}{Colors.ENDC}")
|
|
43
|
-
print(f"{Colors.BOLD}{Colors.CYAN}{'='*60}{Colors.ENDC}\n")
|
|
44
|
-
|
|
45
|
-
def print_step(text: str):
|
|
46
|
-
print(f"{Colors.BOLD}{Colors.BLUE}🔄 {text}{Colors.ENDC}")
|
|
47
|
-
|
|
48
|
-
def print_success(text: str):
|
|
49
|
-
print(f"{Colors.GREEN}✅ {text}{Colors.ENDC}")
|
|
50
|
-
|
|
51
|
-
def print_warning(text: str):
|
|
52
|
-
print(f"{Colors.YELLOW}⚠️ {text}{Colors.ENDC}")
|
|
53
|
-
|
|
54
|
-
def print_error(text: str):
|
|
55
|
-
print(f"{Colors.RED}❌ {text}{Colors.ENDC}")
|
|
56
|
-
|
|
57
|
-
# Define priority-ordered checks
|
|
58
|
-
CORE_CHECKS = [
|
|
59
|
-
("Security Scan", ".agent/skills/vulnerability-scanner/scripts/security_scan.py", True),
|
|
60
|
-
("Smart Audit", ".agent/scripts/audit.js", True),
|
|
61
|
-
("Lint Check", ".agent/skills/lint-and-validate/scripts/lint_runner.py", True),
|
|
62
|
-
("Schema Validation", ".agent/skills/database-design/scripts/schema_validator.py", False),
|
|
63
|
-
("Test Runner", ".agent/skills/testing-patterns/scripts/test_runner.py", False),
|
|
64
|
-
("UX Audit", ".agent/skills/frontend-design/scripts/ux_audit.py", False),
|
|
65
|
-
("SEO Check", ".agent/skills/seo-fundamentals/scripts/seo_checker.py", False),
|
|
66
|
-
]
|
|
67
|
-
|
|
68
|
-
PERFORMANCE_CHECKS = [
|
|
69
|
-
("Lighthouse Audit", ".agent/skills/performance-profiling/scripts/lighthouse_audit.py", True),
|
|
70
|
-
("Playwright E2E", ".agent/skills/webapp-testing/scripts/playwright_runner.py", False),
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
def check_script_exists(script_path: Path) -> bool:
|
|
74
|
-
"""Check if script file exists"""
|
|
75
|
-
return script_path.exists() and script_path.is_file()
|
|
76
|
-
|
|
77
|
-
def run_script(name: str, script_path: Path, project_path: str, url: Optional[str] = None) -> dict:
|
|
78
|
-
"""
|
|
79
|
-
Run a validation script and capture results
|
|
80
|
-
|
|
81
|
-
Returns:
|
|
82
|
-
dict with keys: name, passed, output, skipped
|
|
83
|
-
"""
|
|
84
|
-
if not check_script_exists(script_path):
|
|
85
|
-
print_warning(f"{name}: Script not found, skipping")
|
|
86
|
-
return {"name": name, "passed": True, "output": "", "skipped": True}
|
|
87
|
-
|
|
88
|
-
print_step(f"Running: {name}")
|
|
89
|
-
|
|
90
|
-
# Build command
|
|
91
|
-
if str(script_path).endswith('.js'):
|
|
92
|
-
cmd = ["node", str(script_path), project_path]
|
|
93
|
-
else:
|
|
94
|
-
cmd = ["python", str(script_path), project_path]
|
|
95
|
-
|
|
96
|
-
if url and ("lighthouse" in script_path.name.lower() or "playwright" in script_path.name.lower()):
|
|
97
|
-
cmd.append(url)
|
|
98
|
-
|
|
99
|
-
# Run script
|
|
100
|
-
try:
|
|
101
|
-
result = subprocess.run(
|
|
102
|
-
cmd,
|
|
103
|
-
capture_output=True,
|
|
104
|
-
text=True,
|
|
105
|
-
timeout=300 # 5 minute timeout
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
passed = result.returncode == 0
|
|
109
|
-
|
|
110
|
-
if passed:
|
|
111
|
-
print_success(f"{name}: PASSED")
|
|
112
|
-
else:
|
|
113
|
-
print_error(f"{name}: FAILED")
|
|
114
|
-
if result.stderr:
|
|
115
|
-
print(f" Error: {result.stderr[:200]}")
|
|
116
|
-
|
|
117
|
-
return {
|
|
118
|
-
"name": name,
|
|
119
|
-
"passed": passed,
|
|
120
|
-
"output": result.stdout,
|
|
121
|
-
"error": result.stderr,
|
|
122
|
-
"skipped": False
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
except subprocess.TimeoutExpired:
|
|
126
|
-
print_error(f"{name}: TIMEOUT (>5 minutes)")
|
|
127
|
-
return {"name": name, "passed": False, "output": "", "error": "Timeout", "skipped": False}
|
|
128
|
-
|
|
129
|
-
except Exception as e:
|
|
130
|
-
print_error(f"{name}: ERROR - {str(e)}")
|
|
131
|
-
return {"name": name, "passed": False, "output": "", "error": str(e), "skipped": False}
|
|
132
|
-
|
|
133
|
-
def print_summary(results: List[dict]):
|
|
134
|
-
"""Print final summary report"""
|
|
135
|
-
print_header("📊 CHECKLIST SUMMARY")
|
|
136
|
-
|
|
137
|
-
passed_count = sum(1 for r in results if r["passed"] and not r.get("skipped"))
|
|
138
|
-
failed_count = sum(1 for r in results if not r["passed"] and not r.get("skipped"))
|
|
139
|
-
skipped_count = sum(1 for r in results if r.get("skipped"))
|
|
140
|
-
|
|
141
|
-
print(f"Total Checks: {len(results)}")
|
|
142
|
-
print(f"{Colors.GREEN}✅ Passed: {passed_count}{Colors.ENDC}")
|
|
143
|
-
print(f"{Colors.RED}❌ Failed: {failed_count}{Colors.ENDC}")
|
|
144
|
-
print(f"{Colors.YELLOW}⏭️ Skipped: {skipped_count}{Colors.ENDC}")
|
|
145
|
-
print()
|
|
146
|
-
|
|
147
|
-
# Detailed results
|
|
148
|
-
for r in results:
|
|
149
|
-
if r.get("skipped"):
|
|
150
|
-
status = f"{Colors.YELLOW}⏭️ {Colors.ENDC}"
|
|
151
|
-
elif r["passed"]:
|
|
152
|
-
status = f"{Colors.GREEN}✅{Colors.ENDC}"
|
|
153
|
-
else:
|
|
154
|
-
status = f"{Colors.RED}❌{Colors.ENDC}"
|
|
155
|
-
|
|
156
|
-
print(f"{status} {r['name']}")
|
|
157
|
-
|
|
158
|
-
print()
|
|
159
|
-
|
|
160
|
-
if failed_count > 0:
|
|
161
|
-
print_error(f"{failed_count} check(s) FAILED - Please fix before proceeding")
|
|
162
|
-
return False
|
|
163
|
-
else:
|
|
164
|
-
print_success("All checks PASSED ✨")
|
|
165
|
-
return True
|
|
166
|
-
|
|
167
|
-
def main():
|
|
168
|
-
parser = argparse.ArgumentParser(
|
|
169
|
-
description="Run Agent Skill Kit validation checklist",
|
|
170
|
-
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
171
|
-
epilog="""
|
|
172
|
-
Examples:
|
|
173
|
-
python scripts/checklist.py . # Core checks only
|
|
174
|
-
python scripts/checklist.py . --url http://localhost:3000 # Include performance
|
|
175
|
-
"""
|
|
176
|
-
)
|
|
177
|
-
parser.add_argument("project", help="Project path to validate")
|
|
178
|
-
parser.add_argument("--url", help="URL for performance checks (lighthouse, playwright)")
|
|
179
|
-
parser.add_argument("--skip-performance", action="store_true", help="Skip performance checks even if URL provided")
|
|
180
|
-
|
|
181
|
-
args = parser.parse_args()
|
|
182
|
-
|
|
183
|
-
project_path = Path(args.project).resolve()
|
|
184
|
-
|
|
185
|
-
if not project_path.exists():
|
|
186
|
-
print_error(f"Project path does not exist: {project_path}")
|
|
187
|
-
sys.exit(1)
|
|
188
|
-
|
|
189
|
-
print_header("🚀 AGENT SKILLS KIT - MASTER CHECKLIST")
|
|
190
|
-
print(f"Project: {project_path}")
|
|
191
|
-
print(f"URL: {args.url if args.url else 'Not provided (performance checks skipped)'}")
|
|
192
|
-
|
|
193
|
-
results = []
|
|
194
|
-
|
|
195
|
-
# Run core checks
|
|
196
|
-
print_header("📋 CORE CHECKS")
|
|
197
|
-
for name, script_path, required in CORE_CHECKS:
|
|
198
|
-
script = project_path / script_path
|
|
199
|
-
result = run_script(name, script, str(project_path))
|
|
200
|
-
results.append(result)
|
|
201
|
-
|
|
202
|
-
# If required check fails, stop
|
|
203
|
-
if required and not result["passed"] and not result.get("skipped"):
|
|
204
|
-
print_error(f"CRITICAL: {name} failed. Stopping checklist.")
|
|
205
|
-
print_summary(results)
|
|
206
|
-
sys.exit(1)
|
|
207
|
-
|
|
208
|
-
# Run performance checks if URL provided
|
|
209
|
-
if args.url and not args.skip_performance:
|
|
210
|
-
print_header("⚡ PERFORMANCE CHECKS")
|
|
211
|
-
for name, script_path, required in PERFORMANCE_CHECKS:
|
|
212
|
-
script = project_path / script_path
|
|
213
|
-
result = run_script(name, script, str(project_path), args.url)
|
|
214
|
-
results.append(result)
|
|
215
|
-
|
|
216
|
-
# Print summary
|
|
217
|
-
all_passed = print_summary(results)
|
|
218
|
-
|
|
219
|
-
sys.exit(0 if all_passed else 1)
|
|
220
|
-
|
|
221
|
-
if __name__ == "__main__":
|
|
222
|
-
main()
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Session Manager - Agent Skill Kit
|
|
4
|
-
=================================
|
|
5
|
-
Analyzes project state, detects tech stack, tracks file statistics, and provides
|
|
6
|
-
a summary of the current session.
|
|
7
|
-
|
|
8
|
-
Usage:
|
|
9
|
-
python .agent/scripts/session_manager.py status [path]
|
|
10
|
-
python .agent/scripts/session_manager.py info [path]
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
import os
|
|
14
|
-
import json
|
|
15
|
-
import argparse
|
|
16
|
-
from pathlib import Path
|
|
17
|
-
from typing import Dict, Any, List
|
|
18
|
-
|
|
19
|
-
def get_project_root(path: str) -> Path:
|
|
20
|
-
return Path(path).resolve()
|
|
21
|
-
|
|
22
|
-
def analyze_package_json(root: Path) -> Dict[str, Any]:
|
|
23
|
-
pkg_file = root / "package.json"
|
|
24
|
-
if not pkg_file.exists():
|
|
25
|
-
return {"type": "unknown", "dependencies": {}}
|
|
26
|
-
|
|
27
|
-
try:
|
|
28
|
-
with open(pkg_file, 'r', encoding='utf-8') as f:
|
|
29
|
-
data = json.load(f)
|
|
30
|
-
|
|
31
|
-
deps = data.get("dependencies", {})
|
|
32
|
-
dev_deps = data.get("devDependencies", {})
|
|
33
|
-
all_deps = {**deps, **dev_deps}
|
|
34
|
-
|
|
35
|
-
stack = []
|
|
36
|
-
if "next" in all_deps: stack.append("Next.js")
|
|
37
|
-
elif "react" in all_deps: stack.append("React")
|
|
38
|
-
elif "vue" in all_deps: stack.append("Vue")
|
|
39
|
-
elif "svelte" in all_deps: stack.append("Svelte")
|
|
40
|
-
elif "express" in all_deps: stack.append("Express")
|
|
41
|
-
elif "nestjs" in all_deps or "@nestjs/core" in all_deps: stack.append("NestJS")
|
|
42
|
-
|
|
43
|
-
if "tailwindcss" in all_deps: stack.append("Tailwind CSS")
|
|
44
|
-
if "prisma" in all_deps: stack.append("Prisma")
|
|
45
|
-
if "typescript" in all_deps: stack.append("TypeScript")
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
"name": data.get("name", "unnamed"),
|
|
49
|
-
"version": data.get("version", "0.0.0"),
|
|
50
|
-
"stack": stack,
|
|
51
|
-
"scripts": list(data.get("scripts", {}).keys())
|
|
52
|
-
}
|
|
53
|
-
except Exception as e:
|
|
54
|
-
return {"error": str(e)}
|
|
55
|
-
|
|
56
|
-
def count_files(root: Path) -> Dict[str, int]:
|
|
57
|
-
stats = {"created": 0, "modified": 0, "total": 0}
|
|
58
|
-
# Simple count for now, comprehensive tracking would require git diff or extensive history
|
|
59
|
-
exclude = {".git", "node_modules", ".next", "dist", "build", ".agent", ".gemini", "__pycache__"}
|
|
60
|
-
|
|
61
|
-
for root_dir, dirs, files in os.walk(root):
|
|
62
|
-
dirs[:] = [d for d in dirs if d not in exclude]
|
|
63
|
-
stats["total"] += len(files)
|
|
64
|
-
|
|
65
|
-
return stats
|
|
66
|
-
|
|
67
|
-
def detect_features(root: Path) -> List[str]:
|
|
68
|
-
# Heuristic: look at folder names in src/
|
|
69
|
-
features = []
|
|
70
|
-
src = root / "src"
|
|
71
|
-
if src.exists():
|
|
72
|
-
possible_dirs = ["components", "modules", "features", "app", "pages", "services"]
|
|
73
|
-
for d in possible_dirs:
|
|
74
|
-
p = src / d
|
|
75
|
-
if p.exists() and p.is_dir():
|
|
76
|
-
# List subdirectories as likely features
|
|
77
|
-
for child in p.iterdir():
|
|
78
|
-
if child.is_dir():
|
|
79
|
-
features.append(child.name)
|
|
80
|
-
return features[:10] # Limit to top 10
|
|
81
|
-
|
|
82
|
-
def print_status(root: Path):
|
|
83
|
-
info = analyze_package_json(root)
|
|
84
|
-
stats = count_files(root)
|
|
85
|
-
features = detect_features(root)
|
|
86
|
-
|
|
87
|
-
print("\n=== Project Status ===")
|
|
88
|
-
print(f"\n📁 Project: {info.get('name', root.name)}")
|
|
89
|
-
print(f"📂 Path: {root}")
|
|
90
|
-
print(f"🏷️ Type: {', '.join(info.get('stack', ['Generic']))}")
|
|
91
|
-
print(f"📊 Status: Active")
|
|
92
|
-
|
|
93
|
-
print("\n🔧 Tech Stack:")
|
|
94
|
-
for tech in info.get('stack', []):
|
|
95
|
-
print(f" • {tech}")
|
|
96
|
-
|
|
97
|
-
print(f"\n✅ Detected Modules/Features ({len(features)}):")
|
|
98
|
-
for feat in features:
|
|
99
|
-
print(f" • {feat}")
|
|
100
|
-
if not features:
|
|
101
|
-
print(" (No distinct feature modules detected)")
|
|
102
|
-
|
|
103
|
-
print(f"\n📄 Files: {stats['total']} total files tracked")
|
|
104
|
-
print("\n====================\n")
|
|
105
|
-
|
|
106
|
-
def main():
|
|
107
|
-
parser = argparse.ArgumentParser(description="Session Manager")
|
|
108
|
-
parser.add_argument("command", choices=["status", "info"], help="Command to run")
|
|
109
|
-
parser.add_argument("path", nargs="?", default=".", help="Project path")
|
|
110
|
-
|
|
111
|
-
args = parser.parse_args()
|
|
112
|
-
root = get_project_root(args.path)
|
|
113
|
-
|
|
114
|
-
if args.command == "status":
|
|
115
|
-
print_status(root)
|
|
116
|
-
elif args.command == "info":
|
|
117
|
-
print(json.dumps(analyze_package_json(root), indent=2))
|
|
118
|
-
|
|
119
|
-
if __name__ == "__main__":
|
|
120
|
-
main()
|
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Full Verification Suite - Agent Skill Kit
|
|
4
|
-
==========================================
|
|
5
|
-
|
|
6
|
-
Runs COMPLETE validation including all checks + performance + E2E.
|
|
7
|
-
Use this before deployment or major releases.
|
|
8
|
-
|
|
9
|
-
Usage:
|
|
10
|
-
python scripts/verify_all.py . --url <URL>
|
|
11
|
-
|
|
12
|
-
Includes ALL checks:
|
|
13
|
-
✅ Security Scan (OWASP, secrets, dependencies)
|
|
14
|
-
✅ Lint & Type Coverage
|
|
15
|
-
✅ Schema Validation
|
|
16
|
-
✅ Test Suite (unit + integration)
|
|
17
|
-
✅ UX Audit (psychology, accessibility)
|
|
18
|
-
✅ SEO Check
|
|
19
|
-
✅ Lighthouse (Core Web Vitals)
|
|
20
|
-
✅ Playwright E2E
|
|
21
|
-
✅ Bundle Analysis (if applicable)
|
|
22
|
-
✅ Mobile Audit (if applicable)
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
import sys
|
|
26
|
-
import subprocess
|
|
27
|
-
import argparse
|
|
28
|
-
from pathlib import Path
|
|
29
|
-
from typing import List, Dict, Optional
|
|
30
|
-
from datetime import datetime
|
|
31
|
-
|
|
32
|
-
# ANSI colors
|
|
33
|
-
class Colors:
|
|
34
|
-
HEADER = '\033[95m'
|
|
35
|
-
BLUE = '\033[94m'
|
|
36
|
-
CYAN = '\033[96m'
|
|
37
|
-
GREEN = '\033[92m'
|
|
38
|
-
YELLOW = '\033[93m'
|
|
39
|
-
RED = '\033[91m'
|
|
40
|
-
ENDC = '\033[0m'
|
|
41
|
-
BOLD = '\033[1m'
|
|
42
|
-
|
|
43
|
-
def print_header(text: str):
|
|
44
|
-
print(f"\n{Colors.BOLD}{Colors.CYAN}{'='*70}{Colors.ENDC}")
|
|
45
|
-
print(f"{Colors.BOLD}{Colors.CYAN}{text.center(70)}{Colors.ENDC}")
|
|
46
|
-
print(f"{Colors.BOLD}{Colors.CYAN}{'='*70}{Colors.ENDC}\n")
|
|
47
|
-
|
|
48
|
-
def print_step(text: str):
|
|
49
|
-
print(f"{Colors.BOLD}{Colors.BLUE}🔄 {text}{Colors.ENDC}")
|
|
50
|
-
|
|
51
|
-
def print_success(text: str):
|
|
52
|
-
print(f"{Colors.GREEN}✅ {text}{Colors.ENDC}")
|
|
53
|
-
|
|
54
|
-
def print_warning(text: str):
|
|
55
|
-
print(f"{Colors.YELLOW}⚠️ {text}{Colors.ENDC}")
|
|
56
|
-
|
|
57
|
-
def print_error(text: str):
|
|
58
|
-
print(f"{Colors.RED}❌ {text}{Colors.ENDC}")
|
|
59
|
-
|
|
60
|
-
# Complete verification suite
|
|
61
|
-
VERIFICATION_SUITE = [
|
|
62
|
-
# P0: Security (CRITICAL)
|
|
63
|
-
{
|
|
64
|
-
"category": "Security",
|
|
65
|
-
"checks": [
|
|
66
|
-
("Security Scan", ".agent/skills/vulnerability-scanner/scripts/security_scan.py", True),
|
|
67
|
-
("Dependency Analysis", ".agent/skills/vulnerability-scanner/scripts/dependency_analyzer.py", False),
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
# P1: Code Quality (CRITICAL)
|
|
72
|
-
{
|
|
73
|
-
"category": "Code Quality",
|
|
74
|
-
"checks": [
|
|
75
|
-
("Lint Check", ".agent/skills/lint-and-validate/scripts/lint_runner.py", True),
|
|
76
|
-
("Type Coverage", ".agent/skills/lint-and-validate/scripts/type_coverage.py", False),
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
# P2: Data Layer
|
|
81
|
-
{
|
|
82
|
-
"category": "Data Layer",
|
|
83
|
-
"checks": [
|
|
84
|
-
("Schema Validation", ".agent/skills/database-design/scripts/schema_validator.py", False),
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
# P3: Testing
|
|
89
|
-
{
|
|
90
|
-
"category": "Testing",
|
|
91
|
-
"checks": [
|
|
92
|
-
("Test Suite", ".agent/skills/testing-patterns/scripts/test_runner.py", False),
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
# P4: UX & Accessibility
|
|
97
|
-
{
|
|
98
|
-
"category": "UX & Accessibility",
|
|
99
|
-
"checks": [
|
|
100
|
-
("UX Audit", ".agent/skills/frontend-design/scripts/ux_audit.py", False),
|
|
101
|
-
("Accessibility Check", ".agent/skills/frontend-design/scripts/accessibility_checker.py", False),
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
# P5: SEO & Content
|
|
106
|
-
{
|
|
107
|
-
"category": "SEO & Content",
|
|
108
|
-
"checks": [
|
|
109
|
-
("SEO Check", ".agent/skills/seo-fundamentals/scripts/seo_checker.py", False),
|
|
110
|
-
("GEO Check", ".agent/skills/geo-fundamentals/scripts/geo_checker.py", False),
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
# P6: Performance (requires URL)
|
|
115
|
-
{
|
|
116
|
-
"category": "Performance",
|
|
117
|
-
"requires_url": True,
|
|
118
|
-
"checks": [
|
|
119
|
-
("Lighthouse Audit", ".agent/skills/performance-profiling/scripts/lighthouse_audit.py", True),
|
|
120
|
-
("Bundle Analysis", ".agent/skills/performance-profiling/scripts/bundle_analyzer.py", False),
|
|
121
|
-
]
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
# P7: E2E Testing (requires URL)
|
|
125
|
-
{
|
|
126
|
-
"category": "E2E Testing",
|
|
127
|
-
"requires_url": True,
|
|
128
|
-
"checks": [
|
|
129
|
-
("Playwright E2E", ".agent/skills/webapp-testing/scripts/playwright_runner.py", False),
|
|
130
|
-
]
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
# P8: Mobile (if applicable)
|
|
134
|
-
{
|
|
135
|
-
"category": "Mobile",
|
|
136
|
-
"checks": [
|
|
137
|
-
("Mobile Audit", ".agent/skills/mobile-design/scripts/mobile_audit.py", False),
|
|
138
|
-
]
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
# P9: Internationalization
|
|
142
|
-
{
|
|
143
|
-
"category": "Internationalization",
|
|
144
|
-
"checks": [
|
|
145
|
-
("i18n Check", ".agent/skills/i18n-localization/scripts/i18n_checker.py", False),
|
|
146
|
-
]
|
|
147
|
-
},
|
|
148
|
-
]
|
|
149
|
-
|
|
150
|
-
def run_script(name: str, script_path: Path, project_path: str, url: Optional[str] = None) -> dict:
|
|
151
|
-
"""Run validation script"""
|
|
152
|
-
if not script_path.exists():
|
|
153
|
-
print_warning(f"{name}: Script not found, skipping")
|
|
154
|
-
return {"name": name, "passed": True, "skipped": True, "duration": 0}
|
|
155
|
-
|
|
156
|
-
print_step(f"Running: {name}")
|
|
157
|
-
start_time = datetime.now()
|
|
158
|
-
|
|
159
|
-
# Build command
|
|
160
|
-
cmd = ["python", str(script_path), project_path]
|
|
161
|
-
if url and ("lighthouse" in script_path.name.lower() or "playwright" in script_path.name.lower()):
|
|
162
|
-
cmd.append(url)
|
|
163
|
-
|
|
164
|
-
# Run
|
|
165
|
-
try:
|
|
166
|
-
result = subprocess.run(
|
|
167
|
-
cmd,
|
|
168
|
-
capture_output=True,
|
|
169
|
-
text=True,
|
|
170
|
-
timeout=600 # 10 minute timeout for slow checks
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
duration = (datetime.now() - start_time).total_seconds()
|
|
174
|
-
passed = result.returncode == 0
|
|
175
|
-
|
|
176
|
-
if passed:
|
|
177
|
-
print_success(f"{name}: PASSED ({duration:.1f}s)")
|
|
178
|
-
else:
|
|
179
|
-
print_error(f"{name}: FAILED ({duration:.1f}s)")
|
|
180
|
-
if result.stderr:
|
|
181
|
-
print(f" {result.stderr[:300]}")
|
|
182
|
-
|
|
183
|
-
return {
|
|
184
|
-
"name": name,
|
|
185
|
-
"passed": passed,
|
|
186
|
-
"output": result.stdout,
|
|
187
|
-
"error": result.stderr,
|
|
188
|
-
"skipped": False,
|
|
189
|
-
"duration": duration
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
except subprocess.TimeoutExpired:
|
|
193
|
-
duration = (datetime.now() - start_time).total_seconds()
|
|
194
|
-
print_error(f"{name}: TIMEOUT (>{duration:.0f}s)")
|
|
195
|
-
return {"name": name, "passed": False, "skipped": False, "duration": duration, "error": "Timeout"}
|
|
196
|
-
|
|
197
|
-
except Exception as e:
|
|
198
|
-
duration = (datetime.now() - start_time).total_seconds()
|
|
199
|
-
print_error(f"{name}: ERROR - {str(e)}")
|
|
200
|
-
return {"name": name, "passed": False, "skipped": False, "duration": duration, "error": str(e)}
|
|
201
|
-
|
|
202
|
-
def print_final_report(results: List[dict], start_time: datetime):
|
|
203
|
-
"""Print comprehensive final report"""
|
|
204
|
-
total_duration = (datetime.now() - start_time).total_seconds()
|
|
205
|
-
|
|
206
|
-
print_header("📊 FULL VERIFICATION REPORT")
|
|
207
|
-
|
|
208
|
-
# Statistics
|
|
209
|
-
total = len(results)
|
|
210
|
-
passed = sum(1 for r in results if r["passed"] and not r.get("skipped"))
|
|
211
|
-
failed = sum(1 for r in results if not r["passed"] and not r.get("skipped"))
|
|
212
|
-
skipped = sum(1 for r in results if r.get("skipped"))
|
|
213
|
-
|
|
214
|
-
print(f"Total Duration: {total_duration:.1f}s")
|
|
215
|
-
print(f"Total Checks: {total}")
|
|
216
|
-
print(f"{Colors.GREEN}✅ Passed: {passed}{Colors.ENDC}")
|
|
217
|
-
print(f"{Colors.RED}❌ Failed: {failed}{Colors.ENDC}")
|
|
218
|
-
print(f"{Colors.YELLOW}⏭️ Skipped: {skipped}{Colors.ENDC}")
|
|
219
|
-
print()
|
|
220
|
-
|
|
221
|
-
# Category breakdown
|
|
222
|
-
print(f"{Colors.BOLD}Results by Category:{Colors.ENDC}")
|
|
223
|
-
current_category = None
|
|
224
|
-
for r in results:
|
|
225
|
-
# Print category header if changed
|
|
226
|
-
if r.get("category") and r["category"] != current_category:
|
|
227
|
-
current_category = r["category"]
|
|
228
|
-
print(f"\n{Colors.BOLD}{Colors.CYAN}{current_category}:{Colors.ENDC}")
|
|
229
|
-
|
|
230
|
-
# Print result
|
|
231
|
-
if r.get("skipped"):
|
|
232
|
-
status = f"{Colors.YELLOW}⏭️ {Colors.ENDC}"
|
|
233
|
-
elif r["passed"]:
|
|
234
|
-
status = f"{Colors.GREEN}✅{Colors.ENDC}"
|
|
235
|
-
else:
|
|
236
|
-
status = f"{Colors.RED}❌{Colors.ENDC}"
|
|
237
|
-
|
|
238
|
-
duration_str = f"({r.get('duration', 0):.1f}s)" if not r.get("skipped") else ""
|
|
239
|
-
print(f" {status} {r['name']} {duration_str}")
|
|
240
|
-
|
|
241
|
-
print()
|
|
242
|
-
|
|
243
|
-
# Failed checks detail
|
|
244
|
-
if failed > 0:
|
|
245
|
-
print(f"{Colors.BOLD}{Colors.RED}❌ FAILED CHECKS:{Colors.ENDC}")
|
|
246
|
-
for r in results:
|
|
247
|
-
if not r["passed"] and not r.get("skipped"):
|
|
248
|
-
print(f"\n{Colors.RED}✗ {r['name']}{Colors.ENDC}")
|
|
249
|
-
if r.get("error"):
|
|
250
|
-
error_preview = r["error"][:200]
|
|
251
|
-
print(f" Error: {error_preview}")
|
|
252
|
-
print()
|
|
253
|
-
|
|
254
|
-
# Final verdict
|
|
255
|
-
if failed > 0:
|
|
256
|
-
print_error(f"VERIFICATION FAILED - {failed} check(s) need attention")
|
|
257
|
-
print(f"\n{Colors.YELLOW}💡 Tip: Fix critical (security, lint) issues first{Colors.ENDC}")
|
|
258
|
-
return False
|
|
259
|
-
else:
|
|
260
|
-
print_success("✨ ALL CHECKS PASSED - Ready for deployment! ✨")
|
|
261
|
-
return True
|
|
262
|
-
|
|
263
|
-
def main():
|
|
264
|
-
parser = argparse.ArgumentParser(
|
|
265
|
-
description="Run complete Agent Skill Kit verification suite",
|
|
266
|
-
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
267
|
-
epilog="""
|
|
268
|
-
Examples:
|
|
269
|
-
python scripts/verify_all.py . --url http://localhost:3000
|
|
270
|
-
python scripts/verify_all.py . --url https://staging.example.com --no-e2e
|
|
271
|
-
"""
|
|
272
|
-
)
|
|
273
|
-
parser.add_argument("project", help="Project path to validate")
|
|
274
|
-
parser.add_argument("--url", required=True, help="URL for performance & E2E checks")
|
|
275
|
-
parser.add_argument("--no-e2e", action="store_true", help="Skip E2E tests")
|
|
276
|
-
parser.add_argument("--stop-on-fail", action="store_true", help="Stop on first failure")
|
|
277
|
-
|
|
278
|
-
args = parser.parse_args()
|
|
279
|
-
|
|
280
|
-
project_path = Path(args.project).resolve()
|
|
281
|
-
|
|
282
|
-
if not project_path.exists():
|
|
283
|
-
print_error(f"Project path does not exist: {project_path}")
|
|
284
|
-
sys.exit(1)
|
|
285
|
-
|
|
286
|
-
print_header("🚀 AGENT SKILLS KIT - FULL VERIFICATION SUITE")
|
|
287
|
-
print(f"Project: {project_path}")
|
|
288
|
-
print(f"URL: {args.url}")
|
|
289
|
-
print(f"Started: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
|
|
290
|
-
|
|
291
|
-
start_time = datetime.now()
|
|
292
|
-
results = []
|
|
293
|
-
|
|
294
|
-
# Run all verification categories
|
|
295
|
-
for suite in VERIFICATION_SUITE:
|
|
296
|
-
category = suite["category"]
|
|
297
|
-
requires_url = suite.get("requires_url", False)
|
|
298
|
-
|
|
299
|
-
# Skip if requires URL and not provided
|
|
300
|
-
if requires_url and not args.url:
|
|
301
|
-
continue
|
|
302
|
-
|
|
303
|
-
# Skip E2E if flag set
|
|
304
|
-
if args.no_e2e and category == "E2E Testing":
|
|
305
|
-
continue
|
|
306
|
-
|
|
307
|
-
print_header(f"📋 {category.upper()}")
|
|
308
|
-
|
|
309
|
-
for name, script_path, required in suite["checks"]:
|
|
310
|
-
script = project_path / script_path
|
|
311
|
-
result = run_script(name, script, str(project_path), args.url)
|
|
312
|
-
result["category"] = category
|
|
313
|
-
results.append(result)
|
|
314
|
-
|
|
315
|
-
# Stop on critical failure if flag set
|
|
316
|
-
if args.stop_on_fail and required and not result["passed"] and not result.get("skipped"):
|
|
317
|
-
print_error(f"CRITICAL: {name} failed. Stopping verification.")
|
|
318
|
-
print_final_report(results, start_time)
|
|
319
|
-
sys.exit(1)
|
|
320
|
-
|
|
321
|
-
# Print final report
|
|
322
|
-
all_passed = print_final_report(results, start_time)
|
|
323
|
-
|
|
324
|
-
sys.exit(0 if all_passed else 1)
|
|
325
|
-
|
|
326
|
-
if __name__ == "__main__":
|
|
327
|
-
main()
|