@ai.all/ds7 1.0.0 → 2.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/01-architecture/ATOMIC-DESIGN.md +48 -42
- package/01-architecture/COMPONENT-ANATOMY.md +14 -30
- package/01-architecture/MODIFIER-SYSTEM.md +24 -35
- package/02-design-system/BRANDBOOK-SANDBOX.md +34 -34
- package/02-design-system/NAMING-CONVENTIONS.md +21 -19
- package/02-design-system/TOKENS-SPEC.md +65 -51
- package/03-performance-web-vitals/ASSETS-PIPELINE.md +40 -49
- package/03-performance-web-vitals/CRITICAL-CSS.md +20 -27
- package/03-performance-web-vitals/FONTS-ZERO-CLS.md +30 -34
- package/03-performance-web-vitals/HYDRATION-STRATEGY.md +38 -21
- package/04-seo-ai-optimization/AEO-GEO-AI-SEARCH.md +28 -45
- package/04-seo-ai-optimization/GOOGLE-LOCAL-EEAT.md +20 -25
- package/04-seo-ai-optimization/STRUCTURED-DATA.md +42 -37
- package/05-internationalization/I18N-ARCHITECTURE.md +27 -25
- package/05-internationalization/LOCALE-TEMPLATE.json +23 -22
- package/06-business-conversion/B2C-B2B-MODELS.md +22 -21
- package/06-business-conversion/CONTEXTUAL-LEADS.md +17 -22
- package/06-business-conversion/EV-SOLAR-ECOSYSTEM.md +21 -21
- package/07-testing/TESTING-STRATEGY.md +45 -83
- package/08-token-optimization/TOKEN-STRATEGY.md +54 -103
- package/ALL.md +203 -52
- package/CHANGELOG.md +27 -0
- package/README.md +92 -97
- package/SPEC.md +81 -37
- package/bin/ds7.js +183 -100
- package/package.json +10 -11
- package/templates/component.vue +10 -16
- package/templates/nuxt.config.ts +19 -25
- package/templates/theme.css +17 -10
- package/ANDALUSIA.md +0 -89
- package/ff.md +0 -112
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
# 06
|
|
1
|
+
# 06 · Electric vehicles and solar (example)
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Example from a Spanish solar company. Product names, subsidy programmes and amounts are examples. Verify them before use.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
## 1.
|
|
7
|
+
## 1. Charging from surplus solar
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
A home charger connected to the inverter over the local network can direct surplus solar power to the car. A household that uses 1 kW while the panels make 5 kW sends the remaining 4 kW to the car.
|
|
10
|
+
|
|
11
|
+
**Benefit for the customer:** the car charges from solar energy that would otherwise go to the grid.
|
|
12
|
+
|
|
13
|
+
Check the compatible inverter brands before you promise this.
|
|
12
14
|
|
|
13
15
|
---
|
|
14
16
|
|
|
15
|
-
## 2.
|
|
17
|
+
## 2. Show the benefit in terms people use
|
|
18
|
+
|
|
19
|
+
Technical units (kW, amperes, volts) are hard to compare. Show the result in distance or money:
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
- "Six panels on the roof give about 45 km of driving per day."
|
|
22
|
+
- "Compared with petrol, the monthly saving can exceed [amount calculated for this customer]."
|
|
23
|
+
|
|
24
|
+
State the assumptions next to the figure.
|
|
21
25
|
|
|
22
26
|
---
|
|
23
27
|
|
|
24
|
-
## 3.
|
|
28
|
+
## 3. Vehicle-to-home (V2H)
|
|
29
|
+
|
|
30
|
+
A typical home battery stores about 5 kWh. A modern electric vehicle battery stores several times more. With V2H, the car supplies the home in the evening peak or during a grid outage, if the charger and the car support it.
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
* Батарея современного электромобиля — **60–80 кВт·ч** (в 12–15 раз больше!).
|
|
28
|
-
* Технология V2H позволяет использовать емкость электромобиля для питания дома в вечерние часы пиковых тарифов или при аварийных отключениях электросети.
|
|
32
|
+
Say which models support V2H. Do not offer it to a customer whose hardware does not.
|
|
29
33
|
|
|
30
34
|
---
|
|
31
35
|
|
|
32
|
-
## 4.
|
|
36
|
+
## 4. Subsidies
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
* В карточках товаров V2C всегда выводятся две цены:
|
|
36
|
-
* Базовая цена оборудования;
|
|
37
|
-
* **Финальная цена после субсидии Plan MOVES III** (`782 € → 234 €`).
|
|
38
|
-
* Это снимает ценовые возражения и стимулирует покупку комплекта «Панели + Зарядка».
|
|
38
|
+
Public programmes can cover part of the charger and installation cost. In the example company's catalogue, each product shows two prices: the equipment price and the price after the programme's share. Show both, with the programme name and the source.
|
|
@@ -1,133 +1,95 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 07 · Testing strategy
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> Полный прогон — только перед PR/деплоем. Ежедневная разработка — точечные проверки.
|
|
3
|
+
Run the smallest test that proves the change. Run the full suite once before a commit that finishes a task.
|
|
5
4
|
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
##
|
|
7
|
+
## 1. Layers, fastest first
|
|
9
8
|
|
|
10
9
|
```
|
|
11
|
-
1. Unit (domain logic)
|
|
12
|
-
2. Composable (Vue
|
|
13
|
-
3. Component (Vue
|
|
14
|
-
4.
|
|
10
|
+
1. Unit (domain logic) ~10 ms per test run when logic changes
|
|
11
|
+
2. Composable (Vue reactivity) ~50 ms per test run when a composable changes
|
|
12
|
+
3. Component (Vue Test Utils) ~200 ms per test run when a component changes
|
|
13
|
+
4. End-to-end (Playwright) ~5 s per flow key paths, before release
|
|
15
14
|
```
|
|
16
15
|
|
|
16
|
+
Accessibility checks (axe) run on every page at 390, 820 and 1440 px as part of the quality gates.
|
|
17
|
+
|
|
17
18
|
---
|
|
18
19
|
|
|
19
|
-
##
|
|
20
|
+
## 2. Tools
|
|
20
21
|
|
|
21
|
-
|
|
|
22
|
+
| Tool | Use |
|
|
22
23
|
|---|---|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
24
|
+
| Vitest | unit, composable and component tests |
|
|
25
|
+
| `@vue/test-utils` | mounting components without a browser |
|
|
26
|
+
| Playwright | flows (calculator, contact, 404) and screenshots for review |
|
|
27
|
+
| axe-core | accessibility rules, through Playwright |
|
|
26
28
|
|
|
27
29
|
---
|
|
28
30
|
|
|
29
|
-
##
|
|
31
|
+
## 3. Commands
|
|
30
32
|
|
|
31
33
|
```bash
|
|
32
|
-
#
|
|
33
|
-
npx vitest run
|
|
34
|
-
|
|
35
|
-
#
|
|
36
|
-
npx vitest run
|
|
37
|
-
|
|
38
|
-
# По имени теста
|
|
39
|
-
npx vitest run -t "savings calculator"
|
|
40
|
-
|
|
41
|
-
# Минимальный вывод (экономит токены в AI-диалоге)
|
|
42
|
-
npx vitest run --reporter=dot
|
|
43
|
-
|
|
44
|
-
# Полный suite — только перед коммитом
|
|
45
|
-
npx vitest run
|
|
46
|
-
|
|
47
|
-
# Watch (только при локальной разработке)
|
|
48
|
-
npx vitest --reporter=dot
|
|
34
|
+
npx vitest run path/to/file.test.ts # one file
|
|
35
|
+
npx vitest run path/to/folder/ # one folder
|
|
36
|
+
npx vitest run -t "savings" # by test name
|
|
37
|
+
npx vitest run --reporter=dot # short output
|
|
38
|
+
npx vitest run # full suite, before a finishing commit
|
|
49
39
|
```
|
|
50
40
|
|
|
51
41
|
---
|
|
52
42
|
|
|
53
|
-
##
|
|
43
|
+
## 4. Naming
|
|
54
44
|
|
|
55
|
-
```
|
|
56
|
-
//
|
|
57
|
-
it('calculates savings with 30% self-consumption
|
|
45
|
+
```ts
|
|
46
|
+
// good: what is tested and what is expected
|
|
47
|
+
it('calculates savings with 30% self-consumption', () => { … })
|
|
58
48
|
|
|
59
|
-
//
|
|
60
|
-
it('works', () => {
|
|
49
|
+
// poor: says nothing about what breaks
|
|
50
|
+
it('works', () => { … })
|
|
61
51
|
```
|
|
62
52
|
|
|
63
53
|
---
|
|
64
54
|
|
|
65
|
-
##
|
|
66
|
-
|
|
67
|
-
```typescript
|
|
68
|
-
// app/domain/calculators/residential.test.ts
|
|
55
|
+
## 5. Test file shape
|
|
69
56
|
|
|
57
|
+
```ts
|
|
70
58
|
import { describe, it, expect } from 'vitest'
|
|
71
59
|
import { calcSavings } from './residential'
|
|
72
60
|
|
|
73
|
-
// Self-contained: тест запускается изолированно без глобального setup
|
|
74
61
|
describe('calcSavings', () => {
|
|
75
62
|
it('returns zero savings for zero consumption', () => {
|
|
76
63
|
expect(calcSavings({ kwhMonth: 0, panelKw: 5, tariff: 0.18 })).toBe(0)
|
|
77
64
|
})
|
|
78
65
|
|
|
79
|
-
it('caps savings at
|
|
66
|
+
it('caps savings at the full bill', () => {
|
|
80
67
|
const r = calcSavings({ kwhMonth: 100, panelKw: 20, tariff: 0.18 })
|
|
81
68
|
expect(r.savingsPct).toBeLessThanOrEqual(100)
|
|
82
69
|
})
|
|
83
70
|
})
|
|
84
71
|
```
|
|
85
72
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
## Правила тестового покрытия
|
|
89
|
-
|
|
90
|
-
| Слой | Покрытие | Инструмент |
|
|
91
|
-
|---|---|---|
|
|
92
|
-
| `domain/calculators/` | **≥ 90%** | Vitest unit |
|
|
93
|
-
| `composables/` | **≥ 70%** | Vitest + @vue/test-utils |
|
|
94
|
-
| `components/ui/` | **критичные пути** | @vue/test-utils |
|
|
95
|
-
| `pages/` | **smoke только** | Playwright |
|
|
96
|
-
|
|
97
|
-
> **Не тестировать:** статичные данные (`app/data/`), CSS, переводы (i18n) — их не нужно юнит-тестировать.
|
|
73
|
+
Each test file runs alone, without a global setup that the test depends on.
|
|
98
74
|
|
|
99
75
|
---
|
|
100
76
|
|
|
101
|
-
##
|
|
77
|
+
## 6. Coverage expectations
|
|
102
78
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
79
|
+
| Layer | Expectation |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `domain/` | high; every branch of business rules |
|
|
82
|
+
| `composables/` | main paths and error paths |
|
|
83
|
+
| `components/ui/` | critical interactions only |
|
|
84
|
+
| `pages/` | smoke test: renders, has one `h1`, no console errors |
|
|
107
85
|
|
|
108
|
-
|
|
109
|
-
# Шаблон для AI-итерации (минимум токенов):
|
|
110
|
-
npx vitest run path/to/changed.test.ts --reporter=dot
|
|
111
|
-
```
|
|
86
|
+
Do not unit-test static data, copy or CSS. Copy is checked by the locale parity gate; CSS by the visual review in the sandbox.
|
|
112
87
|
|
|
113
88
|
---
|
|
114
89
|
|
|
115
|
-
##
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
export default defineConfig({
|
|
122
|
-
test: {
|
|
123
|
-
environment: 'jsdom',
|
|
124
|
-
include: ['**/*.test.ts'],
|
|
125
|
-
exclude: ['node_modules', 'ds7', 'dist'],
|
|
126
|
-
reporter: process.env.CI ? 'verbose' : 'dot', // dot = меньше вывода
|
|
127
|
-
coverage: {
|
|
128
|
-
include: ['app/domain/**', 'app/composables/**'],
|
|
129
|
-
reporter: ['text-summary'], // краткий отчёт, не таблицы
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
})
|
|
133
|
-
```
|
|
90
|
+
## 7. Token-efficient testing for agents
|
|
91
|
+
|
|
92
|
+
1. Before editing, know which test covers the file.
|
|
93
|
+
2. After editing, run that test with `--reporter=dot`.
|
|
94
|
+
3. Widen the scope only if shared logic changed.
|
|
95
|
+
4. Run the full suite once at the end of the task.
|
|
@@ -1,149 +1,100 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 08 · Token and context optimisation
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> не тратить токены на повторные чтения и полные прогоны тестов.
|
|
3
|
+
Goal: an agent reads what the task needs and nothing else, and does not repeat work.
|
|
5
4
|
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
##
|
|
7
|
+
## 1. Map before reading
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
Find the layer of the task first, then read only the files on its call chain:
|
|
11
10
|
|
|
12
11
|
```
|
|
13
|
-
|
|
12
|
+
task → layer → files of the layer → direct dependencies only
|
|
14
13
|
```
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Reading order, from general to specific:
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
7. app/pages/<p> ← только если страница затронута
|
|
26
|
-
```
|
|
17
|
+
1. `ds7/ALL.md` (standard rules), then the project section of the root `ALL.md`, below the AI-ALL packs block (project rules and decisions).
|
|
18
|
+
3. `docs/ARCHITECTURE.md` (layer map).
|
|
19
|
+
4. `app/data/<relevant>` if the task concerns data.
|
|
20
|
+
5. `app/domain/<module>` if the task changes business logic.
|
|
21
|
+
6. `app/composables/<name>` if a composable is involved.
|
|
22
|
+
7. `app/components/<name>` if a component is changed.
|
|
23
|
+
8. `app/pages/<name>` if a page is changed.
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
Do not read all of `app/components/` or all of `app/data/`.
|
|
29
26
|
|
|
30
27
|
---
|
|
31
28
|
|
|
32
|
-
## Project
|
|
29
|
+
## 2. Project graph
|
|
30
|
+
|
|
31
|
+
Keep a short graph in `docs/ARCHITECTURE.md`, one line per dependency, so the agent can find callers without searching:
|
|
33
32
|
|
|
34
33
|
```
|
|
35
|
-
pages/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
[slug].vue → DirectionPage → ExtraSections
|
|
39
|
-
|
|
40
|
-
domain/
|
|
41
|
-
calculators/
|
|
42
|
-
residential.ts → useCalcLink (composable)
|
|
43
|
-
ev.ts → useCalcLink, defaults.ts
|
|
44
|
-
|
|
45
|
-
composables/
|
|
46
|
-
usePageSeo.ts → useHead (nuxt) — все страницы
|
|
47
|
-
useModal.ts → SiteModalHost — global
|
|
48
|
-
useShopUrl.ts → tienda.vue, UiShopProductCard
|
|
49
|
-
useSections.ts → [slug].vue, DirectionPage
|
|
50
|
-
|
|
51
|
-
data/
|
|
52
|
-
sections.ts → useSections → [slug].vue
|
|
53
|
-
seo.ts → usePageSeo → all pages
|
|
54
|
-
catalog.ts → UiProductCard, HomeEquipment
|
|
55
|
-
shop.ts → useShopList → tienda.vue
|
|
34
|
+
pages/index.vue → Hero, Systems, Equipment, Faq
|
|
35
|
+
composables/usePageSeo → useHead, all pages
|
|
36
|
+
data/catalog.ts → ProductCard, Equipment
|
|
56
37
|
```
|
|
57
38
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
## Скилы и инструменты для экономии контекста
|
|
61
|
-
|
|
62
|
-
| Скил / Команда | Когда использовать |
|
|
63
|
-
|---|---|
|
|
64
|
-
| `/compact` | Сессия стала длинной — сжать перед продолжением |
|
|
65
|
-
| `context-optimizer` skill | Длинная задача с многими файлами — читать summary |
|
|
66
|
-
| `documentation-lazy-load` skill | Нужна специфика API/библиотеки — не читать всё сразу |
|
|
67
|
-
| `incremental-coding` skill | Сфокусированное изменение — не делать рефактор вокруг |
|
|
68
|
-
| `session-handoff` skill | Смена сессии или модели — сохранить handoff |
|
|
69
|
-
| `token-auditor` skill | Анализ расхода токенов из ccusage |
|
|
70
|
-
| `targeted-testing` skill | Выбрать минимальный тест для изменения |
|
|
39
|
+
Update it when a dependency changes.
|
|
71
40
|
|
|
72
41
|
---
|
|
73
42
|
|
|
74
|
-
##
|
|
43
|
+
## 3. Working rules
|
|
75
44
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
3. Прочитай только файлы в call chain
|
|
81
|
-
4. НЕ читать весь app/components/ или весь app/data/
|
|
82
|
-
```
|
|
45
|
+
**Before the task**
|
|
46
|
+
1. Read `ds7/ALL.md` and the project section of the root `ALL.md`.
|
|
47
|
+
2. Find the layer in `docs/ARCHITECTURE.md`.
|
|
48
|
+
3. Read only the files on the call chain.
|
|
83
49
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
5.
|
|
87
|
-
6.
|
|
88
|
-
7. Используй --reporter=dot для минимального вывода
|
|
89
|
-
```
|
|
50
|
+
**During the task**
|
|
51
|
+
4. After each change, run one targeted test.
|
|
52
|
+
5. Do not start background processes unless needed.
|
|
53
|
+
6. Use `--reporter=dot` for short test output.
|
|
90
54
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
8.
|
|
94
|
-
9.
|
|
95
|
-
10. Коммит только документально подтверждённых изменений
|
|
96
|
-
```
|
|
55
|
+
**At the end**
|
|
56
|
+
7. Run the full suite once.
|
|
57
|
+
8. Record decisions in `docs/DECISIONS.md`, not in the chat.
|
|
58
|
+
9. Commit only what is verified.
|
|
97
59
|
|
|
98
60
|
---
|
|
99
61
|
|
|
100
|
-
## File
|
|
62
|
+
## 4. File summaries
|
|
101
63
|
|
|
102
|
-
|
|
64
|
+
Each non-trivial file starts with one or two lines describing it. An agent can read the first line to decide whether to open the file:
|
|
103
65
|
|
|
104
|
-
```
|
|
105
|
-
// Residential
|
|
106
|
-
// Input: monthly kWh, panel kW, tariff €/kWh. Output: SavingsResult.
|
|
107
|
-
export function calcSavings(params: CalcParams): SavingsResult { … }
|
|
66
|
+
```ts
|
|
67
|
+
// Residential savings calculator. Input: monthly kWh, panel kW, tariff €/kWh. Output: SavingsResult.
|
|
108
68
|
```
|
|
109
69
|
|
|
110
70
|
```vue
|
|
111
71
|
<!--
|
|
112
|
-
UiProductCard —
|
|
113
|
-
Modifiers: -top (
|
|
72
|
+
UiProductCard — product card molecule.
|
|
73
|
+
Modifiers: -top (highlight), -new (ribbon), -compact (slim).
|
|
114
74
|
-->
|
|
115
75
|
```
|
|
116
76
|
|
|
117
|
-
Это позволяет AI прочитать **1 строку** вместо всего файла при навигации.
|
|
118
|
-
|
|
119
77
|
---
|
|
120
78
|
|
|
121
|
-
##
|
|
79
|
+
## 5. Budget guide
|
|
122
80
|
|
|
123
|
-
|
|
|
81
|
+
| File | Reading strategy |
|
|
124
82
|
|---|---|
|
|
125
|
-
| `ALL.md` |
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `app/
|
|
129
|
-
| `app/
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
83
|
+
| `ds7/ALL.md` | whole file, always |
|
|
84
|
+
| Project section of root `ALL.md` | whole section, always |
|
|
85
|
+
| `docs/ARCHITECTURE.md` | the section that matches the layer |
|
|
86
|
+
| `app/data/*.ts` | only when the task concerns data |
|
|
87
|
+
| `app/domain/*.ts` | only when business logic changes |
|
|
88
|
+
| `app/components/ui/*.vue` | only the file being changed |
|
|
89
|
+
| `i18n/locales/*.ts` | only when keys are added |
|
|
90
|
+
| `ds7/**/*.md` | on demand, one section |
|
|
132
91
|
|
|
133
92
|
---
|
|
134
93
|
|
|
135
|
-
##
|
|
94
|
+
## 6. Useful commands
|
|
136
95
|
|
|
137
96
|
```bash
|
|
138
|
-
#
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
# Кто использует composable
|
|
142
|
-
grep -r "useModal" app/ --include="*.vue" -l
|
|
143
|
-
|
|
144
|
-
# Быстрый тест одного модуля (dot = 1 строка вывода)
|
|
145
|
-
npx vitest run app/domain/calculators/residential.test.ts --reporter=dot
|
|
146
|
-
|
|
147
|
-
# Статус только изменённых файлов
|
|
148
|
-
git diff --name-only HEAD
|
|
97
|
+
grep -rl "useModal" app/ --include="*.vue" # who uses a composable
|
|
98
|
+
npx vitest run path/to/file.test.ts --reporter=dot # one test, minimal output
|
|
99
|
+
git diff --name-only HEAD # what changed
|
|
149
100
|
```
|