@neyugn/agent-kits 0.3.9 β†’ 0.5.0

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
@@ -171,8 +171,9 @@ import fs from "fs/promises";
171
171
  import path2 from "path";
172
172
  import { fileURLToPath } from "url";
173
173
  var __dirname = path2.dirname(fileURLToPath(import.meta.url));
174
- var KITS_DIR = path2.resolve(__dirname, "../kits");
175
- var COMMON_DIR = path2.resolve(__dirname, "../common");
174
+ var isSourceFolder = __dirname.includes(path2.join("src", "installers"));
175
+ var KITS_DIR = isSourceFolder ? path2.resolve(__dirname, "../../kits") : path2.resolve(__dirname, "../kits");
176
+ var COMMON_DIR = isSourceFolder ? path2.resolve(__dirname, "../../common") : path2.resolve(__dirname, "../common");
176
177
  function getKitSource(kitId) {
177
178
  const kit = KITS.find((k) => k.id === kitId);
178
179
  if (!kit || !kit.available) {
@@ -211,6 +212,29 @@ async function copyDirectory(src, dest, exclude = [], toolPath) {
211
212
  }
212
213
  }
213
214
  }
215
+ async function assembleRulesContent(rulesDir, content) {
216
+ const includeRegex = /\[INCLUDE:([^\]]+)\]/g;
217
+ let result = content;
218
+ const matches = [...content.matchAll(includeRegex)];
219
+ for (const match of matches) {
220
+ const includeFile = match[1];
221
+ const sectionPath = path2.join(rulesDir, "sections", includeFile);
222
+ try {
223
+ const sectionContent = await fs.readFile(sectionPath, "utf-8");
224
+ const assembledSection = await assembleRulesContent(
225
+ rulesDir,
226
+ sectionContent
227
+ );
228
+ result = result.replace(match[0], assembledSection);
229
+ } catch (e) {
230
+ result = result.replace(
231
+ match[0],
232
+ `<!-- Missing include: ${includeFile} -->`
233
+ );
234
+ }
235
+ }
236
+ return result;
237
+ }
214
238
  async function countItems(dirPath) {
215
239
  try {
216
240
  const entries = await fs.readdir(dirPath);
@@ -225,6 +249,10 @@ async function copyRulesFile(kitSourcePath, kitTargetPath, targetPath, aiTool, s
225
249
  await fs.mkdir(path2.dirname(rulesTarget), { recursive: true });
226
250
  try {
227
251
  let rulesContent = await fs.readFile(rulesSource, "utf-8");
252
+ rulesContent = await assembleRulesContent(
253
+ path2.dirname(rulesSource),
254
+ rulesContent
255
+ );
228
256
  rulesContent = replaceToolPaths(rulesContent, aiTool.path);
229
257
  if (workflowsReplacement) {
230
258
  rulesContent = rulesContent.replace(
@@ -237,6 +265,10 @@ async function copyRulesFile(kitSourcePath, kitTargetPath, targetPath, aiTool, s
237
265
  try {
238
266
  const fallbackSource = path2.join(kitSourcePath, "rules", "GEMINI.md");
239
267
  let rulesContent = await fs.readFile(fallbackSource, "utf-8");
268
+ rulesContent = await assembleRulesContent(
269
+ path2.dirname(fallbackSource),
270
+ rulesContent
271
+ );
240
272
  rulesContent = replaceToolPaths(rulesContent, aiTool.path);
241
273
  if (workflowsReplacement) {
242
274
  rulesContent = rulesContent.replace(
@@ -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,310 +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 |
25
+ [INCLUDE:workflows.md]
149
26
 
150
27
  ---
151
28
 
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 - see ARCHITECTURE.md)
186
-
187
- Key skills: `api-patterns`, `database-design`, `react-patterns`, `typescript-patterns`, `docker-patterns`, `kubernetes-patterns`, `terraform-patterns`, `auth-patterns`, `graphql-patterns`, `redis-patterns`, `realtime-patterns`, `queue-patterns`, `multi-tenancy`, `ai-rag-patterns`, `prompt-engineering`, `monitoring-observability`, `frontend-design`, `mobile-design`, `tailwind-patterns`, `e2e-testing`, `performance-profiling`, `github-actions`, `gitlab-ci-patterns`
188
-
189
- > πŸ”΄ Full skill list: See `ARCHITECTURE.md` β†’ Skills section
29
+ [INCLUDE:skill.md]
190
30
 
191
31
  ---
192
32
 
193
- ## TIER 0: UNIVERSAL RULES
194
-
195
- ### 🌐 Language
196
-
197
- - Non-English prompt β†’ Respond in user's language
198
- - Code comments/variables β†’ Always English
199
- - File names β†’ Always English (kebab-case)
200
-
201
- ### 🧹 Clean Code
202
-
203
- - Concise, no over-engineering, self-documenting
204
- - Testing: Pyramid (Unit > Int > E2E) + AAA
205
- - Performance: Measure first, Core Web Vitals
206
-
207
- ### πŸ—ΊοΈ System Map
208
-
209
- > πŸ”΄ Read `ARCHITECTURE.md` at session start.
210
-
211
- **Paths:** Agents `.agent/agents/`, Skills `.agent/skills/`, Workflows `.agent/workflows/`
212
-
213
- ### 🧠 Read β†’ Understand β†’ Apply
214
-
215
- Before coding: 1) What is the GOAL? 2) What PRINCIPLES? 3) How does this DIFFER from generic?
33
+ [INCLUDE:universal.md]
216
34
 
217
35
  ---
218
36
 
219
- ## TIER 1: CODE RULES
220
-
221
- ### πŸ“± Project Routing
222
-
223
- | Type | Agent | Skills |
224
- | ---------------------------------- | ------------------- | ----------------------------- |
225
- | MOBILE (iOS, Android, RN, Flutter) | mobile-developer | mobile-design |
226
- | WEB (Next.js, React) | frontend-specialist | frontend-design |
227
- | BACKEND (API, DB) | backend-specialist | api-patterns, database-design |
228
-
229
- > πŸ”΄ Mobile + frontend-specialist = WRONG.
230
-
231
- ### πŸ›‘ Socratic Gate
232
-
233
- For complex requests, STOP and ASK first:
234
-
235
- | Request Type | Action |
236
- | ------------------- | ------------------------------------- |
237
- | New Feature / Build | Ask 3+ strategic questions |
238
- | Code Edit / Bug Fix | Confirm understanding first |
239
- | Vague Request | Ask Purpose, Users, Scope |
240
- | Full Orchestration | User must confirm plan before Phase 2 |
241
-
242
- **Never Assume.** If 1% unclear β†’ ASK.
243
-
244
- ### 🎭 Mode Mapping
245
-
246
- | Mode | Agent | Behavior |
247
- | ---- | --------------- | ------------------------------- |
248
- | plan | project-planner | 4-phase, NO CODE before Phase 4 |
249
- | ask | - | Questions only |
250
- | edit | orchestrator | Check {task-slug}.md first |
37
+ [INCLUDE:code.md]
251
38
 
252
39
  ---
253
40
 
254
- ## TIER 2: DESIGN RULES
255
-
256
- > Rules in specialist agents: Web β†’ `frontend-specialist.md`, Mobile β†’ `mobile-developer.md`
41
+ [INCLUDE:design.md]
257
42
 
258
43
  ---
259
44
 
260
- ## πŸ“œ SCRIPTS (Automation)
261
-
262
- ### When to Run Scripts
263
-
264
- | Trigger | Script | Purpose |
265
- | ---------------- | -------------------------- | ---------------------------------------- |
266
- | Before PR/commit | `checklist.py` | Quick validation (Security, Lint, Tests) |
267
- | Before deploy | `verify_all.py` | Full pre-deployment suite |
268
- | Kit maintenance | `kit_status.py --validate` | Check kit integrity |
269
- | Managing skills | `skills_manager.py` | Enable/disable/search skills |
270
-
271
- ### Master Scripts
272
-
273
- ```bash
274
- # Quick check during development
275
- python3 .agent/scripts/checklist.py .
276
-
277
- # Full check with performance audits
278
- python3 .agent/scripts/checklist.py . --url http://localhost:3000
279
-
280
- # Pre-deployment verification
281
- python3 .agent/scripts/verify_all.py . --url http://localhost:3000
282
-
283
- # Kit status
284
- python3 .agent/scripts/kit_status.py --validate
285
-
286
- # Skill management
287
- python3 .agent/scripts/skills_manager.py list
288
- python3 .agent/scripts/skills_manager.py search <query>
289
- ```
290
-
291
- ### Skill-Specific Scripts
292
-
293
- | Skill | Script | When to Use |
294
- | ------------------------ | --------------------- | -------------------------------- |
295
- | `clean-code` | `lint_runner.py` | After code changes |
296
- | `testing-patterns` | `test_runner.py` | After logic changes |
297
- | `security-fundamentals` | `security_scan.py` | Before deploy, after deps change |
298
- | `database-design` | `schema_validator.py` | After schema changes |
299
- | `api-patterns` | `api_validator.py` | After API changes |
300
- | `i18n-localization` | `i18n_checker.py` | After UI text changes |
301
- | `seo-patterns` | `seo_checker.py` | After page changes |
302
- | `accessibility-patterns` | `a11y_checker.py` | After UI changes |
303
-
304
- ### AI Script Protocol
305
-
306
- 1. **Security changes** β†’ Run `security_scan.py`
307
- 2. **Database changes** β†’ Run `schema_validator.py`
308
- 3. **API changes** β†’ Run `api_validator.py`
309
- 4. **UI changes** β†’ Run `a11y_checker.py`
310
- 5. **Before suggesting deploy** β†’ Run `verify_all.py`
311
-
312
- > πŸ”΄ Full script documentation: See `ARCHITECTURE.md` β†’ Scripts section
313
-
314
- ---
315
-
316
- ## πŸ“Š Kit Statistics
317
-
318
- | Metric | Count |
319
- | --------- | ----- |
320
- | Agents | 22 |
321
- | Skills | 40 |
322
- | Workflows | 7 |
323
- | Scripts | 19 |
45
+ [INCLUDE:scripts.md]
324
46
 
325
47
  ---
326
48
 
327
- > **Philosophy:** Modular agents + reusable skills + clear workflows + automated scripts = scalable AI assistance.
49
+ [INCLUDE:footer.md]