Skip to content

Commit 3a005db

Browse files
committed
mod
1 parent ce1ae98 commit 3a005db

6 files changed

Lines changed: 37 additions & 1 deletion

File tree

03_guidelines/common/ai-coding.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,38 @@ If AI consistently fails to follow a specific guideline:
164164
3. Add the rule to the project's checklist template
165165
4. If still failing, consider adding a pre-commit hook or linter rule for automated enforcement
166166

167-
## 5.4 Rule Suppression (Escape Hatch)
167+
## 5.4 How to Write Effective Guidelines (Benchmark-Validated)
168+
169+
[Benchmark data](https://github.com/yunbow/ai-dev-os-benchmark) shows that guideline **specificity** — not quantity — determines AI compliance. Vague rules are ignored; specific rules achieve 100% compliance.
170+
171+
### Rules for writing rules:
172+
173+
| Principle | Bad (0% compliance) | Good (100% compliance) |
174+
|-----------|---------------------|------------------------|
175+
| **Name the exact method** | "Validate date ranges" | "MUST use `.refine()` to check `dueDate > new Date()`" |
176+
| **Name the exact pattern** | "Use exhaustive checks" | "MUST use `default: { const _exhaustive: never = status; }`" |
177+
| **Provide decision criteria** | "Use dynamic imports" | "SHOULD use `next/dynamic` for components with dependencies > 50KB: charts, editors, modals" |
178+
| **Show the anti-pattern** | "Use proper naming" | "❌ `handleDelete``handleTaskDelete` (MUST include noun)" |
179+
| **Use MUST/SHOULD keywords** | "Consider using..." | "MUST validate on BOTH client and server using `zodResolver`" |
180+
181+
### What NOT to include in guidelines:
182+
183+
* General best practices the AI already knows (basic error handling, standard naming, RESTful API design)
184+
* Large Before/After code sections (benchmark shows no improvement, +55% tokens wasted)
185+
* YAML frontmatter or structured metadata (benchmark shows no improvement, +33% tokens wasted)
186+
* Abstract principles without concrete implementation guidance
187+
188+
### The "generate → check → fix" workflow:
189+
190+
Guidelines alone produce near-zero improvement in total code quality scores. The primary quality mechanism is **post-generation verification** via `/ai-dev-os-check`:
191+
192+
1. Load 3-5 project-specific guideline files in CLAUDE.md (~8K tokens)
193+
2. AI generates code
194+
3. Run `/ai-dev-os-check` with a specific checklist
195+
4. AI reviews its own code and fixes violations
196+
5. This workflow scores 96.9/100 in benchmarks
197+
198+
## 5.5 Rule Suppression (Escape Hatch)
168199
When a specific guideline rule is not applicable to a particular module or file, suppress it explicitly rather than ignoring it silently:
169200

170201
* **Project-level suppression**: Add a `project-specific/` guideline that overrides the rule for specific directories or modules. The Specificity Cascade ensures project-specific rules take precedence over common rules.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ git commit -m "chore: pin ai-dev-os to v1.2.0"
188188
| [plugin-kiro](https://github.com/yunbow/ai-dev-os-plugin-kiro) | Steering Rules and Hooks for Kiro |
189189
| [plugin-cursor](https://github.com/yunbow/ai-dev-os-plugin-cursor) | Cursor Rules (.mdc) for guideline-driven development |
190190
| [cli](https://github.com/yunbow/ai-dev-os-cli) | Setup automation — `npx ai-dev-os init` |
191+
| [benchmark](https://github.com/yunbow/ai-dev-os-benchmark) | Quantitative benchmark — guideline impact on AI code quality |
191192

192193
## License
193194

docs/i18n/es/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ git commit -m "chore: pin ai-dev-os to v1.2.0"
188188
| [plugin-kiro](https://github.com/yunbow/ai-dev-os-plugin-kiro) | Steering Rules y Hooks para Kiro |
189189
| [plugin-cursor](https://github.com/yunbow/ai-dev-os-plugin-cursor) | Cursor Rules (.mdc) para desarrollo guiado por directrices |
190190
| [cli](https://github.com/yunbow/ai-dev-os-cli) | Automatización de configuración — `npx ai-dev-os init` |
191+
| [benchmark](https://github.com/yunbow/ai-dev-os-benchmark) | Benchmark cuantitativo — impacto de directrices en calidad |
191192

192193
## Licencia
193194

docs/i18n/ja/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ git commit -m "chore: pin ai-dev-os to v1.2.0"
188188
| [plugin-kiro](https://github.com/yunbow/ai-dev-os-plugin-kiro) | Kiro 向けの Steering Rules と Hooks |
189189
| [plugin-cursor](https://github.com/yunbow/ai-dev-os-plugin-cursor) | ガイドライン駆動開発のための Cursor Rules (.mdc) |
190190
| [cli](https://github.com/yunbow/ai-dev-os-cli) | セットアップ自動化 — `npx ai-dev-os init` |
191+
| [benchmark](https://github.com/yunbow/ai-dev-os-benchmark) | 定量ベンチマーク — ガイドラインの品質影響データ |
191192

192193
## ライセンス
193194

docs/i18n/ko/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ git commit -m "chore: pin ai-dev-os to v1.2.0"
188188
| [plugin-kiro](https://github.com/yunbow/ai-dev-os-plugin-kiro) | Kiro용 Steering Rules와 Hooks |
189189
| [plugin-cursor](https://github.com/yunbow/ai-dev-os-plugin-cursor) | 가이드라인 기반 개발을 위한 Cursor Rules (.mdc) |
190190
| [cli](https://github.com/yunbow/ai-dev-os-cli) | 설정 자동화 — `npx ai-dev-os init` |
191+
| [benchmark](https://github.com/yunbow/ai-dev-os-benchmark) | 정량적 벤치마크 — 가이드라인 품질 영향 데이터 |
191192

192193
## 라이선스
193194

docs/i18n/zh-CN/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ git commit -m "chore: pin ai-dev-os to v1.2.0"
188188
| [plugin-kiro](https://github.com/yunbow/ai-dev-os-plugin-kiro) | Kiro 的 Steering Rules 与 Hooks |
189189
| [plugin-cursor](https://github.com/yunbow/ai-dev-os-plugin-cursor) | 指南驱动开发的 Cursor Rules (.mdc) |
190190
| [cli](https://github.com/yunbow/ai-dev-os-cli) | 设置自动化 — `npx ai-dev-os init` |
191+
| [benchmark](https://github.com/yunbow/ai-dev-os-benchmark) | 定量基准测试 — 指南对代码质量的影响 |
191192

192193
## 许可证
193194

0 commit comments

Comments
 (0)