@lovehlmmm/primekit 1.0.0 → 1.0.4
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 +61 -18
- package/{AGENTS.md → agnt.md} +0 -20
- package/cli/dist/commands/init.d.ts +2 -1
- package/cli/dist/commands/init.js +33 -7
- package/cli/dist/index.js +9 -6
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# PrimeKit (AI Coding Suite Generator)
|
|
2
|
-
> Bộ công cụ AI Coding cá nhân hoá, kiến trúc mở cho Claude Code, Cursor, Codex và các AI Assistants.
|
|
2
|
+
> Bộ công cụ AI Coding cá nhân hoá, kiến trúc mở cho Claude Code, Cursor, Codex, VS Code và các AI Assistants.
|
|
3
3
|
|
|
4
|
-
](https://www.npmjs.com/package/@lovehlmmm/primekit)
|
|
5
5
|

|
|
6
6
|

|
|
7
7
|
|
|
@@ -9,7 +9,59 @@
|
|
|
9
9
|
|
|
10
10
|
## 🌟 Tổng quan Dự án
|
|
11
11
|
|
|
12
|
-
**PrimeKit** là một AI Coding Suite hoàn chỉnh được
|
|
12
|
+
**PrimeKit** (`@lovehlmmm/primekit`) là một AI Coding Suite hoàn chỉnh được thiết kế theo kiến trúc modular mở. Dự án bao gồm hệ thống **100+ skills độc lập**, CLI quản lý vòng đời (`init`, `list`, `doctor`, `update`, `import`, `uninstall`) và bộ kiểm thử benchmark 5 kịch bản thực tế.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 🚀 Hướng dẫn Cài đặt & Sử dụng (Quick Start)
|
|
17
|
+
|
|
18
|
+
### 1. Khởi tạo bằng `npx` (Không cần cài đặt)
|
|
19
|
+
Mở bất kỳ dự án/workspace nào và chạy:
|
|
20
|
+
```bash
|
|
21
|
+
npx @lovehlmmm/primekit init
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. Cài đặt Cục bộ (Global CLI)
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @lovehlmmm/primekit
|
|
27
|
+
|
|
28
|
+
# Sử dụng qua lệnh primekit hoặc alias ngắn pk
|
|
29
|
+
primekit init
|
|
30
|
+
# hoặc
|
|
31
|
+
pk init
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## ⚡ Cú pháp Gọi Skill Rút gọn (`/pk:`)
|
|
37
|
+
|
|
38
|
+
PrimeKit hỗ trợ cú pháp kích hoạt skill rút gọn cực nhanh bằng tiền tố `/pk:`:
|
|
39
|
+
|
|
40
|
+
| Lệnh Gọi Skill | Tên Skill | Vai trò & Quy trình |
|
|
41
|
+
| :--- | :--- | :--- |
|
|
42
|
+
| `/pk:explore` | Codebase Scout | Khảo sát sâu kiến trúc repository, dependencies & entry points |
|
|
43
|
+
| `/pk:clarify` | Requirement Clarifier | Làm rõ yêu cầu chưa đầy đủ & thách thức phạm vi YAGNI |
|
|
44
|
+
| `/pk:plan` | Implementation Planner | Lập kế hoạch theo giai đoạn (`--fast`, `--deep`, `--debate`, `--ultra`) |
|
|
45
|
+
| `/pk:implement` | Focused Coder | Lập trình khoanh vùng chính xác (Hỗ trợ TDD `--tdd`) |
|
|
46
|
+
| `/pk:debug` | Root Cause Analyzer | Phân tích nguyên nhân gốc rễ 5-Whys & kịch bản tái hiện |
|
|
47
|
+
| `/pk:test` | Test Execution | Tự động chạy unit/integration test suite & chống lỗi hồi quy |
|
|
48
|
+
| `/pk:review` | Diff Inspector | Đánh giá git diff, kiểm tra rủi ro bảo mật OWASP/STRIDE |
|
|
49
|
+
| `/pk:handoff` | Session Continuity | Lưu trạng thái bàn giao Hợp đồng Tiếp nối phiên sau |
|
|
50
|
+
| `/pk:predict` | Architecture Predictor | 5 Chuyên gia phản biện kiến trúc trước khi code |
|
|
51
|
+
| `/pk:vibe` | Autonomous Pipeline | Tự động hóa luồng từ GitHub Issue tới PR hoàn chỉnh |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 🛠️ Lệnh Quản lý CLI Reference
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
primekit init # Khởi tạo PrimeKit vào workspace (.primekit/, AGENTS.md, .cursorrules)
|
|
59
|
+
primekit list # Liệt kê các skill, hooks và adapters đã cài đặt
|
|
60
|
+
primekit doctor # Kiểm tra sức khỏe hệ thống, SHA256 checksum & tương thích Assistant
|
|
61
|
+
primekit import <name> # Import/clone skill bất kỳ từ hệ sinh thái vào workspace (VD: pk import predict)
|
|
62
|
+
primekit update # Cập nhật an toàn bộ skill & CLI (tự động tạo backup .bak)
|
|
63
|
+
primekit uninstall # Gỡ bỏ sạch sẽ các thành phần do PrimeKit quản lý
|
|
64
|
+
```
|
|
13
65
|
|
|
14
66
|
---
|
|
15
67
|
|
|
@@ -17,7 +69,7 @@
|
|
|
17
69
|
|
|
18
70
|
```text
|
|
19
71
|
PrimeKit/
|
|
20
|
-
├── .primekit/ # Thư mục chứa skills & adapters đã init
|
|
72
|
+
├── .primekit/ # Thư mục chứa skills & adapters đã init trong workspace
|
|
21
73
|
│ ├── skills/ # Tất cả skills (SKILL.md)
|
|
22
74
|
│ └── manifest.json # File theo dõi phiên bản & checksum SHA256
|
|
23
75
|
├── cli/ # Mã nguồn CLI (Node.js & TypeScript)
|
|
@@ -28,7 +80,7 @@ PrimeKit/
|
|
|
28
80
|
│ └── USAGE.md # Hướng dẫn sử dụng CLI reference
|
|
29
81
|
├── benchmarks/ # 5 bài kiểm thử thực tế (Bug fix, Feature, Refactor, Review, Handoff)
|
|
30
82
|
├── scripts/ # Scripts kiểm thử CLI & runner benchmark
|
|
31
|
-
├── skills/ # Thư mục nguồn
|
|
83
|
+
├── skills/ # Thư mục nguồn 100+ Skills (SKILL.md)
|
|
32
84
|
├── AGENTS.md # Quy tắc agent chuẩn hóa hệ thống
|
|
33
85
|
├── agnt.md # File đặc tả cấu hình Agent tối ưu
|
|
34
86
|
├── package.json # Cấu hình package & scripts
|
|
@@ -37,29 +89,20 @@ PrimeKit/
|
|
|
37
89
|
|
|
38
90
|
---
|
|
39
91
|
|
|
40
|
-
##
|
|
92
|
+
## 🧪 Phát triển & Kiểm thử (Development & Benchmarks)
|
|
41
93
|
|
|
42
|
-
### 1. Cài đặt dependencies và Build
|
|
43
94
|
```bash
|
|
95
|
+
# Cài đặt dependencies và build TypeScript
|
|
44
96
|
npm install
|
|
45
97
|
npm run build
|
|
46
|
-
```
|
|
47
98
|
|
|
48
|
-
|
|
49
|
-
```bash
|
|
99
|
+
# Chạy bộ test CLI integration
|
|
50
100
|
npm test
|
|
51
|
-
```
|
|
52
101
|
|
|
53
|
-
|
|
54
|
-
```bash
|
|
102
|
+
# Chạy bộ đánh giá 5 kịch bản benchmark thực tế
|
|
55
103
|
npm run benchmark
|
|
56
104
|
```
|
|
57
105
|
|
|
58
|
-
### 4. Khởi tạo PrimeKit trong Workspace bất kỳ
|
|
59
|
-
```bash
|
|
60
|
-
node cli/dist/index.js init
|
|
61
|
-
```
|
|
62
|
-
|
|
63
106
|
---
|
|
64
107
|
|
|
65
108
|
## 📜 Giấy phép (License)
|
package/{AGENTS.md → agnt.md}
RENAMED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
# PRIMEKIT INTEGRATION INSTRUCTIONS
|
|
2
|
-
> Active AI Coding Suite: PrimeKit (Universal Architecture)
|
|
3
|
-
|
|
4
|
-
## Available Core Skills
|
|
5
|
-
PrimeKit skills are located in `.primekit/skills/`. Read the corresponding `SKILL.md` before executing workflows:
|
|
6
|
-
|
|
7
|
-
1. **explore** (`.primekit/skills/explore/SKILL.md`): Codebase Scout.
|
|
8
|
-
2. **clarify** (`.primekit/skills/clarify/SKILL.md`): Requirement Clarifier.
|
|
9
|
-
3. **plan** (`.primekit/skills/plan/SKILL.md`): Implementation Planner.
|
|
10
|
-
4. **implement** (`.primekit/skills/implement/SKILL.md`): Focused Coder.
|
|
11
|
-
5. **debug** (`.primekit/skills/debug/SKILL.md`): Root Cause Analyzer.
|
|
12
|
-
6. **test** (`.primekit/skills/test/SKILL.md`): Test Execution & Verification.
|
|
13
|
-
7. **review** (`.primekit/skills/review/SKILL.md`): Diff Inspector.
|
|
14
|
-
8. **handoff** (`.primekit/skills/handoff/SKILL.md`): Session Continuity.
|
|
15
|
-
|
|
16
|
-
## Router Rules
|
|
17
|
-
- Small/single edits -> Direct to `implement`.
|
|
18
|
-
- Complex tasks (>2 files) -> Follow `explore` -> `plan` -> `implement` -> `test` -> `review` -> `handoff`.
|
|
19
|
-
|
|
20
|
-
|
|
21
1
|
# AGENT SPECIFICATION: PRIMEKIT (AI CODING SUITE GENERATOR)
|
|
22
2
|
> **Phiên bản Prompt Tối ưu hóa**: 1.0
|
|
23
3
|
> **Mục tiêu**: Hướng dẫn AI Agent tự thiết kế, xây dựng và đóng gói bộ công cụ AI Coding "PrimeKit" (lấy cảm hứng từ PrimeKit) hoàn chỉnh, chạy thực tế, có CLI, bộ skill và framework đánh giá.
|
|
@@ -3,6 +3,7 @@ export interface InitOptions {
|
|
|
3
3
|
dryRun?: boolean;
|
|
4
4
|
assistant?: string;
|
|
5
5
|
force?: boolean;
|
|
6
|
+
global?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare function copyFolderRecursive(src: string, dest: string, dryRun: boolean, manifestFiles
|
|
8
|
+
export declare function copyFolderRecursive(src: string, dest: string, dryRun: boolean, manifestFiles?: ManifestFileEntry[]): void;
|
|
8
9
|
export declare function runInit(projectRoot?: string, options?: InitOptions): void;
|
|
@@ -30,23 +30,49 @@ function copyFolderRecursive(src, dest, dryRun, manifestFiles) {
|
|
|
30
30
|
if (!dryRun) {
|
|
31
31
|
fs_1.default.copyFileSync(srcPath, destPath);
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
if (manifestFiles) {
|
|
34
|
+
const sha256 = dryRun ? '' : (0, manifest_1.calculateSHA256)(destPath);
|
|
35
|
+
manifestFiles.push({
|
|
36
|
+
path: path_1.default.relative(process.cwd(), destPath).replace(/\\/g, '/'),
|
|
37
|
+
sha256,
|
|
38
|
+
updatedAt: new Date().toISOString()
|
|
39
|
+
});
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
function runInit(projectRoot = process.cwd(), options = {}) {
|
|
43
45
|
const dryRun = !!options.dryRun;
|
|
44
46
|
const assistant = options.assistant || 'all';
|
|
47
|
+
const isGlobal = !!options.global;
|
|
48
|
+
const userHome = process.env.USERPROFILE || process.env.HOME || 'C:\\Users\\TuanNguyenAnh';
|
|
49
|
+
const sourceSkillsDir = path_1.default.join(__dirname, '..', '..', '..', 'skills');
|
|
50
|
+
if (isGlobal) {
|
|
51
|
+
console.log(`[PrimeKit Init --global] Installing PrimeKit Skills Globally to System AI Assistants...`);
|
|
52
|
+
if (dryRun)
|
|
53
|
+
console.log(`[DRY-RUN MODE] No files will be modified.`);
|
|
54
|
+
const globalTargets = [
|
|
55
|
+
path_1.default.join(userHome, '.gemini', 'config', 'skills'),
|
|
56
|
+
path_1.default.join(userHome, '.claude', 'skills'),
|
|
57
|
+
path_1.default.join(userHome, '.cursor', 'rules')
|
|
58
|
+
];
|
|
59
|
+
let installedCount = 0;
|
|
60
|
+
for (const targetDir of globalTargets) {
|
|
61
|
+
const parentDir = path_1.default.dirname(targetDir);
|
|
62
|
+
if (fs_1.default.existsSync(parentDir) || targetDir.includes('.gemini')) {
|
|
63
|
+
console.log(`- Installing global skills to: ${targetDir}`);
|
|
64
|
+
copyFolderRecursive(sourceSkillsDir, targetDir, dryRun);
|
|
65
|
+
installedCount++;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
console.log(`🎉 PrimeKit Global Initialization complete! (${installedCount} assistant targets updated).`);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// Local Project Scope
|
|
45
72
|
console.log(`[PrimeKit Init] Initializing PrimeKit in ${projectRoot}...`);
|
|
46
73
|
if (dryRun) {
|
|
47
74
|
console.log(`[DRY-RUN MODE] No files will be modified.`);
|
|
48
75
|
}
|
|
49
|
-
const sourceSkillsDir = path_1.default.join(__dirname, '..', '..', '..', 'skills');
|
|
50
76
|
const targetSkillsDir = path_1.default.join(projectRoot, '.primekit', 'skills');
|
|
51
77
|
const manifestFiles = [];
|
|
52
78
|
// Copy skills
|
package/cli/dist/index.js
CHANGED
|
@@ -9,13 +9,13 @@ const uninstall_1 = require("./commands/uninstall");
|
|
|
9
9
|
const import_1 = require("./commands/import");
|
|
10
10
|
function printHelp() {
|
|
11
11
|
console.log(`
|
|
12
|
-
PrimeKit CLI v1.0.
|
|
12
|
+
PrimeKit CLI v1.0.2 - Universal AI Coding Tool Suite Management
|
|
13
13
|
|
|
14
14
|
USAGE:
|
|
15
15
|
$ primekit <command> [options]
|
|
16
16
|
|
|
17
17
|
COMMANDS:
|
|
18
|
-
init Initialize PrimeKit in the
|
|
18
|
+
init Initialize PrimeKit in the workspace (or globally with --global).
|
|
19
19
|
list List installed skills, adapters, and tracked components.
|
|
20
20
|
doctor Diagnose health, SHA256 integrity, and adapter integration.
|
|
21
21
|
update Safely update PrimeKit skills and CLI components.
|
|
@@ -23,14 +23,16 @@ COMMANDS:
|
|
|
23
23
|
uninstall Cleanly remove PrimeKit assets from the workspace.
|
|
24
24
|
|
|
25
25
|
OPTIONS:
|
|
26
|
+
--global, -g Install skills globally to system AI Assistant configs (~/.gemini, ~/.claude, etc.).
|
|
26
27
|
--dry-run Simulate changes without modifying files.
|
|
27
28
|
--assistant Specify target assistant (claude, cursor, codex, all).
|
|
28
29
|
--help, -h Display help message.
|
|
29
30
|
|
|
30
31
|
EXAMPLES:
|
|
31
|
-
$ primekit
|
|
32
|
-
$ primekit
|
|
33
|
-
$
|
|
32
|
+
$ primekit init
|
|
33
|
+
$ primekit init --global
|
|
34
|
+
$ pk init -g
|
|
35
|
+
$ pk import predict
|
|
34
36
|
`);
|
|
35
37
|
}
|
|
36
38
|
function main() {
|
|
@@ -41,12 +43,13 @@ function main() {
|
|
|
41
43
|
return;
|
|
42
44
|
}
|
|
43
45
|
const isDryRun = args.includes('--dry-run');
|
|
46
|
+
const isGlobal = args.includes('--global') || args.includes('-g');
|
|
44
47
|
const isAll = args.includes('--all');
|
|
45
48
|
const assistantIdx = args.indexOf('--assistant');
|
|
46
49
|
const assistant = assistantIdx !== -1 && args[assistantIdx + 1] ? args[assistantIdx + 1] : 'all';
|
|
47
50
|
switch (command) {
|
|
48
51
|
case 'init':
|
|
49
|
-
(0, init_1.runInit)(process.cwd(), { dryRun: isDryRun, assistant });
|
|
52
|
+
(0, init_1.runInit)(process.cwd(), { dryRun: isDryRun, assistant, global: isGlobal });
|
|
50
53
|
break;
|
|
51
54
|
case 'list':
|
|
52
55
|
(0, list_1.runList)(process.cwd());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovehlmmm/primekit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Universal AI Coding Tool Suite Generator inspired by AgentKit",
|
|
5
5
|
"main": "cli/dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"skills",
|
|
13
13
|
"docs",
|
|
14
14
|
"README.md",
|
|
15
|
-
"agnt.md"
|
|
16
|
-
"AGENTS.md"
|
|
15
|
+
"agnt.md"
|
|
17
16
|
],
|
|
18
17
|
"publishConfig": {
|
|
19
18
|
"access": "public"
|