ai-dev-starter 0.0.0-stage → 1.0.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/LICENSE +35 -0
- package/README.md +383 -2
- package/adapters/antigravity/AGENTS.md +59 -0
- package/adapters/antigravity/skills/architecture-review/SKILL.md +33 -0
- package/adapters/antigravity/skills/bug-fix/SKILL.md +36 -0
- package/adapters/antigravity/skills/code-review/SKILL.md +34 -0
- package/adapters/antigravity/skills/feature-development/SKILL.md +37 -0
- package/adapters/antigravity/skills/performance-audit/SKILL.md +34 -0
- package/adapters/antigravity/skills/refactor/SKILL.md +35 -0
- package/adapters/antigravity/skills/security-audit/SKILL.md +35 -0
- package/adapters/antigravity/skills/test-generation/SKILL.md +34 -0
- package/adapters/cursor/bug-fix.mdc +38 -0
- package/adapters/cursor/code-review.mdc +56 -0
- package/adapters/cursor/core-rules.mdc +49 -0
- package/adapters/cursor/feature-development.mdc +31 -0
- package/adapters/cursor/performance-arch-tests.mdc +57 -0
- package/adapters/cursor/refactor-and-security.mdc +50 -0
- package/bin/ai-dev-starter.js +2 -0
- package/core/agent-principles.md +96 -0
- package/core/git-analysis.md +150 -0
- package/core/review-methodology.md +154 -0
- package/core/safety-policy.md +70 -0
- package/core/severity-levels.md +104 -0
- package/package.json +40 -4
- package/scripts/ai-dev-starter.js +709 -0
- package/scripts/detector.js +405 -0
- package/standards/backend.md +84 -0
- package/standards/database.md +100 -0
- package/standards/frontend.md +81 -0
- package/standards/security.md +84 -0
- package/standards/testing.md +132 -0
- package/templates/architecture-decision.md +92 -0
- package/templates/project-context.md +144 -0
- package/templates/review-report.md +102 -0
- package/workflows/architecture-review.md +186 -0
- package/workflows/bug-fix.md +149 -0
- package/workflows/code-review.md +189 -0
- package/workflows/feature-development.md +154 -0
- package/workflows/performance-audit.md +169 -0
- package/workflows/refactor.md +128 -0
- package/workflows/security-audit.md +164 -0
- package/workflows/test-generation.md +168 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AI Dev Starter Kit Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Third-Party Attributions
|
|
26
|
+
|
|
27
|
+
Review methodology concepts, severity classification, and anti-speculation
|
|
28
|
+
principles were adapted from PR-Agent by Qodo (formerly CodiumAI):
|
|
29
|
+
https://github.com/Qodo-AI/pr-agent
|
|
30
|
+
Copyright (c) 2023 CodiumAI
|
|
31
|
+
Licensed under the MIT License
|
|
32
|
+
|
|
33
|
+
No source code from PR-Agent was copied. Only conceptual approaches
|
|
34
|
+
(diff-centric review, severity classification, verification methodology)
|
|
35
|
+
were studied and re-implemented independently for IDE-native use.
|
package/README.md
CHANGED
|
@@ -1,3 +1,384 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Universal AI Development Starter Kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A production-quality, reusable AI development system for AI-assisted coding.
|
|
4
|
+
Provides structured workflows for code review, bug fixing, feature development,
|
|
5
|
+
refactoring, security auditing, performance auditing, architecture analysis, and
|
|
6
|
+
test generation — all running inside your IDE's native AI, with no external LLM API key required.
|
|
7
|
+
|
|
8
|
+
**Primary target:** Google Antigravity
|
|
9
|
+
**Also supports:** Cursor
|
|
10
|
+
**Architecture:** Framework-agnostic (PHP/Laravel, React/Next.js, Node.js/TypeScript, Python, and more)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## What It Does
|
|
15
|
+
|
|
16
|
+
| Workflow | Description |
|
|
17
|
+
|----------|-------------|
|
|
18
|
+
| **Code Review** | Analyzes Git changes (committed, staged, unstaged) with evidence-based findings at P0–P3 severity |
|
|
19
|
+
| **Bug Fix** | Root-cause investigation, minimal fix proposal, approval-gated implementation |
|
|
20
|
+
| **Feature Development** | Requirements-first, plan-then-implement, convention-following feature implementation |
|
|
21
|
+
| **Refactoring** | Test-coverage-aware structural improvement with behavioral preservation |
|
|
22
|
+
| **Security Audit** | OWASP-aligned static inspection: injection, auth, sensitive data, mass assignment, CSRF |
|
|
23
|
+
| **Performance Audit** | Evidence-supported: N+1 queries, missing indexes, synchronous blocking, caching gaps |
|
|
24
|
+
| **Architecture Review** | Layer boundaries, coupling, cohesion, dependency quality, scalability |
|
|
25
|
+
| **Test Generation** | Framework-aware test writing using the project's existing testing setup |
|
|
26
|
+
|
|
27
|
+
**Review reports are generated in Persian by default** (configurable to English in `project-context.md`).
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Supported IDEs
|
|
32
|
+
|
|
33
|
+
| IDE | Integration | Status |
|
|
34
|
+
|-----|-------------|--------|
|
|
35
|
+
| Google Antigravity | `AGENTS.md` + `.agents/skills/` (native Skills system) | ✅ Full |
|
|
36
|
+
| Cursor | `.cursor/rules/*.mdc` (native Rules system) | ✅ Full |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
### Prerequisites
|
|
43
|
+
|
|
44
|
+
- Node.js 18+ (only for the installer; no runtime dependencies)
|
|
45
|
+
- Git (for the code review workflow)
|
|
46
|
+
|
|
47
|
+
### Quick Start
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Clone or copy the ai-dev-starter directory into your projects location
|
|
51
|
+
# Then install into your existing project:
|
|
52
|
+
|
|
53
|
+
node /path/to/ai-dev-starter/scripts/ai-dev-starter.js init \
|
|
54
|
+
--ide antigravity \
|
|
55
|
+
--target /path/to/your-project
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### IDE-Specific Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# For Google Antigravity only
|
|
62
|
+
node scripts/ai-dev-starter.js init --ide antigravity --target /your/project
|
|
63
|
+
|
|
64
|
+
# For Cursor only
|
|
65
|
+
node scripts/ai-dev-starter.js init --ide cursor --target /your/project
|
|
66
|
+
|
|
67
|
+
# For both IDEs
|
|
68
|
+
node scripts/ai-dev-starter.js init --ide both --target /your/project
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Install in Current Directory
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
cd /your/project
|
|
75
|
+
node /path/to/ai-dev-starter/scripts/ai-dev-starter.js init --ide antigravity
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Post-Installation
|
|
79
|
+
|
|
80
|
+
After installation, fill in the project context file:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
.agents/project-context.md
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This file tells the AI about your project's tech stack, commands, conventions, and constraints.
|
|
87
|
+
**Do not store credentials in this file.**
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Updating
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
node scripts/ai-dev-starter.js update --target /your/project
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The update command:
|
|
98
|
+
- Shows a diff for files you have manually modified.
|
|
99
|
+
- Asks before overwriting user-modified files.
|
|
100
|
+
- Never silently overwrites.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Uninstallation
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
node scripts/ai-dev-starter.js uninstall --target /your/project
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- Removes all files tracked in the manifest.
|
|
111
|
+
- Preserves files you have manually modified.
|
|
112
|
+
- Removes the manifest file.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Health Check & Detection
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Verify integrity of installed files and configuration
|
|
120
|
+
node scripts/ai-dev-starter.js doctor --target /your/project
|
|
121
|
+
|
|
122
|
+
# Preview what the stack detector discovers in your repository
|
|
123
|
+
node scripts/ai-dev-starter.js detect --target /your/project
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- `doctor`: Verifies all expected files are present, identifies missing or user-modified files.
|
|
127
|
+
- `detect`: Scans `composer.json`, `package.json`, `pyproject.toml`, directories and configs to show the detected stack without modifying files.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Workflow Invocation
|
|
132
|
+
|
|
133
|
+
### Google Antigravity
|
|
134
|
+
|
|
135
|
+
Speak naturally. The skills are auto-discovered:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
"review my code"
|
|
139
|
+
"review my changes on this branch"
|
|
140
|
+
"fix this bug: [paste error or stack trace]"
|
|
141
|
+
"implement feature: user can reset password via email"
|
|
142
|
+
"refactor the OrderController"
|
|
143
|
+
"run a security audit on the auth module"
|
|
144
|
+
"performance review on the API layer"
|
|
145
|
+
"architecture review"
|
|
146
|
+
"generate tests for UserService"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Cursor
|
|
150
|
+
|
|
151
|
+
Mention the rule file or use natural language (the `core-rules.mdc` rule routes automatically):
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
@code-review.mdc — review my code
|
|
155
|
+
@bug-fix.mdc — fix this error: [paste error]
|
|
156
|
+
@feature-development.mdc — implement X
|
|
157
|
+
@refactor-and-security.mdc — refactor this
|
|
158
|
+
@performance-arch-tests.mdc — performance audit
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Or just type naturally — `core-rules.mdc` has `alwaysApply: true` and routes to the right workflow.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Project Context Configuration
|
|
166
|
+
|
|
167
|
+
Edit `.agents/project-context.md` after installation.
|
|
168
|
+
|
|
169
|
+
**Key fields:**
|
|
170
|
+
|
|
171
|
+
```yaml
|
|
172
|
+
project_name: "My SaaS"
|
|
173
|
+
backend_framework: "laravel"
|
|
174
|
+
backend_version: "Laravel 11"
|
|
175
|
+
frontend_framework: "react"
|
|
176
|
+
databases:
|
|
177
|
+
- type: "mysql"
|
|
178
|
+
orm: "eloquent"
|
|
179
|
+
test: "php artisan test"
|
|
180
|
+
report_language: "fa" # fa = Persian, en = English
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Examples by Project Type
|
|
186
|
+
|
|
187
|
+
### Laravel + React Project
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Install
|
|
191
|
+
node scripts/ai-dev-starter.js init --ide both --target /var/www/my-laravel-app
|
|
192
|
+
|
|
193
|
+
# project-context.md configuration:
|
|
194
|
+
# backend_framework: laravel
|
|
195
|
+
# frontend_framework: react
|
|
196
|
+
# test: "php artisan test"
|
|
197
|
+
# report_language: fa
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Invoke:
|
|
201
|
+
```
|
|
202
|
+
"review my code" → Reviews git diff, produces Persian report
|
|
203
|
+
"fix this 500 error: ..." → Investigates Eloquent / controller layer
|
|
204
|
+
"write tests for OrderService" → Generates PHPUnit/Pest tests
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Next.js Project
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Install
|
|
211
|
+
node scripts/ai-dev-starter.js init --ide both --target /home/user/my-nextjs-app
|
|
212
|
+
|
|
213
|
+
# project-context.md configuration:
|
|
214
|
+
# backend_framework: nextjs
|
|
215
|
+
# frontend_framework: next
|
|
216
|
+
# test: "npm test"
|
|
217
|
+
# report_language: en
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Invoke:
|
|
221
|
+
```
|
|
222
|
+
"architecture review" → Evaluates App Router structure, component coupling
|
|
223
|
+
"security audit" → Inspects API routes, auth, XSS vectors
|
|
224
|
+
"performance audit" → Finds client-side data fetching, bundle issues
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Node.js / TypeScript API
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
# Install
|
|
231
|
+
node scripts/ai-dev-starter.js init --ide antigravity --target /home/user/my-api
|
|
232
|
+
|
|
233
|
+
# project-context.md configuration:
|
|
234
|
+
# backend_framework: express
|
|
235
|
+
# backend_language: typescript
|
|
236
|
+
# test: "npm test"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Customization
|
|
242
|
+
|
|
243
|
+
### Adding Project-Specific Rules
|
|
244
|
+
|
|
245
|
+
Edit `AGENTS.md` (Antigravity) or `.cursor/rules/ai-core-rules.mdc` (Cursor) to add project-specific always-on rules. The installer will warn before overwriting user-modified files on subsequent updates.
|
|
246
|
+
|
|
247
|
+
### Adding a New Workflow
|
|
248
|
+
|
|
249
|
+
1. Create `workflows/my-workflow.md` following the existing structure.
|
|
250
|
+
2. Create `adapters/antigravity/skills/my-workflow/SKILL.md` with YAML frontmatter.
|
|
251
|
+
3. Create `adapters/cursor/my-workflow.mdc` with YAML frontmatter.
|
|
252
|
+
4. Add entries to `ANTIGRAVITY_FILES` and `CURSOR_FILES` in `scripts/ai-dev-starter.js`.
|
|
253
|
+
5. Run `update` to deploy.
|
|
254
|
+
|
|
255
|
+
### Adding a New IDE Adapter
|
|
256
|
+
|
|
257
|
+
1. Research the IDE's native rules/instructions format.
|
|
258
|
+
2. Create `adapters/<ide-name>/` directory.
|
|
259
|
+
3. Add a file manifest array in the installer script (following `ANTIGRAVITY_FILES` as a model).
|
|
260
|
+
4. Add the new IDE option to the CLI `--ide` argument parser.
|
|
261
|
+
|
|
262
|
+
### Changing Report Language
|
|
263
|
+
|
|
264
|
+
In `.agents/project-context.md`:
|
|
265
|
+
```yaml
|
|
266
|
+
report_language: "en" # English
|
|
267
|
+
# or
|
|
268
|
+
report_language: "fa" # Persian (default)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Architecture
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
ai-dev-starter/
|
|
277
|
+
├── core/ # Universal, IDE-independent instructions
|
|
278
|
+
│ ├── agent-principles.md # Agent identity, safety rules, communication
|
|
279
|
+
│ ├── safety-policy.md # Destructive action protocol
|
|
280
|
+
│ ├── git-analysis.md # Git command sequences, diff interpretation rules
|
|
281
|
+
│ ├── review-methodology.md # Review dimensions, verification checklist, formats
|
|
282
|
+
│ └── severity-levels.md # P0–P3 definitions with examples
|
|
283
|
+
│
|
|
284
|
+
├── workflows/ # Task-specific execution sequences
|
|
285
|
+
│ ├── code-review.md
|
|
286
|
+
│ ├── bug-fix.md
|
|
287
|
+
│ ├── feature-development.md
|
|
288
|
+
│ ├── refactor.md
|
|
289
|
+
│ ├── security-audit.md
|
|
290
|
+
│ ├── performance-audit.md
|
|
291
|
+
│ ├── architecture-review.md
|
|
292
|
+
│ └── test-generation.md
|
|
293
|
+
│
|
|
294
|
+
├── standards/ # Technology-agnostic coding standards
|
|
295
|
+
│ ├── backend.md
|
|
296
|
+
│ ├── frontend.md
|
|
297
|
+
│ ├── database.md
|
|
298
|
+
│ ├── security.md
|
|
299
|
+
│ └── testing.md
|
|
300
|
+
│
|
|
301
|
+
├── adapters/
|
|
302
|
+
│ ├── antigravity/ # Google Antigravity native format
|
|
303
|
+
│ │ ├── AGENTS.md # Always-on rules (project root)
|
|
304
|
+
│ │ └── skills/ # One SKILL.md bundle per workflow
|
|
305
|
+
│ └── cursor/ # Cursor native format
|
|
306
|
+
│ └── *.mdc # One .mdc rule file per workflow cluster
|
|
307
|
+
│
|
|
308
|
+
├── templates/
|
|
309
|
+
│ ├── project-context.md # Fill-in template for project-specific config
|
|
310
|
+
│ ├── review-report.md # Bilingual review report structure
|
|
311
|
+
│ └── architecture-decision.md # ADR template
|
|
312
|
+
│
|
|
313
|
+
├── scripts/
|
|
314
|
+
│ ├── ai-dev-starter.js # Installer CLI (no external dependencies)
|
|
315
|
+
│ └── detector.js # Project context & tech stack detector
|
|
316
|
+
│
|
|
317
|
+
├── tests/
|
|
318
|
+
│ └── test-installer.js # Automated test suite (54 assertions)
|
|
319
|
+
│
|
|
320
|
+
├── package.json # npm scripts & metadata
|
|
321
|
+
├── README.md
|
|
322
|
+
└── LICENSE
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Design Decisions
|
|
326
|
+
|
|
327
|
+
**Why no external API key?** The kit uses your IDE's native AI. No subscription, no key rotation, no cost per review.
|
|
328
|
+
|
|
329
|
+
**Why Node.js for the installer?** Node.js is available on all major platforms and in most project environments. The installer uses only built-in modules — no `npm install` required.
|
|
330
|
+
|
|
331
|
+
**Why AGENTS.md + Skills instead of a single file?** Progressive disclosure: `AGENTS.md` is always-on and minimal. Skills are loaded only when invoked. This prevents wasting context on irrelevant workflows.
|
|
332
|
+
|
|
333
|
+
**Why are core files referenced by path?** Workflows instruct the AI to load specific core files at runtime. This avoids duplicating content across adapters while maintaining a single source of truth.
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Limitations
|
|
338
|
+
|
|
339
|
+
| Limitation | Detail |
|
|
340
|
+
|-----------|--------|
|
|
341
|
+
| No CI integration | Cannot run as a GitHub Action or comment on PRs. Use this inside your IDE. |
|
|
342
|
+
| Static analysis only | Cannot run DAST, profiling, or dynamic tests automatically. |
|
|
343
|
+
| Git access required | Code Review workflow requires a git repository and read access to `git diff`. |
|
|
344
|
+
| No IDE API access | Cannot post inline comments in PRs — output is text in the IDE chat. |
|
|
345
|
+
| Test execution | AI reports test results only when tests are actually run in the IDE's terminal access. |
|
|
346
|
+
| Cursor non-interactivity | Cursor rules cannot call shell commands directly — the AI must use the terminal panel. |
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Troubleshooting
|
|
351
|
+
|
|
352
|
+
**"Skill not being triggered in Antigravity"**
|
|
353
|
+
- Confirm `.agents/skills/<name>/SKILL.md` exists.
|
|
354
|
+
- Check the `description:` field in the SKILL.md frontmatter is descriptive enough.
|
|
355
|
+
- Run `ai-dev-starter doctor` to verify file presence.
|
|
356
|
+
|
|
357
|
+
**"Cursor rules not loading"**
|
|
358
|
+
- Confirm files are in `.cursor/rules/*.mdc` (not `.cursorrules`).
|
|
359
|
+
- Confirm `alwaysApply: true` is set in `core-rules.mdc`.
|
|
360
|
+
- Check Cursor version supports `.mdc` files (requires Cursor 0.43+).
|
|
361
|
+
|
|
362
|
+
**"Review report is in English but I want Persian"**
|
|
363
|
+
- In `.agents/project-context.md`, set `report_language: fa`.
|
|
364
|
+
|
|
365
|
+
**"Update is overwriting my custom AGENTS.md"**
|
|
366
|
+
- The update command will show a diff and ask before overwriting.
|
|
367
|
+
- If the file is listed as user-modified in the manifest, it will warn and prompt.
|
|
368
|
+
- Answer `n` to skip overwrite.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## Attribution
|
|
373
|
+
|
|
374
|
+
Review methodology and prompt design principles adapted from:
|
|
375
|
+
**PR-Agent** by Qodo (formerly CodiumAI) — https://github.com/Qodo-AI/pr-agent
|
|
376
|
+
Licensed under the MIT License.
|
|
377
|
+
|
|
378
|
+
Adaptations are conceptual (review dimensions, severity classification, anti-speculation rules, diff-centric focus) and do not include direct source code reproduction.
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## License
|
|
383
|
+
|
|
384
|
+
MIT License — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# AI Development Rules — Universal
|
|
2
|
+
|
|
3
|
+
> **Scope:** These rules are always loaded for every task in this project.
|
|
4
|
+
> **Keep this file short.** Full workflow details live in `.agents/skills/`.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Core Identity
|
|
9
|
+
|
|
10
|
+
You are a Principal Software Engineer embedded in this project.
|
|
11
|
+
You are precise, evidence-based, and conservative about irreversible actions.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Always-On Rules
|
|
16
|
+
|
|
17
|
+
1. **Never commit, push, merge, or deploy automatically.**
|
|
18
|
+
2. **Never overwrite user-modified files without showing a diff and asking.**
|
|
19
|
+
3. **Never expose credentials, tokens, or secrets in any output.**
|
|
20
|
+
4. **Never claim tests passed unless you executed them and observed output.**
|
|
21
|
+
5. **Never fabricate code findings — every reported issue must have file + line evidence.**
|
|
22
|
+
6. **Make the smallest change that solves the problem. No scope creep.**
|
|
23
|
+
7. **Preserve existing architecture, naming conventions, and coding style.**
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Workflow Invocation
|
|
28
|
+
|
|
29
|
+
Activate the appropriate skill for each task:
|
|
30
|
+
|
|
31
|
+
| Task | Say | Skill |
|
|
32
|
+
|------|-----|-------|
|
|
33
|
+
| Review code changes | "review my code" | `code-review` |
|
|
34
|
+
| Fix a bug | "fix this bug" or paste error | `bug-fix` |
|
|
35
|
+
| Build a feature | "implement feature X" | `feature-development` |
|
|
36
|
+
| Refactor code | "refactor this" | `refactor` |
|
|
37
|
+
| Security audit | "security audit" | `security-audit` |
|
|
38
|
+
| Performance audit | "performance review" | `performance-audit` |
|
|
39
|
+
| Architecture review | "architecture review" | `architecture-review` |
|
|
40
|
+
| Generate tests | "write tests for X" | `test-generation` |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Project Context
|
|
45
|
+
|
|
46
|
+
Before starting any task, check `.agents/project-context.md` for:
|
|
47
|
+
- Tech stack and framework versions.
|
|
48
|
+
- Development and test commands.
|
|
49
|
+
- Coding conventions.
|
|
50
|
+
- Review report language setting.
|
|
51
|
+
|
|
52
|
+
If the file does not exist, ask the user to run `ai-dev-starter init` or fill in the template at `.agents/project-context.md`.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Report Language
|
|
57
|
+
|
|
58
|
+
Default: **Persian (Farsi)**. Preserve English for code, identifiers, file paths, commands.
|
|
59
|
+
Override in `.agents/project-context.md` → `report_language: en` to switch to English.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architecture-review
|
|
3
|
+
description: >-
|
|
4
|
+
Evaluates the structural health, layer boundaries, coupling, cohesion,
|
|
5
|
+
dependency quality, and scalability of the codebase. Produces findings at
|
|
6
|
+
the architectural level, not code-level defects. Read-only. Use when asked
|
|
7
|
+
for "architecture review", "design review", "بررسی معماری".
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Architecture Review Skill
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Execute the Architecture Review workflow from `workflows/architecture-review.md`.
|
|
15
|
+
|
|
16
|
+
Before starting, load:
|
|
17
|
+
- `core/agent-principles.md`
|
|
18
|
+
- `.agents/project-context.md`
|
|
19
|
+
|
|
20
|
+
Follow the 7-step execution sequence:
|
|
21
|
+
1. Map the directory structure and file distribution.
|
|
22
|
+
2. Identify the architectural pattern in use.
|
|
23
|
+
3. Evaluate layer boundaries (fat controllers, DB in controllers, etc.).
|
|
24
|
+
4. Evaluate coupling and cohesion.
|
|
25
|
+
5. Evaluate third-party dependencies.
|
|
26
|
+
6. Evaluate scalability potential.
|
|
27
|
+
7. Generate structured report.
|
|
28
|
+
|
|
29
|
+
## Key Constraints
|
|
30
|
+
|
|
31
|
+
- **Read-only.** Make no changes.
|
|
32
|
+
- **Structural findings only.** Code-level bugs belong in Code Review, not here.
|
|
33
|
+
- Cite specific files and metrics (line counts, import counts) as evidence.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bug-fix
|
|
3
|
+
description: >-
|
|
4
|
+
Investigates a reported bug, identifies root cause with evidence, proposes a
|
|
5
|
+
minimal fix, and implements only after user approval. Use when the user shares
|
|
6
|
+
an error message, stack trace, test failure, or describes unexpected behavior.
|
|
7
|
+
Trigger phrases: "fix this bug", "this is broken", "باگ", "خطا".
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Bug Fix Skill
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Execute the Bug Fix workflow from `workflows/bug-fix.md`.
|
|
15
|
+
|
|
16
|
+
Before starting, load:
|
|
17
|
+
- `core/agent-principles.md`
|
|
18
|
+
- `core/safety-policy.md`
|
|
19
|
+
- `.agents/project-context.md`
|
|
20
|
+
|
|
21
|
+
Follow the 8-step execution sequence:
|
|
22
|
+
1. Understand the bug report.
|
|
23
|
+
2. Establish evidence (search, grep, read).
|
|
24
|
+
3. Identify root cause.
|
|
25
|
+
4. Identify affected code.
|
|
26
|
+
5. Propose fix (with plan).
|
|
27
|
+
6. **Wait for explicit user approval.**
|
|
28
|
+
7. Implement.
|
|
29
|
+
8. Run tests and report output.
|
|
30
|
+
|
|
31
|
+
## Key Constraints
|
|
32
|
+
|
|
33
|
+
- **Never implement without user approval** of the proposed fix plan.
|
|
34
|
+
- **Minimal change only.** Do not fix unrelated issues encountered during investigation.
|
|
35
|
+
- **Never auto-commit** the fix.
|
|
36
|
+
- Run only the tests relevant to the fix — report actual output.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: >-
|
|
4
|
+
Performs a structured, evidence-based code review of current Git changes.
|
|
5
|
+
Reviews committed, staged, and unstaged changes. Produces a prioritized
|
|
6
|
+
findings report with file/line citations. Use when asked to "review my code",
|
|
7
|
+
"code review", "بررسی کد", or "ریویو کن".
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Code Review Skill
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Execute the Code Review workflow from `workflows/code-review.md`.
|
|
15
|
+
|
|
16
|
+
Before starting, load:
|
|
17
|
+
- `core/agent-principles.md`
|
|
18
|
+
- `core/git-analysis.md`
|
|
19
|
+
- `core/review-methodology.md`
|
|
20
|
+
- `core/severity-levels.md`
|
|
21
|
+
- `.agents/project-context.md` (if present in the project)
|
|
22
|
+
|
|
23
|
+
Then follow the 8-step execution sequence defined in `workflows/code-review.md`.
|
|
24
|
+
|
|
25
|
+
## Key Constraints
|
|
26
|
+
|
|
27
|
+
- **Read-only.** Do not modify any files.
|
|
28
|
+
- **Evidence-only.** Every finding must include file path, line number, and code evidence.
|
|
29
|
+
- **No speculation.** Do not report issues you cannot trace to specific changed lines.
|
|
30
|
+
- **Report language:** Use the `report_language` from `.agents/project-context.md` (default: Persian).
|
|
31
|
+
|
|
32
|
+
## Output
|
|
33
|
+
|
|
34
|
+
A structured review report following the template in `templates/review-report.md`.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-development
|
|
3
|
+
description: >-
|
|
4
|
+
Implements a new feature by first understanding requirements, inspecting
|
|
5
|
+
existing architecture, presenting a plan, and implementing incrementally
|
|
6
|
+
following project conventions. Use when asked to "add feature X",
|
|
7
|
+
"implement Y", "build Z", "اضافه کن", "پیادهسازی کن".
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Feature Development Skill
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Execute the Feature Development workflow from `workflows/feature-development.md`.
|
|
15
|
+
|
|
16
|
+
Before starting, load:
|
|
17
|
+
- `core/agent-principles.md`
|
|
18
|
+
- `core/safety-policy.md`
|
|
19
|
+
- `.agents/project-context.md`
|
|
20
|
+
- Relevant standards from `standards/` based on detected tech stack.
|
|
21
|
+
|
|
22
|
+
Follow the 8-step execution sequence:
|
|
23
|
+
1. Understand and confirm requirements (ask max 3 clarifying questions if needed).
|
|
24
|
+
2. Inspect existing architecture.
|
|
25
|
+
3. Present implementation plan.
|
|
26
|
+
4. **Wait for user approval.**
|
|
27
|
+
5. Implement incrementally (migration → model → service → controller → tests).
|
|
28
|
+
6. Follow existing conventions exactly.
|
|
29
|
+
7. Write tests.
|
|
30
|
+
8. Run tests and report output.
|
|
31
|
+
|
|
32
|
+
## Key Constraints
|
|
33
|
+
|
|
34
|
+
- Present a plan and **wait for approval before writing any files**.
|
|
35
|
+
- Do not introduce new dependencies without approval.
|
|
36
|
+
- Do not modify code outside the authorized scope.
|
|
37
|
+
- Match existing naming conventions, file structure, and coding style exactly.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-audit
|
|
3
|
+
description: >-
|
|
4
|
+
Identifies measurable performance bottlenecks in database queries, API calls,
|
|
5
|
+
frontend rendering, and background jobs. Prioritizes evidence-supported issues
|
|
6
|
+
over theoretical ones. Read-only. Use when asked for "performance audit",
|
|
7
|
+
"slow queries", "optimize", "بررسی کارایی", "کوئری کند".
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Performance Audit Skill
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Execute the Performance Audit workflow from `workflows/performance-audit.md`.
|
|
15
|
+
|
|
16
|
+
Before starting, load:
|
|
17
|
+
- `core/agent-principles.md`
|
|
18
|
+
- `core/severity-levels.md`
|
|
19
|
+
- `.agents/project-context.md`
|
|
20
|
+
|
|
21
|
+
Follow the 7-step execution sequence:
|
|
22
|
+
1. Define scope.
|
|
23
|
+
2. Database query analysis (N+1, missing indexes, unbounded queries).
|
|
24
|
+
3. API and HTTP analysis (synchronous calls, missing caching).
|
|
25
|
+
4. Frontend analysis (bundle size, non-lazy routes, unnecessary renders).
|
|
26
|
+
5. Background job analysis.
|
|
27
|
+
6. Assess each finding for evidence and scale impact.
|
|
28
|
+
7. Generate report.
|
|
29
|
+
|
|
30
|
+
## Key Constraints
|
|
31
|
+
|
|
32
|
+
- **Read-only.** Make no changes.
|
|
33
|
+
- **Evidence-supported findings only.** Speculative performance concerns are not reported.
|
|
34
|
+
- Each finding must include estimated impact at realistic scale.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor
|
|
3
|
+
description: >-
|
|
4
|
+
Improves code structure and readability without changing observable behavior.
|
|
5
|
+
Checks for test coverage first, presents a plan, implements step by step,
|
|
6
|
+
and verifies tests still pass after each step. Use when asked to "refactor",
|
|
7
|
+
"clean up", "simplify", "ریفکتور", "بهبود کد".
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Refactor Skill
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Execute the Refactoring workflow from `workflows/refactor.md`.
|
|
15
|
+
|
|
16
|
+
Before starting, load:
|
|
17
|
+
- `core/agent-principles.md`
|
|
18
|
+
- `core/safety-policy.md`
|
|
19
|
+
- `.agents/project-context.md`
|
|
20
|
+
|
|
21
|
+
Follow the 6-step execution sequence:
|
|
22
|
+
1. Understand scope.
|
|
23
|
+
2. Assess test coverage (warn if none, offer to generate tests first).
|
|
24
|
+
3. Identify improvements.
|
|
25
|
+
4. Present refactoring plan.
|
|
26
|
+
5. **Wait for user approval.**
|
|
27
|
+
6. Implement in small steps, running tests after each.
|
|
28
|
+
|
|
29
|
+
## Key Constraints
|
|
30
|
+
|
|
31
|
+
- **Stop immediately if any test fails.** Report and revert the last step.
|
|
32
|
+
- **No feature additions during refactoring.**
|
|
33
|
+
- **No changes to public APIs.**
|
|
34
|
+
- Do not reformat code outside the changed functions.
|
|
35
|
+
- Behavior must be observably identical before and after.
|