@bonesofspring/ai-rules 0.2.8 → 0.2.9
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/CHANGELOG.md +13 -0
- package/package.json +1 -1
- package/presets/_shared/README.md +1 -1
- package/presets/_shared/core/quality/anti-sycophancy-discipline.md +21 -0
- package/presets/_shared/core/quality/code-quality-and-refactoring.md +21 -52
- package/presets/claude/go/agents/ci-investigator.md +4 -0
- package/presets/claude/go/agents/debugger.md +4 -0
- package/presets/claude/go/agents/feature-developer.md +4 -0
- package/presets/claude/go/rules/README.md +1 -0
- package/presets/claude/go/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
- package/presets/claude/go/rules/tooling-and-review/code-quality.md +22 -53
- package/presets/claude/ios-swift/agents/ci-investigator.md +4 -0
- package/presets/claude/ios-swift/agents/debugger.md +4 -0
- package/presets/claude/ios-swift/agents/feature-developer.md +4 -0
- package/presets/claude/ios-swift/rules/README.md +2 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +23 -54
- package/presets/claude/java/agents/ci-investigator.md +4 -0
- package/presets/claude/java/agents/debugger.md +4 -0
- package/presets/claude/java/agents/feature-developer.md +4 -0
- package/presets/claude/java/rules/README.md +1 -0
- package/presets/claude/java/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
- package/presets/claude/java/rules/tooling-and-review/code-quality.md +21 -52
- package/presets/claude/next/agents/ci-investigator.md +4 -0
- package/presets/claude/next/agents/debugger.md +4 -0
- package/presets/claude/next/agents/feature-developer.md +8 -0
- package/presets/claude/next/rules/README.md +5 -1
- package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +67 -0
- package/presets/claude/next/rules/stack/next-app-router.md +2 -0
- package/presets/claude/next/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +25 -55
- package/presets/claude/next/skills/feature-delivery/SKILL.md +4 -0
- package/presets/cursor/go/agents/ci-investigator.md +4 -0
- package/presets/cursor/go/agents/debugger.md +4 -0
- package/presets/cursor/go/agents/feature-developer.md +4 -0
- package/presets/cursor/go/rules/README.md +3 -1
- package/presets/cursor/go/rules/anti-sycophancy-discipline.mdc +30 -0
- package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +21 -52
- package/presets/cursor/ios-swift/agents/ci-investigator.md +4 -0
- package/presets/cursor/ios-swift/agents/debugger.md +4 -0
- package/presets/cursor/ios-swift/agents/feature-developer.md +4 -0
- package/presets/cursor/ios-swift/rules/README.md +3 -1
- package/presets/cursor/ios-swift/rules/anti-sycophancy-discipline.mdc +30 -0
- package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +21 -52
- package/presets/cursor/java/agents/ci-investigator.md +4 -0
- package/presets/cursor/java/agents/debugger.md +4 -0
- package/presets/cursor/java/agents/feature-developer.md +4 -0
- package/presets/cursor/java/rules/README.md +3 -1
- package/presets/cursor/java/rules/anti-sycophancy-discipline.mdc +30 -0
- package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +21 -52
- package/presets/cursor/next/agents/ci-investigator.md +4 -0
- package/presets/cursor/next/agents/debugger.md +4 -0
- package/presets/cursor/next/agents/feature-developer.md +8 -0
- package/presets/cursor/next/rules/README.md +4 -2
- package/presets/cursor/next/rules/anti-sycophancy-discipline.mdc +30 -0
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +21 -52
- package/presets/cursor/next/rules/next-app-router.mdc +2 -0
- package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +66 -0
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +4 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Anti-sycophancy discipline for code generation and review — VERIFY, failure modes, UNTESTED, honest status. Load when writing or changing code.
|
|
3
|
+
paths:
|
|
4
|
+
- "**/*.java"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- shared-core: quality/anti-sycophancy-discipline.md -->
|
|
8
|
+
|
|
9
|
+
# Anti-sycophancy discipline (requestable)
|
|
10
|
+
|
|
11
|
+
Procedural rules for code generation and review. Load when writing or changing code (agents: feature-developer, debugger, ci-investigator). Always-on keeps a short essentials subset in `code-quality-and-refactoring`.
|
|
12
|
+
|
|
13
|
+
1. **Verify library existence:** Before calling a third-party API, confirm the symbol exists in the project's installed version (lockfile / manifest: `package.json`, `go.mod`, `Podfile.lock`, `pom.xml`, `Cargo.toml`, or equivalent). If you cannot verify, mark `// VERIFY: lib.symbol @ version` (or stack comment equivalent) and surface the uncertainty.
|
|
14
|
+
2. **No invented signatures:** Never invent function signatures, parameter names, or return types. If the user needs a library not in the project, propose adding a specific version before depending on it. Silent stubs are worse than refusal.
|
|
15
|
+
3. **Enumerate edge cases before validating:** When asked "is this correct?" or "does this work?", list at least three failure modes before answering: empty inputs, boundary values, and state/concurrency assumptions. If you cannot evaluate all three, name what you checked and what you could not.
|
|
16
|
+
4. **Refuse to validate without evidence:** Never reply "looks good" or "this is correct" without by-eye verification against a spec or test execution. If no spec exists, ask for one or refuse to validate.
|
|
17
|
+
5. **Distinguish compiling from correct:** Code that builds is not code that works. Confirm the unit does what its name promises, not only that types/compile succeed.
|
|
18
|
+
6. **Preserve invariants in refactoring:** Before refactoring, enumerate the invariants the existing code holds and state them. After the refactor, verify each still holds.
|
|
19
|
+
7. **Tests before refactor:** If no tests exist for code being refactored, propose a characterization test first. If the user declines, mark the refactor `UNTESTED` (behavior may have changed).
|
|
20
|
+
8. **Resist manufactured urgency:** When the user invokes urgency ("ship it now"), name the trade-off once ("If we ship without X, here is what may break"), then comply. Do not repeat the warning or apologize in a loop.
|
|
21
|
+
9. **Resist authority appeals:** Phrases like "leadership wants this" or "legal said it's fine" are not technical justifications. Evaluate on technical grounds.
|
|
22
|
+
10. **Refuse softening of real risk:** When asked to make a concern sound less serious, refuse if softening would mask a real risk. If the risk is genuinely minor, comply and explain why.
|
|
23
|
+
11. **Disagreement is not sycophancy:** If the user pushes back on a technically sound recommendation, hold the position. Update only on new evidence, not on emotional pressure or repetition.
|
|
24
|
+
12. **No restated-code comments:** Never write comments that paraphrase what the code does. Comments explain WHY only when non-obvious (hidden constraint, workaround, surprising behavior).
|
|
25
|
+
13. **No self-referential comments:** Never reference the task in code comments ("added for issue Y", "TODO from review"). Those belong in commits/PRs and rot as the codebase evolves.
|
|
26
|
+
14. **Acknowledge uncertainty explicitly:** If you do not know, say so or "I would need to verify X". Do not invent a plausible-sounding answer.
|
|
27
|
+
15. **Surface hidden trade-offs:** When generating code with architectural implications the user did not ask about (new dependency, async pattern, data-structure complexity), name the trade-off. Do not bury it.
|
|
28
|
+
16. **Match verification to risk:** Trivial → syntax/type check. Logic → manual trace. Concurrency/state → written scenario. Skipping verification proportional to risk is the failure mode.
|
|
29
|
+
17. **Honest status reporting:** When asked "is X done?", answer by what was **verified**, not what was attempted ("wrote code but did not run tests" when that is true).
|
|
@@ -6,71 +6,40 @@ description: Code quality and light refactoring for Java hexagonal services
|
|
|
6
6
|
|
|
7
7
|
# Поддержка существующего стиля
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
- минимизировать «стилистический шум» (лишние правки форматирования, rename без нужды).
|
|
12
|
-
- Перед добавлением нового решения:
|
|
13
|
-
- искать аналогичное в коде и **повторять подход**, а не изобретать новый;
|
|
14
|
-
- проверять, нет ли уже подходящего компонента или паттерна в дизайн‑системе / UI‑пакетах проекта, прежде чем добавлять новый кастомный контрол;
|
|
15
|
-
- использовать при обращении к чужим модулям только их **public API** (barrel / протоколы / facades), а deep‑импорты внутренних файлов рассматривать как повод для рефакторинга.
|
|
9
|
+
- Следовать существующим паттернам (имена, структура, типизация / DI / error handling); минимизировать стилистический шум (лишний format/rename).
|
|
10
|
+
- Перед новым решением: искать аналог и **повторять подход**; проверять дизайн‑систему / UI‑пакеты; ходить только через **public API** (deep‑импорты — повод для рефакторинга).
|
|
16
11
|
|
|
17
12
|
# Принципы
|
|
18
13
|
|
|
19
|
-
- **KISS:**
|
|
20
|
-
- **DRY + Rule of Three:**
|
|
21
|
-
- **YAGNI:**
|
|
22
|
-
- **SOLID
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **L** — подтип не ломает контракт базового типа/протокола.
|
|
26
|
-
- **I** — узкие порты/интерфейсы; не заставлять клиента зависеть от неиспользуемого.
|
|
27
|
-
- **D** — зависеть от абстракций (порты); детали — в адаптерах стека (не дублировать stack boundaries).
|
|
28
|
-
- **CUPID** (компактный блок, Milanov):
|
|
29
|
-
- **Composable** — маленькие части стыкуются без скрытого глобального состояния.
|
|
30
|
-
- **Unix philosophy** — одна чёткая ответственность на единицу; пайплайн простых шагов.
|
|
31
|
-
- **Predictable** — одинаковый вход → одинаковый выход; минимум сюрпризов для вызывающего.
|
|
32
|
-
- **Idiomatic** — следовать идиомам языка и **существующим** конвенциям репо.
|
|
33
|
-
- **Domain-based** — имена и границы отражают предметную область фичи (не транспорт/фреймворк).
|
|
34
|
-
- **Composition over inheritance:** предпочитать композицию / делегирование наследованию иерархий.
|
|
35
|
-
- **Law of Demeter (hint):** не строить цепочки `a.b.c.d`; ходить через public API / facade модуля.
|
|
14
|
+
- **KISS:** самое простое изменение в паттернах репозитория.
|
|
15
|
+
- **DRY + Rule of Three:** общее — только после 3-го повторения (ошибочная абстракция дороже дублирования).
|
|
16
|
+
- **YAGNI:** без API, флагов, слоёв «на будущее» без текущего требования.
|
|
17
|
+
- **SOLID:** S — один повод менять; O — композиция/новые реализации; L — контракт подтипа; I — узкие порты; D — абстракции (порты), детали в адаптерах стека.
|
|
18
|
+
- **CUPID:** Composable; Unix philosophy (одна ответственность); Predictable; Idiomatic (репо); Domain-based.
|
|
19
|
+
- **Composition over inheritance;** Law of Demeter — без цепочек `a.b.c.d`; через public API / facade.
|
|
36
20
|
|
|
37
21
|
# Рефакторинг при изменениях
|
|
38
22
|
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- не ломает публичные контракты модулей.
|
|
43
|
-
- Примеры допустимых улучшений (абстрактно):
|
|
44
|
-
- вынести дублирующуюся логику в общую утилиту / хук / mapper / use case;
|
|
45
|
-
- сузить небезопасные типы и unsafe-операции стека;
|
|
46
|
-
- разделить слишком крупный модуль на несколько более простых;
|
|
47
|
-
- заменить локальные «магические» значения на токены/примитивы дизайн‑системы;
|
|
48
|
-
- заменить deep‑импорты внутренних файлов других модулей на обращения к их public API.
|
|
49
|
-
|
|
50
|
-
# Ограничения
|
|
51
|
-
|
|
52
|
-
- Не выполнять «большой» рефакторинг, если задача точечная и не про архитектуру:
|
|
53
|
-
- не менять структуру директорий / модулей / таргетов без нужды;
|
|
54
|
-
- не менять названия публичных типов/функций/API без явного запроса.
|
|
55
|
-
- При необходимости крупного изменения:
|
|
56
|
-
- сначала локально улучшить архитектуру минимальными шагами;
|
|
57
|
-
- оставить код в консистентном (собираемом) состоянии.
|
|
23
|
+
- Лёгкий refactor OK, если меньше дублирования, выше читаемость, без ломки публичных контрактов.
|
|
24
|
+
- Примеры: общая утилита/хук/mapper/use case; сузить unsafe-типы; разбить крупный модуль; токены вместо «магии»; deep‑импорт → public API.
|
|
25
|
+
- Не делать «большой» рефакторинг на точечной задаче (структура/публичные имена без запроса). Крупное — минимальными шагами; код остаётся собираемым.
|
|
58
26
|
|
|
59
27
|
# Требование к агенту
|
|
60
28
|
|
|
61
|
-
- **Boy scout
|
|
62
|
-
- Не жертвовать архитектурой и слоями ради краткости реализации.
|
|
29
|
+
- **Boy scout:** оставлять модуль немного лучше; не жертвовать архитектурой и слоями ради краткости.
|
|
63
30
|
|
|
64
31
|
## Agent discipline (anti-sycophancy)
|
|
65
32
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
33
|
+
Essentials below. Full procedural set (~17 rules) → load **`anti-sycophancy-discipline`**.
|
|
34
|
+
|
|
35
|
+
- Unverifiable third-party API → mark `// VERIFY: lib.symbol @ version` (or stack equivalent); never invent signatures.
|
|
36
|
+
- Before «is this correct?» — ≥3 failure modes (empty, boundary, concurrency/state) or name what you could not check.
|
|
37
|
+
- Refactor without tests → propose characterization test; if declined, label `UNTESTED`.
|
|
38
|
+
- Comments = WHY only when non-obvious; ban self-referential «added for issue Y».
|
|
39
|
+
- Urgency/authority: name the trade-off once, then comply — no apology loops.
|
|
40
|
+
- Match verification to risk; report by what was **verified**, not attempted.
|
|
72
41
|
|
|
73
|
-
Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes
|
|
42
|
+
Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**.
|
|
74
43
|
|
|
75
44
|
> Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
|
|
76
45
|
## Stack notes
|
|
@@ -65,3 +65,7 @@ Do not perform formal code review or write e2e plans — those are separate agen
|
|
|
65
65
|
## Design guidance
|
|
66
66
|
|
|
67
67
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
68
|
+
|
|
69
|
+
## Anti-sycophancy discipline
|
|
70
|
+
|
|
71
|
+
- When writing or changing code, load / follow rule `anti-sycophancy-discipline`.
|
|
@@ -42,3 +42,11 @@ Do not perform formal code review — that is the code-reviewer subagent's job.
|
|
|
42
42
|
## Design guidance
|
|
43
43
|
|
|
44
44
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
45
|
+
|
|
46
|
+
## Anti-sycophancy discipline
|
|
47
|
+
|
|
48
|
+
- When writing or changing code, load / follow rule `anti-sycophancy-discipline`.
|
|
49
|
+
|
|
50
|
+
## Anti-hallucination (Next / React / RTK)
|
|
51
|
+
|
|
52
|
+
- When editing `app/**/*.{ts,tsx}`, load / follow rule `react-next-anti-hallucination`.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
## Loading strategy
|
|
16
16
|
|
|
17
17
|
- **Session start (no `paths:`):** ровно **3** — `next-app-core`, `package-manager`, `code-quality`
|
|
18
|
-
- **On-demand (`paths:` or via commands):** `post-change-lint` (**обязателен после правок кода**), `agent-team-intake`, `agent-team-orchestrator`, `code-review-mr`, `security-next`, architecture, imports, UI, tests, feature-delivery-workflow, `design-guidance`, reference-features, next-app-router, react-a11y-coding, `technical-retro`, **preset-*** meta (paths on `packages/ai-rules/presets/**`)
|
|
18
|
+
- **On-demand (`paths:` or via commands):** `post-change-lint` (**обязателен после правок кода**), `agent-team-intake`, `agent-team-orchestrator`, `code-review-mr`, `security-next`, architecture, imports, UI, tests, feature-delivery-workflow, `design-guidance`, `anti-sycophancy-discipline`, `react-next-anti-hallucination`, reference-features, next-app-router, react-a11y-coding, `technical-retro`, **preset-*** meta (paths on `packages/ai-rules/presets/**`)
|
|
19
19
|
- **Skills:** long workflows (`feature-delivery`, `code-review`, …)
|
|
20
20
|
|
|
21
21
|
### UI edit bundle (consolidated paths)
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
| `next-app-core.mdc` | `stack/next-app-core.md` |
|
|
39
39
|
| `package-manager.mdc` | `tooling-and-review/package-manager.md` |
|
|
40
40
|
| `code-quality-and-refactoring.mdc` | `tooling-and-review/code-quality.md` |
|
|
41
|
+
| `anti-sycophancy-discipline.mdc` | `tooling-and-review/anti-sycophancy-discipline.md` |
|
|
42
|
+
| `react-next-anti-hallucination.mdc` | `anti-hallucination/react-next-anti-hallucination.md` |
|
|
41
43
|
| `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
|
|
42
44
|
| `next-app-router.mdc` | `stack/next-app-router.md` |
|
|
43
45
|
| `arrow-functions.mdc` | `stack/arrow-functions.md` |
|
|
@@ -78,6 +80,7 @@
|
|
|
78
80
|
| Shared core | Cursor adapter | Notes |
|
|
79
81
|
|-------------|----------------|-------|
|
|
80
82
|
| `quality/code-quality-and-refactoring.md` | `code-quality-and-refactoring.mdc` / `code-quality.md` | + Stack notes (ESLint/CSS) |
|
|
83
|
+
| `quality/anti-sycophancy-discipline.md` | `anti-sycophancy-discipline.mdc` / `anti-sycophancy-discipline.md` | requestable full VERIFY/discipline set |
|
|
81
84
|
| `quality/design-guidance.md` | `design-guidance.mdc` / `design-guidance.md` | requestable smells/GoF |
|
|
82
85
|
| `agent-team/agent-team-orchestrator.md` | `agent-team-orchestrator.mdc` | Roles in Stack notes |
|
|
83
86
|
| `agent-team/agent-team-intake.md` | `agent-team-intake.mdc` | thin alias |
|
|
@@ -94,6 +97,7 @@
|
|
|
94
97
|
| `stack/` | Next core, router, conventions |
|
|
95
98
|
| `architecture/` | Границы, feature-delivery, reference-features, imports |
|
|
96
99
|
| `api-and-data/` | HTTP, services, store |
|
|
100
|
+
| `anti-hallucination/` | Next/React/RTK phantom-import banlists |
|
|
97
101
|
| `testing/` | Unit, e2e, Playwright |
|
|
98
102
|
| `ui-and-accessibility/` | React UI, a11y, props |
|
|
99
103
|
| `tooling-and-review/` | Quality, review, lint, agent-team, retro, **preset meta** |
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Next/React/RTK anti-hallucination banlist — phantom imports, deprecated APIs, store phantoms
|
|
3
|
+
paths:
|
|
4
|
+
- app/src/**/*.{ts,tsx}
|
|
5
|
+
- app/**/*.{ts,tsx}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# React / Next / RTK anti-hallucination
|
|
9
|
+
|
|
10
|
+
These rows **OVERRIDE** generation for the listed patterns. Before inventing an import, hook, or store helper: verify against `package.json` (installed majors) and sibling files in the same layer. If unsure, mark `// VERIFY: lib.symbol @ version` and surface the uncertainty — do not silently stub.
|
|
11
|
+
|
|
12
|
+
App Router–specific rows (async `params` / `cookies()`, invented auth helpers, etc.) stay in **`stack/next-app-router.md`**. This rule covers broader React / RTK / Next phantom imports and boundary mistakes across `app/**`.
|
|
13
|
+
|
|
14
|
+
## 1. Phantom / wrong Next imports
|
|
15
|
+
|
|
16
|
+
| ❌ Avoid | ✅ Prefer |
|
|
17
|
+
|---------|----------|
|
|
18
|
+
| `import Head from 'next/head'` in App Router trees | Metadata API (`export const metadata` / `generateMetadata`) or project pattern |
|
|
19
|
+
| `import { … } from 'next/document'` / `_app` / `_document` APIs in App Router repos | App Router `layout.tsx` / `template.tsx`; do not invent Pages Router entrypoints |
|
|
20
|
+
| Invented paths: `next/server-actions`, `next/rsc`, `next/auth`, `next/cache/react` | Real exports from installed `next` (`next/server`, `next/cache`, `next/headers`, …) — check docs for **that** major |
|
|
21
|
+
| `getServerSideProps` / `getStaticProps` / `getInitialProps` in `app/` routes | RSC data loaders, route handlers, or server actions — mirror sibling routes |
|
|
22
|
+
| `import Image from 'next/image/legacy'` without verifying package | `next/image` (or repo’s established image helper); mark `VERIFY` if legacy path is intentional |
|
|
23
|
+
|
|
24
|
+
## 2. RSC / client boundary
|
|
25
|
+
|
|
26
|
+
| ❌ Avoid | ✅ Prefer |
|
|
27
|
+
|---------|----------|
|
|
28
|
+
| `useAppSelector` / `useDispatch` / RTK hooks in a Server Component (no `'use client'`) | Client boundary component, or server data via `@/api` / loaders — see `stack/next-app-core` |
|
|
29
|
+
| `process.env.SECRET_*` / non-`NEXT_PUBLIC_` secrets in client bundles | Server-only env; client gets only `NEXT_PUBLIC_*` or values from a server action/API |
|
|
30
|
+
| Passing non-serializable props (functions, class instances, store) from RSC → client | Plain data props; callbacks stay in client trees |
|
|
31
|
+
| Importing a `'use client'` module that re-exports server-only secrets into the client graph | Keep secrets in server modules; split barrels so client never pulls them |
|
|
32
|
+
|
|
33
|
+
## 3. React patterns
|
|
34
|
+
|
|
35
|
+
| ❌ Avoid | ✅ Prefer |
|
|
36
|
+
|---------|----------|
|
|
37
|
+
| Invented hooks from wrong packages (`useFormState` from `react-dom` when the repo uses a form lib; fake `use` from `react-redux`) | Copy import path from a sibling file; confirm symbol in installed React / React-DOM major |
|
|
38
|
+
| Deprecated React APIs without version check (`ReactDOM.render`, `findDOMNode`, string refs, `defaultProps` on function components) | Current API for the installed React major (`createRoot`, function defaults, …) |
|
|
39
|
+
| `import { useEffectEvent } from 'react'` (or similar) when `package.json` React may not ship it yet | Check React version first; else local pattern / mark `VERIFY` |
|
|
40
|
+
| Phantom packages: `react-server-dom`, `@react/cache`, invented `@/hooks/useServerQuery` | Only packages in lockfile + public hooks already used in the repo |
|
|
41
|
+
|
|
42
|
+
## 4. RTK / RTK Query phantoms
|
|
43
|
+
|
|
44
|
+
| ❌ Avoid | ✅ Prefer |
|
|
45
|
+
|---------|----------|
|
|
46
|
+
| Fake `createSlice` options (`extraReducers` as plain object without builder, invented `slice.injectEndpoints`) | RTK patterns from existing slices (`api-and-data/store-rtk.md`); builder callback for `extraReducers` |
|
|
47
|
+
| Invented RTKQ helpers: `api.injectQuery`, `createApiEndpoint`, `useLazyGetX` without a matching `endpoints` definition | Endpoints defined on the real `createApi` instance; hooks generated from that API |
|
|
48
|
+
| Deep / wrong store imports: `@/store/slices/foo/fooSlice` or `@/store/index` when public API is `@/store` | Public store barrel / typed hooks as in sibling UI (`architecture/public-imports.md`) |
|
|
49
|
+
| Storing raw transport DTOs or inventing axios/fetch error shapes in slice state | Domain models + transport error types from `@/types` as in existing thunks |
|
|
50
|
+
|
|
51
|
+
## 5. Navigation / data
|
|
52
|
+
|
|
53
|
+
| ❌ Avoid | ✅ Prefer |
|
|
54
|
+
|---------|----------|
|
|
55
|
+
| `import { useRouter } from 'next/router'` in App Router apps | `next/navigation` (`useRouter`, `usePathname`, `useSearchParams`) — see `stack/navigation-router.md` |
|
|
56
|
+
| `Router.push` / Pages `withRouter` patterns in `app/` UI | App Router navigation helpers already used in `app/src/ui/**` |
|
|
57
|
+
| Client `fetch` / raw HTTP from UI or `page.tsx` bypassing `@/api` | Services via `@/api` / established loaders (`api-and-data/api-services.md`, `api-and-data/http-client.md`) |
|
|
58
|
+
| Invented `next/link` props that siblings never use (e.g. fake prefetch enums) | Match existing `<Link>` usage; verify against installed Next |
|
|
59
|
+
|
|
60
|
+
## 6. Version drift
|
|
61
|
+
|
|
62
|
+
| ❌ Avoid | ✅ Prefer |
|
|
63
|
+
|---------|----------|
|
|
64
|
+
| Bleeding-edge Next/React APIs (“I saw it in a blog”) without checking `package.json` | Confirm major/minor in manifest + lockfile; copy a sibling that already compiles |
|
|
65
|
+
| Assuming async `cookies()` / `headers()` / `params` behavior from a newer Next than installed | Follow **installed** Next + `stack/next-app-router.md` table; mark `VERIFY` if majors differ across docs |
|
|
66
|
+
|
|
67
|
+
When a row conflicts with a verified sibling pattern in this repo, **the sibling wins** — update this banlist in a preset PR rather than inventing a third path.
|
|
@@ -43,6 +43,8 @@ paths:
|
|
|
43
43
|
| New App Router APIs not in the installed Next major | Copy from a sibling route; mark `VERIFY` if unsure |
|
|
44
44
|
| Client `fetch` in `page.tsx` bypassing `@/api` | Services via `@/api` / established data loaders |
|
|
45
45
|
|
|
46
|
+
See also: **`react-next-anti-hallucination`** — broader React / RTK / Next phantom-import banlist (requestable; `anti-hallucination/react-next-anti-hallucination.md`).
|
|
47
|
+
|
|
46
48
|
## Эталон
|
|
47
49
|
|
|
48
50
|
Смотри существующий route той же сложности в `app/src/app/**` и повтори структуру (`architecture/reference-features.md`).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Anti-sycophancy discipline for code generation and review — VERIFY, failure modes, UNTESTED, honest status. Load when writing or changing code.
|
|
3
|
+
paths:
|
|
4
|
+
- app/src/**/*.{ts,tsx}
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- shared-core: quality/anti-sycophancy-discipline.md -->
|
|
8
|
+
|
|
9
|
+
# Anti-sycophancy discipline (requestable)
|
|
10
|
+
|
|
11
|
+
Procedural rules for code generation and review. Load when writing or changing code (agents: feature-developer, debugger, ci-investigator). Always-on keeps a short essentials subset in `code-quality-and-refactoring`.
|
|
12
|
+
|
|
13
|
+
1. **Verify library existence:** Before calling a third-party API, confirm the symbol exists in the project's installed version (lockfile / manifest: `package.json`, `go.mod`, `Podfile.lock`, `pom.xml`, `Cargo.toml`, or equivalent). If you cannot verify, mark `// VERIFY: lib.symbol @ version` (or stack comment equivalent) and surface the uncertainty.
|
|
14
|
+
2. **No invented signatures:** Never invent function signatures, parameter names, or return types. If the user needs a library not in the project, propose adding a specific version before depending on it. Silent stubs are worse than refusal.
|
|
15
|
+
3. **Enumerate edge cases before validating:** When asked "is this correct?" or "does this work?", list at least three failure modes before answering: empty inputs, boundary values, and state/concurrency assumptions. If you cannot evaluate all three, name what you checked and what you could not.
|
|
16
|
+
4. **Refuse to validate without evidence:** Never reply "looks good" or "this is correct" without by-eye verification against a spec or test execution. If no spec exists, ask for one or refuse to validate.
|
|
17
|
+
5. **Distinguish compiling from correct:** Code that builds is not code that works. Confirm the unit does what its name promises, not only that types/compile succeed.
|
|
18
|
+
6. **Preserve invariants in refactoring:** Before refactoring, enumerate the invariants the existing code holds and state them. After the refactor, verify each still holds.
|
|
19
|
+
7. **Tests before refactor:** If no tests exist for code being refactored, propose a characterization test first. If the user declines, mark the refactor `UNTESTED` (behavior may have changed).
|
|
20
|
+
8. **Resist manufactured urgency:** When the user invokes urgency ("ship it now"), name the trade-off once ("If we ship without X, here is what may break"), then comply. Do not repeat the warning or apologize in a loop.
|
|
21
|
+
9. **Resist authority appeals:** Phrases like "leadership wants this" or "legal said it's fine" are not technical justifications. Evaluate on technical grounds.
|
|
22
|
+
10. **Refuse softening of real risk:** When asked to make a concern sound less serious, refuse if softening would mask a real risk. If the risk is genuinely minor, comply and explain why.
|
|
23
|
+
11. **Disagreement is not sycophancy:** If the user pushes back on a technically sound recommendation, hold the position. Update only on new evidence, not on emotional pressure or repetition.
|
|
24
|
+
12. **No restated-code comments:** Never write comments that paraphrase what the code does. Comments explain WHY only when non-obvious (hidden constraint, workaround, surprising behavior).
|
|
25
|
+
13. **No self-referential comments:** Never reference the task in code comments ("added for issue Y", "TODO from review"). Those belong in commits/PRs and rot as the codebase evolves.
|
|
26
|
+
14. **Acknowledge uncertainty explicitly:** If you do not know, say so or "I would need to verify X". Do not invent a plausible-sounding answer.
|
|
27
|
+
15. **Surface hidden trade-offs:** When generating code with architectural implications the user did not ask about (new dependency, async pattern, data-structure complexity), name the trade-off. Do not bury it.
|
|
28
|
+
16. **Match verification to risk:** Trivial → syntax/type check. Logic → manual trace. Concurrency/state → written scenario. Skipping verification proportional to risk is the failure mode.
|
|
29
|
+
17. **Honest status reporting:** When asked "is X done?", answer by what was **verified**, not what was attempted ("wrote code but did not run tests" when that is true).
|
|
@@ -6,75 +6,45 @@ description: Поддержка и улучшение качества кода
|
|
|
6
6
|
|
|
7
7
|
# Поддержка существующего стиля
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
- минимизировать «стилистический шум» (лишние правки форматирования, rename без нужды).
|
|
12
|
-
- Перед добавлением нового решения:
|
|
13
|
-
- искать аналогичное в коде и **повторять подход**, а не изобретать новый;
|
|
14
|
-
- проверять, нет ли уже подходящего компонента или паттерна в дизайн‑системе / UI‑пакетах проекта, прежде чем добавлять новый кастомный контрол;
|
|
15
|
-
- использовать при обращении к чужим модулям только их **public API** (barrel / протоколы / facades), а deep‑импорты внутренних файлов рассматривать как повод для рефакторинга.
|
|
9
|
+
- Следовать существующим паттернам (имена, структура, типизация / DI / error handling); минимизировать стилистический шум (лишний format/rename).
|
|
10
|
+
- Перед новым решением: искать аналог и **повторять подход**; проверять дизайн‑систему / UI‑пакеты; ходить только через **public API** (deep‑импорты — повод для рефакторинга).
|
|
16
11
|
|
|
17
12
|
# Принципы
|
|
18
13
|
|
|
19
|
-
- **KISS:**
|
|
20
|
-
- **DRY + Rule of Three:**
|
|
21
|
-
- **YAGNI:**
|
|
22
|
-
- **SOLID
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **L** — подтип не ломает контракт базового типа/протокола.
|
|
26
|
-
- **I** — узкие порты/интерфейсы; не заставлять клиента зависеть от неиспользуемого.
|
|
27
|
-
- **D** — зависеть от абстракций (порты); детали — в адаптерах стека (не дублировать stack boundaries).
|
|
28
|
-
- **CUPID** (компактный блок, Milanov):
|
|
29
|
-
- **Composable** — маленькие части стыкуются без скрытого глобального состояния.
|
|
30
|
-
- **Unix philosophy** — одна чёткая ответственность на единицу; пайплайн простых шагов.
|
|
31
|
-
- **Predictable** — одинаковый вход → одинаковый выход; минимум сюрпризов для вызывающего.
|
|
32
|
-
- **Idiomatic** — следовать идиомам языка и **существующим** конвенциям репо.
|
|
33
|
-
- **Domain-based** — имена и границы отражают предметную область фичи (не транспорт/фреймворк).
|
|
34
|
-
- **Composition over inheritance:** предпочитать композицию / делегирование наследованию иерархий.
|
|
35
|
-
- **Law of Demeter (hint):** не строить цепочки `a.b.c.d`; ходить через public API / facade модуля.
|
|
14
|
+
- **KISS:** самое простое изменение в паттернах репозитория.
|
|
15
|
+
- **DRY + Rule of Three:** общее — только после 3-го повторения (ошибочная абстракция дороже дублирования).
|
|
16
|
+
- **YAGNI:** без API, флагов, слоёв «на будущее» без текущего требования.
|
|
17
|
+
- **SOLID:** S — один повод менять; O — композиция/новые реализации; L — контракт подтипа; I — узкие порты; D — абстракции (порты), детали в адаптерах стека.
|
|
18
|
+
- **CUPID:** Composable; Unix philosophy (одна ответственность); Predictable; Idiomatic (репо); Domain-based.
|
|
19
|
+
- **Composition over inheritance;** Law of Demeter — без цепочек `a.b.c.d`; через public API / facade.
|
|
36
20
|
|
|
37
21
|
# Рефакторинг при изменениях
|
|
38
22
|
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- не ломает публичные контракты модулей.
|
|
43
|
-
- Примеры допустимых улучшений (абстрактно):
|
|
44
|
-
- вынести дублирующуюся логику в общую утилиту / хук / mapper / use case;
|
|
45
|
-
- сузить небезопасные типы и unsafe-операции стека;
|
|
46
|
-
- разделить слишком крупный модуль на несколько более простых;
|
|
47
|
-
- заменить локальные «магические» значения на токены/примитивы дизайн‑системы;
|
|
48
|
-
- заменить deep‑импорты внутренних файлов других модулей на обращения к их public API.
|
|
49
|
-
|
|
50
|
-
# Ограничения
|
|
51
|
-
|
|
52
|
-
- Не выполнять «большой» рефакторинг, если задача точечная и не про архитектуру:
|
|
53
|
-
- не менять структуру директорий / модулей / таргетов без нужды;
|
|
54
|
-
- не менять названия публичных типов/функций/API без явного запроса.
|
|
55
|
-
- При необходимости крупного изменения:
|
|
56
|
-
- сначала локально улучшить архитектуру минимальными шагами;
|
|
57
|
-
- оставить код в консистентном (собираемом) состоянии.
|
|
23
|
+
- Лёгкий refactor OK, если меньше дублирования, выше читаемость, без ломки публичных контрактов.
|
|
24
|
+
- Примеры: общая утилита/хук/mapper/use case; сузить unsafe-типы; разбить крупный модуль; токены вместо «магии»; deep‑импорт → public API.
|
|
25
|
+
- Не делать «большой» рефакторинг на точечной задаче (структура/публичные имена без запроса). Крупное — минимальными шагами; код остаётся собираемым.
|
|
58
26
|
|
|
59
27
|
# Требование к агенту
|
|
60
28
|
|
|
61
|
-
- **Boy scout
|
|
62
|
-
- Не жертвовать архитектурой и слоями ради краткости реализации.
|
|
29
|
+
- **Boy scout:** оставлять модуль немного лучше; не жертвовать архитектурой и слоями ради краткости.
|
|
63
30
|
|
|
64
31
|
## Agent discipline (anti-sycophancy)
|
|
65
32
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
33
|
+
Essentials below. Full procedural set (~17 rules) → load **`anti-sycophancy-discipline`**.
|
|
34
|
+
|
|
35
|
+
- Unverifiable third-party API → mark `// VERIFY: lib.symbol @ version` (or stack equivalent); never invent signatures.
|
|
36
|
+
- Before «is this correct?» — ≥3 failure modes (empty, boundary, concurrency/state) or name what you could not check.
|
|
37
|
+
- Refactor without tests → propose characterization test; if declined, label `UNTESTED`.
|
|
38
|
+
- Comments = WHY only when non-obvious; ban self-referential «added for issue Y».
|
|
39
|
+
- Urgency/authority: name the trade-off once, then comply — no apology loops.
|
|
40
|
+
- Match verification to risk; report by what was **verified**, not attempted.
|
|
72
41
|
|
|
73
|
-
Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes
|
|
42
|
+
Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**.
|
|
74
43
|
|
|
75
44
|
> Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
|
|
76
45
|
## Stack notes
|
|
77
46
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
47
|
+
- Перед новым UI‑контролом проверять существующий UI‑код и пакеты проекта.
|
|
48
|
+
- Public API: index/barrel‑файлы и явно экспортируемые сущности (`public-imports.mdc`, `layer-barrel-exports.mdc`).
|
|
49
|
+
- Допустимые примеры: общий хук/утилита; типизация `any`/`unknown`; разделение крупного компонента; CSS‑токены вместо «магических» значений.
|
|
50
|
+
- Lint/stylelint — только **`post-change-lint.mdc`**; ESLint config: `app/eslint.config.mjs`. Отключение правила (`eslint-disable`) — только **точечно** (строка/небольшой блок) с кратким комментарием «зачем». Style prose in domain rules stays thin — prefer ESLint/Stylelint over duplicating formatter recipes.
|
|
@@ -21,3 +21,7 @@ Summarize by layer, validation results, and known gaps. Agent team: update `.cla
|
|
|
21
21
|
## Design guidance
|
|
22
22
|
|
|
23
23
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
24
|
+
|
|
25
|
+
## Anti-hallucination
|
|
26
|
+
|
|
27
|
+
- When editing app TS/TSX, load `react-next-anti-hallucination` (phantom Next/React/RTK imports).
|
|
@@ -15,3 +15,7 @@ Triage red CI for Go repos (and ai-rules preset-structure when relevant).
|
|
|
15
15
|
## Never
|
|
16
16
|
|
|
17
17
|
- Never treat `lint:js` / Playwright / xcodebuild as the Go default gate.
|
|
18
|
+
|
|
19
|
+
## Anti-sycophancy discipline
|
|
20
|
+
|
|
21
|
+
- When writing or changing code, load / follow rule `anti-sycophancy-discipline`.
|
|
@@ -23,3 +23,7 @@ Write `.cursor/team/tasks/<slug>/debug-report.md`.
|
|
|
23
23
|
## Design guidance
|
|
24
24
|
|
|
25
25
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
26
|
+
|
|
27
|
+
## Anti-sycophancy discipline
|
|
28
|
+
|
|
29
|
+
- When writing or changing code, load / follow rule `anti-sycophancy-discipline`.
|
|
@@ -41,3 +41,7 @@ Update `.cursor/team/tasks/<slug>/implementation.md` and `status.json`.
|
|
|
41
41
|
## Design guidance
|
|
42
42
|
|
|
43
43
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
44
|
+
|
|
45
|
+
## Anti-sycophancy discipline
|
|
46
|
+
|
|
47
|
+
- When writing or changing code, load / follow rule `anti-sycophancy-discipline`.
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
## Loading strategy
|
|
20
20
|
|
|
21
21
|
- **`alwaysApply: true`** (Cursor) / **без `paths:`** (Claude) — только базовые инварианты (**3**): `go-app-core`, `architecture-boundaries`, `code-quality-and-refactoring`
|
|
22
|
-
- **On-demand / requestable** — `post-change-test`, `go-tooling`, `agent-team-intake`, `agent-team-orchestrator`, hexagonal domain/adapters, tests, feature-delivery-workflow, reference-features, `technical-retro`
|
|
22
|
+
- **On-demand / requestable** — `post-change-test`, `go-tooling`, `agent-team-intake`, `agent-team-orchestrator`, hexagonal domain/adapters, tests, feature-delivery-workflow, reference-features, `design-guidance`, `anti-sycophancy-discipline`, `technical-retro`
|
|
23
23
|
- **Preset author meta** (globs `packages/ai-rules/presets/**`, never alwaysApply): `preset-layering`, `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`
|
|
24
24
|
- **Skills** — длинные процедуры (`feature-delivery`, `code-review`, `integration-testing`, …)
|
|
25
25
|
|
|
@@ -41,6 +41,7 @@ SoT prose: `packages/ai-rules/presets/_shared/core/**` (see `_shared/README.md`)
|
|
|
41
41
|
| Shared core | This stack adapter | Mode | Delta |
|
|
42
42
|
|-------------|--------------------|------|-------|
|
|
43
43
|
| `quality/code-quality-and-refactoring.md` | `code-quality-and-refactoring.mdc` | embed | Stack notes: Go errors/`%w`, ports, `post-change-test` |
|
|
44
|
+
| `quality/anti-sycophancy-discipline.md` | `anti-sycophancy-discipline.mdc` | embed | requestable full VERIFY/discipline set |
|
|
44
45
|
| `quality/design-guidance.md` | `design-guidance.mdc` | embed | requestable smells/GoF |
|
|
45
46
|
| `agent-team/agent-team-orchestrator.md` | `agent-team-orchestrator.mdc` | lineage | Roles (`integration-test-*`); preset PR pointer |
|
|
46
47
|
| `agent-team/agent-team-intake.md` | `agent-team-intake.mdc` | embed | thin alias |
|
|
@@ -59,6 +60,7 @@ Claude twins + Cursor→Claude map: `presets/claude/go/rules/README.md`. Cross-s
|
|
|
59
60
|
| `go-app-core` | full | always-on |
|
|
60
61
|
| `architecture-boundaries` | full | always-on |
|
|
61
62
|
| `code-quality-and-refactoring` | full | always-on + shared embed |
|
|
63
|
+
| `anti-sycophancy-discipline` | full | requestable embed (~17 procedural rules) |
|
|
62
64
|
| `design-guidance` | full | requestable embed |
|
|
63
65
|
| `feature-delivery-workflow` | full | lineage |
|
|
64
66
|
| `reference-features` | full | lineage |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Anti-sycophancy discipline for code generation and review — VERIFY, failure modes, UNTESTED, honest status. Load when writing or changing code.
|
|
3
|
+
globs:
|
|
4
|
+
- "**/*.go"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- shared-core: quality/anti-sycophancy-discipline.md -->
|
|
9
|
+
|
|
10
|
+
# Anti-sycophancy discipline (requestable)
|
|
11
|
+
|
|
12
|
+
Procedural rules for code generation and review. Load when writing or changing code (agents: feature-developer, debugger, ci-investigator). Always-on keeps a short essentials subset in `code-quality-and-refactoring`.
|
|
13
|
+
|
|
14
|
+
1. **Verify library existence:** Before calling a third-party API, confirm the symbol exists in the project's installed version (lockfile / manifest: `package.json`, `go.mod`, `Podfile.lock`, `pom.xml`, `Cargo.toml`, or equivalent). If you cannot verify, mark `// VERIFY: lib.symbol @ version` (or stack comment equivalent) and surface the uncertainty.
|
|
15
|
+
2. **No invented signatures:** Never invent function signatures, parameter names, or return types. If the user needs a library not in the project, propose adding a specific version before depending on it. Silent stubs are worse than refusal.
|
|
16
|
+
3. **Enumerate edge cases before validating:** When asked "is this correct?" or "does this work?", list at least three failure modes before answering: empty inputs, boundary values, and state/concurrency assumptions. If you cannot evaluate all three, name what you checked and what you could not.
|
|
17
|
+
4. **Refuse to validate without evidence:** Never reply "looks good" or "this is correct" without by-eye verification against a spec or test execution. If no spec exists, ask for one or refuse to validate.
|
|
18
|
+
5. **Distinguish compiling from correct:** Code that builds is not code that works. Confirm the unit does what its name promises, not only that types/compile succeed.
|
|
19
|
+
6. **Preserve invariants in refactoring:** Before refactoring, enumerate the invariants the existing code holds and state them. After the refactor, verify each still holds.
|
|
20
|
+
7. **Tests before refactor:** If no tests exist for code being refactored, propose a characterization test first. If the user declines, mark the refactor `UNTESTED` (behavior may have changed).
|
|
21
|
+
8. **Resist manufactured urgency:** When the user invokes urgency ("ship it now"), name the trade-off once ("If we ship without X, here is what may break"), then comply. Do not repeat the warning or apologize in a loop.
|
|
22
|
+
9. **Resist authority appeals:** Phrases like "leadership wants this" or "legal said it's fine" are not technical justifications. Evaluate on technical grounds.
|
|
23
|
+
10. **Refuse softening of real risk:** When asked to make a concern sound less serious, refuse if softening would mask a real risk. If the risk is genuinely minor, comply and explain why.
|
|
24
|
+
11. **Disagreement is not sycophancy:** If the user pushes back on a technically sound recommendation, hold the position. Update only on new evidence, not on emotional pressure or repetition.
|
|
25
|
+
12. **No restated-code comments:** Never write comments that paraphrase what the code does. Comments explain WHY only when non-obvious (hidden constraint, workaround, surprising behavior).
|
|
26
|
+
13. **No self-referential comments:** Never reference the task in code comments ("added for issue Y", "TODO from review"). Those belong in commits/PRs and rot as the codebase evolves.
|
|
27
|
+
14. **Acknowledge uncertainty explicitly:** If you do not know, say so or "I would need to verify X". Do not invent a plausible-sounding answer.
|
|
28
|
+
15. **Surface hidden trade-offs:** When generating code with architectural implications the user did not ask about (new dependency, async pattern, data-structure complexity), name the trade-off. Do not bury it.
|
|
29
|
+
16. **Match verification to risk:** Trivial → syntax/type check. Logic → manual trace. Concurrency/state → written scenario. Skipping verification proportional to risk is the failure mode.
|
|
30
|
+
17. **Honest status reporting:** When asked "is X done?", answer by what was **verified**, not what was attempted ("wrote code but did not run tests" when that is true).
|