@dxtmisha/scripts 0.11.1 → 0.11.3
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 +29 -1
- package/bin/design-types-save.ts +1 -0
- package/package.json +1 -1
- package/src/classes/Design/DesignTypes.ts +2 -1
- package/src/classes/Design/DesignTypesPrompts.ts +72 -29
- package/src/classes/Library/LibraryAiPrompt.ts +0 -6
- package/src/config.ts +2 -0
- package/src/media/templates/packages/library/package.json +1 -0
- package/src/media/templates/prompts/aiCodeGlobalPrompt.en.md +12 -11
- package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.md +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.11.3] - 2026-08-19
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Constants**: Added `UI_DIR_RESOURCES` (`'resources'`) directory constant in `src/config.ts`.
|
|
9
|
+
- **Scaffolding Template**: Added `"screenshot": "dxt-screenshot"` script entry to the library package template (`src/media/templates/packages/library/package.json`).
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **AI Prompt Metadata Separation & Granular Cache**:
|
|
13
|
+
- Split prompt metadata caching from monolithic `prompts.json` files into individual JSON files saved in `ai-types-list/resources/`.
|
|
14
|
+
- Updated `DesignTypesPrompts` to read, aggregate, and persist prompt cache items as separate `.json` files in the resources directory.
|
|
15
|
+
- Added `getCacheDir()`, `getCachePath()`, and `saveCacheItem()` methods in `DesignTypesPrompts` to manage individual prompt metadata files.
|
|
16
|
+
- Refactored `make()` and `toAiPromptItem()` to write prompt cache files immediately on change.
|
|
17
|
+
- **AI Types Save Workflow (`dxt-types-save`)**:
|
|
18
|
+
- Made `DesignTypes.makeSave()` asynchronous (`Promise<this>`) and added automatic package description generation via `await this.description.make()`.
|
|
19
|
+
- Updated `bin/design-types-save.ts` to await `makeSave()`.
|
|
20
|
+
|
|
21
|
+
## [0.11.2] - 2026-08-14
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- **AI Prompt Templates**:
|
|
25
|
+
- Streamlined global development principles in `aiCodeGlobalPrompt.en.md` and `aiCodeGlobalPrompt.ru.md` to remove redundant guidelines and improve token efficiency.
|
|
26
|
+
- Strengthened strict instruction-following directives with explicit prohibitions against unsolicited changes, arbitrary refactoring, and unauthorized file modifications.
|
|
27
|
+
- Updated TSDoc documentation language rule to default to `[wikiLanguage]` unless the project defines its own documentation standard.
|
|
28
|
+
- Clarified source code reading requirements: strictly forbidding superficial scans when modifying existing files while encouraging keyword search before scanning large `ai-types.md` references.
|
|
29
|
+
- **Library AI Prompt Generator**:
|
|
30
|
+
- Removed duplicate `## Core Rules & Directives` preamble block in `LibraryAiPrompt` to keep generated `ai-prompt.md` clean and consistent.
|
|
31
|
+
|
|
5
32
|
## [0.11.1] - 2026-08-14
|
|
6
33
|
|
|
7
34
|
### Changed
|
|
8
35
|
- **AI Prompt Templates**:
|
|
9
36
|
- Refined AI initialization step in `aiCodeGlobalPrompt.en.md` and `aiCodeGlobalPrompt.ru.md` to load `ai-types.md` and `ai-developer.md` conditionally only when relevant to the task.
|
|
10
|
-
- Added
|
|
37
|
+
- Added comprehensive definitions of `ai-types.md` (what the file is, its contents including TypeScript signatures and `@keywords` search tags, and how to work with it).
|
|
38
|
+
- Added directive to use fast text/grep search on `ai-types.md` before scanning the entire file line-by-line to preserve context tokens.
|
|
11
39
|
|
|
12
40
|
## [0.11.0] - 2026-08-13
|
|
13
41
|
|
package/bin/design-types-save.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/scripts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "CLI tools, AI integration scripts, and automation utilities for DXT UI — automated component scaffolding, Figma layout generation, library packaging, documentation building, screenshot captures, and AI prompt processing.",
|
|
7
7
|
"keywords": [
|
|
@@ -76,10 +76,11 @@ export class DesignTypes {
|
|
|
76
76
|
* Генерирует определения типов путем объединения обработанных файлов из директории ai-types-list без запуска ИИ.
|
|
77
77
|
* @returns current instance / текущий экземпляр
|
|
78
78
|
*/
|
|
79
|
-
makeSave(): this {
|
|
79
|
+
async makeSave(): Promise<this> {
|
|
80
80
|
console.log('DesignTypes: saving AI types from list...')
|
|
81
81
|
|
|
82
82
|
this.makeTypes.makeSave()
|
|
83
|
+
await this.description.make()
|
|
83
84
|
|
|
84
85
|
console.log('DesignTypes: AI types saved.')
|
|
85
86
|
|
|
@@ -12,12 +12,12 @@ import type {
|
|
|
12
12
|
DesignTypesPromptResult
|
|
13
13
|
} from '../../types/designTypes'
|
|
14
14
|
|
|
15
|
-
import { UI_MODULES } from '../../config'
|
|
15
|
+
import { UI_DIR_AI_TYPES_LIST, UI_DIR_RESOURCES, UI_MODULES } from '../../config'
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Class for reading prompt files and generating AI project rules and prompt triggers description.
|
|
18
|
+
* Class for reading prompt files, managing individual prompt metadata files, and generating AI project rules and prompt triggers description.
|
|
19
19
|
*
|
|
20
|
-
* Класс для чтения файлов промптов и генерации описания правил проекта ИИ и триггеров промптов.
|
|
20
|
+
* Класс для чтения файлов промптов, управления отдельными файлами метаданных промптов и генерации описания правил проекта ИИ и триггеров промптов.
|
|
21
21
|
*/
|
|
22
22
|
export class DesignTypesPrompts {
|
|
23
23
|
/** Cached list of prompt files / Кэшированный список файлов с промптами */
|
|
@@ -39,17 +39,33 @@ export class DesignTypesPrompts {
|
|
|
39
39
|
) { }
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Reads and returns the prompt cache list from
|
|
42
|
+
* Reads and returns the prompt cache list from individual JSON files in the resources directory.
|
|
43
43
|
*
|
|
44
|
-
* Читает и возвращает список кэша промптов из JSON
|
|
44
|
+
* Читает и возвращает список кэша промптов из отдельных JSON файлов в директории ресурсов.
|
|
45
45
|
* @returns prompt cache list / список кэша промптов
|
|
46
46
|
*/
|
|
47
47
|
getCacheList(): DesignTypesPromptCacheList {
|
|
48
48
|
if (this.cacheList === undefined) {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
49
|
+
const cacheDir = this.getCacheDir()
|
|
50
|
+
const files = PropertiesFile.readDirRecursive(cacheDir)
|
|
51
|
+
const list: DesignTypesPromptCacheList = []
|
|
52
|
+
|
|
53
|
+
for (const file of files) {
|
|
54
|
+
if (file.endsWith('.json')) {
|
|
55
|
+
const item = PropertiesFile.readFile<DesignTypesPromptCacheItem>([cacheDir, file])
|
|
56
|
+
|
|
57
|
+
if (
|
|
58
|
+
item
|
|
59
|
+
&& isFilled(item.path)
|
|
60
|
+
&& isFilled(item.name)
|
|
61
|
+
&& isFilled(item.description)
|
|
62
|
+
) {
|
|
63
|
+
list.push(item)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
51
67
|
|
|
52
|
-
this.cacheList =
|
|
68
|
+
this.cacheList = list
|
|
53
69
|
}
|
|
54
70
|
|
|
55
71
|
return this.cacheList
|
|
@@ -114,25 +130,16 @@ export class DesignTypesPrompts {
|
|
|
114
130
|
}
|
|
115
131
|
|
|
116
132
|
/**
|
|
117
|
-
* Processes prompt files using AI and updates
|
|
133
|
+
* Processes prompt files using AI and updates individual JSON cache files if changes are detected.
|
|
118
134
|
*
|
|
119
|
-
* Обрабатывает файлы промптов с помощью ИИ и обновляет JSON
|
|
135
|
+
* Обрабатывает файлы промптов с помощью ИИ и обновляет отдельные JSON файлы кэша при обнаружении изменений.
|
|
120
136
|
* @returns current instance / текущий экземпляр
|
|
121
137
|
*/
|
|
122
138
|
async make(): Promise<this> {
|
|
123
139
|
const list = this.getListPrompts()
|
|
124
|
-
let isCacheChanged = false
|
|
125
140
|
|
|
126
141
|
for (const item of list) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (result.isChanged) {
|
|
130
|
-
isCacheChanged = true
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (isCacheChanged) {
|
|
135
|
-
this.saveCacheList(this.getCacheList())
|
|
142
|
+
await this.toAiPromptItem(item)
|
|
136
143
|
}
|
|
137
144
|
|
|
138
145
|
return this
|
|
@@ -157,13 +164,31 @@ export class DesignTypesPrompts {
|
|
|
157
164
|
}
|
|
158
165
|
|
|
159
166
|
/**
|
|
160
|
-
* Gets the cache
|
|
167
|
+
* Gets the cache directory path for individual prompt JSON files.
|
|
161
168
|
*
|
|
162
|
-
* Получает путь к
|
|
169
|
+
* Получает путь к директории кэша для отдельных JSON файлов промптов.
|
|
170
|
+
* @returns cache directory path / путь к директории кэша
|
|
171
|
+
*/
|
|
172
|
+
protected getCacheDir(): string {
|
|
173
|
+
return PropertiesFile.joinPath([UI_DIR_AI_TYPES_LIST, UI_DIR_RESOURCES])
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Gets the cache JSON file path for a specific prompt file path.
|
|
178
|
+
*
|
|
179
|
+
* Получает путь к JSON файлу кэша для конкретного пути к файлу промпта.
|
|
180
|
+
* @param path relative file path of the prompt / относительный путь к файлу промпта
|
|
163
181
|
* @returns cache JSON file path / путь к JSON файлу кэша
|
|
164
182
|
*/
|
|
165
|
-
protected getCachePath(): string {
|
|
166
|
-
|
|
183
|
+
protected getCachePath(path: string): string {
|
|
184
|
+
const relativePath = path
|
|
185
|
+
.replace(new RegExp(`^${this.promptsDir}/`), '')
|
|
186
|
+
.replace(/\.[^/.]+$/, '.json')
|
|
187
|
+
|
|
188
|
+
return PropertiesFile.joinPath([
|
|
189
|
+
this.getCacheDir(),
|
|
190
|
+
relativePath
|
|
191
|
+
])
|
|
167
192
|
}
|
|
168
193
|
|
|
169
194
|
/**
|
|
@@ -193,14 +218,30 @@ export class DesignTypesPrompts {
|
|
|
193
218
|
}
|
|
194
219
|
|
|
195
220
|
/**
|
|
196
|
-
* Saves
|
|
221
|
+
* Saves an individual prompt cache item to its JSON cache file.
|
|
222
|
+
*
|
|
223
|
+
* Сохраняет отдельный элемент кэша промпта в его JSON файл кэша.
|
|
224
|
+
* @param item prompt cache item to save / элемент кэша промпта для сохранения
|
|
225
|
+
*/
|
|
226
|
+
protected saveCacheItem(item: DesignTypesPromptCacheItem): void {
|
|
227
|
+
PropertiesFile.writeByPath(
|
|
228
|
+
this.getCachePath(item.path),
|
|
229
|
+
item
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Saves the prompt cache list to individual JSON cache files.
|
|
197
235
|
*
|
|
198
|
-
* Сохраняет список кэша промптов в JSON
|
|
236
|
+
* Сохраняет список кэша промптов в отдельные JSON файлы кэша.
|
|
199
237
|
* @param cache cache list to save / список кэша для сохранения
|
|
200
238
|
*/
|
|
201
239
|
protected saveCacheList(cache: DesignTypesPromptCacheList): void {
|
|
202
240
|
this.cacheList = cache
|
|
203
|
-
|
|
241
|
+
|
|
242
|
+
for (const item of cache) {
|
|
243
|
+
this.saveCacheItem(item)
|
|
244
|
+
}
|
|
204
245
|
}
|
|
205
246
|
|
|
206
247
|
/**
|
|
@@ -230,9 +271,9 @@ export class DesignTypesPrompts {
|
|
|
230
271
|
}
|
|
231
272
|
|
|
232
273
|
/**
|
|
233
|
-
* Processes a single prompt file item using cache or AI into a formatted rule entry string and updates cache
|
|
274
|
+
* Processes a single prompt file item using cache or AI into a formatted rule entry string and updates individual cache file if changed.
|
|
234
275
|
*
|
|
235
|
-
* Обрабатывает один элемент файла промпта с использованием кэша или ИИ в отформатированную строку правила и обновляет
|
|
276
|
+
* Обрабатывает один элемент файла промпта с использованием кэша или ИИ в отформатированную строку правила и обновляет отдельный файл кэша при изменениях.
|
|
236
277
|
* @param item prompt file item / элемент файла промпта
|
|
237
278
|
* @returns object with formatted rule string and changed flag / объект с отформатированной строкой правила и флагом изменений
|
|
238
279
|
*/
|
|
@@ -278,6 +319,8 @@ export class DesignTypesPrompts {
|
|
|
278
319
|
cache.push(newItem)
|
|
279
320
|
}
|
|
280
321
|
|
|
322
|
+
this.saveCacheItem(newItem)
|
|
323
|
+
|
|
281
324
|
return {
|
|
282
325
|
prompt: this.getPromptLine(item.path, data.description),
|
|
283
326
|
isChanged: true
|
|
@@ -61,12 +61,6 @@ export class LibraryAiPrompt {
|
|
|
61
61
|
`
|
|
62
62
|
# System Role: AI Coding Assistant & Project Analyzer
|
|
63
63
|
Consolidated documentation, architectural guidelines, and mandatory rules for the project.
|
|
64
|
-
|
|
65
|
-
## Core Rules & Directives
|
|
66
|
-
- **Zero Hallucinations**: Rely strictly on existing APIs and dependencies declared in package.json.
|
|
67
|
-
- **Deep Context Study**: Analyze provided prompt documents and type definitions before writing code.
|
|
68
|
-
- **Explicit Unknowns**: If information is missing or unclear, state it explicitly instead of guessing.
|
|
69
|
-
- **Strict Compliance**: Follow all architectural conventions, design system rules, and coding standards.
|
|
70
64
|
`.trim(),
|
|
71
65
|
this.getGlobalPrompt(),
|
|
72
66
|
this.getVuePrompt()
|
package/src/config.ts
CHANGED
|
@@ -27,6 +27,8 @@ export const UI_DIR_AI = 'ai'
|
|
|
27
27
|
export const UI_DIR_AI_PROMPT_SCREENSHOT = 'ai-screenshot'
|
|
28
28
|
/** AI types list directory name / Название директории со списком типов AI */
|
|
29
29
|
export const UI_DIR_AI_TYPES_LIST = 'ai-types-list'
|
|
30
|
+
/** Resources directory name / Название директории ресурсов */
|
|
31
|
+
export const UI_DIR_RESOURCES = 'resources'
|
|
30
32
|
/** Components directory name/ Название директории компонентов */
|
|
31
33
|
export const UI_DIR_COMPONENTS = 'components'
|
|
32
34
|
/** Constructors directory name/ Название директории конструкторов */
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"component": "dxt-component",
|
|
13
13
|
"library": "dxt-library",
|
|
14
14
|
"types": "npm run library && npm run build && dxt-types",
|
|
15
|
+
"screenshot": "dxt-screenshot",
|
|
15
16
|
"wiki": "dxt-ai-doc",
|
|
16
17
|
"prepublishOnly": "npm run library && npm run build && dxt-types-save",
|
|
17
18
|
"publish-to-npm": "npm publish --access public"
|
|
@@ -5,17 +5,18 @@ Strictly follow these rules for flawless dxt-ui code:
|
|
|
5
5
|
0. **Mandatory Deep Study (CHRONOLOGICAL GUARD)**:
|
|
6
6
|
- **Step 1**: Read/create local `ai-memory.md` strictly in the current package root (e.g., `packages/constructor/`). Using repository root `ai-memory.md` for package files is FORBIDDEN.
|
|
7
7
|
- **Step 2**: Read root `ai-prompt.md` and study descriptions of all mentioned libraries.
|
|
8
|
-
- **Step 3**:
|
|
9
|
-
- Fully read file contents before modifying them
|
|
8
|
+
- **Step 3**: Study linked `ai-types.md` and `ai-developer.md` BEFORE proposing plans, inspecting directory structures, or writing code, ONLY if you think that library may be relevant/useful for the current task. If a package is in `node_modules/` but exists locally (e.g., `packages/`), resolve and study the local source instead.
|
|
9
|
+
- Fully read source file contents before modifying them (superficial scans without reading context are forbidden when modifying existing code). Always check existing infrastructure before writing custom logic.
|
|
10
10
|
|
|
11
11
|
1. **"Copy-Paste Ready"**: Generate complete, runnable files with correct imports. No placeholders (e.g., `// rest of code`).
|
|
12
12
|
2. **Zero Hallucinations**: Strictly use `package.json` dependencies. No invented APIs. Ask if unsure.
|
|
13
|
-
3. **
|
|
14
|
-
4. **
|
|
15
|
-
5. **
|
|
16
|
-
6. **
|
|
17
|
-
7. **
|
|
18
|
-
8. **
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
3. **Uncompromising TS**: No `any` (use `unknown` or generics). Interfaces for all I/O. `as const`, `readonly`, enums. Use `@ts-expect-error` with comments, never `@ts-ignore`.
|
|
14
|
+
4. **Professional Documentation (TSDoc)**: Document all exported entities (purpose, params, returns). Use [wikiLanguage] by default unless the project defines its own documentation standard. Include examples for complex logic.
|
|
15
|
+
5. **Architectural Consistency**: Respect project structure. Reuse existing infrastructure (always re-study this file before writing custom code). Do not modify global/base UI styles unless explicitly requested.
|
|
16
|
+
6. **Strict Adherence & Optimization (STRICT PROHIBITION OF UNSOLICITED ACTIONS)**: Do STRICTLY and ONLY what is requested in the prompt. Making unsolicited changes, arbitrary refactoring, or modifying unrelated files without explicit instructions is STRICTLY FORBIDDEN. Follow instructions precisely without guessing, proposing technical optimizations only within the approved scope.
|
|
17
|
+
7. **AI Workspace Memory (`ai-memory.md`)**: Actively APPLY its rules (highest priority). Update local `ai-memory.md` **ONLY** upon explicit developer command (e.g., "remember", "save to memory") or for critical architectural rules/fixes. **STRICTLY FORBIDDEN** to overwrite or delete existing file contents: you MUST **ONLY append** new directives to the end of the file. Do NOT add routine edits indiscriminately, change logs, or absolute paths (use relative only). Keep it focused strictly on critical architectural constraints and explicit developer instructions.
|
|
18
|
+
8. **Package Type Reference (`ai-types.md`)**:
|
|
19
|
+
- **Purpose & Content**: An AI-optimized complete technical reference of a package containing all public TypeScript declarations (classes, methods, functions, types, interfaces, enums, constants) with concise JSDoc and search tags (`@keywords`).
|
|
20
|
+
- **How to Work (Search Before Full Scan)**: Due to the large size of `ai-types.md` files (thousands of lines), do **NOT** read or scan the entire file line-by-line upfront. **First, use text search** (by keywords, `@keywords`, function/class names) to locate required helpers, types, and signatures quickly to save context tokens. Reading the entire file is only needed when performing deep architectural analysis of the whole package.
|
|
21
|
+
- **Code Reuse**: Before writing custom utility logic or types, ALWAYS check `ai-types.md` of relevant packages to discover and reuse existing infrastructure, classes, and helper functions (DRY).
|
|
22
|
+
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
0. **Обязательное глубокое изучение (БЛОКИРУЮЩИЙ КОНТРОЛЬ)**:
|
|
6
6
|
- **Шаг 1**: Читай/создавай локальный `ai-memory.md` СТРОГО в корне текущего пакета (напр., `packages/constructor/`). Использовать корневой `ai-memory.md` репозитория для файлов пакета ЗАПРЕЩЕНО.
|
|
7
7
|
- **Шаг 2**: Прочитай корневой `ai-prompt.md` и изучи описания всех упомянутых библиотек.
|
|
8
|
-
- **Шаг 3**:
|
|
9
|
-
- Полностью читай содержимое файлов перед
|
|
8
|
+
- **Шаг 3**: Изучи связанные `ai-types.md` и `ai-developer.md` ДО планирования, исследования структуры директорий или написания кода, ТОЛЬКО если кажется, что эта библиотека пригодится в текущей работе. Если пакет в `node_modules/` существует локально (в `packages/`), изучай/изменяй локальные исходники.
|
|
9
|
+
- Полностью читай содержимое исходных файлов перед их изменением (поверхностные правки без чтения контекста модифицируемого кода запрещены). Всегда проверяй существующую инфраструктуру перед написанием кастомной логики.
|
|
10
10
|
|
|
11
11
|
1. **Готовность к использованию (Copy-Paste Ready)**: Генерируй полные, рабочие файлы с правильными импортами. Никаких заглушек (напр., `// остальной код`).
|
|
12
12
|
2. **Нулевая толерантность к галлюцинациям**: Используй только зависимости из `package.json`. Не выдумывай API. Не знаешь — спроси.
|
|
13
|
-
3.
|
|
14
|
-
4.
|
|
15
|
-
5.
|
|
16
|
-
6.
|
|
17
|
-
7.
|
|
18
|
-
8.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
3. **Бескомпромиссный TS**: Никаких `any` (используй `unknown` или generics). Интерфейсы для всех I/O. `as const`, `readonly`, enums. Только `@ts-expect-error` с комментариями, никогда `@ts-ignore`.
|
|
14
|
+
4. **TSDoc документирование**: Документируй все экспорты (назначение, параметры, возвраты). По умолчанию используй язык [wikiLanguage], если проект не определяет собственный стандарт документирования. Примеры для сложной логики.
|
|
15
|
+
5. **Архитектурная консистентность**: Соблюдай структуру. Переиспользуй инфраструктуру (всегда повторно изучай этот файл перед написанием собственного кода). Не меняй глобальные/базовые UI стили без явного запроса.
|
|
16
|
+
6. **Строгое следование инструкциям (СТРОГИЙ ЗАПРЕТ НА САМОВОЛИЕ)**: Делай СТРОГО и ТОЛЬКО то, о чем явно попросил пользователь. КАТЕГОРИЧЕСКИ ЗАПРЕЩЕНО вносить несогласованные изменения, самовольный рефакторинг или модифицировать посторонние файлы. Выполняй команды без додумывания, предлагая технические оптимизации только в рамках утвержденного плана.
|
|
17
|
+
7. **Память ИИ (`ai-memory.md`)**: Активно ПРИМЕНЯЙ ее правила (высший приоритет). Обновляй локальный `ai-memory.md` **ТОЛЬКО** по явной команде разработчика (напр., «запомни», «сохрани в память») или при критических архитектурных правках/правилах. **СТРОГО ЗАПРЕЩЕНО** полностью переписывать или удалять содержимое файла: записи разрешено **ТОЛЬКО дополнять** (append) в конец существующего содержимого. ЗАПРЕЩЕНО добавлять всё подряд, историю изменений (changelogs) и абсолютные пути (только относительные). Храни только действительно важные архитектурные ограничения и явные указания разработчика.
|
|
18
|
+
8. **Справочник типов пакетов (`ai-types.md`)**:
|
|
19
|
+
- **Назначение и состав**: Это специализированный, оптимизированный для ИИ справочник типов пакета, содержащий полный список публичных TypeScript-деклараций (классы, методы, функции, типы, интерфейсы, перечисления, константы) с лаконичными JSDoc-описаниями и поисковыми тегами (`@keywords`).
|
|
20
|
+
- **Как работать (Поиск перед полным сканированием)**: Из-за больших объемов файлов `ai-types.md` (тысячи строк) **НЕ сканируй и не читай** весь файл целиком сразу. **Сначала используй поиск по тексту** (по ключевым словам, тегам `@keywords`, именам функций/классов), чтобы быстро и экономно по токенам найти нужные сущности и сигнатуры. Читать весь файл целиком следует только при необходимости глубокого исследования архитектуры всего пакета.
|
|
21
|
+
- **Переиспользование кода**: Прежде чем писать кастомную логику или собственные утилиты, ОБЯЗАТЕЛЬНО проверь `ai-types.md` релевантных пакетов, чтобы переиспользовать готовую инфраструктуру и готовые хелперы библиотеки (DRY).
|