claudify-agent 1.0.1 → 1.0.3
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/.claude/QUICK-REFERENCE.md +213 -213
- package/.claude/cost-dashboard.md +162 -162
- package/.claude/docs/COST-OPTIMIZATION.md +402 -403
- package/.claude/docs/MCP-INTEGRATION-GUIDE.md +348 -348
- package/.claude/docs/PLAN-MODE-OPTIMIZATION.md +835 -836
- package/.claude/hooks/auto-learning-review.ts +200 -195
- package/.claude/hooks/auto-lint-fix.ts +60 -104
- package/.claude/hooks/auto-security-review.ts +314 -354
- package/.claude/hooks/auto-validate.ts +249 -348
- package/.claude/hooks/lib/claude-hook.ts +168 -0
- package/.claude/hooks/plan-quality-tracker.ts +598 -719
- package/.claude/rules/anti-patterns.md +22 -22
- package/.claude/rules/context-tier-1.md +41 -41
- package/.claude/rules/context-tier-2.md +285 -285
- package/.claude/rules/general.md +25 -25
- package/.claude/rules/mcp-auto-use.md +46 -46
- package/.claude/rules/parallel-exploration-auto.md +30 -31
- package/.claude/rules/plan-mode-execution.md +289 -289
- package/.claude/rules/plan-mode-research.md +34 -34
- package/.claude/rules/plan-mode-structure.md +166 -166
- package/.claude/rules/plan-mode-validation.md +129 -130
- package/.claude/rules/security-critical.md +19 -19
- package/.claude/rules/tool-auto-selection.md +45 -45
- package/.claude/rules/tool-strategy.md +22 -22
- package/.claude/scripts/security-scan.js +1 -1
- package/.claude/security-dashboard.md +142 -142
- package/.claude/settings.json +50 -0
- package/.claude/skills/debug-optimizer/SKILL.md +420 -399
- package/.claude/skills/learning-loop/SKILL.md +313 -308
- package/.claude/skills/mcp-mastery/SKILL.md +218 -214
- package/.claude/skills/nextjs-guide/SKILL.md +687 -687
- package/.claude/skills/parallel-exploration/SKILL.md +197 -193
- package/.claude/skills/plan-mode-mastery/SKILL.md +268 -263
- package/.claude/skills/python-guide/SKILL.md +822 -822
- package/.claude/skills/react-guide/SKILL.md +762 -762
- package/.claude/skills/{security.md → security-guide/SKILL.md} +10 -0
- package/.claude/skills/solidity-guide/SKILL.md +5 -0
- package/.claude/skills/tool-selection/SKILL.md +433 -428
- package/.claude/skills/vite-guide/SKILL.md +445 -445
- package/CLAUDE.md +1 -0
- package/README.md +74 -35
- package/README.vi.md +106 -0
- package/bin/cli.js +13 -4
- package/package.json +13 -1
- package/.claude/skills/debug-optimizer.md +0 -12
- package/.claude/skills/nextjs.md +0 -13
- package/.claude/skills/react.md +0 -12
package/CLAUDE.md
CHANGED
|
@@ -35,6 +35,7 @@ After modifying code, execute local verification based on project stack:
|
|
|
35
35
|
- **Next.js:** @.claude/skills/nextjs-guide/SKILL.md
|
|
36
36
|
- **React:** @.claude/skills/react-guide/SKILL.md
|
|
37
37
|
- **Python:** @.claude/skills/python-guide/SKILL.md
|
|
38
|
+
- **Security (OWASP):** @.claude/skills/security-guide/SKILL.md
|
|
38
39
|
- **Vite:** @.claude/skills/vite-guide/SKILL.md
|
|
39
40
|
- **MCP Mastery:** @.claude/skills/mcp-mastery/SKILL.md
|
|
40
41
|
- **Tool Selection:** @.claude/skills/tool-selection/SKILL.md
|
package/README.md
CHANGED
|
@@ -1,66 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">⚡ claudify-agent</h1>
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Enterprise-grade workflow & context optimization framework for Claude Code, Claude Desktop, and autonomous AI coding agents.</strong>
|
|
5
|
+
</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/claudify-agent"><img src="https://img.shields.io/npm/v/claudify-agent.svg" alt="NPM Version" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/claudify-agent"><img src="https://img.shields.io/npm/dm/claudify-agent.svg" alt="NPM Downloads" /></a>
|
|
9
|
+
<a href="https://github.com/mytoandeptrai/claudify-agent/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" /></a>
|
|
10
|
+
</p>
|
|
11
|
+
<p align="center">
|
|
12
|
+
English | <a href="README.vi.md">Tiếng Việt</a>
|
|
13
|
+
</p>
|
|
14
|
+
</p>
|
|
2
15
|
|
|
3
|
-
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 💡 Overview
|
|
4
19
|
|
|
5
|
-
Inspired by research
|
|
20
|
+
Inspired by empirical research on autonomous agent failure modes, **`claudify-agent`** acts as the deterministic bridle and operating system for Claude:
|
|
21
|
+
- **Prevents Context Bloat & Token Snowball:** Eliminates token waste and context rot by enforcing sub-20 line rules and on-demand `@path` modular skill loading.
|
|
22
|
+
- **Plan-First Mandate:** Obligates Claude to formulate an explicit execution plan before modifying two or more files.
|
|
23
|
+
- **Zero-Token Local Verification:** Offloads formatting, ESLint corrections, typechecks, and security scans to local scripts rather than burning hundreds of thousands of tokens across LLM feedback loops.
|
|
24
|
+
- **Production Backend & Web3 Ready:** Comprehensive guidelines for high-throughput **Golang**, enterprise **NestJS**, distributed **Concurrency & Locking**, and secure **Solidity Smart Contracts**.
|
|
6
25
|
|
|
7
26
|
---
|
|
8
27
|
|
|
9
|
-
##
|
|
28
|
+
## 📦 Quick Start
|
|
10
29
|
|
|
11
|
-
|
|
30
|
+
Initialize `claudify-agent` into any existing repository or new project with a single command:
|
|
12
31
|
|
|
13
32
|
```bash
|
|
14
33
|
npx claudify-agent init
|
|
15
34
|
```
|
|
16
35
|
|
|
17
|
-
|
|
18
|
-
- `CLAUDE.md`:
|
|
19
|
-
- `.claude/
|
|
20
|
-
- `.claude/
|
|
21
|
-
- `.claude/scripts/`:
|
|
36
|
+
This bootstraps:
|
|
37
|
+
- `CLAUDE.md`: The central root steering file auto-loaded by Claude Code CLI.
|
|
38
|
+
- `.claude/rules/`: 13 context-tiered rules governing planning, execution, and security.
|
|
39
|
+
- `.claude/skills/`: 12 on-demand domain skills (Golang, NestJS, Concurrency, Solidity, Next.js, etc.).
|
|
40
|
+
- `.claude/scripts/`: Local multi-language verification suite (`auto-validate.js`, `security-scan.js`).
|
|
22
41
|
|
|
23
42
|
---
|
|
24
43
|
|
|
25
|
-
##
|
|
44
|
+
## 🚀 How to Use
|
|
26
45
|
|
|
27
|
-
###
|
|
28
|
-
|
|
29
|
-
Sau khi chạy `npx claudify-agent init`, chỉ cần mở terminal và gõ:
|
|
46
|
+
### 1. With Claude Code CLI (Recommended)
|
|
47
|
+
After running `npx claudify-agent init`, open your terminal in the project root and launch Claude:
|
|
30
48
|
```bash
|
|
31
49
|
claude
|
|
32
50
|
```
|
|
33
|
-
|
|
34
|
-
- Tự động lập **Plan Mode** trước khi sửa từ 2 file trở lên.
|
|
35
|
-
- Tự động tra cứu kỹ năng chuyên biệt khi đụng tới backend Go, NestJS, hoặc Smart Contract.
|
|
36
|
-
- Tự chạy kiểm tra local sau khi code xong.
|
|
51
|
+
Claude Code automatically discovers `CLAUDE.md`. All guardrails, tiered rules, and verification loops run seamlessly in the background.
|
|
37
52
|
|
|
38
|
-
###
|
|
53
|
+
### 2. With Claude Desktop / Claude Projects
|
|
54
|
+
1. Open **Claude Desktop** and create a new **Project** pointing to your workspace.
|
|
55
|
+
2. Copy the content of [`CLAUDE.md`](CLAUDE.md) into the **Custom Instructions** box.
|
|
56
|
+
3. Attach the `.claude/` directory to Project Knowledge for on-demand skill retrieval.
|
|
39
57
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🧠 Architecture & ReAct Loop
|
|
61
|
+
|
|
62
|
+
```mermaid
|
|
63
|
+
graph TD
|
|
64
|
+
User["Developer Prompt"] --> Claude["Claude Code CLI"]
|
|
65
|
+
Claude --> RootCheck["CLAUDE.md<br>(Sub-20 Line Minimalist Guardrails)"]
|
|
66
|
+
RootCheck --> PlanCheck{"Modifying >= 2 Files?"}
|
|
67
|
+
PlanCheck -- "Yes" --> Plan["1. Produce Concise Plan<br>& Await Confirmation"]
|
|
68
|
+
PlanCheck -- "No" --> Execute["2. Targeted Execution"]
|
|
69
|
+
Plan --> Execute
|
|
70
|
+
Execute --> LocalChecks{"3. Local Verification Loop<br>(Zero Tokens Spent)"}
|
|
71
|
+
LocalChecks -->|"Format / Syntax"| ESLint["Local ESLint auto-fix"]
|
|
72
|
+
LocalChecks -->|"Type Safety"| TSC["Local tsc --noEmit"]
|
|
73
|
+
LocalChecks -->|"Go / Solidity"| Compiler["go vet / forge test"]
|
|
74
|
+
LocalChecks -->|"Security"| SecScan["Local Secret Scan"]
|
|
75
|
+
ESLint --> Done["✅ Clean, Verified Output"]
|
|
76
|
+
TSC --> Done
|
|
77
|
+
Compiler --> Done
|
|
78
|
+
SecScan --> Done
|
|
79
|
+
```
|
|
43
80
|
|
|
44
81
|
---
|
|
45
82
|
|
|
46
|
-
## 🛠️
|
|
83
|
+
## 🛠️ Included 12 Production Skills
|
|
47
84
|
|
|
48
|
-
|
|
|
85
|
+
| Skill | Path | Focus Area |
|
|
49
86
|
| :--- | :--- | :--- |
|
|
50
|
-
| **Backend Concurrency** | `.claude/skills/backend-concurrency/SKILL.md` |
|
|
51
|
-
| **Golang Backend** | `.claude/skills/golang-guide/SKILL.md` | Standard layout
|
|
52
|
-
| **NestJS Enterprise** | `.claude/skills/nestjs-guide/SKILL.md` |
|
|
53
|
-
| **Solidity
|
|
54
|
-
| **Next.js Guide** | `.claude/skills/nextjs-guide/SKILL.md` | App Router, Server Components
|
|
87
|
+
| **Backend Concurrency** | `.claude/skills/backend-concurrency/SKILL.md` | Race conditions, Distributed Redis Lock, Deadlocks, Idempotency. |
|
|
88
|
+
| **Golang Backend** | `.claude/skills/golang-guide/SKILL.md` | Standard project layout, Worker Pools, Concurrency safety, Context. |
|
|
89
|
+
| **NestJS Enterprise** | `.claude/skills/nestjs-guide/SKILL.md` | Clean module boundaries, TypeORM QueryRunner transactions, DTO safety. |
|
|
90
|
+
| **Solidity Smart Contracts** | `.claude/skills/solidity-guide/SKILL.md` | CEI pattern, ReentrancyGuard, EVM gas optimization, Foundry tests. |
|
|
91
|
+
| **Next.js Guide** | `.claude/skills/nextjs-guide/SKILL.md` | App Router, React Server Components (RSC), and Server Actions. |
|
|
55
92
|
| **React Guide** | `.claude/skills/react-guide/SKILL.md` | Single Source of Truth, render optimization & Custom Hooks. |
|
|
56
93
|
| **Python Guide** | `.claude/skills/python-guide/SKILL.md` | FastAPI, Django, Type hints & Pydantic. |
|
|
57
|
-
| **MCP Mastery** | `.claude/skills/mcp-mastery/SKILL.md` |
|
|
58
|
-
| **Debug Optimizer** | `.claude/skills/debug-optimizer/SKILL.md` |
|
|
59
|
-
| **
|
|
60
|
-
| **
|
|
61
|
-
| **
|
|
94
|
+
| **MCP Mastery** | `.claude/skills/mcp-mastery/SKILL.md` | Model Context Protocol configuration and tool calling patterns. |
|
|
95
|
+
| **Debug Optimizer** | `.claude/skills/debug-optimizer/SKILL.md` | 4-step systematic root-cause debugging protocol. |
|
|
96
|
+
| **Security Guide** | `.claude/skills/security-guide/SKILL.md` | OWASP Top 10: secrets, injection, auth checks, input validation. |
|
|
97
|
+
| **Tool Selection** | `.claude/skills/tool-selection/SKILL.md` | Decision matrix to minimize excessive LLM tool calls. |
|
|
98
|
+
| **Plan Mastery** | `.claude/skills/plan-mode-mastery/SKILL.md` | Systematic research and execution planning before code generation. |
|
|
99
|
+
| **Vite Guide** | `.claude/skills/vite-guide/SKILL.md` | Modern SPA build optimization and bundling practices. |
|
|
62
100
|
|
|
63
101
|
---
|
|
64
102
|
|
|
65
103
|
## 📄 License
|
|
66
|
-
|
|
104
|
+
|
|
105
|
+
MIT © [jacob-tech](https://github.com/mytoandeptrai)
|
package/README.vi.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">⚡ claudify-agent</h1>
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Framework tối ưu hóa ngữ cảnh và quy trình làm việc chuẩn doanh nghiệp cho Claude Code, Claude Desktop và các AI Coding Agent tự chủ.</strong>
|
|
5
|
+
</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/claudify-agent"><img src="https://img.shields.io/npm/v/claudify-agent.svg" alt="NPM Version" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/claudify-agent"><img src="https://img.shields.io/npm/dm/claudify-agent.svg" alt="NPM Downloads" /></a>
|
|
9
|
+
<a href="https://github.com/mytoandeptrai/claudify-agent/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" /></a>
|
|
10
|
+
</p>
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="README.md">English</a> | Tiếng Việt
|
|
13
|
+
</p>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 💡 Tổng Quan
|
|
19
|
+
|
|
20
|
+
Lấy cảm hứng từ các nghiên cứu thực nghiệm về thất bại của AI Agent khi viết code, **`claudify-agent`** đóng vai trò là "dây cương và hệ điều hành" cho Claude:
|
|
21
|
+
- **Chống Tràn Ngữ Cảnh & Hiệu Ứng Tuyết Lăn (Context Snowball):** Triệt tiêu lãng phí token bằng nguyên tắc luật dưới 20 dòng và nạp modular skill theo nhu cầu thông qua cú pháp `@path`.
|
|
22
|
+
- **Bắt Buộc Lập Kế Hoạch (Plan-First):** Ép Claude phải xuất ra một kế hoạch (Plan) cụ thể trước khi được phép sửa từ 2 file trở lên.
|
|
23
|
+
- **Xác Thực Cục Bộ Tốn 0 Token (Zero-Token Verification):** Đẩy toàn bộ việc sửa format, ESLint, kiểm tra type TypeScript và quét bảo mật cho các script local chạy trên máy tính thay vì đốt hàng trăm ngàn token qua các lượt chat lặp lại của AI.
|
|
24
|
+
- **Sẵn Sàng Cho Production Backend & Web3:** Cung cấp sẵn các cẩm nang chuẩn cho hệ thống **Golang** hiệu năng cao, **NestJS** doanh nghiệp, xử lý **Concurrency & Khóa phân tán (Locking)**, và hợp đồng thông minh **Solidity** an toàn.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 📦 Khởi Tạo Nhanh (Quick Start)
|
|
29
|
+
|
|
30
|
+
Khởi tạo `claudify-agent` vào bất kỳ dự án mới hoặc có sẵn nào chỉ bằng 1 dòng lệnh duy nhất:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx claudify-agent init
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Lệnh này sẽ tự động thiết lập:
|
|
37
|
+
- `CLAUDE.md`: File điều phối trung tâm tự động được nạp bởi Claude Code CLI.
|
|
38
|
+
- `.claude/rules/`: 13 quy tắc phân tầng kiểm soát quá trình lập plan, thực thi và bảo mật.
|
|
39
|
+
- `.claude/skills/`: 12 cẩm nang chuyên sâu theo từng công nghệ (Golang, NestJS, Concurrency, Solidity, Next.js...).
|
|
40
|
+
- `.claude/scripts/`: Bộ công cụ tự động kiểm tra code đa ngôn ngữ (`auto-validate.js`, `security-scan.js`).
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🚀 Hướng Dẫn Sử Dụng
|
|
45
|
+
|
|
46
|
+
### 1. Dùng với Claude Code CLI (Khuyên dùng nhất)
|
|
47
|
+
Sau khi chạy `npx claudify-agent init`, mở terminal tại thư mục dự án và gõ:
|
|
48
|
+
```bash
|
|
49
|
+
claude
|
|
50
|
+
```
|
|
51
|
+
Claude Code sẽ tự động nhận diện `CLAUDE.md`. Toàn bộ luật bảo vệ, phân tầng ngữ cảnh và chuỗi kiểm tra tự động sẽ chạy ngầm mà không cần cấu hình thêm.
|
|
52
|
+
|
|
53
|
+
### 2. Dùng với Claude Desktop / Claude Projects
|
|
54
|
+
1. Mở **Claude Desktop** $\rightarrow$ Tạo một **Project** trỏ vào thư mục code của bạn.
|
|
55
|
+
2. Sao chép toàn bộ nội dung file [`CLAUDE.md`](CLAUDE.md) dán vào ô **Custom Instructions**.
|
|
56
|
+
3. Đính kèm thư mục `.claude/` vào Project Files để Claude tra cứu kỹ năng khi cần.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🧠 Kiến Trúc Hoạt Động (ReAct Loop)
|
|
61
|
+
|
|
62
|
+
```mermaid
|
|
63
|
+
graph TD
|
|
64
|
+
User["Developer Prompt"] --> Claude["Claude Code CLI"]
|
|
65
|
+
Claude --> RootCheck["CLAUDE.md<br>(Sub-20 Line Minimalist Guardrails)"]
|
|
66
|
+
PlanCheck{"Sửa >= 2 Files?"}
|
|
67
|
+
RootCheck --> PlanCheck
|
|
68
|
+
PlanCheck -- "Có" --> Plan["1. Lập Plan Chi Tiết<br>& Chờ Duyệt"]
|
|
69
|
+
PlanCheck -- "Không" --> Execute["2. Thực Thi Targeted Code"]
|
|
70
|
+
Plan --> Execute
|
|
71
|
+
Execute --> LocalChecks{"3. Chuỗi Kiểm Tra Local<br>(Tốn 0 LLM Token)"}
|
|
72
|
+
LocalChecks -->|"Format / Cú pháp"| ESLint["Tự chạy ESLint fix"]
|
|
73
|
+
LocalChecks -->|"Type Safety"| TSC["Tự chạy tsc --noEmit"]
|
|
74
|
+
LocalChecks -->|"Go / Solidity"| Compiler["go vet / forge test"]
|
|
75
|
+
LocalChecks -->|"Bảo mật"| SecScan["Quét rò rỉ Secret"]
|
|
76
|
+
ESLint --> Done["✅ Code Sạch & Đã Kiểm Thử"]
|
|
77
|
+
TSC --> Done
|
|
78
|
+
Compiler --> Done
|
|
79
|
+
SecScan --> Done
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 🛠️ Danh Mục 12 Kỹ Năng Đính Kèm
|
|
85
|
+
|
|
86
|
+
| Kỹ Năng | Đường Dẫn | Trọng Tâm Giải Quyết |
|
|
87
|
+
| :--- | :--- | :--- |
|
|
88
|
+
| **Backend Concurrency** | `.claude/skills/backend-concurrency/SKILL.md` | Xử lý Race conditions, Redis Distributed Lock, Deadlocks, Idempotency. |
|
|
89
|
+
| **Golang Backend** | `.claude/skills/golang-guide/SKILL.md` | Standard layout (`cmd/`, `internal/`), Worker Pool, Safe Goroutines, Context. |
|
|
90
|
+
| **NestJS Enterprise** | `.claude/skills/nestjs-guide/SKILL.md` | Module boundaries, TypeORM Transaction QueryRunner, DTO Validation. |
|
|
91
|
+
| **Solidity Smart Contracts** | `.claude/skills/solidity-guide/SKILL.md` | Mô hình CEI, ReentrancyGuard, tối ưu Gas EVM, Foundry/Hardhat tests. |
|
|
92
|
+
| **Next.js Guide** | `.claude/skills/nextjs-guide/SKILL.md` | App Router, Server Components (RSC), và Server Actions. |
|
|
93
|
+
| **React Guide** | `.claude/skills/react-guide/SKILL.md` | Single Source of Truth, tối ưu Render & Custom Hooks. |
|
|
94
|
+
| **Python Guide** | `.claude/skills/python-guide/SKILL.md` | FastAPI, Django, Type hints & Pydantic. |
|
|
95
|
+
| **MCP Mastery** | `.claude/skills/mcp-mastery/SKILL.md` | Cấu hình và gọi các Model Context Protocol servers. |
|
|
96
|
+
| **Debug Optimizer** | `.claude/skills/debug-optimizer/SKILL.md` | Quy trình truy tìm nguyên nhân gốc rễ (Root Cause) 4 bước. |
|
|
97
|
+
| **Security Guide** | `.claude/skills/security-guide/SKILL.md` | OWASP Top 10: quản lý secrets, chống injection, phân quyền, validate input. |
|
|
98
|
+
| **Tool Selection** | `.claude/skills/tool-selection/SKILL.md` | Chiến lược chọn đúng tool nhằm giảm thiểu số lần gọi API. |
|
|
99
|
+
| **Plan Mastery** | `.claude/skills/plan-mode-mastery/SKILL.md` | Lập kế hoạch bài bản trước khi bắt đầu sinh code. |
|
|
100
|
+
| **Vite Guide** | `.claude/skills/vite-guide/SKILL.md` | Cấu hình bundling SPA tối ưu hiệu năng. |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 📄 Bản Quyền
|
|
105
|
+
|
|
106
|
+
Phát hành dưới giấy phép MIT © [jacob-tech](https://github.com/mytoandeptrai)
|
package/bin/cli.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { fileURLToPath } from 'url';
|
|
9
9
|
import { dirname, join, resolve } from 'path';
|
|
10
|
-
import { cp
|
|
10
|
+
import { cp } from 'fs/promises';
|
|
11
11
|
import { existsSync } from 'fs';
|
|
12
12
|
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -28,9 +28,18 @@ if (command === 'init') {
|
|
|
28
28
|
await cp(join(packageRoot, 'CLAUDE.md'), join(targetDir, 'CLAUDE.md'));
|
|
29
29
|
console.log(' ✅ Created CLAUDE.md (Root agent instruction guidelines)');
|
|
30
30
|
|
|
31
|
-
// 2. Copy .claude folder
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
// 2. Copy .claude folder (never overwrite the project's own settings.json)
|
|
32
|
+
const settingsSrc = join(packageRoot, '.claude', 'settings.json');
|
|
33
|
+
const settingsDest = join(targetDir, '.claude', 'settings.json');
|
|
34
|
+
const keepSettings = existsSync(settingsDest);
|
|
35
|
+
await cp(join(packageRoot, '.claude'), join(targetDir, '.claude'), {
|
|
36
|
+
recursive: true,
|
|
37
|
+
filter: (src) => !(keepSettings && src === settingsSrc),
|
|
38
|
+
});
|
|
39
|
+
console.log(' ✅ Created .claude/ (Skills, rules and Claude Code hooks)');
|
|
40
|
+
if (keepSettings) {
|
|
41
|
+
console.log(` ⚠️ Kept your existing .claude/settings.json — merge the "hooks" block from ${settingsSrc} manually.`);
|
|
42
|
+
}
|
|
34
43
|
|
|
35
44
|
console.log('\n🎉 Successfully initialized Claudify!');
|
|
36
45
|
console.log('👉 Next Steps:');
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudify-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Enterprise-grade workflow & context optimization framework for Claude Code, Claude Desktop, and AI coding agents.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/mytoandeptrai/claudify-agent.git"
|
|
8
|
+
},
|
|
5
9
|
"type": "module",
|
|
6
10
|
"main": "bin/cli.js",
|
|
7
11
|
"bin": {
|
|
@@ -42,5 +46,13 @@
|
|
|
42
46
|
},
|
|
43
47
|
"publishConfig": {
|
|
44
48
|
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@eslint/js": "^10.0.1",
|
|
52
|
+
"@types/node": "^26.6.6",
|
|
53
|
+
"eslint": "^10.14.0",
|
|
54
|
+
"globals": "^17.14.0",
|
|
55
|
+
"typescript": "^6.0.3",
|
|
56
|
+
"typescript-eslint": "^8.72.1"
|
|
45
57
|
}
|
|
46
58
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Root Cause Debugging & Troubleshooting
|
|
2
|
-
|
|
3
|
-
## 4-Step Systematic Debugging Protocol
|
|
4
|
-
1. **Reproduce & Isolate:** Recreate the exact failure case with minimal reproduction code or single targeted test.
|
|
5
|
-
2. **Inspect & Trace:** Check actual runtime logs, stack traces, and variable states instead of guessing.
|
|
6
|
-
3. **Hypothesize & Form Minimal Fix:** Identify the root mechanism causing the breakdown. Form the smallest possible diff that completely fixes the issue.
|
|
7
|
-
4. **Regression Prevention:** Add a targeted regression test confirming the bug is dead and adjacent modules remain intact.
|
|
8
|
-
|
|
9
|
-
## Anti-Patterns
|
|
10
|
-
- ❌ Do NOT randomly wrap code in `try-catch` blocks without handling or logging errors.
|
|
11
|
-
- ❌ Do NOT suppress TypeScript compiler errors with `@ts-ignore` or `as any`.
|
|
12
|
-
- ❌ Do NOT write sprawling test fixtures when a focused unit test suffices.
|
package/.claude/skills/nextjs.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Next.js 14+ / App Router Mastery Skill
|
|
2
|
-
|
|
3
|
-
## Core Principles
|
|
4
|
-
1. **Server Components by Default:** Keep components as React Server Components (RSC) unless interactivity (hooks, state, browser events) is strictly required.
|
|
5
|
-
2. **Client Components Boundary:** Push `'use client'` to the leaf nodes of the component tree to maximize server-side performance.
|
|
6
|
-
3. **Data Fetching:** Fetch data directly inside Server Components using async/await. Avoid `useEffect` for data loading.
|
|
7
|
-
4. **Server Actions:** Use Server Actions for mutations. Always validate incoming inputs with Zod before database operations.
|
|
8
|
-
5. **Route Handlers:** Place API endpoints in `app/api/[route]/route.ts`. Return typed `NextResponse.json(...)`.
|
|
9
|
-
|
|
10
|
-
## Anti-Patterns to Avoid
|
|
11
|
-
- ❌ Do NOT add `'use client'` to top-level page components (`page.tsx`) just to use a small client button.
|
|
12
|
-
- ❌ Do NOT leak secrets or database queries into Client Components.
|
|
13
|
-
- ❌ Do NOT use `router.refresh()` in loops.
|
package/.claude/skills/react.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# React & State Management Mastery
|
|
2
|
-
|
|
3
|
-
## Architecture Rules
|
|
4
|
-
1. **Single Source of Truth:** Keep state as close to where it is consumed as possible.
|
|
5
|
-
2. **State Elevation:** Only elevate state to global store (Zustand, Context) when shared across distant siblings.
|
|
6
|
-
3. **Pure Components:** Keep rendering pure. Side effects belong strictly in `useEffect` or event handlers.
|
|
7
|
-
4. **Custom Hooks:** Extract reusable component logic and state handling into `use[Feature]` custom hooks.
|
|
8
|
-
|
|
9
|
-
## Performance Checklist
|
|
10
|
-
- Memoize expensive calculations with `useMemo`.
|
|
11
|
-
- Avoid premature optimization; profile render frequency before adding `useCallback` everywhere.
|
|
12
|
-
- Always provide stable, unique `key` props (never use array index for dynamic/reorderable lists).
|