Compare commits
3 Commits
html-to-sc
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
db6edeaa53
|
|||
|
e07acc6d81
|
|||
|
ef8e392357
|
25
README.md
Normal file
25
README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Навыки для AI-ассистентов
|
||||
|
||||
Коллекция навыков (skills) для AI-ассистентов и сред разработки.
|
||||
|
||||
## Список навыков
|
||||
|
||||
- **[format-html](./format-html/SKILL.md)** — форматирование и исправление сырой HTML-разметки (отступы в 4 пробела, выравнивание структуры, закрытие тегов).
|
||||
- **[html-to-scss](./html-to-scss/SKILL.md)** — генерация структуры SCSS по методологии БЭМ на основе переданной HTML-разметки.
|
||||
|
||||
## Установка
|
||||
|
||||
Для установки навыков рекомендуется использовать CLI-пакет [skills](https://www.npmjs.com/package/skills):
|
||||
|
||||
```bash
|
||||
# Установка навыка из репозитория
|
||||
npx skills add git@gitea.optiweb.ru:public/skills.git
|
||||
```
|
||||
|
||||
Также можно вручную скопировать папку нужного навыка в директорию скиллов вашего ассистента (например, `.agents/skills/`).
|
||||
|
||||
## Добавление нового навыка
|
||||
|
||||
1. Создайте папку с именем навыка (например, `my-skill/`).
|
||||
2. Добавьте в неё файл `SKILL.md` с описанием и правилами работы.
|
||||
3. Добавьте информацию о новом навыке в список в `README.md`.
|
||||
46
format-html/SKILL.md
Normal file
46
format-html/SKILL.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
name: format-html
|
||||
description: Prettify raw HTML markup provided by the user. Use when the user sends HTML and asks to make it readable, format, indent, or pretty-print it. Output is properly indented (4 spaces), with elements placed on new lines according to nesting depth, and text inside tags kept on a single line. Fix missing or extra opening/closing tags as part of the cleanup.
|
||||
license: MIT
|
||||
metadata:
|
||||
author: Valentin Silyutin
|
||||
version: "1.0.0"
|
||||
---
|
||||
|
||||
# HTML Formatting
|
||||
|
||||
Your task is to format the HTML code provided by the user. Make it clean, valid, and readable, and output **only the resulting HTML code** without any markdown commentary or explanations.
|
||||
|
||||
## Formatting Rules
|
||||
|
||||
1. **Indentation:** Use **4 spaces** per nesting level. Do not use tabs.
|
||||
2. **Line Breaks & Nesting:**
|
||||
- Place each block-level element on a new line matching its indentation level.
|
||||
- Void tags (e.g., `<img>`, `<br>`, `<meta>`, `<input>`, `<link>`, `<hr>`, `<source>`) must be placed on their own line when nested inside block elements.
|
||||
- **Inline Elements:** Keep inline elements (e.g., `<span>`, `<a>`, `<strong>`, `<em>`, `<code>`) inline with surrounding text to preserve natural whitespace and avoid unintended spacing bugs.
|
||||
3. **Text Nodes:** Keep regular text inside block tags on a single line — do not wrap based on arbitrary line width.
|
||||
4. **Preserved Content (`<pre>`, `<textarea>`, `<script>`, `<style>`):**
|
||||
- Do not alter the inner whitespace, indentation, or newlines inside `<pre>` and `<textarea>` elements.
|
||||
- Keep scripts and styles intact, only indenting the container tags.
|
||||
5. **Attributes:**
|
||||
- Place attributes on the same line as the opening tag.
|
||||
- If an element has many attributes and exceeds standard line length, you may place one attribute per line, indented relative to the tag.
|
||||
- Use double quotes (`"`) for attribute values.
|
||||
6. **DOCTYPE & Void Tags:**
|
||||
- Keep standard `<!DOCTYPE html>`, `<html>`, `<head>`, `<body>` structure.
|
||||
- Normalize void tags to HTML5 syntax without trailing slashes (e.g., `<img src="...">`, `<input type="...">`, `<br>`, `<hr>`).
|
||||
7. **Blank Lines:** Do not add redundant empty lines between sibling elements. Use a single blank line only to separate major layout landmarks if appropriate.
|
||||
|
||||
## Structural Repair
|
||||
|
||||
Fix any syntax and hierarchy issues present in the input HTML:
|
||||
|
||||
- **Missing closing tags:** Add them in the correct hierarchical positions.
|
||||
- **Extraneous closing tags:** Remove orphaned tags.
|
||||
- **Invalid nesting:** Correct overlapping tags (e.g., turn `<b><i></b></i>` into `<b><i></i></b>`).
|
||||
- **Content preservation:** Never rewrite text copy, invent missing content, or modify functional attribute values.
|
||||
|
||||
## Strict Output Format
|
||||
|
||||
- Output only the raw formatted HTML within a single markdown code block (or direct HTML stream).
|
||||
- No greetings, explanations, diffs, or follow-up notes.
|
||||
Reference in New Issue
Block a user