@neyugn/agent-kits 0.4.0 β†’ 0.5.1

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/dist/cli.js CHANGED
@@ -9,6 +9,8 @@ import gradient from "gradient-string";
9
9
  import os2 from "os";
10
10
  import path6 from "path";
11
11
  import pc from "picocolors";
12
+ import { exec } from "child_process";
13
+ import { promisify } from "util";
12
14
 
13
15
  // src/config.ts
14
16
  import os from "os";
@@ -171,8 +173,9 @@ import fs from "fs/promises";
171
173
  import path2 from "path";
172
174
  import { fileURLToPath } from "url";
173
175
  var __dirname = path2.dirname(fileURLToPath(import.meta.url));
174
- var KITS_DIR = path2.resolve(__dirname, "../kits");
175
- var COMMON_DIR = path2.resolve(__dirname, "../common");
176
+ var isSourceFolder = __dirname.includes(path2.join("src", "installers"));
177
+ var KITS_DIR = isSourceFolder ? path2.resolve(__dirname, "../../kits") : path2.resolve(__dirname, "../kits");
178
+ var COMMON_DIR = isSourceFolder ? path2.resolve(__dirname, "../../common") : path2.resolve(__dirname, "../common");
176
179
  function getKitSource(kitId) {
177
180
  const kit = KITS.find((k) => k.id === kitId);
178
181
  if (!kit || !kit.available) {
@@ -211,6 +214,29 @@ async function copyDirectory(src, dest, exclude = [], toolPath) {
211
214
  }
212
215
  }
213
216
  }
