ai-devx 1.0.2 → 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/bin/cli.js CHANGED
@@ -1,61 +1,90 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { program } = require('commander');
4
- const chalk = require('chalk');
5
- const pkg = require('../package.json');
6
- const initCommand = require('../src/commands/init');
7
- const updateCommand = require('../src/commands/update');
8
- const statusCommand = require('../src/commands/status');
3
+ const { program } = require("commander");
4
+ const chalk = require("chalk");
5
+ const pkg = require("../package.json");
6
+ const initCommand = require("../src/commands/init");
7
+ const updateCommand = require("../src/commands/update");
8
+ const statusCommand = require("../src/commands/status");
9
9
 
10
- console.log(chalk.cyan.bold(`
10
+ console.log(
11
+ chalk.cyan.bold(`
11
12
  ╔════════════════════════════════════╗
12
13
  ║ 🤖 AI-DEVX ${pkg.version.padEnd(8)} ║
13
14
  ║ AI Agent Templates & Workflows ║
14
15
  ╚════════════════════════════════════╝
15
- `));
16
+ `),
17
+ );
16
18
 
17
19
  program
18
- .name('ai-devx')
19
- .description('AI Agent templates with Skills, Agents, and Workflows')
20
- .version(pkg.version, '-v, --version', 'Display version number');
20
+ .name("ai-devx")
21
+ .description("AI Agent templates with Skills, Agents, and Workflows")
22
+ .version(pkg.version, "-v, --version", "Display version number");
21
23
 
22
24
  program
23
- .command('init')
24
- .description('Install .agent folder into your project')
25
- .option('-f, --force', 'Overwrite existing .agent folder')
26
- .option('-p, --path <path>', 'Install in specific directory', process.cwd())
27
- .option('-b, --branch <branch>', 'Use specific branch from repository', 'main')
28
- .option('-q, --quiet', 'Suppress output (for CI/CD)')
29
- .option('--dry-run', 'Preview actions without executing')
30
- .option('-s, --source <url>', 'Custom template source (GitHub repo)', 'kmamtora/ai-devx')
25
+ .command("init")
26
+ .description("Install .agent folder into your project")
27
+ .option("-f, --force", "Overwrite existing .agent folder")
28
+ .option("-p, --path <path>", "Install in specific directory", process.cwd())
29
+ .option(
30
+ "-b, --branch <branch>",
31
+ "Use specific branch from repository",
32
+ "main",
33
+ )
34
+ .option("-q, --quiet", "Suppress output (for CI/CD)")
35
+ .option("--dry-run", "Preview actions without executing")
36
+ .option(
37
+ "-s, --source <url>",
38
+ "Custom template source (GitHub repo)",
39
+ "kmamtora/ai-devx",
40
+ )
41
+ .option(
42
+ "-a, --assistant <assistants>",
43
+ "Comma-separated list of assistants (claude,gemini,all)",
44
+ "all",
45
+ )
31
46
  .action(initCommand);
32
47
 
33
48
  program
34
- .command('update')
35
- .description('Update to the latest version of templates')
36
- .option('-f, --force', 'Force update even if up-to-date')
37
- .option('--backup', 'Create backup before updating')
38
- .option('-q, --quiet', 'Suppress output')
49
+ .command("update")
50
+ .description("Update to the latest version of templates")
51
+ .option("-f, --force", "Force update even if up-to-date")
52
+ .option("--backup", "Create backup before updating")
53
+ .option("-q, --quiet", "Suppress output")
39
54
  .action(updateCommand);
40
55
 
41
56
  program
42
- .command('status')
43
- .description('Check installation status and version info')
44
- .option('-p, --path <path>', 'Check specific directory', process.cwd())
57
+ .command("status")
58
+ .description("Check installation status and version info")
59
+ .option("-p, --path <path>", "Check specific directory", process.cwd())
45
60
  .action(statusCommand);
46
61
 
