class-ai-agent 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +195 -284
- package/package.json +3 -2
- package/royal-solution-logo-v2.svg +58 -0
package/README.md
CHANGED
|
@@ -1,41 +1,113 @@
|
|
|
1
|
-
# AI Agent Project
|
|
1
|
+
# AI Agent Project
|
|
2
|
+
|
|
3
|
+
**Production-grade configuration for [Claude Code](https://code.claude.com/docs) and [Cursor](https://cursor.com)** — shared rules, specialized agents, workflow prompts, and checklists you can drop into any repository.
|
|
2
4
|
|
|
3
5
|
<div align="center">
|
|
4
|
-
<img src="https://res.cloudinary.com/ecommerce2021/image/upload/v1768626951/dev_efjbzw.jpg" alt="Code Web Khong Kho" width="120" style="border-radius: 50%"/>
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
<
|
|
7
|
+
<p>
|
|
8
|
+
<img src="royal-solution-logo-v2.svg" alt="Royal Solution" width="280" />
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
### Royal Solution
|
|
12
|
+
|
|
13
|
+
Open-source AI agent scaffolding by **Royal Solution** — use it in your own projects and teams.
|
|
14
|
+
|
|
15
|
+
<sub>Adapted from <a href="https://github.com/fdhhhdjd/Class-AI-Agent">fdhhhdjd/Class-AI-Agent</a> · Community & docs · <a href="https://codewebkhongkho.com/portfolios">Code Web Khong Kho</a></sub>
|
|
8
16
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
<p>
|
|
18
|
+
<a href="https://www.npmjs.com/package/class-ai-agent"><img src="https://img.shields.io/npm/v/class-ai-agent?label=npm&logo=npm&style=flat-square" alt="npm version" /></a>
|
|
19
|
+
<img src="https://img.shields.io/badge/node-%3E%3D16.7-339933?logo=node.js&logoColor=white&style=flat-square" alt="Node.js 16.7+" />
|
|
20
|
+
<img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License MIT" />
|
|
21
|
+
<img src="https://img.shields.io/badge/version-1.2.2-blue?style=flat-square" alt="Version" />
|
|
22
|
+
</p>
|
|
13
23
|
|
|
14
|
-
<sub>Inspired by <a href="https://github.com/addyosmani/agent-skills">addyosmani/agent-skills</a></sub>
|
|
15
24
|
</div>
|
|
16
25
|
|
|
17
26
|
---
|
|
18
27
|
|
|
19
|
-
##
|
|
28
|
+
## Contents
|
|
29
|
+
|
|
30
|
+
- [Why use this](#why-use-this)
|
|
31
|
+
- [Install (quick)](#install-quick)
|
|
32
|
+
- [Overview](#overview)
|
|
33
|
+
- [Development workflow](#development-workflow)
|
|
34
|
+
- [Project structure](#project-structure)
|
|
35
|
+
- [Specialized agents](#specialized-agents)
|
|
36
|
+
- [Approved tech stack](#approved-tech-stack)
|
|
37
|
+
- [Mandatory rules](#mandatory-rules)
|
|
38
|
+
- [Using commands & agents](#using-commands--agents)
|
|
39
|
+
- [Key concepts](#key-concepts)
|
|
40
|
+
- [Security](#security)
|
|
41
|
+
- [Contributing](#contributing)
|
|
42
|
+
- [Publishing to npm (maintainers)](#publishing-to-npm-maintainers)
|
|
43
|
+
- [Credits](#credits)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Why use this
|
|
48
|
+
|
|
49
|
+
| You get | Details |
|
|
50
|
+
|--------|---------|
|
|
51
|
+
| **Two layouts** | **`.claude/`** for Claude Code (`.md` rules) and **`.cursor/`** for Cursor (`.mdc` rules + `CURSOR.md`) |
|
|
52
|
+
| **One workflow** | Spec → Plan → Build → Test → Review → Ship |
|
|
53
|
+
| **10 agent personas** | Frontend, backend, architect, review, QA, security, PM, UX, SEO, test engineer |
|
|
54
|
+
| **13 topic rules** | Code style, security, API, DB, testing, git, and more (same ideas in both trees) |
|
|
55
|
+
| **`npx` installer** | Copies the folders into your project in one command |
|
|
56
|
+
|
|
57
|
+
Root **`AGENTS.md`** points Cursor at **`.cursor/CURSOR.md`**.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Install (quick)
|
|
62
|
+
|
|
63
|
+
Requires **Node.js [16.7+](https://nodejs.org/)**.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx class-ai-agent
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Install into another directory, or only Claude / only Cursor:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx class-ai-agent --dir /path/to/your/project
|
|
73
|
+
npx class-ai-agent --claude
|
|
74
|
+
npx class-ai-agent --cursor
|
|
75
|
+
npx class-ai-agent --force # overwrite existing
|
|
76
|
+
npx class-ai-agent --help
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**From a clone** (local dev):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git clone https://github.com/khoantd/class-ai-agent.git
|
|
83
|
+
cd class-ai-agent
|
|
84
|
+
npm exec -- class-ai-agent --dir /path/to/your/project
|
|
85
|
+
# or: node bin/class-ai-agent.cjs --dir /path/to/your/project
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Manual copy:** copy **`.claude/`**, **`.cursor/`**, and **`AGENTS.md`** into your project root.
|
|
20
89
|
|
|
21
|
-
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Overview
|
|
22
93
|
|
|
23
|
-
|
|
24
|
-
|--------|------|---------|
|
|
25
|
-
| **`.claude/`** | [Claude Code](https://code.claude.com/docs) | Slash commands, `CLAUDE.md`, rules as `.md` |
|
|
26
|
-
| **`.cursor/`** | [Cursor](https://cursor.com) | Same workflows; rules as **`.mdc`** (Cursor project rules); hub doc **`CURSOR.md`** |
|
|
94
|
+
This repo ships **two parallel trees** so you can use the same habits in Claude Code and Cursor:
|
|
27
95
|
|
|
28
|
-
|
|
96
|
+
| Layout | Tool | What you use |
|
|
97
|
+
|--------|------|----------------|
|
|
98
|
+
| **`.claude/`** | Claude Code | Slash commands, **`CLAUDE.md`**, rules as **`.md`** |
|
|
99
|
+
| **`.cursor/`** | Cursor | Project rules as **`.mdc`**, hub **`CURSOR.md`**, **`@`** file mentions |
|
|
29
100
|
|
|
30
|
-
|
|
31
|
-
- **10 specialized agents** for different development roles
|
|
32
|
-
- **13 mandatory topic rules** (same content in `.claude/rules/` and `.cursor/rules/`), plus **`cursor-overview.mdc`** in `.cursor/rules/` for Cursor workflow entry
|
|
33
|
-
- **9 workflow prompts** (slash-style command markdown files)
|
|
34
|
-
- **4 reference checklists** for security, testing, performance, and accessibility
|
|
101
|
+
What is inside:
|
|
35
102
|
|
|
36
|
-
|
|
103
|
+
- **Structured workflow** (Spec → Plan → Build → Test → Review → Ship)
|
|
104
|
+
- **10 specialized agents** (markdown personas under `agents/`)
|
|
105
|
+
- **13 mandatory topic rules** (plus **`cursor-overview.mdc`** under `.cursor/rules/`)
|
|
106
|
+
- **9 workflow prompts** under `commands/`
|
|
107
|
+
- **5 skills** (TDD, code review, incremental implementation, deploy, security review)
|
|
108
|
+
- **4 reference checklists** (security, testing, performance, accessibility)
|
|
37
109
|
|
|
38
|
-
|
|
110
|
+
Keep **`.claude/`** and **`.cursor/`** in sync when you change standards.
|
|
39
111
|
|
|
40
112
|
---
|
|
41
113
|
|
|
@@ -43,255 +115,114 @@ The same files can be installed with **`npx`** (see [Quick Start](#quick-start))
|
|
|
43
115
|
|
|
44
116
|
```
|
|
45
117
|
┌──────────────────────────────────────────────────────────────────┐
|
|
46
|
-
│
|
|
47
|
-
│
|
|
48
|
-
│ │
|
|
49
|
-
│ Define Plan Build Verify Review Ship │
|
|
50
|
-
│ │
|
|
118
|
+
│ /spec → /plan → /build → /test → /review → /deploy │
|
|
119
|
+
│ Define Plan Build Verify Review Ship │
|
|
51
120
|
└──────────────────────────────────────────────────────────────────┘
|
|
52
121
|
```
|
|
53
122
|
|
|
54
|
-
| Phase | Command |
|
|
55
|
-
|
|
56
|
-
| **Define** | `/spec` |
|
|
57
|
-
| **Plan** | `/plan` |
|
|
58
|
-
| **Build** | `/build` |
|
|
59
|
-
| **Verify** | `/test` |
|
|
123
|
+
| Phase | Command | Purpose |
|
|
124
|
+
|-------|---------|---------|
|
|
125
|
+
| **Define** | `/spec` | PRD: objectives, scope, boundaries |
|
|
126
|
+
| **Plan** | `/plan` | Vertical slices, acceptance criteria |
|
|
127
|
+
| **Build** | `/build` | Incremental implementation, TDD |
|
|
128
|
+
| **Verify** | `/test` | Tests (RED → GREEN → REFACTOR) |
|
|
60
129
|
| **Review** | `/review` | Five-axis code review |
|
|
61
|
-
| **Ship** | `/deploy` | Build, test,
|
|
62
|
-
|
|
63
|
-
### Supporting Commands
|
|
130
|
+
| **Ship** | `/deploy` | Build, test, deploy |
|
|
64
131
|
|
|
65
|
-
|
|
66
|
-
|---------|-------------|
|
|
67
|
-
| `/debug` | Systematic error diagnosis |
|
|
68
|
-
| `/simplify` | Reduce code complexity |
|
|
69
|
-
| `/fix-issue` | Analyze and fix issues |
|
|
132
|
+
**Supporting:** `/debug`, `/simplify`, `/fix-issue` (see `commands/`).
|
|
70
133
|
|
|
71
134
|
---
|
|
72
135
|
|
|
73
136
|
## Project Structure
|
|
74
137
|
|
|
75
|
-
### Claude Code
|
|
138
|
+
### `.claude/` (Claude Code)
|
|
76
139
|
|
|
77
140
|
```
|
|
78
141
|
.claude/
|
|
79
|
-
├── CLAUDE.md
|
|
80
|
-
|
|
81
|
-
├──
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
│ ├── review.md # /review — Code review
|
|
87
|
-
│ ├── deploy.md # /deploy — Deployment
|
|
88
|
-
│ ├── debug.md # /debug — Error diagnosis
|
|
89
|
-
│ ├── simplify.md # /simplify — Code simplification
|
|
90
|
-
│ └── fix-issue.md # /fix-issue — Issue resolution
|
|
91
|
-
│
|
|
92
|
-
├── agents/ # Specialized agents (10 total)
|
|
93
|
-
│ ├── frontend.md # Frontend Developer
|
|
94
|
-
│ ├── backend.md # Backend Developer
|
|
95
|
-
│ ├── systems-architect.md # Systems Architect
|
|
96
|
-
│ ├── code-reviewer.md # Code Reviewer
|
|
97
|
-
│ ├── test-engineer.md # Test Engineer
|
|
98
|
-
│ ├── security-auditor.md # Security Auditor
|
|
99
|
-
│ ├── qa.md # QA Engineer
|
|
100
|
-
│ ├── project-manager.md # Project Manager
|
|
101
|
-
│ ├── ui-ux-designer.md # UI/UX Designer
|
|
102
|
-
│ └── copywriter-seo.md # Copywriter/SEO
|
|
103
|
-
│
|
|
104
|
-
├── rules/ # Mandatory rules (13 total)
|
|
105
|
-
│ ├── clean-code.md # Clean Code principles
|
|
106
|
-
│ ├── code-style.md # Formatting & naming
|
|
107
|
-
│ ├── error-handling.md # Error patterns
|
|
108
|
-
│ ├── tech-stack.md # Approved technologies
|
|
109
|
-
│ ├── system-design.md # System design patterns
|
|
110
|
-
│ ├── project-structure.md # Folder organization
|
|
111
|
-
│ ├── api-conventions.md # REST API standards
|
|
112
|
-
│ ├── naming-conventions.md # Naming patterns
|
|
113
|
-
│ ├── database.md # Database patterns
|
|
114
|
-
│ ├── security.md # Security requirements
|
|
115
|
-
│ ├── monitoring.md # Observability
|
|
116
|
-
│ ├── testing.md # Test standards
|
|
117
|
-
│ └── git-workflow.md # Git conventions
|
|
118
|
-
│
|
|
119
|
-
├── skills/ # Advanced skills
|
|
120
|
-
│ ├── tdd/SKILL.md # Test-Driven Development
|
|
121
|
-
│ ├── code-review/SKILL.md # Five-axis review
|
|
122
|
-
│ ├── incremental-implementation/SKILL.md
|
|
123
|
-
│ ├── deploy/SKILL.md
|
|
124
|
-
│ └── security-review/SKILL.md
|
|
125
|
-
│
|
|
126
|
-
├── references/ # Quick checklists
|
|
127
|
-
│ ├── security-checklist.md
|
|
128
|
-
│ ├── testing-patterns.md
|
|
129
|
-
│ ├── performance-checklist.md
|
|
130
|
-
│ └── accessibility-checklist.md
|
|
131
|
-
│
|
|
132
|
-
└── settings.json # Project settings (paths & dirs)
|
|
142
|
+
├── CLAUDE.md # Main configuration
|
|
143
|
+
├── commands/ # 9 workflow prompts (spec, plan, build, …)
|
|
144
|
+
├── agents/ # 10 personas
|
|
145
|
+
├── rules/ # 13 mandatory topic rules (.md)
|
|
146
|
+
├── skills/ # TDD, review, deploy, …
|
|
147
|
+
├── references/ # Checklists
|
|
148
|
+
└── settings.json
|
|
133
149
|
```
|
|
134
150
|
|
|
135
|
-
###
|
|
151
|
+
### `.cursor/` (Cursor)
|
|
136
152
|
|
|
137
|
-
|
|
153
|
+
Same ideas as `.claude/` for `commands/`, `agents/`, `skills/`, `references/`. Differences:
|
|
138
154
|
|
|
139
|
-
| Item |
|
|
140
|
-
|
|
141
|
-
| **`CURSOR.md`** | Hub
|
|
142
|
-
| **`rules/*.mdc`** |
|
|
143
|
-
| **`settings.json`** |
|
|
144
|
-
| **`AGENTS.md
|
|
155
|
+
| Item | Role |
|
|
156
|
+
|------|------|
|
|
157
|
+
| **`CURSOR.md`** | Hub (like `CLAUDE.md`, Cursor-focused) |
|
|
158
|
+
| **`rules/*.mdc`** | Project rules + YAML; **`security.mdc`** and **`cursor-overview.mdc`** are central |
|
|
159
|
+
| **`settings.json`** | Path hints (mirrors Claude layout) |
|
|
160
|
+
| **`AGENTS.md`** (repo root) | Entry pointer for Cursor |
|
|
145
161
|
|
|
146
162
|
```
|
|
147
163
|
.cursor/
|
|
148
164
|
├── CURSOR.md
|
|
149
165
|
├── settings.json
|
|
150
|
-
├── commands/
|
|
151
|
-
├── agents/
|
|
152
|
-
├── rules/
|
|
166
|
+
├── commands/
|
|
167
|
+
├── agents/
|
|
168
|
+
├── rules/ # 14 × .mdc (13 topics + cursor-overview)
|
|
153
169
|
├── skills/
|
|
154
|
-
|
|
170
|
+
└── references/
|
|
155
171
|
```
|
|
156
172
|
|
|
157
|
-
Keep **`.claude/`** and **`.cursor/`** aligned when you change standards or workflows.
|
|
158
|
-
|
|
159
173
|
---
|
|
160
174
|
|
|
161
175
|
## Specialized Agents
|
|
162
176
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
|
166
|
-
|
|
167
|
-
| **
|
|
168
|
-
| **Backend Developer** | Express, Prisma, Redis, BullMQ | APIs, services, jobs |
|
|
169
|
-
| **Systems Architect** | Architecture, ADRs, scaling | System design decisions |
|
|
170
|
-
|
|
171
|
-
### Quality Agents
|
|
172
|
-
|
|
173
|
-
| Agent | Role | Invoke When |
|
|
174
|
-
|-------|------|-------------|
|
|
175
|
-
| **Code Reviewer** | Five-axis code review | PR reviews, quality checks |
|
|
176
|
-
| **Test Engineer** | TDD, coverage, test strategy | Writing and reviewing tests |
|
|
177
|
-
| **Security Auditor** | Vulnerability, threat modeling | Security reviews |
|
|
178
|
-
| **QA Engineer** | Test plans, E2E, bug reports | Quality assurance |
|
|
179
|
-
|
|
180
|
-
### Product Agents
|
|
177
|
+
| Area | Agents |
|
|
178
|
+
|------|--------|
|
|
179
|
+
| **Development** | Frontend, Backend, Systems Architect |
|
|
180
|
+
| **Quality** | Code Reviewer, Test Engineer, Security Auditor, QA |
|
|
181
|
+
| **Product** | Project Manager, UI/UX Designer, Copywriter/SEO |
|
|
181
182
|
|
|
182
|
-
|
|
183
|
-
|-------|------|-------------|
|
|
184
|
-
| **Project Manager** | Stories, sprints, planning | Project planning |
|
|
185
|
-
| **UI/UX Designer** | Design system, accessibility | UX decisions |
|
|
186
|
-
| **Copywriter/SEO** | Copy, meta tags, SEO | Content creation |
|
|
183
|
+
Full definitions live in **`agents/*.md`**. In Cursor, **`@`**-include a file when you want that role.
|
|
187
184
|
|
|
188
185
|
---
|
|
189
186
|
|
|
190
|
-
## Approved
|
|
187
|
+
## Approved tech stack
|
|
191
188
|
|
|
192
189
|
| Layer | Technology |
|
|
193
|
-
|
|
190
|
+
|-------|------------|
|
|
194
191
|
| **Frontend (SEO)** | Next.js 14 (App Router) |
|
|
195
|
-
| **Frontend (
|
|
192
|
+
| **Frontend (admin)** | React + Vite |
|
|
196
193
|
| **Styling** | Tailwind CSS + shadcn/ui |
|
|
197
194
|
| **State** | Zustand + TanStack Query |
|
|
198
195
|
| **Backend** | Express.js + TypeScript |
|
|
199
196
|
| **ORM** | Prisma |
|
|
200
197
|
| **Database** | PostgreSQL |
|
|
201
198
|
| **Cache** | Redis (ioredis) |
|
|
202
|
-
| **Queue** | BullMQ
|
|
199
|
+
| **Queue** | BullMQ / RabbitMQ |
|
|
203
200
|
| **Auth** | NextAuth.js / JWT + bcrypt |
|
|
204
201
|
| **Testing** | Vitest + Playwright |
|
|
205
202
|
| **Monitoring** | Prometheus + Grafana + Pino |
|
|
206
203
|
| **CI/CD** | GitHub Actions |
|
|
207
204
|
| **Deploy** | Vercel + Railway/Fly.io |
|
|
208
205
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
## Mandatory Rules
|
|
212
|
-
|
|
213
|
-
Follow the rules in **`.claude/rules/`** (Markdown) when using Claude Code, and **`.cursor/rules/`** (`.mdc`) when using Cursor. Content matches; Cursor loads `.mdc` frontmatter automatically.
|
|
214
|
-
|
|
215
|
-
### Code Quality
|
|
216
|
-
- **clean-code.md** — Variables, functions, SOLID, async/await
|
|
217
|
-
- **code-style.md** — 2-space indent, single quotes, semicolons
|
|
218
|
-
- **error-handling.md** — AppError class, centralized handler
|
|
219
|
-
|
|
220
|
-
### Architecture
|
|
221
|
-
- **tech-stack.md** — Approved technologies only
|
|
222
|
-
- **system-design.md** — CAP, caching, scaling patterns
|
|
223
|
-
- **project-structure.md** — Layered architecture
|
|
224
|
-
- **api-conventions.md** — REST standards, response envelopes
|
|
225
|
-
|
|
226
|
-
### Data & Naming
|
|
227
|
-
- **naming-conventions.md** — Cache keys, DB, queues, env vars
|
|
228
|
-
- **database.md** — Prisma patterns, N+1 prevention
|
|
229
|
-
|
|
230
|
-
### Operations
|
|
231
|
-
- **security.md** — **CRITICAL** — Never violate
|
|
232
|
-
- **monitoring.md** — Prometheus, Grafana, alerting
|
|
233
|
-
- **testing.md** — 80% coverage minimum
|
|
234
|
-
- **git-workflow.md** — Conventional commits
|
|
206
|
+
Details and alternatives are in **`rules/tech-stack.md`** (or **`.mdc`** in Cursor).
|
|
235
207
|
|
|
236
208
|
---
|
|
237
209
|
|
|
238
|
-
##
|
|
239
|
-
|
|
240
|
-
### Install with `npx` (recommended)
|
|
241
|
-
|
|
242
|
-
Requires [Node.js](https://nodejs.org/) **16.7+**. After you publish this repository to the npm registry (`npm publish`; package name **`class-ai-agent`** in `package.json`):
|
|
210
|
+
## Mandatory rules
|
|
243
211
|
|
|
244
|
-
|
|
245
|
-
# Install into the current directory (.claude/, .cursor/, AGENTS.md)
|
|
246
|
-
npx class-ai-agent
|
|
247
|
-
|
|
248
|
-
# Install into another folder
|
|
249
|
-
npx class-ai-agent --dir /path/to/your/project
|
|
250
|
-
|
|
251
|
-
# Only Claude Code files
|
|
252
|
-
npx class-ai-agent --claude
|
|
253
|
-
|
|
254
|
-
# Only Cursor files + AGENTS.md
|
|
255
|
-
npx class-ai-agent --cursor
|
|
256
|
-
|
|
257
|
-
# Overwrite an existing install
|
|
258
|
-
npx class-ai-agent --force
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
Run **`npx class-ai-agent --help`** for all options.
|
|
262
|
-
|
|
263
|
-
#### Publishing to npm (fix `E403` / 2FA)
|
|
264
|
-
|
|
265
|
-
If **`npm publish`** fails with **`403 Forbidden`** and a message about **two-factor authentication**, npm is blocking the upload until your account meets its publish policy:
|
|
266
|
-
|
|
267
|
-
1. Sign in at [npmjs.com](https://www.npmjs.com/) → **Account** → enable **Two-Factor Authentication** (use **Auth and writes** so publishing is covered).
|
|
268
|
-
2. In the terminal, refresh the session if needed: **`npm logout`** then **`npm login`**.
|
|
269
|
-
3. Run **`npm publish --access public`** again and enter your **one-time password** when npm asks for it.
|
|
212
|
+
Use **`.claude/rules/*.md`** or **`.cursor/rules/*.mdc`** (paired content; Cursor applies `.mdc` frontmatter).
|
|
270
213
|
|
|
271
|
-
|
|
214
|
+
| Theme | Files |
|
|
215
|
+
|-------|--------|
|
|
216
|
+
| **Code quality** | `clean-code`, `code-style`, `error-handling` |
|
|
217
|
+
| **Architecture** | `tech-stack`, `system-design`, `project-structure`, `api-conventions` |
|
|
218
|
+
| **Data** | `naming-conventions`, `database` |
|
|
219
|
+
| **Operations** | **`security`** (critical), `monitoring`, `testing`, `git-workflow` |
|
|
272
220
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
```bash
|
|
276
|
-
cd class-ai-agent
|
|
277
|
-
npm exec -- class-ai-agent --dir /path/to/your/project
|
|
278
|
-
# or: node bin/class-ai-agent.cjs --dir /path/to/your/project
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
### Manual copy
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
git clone https://github.com/khoantd/class-ai-agent.git
|
|
285
|
-
cd class-ai-agent
|
|
286
|
-
|
|
287
|
-
cp -r .claude/ /path/to/your/project/
|
|
288
|
-
cp -r .cursor/ /path/to/your/project/
|
|
289
|
-
cp AGENTS.md /path/to/your/project/
|
|
290
|
-
```
|
|
221
|
+
---
|
|
291
222
|
|
|
292
|
-
|
|
223
|
+
## Using commands & agents
|
|
293
224
|
|
|
294
|
-
**Claude Code** —
|
|
225
|
+
**Claude Code** — run slash commands in the tool, e.g.:
|
|
295
226
|
|
|
296
227
|
```text
|
|
297
228
|
/spec "User authentication feature"
|
|
@@ -302,104 +233,84 @@ cp AGENTS.md /path/to/your/project/
|
|
|
302
233
|
/deploy
|
|
303
234
|
```
|
|
304
235
|
|
|
305
|
-
**Cursor** —
|
|
306
|
-
|
|
307
|
-
### Using Agents
|
|
236
|
+
**Cursor** — prompts live under **`.cursor/commands/`**. Open the file, copy the section you need, or **`@`** it (e.g. `@.cursor/commands/spec.md`).
|
|
308
237
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
```text
|
|
312
|
-
"Act as the Frontend Developer and build the login page"
|
|
313
|
-
"As Systems Architect, design the notification system"
|
|
314
|
-
"Code Reviewer: review this PR for security issues"
|
|
315
|
-
"Test Engineer: write tests for the payment flow"
|
|
316
|
-
```
|
|
238
|
+
**Agents** — describe the role in natural language, or in Cursor **`@`** an agent file, e.g. `@.cursor/agents/code-reviewer.md`.
|
|
317
239
|
|
|
318
240
|
---
|
|
319
241
|
|
|
320
|
-
## Key
|
|
321
|
-
|
|
322
|
-
### Five-Axis Code Review
|
|
323
|
-
|
|
324
|
-
Every code review evaluates:
|
|
242
|
+
## Key concepts
|
|
325
243
|
|
|
326
|
-
|
|
327
|
-
2. **Readability** — Can others understand it?
|
|
328
|
-
3. **Architecture** — Follows patterns? Appropriate abstractions?
|
|
329
|
-
4. **Security** — Input validation? Auth? No secrets?
|
|
330
|
-
5. **Performance** — N+1? Pagination? Async?
|
|
244
|
+
### Five-axis review
|
|
331
245
|
|
|
332
|
-
|
|
246
|
+
1. **Correctness** — Behavior, edge cases, tests
|
|
247
|
+
2. **Readability** — Names, structure
|
|
248
|
+
3. **Architecture** — Patterns, boundaries
|
|
249
|
+
4. **Security** — Validation, auth, secrets
|
|
250
|
+
5. **Performance** — Queries, async, pagination
|
|
333
251
|
|
|
334
|
-
|
|
335
|
-
RED → Write failing test
|
|
336
|
-
GREEN → Write minimal code to pass
|
|
337
|
-
REFACTOR → Improve while green
|
|
338
|
-
```
|
|
252
|
+
### TDD
|
|
339
253
|
|
|
340
|
-
|
|
254
|
+
`RED` (failing test) → `GREEN` (minimal pass) → `REFACTOR`.
|
|
341
255
|
|
|
342
|
-
|
|
256
|
+
### Vertical slices
|
|
343
257
|
|
|
344
|
-
|
|
345
|
-
✅ Task 1: User can create task (DB + API + UI)
|
|
346
|
-
✅ Task 2: User can view tasks (DB + API + UI)
|
|
347
|
-
|
|
348
|
-
❌ Task 1: Create all DB models
|
|
349
|
-
❌ Task 2: Create all API routes
|
|
350
|
-
```
|
|
258
|
+
Ship thin end-to-end slices (DB + API + UI), not “all models first, then all routes.”
|
|
351
259
|
|
|
352
260
|
---
|
|
353
261
|
|
|
354
262
|
## Security
|
|
355
263
|
|
|
356
|
-
**
|
|
357
|
-
- `.env` files
|
|
358
|
-
- API keys, secrets, passwords
|
|
359
|
-
- `.claude/settings.local.json` (and any local-only Cursor overrides if you add them)
|
|
264
|
+
**Do not commit:** `.env`, secrets, API keys, **`.claude/settings.local.json`**, or local-only Cursor overrides with secrets.
|
|
360
265
|
|
|
361
|
-
**
|
|
362
|
-
- Use environment variables
|
|
363
|
-
- Validate all inputs
|
|
364
|
-
- Hash passwords (bcrypt >= 12 rounds)
|
|
365
|
-
- Parameterize queries
|
|
266
|
+
**Do:** environment variables, input validation, strong password hashing, parameterized queries.
|
|
366
267
|
|
|
367
268
|
---
|
|
368
269
|
|
|
369
270
|
## Contributing
|
|
370
271
|
|
|
371
|
-
1. Follow the
|
|
372
|
-
2.
|
|
373
|
-
3. Run
|
|
374
|
-
4.
|
|
375
|
-
5.
|
|
272
|
+
1. Follow the workflow (`/spec` → `/plan` → `/build`, or the same prompts under `.cursor/commands/`).
|
|
273
|
+
2. Keep tests green.
|
|
274
|
+
3. Run **`/review`** before opening a PR.
|
|
275
|
+
4. Use [conventional commits](https://www.conventionalcommits.org/).
|
|
276
|
+
5. Update **both** `.claude/` and `.cursor/` when rules or workflows change.
|
|
376
277
|
|
|
377
278
|
---
|
|
378
279
|
|
|
379
|
-
##
|
|
280
|
+
## Publishing to npm (maintainers)
|
|
380
281
|
|
|
381
|
-
-
|
|
382
|
-
- Best practices from *Software Engineering at Google*
|
|
383
|
-
- Clean Code principles from Robert C. Martin
|
|
282
|
+
`package.json` name: **`class-ai-agent`**. Use **`npm publish --access public`** after `npm login`.
|
|
384
283
|
|
|
385
|
-
|
|
284
|
+
<details>
|
|
285
|
+
<summary><strong>403 / two-factor authentication</strong></summary>
|
|
386
286
|
|
|
387
|
-
|
|
287
|
+
If publish fails with **two-factor authentication** required:
|
|
388
288
|
|
|
389
|
-
|
|
390
|
-
|
|
289
|
+
1. On [npmjs.com](https://www.npmjs.com/) → **Account** → enable **Two-Factor Authentication** (include **writes** for publishing).
|
|
290
|
+
2. Run **`npm logout`** then **`npm login`**.
|
|
291
|
+
3. Run **`npm publish --access public`** again and enter the OTP when prompted.
|
|
391
292
|
|
|
392
|
-
|
|
293
|
+
For CI, use an [npm access token](https://docs.npmjs.com/about-access-tokens) with publish permission and set **`NPM_TOKEN`** as documented by npm.
|
|
393
294
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
295
|
+
</details>
|
|
296
|
+
|
|
297
|
+
<details>
|
|
298
|
+
<summary><strong>403 / “cannot publish over the previously published versions”</strong></summary>
|
|
299
|
+
|
|
300
|
+
Each version number can only be published **once**. After **`1.2.0`** is on the registry, you must bump before the next upload, for example:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
npm version patch --no-git-tag-version
|
|
304
|
+
npm publish --access public
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
That advances **`patch`** (e.g. `1.2.0` → `1.2.1`). Use **`npm version minor`** or **`major`** when the change warrants it.
|
|
308
|
+
|
|
309
|
+
</details>
|
|
400
310
|
|
|
401
311
|
---
|
|
402
312
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
313
|
+
## Credits
|
|
314
|
+
|
|
315
|
+
- **[Royal Solution](https://codewebkhongkho.com/portfolios)** — project and scaffolding.
|
|
316
|
+
- Upstream inspiration: [fdhhhdjd/Class-AI-Agent](https://github.com/fdhhhdjd/Class-AI-Agent), [addyosmani/agent-skills](https://github.com/addyosmani/agent-skills).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "class-ai-agent",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Production-grade AI agent configuration for Claude Code & Cursor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"bin",
|
|
30
30
|
".claude",
|
|
31
31
|
".cursor",
|
|
32
|
-
"AGENTS.md"
|
|
32
|
+
"AGENTS.md",
|
|
33
|
+
"royal-solution-logo-v2.svg"
|
|
33
34
|
],
|
|
34
35
|
"scripts": {
|
|
35
36
|
"prepack": "node -e \"const fs=require('fs');['.claude','.cursor','AGENTS.md'].forEach(p=>{if(!fs.existsSync(p))process.exit(1)})\"",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 200" width="520" height="200">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="nodeGrad1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#4a9be8"/>
|
|
5
|
+
<stop offset="100%" stop-color="#2d6fd4"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="nodeGrad2" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
8
|
+
<stop offset="0%" stop-color="#2d6fd4"/>
|
|
9
|
+
<stop offset="100%" stop-color="#1a4fa0"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
<linearGradient id="nodeGrad3" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
12
|
+
<stop offset="0%" stop-color="#1a3a7a"/>
|
|
13
|
+
<stop offset="100%" stop-color="#0f2654"/>
|
|
14
|
+
</linearGradient>
|
|
15
|
+
<linearGradient id="goldAccent" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
16
|
+
<stop offset="0%" stop-color="#d4a843"/>
|
|
17
|
+
<stop offset="100%" stop-color="#f0c75e"/>
|
|
18
|
+
</linearGradient>
|
|
19
|
+
</defs>
|
|
20
|
+
|
|
21
|
+
<!-- === ASCENDING NODES ICON === -->
|
|
22
|
+
<g transform="translate(55, 100)">
|
|
23
|
+
<!-- Dashed connection lines -->
|
|
24
|
+
<line x1="-20" y1="30" x2="5" y2="8" stroke="#a3c8ee" stroke-width="1.8" stroke-dasharray="4,3" opacity="0.7"/>
|
|
25
|
+
<line x1="5" y1="8" x2="35" y2="-22" stroke="#7baee5" stroke-width="1.8" stroke-dasharray="4,3" opacity="0.7"/>
|
|
26
|
+
<line x1="-20" y1="30" x2="35" y2="-22" stroke="#5a94d8" stroke-width="1.5" stroke-dasharray="4,3" opacity="0.5"/>
|
|
27
|
+
|
|
28
|
+
<!-- Node 1 (smallest, bottom-left) -->
|
|
29
|
+
<circle cx="-20" cy="30" r="10" fill="url(#nodeGrad1)" opacity="0.85"/>
|
|
30
|
+
<circle cx="-20" cy="30" r="5.5" fill="none" stroke="#fff" stroke-width="1.5" opacity="0.5"/>
|
|
31
|
+
|
|
32
|
+
<!-- Node 2 (medium, middle) -->
|
|
33
|
+
<circle cx="5" cy="8" r="14" fill="url(#nodeGrad2)" opacity="0.9"/>
|
|
34
|
+
<circle cx="5" cy="8" r="8" fill="none" stroke="#fff" stroke-width="1.5" opacity="0.5"/>
|
|
35
|
+
|
|
36
|
+
<!-- Node 3 (largest, top-right) -->
|
|
37
|
+
<circle cx="35" cy="-22" r="20" fill="url(#nodeGrad3)"/>
|
|
38
|
+
<circle cx="35" cy="-22" r="12" fill="none" stroke="#fff" stroke-width="2" opacity="0.4"/>
|
|
39
|
+
<circle cx="35" cy="-22" r="6" fill="#2d6fd4" opacity="0.6"/>
|
|
40
|
+
|
|
41
|
+
<!-- Crown accent on top node -->
|
|
42
|
+
<polygon points="27,-46 31,-38 35,-42 39,-38 43,-46" fill="url(#goldAccent)" opacity="0.95"/>
|
|
43
|
+
<!-- Three crown dots -->
|
|
44
|
+
<circle cx="27" cy="-47.5" r="1.5" fill="#f0c75e"/>
|
|
45
|
+
<circle cx="35" cy="-43.5" r="1.5" fill="#f0c75e"/>
|
|
46
|
+
<circle cx="43" cy="-47.5" r="1.5" fill="#f0c75e"/>
|
|
47
|
+
</g>
|
|
48
|
+
|
|
49
|
+
<!-- === COMPANY NAME === -->
|
|
50
|
+
<text x="135" y="88" font-family="'Segoe UI', 'Helvetica Neue', Arial, sans-serif" font-size="42" font-weight="700" fill="#1a3a7a" letter-spacing="2">ROYAL</text>
|
|
51
|
+
<text x="135" y="128" font-family="'Segoe UI', 'Helvetica Neue', Arial, sans-serif" font-size="40" font-weight="300" fill="#2d6fd4" letter-spacing="6">SOLUTION</text>
|
|
52
|
+
|
|
53
|
+
<!-- Gold accent line -->
|
|
54
|
+
<rect x="135" y="140" width="90" height="2.5" rx="1.25" fill="url(#goldAccent)"/>
|
|
55
|
+
|
|
56
|
+
<!-- Tagline -->
|
|
57
|
+
<text x="135" y="163" font-family="'Segoe UI', 'Helvetica Neue', Arial, sans-serif" font-size="10.5" fill="#7a8aaa" letter-spacing="3.5" font-weight="400">TECHNOLOGY SOLUTIONS</text>
|
|
58
|
+
</svg>
|