@dxtmisha/scripts 0.11.0 → 0.11.2

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 CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.11.2] - 2026-08-14
6
+
7
+ ### Changed
8
+ - **AI Prompt Templates**:
9
+ - Streamlined global development principles in `aiCodeGlobalPrompt.en.md` and `aiCodeGlobalPrompt.ru.md` to remove redundant guidelines and improve token efficiency.
10
+ - Strengthened strict instruction-following directives with explicit prohibitions against unsolicited changes, arbitrary refactoring, and unauthorized file modifications.
11
+ - Updated TSDoc documentation language rule to default to `[wikiLanguage]` unless the project defines its own documentation standard.
12
+ - Clarified source code reading requirements: strictly forbidding superficial scans when modifying existing files while encouraging keyword search before scanning large `ai-types.md` references.
13
+ - **Library AI Prompt Generator**:
14
+ - Removed duplicate `## Core Rules & Directives` preamble block in `LibraryAiPrompt` to keep generated `ai-prompt.md` clean and consistent.
15
+
16
+ ## [0.11.1] - 2026-08-14
17
+
18
+ ### Changed
19
+ - **AI Prompt Templates**:
20
+ - 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.
21
+ - 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).
22
+ - Added directive to use fast text/grep search on `ai-types.md` before scanning the entire file line-by-line to preserve context tokens.
23
+
5
24
  ## [0.11.0] - 2026-08-13
6
25
 
7
26
  ### Added
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/scripts",
3
3
  "private": false,
4
- "version": "0.11.0",
4
+ "version": "0.11.2",
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": [
@@ -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()
@@ -11,9 +11,9 @@
11
11
  "test": "vitest",
12
12
  "component": "dxt-component",
13
13
  "library": "dxt-library",
14
- "types": "npm run prepublishOnly && dxt-types",
14
+ "types": "npm run library && npm run build && dxt-types",
15
15
  "wiki": "dxt-ai-doc",
16
- "prepublishOnly": "npm run library && npm run build",
16
+ "prepublishOnly": "npm run library && npm run build && dxt-types-save",
17
17
  "publish-to-npm": "npm publish --access public"
18
18
  },
19
19
  "files": [
@@ -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**: Read all linked `ai-types.md` and `ai-developer.md` BEFORE proposing plans, inspecting directory structures, or writing code. If a package is in `node_modules/` but exists locally (e.g., `packages/`), resolve and study the local source instead.
9
- - Fully read file contents before modifying them. Superficial scans (text search only) are strictly forbidden. Always check existing infrastructure before writing custom logic.
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. **Clean Code (DRY/KISS/SOLID)**: Declarative style. Single responsibility (1 task = 1 function). No abbreviations (`el`, `val`, etc. are forbidden). Optimized and legible.
14
- 4. **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`.
15
- 5. **Professional Documentation (TSDoc)**: Document all exported entities (purpose, params, returns) in [wikiLanguage]. Include examples for complex logic.
16
- 6. **Architectural Consistency**: Respect project structure. Reuse existing infrastructure (always check `ai-types.md` first). Do not modify global/base UI styles unless explicitly requested.
17
- 7. **Security & Performance**: Error-proof code (`?.`, `??`, guard clauses). Use explicit `try-catch` for async. Never swallow errors. Avoid heavy ops in loops/reactivity.
18
- 8. **Aesthetics & Conciseness**: Group logically. Save tokens by avoiding redundant comments if code is self-explanatory.
19
- 9. **Strict Adherence & Optimization**: Follow instructions precisely without guessing. Propose relevant technical optimizations while strictly adhering to plans.
20
- 10. **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.
21
- 11. **Mandatory Full-File Self-Audit**: When creating new entities, you MUST audit the ENTIRE file (not just modified parts) to ensure no logic duplication (DRY) and full compliance with project rules. *Exception: minor bug fixes to existing code do not require a full audit.*
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**: Прочитай все связанные `ai-types.md` и `ai-developer.md` ДО планирования, исследования структуры директорий или написания кода. Если пакет в `node_modules/` существует локально (в `packages/`), изучай/изменяй локальные исходники.
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. **Чистый код (DRY/KISS/SOLID)**: Декларативный стиль. Единая ответственность (1 задача = 1 функция). Запрет на сокращения (никаких `el`, `val`, `temp` и т.д.). Оптимизация и читаемость.
14
- 4. **Бескомпромиссный TS**: Никаких `any` (используй `unknown` или generics). Интерфейсы для всех I/O. `as const`, `readonly`, enums. Только `@ts-expect-error` с комментариями, никогда `@ts-ignore`.
15
- 5. **TSDoc документирование**: Документируй все экспорты (назначение, параметры, возвраты) на языке [wikiLanguage]. Примеры для сложной логики.
16
- 6. **Архитектурная консистентность**: Соблюдай структуру. Переиспользуй инфраструктуру (сначала всегда читай `ai-types.md`). Не меняй глобальные/базовые UI стили без явного запроса.
17
- 7. **Безопасность и Производительность**: Защищенный код (`?.`, `??`, guard clauses). Явный `try-catch` для асинхронности. Не скрывай ошибки. Избегай тяжелых операций в циклах/реактивности.
18
- 8. **Эстетика и Лаконичность**: Логическая группировка. Экономь токены, избегая избыточных комментариев, если код очевиден.
19
- 9. **Строгое следование инструкциям**: Выполняй команды без додумывания, но предлагай уместные технические оптимизации, придерживаясь плана.
20
- 10. **Память ИИ (`ai-memory.md`)**: Активно ПРИМЕНЯЙ ее правила (высший приоритет). Обновляй локальный `ai-memory.md` **ТОЛЬКО** по явной команде разработчика (напр., «запомни», «сохрани в память») или при критических архитектурных правках/правилах. **СТРОГО ЗАПРЕЩЕНО** полностью переписывать или удалять содержимое файла: записи разрешено **ТОЛЬКО дополнять** (append) в конец существующего содержимого. ЗАПРЕЩЕНО добавлять всё подряд, историю изменений (changelogs) и абсолютные пути (только относительные). Храни только действительно важные архитектурные ограничения и явные указания разработчика.
21
- 11. **Обязательный полный самоаудит**: При создании новых сущностей ОБЯЗАТЕЛЬНО проверяй ВЕСЬ файл целиком. Строго контролируй отсутствие дублирования (DRY) и соблюдение всех правил проекта. *Исключение: мелкие правки существующего кода не требуют полного аудита.*
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).