217
+ async function assembleRulesContent(rulesDir, content) {
218
+ const includeRegex = /\[INCLUDE:([^\]]+)\]/g;
219
+ let result = content;
220
+ const matches = [...content.matchAll(includeRegex)];
221
+ for (const match of matches) {
222
+ const includeFile = match[1];
223
+ const sectionPath = path2.join(rulesDir, "sections", includeFile);
224
+ try {
225
+ const sectionContent = await fs.readFile(sectionPath, "utf-8");
226
+ const assembledSection = await assembleRulesContent(
227
+ rulesDir,
228
+ sectionContent
229
+ );
230
+ result = result.replace(match[0], assembledSection);
231
+ } catch (e) {
232
+ result = result.replace(
233
+ match[0],
234
+ `<!-- Missing include: ${includeFile} -->`
235
+ );
236
+ }
237
+ }
238
+ return result;
239
+ }
214
240
  async function countItems(dirPath) {
215
241
  try {
216
242
  const entries = await fs.readdir(dirPath);
@@ -225,6 +251,10 @@ async function copyRulesFile(kitSourcePath, kitTargetPath, targetPath, aiTool, s
225
251
  await fs.mkdir(path2.dirname(rulesTarget), { recursive: true });
226
252
  try {
227
253
  let rulesContent = await fs.readFile(rulesSource, "utf-8");
254
+ rulesContent = await assembleRulesContent(
255
+ path2.dirname(rulesSource),
256
+ rulesContent
257
+ );
228
258
  rulesContent = replaceToolPaths(rulesContent, aiTool.path);
229
259
  if (workflowsReplacement) {
230
260
  rulesContent = rulesContent.replace(
@@ -237,6 +267,10 @@ async function copyRulesFile(kitSourcePath, kitTargetPath, targetPath, aiTool, s
237
267
  try {
238
268
  const fallbackSource = path2.join(kitSourcePath, "rules", "GEMINI.md");
239
269
  let rulesContent = await fs.readFile(fallbackSource, "utf-8");
270
+ rulesContent = await assembleRulesContent(
271
+ path2.dirname(fallbackSource),
272
+ rulesContent
273
+ );
240
274
  rulesContent = replaceToolPaths(rulesContent, aiTool.path);
241
275
  if (workflowsReplacement) {
242
276
  rulesContent = rulesContent.replace(
@@ -966,6 +1000,63 @@ async function installKit(options) {
966
1000
  }
967
1001
 
968
1002
  // src/cli.ts
1003
+ var execAsync = promisify(exec);
1004
+ var PACKAGE_NAME = "@neyugn/agent-kits";
1005
+ function getPkgVersion() {
1006
+ try {
1007
+ const basePath = path6.dirname(new URL(import.meta.url).pathname);
1008
+ const parentPath = path6.join(basePath, "..");
1009
+ const grandParentPath = path6.join(basePath, "..", "..");
1010
+ const pkgFromParent = path6.join(parentPath, "package.json");
1011
+ const pkgFromGrandParent = path6.join(grandParentPath, "package.json");
1012
+ if (fs5.existsSync(pkgFromParent)) {
1013
+ return JSON.parse(fs5.readFileSync(pkgFromParent, "utf-8")).version;
1014
+ }
1015
+ if (fs5.existsSync(pkgFromGrandParent)) {
1016
+ return JSON.parse(fs5.readFileSync(pkgFromGrandParent, "utf-8")).version;
1017
+ }
1018
+ return "unknown";
1019
+ } catch {
1020
+ return "unknown";
1021
+ }
1022
+ }
1023
+ var pkgVersion = getPkgVersion();
1024
+ async function getLatestVersion() {
1025
+ try {
1026
+ const { stdout } = await execAsync(
1027
+ `npm view ${PACKAGE_NAME} version --registry https://registry.npmjs.org`
1028
+ );
1029
+ return stdout.trim();
1030
+ } catch {
1031
+ return null;
1032
+ }
1033
+ }
1034
+ async function checkForUpdates() {
1035
+ const current = pkgVersion;
1036
+ const latest = await getLatestVersion();
1037
+ console.log(
1038
+ boxen(
1039
+ [
1040
+ `${pc.bold("agent-kits")} ${pc.dim(`v${current}`)}`,
1041
+ "",
1042
+ `${pc.dim("Latest:")} ${latest ? pc.cyan(`v${latest}`) : pc.dim("unknown")}`
1043
+ ].join("\n"),
1044
+ { padding: 1, borderStyle: "round", borderColor: "cyan" }
1045
+ )
1046
+ );
1047
+ if (latest && latest !== current) {
1048
+ console.log("");
1049
+ console.log(
1050
+ pc.yellow(` ${pc.bold("\u26A0 Update available!")} Run below to update:`)
1051
+ );
1052
+ console.log(` ${pc.magenta(`npx ${PACKAGE_NAME}@latest`)}`);
1053
+ console.log("");
1054
+ } else if (latest === current) {
1055
+ console.log("");
1056
+ console.log(pc.green(` \u2713 You're on the latest version!`));
1057
+ console.log("");
1058
+ }
1059
+ }
969
1060
  function expandPath(inputPath) {
970
1061
  if (inputPath.startsWith("~")) {
971
1062
  return path6.join(os2.homedir(), inputPath.slice(1));
@@ -1017,6 +1108,32 @@ function displayBanner() {
1017
1108
  console.log("");
1018
1109
  }
1019
1110
  async function main() {
1111
+ const args = process.argv.slice(2);
1112
+ if (args.includes("--check-updates") || args.includes("-u")) {
1113
+ await checkForUpdates();
1114
+ return;
1115
+ }
1116
+ if (args.includes("--version") || args.includes("-v")) {
1117
+ console.log(`v${pkgVersion}`);
1118
+ return;
1119
+ }
1120
+ if (args.includes("--help") || args.includes("-h")) {
1121
+ console.log(
1122
+ boxen(
1123
+ [
1124
+ `${pc.bold("agent-kits")} ${pc.dim(`v${pkgVersion}`)}`,
1125
+ "",
1126
+ `${pc.cyan("--check-updates, -u")} ${pc.dim("Check for available updates")}`,
1127
+ `${pc.cyan("--version, -v")} ${pc.dim("Show current version")}`,
1128
+ `${pc.cyan("--help, -h")} ${pc.dim("Show this help message")}`,
1129
+ "",
1130
+ `${pc.dim("Run without args to start the interactive setup wizard.")}`
1131
+ ].join("\n"),
1132
+ { padding: 1, borderStyle: "round", borderColor: "cyan" }
1133
+ )
1134
+ );
1135
+ return;
1136
+ }
1020
1137
  displayBanner();
1021
1138
  p.intro(pc.bgCyan(pc.black(" SETUP WIZARD ")));
1022
1139
  const aiToolResult = await p.select({
@@ -1,16 +1,6 @@
1
1
  # AGENTS.md - AGT-Kit
2
2
 
3
- > AI Agent Capability Expansion Toolkit - This file defines AI behavior in this workspace.
4
-
5
- ---
6
-
7
- ## 🎯 Kit Purpose
8
-
9
- AGT-Kit is a portable, modular AI agent system consisting of:
10
-
11
- - **22 Specialist Agents** - Role-based AI personas
12
- - **40 Skills** - Domain-specific knowledge modules
13
- - **7 Workflows** - Slash command procedures
3
+ > AI Agent Capability Expansion Toolkit - 22 agents Β· 40 skills Β· 7 workflows.
14
4
 
15
5
  ---
16
6
 
@@ -18,308 +8,42 @@ AGT-Kit is a portable, modular AI agent system consisting of:
18
8
 
19
9
  > **MANDATORY:** Read agent file + skills BEFORE any implementation.
20
10
 
21
- ### Modular Skill Loading
22
-
23
11
  Agent activated β†’ Check frontmatter `skills:` β†’ Read SKILL.md β†’ Apply.
24
12
 
25
- - **Priority:** P0 (AGENTS.md) > P1 (Agent.md) > P2 (SKILL.md). All binding.
26
- - **Enforcement:** Never skip reading. "Read β†’ Understand β†’ Apply" mandatory.
13
+ **Priority:** P0 (AGENTS.md) > P1 (Agent.md) > P2 (SKILL.md). All binding.
27
14
 
28
15
  ---
29
16
 
30
- ## πŸ“₯ REQUEST CLASSIFIER
31
-
32
- | Request Type | Trigger Keywords | Active Agents |
33
- | ------------ | ------------------------ | -------------------------- |
34
- | **QUESTION** | "what is", "explain" | - |
35
- | **PLAN** | "plan", "lαΊ­p kαΊΏ hoαΊ‘ch" | project-planner |
36
- | **CREATE** | "create", "build", "tαΊ‘o" | orchestrator β†’ specialists |
37
- | **DEBUG** | "debug", "fix", "gα»‘ lα»—i" | debugger |
38
- | **TEST** | "test", "kiểm tra" | test-engineer |
39
- | **DEPLOY** | "deploy", "release" | devops-engineer |
40
- | **COMPLEX** | Multi-domain task | orchestrator (3+ agents) |
17
+ [INCLUDE:classifier.md]
41
18
 
42
19
  ---
43
20
 
44
- ## πŸ€– AGENT ROUTING
45
-
46
- **Always analyze and select best agent(s) before responding.**
47
-
48
- ### Protocol
49
-
50
- 1. **Analyze**: Detect domains (Frontend, Backend, Security, etc.)
51
- 2. **Select**: Choose appropriate specialist(s)
52
- 3. **πŸ”΄ Announce**: Your **VERY FIRST line** of response MUST be: `⚑ **@[agent-name] activated!**`
53
- 4. **Apply**: Use agent's persona and rules
54
-
55
- > πŸ”΄ **MANDATORY ANNOUNCEMENT RULE:**
56
- > - You MUST output the announcement as the **first line** of every response before ANY other text.
57
- > - Format: `⚑ **@agent-name activated!**` (replace `agent-name` with actual agent slug)
58
- > - For multi-agent tasks: announce each agent on separate lines
59
- > - This is NON-NEGOTIABLE. The user RELIES on this to verify correct agent routing.
60
- >
61
- > **Example β€” Single agent:**
62
- > ```
63
- > ⚑ **@backend-specialist activated!**
64
- >
65
- > Let me analyze your API endpoint...
66
- > ```
67
- >
68
- > **Example β€” Multiple agents:**
69
- > ```
70
- > ⚑ **@orchestrator activated!**
71
- > ⚑ **@frontend-specialist activated!**
72
- > ⚑ **@backend-specialist activated!**
73
- >
74
- > I'll coordinate the full-stack implementation...
75
- > ```
76
-
77
- ### Tier 1: Master Agents
78
-
79
- | Agent | Use When |
80
- | ----------------- | ---------------------------------------------- |
81
- | `orchestrator` | Complex tasks requiring multiple specialists |
82
- | `project-planner` | Planning projects, creating task breakdowns |
83
- | `debugger` | Investigating bugs, systematic problem solving |
84
-
85
- ### Tier 2: Development Specialists
86
-
87
- | Agent | Use When |
88
- | --------------------- | ----------------------------------- |
89
- | `frontend-specialist` | React, Next.js, Vue, UI/UX work |
90
- | `backend-specialist` | APIs, Node.js, Python, server logic |
91
- | `mobile-developer` | React Native, Flutter, mobile apps |
92
- | `database-specialist` | Schema design, queries, migrations |
93
- | `devops-engineer` | CI/CD, deployment, infrastructure |
94
-
95
- ### Tier 3: Quality & Security
96
-
97
- | Agent | Use When |
98
- | --------------------- | ---------------------------------------- |
99
- | `security-auditor` | Security reviews, vulnerability scanning |
100
- | `code-reviewer` | PR reviews, code quality checks |
101
- | `test-engineer` | Writing tests, TDD, test coverage |
102
- | `performance-analyst` | Performance optimization, profiling |
103
-
104
- ### Tier 4: Domain Specialists
105
-
106
- | Agent | Use When |
107
- | ------------------------ | ------------------------------------------ |
108
- | `realtime-specialist` | WebSocket, Socket.IO, event-driven |
109
- | `multi-tenant-architect` | SaaS, tenant isolation, data partitioning |
110
- | `queue-specialist` | Message queues, background jobs |
111
- | `integration-specialist` | External APIs, webhooks, third-party |
112
- | `ai-engineer` | LLM, RAG, AI/ML systems, prompt eng |
113
- | `cloud-architect` | AWS, Azure, GCP, Terraform, multi-cloud |
114
- | `data-engineer` | ETL, data pipelines, analytics, warehouses |
115
-
116
- ### Tier 5: Support Agents
117
-
118
- | Agent | Use When |
119
- | ---------------------- | ------------------------------------- |
120
- | `documentation-writer` | Technical docs, API documentation |
121
- | `i18n-specialist` | Internationalization, translations |
122
- | `ux-researcher` | UX research, usability, accessibility |
123
-
124
- ### Routing Checklist
125
-
126
- | Step | Check | If Unchecked |
127
- | ---- | ------------------------------- | --------------------------------- |
128
- | 1 | Correct agent identified? | β†’ Analyze domain |
129
- | 2 | Read agent's .md file? | β†’ Open `.agent/agents/{agent}.md` |
130
- | 3 | Announced @agent as FIRST LINE? | β†’ πŸ”΄ Add announcement IMMEDIATELY |
131
- | 4 | Loaded skills from frontmatter? | β†’ Check `skills:` field |
132
-
133
- ❌ Code without agent = PROTOCOL VIOLATION
134
- ❌ Skip announcement = USER CANNOT VERIFY
135
- ❌ Announcement NOT as first line = PROTOCOL VIOLATION
21
+ [INCLUDE:routing.md]
136
22
 
137
23
  ---
138
24
 
139
- ## πŸ“œ WORKFLOWS (Slash Commands)
140
-
141
- | Command | Description | Agent |
142
- | -------------- | ------------------------------------ | --------------- |
143
- | `/plan` | Create project plan, NO CODE | project-planner |
144
- | `/create` | Build new application | orchestrator |
145
- | `/debug` | Systematic debugging | debugger |
146
- | `/test` | Generate and run tests | test-engineer |
147
- | `/deploy` | Production deployment | devops-engineer |
148
- | `/orchestrate` | Multi-agent coordination (3+ agents) | orchestrator |
149
-
150
- ---
151
-
152
- ## πŸ› οΈ SKILL LOADING PROTOCOL
153
-
154
- ```
155
- User Request β†’ Check Profile β†’ Skill Description Match β†’ Load SKILL.md β†’ Apply
156
- ```
157
-
158
- ### Profile-Aware Loading
159
-
160
- > **CRITICAL:** Before loading any skill or selecting any agent, check `.agent/profile.json`
161
-
162
- ```
163
- 1. Check if `.agent/profile.json` exists
164
- 2. If EXISTS:
165
- - Read skills.enabled[] β†’ Only load these skills
166
- - Read skills.disabled[] β†’ Skip these skills
167
- - Read agents.disabled[] β†’ Skip these agents
168
- - Respect userOverrides.force-enabled/force-disabled
169
- 3. If NOT EXISTS:
170
- - All skills/agents are ENABLED by default
171
- - Behave as if no filtering is applied
172
- ```
173
-
174
- ### Core Skills (Always Available)
175
-
176
- These skills are NEVER disabled regardless of profile:
177
-
178
- - `clean-code` - Pragmatic coding standards (used by ALL agents)
179
- - `testing-patterns` - Testing pyramid, AAA pattern
180
- - `security-fundamentals` - OWASP 2025
181
- - `brainstorming` - Socratic questioning protocol
182
- - `plan-writing` - Task breakdown and WBS
183
- - `systematic-debugging` - 4-phase debugging
184
-
185
- ### Domain Skills (40 total)
186
-
187
- > Full skill list with descriptions: See `ARCHITECTURE.md` β†’ Skills section
25
+ [INCLUDE:workflows.md]
188
26
 
189
27
  ---
190
28
 
191
- ## TIER 0: UNIVERSAL RULES
192
-
193
- ### 🌐 Language
194
-
195
- - Non-English prompt β†’ Respond in user's language
196
- - Code comments/variables β†’ Always English
197
- - File names β†’ Always English (kebab-case)
198
-
199
- ### 🧹 Clean Code
200
-
201
- - Concise, no over-engineering, self-documenting
202
- - Testing: Pyramid (Unit > Int > E2E) + AAA
203
- - Performance: Measure first, Core Web Vitals
204
-
205
- ### πŸ—ΊοΈ System Map
206
-
207
- > Read `ARCHITECTURE.md` only when you need full agent/skill details.
208
-
209
- **Paths:** Agents `.agent/agents/`, Skills `.agent/skills/`, Workflows `.agent/workflows/`
210
-
211
- ### 🧠 Read β†’ Understand β†’ Apply
212
-
213
- Before coding: 1) What is the GOAL? 2) What PRINCIPLES? 3) How does this DIFFER from generic?
29
+ [INCLUDE:skill.md]
214
30
 
215
31
  ---
216
32
 
217
- ## TIER 1: CODE RULES
218
-
219
- ### πŸ“± Project Routing
220
-
221
- | Type | Agent | Skills |
222
- | ---------------------------------- | ------------------- | ----------------------------- |
223
- | MOBILE (iOS, Android, RN, Flutter) | mobile-developer | mobile-design |
224
- | WEB (Next.js, React) | frontend-specialist | frontend-design |
225
- | BACKEND (API, DB) | backend-specialist | api-patterns, database-design |
226
-
227
- > πŸ”΄ Mobile + frontend-specialist = WRONG.
228
-
229
- ### πŸ›‘ Socratic Gate
230
-
231
- For complex requests, STOP and ASK first:
232
-
233
- | Request Type | Action |
234
- | ------------------- | ------------------------------------- |
235
- | New Feature / Build | Ask 3+ strategic questions |
236
- | Code Edit / Bug Fix | Confirm understanding first |
237
- | Vague Request | Ask Purpose, Users, Scope |
238
- | Full Orchestration | User must confirm plan before Phase 2 |
239
-
240
- **Never Assume.** If 1% unclear β†’ ASK.
241
-
242
- ### 🎭 Mode Mapping
243
-
244
- | Mode | Agent | Behavior |
245
- | ---- | --------------- | ------------------------------- |
246
- | plan | project-planner | 4-phase, NO CODE before Phase 4 |
247
- | ask | - | Questions only |
248
- | edit | orchestrator | Check {task-slug}.md first |
33
+ [INCLUDE:universal.md]
249
34
 
250
35
  ---
251
36
 
252
- ## TIER 2: DESIGN RULES
253
-
254
- > Rules in specialist agents: Web β†’ `frontend-specialist.md`, Mobile β†’ `mobile-developer.md`
37
+ [INCLUDE:code.md]
255
38
 
256
39
  ---
257
40
 
258
- ## πŸ“œ SCRIPTS (Automation)
259
-
260
- ### When to Run Scripts
261
-
262
- | Trigger | Script | Purpose |
263
- | ---------------- | -------------------------- | ---------------------------------------- |
264
- | Before PR/commit | `checklist.py` | Quick validation (Security, Lint, Tests) |
265
- | Before deploy | `verify_all.py` | Full pre-deployment suite |
266
- | Kit maintenance | `kit_status.py --validate` | Check kit integrity |
267
- | Managing skills | `skills_manager.py` | Enable/disable/search skills |
268
-
269
- ### Master Scripts
270
-
271
- ```bash
272
- # Quick check during development
273
- python3 .agent/scripts/checklist.py .
274
-
275
- # Full check with performance audits
276
- python3 .agent/scripts/checklist.py . --url http://localhost:3000
277
-
278
- # Pre-deployment verification
279
- python3 .agent/scripts/verify_all.py . --url http://localhost:3000
280
-
281
- # Kit status
282
- python3 .agent/scripts/kit_status.py --validate
283
-
284
- # Skill management
285
- python3 .agent/scripts/skills_manager.py list
286
- python3 .agent/scripts/skills_manager.py search <query>
287
- ```
288
-
289
- ### Skill-Specific Scripts
290
-
291
- | Skill | Script | When to Use |
292
- | ------------------------ | --------------------- | -------------------------------- |
293
- | `clean-code` | `lint_runner.py` | After code changes |
294
- | `testing-patterns` | `test_runner.py` | After logic changes |
295
- | `security-fundamentals` | `security_scan.py` | Before deploy, after deps change |
296
- | `database-design` | `schema_validator.py` | After schema changes |
297
- | `api-patterns` | `api_validator.py` | After API changes |
298
- | `i18n-localization` | `i18n_checker.py` | After UI text changes |
299
- | `seo-patterns` | `seo_checker.py` | After page changes |
300
- | `accessibility-patterns` | `a11y_checker.py` | After UI changes |
301
-
302
- ### AI Script Protocol
303
-
304
- 1. **Security changes** β†’ Run `security_scan.py`
305
- 2. **Database changes** β†’ Run `schema_validator.py`
306
- 3. **API changes** β†’ Run `api_validator.py`
307
- 4. **UI changes** β†’ Run `a11y_checker.py`
308
- 5. **Before suggesting deploy** β†’ Run `verify_all.py`
309
-
310
- > πŸ”΄ Full script documentation: See `ARCHITECTURE.md` β†’ Scripts section
41
+ [INCLUDE:design.md]
311
42
 
312
43
  ---
313
44
 
314
- ## πŸ“Š Kit Statistics
315
-
316
- | Metric | Count |
317
- | --------- | ----- |
318
- | Agents | 22 |
319
- | Skills | 40 |
320
- | Workflows | 7 |
321
- | Scripts | 19 |
45
+ [INCLUDE:scripts.md]
322
46
 
323
47
  ---
324
48
 
325
- > **Philosophy:** Modular agents + reusable skills + clear workflows + automated scripts = scalable AI assistance.
49
+ [INCLUDE:footer.md]