47
- program.on('--help', () => {
48
- console.log('');
49
- console.log(chalk.bold('Examples:'));
50
- console.log(' $ ai-devx init # Install in current directory');
51
- console.log(' $ ai-devx init --path ./my-project # Install in specific directory');
52
- console.log(' $ ai-devx init --force # Overwrite existing installation');
53
- console.log(' $ ai-devx update # Update templates');
54
- console.log(' $ ai-devx status # Check installation status');
55
- console.log('');
56
- console.log(chalk.bold('Quick Start:'));
57
- console.log(' $ npx ai-devx init');
58
- console.log('');
62
+ program.on("--help", () => {
63
+ console.log("");
64
+ console.log(chalk.bold("Examples:"));
65
+ console.log(
66
+ " $ ai-devx init # Install in current directory",
67
+ );
68
+ console.log(
69
+ " $ ai-devx init --path ./my-project # Install in specific directory",
70
+ );
71
+ console.log(
72
+ " $ ai-devx init --force # Overwrite existing installation",
73
+ );
74
+ console.log(
75
+ " $ ai-devx init --assistant claude # Install with only Claude rules",
76
+ );
77
+ console.log(
78
+ " $ ai-devx init --assistant claude,gemini # Install with both assistants",
79
+ );
80
+ console.log(" $ ai-devx update # Update templates");
81
+ console.log(
82
+ " $ ai-devx status # Check installation status",
83
+ );
84
+ console.log("");
85
+ console.log(chalk.bold("Quick Start:"));
86
+ console.log(" $ npx ai-devx init");
87
+ console.log("");
59
88
  });
60
89
 
61
90
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-devx",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "AI Agent templates with Skills, Agents, and Workflows for enhanced coding assistance",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,83 +1,119 @@
1
- const path = require('path');
2
- const fs = require('fs-extra');
3
- const ora = require('ora');
4
- const logger = require('../utils/logger');
5
- const fileUtils = require('../utils/fileSystem');
6
- const config = require('../config');
1
+ const path = require("path");
2
+ const fs = require("fs-extra");
3
+ const ora = require("ora");
4
+ const logger = require("../utils/logger");
5
+ const fileUtils = require("../utils/fileSystem");
6
+ const config = require("../config");
7
7
 
8
8
  async function initCommand(options) {
9
- const { force, path: targetPath, branch, quiet, dryRun, source } = options;
10
-
11
- const spinner = quiet ? null : ora('Installing AI-DEVX templates...').start();
12
-
9
+ const {
10
+ force,
11
+ path: targetPath,
12
+ branch,
13
+ quiet,
14
+ dryRun,
15
+ source,
16
+ assistant,
17
+ } = options;
18
+
19
+ const spinner = quiet ? null : ora("Installing AI-DEVX templates...").start();
20
+
13
21
  try {
14
22
  const absolutePath = path.resolve(targetPath);
15
23
  const agentPath = path.join(absolutePath, config.AGENT_FOLDER);
16
-
24
+
17
25
  // Check if already installed
18
26
  const isInstalled = await fileUtils.isInstalled(absolutePath);
19
-
27
+
20
28
  if (isInstalled && !force && !dryRun) {
21
29
  if (spinner) spinner.stop();
22
- logger.warning('AI-DEVX is already installed in this directory.');
23
- logger.info('Use --force to overwrite or run "ai-devx update" to update.');
30
+ logger.warning("AI-DEVX is already installed in this directory.");
31
+ logger.info(
32
+ 'Use --force to overwrite or run "ai-devx update" to update.',
33
+ );
24
34
  logger.blank();
25
- logger.info('To keep .agent/ local without git tracking:');
35
+ logger.info("To keep .agent/ local without git tracking:");
26
36
  logger.step('Add ".agent/" to .git/info/exclude (not .gitignore)');
27
37
  return;
28
38
  }
29
-
39
+
30
40
  if (dryRun) {
31
41
  if (spinner) spinner.stop();
32
- logger.info('DRY RUN - Actions that would be taken:');
42
+ logger.info("DRY RUN - Actions that would be taken:");
33
43
  logger.step(`Install templates to: ${agentPath}`);
34
- if (isInstalled) logger.step('Overwrite existing installation');
44
+ if (isInstalled) logger.step("Overwrite existing installation");
35
45
  return;
36
46
  }
37
-
47
+
38
48
  // Determine source path
39
- const sourcePath = path.join(__dirname, '../../templates/.agent');
40
-
49
+ const sourcePath = path.join(__dirname, "../../templates/.agent");
50
+
41
51
  // Copy templates
42
- if (spinner) spinner.text = 'Copying template files...';
52
+ if (spinner) spinner.text = "Copying template files...";
43
53
  await fileUtils.copyDir(sourcePath, agentPath, { force });
44
-
54
+
55
+ // Handle assistant selection
56
+ if (spinner) spinner.text = "Configuring assistants...";
57
+ const selectedAssistants =
58
+ assistant === "all"
59
+ ? ["claude", "gemini"]
60
+ : assistant
61
+ .toLowerCase()
62
+ .split(",")
63
+ .map((a) => a.trim());
64
+
65
+ const rulesPath = path.join(agentPath, "rules");
66
+ const validAssistants = ["claude", "gemini"];
67
+
68
+ // Remove rules for unselected assistants
69
+ for (const ast of validAssistants) {
70
+ if (!selectedAssistants.includes(ast)) {
71
+ const ruleFile = path.join(rulesPath, `${ast.toUpperCase()}.md`);
72
+ try {
73
+ await fs.remove(ruleFile);
74
+ } catch (e) {
75
+ // File might not exist, ignore
76
+ }
77
+ }
78
+ }
79
+
45
80
  // Write version file
46
- const versionFile = path.join(agentPath, 'VERSION');
47
- await fs.writeFile(versionFile, config.version || '1.0.0');
48
-
81
+ const versionFile = path.join(agentPath, "VERSION");
82
+ await fs.writeFile(versionFile, config.version || "1.0.0");
83
+
49
84
  // Write config file
50
- const configFile = path.join(agentPath, 'config.json');
85
+ const configFile = path.join(agentPath, "config.json");
51
86
  await fileUtils.writeJson(configFile, {
52
- version: '1.0.0',
87
+ version: "1.0.0",
53
88
  installedAt: new Date().toISOString(),
54
- source: source
89
+ source: source,
90
+ assistants: selectedAssistants,
55
91
  });
56
-
57
- if (spinner) spinner.succeed('AI-DEVX templates installed successfully!');
58
-
92
+
93
+ if (spinner) spinner.succeed("AI-DEVX templates installed successfully!");
94
+
59
95
  if (!quiet) {
60
96
  logger.blank();
61
97
  logger.success(`Installed in: ${agentPath}`);
62
98
  logger.blank();
63
- logger.info('What\'s included:');
99
+ logger.info("What's included:");
64
100
  logger.step(`Agents: 9 specialist personas`);
65
101
  logger.step(`Skills: Domain-specific knowledge modules`);
66
102
  logger.step(`Workflows: Slash commands (/plan, /create, /debug, etc.)`);
67
103
  logger.step(`Scripts: Validation and automation tools`);
104
+ logger.step(`Assistants: ${selectedAssistants.join(", ")}`);
68
105
  logger.blank();
69
- logger.info('Quick Start:');
70
- logger.step('Type /plan to create a task breakdown');
71
- logger.step('Type /create to build new features');
72
- logger.step('Type /debug for systematic debugging');
106
+ logger.info("Quick Start:");
107
+ logger.step("Type /plan to create a task breakdown");
108
+ logger.step("Type /create to build new features");
109
+ logger.step("Type /debug for systematic debugging");
73
110
  logger.blank();
74
- logger.warning('Important: For Cursor/Windsurf compatibility');
111
+ logger.warning("Important: For Cursor/Windsurf compatibility");
75
112
  logger.step('Add ".agent/" to .git/info/exclude (NOT .gitignore)');
76
- logger.step('This keeps templates local while allowing AI indexing');
113
+ logger.step("This keeps templates local while allowing AI indexing");
77
114
  }
78
-
79
115
  } catch (error) {
80
- if (spinner) spinner.fail('Installation failed');
116
+ if (spinner) spinner.fail("Installation failed");
81
117
  logger.error(error.message);
82
118
  process.exit(1);
83
119
  }
@@ -0,0 +1,273 @@
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
5
+ # CLAUDE.md - Intelligence Core
6
+
7
+ > This file defines how Claude behaves in this workspace.
8
+
9
+ ---
10
+
11
+ ## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
12
+
13
+ > **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
14
+
15
+ ### 1. Modular Skill Loading Protocol
16
+
17
+ Agent activated → Check frontmatter "skills:" → Read SKILL.md (INDEX) → Read specific sections.
18
+
19
+ - **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
20
+ - **Rule Priority:** P0 (CLAUDE.md) > P1 (Agent .md) > P2 (SKILL.md). All rules are binding.
21
+
22
+ ### 2. Enforcement Protocol
23
+
24
+ 1. **When agent is activated:**
25
+ - ✅ Activate: Read Rules → Check Frontmatter → Load SKILL.md → Apply All.
26
+ 2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.
27
+
28
+ ---
29
+
30
+ ## 📥 REQUEST CLASSIFIER (STEP 1)
31
+
32
+ **Before ANY action, classify the request:**
33
+
34
+ | Request Type | Trigger Keywords | Active Tiers | Result |
35
+ | ---------------- | ------------------------------------------ | ------------------------------ | --------------------------- |
36
+ | **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
37
+ | **SURVEY/INTEL** | "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
38
+ | **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
39
+ | **COMPLEX CODE** | "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
40
+ | **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
41
+ | **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |
42
+
43
+ ---
44
+
45
+ ## 🤖 INTELLIGENT AGENT ROUTING (STEP 2 - AUTO)
46
+
47
+ **ALWAYS ACTIVE: Before responding to ANY request, automatically analyze and select the best agent(s).**
48
+
49
+ > 🔴 **MANDATORY:** You MUST follow the protocol defined in `@[skills/intelligent-routing]`.
50
+
51
+ ### Auto-Selection Protocol
52
+
53
+ 1. **Analyze (Silent)**: Detect domains (Frontend, Backend, Security, etc.) from user request.
54
+ 2. **Select Agent(s)**: Choose the most appropriate specialist(s).
55
+ 3. **Inform User**: Concisely state which expertise is being applied.
56
+ 4. **Apply**: Generate response using the selected agent's persona and rules.
57
+
58
+ ### Response Format (MANDATORY)
59
+
60
+ When auto-applying an agent, inform the user:
61
+
62
+ ```markdown
63
+ 🤖 **Applying knowledge of `@[agent-name]`...**
64
+
65
+ [Continue with specialized response]
66
+ ```
67
+
68
+ **Rules:**
69
+
70
+ 1. **Silent Analysis**: No verbose meta-commentary ("I am analyzing...").
71
+ 2. **Respect Overrides**: If user mentions `@agent`, use it.
72
+ 3. **Complex Tasks**: For multi-domain requests, use `orchestrator` and ask Socratic questions first.
73
+
74
+ ### ⚠️ AGENT ROUTING CHECKLIST (MANDATORY BEFORE EVERY CODE/DESIGN RESPONSE)
75
+
76
+ **Before ANY code or design work, you MUST complete this mental checklist:**
77
+
78
+ | Step | Check | If Unchecked |
79
+ | ---- | -------------------------------------------------------- | -------------------------------------------- |
80
+ | 1 | Did I identify the correct agent for this domain? | → STOP. Analyze request domain first. |
81
+ | 2 | Did I READ the agent's `.md` file (or recall its rules)? | → STOP. Open `.agent/agents/{agent}.md` |
82
+ | 3 | Did I announce `🤖 Applying knowledge of @[agent]...`? | → STOP. Add announcement before response. |
83
+ | 4 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |
84
+
85
+ **Failure Conditions:**
86
+
87
+ - ❌ Writing code without identifying an agent = **PROTOCOL VIOLATION**
88
+ - ❌ Skipping the announcement = **USER CANNOT VERIFY AGENT WAS USED**
89
+ - ❌ Ignoring agent-specific rules (e.g., Purple Ban) = **QUALITY FAILURE**
90
+
91
+ > 🔴 **Self-Check Trigger:** Every time you are about to write code or create UI, ask yourself:
92
+ > "Have I completed the Agent Routing Checklist?" If NO → Complete it first.
93
+
94
+ ---
95
+
96
+ ## TIER 0: UNIVERSAL RULES (Always Active)
97
+
98
+ ### 🌐 Language Handling
99
+
100
+ When user's prompt is NOT in English:
101
+
102
+ 1. **Internally translate** for better comprehension
103
+ 2. **Respond in user's language** - match their communication
104
+ 3. **Code comments/variables** remain in English
105
+
106
+ ### 🧹 Clean Code (Global Mandatory)
107
+
108
+ **ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.**
109
+
110
+ - **Code**: Concise, direct, no over-engineering. Self-documenting.
111
+ - **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
112
+ - **Performance**: Measure first. Adhere to 2025 standards (Core Web Vitals).
113
+ - **Infra/Safety**: 5-Phase Deployment. Verify secrets security.
114
+
115
+ ### 📁 File Dependency Awareness
116
+
117
+ **Before modifying ANY file:**
118
+
119
+ 1. Check `CODEBASE.md` → File Dependencies
120
+ 2. Identify dependent files
121
+ 3. Update ALL affected files together
122
+
123
+ ### 🗺️ System Map Read
124
+
125
+ > 🔴 **MANDATORY:** Read `ARCHITECTURE.md` at session start to understand Agents, Skills, and Scripts.
126
+
127
+ **Path Awareness:**
128
+
129
+ - Agents: `.agent/` (Project)
130
+ - Skills: `.agent/skills/` (Project)
131
+ - Runtime Scripts: `.agent/skills/<skill>/scripts/`
132
+
133
+ ### 🧠 Read → Understand → Apply
134
+
135
+ ```
136
+ ❌ WRONG: Read agent file → Start coding
137
+ ✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
138
+ ```
139
+
140
+ **Before coding, answer:**
141
+
142
+ 1. What is the GOAL of this agent/skill?
143
+ 2. What PRINCIPLES must I apply?
144
+ 3. How does this DIFFER from generic output?
145
+
146
+ ---
147
+
148
+ ## TIER 1: CODE RULES (When Writing Code)
149
+
150
+ ### 📱 Project Type Routing
151
+
152
+ | Project Type | Primary Agent | Skills |
153
+ | -------------------------------------- | --------------------- | ----------------------------- |
154
+ | **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
155
+ | **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
156
+ | **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
157
+
158
+ > 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
159
+
160
+ ### 🛑 Socratic Gate
161
+
162
+ **For complex requests, STOP and ASK first:**
163
+
164
+ ### 🛑 GLOBAL SOCRATIC GATE (TIER 0)
165
+
166
+ **MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
167
+
168
+ | Request Type | Strategy | Required Action |
169
+ | ----------------------- | -------------- | ----------------------------------------------------------------- |
170
+ | **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
171
+ | **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
172
+ | **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
173
+ | **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
174
+ | **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
175
+
176
+ **Protocol:**
177
+
178
+ 1. **Never Assume:** If even 1% is unclear, ASK.
179
+ 2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting.
180
+ 3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
181
+ 4. **Reference:** Full protocol in `@[skills/brainstorming]`.
182
+
183
+ ### 🏁 Final Checklist Protocol
184
+
185
+ **Trigger:** When the user says "final checks", "run all tests", "verify everything", or similar phrases.
186
+
187
+ | Task Stage | Command | Purpose |
188
+ | ---------------- | -------------------------------------------------- | ------------------------------ |
189
+ | **Manual Audit** | `python .agent/scripts/checklist.py .` | Priority-based project audit |
190
+ | **Pre-Deploy** | `python .agent/scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
191
+
192
+ **Priority Execution Order:**
193
+
194
+ 1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**
195
+
196
+ **Rules:**
197
+
198
+ - **Completion:** A task is NOT finished until `checklist.py` returns success.
199
+ - **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
200
+
201
+ **Available Scripts (12 total):**
202
+
203
+ | Script | Skill | When to Use |
204
+ | -------------------------- | --------------------- | ------------------- |
205
+ | `security_scan.py` | vulnerability-scanner | Always on deploy |
206
+ | `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy |
207
+ | `lint_runner.py` | lint-and-validate | Every code change |
208
+ | `test_runner.py` | testing-patterns | After logic change |
209
+ | `schema_validator.py` | database-design | After DB change |
210
+ | `ux_audit.py` | frontend-design | After UI change |
211
+ | `accessibility_checker.py` | frontend-design | After UI change |
212
+ | `seo_checker.py` | seo-fundamentals | After page change |
213
+ | `bundle_analyzer.py` | performance-profiling | Before deploy |
214
+ | `mobile_audit.py` | mobile-design | After mobile change |
215
+ | `lighthouse_audit.py` | performance-profiling | Before deploy |
216
+ | `playwright_runner.py` | webapp-testing | Before deploy |
217
+
218
+ > 🔴 **Agents & Skills can invoke ANY script** via `python .agent/skills/<skill>/scripts/<script>.py`
219
+
220
+ ### 🎭 Claude Mode Mapping
221
+
222
+ | Mode | Agent | Behavior |
223
+ | -------- | ----------------- | -------------------------------------------- |
224
+ | **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
225
+ | **ask** | - | Focus on understanding. Ask questions. |
226
+ | **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
227
+
228
+ **Plan Mode (4-Phase):**
229
+
230
+ 1. ANALYSIS → Research, questions
231
+ 2. PLANNING → `{task-slug}.md`, task breakdown
232
+ 3. SOLUTIONING → Architecture, design (NO CODE!)
233
+ 4. IMPLEMENTATION → Code + tests
234
+
235
+ > 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.
236
+
237
+ ---
238
+
239
+ ## TIER 2: DESIGN RULES (Reference)
240
+
241
+ > **Design rules are in the specialist agents, NOT here.**
242
+
243
+ | Task | Read |
244
+ | ------------ | ------------------------------- |
245
+ | Web UI/UX | `.agent/frontend-specialist.md` |
246
+ | Mobile UI/UX | `.agent/mobile-developer.md` |
247
+
248
+ **These agents contain:**
249
+
250
+ - Purple Ban (no violet/purple colors)
251
+ - Template Ban (no standard layouts)
252
+ - Anti-cliché rules
253
+ - Deep Design Thinking protocol
254
+
255
+ > 🔴 **For design work:** Open and READ the agent file. Rules are there.
256
+
257
+ ---
258
+
259
+ ## 📁 QUICK REFERENCE
260
+
261
+ ### Agents & Skills
262
+
263
+ - **Masters**: `orchestrator`, `project-planner`, `security-auditor` (Cyber/Audit), `backend-specialist` (API/DB), `frontend-specialist` (UI/UX), `mobile-developer`, `debugger`, `game-developer`
264
+ - **Key Skills**: `clean-code`, `brainstorming`, `app-builder`, `frontend-design`, `mobile-design`, `plan-writing`, `behavioral-modes`
265
+
266
+ ### Key Scripts
267
+
268
+ - **Verify**: `.agent/scripts/verify_all.py`, `.agent/scripts/checklist.py`
269
+ - **Scanners**: `security_scan.py`, `dependency_analyzer.py`
270
+ - **Audits**: `ux_audit.py`, `mobile_audit.py`, `lighthouse_audit.py`, `seo_checker.py`
271
+ - **Test**: `playwright_runner.py`, `test_runner.py`
272
+
273
+ ---
@@ -12,14 +12,14 @@ allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Agent
12
12
 
13
13
  **Read ONLY files relevant to the request!** Check the content map, find what you need.
14
14
 
15
- | File | Description | When to Read |
16
- |------|-------------|--------------|
17
- | `project-detection.md` | Keyword matrix, project type detection | Starting new project |
18
- | `tech-stack.md` | 2026 default stack, alternatives | Choosing technologies |
19
- | `agent-coordination.md` | Agent pipeline, execution order | Coordinating multi-agent work |
20
- | `scaffolding.md` | Directory structure, core files | Creating project structure |
21
- | `feature-building.md` | Feature analysis, error handling | Adding features to existing project |
22
- | `templates/SKILL.md` | **Project templates** | Scaffolding new project |
15
+ | File | Description | When to Read |
16
+ | ----------------------- | -------------------------------------- | ----------------------------------- |
17
+ | `project-detection.md` | Keyword matrix, project type detection | Starting new project |
18
+ | `tech-stack.md` | 2026 default stack, alternatives | Choosing technologies |
19
+ | `agent-coordination.md` | Agent pipeline, execution order | Coordinating multi-agent work |
20
+ | `scaffolding.md` | Directory structure, core files | Creating project structure |
21
+ | `feature-building.md` | Feature analysis, error handling | Adding features to existing project |
22
+ | `templates/SKILL.md` | **Project templates** | Scaffolding new project |
23
23
 
24
24
  ---
25
25
 
@@ -27,32 +27,33 @@ allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Agent
27
27
 
28
28
  Quick-start scaffolding for new projects. **Read the matching template only!**
29
29
 
30
- | Template | Tech Stack | When to Use |
31
- |----------|------------|-------------|
32
- | [nextjs-fullstack](templates/nextjs-fullstack/TEMPLATE.md) | Next.js + Prisma | Full-stack web app |
33
- | [nextjs-saas](templates/nextjs-saas/TEMPLATE.md) | Next.js + Stripe | SaaS product |
34
- | [nextjs-static](templates/nextjs-static/TEMPLATE.md) | Next.js + Framer | Landing page |
35
- | [nuxt-app](templates/nuxt-app/TEMPLATE.md) | Nuxt 3 + Pinia | Vue full-stack app |
36
- | [express-api](templates/express-api/TEMPLATE.md) | Express + JWT | REST API |
37
- | [python-fastapi](templates/python-fastapi/TEMPLATE.md) | FastAPI | Python API |
38
- | [react-native-app](templates/react-native-app/TEMPLATE.md) | Expo + Zustand | Mobile app |
39
- | [flutter-app](templates/flutter-app/TEMPLATE.md) | Flutter + Riverpod | Cross-platform mobile |
40
- | [electron-desktop](templates/electron-desktop/TEMPLATE.md) | Electron + React | Desktop app |
41
- | [chrome-extension](templates/chrome-extension/TEMPLATE.md) | Chrome MV3 | Browser extension |
42
- | [cli-tool](templates/cli-tool/TEMPLATE.md) | Node.js + Commander | CLI app |
43
- | [monorepo-turborepo](templates/monorepo-turborepo/TEMPLATE.md) | Turborepo + pnpm | Monorepo |
30
+ | Template | Tech Stack | When to Use |
31
+ | -------------------------------------------------------------- | ------------------- | --------------------- |
32
+ | [nextjs-fullstack](templates/nextjs-fullstack/TEMPLATE.md) | Next.js + Prisma | Full-stack web app |
33
+ | [nextjs-saas](templates/nextjs-saas/TEMPLATE.md) | Next.js + Stripe | SaaS product |
34
+ | [nextjs-static](templates/nextjs-static/TEMPLATE.md) | Next.js + Framer | Landing page |
35
+ | [nuxt-app](templates/nuxt-app/TEMPLATE.md) | Nuxt 3 + Pinia | Vue full-stack app |
36
+ | [express-api](templates/express-api/TEMPLATE.md) | Express + JWT | REST API |
37
+ | [python-fastapi](templates/python-fastapi/TEMPLATE.md) | FastAPI | Python API |
38
+ | [react-native-app](templates/react-native-app/TEMPLATE.md) | Expo + Zustand | Mobile app |
39
+ | [flutter-app](templates/flutter-app/TEMPLATE.md) | Flutter + Riverpod | Cross-platform mobile |
40
+ | [electron-desktop](templates/electron-desktop/TEMPLATE.md) | Electron + React | Desktop app |
41
+ | [chrome-extension](templates/chrome-extension/TEMPLATE.md) | Chrome MV3 | Browser extension |
42
+ | [cli-tool](templates/cli-tool/TEMPLATE.md) | Node.js + Commander | CLI app |
43
+ | [monorepo-turborepo](templates/monorepo-turborepo/TEMPLATE.md) | Turborepo + pnpm | Monorepo |
44
+ | [golang-gin](templates/golang-gin/TEMPLATE.md) | Gin + GORM | Go REST API |
44
45
 
45
46
  ---
46
47
 
47
48
  ## 🔗 Related Agents
48
49
 
49
- | Agent | Role |
50
- |-------|------|
51
- | `project-planner` | Task breakdown, dependency graph |
52
- | `frontend-specialist` | UI components, pages |
53
- | `backend-specialist` | API, business logic |
54
- | `database-architect` | Schema, migrations |
55
- | `devops-engineer` | Deployment, preview |
50
+ | Agent | Role |
51
+ | --------------------- | -------------------------------- |
52
+ | `project-planner` | Task breakdown, dependency graph |
53
+ | `frontend-specialist` | UI components, pages |
54
+ | `backend-specialist` | API, business logic |
55
+ | `database-architect` | Schema, migrations |
56
+ | `devops-engineer` | Deployment, preview |
56
57
 
57
58
  ---
58
59
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: templates
3
- description: Project scaffolding templates for new applications. Use when creating new projects from scratch. Contains 12 templates for various tech stacks.
3
+ description: Project scaffolding templates for new applications. Use when creating new projects from scratch. Contains 13 templates for various tech stacks.
4
4
  allowed-tools: Read, Glob, Grep
5
5
  ---
6
6
 
@@ -14,20 +14,21 @@ allowed-tools: Read, Glob, Grep
14
14
 
15
15
  **Read ONLY the template matching user's project type!**
16
16
 
17
- | Template | Tech Stack | When to Use |
18
- |----------|------------|-------------|
19
- | [nextjs-fullstack](nextjs-fullstack/TEMPLATE.md) | Next.js + Prisma | Full-stack web app |
20
- | [nextjs-saas](nextjs-saas/TEMPLATE.md) | Next.js + Stripe | SaaS product |
21
- | [nextjs-static](nextjs-static/TEMPLATE.md) | Next.js + Framer | Landing page |
22
- | [express-api](express-api/TEMPLATE.md) | Express + JWT | REST API |
23
- | [python-fastapi](python-fastapi/TEMPLATE.md) | FastAPI | Python API |
24
- | [react-native-app](react-native-app/TEMPLATE.md) | Expo + Zustand | Mobile app |
25
- | [flutter-app](flutter-app/TEMPLATE.md) | Flutter + Riverpod | Cross-platform |
26
- | [electron-desktop](electron-desktop/TEMPLATE.md) | Electron + React | Desktop app |
27
- | [chrome-extension](chrome-extension/TEMPLATE.md) | Chrome MV3 | Browser extension |
28
- | [cli-tool](cli-tool/TEMPLATE.md) | Node.js + Commander | CLI app |
29
- | [monorepo-turborepo](monorepo-turborepo/TEMPLATE.md) | Turborepo + pnpm | Monorepo |
30
- | [astro-static](astro-static/TEMPLATE.md) | Astro + MDX | Blog / Docs |
17
+ | Template | Tech Stack | When to Use |
18
+ | ---------------------------------------------------- | ------------------- | ------------------ |
19
+ | [nextjs-fullstack](nextjs-fullstack/TEMPLATE.md) | Next.js + Prisma | Full-stack web app |
20
+ | [nextjs-saas](nextjs-saas/TEMPLATE.md) | Next.js + Stripe | SaaS product |
21
+ | [nextjs-static](nextjs-static/TEMPLATE.md) | Next.js + Framer | Landing page |
22
+ | [express-api](express-api/TEMPLATE.md) | Express + JWT | REST API |
23
+ | [python-fastapi](python-fastapi/TEMPLATE.md) | FastAPI | Python API |
24
+ | [react-native-app](react-native-app/TEMPLATE.md) | Expo + Zustand | Mobile app |
25
+ | [flutter-app](flutter-app/TEMPLATE.md) | Flutter + Riverpod | Cross-platform |
26
+ | [electron-desktop](electron-desktop/TEMPLATE.md) | Electron + React | Desktop app |
27
+ | [chrome-extension](chrome-extension/TEMPLATE.md) | Chrome MV3 | Browser extension |
28
+ | [cli-tool](cli-tool/TEMPLATE.md) | Node.js + Commander | CLI app |
29
+ | [monorepo-turborepo](monorepo-turborepo/TEMPLATE.md) | Turborepo + pnpm | Monorepo |
30
+ | [astro-static](astro-static/TEMPLATE.md) | Astro + MDX | Blog / Docs |
31
+ | [golang-gin](golang-gin/TEMPLATE.md) | Gin + GORM | Go REST API |
31
32
 
32
33
  ---
33
34
 
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: golang-gin
3
+ description: Gin REST API template inspired by FastAPI architecture (GORM, Validator, Goose).
4
+ ---
5
+
6
+ # Golang Gin REST API Template
7
+
8
+ A production-ready **Gin** boilerplate that mirrors **FastAPI-style architecture**: clean layers, explicit DTOs, and clear separation of concerns.
9
+
10
+ ---
11
+
12
+ ## Tech Stack
13
+
14
+ | Component | Technology |
15
+ |---------|-----------|
16
+ | Framework | Gin |
17
+ | Language | Go 1.22+ |
18
+ | ORM | GORM |
19
+ | Validation | go-playground/validator |
20
+ | Migrations | Goose |
21
+ | Auth | JWT |
22
+ | Config | Viper |
23
+ | Logging | Zap |
24
+
25
+ ---
26
+
27
+ ## Directory Structure
28
+
29
+ ```
30
+ project-name/
31
+ ├── cmd/
32
+ │ └── server/
33
+ │ └── main.go # App entrypoint
34
+ ├── internal/
35
+ │ ├── app/ # App bootstrap
36
+ │ │ ├── router.go
37
+ │ │ └── server.go
38
+ │ ├── config/ # Config & env
39
+ │ │ └── config.go
40
+ │ ├── database/ # DB connection
41
+ │ │ └── postgres.go
42
+ │ ├── models/ # GORM models
43
+ │ ├── dto/ # Request/Response DTOs
44
+ │ ├── handlers/ # HTTP handlers
45
+ │ ├── services/ # Business logic
46
+ │ ├── repositories/ # DB access layer
47
+ │ ├── middleware/ # Auth, logging
48
+ │ └── utils/
49
+ ├── migrations/ # Goose migrations
50
+ ├── tests/
51
+ ├── .env.example
52
+ ├── go.mod
53
+ └── go.sum
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Key Concepts
59
+
60
+ | Concept | Description |
61
+ |-------|------------|
62
+ | Concurrency | Goroutines + context |
63
+ | Dependency Injection | Constructor-based |
64
+ | DTO Pattern | Explicit request/response structs |
65
+ | Context Propagation | `context.Context` |
66
+ | Validation | Struct tags |
67
+ | Clean Architecture | Handler → Service → Repository |
68
+
69
+ ---
70
+
71
+ ## FastAPI → Gin Mapping
72
+
73
+ | FastAPI | Gin |
74
+ |------|-----|
75
+ | Routers | Handlers + Router |
76
+ | Dependencies | Middleware |
77
+ | Services | Services |
78
+ | Models | GORM models |
79
+ | Schemas | DTO structs |
80
+ | Depends | Constructor injection |
81
+
82
+ ---
83
+
84
+ ## API Layers
85
+
86
+ | Layer | Responsibility |
87
+ |------|---------------|
88
+ | Handlers | HTTP & request binding |
89
+ | Middleware | Auth, logging, rate-limit |
90
+ | Services | Business rules |
91
+ | Repositories | DB queries |
92
+ | Models | Database entities |
93
+ | DTOs | Validation & serialization |
94
+
95
+ ---
96
+
97
+ ## Setup Steps
98
+
99
+ 1. Initialize module
100
+ ```bash
101
+ go mod init project
102
+ ```
103
+
104
+ 2. Install dependencies
105
+ ```bash
106
+ go get github.com/gin-gonic/gin
107
+ go get gorm.io/gorm
108
+ go get gorm.io/driver/postgres
109
+ go get github.com/spf13/viper
110
+ go get github.com/golang-jwt/jwt/v5
111
+ ```
112
+
113
+ 3. Configure environment
114
+ ```bash
115
+ cp .env.example .env
116
+ ```
117
+
118
+ 4. Run migrations
119
+ ```bash
120
+ goose up
121
+ ```
122
+
123
+ 5. Start server
124
+ ```bash
125
+ go run cmd/server/main.go
126
+ ```
127
+
128
+ Server runs on:
129
+ ```
130
+ http://localhost:8000
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Best Practices
136
+
137
+ - Keep `main.go` minimal
138
+ - Use DTOs for all input/output
139
+ - Context-aware DB calls
140
+ - Version APIs (`/api/v1`)
141
+ - Middleware for cross-cutting concerns
142
+ - Single static binary for deployment
143
+
144
+ ---
145
+
146
+ ## When to Choose Gin over FastAPI
147
+
148
+ ✔ Higher throughput
149
+ ✔ Lower memory usage
150
+ ✔ Compile-time safety
151
+ ✔ Single binary deployments
152
+
153
+ ---
154
+
155
+ ## Best Practices
156
+
157
+ - JWT authentication
158
+ - Swagger / OpenAPI
159
+ - Docker & Kubernetes
160
+ - Observability (Prometheus + Grafana)
161
+ - CI/CD pipeline
162
+
163
+ ---
164
+