@lovehlmmm/primekit 1.0.2 → 1.0.5

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 CHANGED
@@ -1,107 +1,87 @@
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, VS Code và các AI Assistants.
1
+ # PrimeKit (Universal AI Coding Suite)
2
+ > Trang bị bộ 100+ Skills và Quy chuẩn Lập trình Chuyên nghiệp cho Claude Code, Cursor, Codex, VS Code và mọi AI Coding Assistant.
3
3
 
4
4
  [![npm package](https://img.shields.io/npm/v/@lovehlmmm/primekit.svg)](https://www.npmjs.com/package/@lovehlmmm/primekit)
5
- ![Build Status](https://img.shields.io/badge/Tests-100%25%20Passing-brightgreen.svg)
5
+ ![Build Status](https://img.shields.io/badge/Status-Active-brightgreen.svg)
6
6
  ![License](https://img.shields.io/badge/License-MIT-green.svg)
7
7
 
8
8
  ---
9
9
 
10
- ## 🌟 Tổng quan Dự án
10
+ ## 🌟 Giới thiệu PrimeKit
11
11
 
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ế.
12
+ **PrimeKit** (`@lovehlmmm/primekit`) là bộ công cụ AI Coding mở giúp tự động hóa quy trình phát triển phần mềm. Khi khởi tạo trong dự án hoặc hệ thống, PrimeKit trang bị cho AI Assistant của bạn bộ 100+ skills chuyên sâu (khảo sát codebase, lập kế hoạch multi-agent, lập trình TDD, phân tích nguyên nhân gốc rễ 5-Whys, quét bảo mật OWASP, và lưu hợp đồng bàn giao).
13
13
 
14
14
  ---
15
15
 
16
- ## 🚀 Hướng dẫn Cài đặt & Sử dụng (Quick Start)
16
+ ## 🚀 Hướng dẫn Cài đặt Nhanh (Quick Start)
17
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:
18
+ Bạn có thể sử dụng PrimeKit ngay lập tức theo 2 cơ chế:
19
+
20
+ ### 1. Cài đặt Cấp Dự án (Project Scope - Cho cá nhân & Teamwork)
21
+ Khởi tạo trực tiếp vào thư mục dự án hiện tại (tự động tạo `AGENTS.md`, `.cursorrules` và bộ skills):
20
22
  ```bash
21
23
  npx @lovehlmmm/primekit init
22
24
  ```
23
25
 
24
- ### 2. Cài đặt Cục bộ (Global CLI)
26
+ ### 2. Cài đặt Toàn cục (Global Scope - Cài 1 lần dùng cho MỌI dự án)
27
+ Cài đặt bộ skills trực tiếp vào hệ thống cá nhân (`~/.gemini/config/skills/`, `~/.claude/skills/`, `~/.cursor/rules/`):
28
+ ```bash
29
+ npx @lovehlmmm/primekit init --global
30
+ ```
31
+
32
+ ### 3. Cài đặt CLI Global (Tùy chọn)
25
33
  ```bash
26
34
  npm install -g @lovehlmmm/primekit
27
35
 
28
- # Sử dụng qua lệnh primekit hoặc alias ngắn pk
29
- primekit init
30
- # hoặc
36
+ # Sau khi cài global, bạn có thể gõ ngắn gọn lệnh primekit hoặc pk:
31
37
  pk init
38
+ pk init --global
32
39
  ```
33
40
 
34
41
  ---
35
42
 
36
43
  ## ⚡ Cú pháp Gọi Skill Rút gọn (`/pk:`)
37
44
 
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:`:
45
+ Sau khi khởi tạo, bạn có thể gõ lệnh kích hoạt trực tiếp trong ô chat với AI Assistant của mình:
39
46
 
40
- | Lệnh Gọi Skill | Tên Skill | Vai trò & Quy trình |
47
+ | Lệnh Gọi Skill | Tên Skill | Mô tả & Quy trình Thực thi |
41
48
  | :--- | :--- | :--- |
42
49
  | `/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 |
50
+ | `/pk:clarify` | Requirement Clarifier | Phân tích lỗ hổng yêu cầu & thách thức phạm vi thừa (YAGNI) |
44
51
  | `/pk:plan` | Implementation Planner | Lập kế hoạch theo giai đoạn (`--fast`, `--deep`, `--debate`, `--ultra`) |
45
52
  | `/pk:implement` | Focused Coder | Lập trình khoanh vùng chính xác (Hỗ trợ TDD `--tdd`) |
46
53
  | `/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 |
54
+ | `/pk:test` | Test Execution | Tự động nhận diện runner, thực thi test suite & chống lỗi hồi quy |
48
55
  | `/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 |
56
+ | `/pk:handoff` | Session Continuity | Đóng gói Hợp đồng Tiếp nối phiên làm việc cho lần sau |
50
57
  | `/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 |
58
+ | `/pk:vibe` | Autonomous Pipeline | Tự động hóa luồng làm việc từ GitHub Issue tới PR |
52
59
 
53
60
  ---
54
61
 
55
- ## 🛠️ Lệnh Quản lý CLI Reference
62
+ ## 🛠️ Danh mục Lệnh PrimeKit CLI
56
63
 
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
- ```
64
+ | Lệnh CLI | Mô tả Chức năng |
65
+ | :--- | :--- |
66
+ | `pk init` | Khởi tạo PrimeKit vào thư mục dự án hiện tại |
67
+ | `pk init -g` | Cài đặt bộ skills vào hệ thống toàn cục cho mọi dự án |
68
+ | `pk list` | Liệt kê các skill, hooks và adapters đã cài đặt |
69
+ | `pk doctor` | Kiểm tra sức khỏe hệ thống, checksum SHA256 & độ tương thích AI |
70
+ | `pk import <skill>` | Clone/Import skill bất kỳ từ hệ sinh thái vào dự án (VD: `pk import predict`) |
71
+ | `pk update` | Cập nhật an toàn bộ skill & CLI (tự động sao lưu file `.bak`) |
72
+ | `pk uninstall` | Gỡ bỏ sạch sẽ các tập tin do PrimeKit quản lý |
65
73
 
66
74
  ---
67
75
 
68
- ## 📁 Cấu trúc Thư mục Dự án
69
-
70
- ```text
71
- PrimeKit/
72
- ├── .primekit/ # Thư mục chứa skills & adapters đã init trong workspace
73
- │ ├── skills/ # Tất cả skills (SKILL.md)
74
- │ └── manifest.json # File theo dõi phiên bản & checksum SHA256
75
- ├── cli/ # Mã nguồn CLI (Node.js & TypeScript)
76
- │ ├── src/ # Code nguồn (commands, adapters, utils)
77
- │ └── dist/ # Code đã biên dịch JavaScript
78
- ├── docs/ # Tài liệu hướng dẫn tiếng Việt
79
- │ ├── ARCHITECTURE.md # Kiến trúc chi tiết hệ thống
80
- │ └── USAGE.md # Hướng dẫn sử dụng CLI reference
81
- ├── benchmarks/ # 5 bài kiểm thử thực tế (Bug fix, Feature, Refactor, Review, Handoff)
82
- ├── scripts/ # Scripts kiểm thử CLI & runner benchmark
83
- ├── skills/ # Thư mục nguồn 100+ Skills (SKILL.md)
84
- ├── AGENTS.md # Quy tắc agent chuẩn hóa hệ thống
85
- ├── agnt.md # File đặc tả cấu hình Agent tối ưu
86
- ├── package.json # Cấu hình package & scripts
87
- └── tsconfig.json # Cấu hình TypeScript compiler
88
- ```
76
+ ## 🎯 Bảng Tương thích với các IDE & AI Assistants
89
77
 
90
- ---
91
-
92
- ## 🧪 Phát triển & Kiểm thử (Development & Benchmarks)
93
-
94
- ```bash
95
- # Cài đặt dependencies và build TypeScript
96
- npm install
97
- npm run build
98
-
99
- # Chạy bộ test CLI integration
100
- npm test
78
+ PrimeKit tương thích 100% với mọi môi trường lập trình AI phổ biến hiện nay:
101
79
 
102
- # Chạy bộ đánh giá 5 kịch bản benchmark thực tế
103
- npm run benchmark
104
- ```
80
+ - **Claude Code (CLI)**: Nhận diện qua `.claude/skills/` và `.primekit/claude-adapter.json`.
81
+ - **Cursor IDE**: Nhận diện qua file cấu hình `.cursorrules` và `.cursor/rules/`.
82
+ - **Codex / OpenAI**: Nhận diện qua tập tin quy chuẩn `AGENTS.md`.
83
+ - **VS Code (Copilot / Gemini / Antigravity)**: Nhận diện qua `AGENTS.md` và `.gemini/config/skills/`.
84
+ - **Custom CLI Agents**: Tuân thủ chuẩn định dạng Markdown CommonMark & YAML Frontmatter.
105
85
 
106
86
  ---
107
87
 
@@ -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: ManifestFileEntry[]): void;
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
- const sha256 = dryRun ? '' : (0, manifest_1.calculateSHA256)(destPath);
34
- manifestFiles.push({
35
- path: path_1.default.relative(process.cwd(), destPath).replace(/\\/g, '/'),
36
- sha256,
37
- updatedAt: new Date().toISOString()
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.0 - Universal AI Coding Tool Suite Management
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 current project workspace.
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 import plan
32
- $ primekit import predict
33
- $ primekit import --all
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.2",
3
+ "version": "1.0.5",
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"