@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.
@@ -1,38 +1,38 @@
1
- # 06-Business · EV & Solar Ecosystem (V2C, V2H, Plan MOVES III)
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. Зарядка от излишков солнца (100% Solar Surplus)
7
+ ## 1. Charging from surplus solar
8
8
 
9
- Станции испанского производителя **V2C Trydan** — якорный продукт для направления `Movilidad`:
10
- * **Принцип:** Станция связывается по Wi-Fi с инвертором (Huawei, Livoltek, GoodWe). Если дом потребляет 1 кВт, а панели генерируют 5 кВт, оставшиеся 4 кВт излишка автоматически направляются в батарею автомобиля.
11
- * **Выгода:** Машина заряжается **чистой бесплатной энергией солнца (0 € расходов)**, не покупая ни одного кВт·ч из сети.
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
- * *«6 солнечных панелей на крыше = 45 км бесплатного ежедневного пробега»*.
20
- * *«Экономия на заправке автомобиля: более 180 € в месяц по сравнению с бензином»*.
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. V2H (Vehicle-to-Home) — Электромобиль как аккумулятор дома
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
- * Обычная домашняя батарея (например, 5 кВт·ч) стоит около 3 000 €.
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. Субсидии Plan MOVES III (Возврат до 70–80%)
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
- # DS7 · 07 — Targeted Testing Strategy
1
+ # 07 · Testing strategy
2
2
 
3
- > **Принцип:** Запускай минимально достаточный тест — не весь suite.
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) ~10ms/test → запускать всегда при изменении логики
12
- 2. Composable (Vue reactive) ~50ms/test → при изменении composable
13
- 3. Component (Vue TU) ~200ms/test → при изменении компонента
14
- 4. E2E / Playwright ~5s/flow → только критичные пути, перед релизом
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
- | **Vitest** | Unit + composable + component тесты |
24
- | **@vue/test-utils** | Маунт Vue-компонентов без браузера |
25
- | **Playwright** | E2E (checkout, calculator flow, 404) |
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 app/domain/calculators/residential.test.ts
34
-
35
- # Одна папка
36
- npx vitest run app/domain/calculators/
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
- ```typescript
56
- // ✅ Описательное: что тестируем + ожидаемый результат
57
- it('calculates savings with 30% self-consumption correctly', () => { ... })
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 100% of bill', () => {
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
- ## Стратегия для AI-агентов (экономия токенов)
77
+ ## 6. Coverage expectations
102
78
 
103
- 1. **Перед правкой** — запусти только тест изменяемого файла
104
- 2. **После правки** — снова только этот тест (`--reporter=dot`)
105
- 3. **Расширяй scope** только если изменение затронуло shared logic
106
- 4. **Полный suite** — один раз в конце задачи, не в каждой итерации
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
- ```bash
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
- ## Vitest Config (рекомендуемый минимум)
116
-
117
- ```typescript
118
- // vitest.config.ts
119
- import { defineConfig } from 'vitest/config'
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
- # DS7 · 08 — Token & Context Optimization
1
+ # 08 · Token and context optimisation
2
2
 
3
- > **Цель:** Работать с AI-агентами эффективно — читать только нужные файлы,
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
- 1. ALL.md ← правила проекта (всегда первым)
20
- 2. docs/ARCHITECTURE.md ← где лежит нужный слой
21
- 3. app/data/<relevant> ← данные затронутого домена
22
- 4. app/domain/<module> ← бизнес-логика (если меняем)
23
- 5. app/composables/<x> ← только если composable затронут
24
- 6. app/components/<X> ← только если компонент затронут
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
- > Никогда не читать всё подряд. Читать только call chain задачи.
25
+ Do not read all of `app/components/` or all of `app/data/`.
29
26
 
30
27
  ---
31
28
 
32
- ## Project Graph — быстрая карта зависимостей
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
- index.vue → HomeHero, HomeSystem, HomeEquipment, HomeFaq …
37
- movilidad.vue → UiPageHero, HomeFleet, HomeBundles, CalcSection …
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
- ## Правила для AI-агентов в этом проекте
43
+ ## 3. Working rules
75
44
 
76
- ### Перед началом задачи
77
- ```
78
- 1. Прочитай ALL.md (правила)
79
- 2. Определи слой задачи по ARCHITECTURE.md
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. После каждого изменения → один точечный тест (не suite)
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. Запустить полный suite один раз
94
- 9. Сохранить handoff через session-handoff skill
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-Level Summaries (стандарт DS7)
62
+ ## 4. File summaries
101
63
 
102
- Каждый нетривиальный файл должен иметь 1-2 строки комментария вверху:
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
- ```typescript
105
- // Residential solar savings calculator.
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 — universal product card (Atomic: Molecule).
113
- Modifiers: -top (crown badge), -new (ribbon), -compact (slim layout).
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
- | `docs/ARCHITECTURE.md` | Читать нужный раздел |
127
- | `app/data/*.ts` | Только если задача про данные |
128
- | `app/domain/calculators/*.ts` | Только если правим логику |
129
- | `app/components/ui/UiX.vue` | Читать только изменяемый |
130
- | `i18n/locales/es.ts` | Только если добавляем ключи |
131
- | `ds7/**/*.md` | Lazy — читать только нужный раздел |
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
- ## Быстрые команды (копипаст для AI-диалога)
94
+ ## 6. Useful commands
136
95
 
137
96
  ```bash
138
- # Граф изменённого файла
139
- grep -r "import.*residential" app/ --include="*.ts" --include="*.vue" -l
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
  ```