readme and docs editing

This commit is contained in:
2026-05-22 09:19:26 +10:00
parent 52b1723137
commit f4375c2349
10 changed files with 265 additions and 24 deletions
+28
View File
@@ -0,0 +1,28 @@
---
description: Global token-saving, cost control, and context management rules
globs: *
---
# Global Optimization & Cost Control
## ?? Context & Local Data
- **Strict file targeting:** Work ONLY with files explicitly provided via `@` or open in the active editor tab. Do not use global codebase search unless requested.
- **Local assets only:** Always work with local copies of repositories and dependencies. Never request external web resources or re-download packages without a explicit build error.
- **Size Limit:** Do not load files larger than 500 lines into the context unless strictly necessary.
## ?? Git & Commits Management
- **Automatic commits are strictly FORBIDDEN.** Never execute `git commit` or `git push` without an explicit user command.
- Only suggest a commit after phrases like: "Ñäåëàé êîììèò", "Çàôèêñèðóé èçìåíåíèÿ", "Push".
- Before committing: display `git diff --stat` and wait for explicit user confirmation.
- Use Conventional Commits format (`feat:`, `fix:`, `refactor:`, `docs:`).
## ?? Output Format & Brevity
- **Strictly no fluff:** Omit greetings, apologies, and closing pleasantries.
- **Diff-style only:** Output only modified code fragments, never duplicate unchanged logic or whole files.
- **Extreme brevity:** Explanations must be 1-3 sentences max. Use documentation links instead of long texts.
- If a task doesn't require code, respond strictly with text. If in doubt, ask ONE precise clarifying question.
## ?? Model Routing Reminder
- Simple questions, explanations, docs ? Use lightweight models (e.g., `gpt-4o-mini`, `claude-3-haiku`).
- Complex code generation, refactoring, and debugging ? Use advanced models (e.g., `claude-3.5-sonnet`).
- Do not switch models without an explicit reason.
+13
View File
@@ -0,0 +1,13 @@
---
description: Code generation syntax restrictions to minimize output tokens
globs: "*.{ts,js,py,cs}"
---
# Syntax Optimization
- **No JSDoc/Docstrings:** Do NOT write documentation, comments, JSDoc, or docstrings for generated functions unless explicitly asked.
- **No logs or prints:** Remove all `console.log`, `print()`, or debugging statements from the final code output.
- **Use concise syntax:**
- In JavaScript/TypeScript: Use arrow functions, optional chaining (`?.`), nullish coalescing (`??`), and destructuring.
- In Python: Use list comprehensions, dict comprehensions, and built-in functions.
- **Minimize imports:** Do not output the `import` statements section if the required packages are standard and already exist in the file.
+18
View File
@@ -0,0 +1,18 @@
---
description: High-density PowerShell script generation rules for minimal token usage
globs: "*.ps1, *.psm1"
---
# PowerShell Token Optimization
- **Use Short Aliases:** Use short aliases instead of full cmdlet names to drastically cut output tokens:
- Use `gc` instead of `Get-Content`
- Use `gci` instead of `Get-ChildItem`
- Use `%` instead of `ForEach-Object`
- Use `?` instead of `Where-Object`
- Use `measure` instead of `Measure-Object`
- **Pipeline Over Loops:** Prefer pipeline chains (`gci | % { ... }`) over multi-line `foreach ($item in $items) { ... }` blocks.
- **No Help/Comments:** Do not generate `.SYNOPSIS`, `.DESCRIPTION`, or comment-based help at the top of scripts.
- **Omit Parameter Names:** Drop explicit parameter names where positional arguments are clear (e.g., use `gc file.txt` instead of `Get-Content -Path file.txt`).
- **Silent Execution:** Do not add verbose logging, `Write-Host`, or `Write-Output` unless explicitly asked to create UI/logs.
- **Preserve CLI Arguments:** Do not duplicate full multi-line `yt-dlp` command-line arguments, format strings, or output templates if they are not the subject of the modifications. Use placeholders or variable references.
+14
View File
@@ -0,0 +1,14 @@
---
description: Ultra-dense Python code generation rules to save output tokens
globs: "*.py"
---
# Python Token Optimization
- **Use Syntactic Sugar:** Prioritize list comprehensions, dict comprehensions, and ternary operators (`x if condition else y`) to keep code on a single line.
- **Built-in Libraries First:** Use standard libraries (`pathlib`, `json`, `subprocess`, `asyncio`) instead of introducing heavy external dependencies unless already in `requirements.txt`.
- **Type Hinting:** Do NOT add type hints (`def func(x: int) -> str:`) unless the existing file strictly uses them. Type hints consume significant tokens.
- **No Format Duplication:** When modifying scripts (like video downloaders), provide only the modified function or class method. Never output the `if __name__ == "__main__":` block or argument parsing logic if they haven't changed.
- **No Docstrings:** Strictly forbid writing `"""docstrings"""` or `# comments` explaining the logic.
- **Preserve yt-dlp Options:** Never rewrite, duplicate, or expand the `ydl_opts` configuration dictionary or custom extraction options. If changes are unrelated to download options, use a placeholder comment like `# ... existing ydl_opts ...` instead of outputting the full dictionary block.
+22
View File
@@ -0,0 +1,22 @@
---
description: Global token-saving rules for ultra-concise communication and minimal context usage
globs: *
---
# Token-Saving Instructions
## Communication Strategy
- **Strictly no fluff:** Omit all greetings, pleasantries, apologies, and concluding remarks.
- **Direct answers only:** Start your response immediately with the solution, code block, or direct answer.
- **Extreme brevity:** Keep explanations under 2-3 sentences. Use bullet points instead of long paragraphs.
## Code Generation Guidelines
- **Do not restate existing code:** Never copy and paste parts of my existing file just to show where to insert changes.
- **Provide diffs only:** Show only the specific lines that need to be changed, added, or deleted. Use brief comments (`// ... existing code ...`) to show placement if necessary.
- **No boilerplate:** Do not generate setup code, imports, or boilerplate unless explicitly requested.
- **Single-line implementations:** Prefer concise, clean, short code syntax where readable (e.g., arrow functions, ternary operators).
## Code Review and Verification
- Do not explain why the code works unless asked.
- If the solution is simple, output *only* the code block and nothing else.
- If you need more information, ask a single, precise question. Do not list multiple hypotheticals.
+44
View File
@@ -0,0 +1,44 @@
---
description: Bump версии в csproj и тег релиза vX.Y.Z при обновлениях
alwaysApply: true
---
# Версия сборки и теги релиза
Единственный источник — `VideoDownloader.App/VideoDownloader.App.csproj`. Синхронно обновляй:
- `Version` (например `0.7.0`)
- `AssemblyVersion` — `x.y.z.0`
- `FileVersion` — `x.y.z.0`
- `InformationalVersion` остаётся `$(Version)`
## Обычные правки (patch)
После осмысленного изменения в `VideoDownloader.App` поднимай **patch** на **+0.0.1** (например `0.7.0` → `0.7.1`). Bump в **том же коммите**, что и изменение, где это уместно.
## Minor / major
При заметном релизе можно поднять **minor** или **major** по смыслу (например `0.6.x` → `0.7.0`). Не обязательно делать это при каждой мелкой правке.
## Тег версии при каждом bump (`vX.Y.Z`) — не забывать
Ветки вида `v0.7.x` **не используем** — маркер релиза — **легковесный или аннотированный тег** с тем же именем.
При **любом** повышении `<Version>` в csproj в том же цикле работы:
1. Закоммитить bump (вместе с изменениями или коммитом `chore: bump version to X.Y.Z`).
2. Создать тег на **текущем** `HEAD` (после коммита с bump):
`git tag -a vX.Y.Z -m "Release X.Y.Z"` (или `git tag vX.Y.Z` для легковесного тега).
Если тег с таким именем уже существовал локально по ошибке: удалить и создать заново на нужном коммите, либо `git tag -f` осознанно.
3. Запушить **обязательно**: **`git push origin native-code`** и **`git push origin vX.Y.Z`** (первый релиз с этим номером).
Повторный push того же тега на другой коммит на сервере обычно запрещён — bump версии делается новым номером и новым тегом.
Именование тега: **`v` + полная semver из `<Version>`** (пример: `v0.7.2`), без префикса `release/`.
**Не пушить** только `native-code` без нового **`v*`** — при bump версии всегда создавай и пушь соответствующий тег.
### Проверка на GitHub
Релиз по тегу: вкладка **Releases** или список тегов в репозитории; `git checkout v0.7.2` локально даёт ту же ревизию, что и при сборке с этим bump.
Если на `origin` ещё есть старая **ветка** с тем же имени, что у тега, удаляй явно: `git push origin --delete refs/heads/vX.Y.Z` (иначе Git может не разрешить неоднозначность `vX.Y.Z`).