Compare commits

...

59 Commits

Author SHA1 Message Date
sck_0
4acf69d80e chore: release 4.4.0 - add fp-ts skills (PR #43) 2026-01-30 20:29:59 +01:00
github-actions[bot]
aaee268672 chore: sync generated registry files [ci skip] 2026-01-30 19:28:08 +00:00
Kadu Maverick
cb9f1b1a4e feat: add fp-ts skills for TypeScript functional programming (#43)
Add three practical fp-ts skills:
- fp-ts-pragmatic: The 80/20 of functional programming, jargon-free
- fp-ts-react: Patterns for using fp-ts with React 18/19 and Next.js
- fp-ts-errors: Type-safe error handling with Either and TaskEither

Source: https://github.com/whatiskadudoing/fp-ts-skills

Co-authored-by: kadu-maverickk <maycon.guedes@itglobers.com>
2026-01-30 20:27:51 +01:00
github-actions[bot]
8b523ccc54 chore: sync generated registry files [ci skip] 2026-01-30 08:24:50 +00:00
sck_0
b831384713 chore: remove temporary analysis files and update .gitignore
- Removed temporary report files (*_REPORT.md, *_COUNT.md)
- Removed temporary JSON analysis files
- Removed temporary analysis scripts
- Added patterns to .gitignore to prevent future commits
2026-01-30 09:24:33 +01:00
sck_0
2128d7b256 chore: resolve merge conflicts and sync generated files [ci skip] 2026-01-30 09:21:51 +01:00
sck_0
10bc6d37d7 chore: sync generated registry files [ci skip] 2026-01-30 09:21:33 +01:00
github-actions[bot]
a53052fcb1 chore: sync generated registry files [ci skip] 2026-01-30 08:18:19 +00:00
sck_0
a53a16e24a docs: add VoltAgent to Credits & Sources section 2026-01-30 09:18:03 +01:00
sck_0
2250f88e89 docs: update README with correct skill count (614) and add VoltAgent to Credits
- Updated all skill count references from 621 to 614
- Added VoltAgent/awesome-agent-skills to Credits & Sources section
- All skill count references now consistent
2026-01-30 09:17:58 +01:00
github-actions[bot]
6b377e8549 chore: sync generated registry files [ci skip] 2026-01-30 08:16:36 +00:00
sck_0
92e90552e0 chore: sync generated registry files after merge 2026-01-30 09:15:50 +01:00
sck_0
76f43ef8ee docs: add analysis and implementation reports for VoltAgent integration
- VoltAgent repository analysis and validation reports
- Similar skills analysis and implementation tracking
- HTML to markdown conversion report
- Final skills count verification
2026-01-30 09:15:27 +01:00
sck_0
dde0467e42 feat: add 61 new skills from VoltAgent repository
- 27 official team skills (Sentry, Trail of Bits, Expo, Hugging Face, etc.)
- 34 community skills including context engineering suite
- All skills validated and compliant with V4 quality bar
- Complete source attribution maintained

Skills added:
- Official: commit, create-pr, find-bugs, iterate-pr, culture-index, fix-review, sharp-edges, expo-deployment, upgrading-expo, hugging-face-cli, hugging-face-jobs, vercel-deploy-claimable, design-md, using-neon, n8n-*, swiftui-expert-skill, fal-*, deep-research, imagen, readme, screenshots
- Community: frontend-slides, linear-claude-skill, skill-rails-upgrade, context-*, multi-agent-patterns, tool-design, evaluation, memory-systems, terraform-skill, and more
2026-01-30 09:15:26 +01:00
sck_0
d1edc684e9 chore: sync generated registry files for v4.3.0
- Updated catalog to 614 skills
- Updated README.md with correct skill counts
- Updated package.json to version 4.3.0
- Added release notes for v4.3.0
- Updated SOURCES.md with new attributions
2026-01-30 09:15:24 +01:00
github-actions[bot]
4e1ba66df9 chore: sync generated registry files [ci skip] 2026-01-30 07:35:12 +00:00
sck_0
cc905285e7 docs: add evandro-miguel to Repo Contributors (PR #41) 2026-01-30 08:34:59 +01:00
github-actions[bot]
0897cca3a4 chore: sync generated registry files [ci skip] 2026-01-30 07:30:13 +00:00
sck_0
0ed1a74d8d Merge branch 'main' of https://github.com/sickn33/antigravity-awesome-skills - resolve registry sync 2026-01-30 08:29:48 +01:00
sck_0
1485b8a88b chore(release): v4.2.0 - writing-skills gold standard refactor 2026-01-30 08:29:17 +01:00
sck_0
92fcf2e24d chore: sync generated registry files 2026-01-30 08:28:50 +01:00
github-actions[bot]
0d1599b597 chore: sync generated registry files [ci skip] 2026-01-30 07:28:37 +00:00
sickn33
af2934c938 feat(writing-skills): refactor to gold standard architecture
Closes #40
2026-01-30 08:28:19 +01:00
github-actions[bot]
03a0ece33a chore: update star history chart 2026-01-30 06:44:02 +00:00
Antigravity Agent
10ca106b79 feat(writing-skills): refactor skill to gold standard architecture 2026-01-29 15:12:41 -03:00
github-actions[bot]
f2c3e783b5 chore: sync generated registry files [ci skip] 2026-01-29 12:19:36 +00:00
sck_0
d1c1721db7 chore: ignore root node_modules to fix CI drift
- Add node_modules/ to .gitignore; untrack existing root node_modules
- npm ci recreates it on runner; ignored, so no drift from install
2026-01-29 13:19:20 +01:00
github-actions[bot]
9a6cff2d69 chore: sync generated registry files [ci skip] 2026-01-29 12:17:15 +00:00
sck_0
a4292c3939 ci: use npm ci to avoid package-lock drift; sync catalog outputs 2026-01-29 13:16:52 +01:00
github-actions[bot]
755f9cef4f chore: sync generated registry files [ci skip] 2026-01-29 12:14:39 +00:00
sck_0
334dbfe37f merge: integrate update_readme refactor with remote; resolve catalog conflicts via regeneration 2026-01-29 13:14:22 +01:00
sck_0
f9b6a3b8db fix: refactor update_readme to match current README (counts only, no Full Skill Registry)
- Remove Full Skill Registry and table logic; keep only count substitutions
- Add Browse N+ Skills and TOC link updates
- Always write README after substitutions so chain completes without error
2026-01-29 13:13:34 +01:00
github-actions[bot]
ef5aeeaa0c chore: sync generated registry files [ci skip] 2026-01-29 12:08:22 +00:00
sck_0
559dd6f40f chore: implement repo improvements plan (npm scripts, docs, catalog CI, i18n, validator)
- Add npm scripts: validate, validate:strict, index, readme, chain, catalog, build
- Align docs to V4 and 560 skills (GETTING_STARTED, FAQ, BUNDLES, MAINTENANCE, vietnamese)
- build-catalog: output to data/ for catalog, bundles, aliases; add to CI and drift check
- Add yaml dep, Node setup and catalog step in CI; extend auto-commit and drift msg
- Translate CI and MAINTENANCE to English; update CI_DRIFT_FIX and maintenance routine
- QUALITY_BAR/CONTRIBUTING: canonical validator npm run validate; legacy note in validate-skills.js
2026-01-29 13:08:02 +01:00
sck_0
6365f592f0 docs: migliorare BUNDLES.md con bundle aggiuntivi, link diretti e struttura migliorata
- Aggiunti 8+ nuovi bundle (Security Developer, Full-Stack, LLM App Dev, etc.)
- Corretti nomi skill inesistenti con skill reali del repository
- Aggiunti link diretti a tutti gli skill per navigazione più facile
- Migliorata organizzazione con sezioni più chiare
- Aggiunta sezione Quick Start con istruzioni di installazione
- Aggiunta sezione Learning Paths per progressione skill
- Migliorate descrizioni e struttura generale
- Da 12 a 20+ bundle organizzati per ruolo e livello
2026-01-29 12:45:47 +01:00
sck_0
ba668dde07 feat: add npx installer CLI
- Add package.json with bin for antigravity-awesome-skills
- Add bin/install.js: clone to ~/.agent/skills (default), --cursor/--claude/--gemini/--path
- Git pull if dir exists; core.symlinks=true on Windows
- Update README and GETTING_STARTED with npx instructions
2026-01-29 12:41:00 +01:00
sickn33
b74dbe7795 Update contributors list in README.md
Removed descriptions from contributors Đỗ Khắc Gia Khoa and junited31.
2026-01-29 12:24:17 +01:00
github-actions[bot]
d11e71c1df chore: sync generated registry files [ci skip] 2026-01-29 11:23:06 +00:00
sck_0
395c772661 chore: complete unreal-engine-cpp-pro skill with risk, source and When to Use section
Completes PR #39 by adding missing frontmatter fields and When to Use section.

Co-authored-by: junited31 <junited31@users.noreply.github.com>
2026-01-29 12:22:55 +01:00
github-actions[bot]
c427208f4c chore: sync generated registry files [ci skip] 2026-01-29 11:22:45 +00:00
sck_0
49d47b6729 feat: add unreal-engine-cpp-pro (PR #39)
Co-authored-by: junited31 <junited31@users.noreply.github.com>
2026-01-29 12:22:33 +01:00
sck_0
e4b782d1e6 Merge PR #39: feat: add unreal-engine-cpp-pro
- Added unreal-engine-cpp-pro skill with complete frontmatter
- Includes risk: safe, source: self, and When to Use section
- Added example Actor implementation
- Resolved merge conflict keeping complete version
2026-01-29 12:22:25 +01:00
sck_0
1bd6cd8c5e chore: update skill counts to 560+ across all documentation
- Updated README.md title and descriptions from 552+ to 560+
- Updated docs/GETTING_STARTED.md references
- Updated RELEASE_NOTES.md to v4.1.0
- Removed duplicate contributor entry
2026-01-29 12:21:01 +01:00
sickn33
934f41481f Merge pull request #38 from Dokhacgiakhoa/vietnamese-translation
feat(i18n): Add comprehensive Vietnamese translations for documentation
2026-01-29 12:20:42 +01:00
sck_0
9c64999dea docs: update contributors and add release notes for PR #38 and #39
- Added @Dokhacgiakhoa and @junited31 to Repo Contributors
- Created RELEASE_NOTES.md documenting Vietnamese translations and unreal-engine-cpp-pro skill
2026-01-29 12:17:47 +01:00
sck_0
539a5890d1 chore: sync generated files after adding unreal-engine-cpp-pro skill 2026-01-29 12:17:47 +01:00
junited31
01731166b5 feat: add unreal-engine-cpp-pro 2026-01-29 19:04:42 +09:00
github-actions[bot]
e1dd8f41bc chore: update star history chart 2026-01-29 06:42:36 +00:00
Đỗ Khắc Gia Khoa
b282aeee33 docs: refine vietnamese translations for natural flow and correct terminology 2026-01-29 04:50:43 +07:00
Đỗ Khắc Gia Khoa
2467d6a2ac docs: translate security policy and skills readme, mark agent skills as english-only 2026-01-29 04:48:06 +07:00
Đỗ Khắc Gia Khoa
bad87316db refactor: remove translated skills to keep them English-only for AI Agent compatibility 2026-01-29 04:42:47 +07:00
Đỗ Khắc Gia Khoa
e9b5ccd7ac docs: update translation plan with completed skills 2026-01-29 04:41:09 +07:00
Đỗ Khắc Gia Khoa
eaf809578e feat: translate batch 5 (backend, cloud, csharp, code-review) 2026-01-29 04:40:30 +07:00
Đỗ Khắc Gia Khoa
637fc86c99 feat: translate batch 3 & 4 (10 more skills: agent-*, ai-*, api-*, aws, azure) 2026-01-29 04:35:13 +07:00
Đỗ Khắc Gia Khoa
3e375f7ca1 feat: translate batch 2 (3d-web, agent misc skills) 2026-01-29 04:27:22 +07:00
Đỗ Khắc Gia Khoa
6b517ed29a feat: translate top 5 development skills (clean-code, TS, React, Python, Node) 2026-01-29 04:21:55 +07:00
Đỗ Khắc Gia Khoa
2fc3237ef9 chore: rename translation files to .vi.md extension 2026-01-29 04:12:25 +07:00
sck_0
a16b57e581 docs: restructure translation formatting - moving all localized content to docs/vietnamese 2026-01-29 04:10:29 +07:00
sck_0
068b4b5d2d chore: update code 2026-01-28 18:01:08 +01:00
367 changed files with 26054 additions and 21137 deletions

View File

@@ -1,4 +1,4 @@
# 🛠️ Repository Maintenance Guide (V3)
# 🛠️ Repository Maintenance Guide (V4)
> **"If it's not documented, it's broken."**
@@ -24,21 +24,20 @@ Committing is NOT enough. You must PUSH to the remote.
If you touch **any of these**:
- `skills/` (aggiungi/rimuovi/modifichi skill)
- la sezione **Full Skill Registry** di `README.md`
- i **conteggi/claim** sul numero di skill (`256+ Agentic Skills...`, `(256/256)`, ecc.)
- `skills/` (add/remove/modify skills)
- the **Full Skill Registry** section of `README.md`
- **counts/claims** about the number of skills (`560+ Agentic Skills...`, `(560/560)`, etc.)
allora **DEVI** eseguire la Validation Chain **PRIMA** di committare.
then you **MUST** run the Validation Chain **BEFORE** committing.
- Eseguire `validate_skills.py` **NON è opzionale**.
- Eseguire `generate_index.py` **NON è opzionale**.
- Eseguire `update_readme.py` **NON è opzionale**.
- Running `npm run chain` is **NOT optional**.
- Running `npm run catalog` is **NOT optional**.
Se la CI fallisce con:
If CI fails with:
> `❌ Detected uncommitted changes in README.md or skills_index.json`
> `❌ Detected uncommitted changes produced by registry/readme/catalog scripts.`
significa che **non hai eseguito o committato** correttamente la Validation Chain.
it means you **did not run or commit** the Validation Chain correctly.
### 3. 📝 EVIDENCE OF WORK
@@ -59,29 +58,23 @@ significa che **non hai eseguito o committato** correttamente la Validation Chai
Before ANY commit that adds/modifies skills, run the chain:
1. **Validate Metadata & Quality**:
1. **Validate, index, and update readme**:
```bash
python3 scripts/validate_skills.py
npm run chain
```
_Must return 0 errors for new skills._
2. **Regenerate Index**:
2. **Build catalog**:
```bash
python3 scripts/generate_index.py
npm run catalog
```
3. **Update Readme**:
3. **COMMIT GENERATED FILES**:
```bash
python3 scripts/update_readme.py
```
4. **COMMIT GENERATED FILES**:
```bash
git add skills_index.json README.md
git add README.md skills_index.json data/catalog.json data/bundles.json data/aliases.json CATALOG.md
git commit -m "chore: sync generated files"
```
> 🔴 **CRITICAL**: If you skip this, CI will fail with "Detected uncommitted changes".
@@ -102,13 +95,13 @@ After multiple PR merges or significant changes:
3. **Draft a Release**:
- Go to [Releases Page](https://github.com/sickn33/antigravity-awesome-skills/releases).
- Draft a new release for the merged changes.
- Tag version (e.g., `v3.1.0`).
- Tag version (e.g., `v4.1.0`).
---
## 2. 📝 Documentation "Pixel Perfect" Rules
We discovered several consistency issues during V3 development. Follow these rules STRICTLY.
We discovered several consistency issues during V4 development. Follow these rules STRICTLY.
### A. Table of Contents (TOC) Anchors
@@ -124,21 +117,21 @@ GitHub's anchor generation breaks if headers have emojis.
If you update installation instructions or tool compatibility, you MUST update all 3 files:
1. `README.md` (Source of Truth)
2. `GETTING_STARTED.md` (Beginner Guide)
3. `FAQ.md` (Troubleshooting)
2. `docs/GETTING_STARTED.md` (Beginner Guide)
3. `docs/FAQ.md` (Troubleshooting)
_Common pitfall: Updating the clone URL in README but leaving an old one in FAQ._
### C. Statistics Consistency (CRITICAL)
If you add/remove skills, you **MUST** ensure the total count is identical in ALL locations.
**Do not allow drift** (e.g., 356 in title, 354 in header).
**Do not allow drift** (e.g., 560 in title, 558 in header).
Locations to check:
1. **Title of `README.md`**: "356+ Agentic Skills..."
2. **`## Full Skill Registry (356/356)` header**.
3. **`GETTING_STARTED.md` intro**.
1. **Title of `README.md`**: "560+ Agentic Skills..."
2. **`## Full Skill Registry (560/560)` header**.
3. **`docs/GETTING_STARTED.md` intro**.
### D. Credits Policy (Who goes where?)
@@ -166,7 +159,7 @@ Reject any PR that fails this:
4. **Examples**: Copy-pasteable code blocks?
5. **Actions**: "Run this command" vs "Think about this".
### B. Risk Labels (V3)
### B. Risk Labels (V4)
- ⚪ **Safe**: Default.
- 🔴 **Risk**: Destructive/Security tools. MUST have `[Authorized Use Only]` warning.
@@ -183,8 +176,8 @@ When cutting a new version (e.g., V4):
3. **Bump Version**: Update header in `README.md`.
4. **Tag Release**:
```bash
git tag -a v3.0.0 -m "V3 Enterprise Edition"
git push origin v3.0.0
git tag -a v4.0.0 -m "V4 Enterprise Edition"
git push origin v4.0.0
```
### 📋 Release Note Template

View File

@@ -37,6 +37,17 @@ jobs:
run: |
python3 scripts/update_readme.py
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install npm dependencies
run: npm ci
- name: 📦 Build catalog
run: npm run catalog
- name: Set up GitHub credentials (for auto-sync)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
@@ -47,12 +58,12 @@ jobs:
- name: Auto-commit registry drift (main only)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
# Se non ci sono cambi, esci senza errore
# If no changes, exit successfully
git diff --quiet && exit 0
git add README.md skills_index.json || true
git add README.md skills_index.json data/catalog.json data/bundles.json data/aliases.json CATALOG.md || true
# Se non c'è niente da committare, esci senza errore
# If nothing to commit, exit successfully
git diff --cached --quiet && exit 0
git commit -m "chore: sync generated registry files [ci skip]"
@@ -61,13 +72,12 @@ jobs:
- name: 🚨 Check for Uncommitted Drift
run: |
if ! git diff --quiet; then
echo "❌ Detected uncommitted changes produced by registry/readme scripts."
echo "❌ Detected uncommitted changes produced by registry/readme/catalog scripts."
echo
echo "To fix locally, run the FULL Validation Chain, then commit and push:"
echo " python3 scripts/validate_skills.py"
echo " python3 scripts/generate_index.py"
echo " python3 scripts/update_readme.py"
echo " git add README.md skills_index.json"
echo " npm run chain"
echo " npm run catalog"
echo " git add README.md skills_index.json data/catalog.json data/bundles.json data/aliases.json CATALOG.md"
echo " git commit -m \"chore: sync generated registry files\""
echo " git push"
exit 1

21
.gitignore vendored
View File

@@ -1,7 +1,26 @@
node_modules/
walkthrough.md
.agent/rules/
.gemini/
LOCAL_CONFIG.md
data/node_modules
# Temporary analysis and report files
*_REPORT.md
*_ANALYSIS*.md
*_COUNT.md
*_SUMMARY.md
*_analysis.json
*_validation.json
*_results.json
voltagent_*.json
similar_skills_*.json
remaining_*.json
html_*.json
# Temporary analysis scripts
scripts/*voltagent*.py
scripts/*html*.py
scripts/*similar*.py
scripts/*count*.py

View File

@@ -1,16 +1,17 @@
# Skill Catalog
Generated at: 2026-01-28T16:10:28.837Z
Generated at: 2026-01-30T19:29:11.960Z
Total skills: 552
Total skills: 617
## architecture (52)
## architecture (58)
| Skill | Description | Tags | Triggers |
| --- | --- | --- | --- |
| `architect-review` | Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system desi... | | architect, review, software, specializing, architecture, clean, microservices, event, driven, ddd, reviews, designs |
| `architecture` | Architectural decision-making framework. Requirements analysis, trade-off evaluation, ADR documentation. Use when making architecture decisions or analyzing ... | architecture | architecture, architectural, decision, making, framework, requirements, analysis, trade, off, evaluation, adr, documentation |
| `architecture-decision-records` | Write and maintain Architecture Decision Records (ADRs) following best practices for technical decision documentation. Use when documenting significant techn... | architecture, decision, records | architecture, decision, records, write, maintain, adrs, following, technical, documentation, documenting, significant, decisions |
| `automate-whatsapp` | Build WhatsApp automations with Kapso workflows: configure WhatsApp triggers, edit workflow graphs, manage executions, deploy functions, and use databases/in... | automate, whatsapp | automate, whatsapp, automations, kapso, configure, triggers, edit, graphs, executions, deploy, functions, databases |
| `avalonia-viewmodels-zafiro` | Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI. | avalonia, viewmodels, zafiro | avalonia, viewmodels, zafiro, optimal, viewmodel, wizard, creation, reactiveui |
| `bash-linux` | Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems. | bash, linux | bash, linux, terminal, critical, commands, piping, error, handling, scripting, working, macos |
| `binary-analysis-patterns` | Master binary analysis patterns including disassembly, decompilation, control flow analysis, and code pattern recognition. Use when analyzing executables, un... | binary | binary, analysis, including, disassembly, decompilation, control, flow, code, recognition, analyzing, executables, understanding |
@@ -23,6 +24,7 @@ Total skills: 552
| `code-refactoring-refactor-clean` | You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and r... | code, refactoring, refactor, clean | code, refactoring, refactor, clean, specializing, principles, solid, software, engineering, analyze, provided, improve |
| `codebase-cleanup-refactor-clean` | You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and r... | codebase, cleanup, refactor, clean | codebase, cleanup, refactor, clean, code, refactoring, specializing, principles, solid, software, engineering, analyze |
| `competitor-alternatives` | When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'v... | competitor, alternatives | competitor, alternatives, user, wants, comparison, alternative, pages, seo, sales, enablement, mentions, page |
| `context-degradation` | Recognize patterns of context failure: lost-in-middle, poisoning, distraction, and clash | degradation | degradation, context, recognize, failure, lost, middle, poisoning, distraction, clash |
| `core-components` | Core component library and design system patterns. Use when building UI, using design tokens, or working with the component library. | core, components | core, components, component, library, building, ui, tokens, working |
| `cpp-pro` | Write idiomatic C++ code with modern features, RAII, smart pointers, and STL algorithms. Handles templates, move semantics, and performance optimization. Use... | cpp | cpp, pro, write, idiomatic, code, features, raii, smart, pointers, stl, algorithms, move |
| `cqrs-implementation` | Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or bu... | cqrs | cqrs, command, query, responsibility, segregation, scalable, architectures, separating, read, write, models, optimizing |
@@ -41,6 +43,8 @@ Total skills: 552
| `julia-pro` | Master Julia 1.10+ with modern features, performance optimization, multiple dispatch, and production-ready practices. Expert in the Julia ecosystem including... | julia | julia, pro, 10, features, performance, optimization, multiple, dispatch, ecosystem, including, package, scientific |
| `minecraft-bukkit-pro` | Master Minecraft server plugin development with Bukkit, Spigot, and Paper APIs. Specializes in event-driven architecture, command systems, world manipulation... | minecraft, bukkit | minecraft, bukkit, pro, server, plugin, development, spigot, paper, apis, specializes, event, driven |
| `monorepo-architect` | Expert in monorepo architecture, build systems, and dependency management at scale. Masters Nx, Turborepo, Bazel, and Lerna for efficient multi-project devel... | monorepo | monorepo, architect, architecture, dependency, scale, masters, nx, turborepo, bazel, lerna, efficient, multi |
| `multi-agent-patterns` | Master orchestrator, peer-to-peer, and hierarchical multi-agent architectures | multi, agent | multi, agent, orchestrator, peer, hierarchical, architectures |
| `n8n-mcp-tools-expert` | Expert guide for using n8n-mcp MCP tools effectively. Use when searching for nodes, validating configurations, accessing templates, managing workflows, or us... | n8n, mcp | n8n, mcp, effectively, searching, nodes, validating, configurations, accessing, managing, any, provides, selection |
| `nestjs-expert` | Nest.js framework expert specializing in module architecture, dependency injection, middleware, guards, interceptors, testing with Jest/Supertest, TypeORM/Mo... | nestjs | nestjs, nest, js, framework, specializing, module, architecture, dependency, injection, middleware, guards, interceptors |
| `nx-workspace-patterns` | Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected com... | nx, workspace | nx, workspace, configure, optimize, monorepo, workspaces, setting, up, configuring, boundaries, optimizing, caching |
| `on-call-handoff-patterns` | Master on-call shift handoffs with context transfer, escalation procedures, and documentation. Use when transitioning on-call responsibilities, documenting s... | on, call, handoff | on, call, handoff, shift, handoffs, context, transfer, escalation, procedures, documentation, transitioning, responsibilities |
@@ -56,12 +60,14 @@ Total skills: 552
| `tailwind-design-system` | Build scalable design systems with Tailwind CSS, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implemen... | tailwind | tailwind, scalable, css, tokens, component, libraries, responsive, creating, implementing, standardizing, ui |
| `tailwind-patterns` | Tailwind CSS v4 principles. CSS-first configuration, container queries, modern patterns, design token architecture. | tailwind | tailwind, css, v4, principles, first, configuration, container, queries, token, architecture |
| `testing-patterns` | Jest testing patterns, factory functions, mocking strategies, and TDD workflow. Use when writing unit tests, creating test factories, or following TDD red-gr... | | testing, jest, factory, functions, mocking, tdd, writing, unit, tests, creating, test, factories |
| `tool-design` | Build tools that agents can use effectively, including architectural reduction patterns | | agents, effectively, including, architectural, reduction |
| `unreal-engine-cpp-pro` | Expert guide for Unreal Engine 5.x C++ development, covering UObject hygiene, performance patterns, and best practices. | unreal, engine, cpp | unreal, engine, cpp, pro, development, covering, uobject, hygiene, performance |
| `wcag-audit-patterns` | Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fi... | wcag, audit | wcag, audit, conduct, accessibility, audits, automated, testing, manual, verification, remediation, guidance, auditing |
| `workflow-orchestration-patterns` | Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism cons... | | orchestration, durable, temporal, distributed, covers, vs, activity, separation, saga, state, determinism, constraints |
| `workflow-patterns` | Use this skill when implementing tasks according to Conductor's TDD workflow, handling phase checkpoints, managing git commits for tasks, or understanding th... | | skill, implementing, tasks, according, conductor, tdd, handling, phase, checkpoints, managing, git, commits |
| `zapier-make-patterns` | No-code automation democratizes workflow building. Zapier and Make (formerly Integromat) let non-developers automate business processes without writing code.... | zapier, make | zapier, make, no, code, automation, democratizes, building, formerly, integromat, let, non, developers |
## business (35)
## business (37)
| Skill | Description | Tags | Triggers |
| --- | --- | --- | --- |
@@ -71,6 +77,7 @@ Total skills: 552
| `context-driven-development` | Use this skill when working with Conductor's context-driven development methodology, managing project context artifacts, or understanding the relationship be... | driven | driven, context, development, skill, working, conductor, methodology, managing, artifacts, understanding, relationship, between |
| `copy-editing` | When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,'... | copy, editing | copy, editing, user, wants, edit, review, improve, existing, marketing, mentions, my, feedback |
| `copywriting` | Use this skill when writing, rewriting, or improving marketing copy for any page (homepage, landing page, pricing, feature, product, or about page). This ski... | copywriting | copywriting, skill, writing, rewriting, improving, marketing, copy, any, page, homepage, landing, pricing |
| `deep-research` | Execute autonomous multi-step research using Google Gemini Deep Research Agent. Use for: market analysis, competitive landscaping, literature reviews, techni... | deep, research | deep, research, execute, autonomous, multi, step, google, gemini, agent, market, analysis, competitive |
| `defi-protocol-templates` | Implement DeFi protocols with production-ready templates for staking, AMMs, governance, and lending systems. Use when building decentralized finance applicat... | defi, protocol | defi, protocol, protocols, staking, amms, governance, lending, building, decentralized, finance, applications, smart |
| `employment-contract-templates` | Create employment contracts, offer letters, and HR policy documents following legal best practices. Use when drafting employment agreements, creating HR poli... | employment, contract | employment, contract, contracts, offer, letters, hr, policy, documents, following, legal, drafting, agreements |
| `framework-migration-legacy-modernize` | Orchestrate a comprehensive legacy system modernization using the strangler fig pattern, enabling gradual replacement of outdated components while maintainin... | framework, migration, legacy, modernize | framework, migration, legacy, modernize, orchestrate, modernization, strangler, fig, enabling, gradual, replacement, outdated |
@@ -84,6 +91,7 @@ Total skills: 552
| `paywall-upgrade-cro` | When the user wants to create or optimize in-app paywalls, upgrade screens, upsell modals, or feature gates. Also use when the user mentions "paywall," "upgr... | paywall, upgrade, cro | paywall, upgrade, cro, user, wants, optimize, app, paywalls, screens, upsell, modals, feature |
| `pricing-strategy` | Design pricing, packaging, and monetization strategies based on value, customer willingness to pay, and growth objectives. | pricing | pricing, packaging, monetization, value, customer, willingness, pay, growth, objectives |
| `sales-automator` | Draft cold emails, follow-ups, and proposal templates. Creates pricing pages, case studies, and sales scripts. Use PROACTIVELY for sales outreach or lead nur... | sales, automator | sales, automator, draft, cold, emails, follow, ups, proposal, creates, pricing, pages, case |
| `screenshots` | Generate marketing screenshots of your app using Playwright. Use when the user wants to create screenshots for Product Hunt, social media, landing pages, or ... | screenshots | screenshots, generate, marketing, app, playwright, user, wants, product, hunt, social, media, landing |
| `scroll-experience` | Expert in building immersive scroll-driven experiences - parallax storytelling, scroll animations, interactive narratives, and cinematic web experiences. Lik... | scroll, experience | scroll, experience, building, immersive, driven, experiences, parallax, storytelling, animations, interactive, narratives, cinematic |
| `seo-cannibalization-detector` | Analyzes multiple provided pages to identify keyword overlap and potential cannibalization issues. Suggests differentiation strategies. Use PROACTIVELY when ... | seo, cannibalization, detector | seo, cannibalization, detector, analyzes, multiple, provided, pages, identify, keyword, overlap, potential, issues |
| `seo-content-auditor` | Analyzes provided content for quality, E-E-A-T signals, and SEO best practices. Scores content and provides improvement recommendations based on established ... | seo, content, auditor | seo, content, auditor, analyzes, provided, quality, signals, scores, provides, improvement, recommendations, established |
@@ -101,7 +109,7 @@ Total skills: 552
| `startup-financial-modeling` | This skill should be used when the user asks to "create financial projections", "build a financial model", "forecast revenue", "calculate burn rate", "estima... | startup, financial, modeling | startup, financial, modeling, skill, should, used, user, asks, projections, model, forecast, revenue |
| `team-composition-analysis` | This skill should be used when the user asks to "plan team structure", "determine hiring needs", "design org chart", "calculate compensation", "plan equity a... | team, composition | team, composition, analysis, skill, should, used, user, asks, plan, structure, determine, hiring |
## data-ai (81)
## data-ai (92)
| Skill | Description | Tags | Triggers |
| --- | --- | --- | --- |
@@ -114,12 +122,14 @@ Total skills: 552
| `api-documenter` | Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build com... | api, documenter | api, documenter, documentation, openapi, ai, powered, developer, experience, interactive, docs, generate, sdks |
| `autonomous-agent-patterns` | Design patterns for building autonomous coding agents. Covers tool integration, permission systems, browser automation, and human-in-the-loop workflows. Use ... | autonomous, agent | autonomous, agent, building, coding, agents, covers, integration, permission, browser, automation, human, loop |
| `autonomous-agents` | Autonomous agents are AI systems that can independently decompose goals, plan actions, execute tools, and self-correct without constant human guidance. The c... | autonomous, agents | autonomous, agents, ai, independently, decompose, goals, plan, actions, execute, self, correct, without |
| `beautiful-prose` | Hard-edged writing style contract for timeless, forceful English prose without AI tics | beautiful, prose | beautiful, prose, hard, edged, writing, style, contract, timeless, forceful, english, without, ai |
| `behavioral-modes` | AI operational modes (brainstorm, implement, debug, review, teach, ship, orchestrate). Use to adapt behavior based on task type. | behavioral, modes | behavioral, modes, ai, operational, brainstorm, debug, review, teach, ship, orchestrate, adapt, behavior |
| `blockrun` | Use when user needs capabilities Claude lacks (image generation, real-time X/Twitter data) or explicitly requests external models ("blockrun", "use grok", "u... | blockrun | blockrun, user, capabilities, claude, lacks, image, generation, real, time, twitter, data, explicitly |
| `browser-automation` | Browser automation powers web testing, scraping, and AI agent interactions. The difference between a flaky script and a reliable system comes down to underst... | browser | browser, automation, powers, web, testing, scraping, ai, agent, interactions, difference, between, flaky |
| `business-analyst` | Master modern business analysis with AI-powered analytics, real-time dashboards, and data-driven insights. Build comprehensive KPI frameworks, predictive mod... | business, analyst | business, analyst, analysis, ai, powered, analytics, real, time, dashboards, data, driven, insights |
| `cc-skill-backend-patterns` | Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes. | cc, skill, backend | cc, skill, backend, architecture, api, database, optimization, server, side, node, js, express |
| `cc-skill-clickhouse-io` | ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads. | cc, skill, clickhouse, io | cc, skill, clickhouse, io, database, query, optimization, analytics, data, engineering, high, performance |
| `clarity-gate` | Pre-ingestion verification for epistemic quality in RAG systems with 9-point verification and Two-Round HITL workflow | clarity, gate | clarity, gate, pre, ingestion, verification, epistemic, quality, rag, point, two, round, hitl |
| `code-documentation-doc-generate` | You are a documentation expert specializing in creating comprehensive, maintainable documentation from code. Generate API docs, architecture diagrams, user g... | code, documentation, doc, generate | code, documentation, doc, generate, specializing, creating, maintainable, api, docs, architecture, diagrams, user |
| `codex-review` | Professional code review with auto CHANGELOG generation, integrated with Codex AI | codex | codex, review, professional, code, auto, changelog, generation, integrated, ai |
| `content-marketer` | Elite content marketing strategist specializing in AI-powered content creation, omnichannel distribution, SEO optimization, and data-driven performance marke... | content, marketer | content, marketer, elite, marketing, strategist, specializing, ai, powered, creation, omnichannel, distribution, seo |
@@ -138,6 +148,12 @@ Total skills: 552
| `documentation-generation-doc-generate` | You are a documentation expert specializing in creating comprehensive, maintainable documentation from code. Generate API docs, architecture diagrams, user g... | documentation, generation, doc, generate | documentation, generation, doc, generate, specializing, creating, maintainable, code, api, docs, architecture, diagrams |
| `documentation-templates` | Documentation templates and structure guidelines. README, API docs, code comments, and AI-friendly documentation. | documentation | documentation, structure, guidelines, readme, api, docs, code, comments, ai, friendly |
| `embedding-strategies` | Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optim... | embedding, strategies | embedding, strategies, select, optimize, models, semantic, search, rag, applications, choosing, implementing, chunking |
| `fal-audio` | Text-to-speech and speech-to-text using fal.ai audio models | fal, audio | fal, audio, text, speech, ai, models |
| `fal-generate` | Generate images and videos using fal.ai AI models | fal, generate | fal, generate, images, videos, ai, models |
| `fal-image-edit` | AI-powered image editing with style transfer and object removal | fal, image, edit | fal, image, edit, ai, powered, editing, style, transfer, object, removal |
| `fal-upscale` | Upscale and enhance image and video resolution using AI | fal, upscale | fal, upscale, enhance, image, video, resolution, ai |
| `fal-workflow` | Generate workflow JSON files for chaining AI models | fal | fal, generate, json, files, chaining, ai, models |
| `fp-ts-react` | Practical patterns for using fp-ts with React - hooks, state, forms, data fetching. Use when building React apps with functional programming patterns. Works ... | fp, ts, react | fp, ts, react, practical, hooks, state, forms, data, fetching, building, apps, functional |
| `frontend-dev-guidelines` | Opinionated frontend development standards for modern React + TypeScript applications. Covers Suspense-first data fetching, lazy loading, feature-based archi... | frontend, dev, guidelines | frontend, dev, guidelines, opinionated, development, standards, react, typescript, applications, covers, suspense, first |
| `geo-fundamentals` | Generative Engine Optimization for AI search engines (ChatGPT, Claude, Perplexity). | geo, fundamentals | geo, fundamentals, generative, engine, optimization, ai, search, engines, chatgpt, claude, perplexity |
| `graphql` | GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful al... | graphql | graphql, gives, clients, exactly, data, no, less, one, endpoint, typed, schema, introspection |
@@ -149,6 +165,7 @@ Total skills: 552
| `llm-application-dev-langchain-agent` | You are an expert LangChain agent developer specializing in production-grade AI systems using LangChain 0.1+ and LangGraph. | llm, application, dev, langchain, agent | llm, application, dev, langchain, agent, developer, specializing, grade, ai, langgraph |
| `llm-application-dev-prompt-optimize` | You are an expert prompt engineer specializing in crafting effective prompts for LLMs through advanced techniques including constitutional AI, chain-of-thoug... | llm, application, dev, prompt, optimize | llm, application, dev, prompt, optimize, engineer, specializing, crafting, effective, prompts, llms, through |
| `llm-evaluation` | Implement comprehensive evaluation strategies for LLM applications using automated metrics, human feedback, and benchmarking. Use when testing LLM performanc... | llm, evaluation | llm, evaluation, applications, automated, metrics, human, feedback, benchmarking, testing, performance, measuring, ai |
| `nanobanana-ppt-skills` | AI-powered PPT generation with document analysis and styled images | nanobanana, ppt, skills | nanobanana, ppt, skills, ai, powered, generation, document, analysis, styled, images |
| `neon-postgres` | Expert patterns for Neon serverless Postgres, branching, connection pooling, and Prisma/Drizzle integration Use when: neon database, serverless postgres, dat... | neon, postgres | neon, postgres, serverless, branching, connection, pooling, prisma, drizzle, integration, database |
| `nextjs-app-router-patterns` | Master Next.js 14+ App Router with Server Components, streaming, parallel routes, and advanced data fetching. Use when building Next.js applications, impleme... | nextjs, app, router | nextjs, app, router, next, js, 14, server, components, streaming, parallel, routes, data |
| `nextjs-best-practices` | Next.js App Router principles. Server Components, data fetching, routing patterns. | nextjs, best, practices | nextjs, best, practices, next, js, app, router, principles, server, components, data, fetching |
@@ -171,6 +188,7 @@ Total skills: 552
| `senior-architect` | Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin, F... | senior | senior, architect, software, architecture, skill, designing, scalable, maintainable, reactjs, nextjs, nodejs, express |
| `seo-audit` | Diagnose and audit SEO issues affecting crawlability, indexation, rankings, and organic performance. Use when the user asks for an SEO audit, technical SEO r... | seo, audit | seo, audit, diagnose, issues, affecting, crawlability, indexation, rankings, organic, performance, user, asks |
| `similarity-search-patterns` | Implement efficient similarity search with vector databases. Use when building semantic search, implementing nearest neighbor queries, or optimizing retrieva... | similarity, search | similarity, search, efficient, vector, databases, building, semantic, implementing, nearest, neighbor, queries, optimizing |
| `skill-seekers` | -Automatically convert documentation websites, GitHub repositories, and PDFs into Claude AI skills in minutes. | skill, seekers | skill, seekers, automatically, convert, documentation, websites, github, repositories, pdfs, claude, ai, skills |
| `spark-optimization` | Optimize Apache Spark jobs with partitioning, caching, shuffle optimization, and memory tuning. Use when improving Spark performance, debugging slow jobs, or... | spark, optimization | spark, optimization, optimize, apache, jobs, partitioning, caching, shuffle, memory, tuning, improving, performance |
| `sql-optimization-patterns` | Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when de... | sql, optimization | sql, optimization, query, indexing, explain, analysis, dramatically, improve, database, performance, eliminate, slow |
| `sqlmap-database-pentesting` | This skill should be used when the user asks to "automate SQL injection testing," "enumerate database structure," "extract database credentials using sqlmap,... | sqlmap, database, pentesting | sqlmap, database, pentesting, penetration, testing, skill, should, used, user, asks, automate, sql |
@@ -181,13 +199,14 @@ Total skills: 552
| `unity-ecs-patterns` | Master Unity ECS (Entity Component System) with DOTS, Jobs, and Burst for high-performance game development. Use when building data-oriented games, optimizin... | unity, ecs | unity, ecs, entity, component, dots, jobs, burst, high, performance, game, development, building |
| `vector-database-engineer` | Expert in vector databases, embedding strategies, and semantic search implementation. Masters Pinecone, Weaviate, Qdrant, Milvus, and pgvector for RAG applic... | vector, database | vector, database, engineer, databases, embedding, semantic, search, masters, pinecone, weaviate, qdrant, milvus |
| `vector-index-tuning` | Optimize vector index performance for latency, recall, and memory. Use when tuning HNSW parameters, selecting quantization strategies, or scaling vector sear... | vector, index, tuning | vector, index, tuning, optimize, performance, latency, recall, memory, hnsw, parameters, selecting, quantization |
| `vexor` | Vector-powered CLI for semantic file search with a Claude/Codex skill | vexor | vexor, vector, powered, cli, semantic, file, search, claude, codex, skill |
| `voice-ai-development` | Expert in building voice AI applications - from real-time voice agents to voice-enabled apps. Covers OpenAI Realtime API, Vapi for voice agents, Deepgram for... | voice, ai | voice, ai, development, building, applications, real, time, agents, enabled, apps, covers, openai |
| `voice-ai-engine-development` | Build real-time conversational AI voice engines using async worker pipelines, streaming transcription, LLM agents, and TTS synthesis with interrupt handling ... | voice, ai, engine | voice, ai, engine, development, real, time, conversational, engines, async, worker, pipelines, streaming |
| `web-artifacts-builder` | Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use ... | web, artifacts, builder | web, artifacts, builder, suite, creating, elaborate, multi, component, claude, ai, html, frontend |
| `xlsx` | Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work ... | xlsx | xlsx, spreadsheet, creation, editing, analysis, formulas, formatting, data, visualization, claude, work, spreadsheets |
| `xlsx-official` | Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work ... | xlsx, official | xlsx, official, spreadsheet, creation, editing, analysis, formulas, formatting, data, visualization, claude, work |
## development (72)
## development (80)
| Skill | Description | Tags | Triggers |
| --- | --- | --- | --- |
@@ -214,9 +233,12 @@ Total skills: 552
| `fastapi-pro` | Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROA... | fastapi | fastapi, pro, high, performance, async, apis, sqlalchemy, pydantic, v2, microservices, websockets, python |
| `fastapi-templates` | Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applicati... | fastapi | fastapi, async, dependency, injection, error, handling, building, new, applications, setting, up, backend |
| `firecrawl-scraper` | Deep web scraping, screenshots, PDF parsing, and website crawling using Firecrawl API | firecrawl, scraper | firecrawl, scraper, deep, web, scraping, screenshots, pdf, parsing, website, crawling, api |
| `fp-ts-errors` | Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with f... | fp, ts, errors | fp, ts, errors, handle, values, either, taskeither, cleaner, predictable, typescript, code, implementing |
| `fp-ts-pragmatic` | A practical, jargon-free guide to fp-ts functional programming - the 80/20 approach that gets results without the academic overhead. Use when writing TypeScr... | fp, ts, pragmatic | fp, ts, pragmatic, practical, jargon, free, functional, programming, 80, 20, approach, gets |
| `frontend-design` | Create distinctive, production-grade frontend interfaces with intentional aesthetics, high craft, and non-generic visual identity. Use when building or styli... | frontend | frontend, distinctive, grade, interfaces, intentional, aesthetics, high, craft, non, generic, visual, identity |
| `frontend-developer` | Build React components, implement responsive layouts, and handle client-side state management. Masters React 19, Next.js 15, and modern frontend architecture... | frontend | frontend, developer, react, components, responsive, layouts, handle, client, side, state, masters, 19 |
| `frontend-mobile-development-component-scaffold` | You are a React component architecture expert specializing in scaffolding production-ready, accessible, and performant components. Generate complete componen... | frontend, mobile, component | frontend, mobile, component, development, scaffold, react, architecture, specializing, scaffolding, accessible, performant, components |
| `frontend-slides` | Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a... | frontend, slides | frontend, slides, stunning, animation, rich, html, presentations, scratch, converting, powerpoint, files, user |
| `go-concurrency-patterns` | Master Go concurrency with goroutines, channels, sync primitives, and context. Use when building concurrent Go applications, implementing worker pools, or de... | go, concurrency | go, concurrency, goroutines, channels, sync, primitives, context, building, concurrent, applications, implementing, worker |
| `golang-pro` | Master Go 1.21+ with modern patterns, advanced concurrency, performance optimization, and production-ready microservices. Expert in the latest Go ecosystem i... | golang | golang, pro, go, 21, concurrency, performance, optimization, microservices, latest, ecosystem, including, generics |
| `hubspot-integration` | Expert patterns for HubSpot CRM integration including OAuth authentication, CRM objects, associations, batch operations, webhooks, and custom objects. Covers... | hubspot, integration | hubspot, integration, crm, including, oauth, authentication, objects, associations, batch, operations, webhooks, custom |
@@ -225,12 +247,16 @@ Total skills: 552
| `javascript-testing-patterns` | Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fi... | javascript | javascript, testing, jest, vitest, library, unit, tests, integration, mocking, fixtures, test, driven |
| `javascript-typescript-typescript-scaffold` | You are a TypeScript project architecture expert specializing in scaffolding production-ready Node.js and frontend applications. Generate complete project st... | javascript, typescript | javascript, typescript, scaffold, architecture, specializing, scaffolding, node, js, frontend, applications, generate, complete |
| `launch-strategy` | When the user wants to plan a product launch, feature announcement, or release strategy. Also use when the user mentions 'launch,' 'Product Hunt,' 'feature r... | launch | launch, user, wants, plan, product, feature, announcement, release, mentions, hunt, go, market |
| `makepad-skills` | Makepad UI development skills for Rust apps: setup, patterns, shaders, packaging, and troubleshooting. | makepad, skills | makepad, skills, ui, development, rust, apps, setup, shaders, packaging, troubleshooting |
| `mcp-builder` | Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use whe... | mcp, builder | mcp, builder, creating, high, quality, model, context, protocol, servers, enable, llms, interact |
| `memory-safety-patterns` | Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, ... | memory, safety | memory, safety, safe, programming, raii, ownership, smart, pointers, resource, rust, writing, code |
| `mobile-design` | Mobile-first design and engineering doctrine for iOS and Android apps. Covers touch interaction, performance, platform conventions, offline behavior, and mob... | mobile | mobile, first, engineering, doctrine, ios, android, apps, covers, touch, interaction, performance, platform |
| `mobile-developer` | Develop React Native, Flutter, or native mobile apps with modern architecture patterns. Masters cross-platform development, native integrations, offline sync... | mobile | mobile, developer, develop, react, native, flutter, apps, architecture, masters, cross, platform, development |
| `modern-javascript-patterns` | Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional progra... | modern, javascript | modern, javascript, es6, features, including, async, await, destructuring, spread, operators, arrow, functions |
| `multi-platform-apps-multi-platform` | Build and deploy the same feature consistently across web, mobile, and desktop platforms using API-first architecture and parallel implementation strategies. | multi, platform, apps | multi, platform, apps, deploy, same, feature, consistently, web, mobile, desktop, platforms, api |
| `n8n-code-python` | Write Python code in n8n Code nodes. Use when writing Python in n8n, using _input/_json/_node syntax, working with standard library, or need to understand Py... | n8n, code, python | n8n, code, python, write, nodes, writing, input, json, node, syntax, working, standard |
| `n8n-node-configuration` | Operation-aware node configuration guidance. Use when configuring nodes, understanding property dependencies, determining required fields, choosing between g... | n8n, node, configuration | n8n, node, configuration, operation, aware, guidance, configuring, nodes, understanding, property, dependencies, determining |
| `observe-whatsapp` | Observe and troubleshoot WhatsApp in Kapso: debug message delivery, inspect webhook deliveries/retries, triage API errors, and run health checks. Use when in... | observe, whatsapp | observe, whatsapp, troubleshoot, kapso, debug, message, delivery, inspect, webhook, deliveries, retries, triage |
| `product-manager-toolkit` | Comprehensive toolkit for product managers including RICE prioritization, customer interview analysis, PRD templates, discovery frameworks, and go-to-market ... | product, manager | product, manager, toolkit, managers, including, rice, prioritization, customer, interview, analysis, prd, discovery |
| `python-development-python-scaffold` | You are a Python project architecture expert specializing in scaffolding production-ready Python applications. Generate complete project structures with mode... | python | python, development, scaffold, architecture, specializing, scaffolding, applications, generate, complete, structures, tooling, uv |
| `python-packaging` | Create distributable Python packages with proper project structure, setup.py/pyproject.toml, and publishing to PyPI. Use when packaging Python libraries, cre... | python, packaging | python, packaging, distributable, packages, proper, structure, setup, py, pyproject, toml, publishing, pypi |
@@ -253,6 +279,7 @@ Total skills: 552
| `shopify-development` | Build Shopify apps, extensions, themes using GraphQL Admin API, Shopify CLI, Polaris UI, and Liquid.
TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify, development, apps, extensions, themes, graphql, admin, api, cli, polaris, ui, liquid |
| `slack-bot-builder` | Build Slack apps using the Bolt framework across Python, JavaScript, and Java. Covers Block Kit for rich UIs, interactive components, slash commands, event h... | slack, bot, builder | slack, bot, builder, apps, bolt, framework, python, javascript, java, covers, block, kit |
| `swiftui-expert-skill` | Write, review, or improve SwiftUI code following best practices for state management, view composition, performance, modern APIs, Swift concurrency, and iOS ... | swiftui, skill | swiftui, skill, write, review, improve, code, following, state, view, composition, performance, apis |
| `systems-programming-rust-project` | You are a Rust project architecture expert specializing in scaffolding production-ready Rust applications. Generate complete project structures with cargo to... | programming, rust | programming, rust, architecture, specializing, scaffolding, applications, generate, complete, structures, cargo, tooling, proper |
| `tavily-web` | Web search, content extraction, crawling, and research capabilities using Tavily API | tavily, web | tavily, web, search, content, extraction, crawling, research, capabilities, api |
| `telegram-mini-app` | Expert in building Telegram Mini Apps (TWA) - web apps that run inside Telegram with native-like experience. Covers the TON ecosystem, Telegram Web App API, ... | telegram, mini, app | telegram, mini, app, building, apps, twa, web, run, inside, native, like, experience |
@@ -265,7 +292,7 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `viral-generator-builder` | Expert in building shareable generator tools that go viral - name generators, quiz makers, avatar creators, personality tests, and calculator tools. Covers t... | viral, generator, builder | viral, generator, builder, building, shareable, go, name, generators, quiz, makers, avatar, creators |
| `webapp-testing` | Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing... | webapp | webapp, testing, toolkit, interacting, local, web, applications, playwright, supports, verifying, frontend, functionality |
## general (95)
## general (122)
| Skill | Description | Tags | Triggers |
| --- | --- | --- | --- |
@@ -289,21 +316,32 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `cc-skill-continuous-learning` | Development skill from everything-claude-code | cc, skill, continuous, learning | cc, skill, continuous, learning, development, everything, claude, code |
| `cc-skill-project-guidelines-example` | Project Guidelines Skill (Example) | cc, skill, guidelines, example | cc, skill, guidelines, example |
| `cc-skill-strategic-compact` | Development skill from everything-claude-code | cc, skill, strategic, compact | cc, skill, strategic, compact, development, everything, claude, code |
| `claude-ally-health` | A health assistant skill for medical information analysis, symptom tracking, and wellness guidance. | claude, ally, health | claude, ally, health, assistant, skill, medical, information, analysis, symptom, tracking, wellness, guidance |
| `claude-code-guide` | Master guide for using Claude Code effectively. Includes configuration templates, prompting strategies "Thinking" keywords, debugging techniques, and best pr... | claude, code | claude, code, effectively, includes, configuration, prompting, thinking, keywords, debugging, techniques, interacting, agent |
| `claude-scientific-skills` | Scientific research and analysis skills | claude, scientific, skills | claude, scientific, skills, research, analysis |
| `claude-speed-reader` | -Speed read Claude's responses at 600+ WPM using RSVP with Spritz-style ORP highlighting | claude, speed, reader | claude, speed, reader, read, responses, 600, wpm, rsvp, spritz, style, orp, highlighting |
| `claude-win11-speckit-update-skill` | Windows 11 system management | claude, win11, speckit, update, skill | claude, win11, speckit, update, skill, windows, 11 |
| `clean-code` | Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments | clean, code | clean, code, pragmatic, coding, standards, concise, direct, no, engineering, unnecessary, comments |
| `code-documentation-code-explain` | You are a code education expert specializing in explaining complex code through clear narratives, visual diagrams, and step-by-step breakdowns. Transform dif... | code, documentation, explain | code, documentation, explain, education, specializing, explaining, complex, through, clear, narratives, visual, diagrams |
| `code-refactoring-context-restore` | Use when working with code refactoring context restore | code, refactoring, restore | code, refactoring, restore, context, working |
| `code-refactoring-tech-debt` | You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncov... | code, refactoring, tech, debt | code, refactoring, tech, debt, technical, specializing, identifying, quantifying, prioritizing, software, analyze, codebase |
| `code-review-excellence` | Master effective code review practices to provide constructive feedback, catch bugs early, and foster knowledge sharing while maintaining team morale. Use wh... | code, excellence | code, excellence, review, effective, provide, constructive, feedback, catch, bugs, early, foster, knowledge |
| `codebase-cleanup-tech-debt` | You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncov... | codebase, cleanup, tech, debt | codebase, cleanup, tech, debt, technical, specializing, identifying, quantifying, prioritizing, software, analyze, uncover |
| `commit` | Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows convention... | commit | commit, messages, following, sentry, conventions, committing, code, changes, writing, formatting, git, history |
| `comprehensive-review-full-review` | Use when working with comprehensive review full review | comprehensive, full | comprehensive, full, review, working |
| `comprehensive-review-pr-enhance` | You are a PR optimization expert specializing in creating high-quality pull requests that facilitate efficient code reviews. Generate comprehensive PR descri... | comprehensive, pr, enhance | comprehensive, pr, enhance, review, optimization, specializing, creating, high, quality, pull, requests, facilitate |
| `concise-planning` | Use when a user asks for a plan for a coding task, to generate a clear, actionable, and atomic checklist. | concise, planning | concise, planning, user, asks, plan, coding, task, generate, clear, actionable, atomic, checklist |
| `context-compression` | Design and evaluate compression strategies for long-running sessions | compression | compression, context, evaluate, long, running, sessions |
| `context-fundamentals` | Understand what context is, why it matters, and the anatomy of context in agent systems | fundamentals | fundamentals, context, understand, what, why, matters, anatomy, agent |
| `context-management-context-restore` | Use when working with context management context restore | restore | restore, context, working |
| `context-management-context-save` | Use when working with context management context save | save | save, context, working |
| `context-optimization` | Apply compaction, masking, and caching strategies | optimization | optimization, context, apply, compaction, masking, caching |
| `create-pr` | Create pull requests following Sentry conventions. Use when opening PRs, writing PR descriptions, or preparing changes for review. Follows Sentry's code revi... | create, pr | create, pr, pull, requests, following, sentry, conventions, opening, prs, writing, descriptions, preparing |
| `culture-index` | Index and search culture documentation | culture, index | culture, index, search, documentation |
| `daily-news-report` | Scrapes content based on a preset URL list, filters high-quality technical information, and generates daily Markdown reports. | daily, news, report | daily, news, report, scrapes, content, preset, url, list, filters, high, quality, technical |
| `debugging-strategies` | Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or technology stack. Use ... | debugging, strategies | debugging, strategies, systematic, techniques, profiling, root, cause, analysis, efficiently, track, down, bugs |
| `debugging-toolkit-smart-debug` | Use when working with debugging toolkit smart debug | debugging, debug | debugging, debug, toolkit, smart, working |
| `design-md` | Analyze Stitch projects and synthesize a semantic design system into DESIGN.md files | md | md, analyze, stitch, synthesize, semantic, files |
| `dispatching-parallel-agents` | Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | dispatching, parallel, agents | dispatching, parallel, agents, facing, independent, tasks, worked, without, shared, state, sequential, dependencies |
| `docx` | Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude ... | docx | docx, document, creation, editing, analysis, tracked, changes, comments, formatting, preservation, text, extraction |
| `docx-official` | Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude ... | docx, official | docx, official, document, creation, editing, analysis, tracked, changes, comments, formatting, preservation, text |
@@ -311,21 +349,28 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `environment-setup-guide` | Guide developers through setting up development environments with proper tools, dependencies, and configurations | environment, setup | environment, setup, developers, through, setting, up, development, environments, proper, dependencies, configurations |
| `error-debugging-multi-agent-review` | Use when working with error debugging multi agent review | error, debugging, multi, agent | error, debugging, multi, agent, review, working |
| `error-diagnostics-smart-debug` | Use when working with error diagnostics smart debug | error, diagnostics, debug | error, diagnostics, debug, smart, working |
| `evaluation` | Build evaluation frameworks for agent systems | evaluation | evaluation, frameworks, agent |
| `executing-plans` | Use when you have a written implementation plan to execute in a separate session with review checkpoints | executing, plans | executing, plans, written, plan, execute, separate, session, review, checkpoints |
| `fal-platform` | Platform APIs for model management, pricing, and usage tracking | fal, platform | fal, platform, apis, model, pricing, usage, tracking |
| `ffuf-claude-skill` | Web fuzzing with ffuf | ffuf, claude, skill | ffuf, claude, skill, web, fuzzing |
| `file-organizer` | Intelligently organizes files and folders by understanding context, finding duplicates, and suggesting better organizational structures. Use when user wants ... | file, organizer | file, organizer, intelligently, organizes, files, folders, understanding, context, finding, duplicates, suggesting, better |
| `finishing-a-development-branch` | Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting s... | finishing, a, branch | finishing, a, branch, development, complete, all, tests, pass, decide, how, integrate, work |
| `fix-review` | Verify fix commits address audit findings without new bugs | fix | fix, review, verify, commits, address, audit, findings, without, new, bugs |
| `framework-migration-code-migrate` | You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migrat... | framework, migration, code, migrate | framework, migration, code, migrate, specializing, transitioning, codebases, between, frameworks, languages, versions, platforms |
| `game-development` | Game development orchestrator. Routes to platform-specific skills based on project needs. | game | game, development, orchestrator, routes, platform, specific, skills |
| `git-advanced-workflows` | Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use... | git, advanced | git, advanced, including, rebasing, cherry, picking, bisect, worktrees, reflog, maintain, clean, history |
| `git-pr-workflows-onboard` | You are an **expert onboarding specialist and knowledge transfer architect** with deep experience in remote-first organizations, technical team integration, ... | git, pr, onboard | git, pr, onboard, onboarding, knowledge, transfer, architect, deep, experience, remote, first, organizations |
| `git-pr-workflows-pr-enhance` | You are a PR optimization expert specializing in creating high-quality pull requests that facilitate efficient code reviews. Generate comprehensive PR descri... | git, pr, enhance | git, pr, enhance, optimization, specializing, creating, high, quality, pull, requests, facilitate, efficient |
| `imagen` | | imagen | imagen |
| `infinite-gratitude` | Multi-agent research skill for parallel research execution (10 agents, battle-tested with real case studies). | infinite, gratitude | infinite, gratitude, multi, agent, research, skill, parallel, execution, 10, agents, battle, tested |
| `interactive-portfolio` | Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, d... | interactive, portfolio | interactive, portfolio, building, portfolios, actually, land, jobs, clients, just, showing, work, creating |
| `last30days` | Research a topic from the last 30 days on Reddit + X + Web, become an expert, and write copy-paste-ready prompts for the user's target tool. | last30days | last30days, research, topic, last, 30, days, reddit, web, become, write, copy, paste |
| `legacy-modernizer` | Refactor legacy codebases, migrate outdated frameworks, and implement gradual modernization. Handles technical debt, dependency updates, and backward compati... | legacy, modernizer | legacy, modernizer, refactor, codebases, migrate, outdated, frameworks, gradual, modernization, technical, debt, dependency |
| `linear-claude-skill` | Manage Linear issues, projects, and teams | linear, claude, skill | linear, claude, skill, issues, teams |
| `lint-and-validate` | Automatic quality control, linting, and static analysis procedures. Use after every code modification to ensure syntax correctness and project standards. Tri... | lint, and, validate | lint, and, validate, automatic, quality, control, linting, static, analysis, procedures, after, every |
| `linux-privilege-escalation` | This skill should be used when the user asks to "escalate privileges on Linux", "find privesc vectors on Linux systems", "exploit sudo misconfigurations", "a... | linux, privilege, escalation | linux, privilege, escalation, skill, should, used, user, asks, escalate, privileges, find, privesc |
| `linux-shell-scripting` | This skill should be used when the user asks to "create bash scripts", "automate Linux tasks", "monitor system resources", "backup files", "manage users", or... | linux, shell, scripting | linux, shell, scripting, scripts, skill, should, used, user, asks, bash, automate, tasks |
| `memory-systems` | Design short-term, long-term, and graph-based memory architectures | memory | memory, short, term, long, graph, architectures |
| `micro-saas-launcher` | Expert in launching small, focused SaaS products fast - the indie hacker approach to building profitable software. Covers idea validation, MVP development, p... | micro, saas, launcher | micro, saas, launcher, launching, small, products, fast, indie, hacker, approach, building, profitable |
| `monorepo-management` | Master monorepo management with Turborepo, Nx, and pnpm workspaces to build efficient, scalable multi-package repositories with optimized builds and dependen... | monorepo | monorepo, turborepo, nx, pnpm, workspaces, efficient, scalable, multi, package, repositories, optimized, dependency |
| `nft-standards` | Implement NFT standards (ERC-721, ERC-1155) with proper metadata handling, minting strategies, and marketplace integration. Use when creating NFT contracts, ... | nft, standards | nft, standards, erc, 721, 1155, proper, metadata, handling, minting, marketplace, integration, creating |
@@ -343,20 +388,27 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `pptx-official` | Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying o... | pptx, official | pptx, official, presentation, creation, editing, analysis, claude, work, presentations, files, creating, new |
| `privilege-escalation-methods` | This skill should be used when the user asks to "escalate privileges", "get root access", "become administrator", "privesc techniques", "abuse sudo", "exploi... | privilege, escalation, methods | privilege, escalation, methods, skill, should, used, user, asks, escalate, privileges, get, root |
| `prompt-library` | Curated collection of high-quality prompts for various use cases. Includes role-based prompts, task-specific templates, and prompt refinement techniques. Use... | prompt, library | prompt, library, curated, collection, high, quality, prompts, various, cases, includes, role, task |
| `readme` | When the user wants to create or update a README.md file for a project. Also use when the user says | readme | readme, user, wants, update, md, file, says |
| `receiving-code-review` | Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technic... | receiving, code | receiving, code, review, feedback, before, implementing, suggestions, especially, seems, unclear, technically, questionable |
| `referral-program` | When the user wants to create, optimize, or analyze a referral program, affiliate program, or word-of-mouth strategy. Also use when the user mentions 'referr... | referral, program | referral, program, user, wants, optimize, analyze, affiliate, word, mouth, mentions, ambassador, viral |
| `requesting-code-review` | Use when completing tasks, implementing major features, or before merging to verify work meets requirements | requesting, code | requesting, code, review, completing, tasks, implementing, major, features, before, merging, verify, work |
| `search-specialist` | Expert web researcher using advanced search techniques and synthesis. Masters search operators, result filtering, and multi-source verification. Handles comp... | search | search, web, researcher, techniques, synthesis, masters, operators, result, filtering, multi, source, verification |
| `sharp-edges` | Identify error-prone APIs and dangerous configurations | sharp, edges | sharp, edges, identify, error, prone, apis, dangerous, configurations |
| `shellcheck-configuration` | Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or ensuri... | shellcheck, configuration | shellcheck, configuration, static, analysis, usage, shell, script, quality, setting, up, linting, infrastructure |
| `signup-flow-cro` | When the user wants to optimize signup, registration, account creation, or trial activation flows. Also use when the user mentions "signup conversions," "reg... | signup, flow, cro | signup, flow, cro, user, wants, optimize, registration, account, creation, trial, activation, flows |
| `skill-creator` | Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capa... | skill, creator | skill, creator, creating, effective, skills, should, used, users, want, new, update, existing |
| `skill-rails-upgrade` | Analyze Rails apps and provide upgrade assessments | skill, rails, upgrade | skill, rails, upgrade, analyze, apps, provide, assessments |
| `slack-gif-creator` | Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users reques... | slack, gif, creator | slack, gif, creator, knowledge, utilities, creating, animated, gifs, optimized, provides, constraints, validation |
| `social-content` | When the user wants help creating, scheduling, or optimizing social media content for LinkedIn, Twitter/X, Instagram, TikTok, Facebook, or other platforms. A... | social, content | social, content, user, wants, creating, scheduling, optimizing, media, linkedin, twitter, instagram, tiktok |
| `subagent-driven-development` | Use when executing implementation plans with independent tasks in the current session | subagent, driven | subagent, driven, development, executing, plans, independent, tasks, current, session |
| `superpowers-lab` | Lab environment for Claude superpowers | superpowers, lab | superpowers, lab, environment, claude |
| `theme-factory` | Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors... | theme, factory | theme, factory, toolkit, styling, artifacts, these, slides, docs, reportings, html, landing, pages |
| `threejs-skills` | Three.js skills for creating 3D elements and interactive experiences | threejs, skills | threejs, skills, three, js, creating, 3d, elements, interactive, experiences |
| `turborepo-caching` | Configure Turborepo for efficient monorepo builds with local and remote caching. Use when setting up Turborepo, optimizing build pipelines, or implementing d... | turborepo, caching | turborepo, caching, configure, efficient, monorepo, local, remote, setting, up, optimizing, pipelines, implementing |
| `tutorial-engineer` | Creates step-by-step tutorials and educational content from code. Transforms complex concepts into progressive learning experiences with hands-on examples. U... | tutorial | tutorial, engineer, creates, step, tutorials, educational, content, code, transforms, complex, concepts, progressive |
| `ui-skills` | Opinionated, evolving constraints to guide agents when building interfaces | ui, skills | ui, skills, opinionated, evolving, constraints, agents, building, interfaces |
| `ui-ux-designer` | Create interface designs, wireframes, and design systems. Masters user research, accessibility standards, and modern design tools. Specializes in design toke... | ui, ux, designer | ui, ux, designer, interface, designs, wireframes, masters, user, research, accessibility, standards, specializes |
| `upgrading-expo` | Upgrade Expo SDK versions | upgrading, expo | upgrading, expo, upgrade, sdk, versions |
| `upstash-qstash` | Upstash QStash expert for serverless message queues, scheduled jobs, and reliable HTTP-based task delivery without managing infrastructure. Use when: qstash,... | upstash, qstash | upstash, qstash, serverless, message, queues, scheduled, jobs, reliable, http, task, delivery, without |
| `using-git-worktrees` | Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with sma... | using, git, worktrees | using, git, worktrees, starting, feature, work, isolation, current, workspace, before, executing, plans |
| `using-superpowers` | Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions | using, superpowers | using, superpowers, starting, any, conversation, establishes, how, find, skills, requiring, skill, invocation |
@@ -364,8 +416,10 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `web-performance-optimization` | Optimize website and web application performance including loading speed, Core Web Vitals, bundle size, caching strategies, and runtime performance | web, performance, optimization | web, performance, optimization, optimize, website, application, including, loading, speed, core, vitals, bundle |
| `windows-privilege-escalation` | This skill should be used when the user asks to "escalate privileges on Windows," "find Windows privesc vectors," "enumerate Windows for privilege escalation... | windows, privilege, escalation | windows, privilege, escalation, skill, should, used, user, asks, escalate, privileges, find, privesc |
| `writing-plans` | Use when you have a spec or requirements for a multi-step task, before touching code | writing, plans | writing, plans, spec, requirements, multi, step, task, before, touching, code |
| `writing-skills` | Use when creating, updating, or improving agent skills. | writing, skills | writing, skills, creating, updating, improving, agent |
| `x-article-publisher-skill` | Publish articles to X/Twitter | x, article, publisher, skill | x, article, publisher, skill, publish, articles, twitter |
## infrastructure (72)
## infrastructure (77)
| Skill | Description | Tags | Triggers |
| --- | --- | --- | --- |
@@ -374,6 +428,7 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `api-testing-observability-api-mock` | You are an API mocking expert specializing in realistic mock services for development, testing, and demos. Design mocks that simulate real API behavior and e... | api, observability, mock | api, observability, mock, testing, mocking, specializing, realistic, development, demos, mocks, simulate, real |
| `application-performance-performance-optimization` | Optimize end-to-end application performance with profiling, observability, and backend/frontend tuning. Use when coordinating performance optimization across... | application, performance, optimization | application, performance, optimization, optimize, profiling, observability, backend, frontend, tuning, coordinating, stack |
| `aws-serverless` | Specialized skill for building production-ready serverless applications on AWS. Covers Lambda functions, API Gateway, DynamoDB, SQS/SNS event-driven patterns... | aws, serverless | aws, serverless, specialized, skill, building, applications, covers, lambda, functions, api, gateway, dynamodb |
| `aws-skills` | AWS development with infrastructure automation and cloud architecture patterns | aws, skills | aws, skills, development, infrastructure, automation, cloud, architecture |
| `backend-architect` | Expert backend architect specializing in scalable API design, microservices architecture, and distributed systems. Masters REST/GraphQL/gRPC APIs, event-driv... | backend | backend, architect, specializing, scalable, api, microservices, architecture, distributed, masters, rest, graphql, grpc |
| `backend-development-feature-development` | Orchestrate end-to-end backend feature development from requirements to deployment. Use when coordinating multi-phase feature delivery across teams and servi... | backend | backend, development, feature, orchestrate, requirements, deployment, coordinating, multi, phase, delivery, teams |
| `bash-defensive-patterns` | Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requir... | bash, defensive | bash, defensive, programming, techniques, grade, scripts, writing, robust, shell, ci, cd, pipelines |
@@ -398,6 +453,7 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `error-debugging-error-trace` | You are an error tracking and observability expert specializing in implementing comprehensive error monitoring solutions. Set up error tracking systems, conf... | error, debugging, trace | error, debugging, trace, tracking, observability, specializing, implementing, monitoring, solutions, set, up, configure |
| `error-diagnostics-error-analysis` | You are an expert error analysis specialist with deep expertise in debugging distributed systems, analyzing production incidents, and implementing comprehens... | error, diagnostics | error, diagnostics, analysis, deep, expertise, debugging, distributed, analyzing, incidents, implementing, observability, solutions |
| `error-diagnostics-error-trace` | You are an error tracking and observability expert specializing in implementing comprehensive error monitoring solutions. Set up error tracking systems, conf... | error, diagnostics, trace | error, diagnostics, trace, tracking, observability, specializing, implementing, monitoring, solutions, set, up, configure |
| `expo-deployment` | Deploy Expo apps to production | expo, deployment | expo, deployment, deploy, apps |
| `file-uploads` | Expert at handling file uploads and cloud storage. Covers S3, Cloudflare R2, presigned URLs, multipart uploads, and image optimization. Knows how to handle l... | file, uploads | file, uploads, handling, cloud, storage, covers, s3, cloudflare, r2, presigned, urls, multipart |
| `flutter-expert` | Master Flutter development with Dart 3, advanced widgets, and multi-platform deployment. Handles state management, animations, testing, and performance optim... | flutter | flutter, development, dart, widgets, multi, platform, deployment, state, animations, testing, performance, optimization |
| `gcp-cloud-run` | Specialized skill for building production-ready serverless applications on GCP. Covers Cloud Run services (containerized), Cloud Run Functions (event-driven)... | gcp, cloud, run | gcp, cloud, run, specialized, skill, building, serverless, applications, covers, containerized, functions, event |
@@ -408,8 +464,10 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `gitops-workflow` | Implement GitOps workflows with ArgoCD and Flux for automated, declarative Kubernetes deployments with continuous reconciliation. Use when implementing GitOp... | gitops | gitops, argocd, flux, automated, declarative, kubernetes, deployments, continuous, reconciliation, implementing, automating, setting |
| `grafana-dashboards` | Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visua... | grafana, dashboards | grafana, dashboards, real, time, visualization, application, metrics, building, monitoring, visualizing, creating, operational |
| `helm-chart-scaffolding` | Design, organize, and manage Helm charts for templating and packaging Kubernetes applications with reusable configurations. Use when creating Helm charts, pa... | helm, chart | helm, chart, scaffolding, organize, charts, templating, packaging, kubernetes, applications, reusable, configurations, creating |
| `hugging-face-cli` | Execute Hugging Face Hub operations using the `hf` CLI. Use when the user needs to download models/datasets/spaces, upload files to Hub repositories, create ... | hugging, face, cli | hugging, face, cli, execute, hub, operations, hf, user, download, models, datasets, spaces |
| `hybrid-cloud-networking` | Configure secure, high-performance connectivity between on-premises infrastructure and cloud platforms using VPN and dedicated connections. Use when building... | hybrid, cloud, networking | hybrid, cloud, networking, configure, secure, high, performance, connectivity, between, premises, infrastructure, platforms |
| `istio-traffic-management` | Configure Istio traffic management including routing, load balancing, circuit breakers, and canary deployments. Use when implementing service mesh traffic po... | istio, traffic | istio, traffic, configure, including, routing, load, balancing, circuit, breakers, canary, deployments, implementing |
| `iterate-pr` | Iterate on a PR until CI passes. Use when you need to fix CI failures, address review feedback, or continuously push fixes until all checks are green. Automa... | iterate, pr | iterate, pr, until, ci, passes, fix, failures, address, review, feedback, continuously, push |
| `java-pro` | Master Java 21+ with modern features like virtual threads, pattern matching, and Spring Boot 3.x. Expert in the latest Java ecosystem including GraalVM, Proj... | java | java, pro, 21, features, like, virtual, threads, matching, spring, boot, latest, ecosystem |
| `kpi-dashboard-design` | Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboard... | kpi, dashboard | kpi, dashboard, effective, dashboards, metrics, selection, visualization, real, time, monitoring, building, business |
| `langfuse` | Expert in Langfuse - the open-source LLM observability platform. Covers tracing, prompt management, evaluation, datasets, and integration with LangChain, Lla... | langfuse | langfuse, open, source, llm, observability, platform, covers, tracing, prompt, evaluation, datasets, integration |
@@ -434,15 +492,16 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `sql-pro` | Master modern SQL with cloud-native databases, OLTP/OLAP optimization, and advanced query techniques. Expert in performance tuning, data modeling, and hybrid... | sql | sql, pro, cloud, native, databases, oltp, olap, optimization, query, techniques, performance, tuning |
| `temporal-python-pro` | Master Temporal workflow orchestration with Python SDK. Implements durable workflows, saga patterns, and distributed transactions. Covers async/await, testin... | temporal, python | temporal, python, pro, orchestration, sdk, implements, durable, saga, distributed, transactions, covers, async |
| `terraform-module-library` | Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure mod... | terraform, module, library | terraform, module, library, reusable, modules, aws, azure, gcp, infrastructure, following, code, creating |
| `terraform-skill` | Terraform infrastructure as code best practices | terraform, skill | terraform, skill, infrastructure, code |
| `test-automator` | Master AI-powered test automation with modern frameworks, self-healing tests, and comprehensive quality engineering. Build scalable testing strategies with a... | automator | automator, test, ai, powered, automation, frameworks, self, healing, tests, quality, engineering, scalable |
| `unity-developer` | Build Unity games with optimized C# scripts, efficient rendering, and proper asset management. Masters Unity 6 LTS, URP/HDRP pipelines, and cross-platform de... | unity | unity, developer, games, optimized, scripts, efficient, rendering, proper, asset, masters, lts, urp |
| `vercel-deploy-claimable` | Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as | vercel, deploy, claimable | vercel, deploy, claimable, applications, websites, skill, user, requests, deployment, actions, such |
| `vercel-deployment` | Expert knowledge for deploying to Vercel with Next.js Use when: vercel, deploy, deployment, hosting, production. | vercel, deployment | vercel, deployment, knowledge, deploying, next, js, deploy, hosting |
| `voice-agents` | Voice agents represent the frontier of AI interaction - humans speaking naturally with AI systems. The challenge isn't just speech recognition and synthesis,... | voice, agents | voice, agents, represent, frontier, ai, interaction, humans, speaking, naturally, challenge, isn, just |
| `wireshark-analysis` | This skill should be used when the user asks to "analyze network traffic with Wireshark", "capture packets for troubleshooting", "filter PCAP files", "follow... | wireshark | wireshark, network, traffic, analysis, skill, should, used, user, asks, analyze, capture, packets |
| `workflow-automation` | Workflow automation is the infrastructure that makes AI agents reliable. Without durable execution, a network hiccup during a 10-step payment flow means lost... | | automation, infrastructure, makes, ai, agents, reliable, without, durable, execution, network, hiccup, during |
| `writing-skills` | Use when creating new skills, editing existing skills, or verifying skills work before deployment | writing, skills | writing, skills, creating, new, editing, existing, verifying, work, before, deployment |
## security (107)
## security (112)
| Skill | Description | Tags | Triggers |
| --- | --- | --- | --- |
@@ -478,6 +537,7 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `docker-expert` | Docker containerization expert with deep knowledge of multi-stage builds, image optimization, container security, Docker Compose orchestration, and productio... | docker | docker, containerization, deep, knowledge, multi, stage, image, optimization, container, security, compose, orchestration |
| `ethical-hacking-methodology` | This skill should be used when the user asks to "learn ethical hacking", "understand penetration testing lifecycle", "perform reconnaissance", "conduct secur... | ethical, hacking, methodology | ethical, hacking, methodology, skill, should, used, user, asks, learn, understand, penetration, testing |
| `file-path-traversal` | This skill should be used when the user asks to "test for directory traversal", "exploit path traversal vulnerabilities", "read arbitrary files through web a... | file, path, traversal | file, path, traversal, testing, skill, should, used, user, asks, test, directory, exploit |
| `find-bugs` | Find bugs, security vulnerabilities, and code quality issues in local branch changes. Use when asked to review changes, find bugs, security review, or audit ... | find, bugs | find, bugs, security, vulnerabilities, code, quality, issues, local, branch, changes, asked, review |
| `firebase` | Firebase gives you a complete backend in minutes - auth, database, storage, functions, hosting. But the ease of setup hides real complexity. Security rules a... | firebase | firebase, gives, complete, backend, minutes, auth, database, storage, functions, hosting, ease, setup |
| `firmware-analyst` | Expert firmware analyst specializing in embedded systems, IoT security, and hardware reverse engineering. Masters firmware extraction, analysis, and vulnerab... | firmware, analyst | firmware, analyst, specializing, embedded, iot, security, hardware, reverse, engineering, masters, extraction, analysis |
| `form-cro` | Optimize any form that is NOT signup or account registration — including lead capture, contact, demo request, application, survey, quote, and checkout forms.... | form, cro | form, cro, optimize, any, signup, account, registration, including, lead, capture, contact, demo |
@@ -487,6 +547,7 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `gdpr-data-handling` | Implement GDPR-compliant data handling with consent management, data subject rights, and privacy by design. Use when building systems that process EU persona... | gdpr, data, handling | gdpr, data, handling, compliant, consent, subject, rights, privacy, building, process, eu, personal |
| `graphql-architect` | Master modern GraphQL with federation, performance optimization, and enterprise security. Build scalable schemas, implement advanced caching, and design real... | graphql | graphql, architect, federation, performance, optimization, enterprise, security, scalable, schemas, caching, real, time |
| `html-injection-testing` | This skill should be used when the user asks to "test for HTML injection", "inject HTML into web pages", "perform HTML injection attacks", "deface web applic... | html, injection | html, injection, testing, skill, should, used, user, asks, test, inject, web, pages |
| `hugging-face-jobs` | This skill should be used when users want to run any workload on Hugging Face Jobs infrastructure. Covers UV scripts, Docker-based jobs, hardware selection, ... | hugging, face, jobs | hugging, face, jobs, skill, should, used, users, want, run, any, workload, infrastructure |
| `hybrid-cloud-architect` | Expert hybrid cloud architect specializing in complex multi-cloud solutions across AWS/Azure/GCP and private clouds (OpenStack/VMware). Masters hybrid connec... | hybrid, cloud | hybrid, cloud, architect, specializing, complex, multi, solutions, aws, azure, gcp, private, clouds |
| `idor-testing` | This skill should be used when the user asks to "test for insecure direct object references," "find IDOR vulnerabilities," "exploit broken access control," "... | idor | idor, vulnerability, testing, skill, should, used, user, asks, test, insecure, direct, object |
| `incident-responder` | Expert SRE incident responder specializing in rapid problem resolution, modern observability, and comprehensive incident management. Masters incident command... | incident, responder | incident, responder, sre, specializing, rapid, problem, resolution, observability, masters, command, blameless, post |
@@ -530,6 +591,7 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `scanning-tools` | This skill should be used when the user asks to "perform vulnerability scanning", "scan networks for open ports", "assess web application security", "scan wi... | scanning | scanning, security, skill, should, used, user, asks, perform, vulnerability, scan, networks, open |
| `secrets-management` | Implement secure secrets management for CI/CD pipelines using Vault, AWS Secrets Manager, or native platform solutions. Use when handling sensitive credentia... | secrets | secrets, secure, ci, cd, pipelines, vault, aws, manager, native, platform, solutions, handling |
| `security-auditor` | Expert security auditor specializing in DevSecOps, comprehensive cybersecurity, and compliance frameworks. Masters vulnerability assessment, threat modeling,... | security, auditor | security, auditor, specializing, devsecops, cybersecurity, compliance, frameworks, masters, vulnerability, assessment, threat, modeling |
| `security-bluebook-builder` | Build security Blue Books for sensitive apps | security, bluebook, builder | security, bluebook, builder, blue, books, sensitive, apps |
| `security-compliance-compliance-check` | You are a compliance expert specializing in regulatory requirements for software systems including GDPR, HIPAA, SOC2, PCI-DSS, and other industry standards. ... | security, compliance, check | security, compliance, check, specializing, regulatory, requirements, software, including, gdpr, hipaa, soc2, pci |
| `security-requirement-extraction` | Derive security requirements from threat models and business context. Use when translating threats into actionable requirements, creating security user stori... | security, requirement, extraction | security, requirement, extraction, derive, requirements, threat, models, business, context, translating, threats, actionable |
| `security-scanning-security-dependencies` | You are a security expert specializing in dependency vulnerability analysis, SBOM generation, and supply chain security. Scan project dependencies across eco... | security, scanning, dependencies | security, scanning, dependencies, specializing, dependency, vulnerability, analysis, sbom, generation, supply, chain, scan |
@@ -549,12 +611,14 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `top-web-vulnerabilities` | This skill should be used when the user asks to "identify web application vulnerabilities", "explain common security flaws", "understand vulnerability catego... | top, web, vulnerabilities | top, web, vulnerabilities, 100, reference, skill, should, used, user, asks, identify, application |
| `twilio-communications` | Build communication features with Twilio: SMS messaging, voice calls, WhatsApp Business API, and user verification (2FA). Covers the full spectrum from simpl... | twilio, communications | twilio, communications, communication, features, sms, messaging, voice, calls, whatsapp, business, api, user |
| `ui-visual-validator` | Rigorous visual validation expert specializing in UI testing, design system compliance, and accessibility verification. Masters screenshot analysis, visual r... | ui, visual, validator | ui, visual, validator, rigorous, validation, specializing, testing, compliance, accessibility, verification, masters, screenshot |
| `using-neon` | Guides and best practices for working with Neon Serverless Postgres. Covers getting started, local development with Neon, choosing a connection method, Neon ... | using, neon | using, neon, guides, working, serverless, postgres, covers, getting, started, local, development, choosing |
| `varlock-claude-skill` | Secure environment variable management ensuring secrets are never exposed in Claude sessions, terminals, logs, or git commits | varlock, claude, skill | varlock, claude, skill, secure, environment, variable, ensuring, secrets, never, exposed, sessions, terminals |
| `vulnerability-scanner` | Advanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization. | vulnerability, scanner | vulnerability, scanner, analysis, principles, owasp, 2025, supply, chain, security, attack, surface, mapping |
| `web-design-guidelines` | Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my si... | web, guidelines | web, guidelines, review, ui, code, interface, compliance, asked, my, check, accessibility, audit |
| `wordpress-penetration-testing` | This skill should be used when the user asks to "pentest WordPress sites", "scan WordPress for vulnerabilities", "enumerate WordPress users, themes, or plugi... | wordpress, penetration | wordpress, penetration, testing, skill, should, used, user, asks, pentest, sites, scan, vulnerabilities |
| `xss-html-injection` | This skill should be used when the user asks to "test for XSS vulnerabilities", "perform cross-site scripting attacks", "identify HTML injection flaws", "exp... | xss, html, injection | xss, html, injection, cross, site, scripting, testing, skill, should, used, user, asks |
## testing (21)
## testing (22)
| Skill | Description | Tags | Triggers |
| --- | --- | --- | --- |
@@ -566,6 +630,7 @@ TRIGGER: "shopify", "shopify app", "checkout extension",... | shopify | shopify,
| `pentest-commands` | This skill should be used when the user asks to "run pentest commands", "scan with nmap", "use metasploit exploits", "crack passwords with hydra or john", "s... | pentest, commands | pentest, commands, skill, should, used, user, asks, run, scan, nmap, metasploit, exploits |
| `performance-testing-review-multi-agent-review` | Use when working with performance testing review multi agent review | performance, multi, agent | performance, multi, agent, testing, review, working |
| `playwright-skill` | Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check res... | playwright, skill | playwright, skill, complete, browser, automation, auto, detects, dev, servers, writes, clean, test |
| `pypict-skill` | Pairwise test generation | pypict, skill | pypict, skill, pairwise, test, generation |
| `screen-reader-testing` | Test web applications with screen readers including VoiceOver, NVDA, and JAWS. Use when validating screen reader compatibility, debugging accessibility issue... | screen, reader | screen, reader, testing, test, web, applications, readers, including, voiceover, nvda, jaws, validating |
| `startup-analyst` | Expert startup business analyst specializing in market sizing, financial modeling, competitive analysis, and strategic planning for early-stage companies. Us... | startup, analyst | startup, analyst, business, specializing, market, sizing, financial, modeling, competitive, analysis, strategic, planning |
| `startup-metrics-framework` | This skill should be used when the user asks about "key startup metrics", "SaaS metrics", "CAC and LTV", "unit economics", "burn multiple", "rule of 40", "ma... | startup, metrics, framework | startup, metrics, framework, skill, should, used, user, asks, about, key, saas, cac |

View File

@@ -99,7 +99,7 @@ The following skills are now correctly indexed and visible in the registry:
### Changed
- **Documentation**: Added `docs/CI_DRIFT_FIX.md` as a canonical reference for resolving drift issues.
- **Guidance**: Updated `GETTING_STARTED.md` counts to match the full registry (253+ skills).
- **Guidance**: Updated `docs/GETTING_STARTED.md` counts to match the full registry (253+ skills).
- **Maintenance**: Updated `MAINTENANCE.md` with strict protocols for handling generated files.
## [3.0.0] - 2026-01-25 - "The Governance Update"
@@ -259,7 +259,7 @@ The following skills are now correctly indexed and visible in the registry:
- `cc-skill-project-guidelines-example`
- `cc-skill-security-review`
- `cc-skill-strategic-compact`
- **Documentation**: New `WALKTHROUGH.md` for import process details.
- **Documentation**: New `docs/WALKTHROUGH.md` for import process details.
### Changed

View File

@@ -1,11 +1,11 @@
# 🤝 Contributing Guide - V3 Enterprise Edition
# 🤝 Contributing Guide - V4 Enterprise Edition
**Thank you for wanting to make this repo better!** This guide shows you exactly how to contribute, even if you're new to open source.
With V3, we raised the bar for quality. Please read the **new Quality Standards** below carefully.
With V4, we raised the bar for quality. Please read the **new Quality Standards** below carefully.
---
## 🧐 The "Quality Bar" (V3 Standard)
## 🧐 The "Quality Bar" (V4 Standard)
**Critical for new skills:** Every skill submitted must pass our **5-Point Quality Check** (see `docs/QUALITY_BAR.md` for details):
@@ -112,16 +112,13 @@ code example here
- ❌ Don't do this
```
#### Step 4: Validate (CRITICAL V3 STEP)
#### Step 4: Validate (CRITICAL V4 STEP)
Run the validation script locally. **We will not merge PRs that fail this check.**
Use the canonical validator `scripts/validate_skills.py` via `npm run validate`. **We will not merge PRs that fail this check.**
```bash
# Soft mode (warnings only)
python3 scripts/validate_skills.py
# Hard mode (what CI runs)
python3 scripts/validate_skills.py --strict
npm run validate # soft mode (warnings only)
npm run validate:strict # strict mode (what CI runs)
```
This checks:

View File

@@ -1,6 +1,6 @@
# 🌌 Antigravity Awesome Skills: 257+ Agentic Skills for Claude Code, Gemini CLI, Cursor, Copilot & More
# 🌌 Antigravity Awesome Skills: 624+ Agentic Skills for Claude Code, Gemini CLI, Cursor, Copilot & More
> **The Ultimate Collection of 257+ Universal Agentic Skills for AI Coding Assistants — Claude Code, Gemini CLI, Codex CLI, Antigravity IDE, GitHub Copilot, Cursor, OpenCode**
> **The Ultimate Collection of 624+ Universal Agentic Skills for AI Coding Assistants — Claude Code, Gemini CLI, Codex CLI, Antigravity IDE, GitHub Copilot, Cursor, OpenCode**
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Claude Code](https://img.shields.io/badge/Claude%20Code-Anthropic-purple)](https://claude.ai)
@@ -11,7 +11,7 @@
[![OpenCode](https://img.shields.io/badge/OpenCode-CLI-gray)](https://github.com/opencode-ai/opencode)
[![Antigravity](https://img.shields.io/badge/Antigravity-DeepMind-red)](https://github.com/sickn33/antigravity-awesome-skills)
**Antigravity Awesome Skills** is a curated, battle-tested library of **257 high-performance agentic skills** designed to work seamlessly across all major AI coding assistants:
**Antigravity Awesome Skills** is a curated, battle-tested library of **624 high-performance agentic skills** designed to work seamlessly across all major AI coding assistants:
- 🟣 **Claude Code** (Anthropic CLI)
- 🔵 **Gemini CLI** (Google DeepMind)
@@ -29,7 +29,7 @@ This repository provides essential skills to transform your AI assistant into a
- [🔌 Compatibility & Invocation](#compatibility--invocation)
- [📦 Features & Categories](#features--categories)
- [🎁 Curated Collections (Bundles)](#curated-collections)
- [📚 Browse 550+ Skills](#browse-550-skills)
- [📚 Browse 624+ Skills](#browse-624-skills)
- [🛠️ Installation](#installation)
- [🤝 How to Contribute](#how-to-contribute)
- [👥 Contributors & Credits](#credits--sources)
@@ -52,10 +52,14 @@ AI Agents (like Claude Code, Cursor, or Gemini) are smart, but they lack **speci
### 2. ⚡️ Quick Start (The "Bundle" Way)
Don't install 250+ skills manually. Use our **Starter Packs**:
Don't install 624+ skills manually. Use our **Starter Packs**:
1. **Clone the repo**:
1. **Install** (pick one):
```bash
# Easiest: npx installer (clones to ~/.agent/skills by default)
npx antigravity-awesome-skills
# Or clone manually
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
2. **Pick your persona** (See [docs/BUNDLES.md](docs/BUNDLES.md)):
@@ -70,7 +74,7 @@ Once installed, just ask your agent naturally:
> "Use the **@brainstorming** skill to help me plan a SaaS."
> "Run **@lint-and-validate** on this file."
👉 **[Read the Full Getting Started Guide](GETTING_STARTED.md)**
👉 **[Read the Full Getting Started Guide](docs/GETTING_STARTED.md)**
---
@@ -91,7 +95,7 @@ These skills follow the universal **SKILL.md** format and work with any AI codin
> [!WARNING]
> **Windows Users**: This repository uses **symlinks** for official skills.
> You must enable Developer Mode or run Git as Administrator:
> The **npx** installer sets `core.symlinks=true` automatically. For **git clone**, enable Developer Mode or run Git as Administrator:
> `git clone -c core.symlinks=true https://github.com/...`
---
@@ -104,17 +108,23 @@ This repository aggregates the best capabilities from across the open-source com
The repository is organized into specialized domains to transform your AI into an expert across the entire software development lifecycle:
- **Engineering & Architecture**: 50+ skills for Backend, Frontend, DevOps, and System Design including `backend-architect`, `c4-architecture`, and `kubernetes-architect`.
- **AI & Data**: 80+ skills covering LLMs, RAG, Agents (LangChain/CrewAI), and Data Engineering.
- **Security**: 30+ skills for Penetration Testing, Code Auditing, and Security Compliance.
- **Product & Business**: 35+ skills for Startup Analytics, Marketing Strategy, and SEO.
- **Development**: 70+ skills for Python, TypeScript/JavaScript, Rust, Go, and more.
| Category | Focus | Example skills |
| :--- | :--- | :--- |
| Architecture (52) | System design, ADRs, C4, and scalable patterns | `architecture`, `c4-context`, `senior-architect` |
| Business (35) | Growth, pricing, CRO, SEO, and go-to-market | `copywriting`, `pricing-strategy`, `seo-audit` |
| Data & AI (81) | LLM apps, RAG, agents, observability, analytics | `rag-engineer`, `prompt-engineer`, `langgraph` |
| Development (72) | Language mastery, framework patterns, code quality | `typescript-expert`, `python-patterns`, `react-patterns` |
| General (95) | Planning, docs, product ops, writing, guidelines | `brainstorming`, `doc-coauthoring`, `writing-plans` |
| Infrastructure (72) | DevOps, cloud, serverless, deployment, CI/CD | `docker-expert`, `aws-serverless`, `vercel-deployment` |
| Security (107) | AppSec, pentesting, vuln analysis, compliance | `api-security-best-practices`, `sql-injection-testing`, `vulnerability-scanner` |
| Testing (21) | TDD, test design, fixes, QA workflows | `test-driven-development`, `testing-patterns`, `test-fixing` |
| Workflow (17) | Automation, orchestration, jobs, agents | `workflow-automation`, `inngest`, `trigger-dev` |
## Curated Collections
[Check out our Starter Packs in docs/BUNDLES.md](docs/BUNDLES.md) to find the perfect toolkit for your role.
## Browse 550+ Skills
## Browse 624+ Skills
We have moved the full skill registry to a dedicated catalog to keep this README clean.
@@ -122,10 +132,33 @@ We have moved the full skill registry to a dedicated catalog to keep this README
## Installation
To use these skills with **Claude Code**, **Gemini CLI**, **Codex CLI**, **Cursor**, **Antigravity**, or **OpenCode**, clone this repository into your agent's skills directory:
To use these skills with **Claude Code**, **Gemini CLI**, **Codex CLI**, **Cursor**, **Antigravity**, or **OpenCode**:
### Option A: npx (recommended)
```bash
# Universal installation (works with most tools)
# Default: ~/.agent/skills (universal)
npx antigravity-awesome-skills
# Cursor
npx antigravity-awesome-skills --cursor
# Claude Code
npx antigravity-awesome-skills --claude
# Gemini CLI
npx antigravity-awesome-skills --gemini
# Custom path
npx antigravity-awesome-skills --path ./my-skills
```
Run `npx antigravity-awesome-skills --help` for all options. If the directory already exists, the installer runs `git pull` to update.
### Option B: git clone
```bash
# Universal (works with most tools)
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
# Claude Code specific
@@ -190,6 +223,7 @@ This collection would not be possible without the incredible work of the Claude
- **[zebbern/claude-code-guide](https://github.com/zebbern/claude-code-guide)**: Comprehensive Security suite & Guide (Source for ~60 new skills).
- **[alirezarezvani/claude-skills](https://github.com/alirezarezvani/claude-skills)**: Senior Engineering and PM toolkit.
- **[karanb192/awesome-claude-skills](https://github.com/karanb192/awesome-claude-skills)**: A massive list of verified skills for Claude Code.
- **[VoltAgent/awesome-agent-skills](https://github.com/VoltAgent/awesome-agent-skills)**: Curated collection of 61 high-quality skills including official team skills from Sentry, Trail of Bits, Expo, Hugging Face, and comprehensive context engineering suite (v4.3.0 integration).
- **[zircote/.claude](https://github.com/zircote/.claude)**: Shopify development skill reference.
- **[vibeforge1111/vibeship-spawner-skills](https://github.com/vibeforge1111/vibeship-spawner-skills)**: AI Agents, Integrations, Maker Tools (57 skills, Apache 2.0).
- **[coreyhaines31/marketingskills](https://github.com/coreyhaines31/marketingskills)**: Marketing skills for CRO, copywriting, SEO, paid ads, and growth (23 skills, MIT).
@@ -251,11 +285,13 @@ We officially thank the following contributors for their help in making this rep
- [Owen Wu](https://github.com/yubing744)
- [SuperJMN](https://github.com/SuperJMN)
- [Viktor Ferenczi](https://github.com/viktor-ferenczi)
- [Đỗ Khắc Gia Khoa](https://github.com/Dokhacgiakhoa)
- [evandro-miguel](https://github.com/evandro-miguel)
- [junited31](https://github.com/junited31)
- [krisnasantosa15](https://github.com/krisnasantosa15)
- [raeef1001](https://github.com/raeef1001)
- [taksrules](https://github.com/taksrules)
- [zebbern](https://github.com/zebbern)
- [Đỗ Khắc Gia Khoa](https://github.com/dokhacgiakhoa)
- [vuth-dogo](https://github.com/vuth-dogo)
## Star History

153
RELEASE_NOTES.md Normal file
View File

@@ -0,0 +1,153 @@
# Release v4.4.0: fp-ts skills for TypeScript
> **Three practical fp-ts skills for TypeScript functional programming**
This release adds 3 fp-ts skills sourced from [whatiskadudoing/fp-ts-skills](https://github.com/whatiskadudoing/fp-ts-skills), bringing the total to 624 skills. These skills focus on practical, jargon-free patterns for pipe, Option, Either, TaskEither, React integration, and type-safe error handling.
## New Skills (3)
- **[fp-ts-pragmatic](skills/fp-ts-pragmatic/)** The 80/20 of functional programming: pipe, Option, Either, TaskEither without academic jargon
- **[fp-ts-react](skills/fp-ts-react/)** Patterns for using fp-ts with React 18/19 and Next.js 14/15 (state, forms, data fetching)
- **[fp-ts-errors](skills/fp-ts-errors/)** Type-safe error handling with Either and TaskEither; no more try/catch spaghetti
## Registry Update
- **Total Skills**: 624 (from 621)
- **New Skills Added**: 3
- **Catalog**: Regenerated with all skills
---
# Release v4.3.0: VoltAgent Integration & Context Engineering Suite
> **Massive expansion with 61 new skills from VoltAgent repository, including official team skills and comprehensive context engineering capabilities**
This release adds 61 high-quality skills sourced from the VoltAgent/awesome-agent-skills curated collection, bringing the total to 614 skills. Highlights include official skills from Sentry, Trail of Bits, Expo, Hugging Face, and a complete context engineering suite for building sophisticated AI agents.
## 🚀 New Skills
### Official Team Skills (27)
#### Sentry (4)
- **[commit](skills/commit/)** Create commits with best practices following Sentry conventions
- **[create-pr](skills/create-pr/)** Create pull requests with proper descriptions and review guidelines
- **[find-bugs](skills/find-bugs/)** Find and identify bugs in code systematically
- **[iterate-pr](skills/iterate-pr/)** Iterate on pull request feedback efficiently
#### Trail of Bits (3)
- **[culture-index](skills/culture-index/)** Index and search culture documentation
- **[fix-review](skills/fix-review/)** Verify fix commits address audit findings without new bugs
- **[sharp-edges](skills/sharp-edges/)** Identify error-prone APIs and dangerous configurations
#### Expo (2)
- **[expo-deployment](skills/expo-deployment/)** Deploy Expo apps to production
- **[upgrading-expo](skills/upgrading-expo/)** Upgrade Expo SDK versions safely
#### Hugging Face (2)
- **[hugging-face-cli](skills/hugging-face-cli/)** HF Hub CLI for models, datasets, repos, and compute jobs
- **[hugging-face-jobs](skills/hugging-face-jobs/)** Run compute jobs and Python scripts on HF infrastructure
#### Other Official (16)
- **[vercel-deploy-claimable](skills/vercel-deploy-claimable/)** Deploy projects to Vercel
- **[design-md](skills/design-md/)** Create and manage DESIGN.md files (Google Stitch)
- **[using-neon](skills/using-neon/)** Best practices for Neon Serverless Postgres
- **[n8n-code-python](skills/n8n-code-python/)** Python in n8n Code nodes
- **[n8n-mcp-tools-expert](skills/n8n-mcp-tools-expert/)** n8n MCP tools guide
- **[n8n-node-configuration](skills/n8n-node-configuration/)** n8n node configuration
- **[swiftui-expert-skill](skills/swiftui-expert-skill/)** SwiftUI best practices
- **[fal-audio](skills/fal-audio/)** Text-to-speech and speech-to-text using fal.ai
- **[fal-generate](skills/fal-generate/)** Generate images and videos using fal.ai AI models
- **[fal-image-edit](skills/fal-image-edit/)** AI-powered image editing with style transfer
- **[fal-platform](skills/fal-platform/)** Platform APIs for model management and usage tracking
- **[fal-upscale](skills/fal-upscale/)** Upscale and enhance image/video resolution using AI
- **[fal-workflow](skills/fal-workflow/)** Generate workflow JSON files for chaining AI models
- **[deep-research](skills/deep-research/)** Gemini Deep Research Agent for autonomous research
- **[imagen](skills/imagen/)** Generate images using Google Gemini
- **[readme](skills/readme/)** Generate comprehensive project documentation
### Community Skills (34)
#### Context Engineering Suite (7)
A complete suite for building sophisticated AI agents with advanced context management:
- **[context-fundamentals](skills/context-fundamentals/)** Understand what context is, why it matters, and the anatomy of context in agent systems
- **[context-degradation](skills/context-degradation/)** Recognize patterns of context failure: lost-in-middle, poisoning, distraction, and clash
- **[context-compression](skills/context-compression/)** Design and evaluate compression strategies for long-running sessions
- **[context-optimization](skills/context-optimization/)** Apply compaction, masking, and caching strategies
- **[multi-agent-patterns](skills/multi-agent-patterns/)** Master orchestrator, peer-to-peer, and hierarchical multi-agent architectures
- **[memory-systems](skills/memory-systems/)** Design short-term, long-term, and graph-based memory architectures
- **[evaluation](skills/evaluation/)** Build evaluation frameworks for agent systems
#### Development Tools (8)
- **[frontend-slides](skills/frontend-slides/)** Generate animation-rich HTML presentations with visual style previews
- **[linear-claude-skill](skills/linear-claude-skill/)** Manage Linear issues, projects, and teams
- **[skill-rails-upgrade](skills/skill-rails-upgrade/)** Analyze Rails apps and provide upgrade assessments
- **[terraform-skill](skills/terraform-skill/)** Terraform infrastructure as code best practices
- **[tool-design](skills/tool-design/)** Build tools that agents can use effectively, including architectural reduction patterns
- **[screenshots](skills/screenshots/)** Generate marketing screenshots with Playwright
- **[automate-whatsapp](skills/automate-whatsapp/)** Build WhatsApp automations with workflows and agents
- **[observe-whatsapp](skills/observe-whatsapp/)** Debug WhatsApp delivery issues and run health checks
#### Platform & Framework Skills (19)
- **[aws-skills](skills/aws-skills/)** AWS development with infrastructure automation
- **[ui-skills](skills/ui-skills/)** Opinionated constraints for building interfaces
- **[vexor](skills/vexor/)** Vector-powered CLI for semantic file search
- **[pypict-skill](skills/pypict-skill/)** Pairwise test generation
- **[makepad-skills](skills/makepad-skills/)** Makepad UI development for Rust apps
- **[threejs-skills](skills/threejs-skills/)** Three.js 3D experiences
- **[claude-scientific-skills](skills/claude-scientific-skills/)** Scientific research skills
- **[claude-win11-speckit-update-skill](skills/claude-win11-speckit-update-skill/)** Windows 11 management
- **[security-bluebook-builder](skills/security-bluebook-builder/)** Security documentation
- **[claude-ally-health](skills/claude-ally-health/)** Health assistant
- **[clarity-gate](skills/clarity-gate/)** RAG quality verification
- **[beautiful-prose](skills/beautiful-prose/)** Writing style guide
- **[claude-speed-reader](skills/claude-speed-reader/)** Speed reading tool
- **[skill-seekers](skills/skill-seekers/)** Skill conversion tool
- **[varlock-claude-skill](skills/varlock-claude-skill/)** Secure environment variable management
- **[superpowers-lab](skills/superpowers-lab/)** Superpowers Lab integration
- **[nanobanana-ppt-skills](skills/nanobanana-ppt-skills/)** PowerPoint presentation skills
- **[x-article-publisher-skill](skills/x-article-publisher-skill/)** X/Twitter article publishing
- **[ffuf-claude-skill](skills/ffuf-claude-skill/)** Web fuzzing with ffuf
---
## 📦 Registry Update
- **Total Skills**: 614 (from 553)
- **New Skills Added**: 61
- **Catalog**: Fully regenerated with all new skills
- **Sources**: All skills properly attributed in `docs/SOURCES.md`
## 🔧 Improvements
### Quality Assurance
- All new skills validated for frontmatter compliance
- "When to Use" sections added where missing
- Source attribution maintained for all skills
- Risk labels properly set
### Documentation
- Updated README.md with correct skill count (614)
- Updated package.json version to 4.3.0
- Comprehensive release notes created
## 📊 Statistics
- **Skills from VoltAgent Repository**: 61
- Official Team Skills: 27
- Community Skills: 34
- **Skills Analyzed**: 174 total from VoltAgent
- **Skills Already Present**: 32 (skipped as duplicates)
- **Skills with Similar Names**: 89 (analyzed, 12 implemented as complementary)
## 👥 Credits
A huge shoutout to our community contributors and the VoltAgent team:
- **VoltAgent/awesome-agent-skills** for curating an excellent collection
- **Official Teams**: Sentry, Trail of Bits, Expo, Hugging Face, Vercel Labs, Google Labs, Neon, fal.ai
- **Community Contributors**: zarazhangrui, wrsmith108, robzolkos, muratcankoylan, antonbabenko, and all other skill authors
---
_Upgrade now: `git pull origin main` to fetch the latest skills._

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 51 KiB

113
bin/install.js Executable file
View File

@@ -0,0 +1,113 @@
#!/usr/bin/env node
const { spawnSync } = require('child_process');
const path = require('path');
const fs = require('fs');
const REPO = 'https://github.com/sickn33/antigravity-awesome-skills.git';
const HOME = process.env.HOME || process.env.USERPROFILE || '';
function resolveDir(p) {
if (!p) return null;
const s = p.replace(/^~($|\/)/, HOME + '$1');
return path.resolve(s);
}
function parseArgs() {
const a = process.argv.slice(2);
let pathArg = null;
let cursor = false, claude = false, gemini = false;
for (let i = 0; i < a.length; i++) {
if (a[i] === '--help' || a[i] === '-h') return { help: true };
if (a[i] === '--path' && a[i + 1]) { pathArg = a[++i]; continue; }
if (a[i] === '--cursor') { cursor = true; continue; }
if (a[i] === '--claude') { claude = true; continue; }
if (a[i] === '--gemini') { gemini = true; continue; }
if (a[i] === 'install') continue;
}
return { pathArg, cursor, claude, gemini };
}
function defaultDir(opts) {
if (opts.pathArg) return resolveDir(opts.pathArg);
if (opts.cursor) return path.join(HOME, '.cursor', 'skills');
if (opts.claude) return path.join(HOME, '.claude', 'skills');
if (opts.gemini) return path.join(HOME, '.gemini', 'skills');
return path.join(HOME, '.agent', 'skills');
}
function printHelp() {
console.log(`
antigravity-awesome-skills — installer
npx antigravity-awesome-skills [install] [options]
Clones the skills repo into your agent's skills directory.
Options:
--cursor Install to ~/.cursor/skills (Cursor)
--claude Install to ~/.claude/skills (Claude Code)
--gemini Install to ~/.gemini/skills (Gemini CLI)
--path <dir> Install to <dir> (default: ~/.agent/skills)
Examples:
npx antigravity-awesome-skills
npx antigravity-awesome-skills --cursor
npx antigravity-awesome-skills --path ./my-skills
`);
}
function run(cmd, args, opts = {}) {
const r = spawnSync(cmd, args, { stdio: 'inherit', ...opts });
if (r.status !== 0) process.exit(r.status == null ? 1 : r.status);
}
function main() {
const opts = parseArgs();
if (opts.help) {
printHelp();
return;
}
const target = defaultDir(opts);
if (!target || !HOME) {
console.error('Could not resolve home directory. Use --path <absolute-path>.');
process.exit(1);
}
if (fs.existsSync(target)) {
const gitDir = path.join(target, '.git');
if (fs.existsSync(gitDir)) {
console.log('Directory already exists and is a git repo. Updating…');
process.chdir(target);
run('git', ['pull']);
return;
}
console.error(`Directory exists and is not a git repo: ${target}`);
console.error('Remove it or use --path to choose another location.');
process.exit(1);
}
const parent = path.dirname(target);
if (!fs.existsSync(parent)) {
try {
fs.mkdirSync(parent, { recursive: true });
} catch (e) {
console.error(`Cannot create parent directory: ${parent}`, e.message);
process.exit(1);
}
}
if (process.platform === 'win32') {
run('git', ['-c', 'core.symlinks=true', 'clone', REPO, target]);
} else {
run('git', ['clone', REPO, target]);
}
console.log(`\nInstalled to ${target}`);
console.log('Pick a bundle in docs/BUNDLES.md and use @skill-name in your AI assistant.');
}
main();

View File

@@ -1,5 +1,5 @@
{
"generatedAt": "2026-01-28T16:10:28.837Z",
"generatedAt": "2026-01-30T19:29:11.960Z",
"aliases": {
"accessibility-compliance-audit": "accessibility-compliance-accessibility-audit",
"active directory attacks": "active-directory-attacks",
@@ -24,6 +24,7 @@
"cicd-automation-automate": "cicd-automation-workflow-automate",
"claude code guide": "claude-code-guide",
"d3-viz": "claude-d3js-skill",
"claude-win11-skill": "claude-win11-speckit-update-skill",
"cloud penetration testing": "cloud-penetration-testing",
"code-documentation-explain": "code-documentation-code-explain",
"code-documentation-generate": "code-documentation-doc-generate",

View File

@@ -1,5 +1,5 @@
{
"generatedAt": "2026-01-28T16:10:28.837Z",
"generatedAt": "2026-01-30T19:29:11.960Z",
"bundles": {
"core-dev": {
"description": "Core development skills across languages, frameworks, and backend/frontend fundamentals.",
@@ -45,16 +45,21 @@
"firebase",
"firecrawl-scraper",
"flutter-expert",
"fp-ts-errors",
"fp-ts-pragmatic",
"fp-ts-react",
"frontend-design",
"frontend-dev-guidelines",
"frontend-developer",
"frontend-mobile-development-component-scaffold",
"frontend-mobile-security-xss-scan",
"frontend-security-coder",
"frontend-slides",
"go-concurrency-patterns",
"golang-pro",
"graphql",
"hubspot-integration",
"hugging-face-jobs",
"ios-developer",
"java-pro",
"javascript-mastery",
@@ -63,6 +68,7 @@
"javascript-typescript-typescript-scaffold",
"langgraph",
"launch-strategy",
"makepad-skills",
"mcp-builder",
"memory-safety-patterns",
"mobile-design",
@@ -71,11 +77,14 @@
"modern-javascript-patterns",
"moodle-external-api-development",
"multi-platform-apps-multi-platform",
"n8n-code-python",
"n8n-node-configuration",
"nextjs-app-router-patterns",
"nextjs-best-practices",
"nextjs-supabase-auth",
"nodejs-backend-patterns",
"nodejs-best-practices",
"observe-whatsapp",
"openapi-spec-generation",
"php-pro",
"plaid-fintech",
@@ -103,6 +112,7 @@
"shopify-apps",
"shopify-development",
"slack-bot-builder",
"swiftui-expert-skill",
"systems-programming-rust-project",
"tavily-web",
"telegram-bot-builder",
@@ -116,6 +126,7 @@
"typescript-expert",
"typescript-pro",
"ui-ux-pro-max",
"using-neon",
"uv-package-manager",
"viral-generator-builder",
"voice-agents",
@@ -152,6 +163,7 @@
"design-orchestration",
"docker-expert",
"ethical-hacking-methodology",
"find-bugs",
"firebase",
"firmware-analyst",
"form-cro",
@@ -160,6 +172,7 @@
"frontend-security-coder",
"gdpr-data-handling",
"graphql-architect",
"hugging-face-jobs",
"hybrid-cloud-architect",
"idor-testing",
"k8s-manifest-generator",
@@ -190,6 +203,7 @@
"scanning-tools",
"secrets-management",
"security-auditor",
"security-bluebook-builder",
"security-compliance-compliance-check",
"security-requirement-extraction",
"security-scanning-security-dependencies",
@@ -207,6 +221,8 @@
"top-web-vulnerabilities",
"twilio-communications",
"ui-visual-validator",
"using-neon",
"varlock-claude-skill",
"vulnerability-scanner",
"web-design-guidelines",
"wordpress-penetration-testing",
@@ -263,9 +279,11 @@
"database-optimizer",
"dbt-transformation-patterns",
"firebase",
"fp-ts-react",
"frontend-dev-guidelines",
"gdpr-data-handling",
"graphql",
"hugging-face-jobs",
"hybrid-cloud-networking",
"idor-testing",
"ios-developer",
@@ -298,6 +316,7 @@
"sql-pro",
"sqlmap-database-pentesting",
"unity-ecs-patterns",
"using-neon",
"vector-database-engineer",
"xlsx",
"xlsx-official"
@@ -335,6 +354,7 @@
"error-debugging-error-trace",
"error-diagnostics-error-analysis",
"error-diagnostics-error-trace",
"expo-deployment",
"flutter-expert",
"git-pr-workflows-git-workflow",
"gitlab-ci-patterns",
@@ -372,9 +392,9 @@
"temporal-python-pro",
"terraform-specialist",
"unity-developer",
"vercel-deploy-claimable",
"vercel-deployment",
"voice-agents",
"writing-skills"
"voice-agents"
]
}
},

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "antigravity-awesome-skills",
"version": "4.0.0",
"version": "4.2.0",
"dependencies": {
"yaml": "^2.8.2"
}

View File

@@ -1,124 +1,396 @@
# 📦 Antigravity Skill Bundles
Don't know where to start? Pick a bundle below to get a curated set of skills for your role.
> **Curated collections of skills organized by role and expertise level.** Don't know where to start? Pick a bundle below to get a curated set of skills for your role.
## 🚀 The "Essentials" Starter Pack
## 🚀 Quick Start
_For everyone. Install these first._
1. **Install the repository:**
```bash
npx antigravity-awesome-skills
# or clone manually
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
- `concise-planning`: Always start with a plan.
- `lint-and-validate`: Keep your code clean automatically.
- `git-pushing`: Save your work safely.
- `kaizen`: Continuous improvement mindset.
2. **Choose your bundle** from the list below based on your role or interests.
## 🛡️ The "Security Engineer" Pack
_For pentesting, auditing, and hardening._
- `ethical-hacking-methodology`: The Bible of ethical hacking.
- `burp-suite-testing`: Web vulnerability scanning.
- `owasp-top-10`: Check for the most common flaws.
- `linux-privilege-escalation`: Advanced Linux security assessment.
- `cloud-penetration-testing`: AWS/Azure/GCP security.
## 🌐 The "Web Wizard" Pack
_For building modern, high-performance web apps._
- `frontend-design`: UI guidelines and aesthetics.
- `react-patterns`: Best practices for React (if available).
- `tailwind-patterns`: Styling superpowers.
- `form-cro`: Optimize your forms for conversion.
- `seo-audit`: Get found on Google.
## 🤖 The "Agent Architect" Pack
_For building AI systems._
- `agent-evaluation`: Test your agents.
- `langgraph`: Build stateful agent workflows.
- `mcp-builder`: Create your own tools.
- `prompt-engineering`: Master the art of talking to LLMs.
## 🎮 The "Indie Game Dev" Pack
_For building games with AI assistants._
- `game-development/game-design`: Mechanics and loops.
- `game-development/2d-games`: Sprites and physics.
- `game-development/3d-games`: Models and shaders.
- `game-development/unity-csharp`: C# scripting mastery.
- `algorithmic-art`: Generate assets with code.
## 🐍 The "Python Pro" Pack
_For backend heavyweights and data scientists._
- `python-patterns`: Idiomatic Python code.
- `poetry-manager`: Dependency management that works.
- `pytest-mastery`: Testing frameworks.
- `fastapi-expert`: High-performance APIs.
- `django-guide`: The battery-included framework.
## 🦄 The "Startup Founder" Pack
_For building products, not just code._
- `product-requirements-doc`: Define what to build.
- `competitor-analysis`: Know who you are fighting.
- `pitch-deck-creator`: Raise capital (or just explain your idea).
- `landing-page-copy`: Write words that sell.
- `stripe-integration`: Get paid.
## 🌧️ The "DevOps & Cloud" Pack
_For infrastructure and scaling._
- `docker-expert`: Master containers and multi-stage builds.
- `aws-serverless`: Go serverless on AWS (Lambda, DynamoDB).
- `environment-setup-guide`: Standardization for teams.
- `deployment-procedures`: Safe rollout strategies.
- `bash-linux`: Terminal wizardry.
## 📊 The "Data & Analytics" Pack
_For making sense of the numbers._
- `analytics-tracking`: Set up GA4/PostHog correctly.
- `d3-viz`: Beautiful custom visualizations.
- `sql-mastery`: Write better queries (Community skill).
- `ab-test-setup`: Validated learning.
## 🎨 The "Creative Director" Pack
_For visuals, content, and branding._
- `canvas-design`: Generate posters and diagrams.
- `frontend-design`: UI aesthetics.
- `content-creator`: SEO-optimized blog posts.
- `copy-editing`: Polish your prose.
- `algorithmic-art`: Code-generated masterpieces.
## 🐞 The "QA & Testing" Pack
_For breaking things before users do._
- `test-driven-development`: Red, Green, Refactor.
- `systematic-debugging`: Sherlock Holmes for code.
- `browser-automation`: End-to-end testing with Playwright.
- `ab-test-setup`: Validated experiments.
- `code-review-checklist`: Catch bugs in PRs.
## 🖌️ The "Web Designer" Pack
_For pixel-perfect experiences._
- `ui-ux-pro-max`: Premium design systems/tokens.
- `frontend-design`: The base layer of aesthetics.
- `3d-web-experience`: Three.js & R3F magic.
- `canvas-design`: Static visuals/posters.
- `responsive-layout`: Mobile-first principles.
3. **Use skills** by referencing them in your AI assistant:
- Claude Code: `>> @skill-name help me...`
- Cursor: `@skill-name in chat`
- Gemini CLI: `Use skill-name...`
---
_To use a bundle, simply copy the skill names into your `.agent/skills` folder or use them with your agent._
## 🎯 Essentials & Core
### 🚀 The "Essentials" Starter Pack
_For everyone. Install these first._
- [`concise-planning`](../skills/concise-planning/): Always start with a plan.
- [`lint-and-validate`](../skills/lint-and-validate/): Keep your code clean automatically.
- [`git-pushing`](../skills/git-pushing/): Save your work safely.
- [`kaizen`](../skills/kaizen/): Continuous improvement mindset.
- [`systematic-debugging`](../skills/systematic-debugging/): Debug like a pro.
---
## 🛡️ Security & Compliance
### 🛡️ The "Security Engineer" Pack
_For pentesting, auditing, and hardening._
- [`ethical-hacking-methodology`](../skills/ethical-hacking-methodology/): The Bible of ethical hacking.
- [`burp-suite-testing`](../skills/burp-suite-testing/): Web vulnerability scanning.
- [`top-web-vulnerabilities`](../skills/top-web-vulnerabilities/): OWASP-aligned vulnerability taxonomy.
- [`linux-privilege-escalation`](../skills/linux-privilege-escalation/): Advanced Linux security assessment.
- [`cloud-penetration-testing`](../skills/cloud-penetration-testing/): AWS/Azure/GCP security.
- [`security-auditor`](../skills/security-auditor/): Comprehensive security audits.
- [`vulnerability-scanner`](../skills/vulnerability-scanner/): Advanced vulnerability analysis.
### 🔐 The "Security Developer" Pack
_For building secure applications._
- [`api-security-best-practices`](../skills/api-security-best-practices/): Secure API design patterns.
- [`auth-implementation-patterns`](../skills/auth-implementation-patterns/): JWT, OAuth2, session management.
- [`backend-security-coder`](../skills/backend-security-coder/): Secure backend coding practices.
- [`frontend-security-coder`](../skills/frontend-security-coder/): XSS prevention and client-side security.
- [`cc-skill-security-review`](../skills/cc-skill-security-review/): Security checklist for features.
- [`pci-compliance`](../skills/pci-compliance/): Payment card security standards.
---
## 🌐 Web Development
### 🌐 The "Web Wizard" Pack
_For building modern, high-performance web apps._
- [`frontend-design`](../skills/frontend-design/): UI guidelines and aesthetics.
- [`react-best-practices`](../skills/react-best-practices/): React & Next.js performance optimization.
- [`react-patterns`](../skills/react-patterns/): Modern React patterns and principles.
- [`nextjs-best-practices`](../skills/nextjs-best-practices/): Next.js App Router patterns.
- [`tailwind-patterns`](../skills/tailwind-patterns/): Tailwind CSS v4 styling superpowers.
- [`form-cro`](../skills/form-cro/): Optimize your forms for conversion.
- [`seo-audit`](../skills/seo-audit/): Get found on Google.
### 🖌️ The "Web Designer" Pack
_For pixel-perfect experiences._
- [`ui-ux-pro-max`](../skills/ui-ux-pro-max/): Premium design systems and tokens.
- [`frontend-design`](../skills/frontend-design/): The base layer of aesthetics.
- [`3d-web-experience`](../skills/3d-web-experience/): Three.js & React Three Fiber magic.
- [`canvas-design`](../skills/canvas-design/): Static visuals and posters.
- [`mobile-design`](../skills/mobile-design/): Mobile-first design principles.
- [`scroll-experience`](../skills/scroll-experience/): Immersive scroll-driven experiences.
### ⚡ The "Full-Stack Developer" Pack
_For end-to-end web application development._
- [`senior-fullstack`](../skills/senior-fullstack/): Complete fullstack development guide.
- [`frontend-developer`](../skills/frontend-developer/): React 19+ and Next.js 15+ expertise.
- [`backend-dev-guidelines`](../skills/backend-dev-guidelines/): Node.js/Express/TypeScript patterns.
- [`api-patterns`](../skills/api-patterns/): REST vs GraphQL vs tRPC selection.
- [`database-design`](../skills/database-design/): Schema design and ORM selection.
- [`stripe-integration`](../skills/stripe-integration/): Payments and subscriptions.
---
## 🤖 AI & Agents
### 🤖 The "Agent Architect" Pack
_For building AI systems and autonomous agents._
- [`agent-evaluation`](../skills/agent-evaluation/): Test and benchmark your agents.
- [`langgraph`](../skills/langgraph/): Build stateful agent workflows.
- [`mcp-builder`](../skills/mcp-builder/): Create your own MCP tools.
- [`prompt-engineering`](../skills/prompt-engineering/): Master the art of talking to LLMs.
- [`ai-agents-architect`](../skills/ai-agents-architect/): Design autonomous AI agents.
- [`rag-engineer`](../skills/rag-engineer/): Build RAG systems with vector search.
### 🧠 The "LLM Application Developer" Pack
_For building production LLM applications._
- [`llm-app-patterns`](../skills/llm-app-patterns/): Production-ready LLM patterns.
- [`rag-implementation`](../skills/rag-implementation/): Retrieval-Augmented Generation.
- [`prompt-caching`](../skills/prompt-caching/): Cache strategies for LLM prompts.
- [`context-window-management`](../skills/context-window-management/): Manage LLM context efficiently.
- [`langfuse`](../skills/langfuse/): LLM observability and tracing.
---
## 🎮 Game Development
### 🎮 The "Indie Game Dev" Pack
_For building games with AI assistants._
- [`game-development/game-design`](../skills/game-development/game-design/): Mechanics and loops.
- [`game-development/2d-games`](../skills/game-development/2d-games/): Sprites and physics.
- [`game-development/3d-games`](../skills/game-development/3d-games/): Models and shaders.
- [`unity-developer`](../skills/unity-developer/): Unity 6 LTS development.
- [`godot-gdscript-patterns`](../skills/godot-gdscript-patterns/): Godot 4 GDScript patterns.
- [`algorithmic-art`](../skills/algorithmic-art/): Generate assets with code.
---
## 🐍 Backend & Languages
### 🐍 The "Python Pro" Pack
_For backend heavyweights and data scientists._
- [`python-pro`](../skills/python-pro/): Master Python 3.12+ with modern features.
- [`python-patterns`](../skills/python-patterns/): Idiomatic Python code.
- [`fastapi-pro`](../skills/fastapi-pro/): High-performance async APIs.
- [`fastapi-templates`](../skills/fastapi-templates/): Production-ready FastAPI projects.
- [`django-pro`](../skills/django-pro/): The battery-included framework.
- [`python-testing-patterns`](../skills/python-testing-patterns/): Comprehensive testing with pytest.
- [`async-python-patterns`](../skills/async-python-patterns/): Python asyncio mastery.
### 🟦 The "TypeScript & JavaScript" Pack
_For modern web development._
- [`typescript-expert`](../skills/typescript-expert/): TypeScript mastery and advanced types.
- [`javascript-pro`](../skills/javascript-pro/): Modern JavaScript with ES6+.
- [`react-best-practices`](../skills/react-best-practices/): React performance optimization.
- [`nodejs-best-practices`](../skills/nodejs-best-practices/): Node.js development principles.
- [`nextjs-app-router-patterns`](../skills/nextjs-app-router-patterns/): Next.js 14+ App Router.
### 🦀 The "Systems Programming" Pack
_For low-level and performance-critical code._
- [`rust-pro`](../skills/rust-pro/): Rust 1.75+ with async patterns.
- [`go-concurrency-patterns`](../skills/go-concurrency-patterns/): Go concurrency mastery.
- [`golang-pro`](../skills/golang-pro/): Go development expertise.
- [`memory-safety-patterns`](../skills/memory-safety-patterns/): Memory-safe programming.
- [`cpp-pro`](../skills/cpp-pro/): Modern C++ development.
---
## 🦄 Product & Business
### 🦄 The "Startup Founder" Pack
_For building products, not just code._
- [`product-manager-toolkit`](../skills/product-manager-toolkit/): RICE prioritization, PRD templates.
- [`competitive-landscape`](../skills/competitive-landscape/): Competitor analysis.
- [`competitor-alternatives`](../skills/competitor-alternatives/): Create comparison pages.
- [`launch-strategy`](../skills/launch-strategy/): Product launch planning.
- [`copywriting`](../skills/copywriting/): Marketing copy that converts.
- [`stripe-integration`](../skills/stripe-integration/): Get paid from day one.
### 📊 The "Business Analyst" Pack
_For data-driven decision making._
- [`business-analyst`](../skills/business-analyst/): AI-powered analytics and KPIs.
- [`startup-metrics-framework`](../skills/startup-metrics-framework/): SaaS metrics and unit economics.
- [`startup-financial-modeling`](../skills/startup-financial-modeling/): 3-5 year financial projections.
- [`market-sizing-analysis`](../skills/market-sizing-analysis/): TAM/SAM/SOM calculations.
- [`kpi-dashboard-design`](../skills/kpi-dashboard-design/): Effective KPI dashboards.
### 📈 The "Marketing & Growth" Pack
_For driving user acquisition and retention._
- [`content-creator`](../skills/content-creator/): SEO-optimized marketing content.
- [`seo-audit`](../skills/seo-audit/): Technical SEO health checks.
- [`programmatic-seo`](../skills/programmatic-seo/): Create pages at scale.
- [`analytics-tracking`](../skills/analytics-tracking/): Set up GA4/PostHog correctly.
- [`ab-test-setup`](../skills/ab-test-setup/): Validated learning experiments.
- [`email-sequence`](../skills/email-sequence/): Automated email campaigns.
---
## 🌧️ DevOps & Infrastructure
### 🌧️ The "DevOps & Cloud" Pack
_For infrastructure and scaling._
- [`docker-expert`](../skills/docker-expert/): Master containers and multi-stage builds.
- [`aws-serverless`](../skills/aws-serverless/): Serverless on AWS (Lambda, DynamoDB).
- [`kubernetes-architect`](../skills/kubernetes-architect/): K8s architecture and GitOps.
- [`terraform-specialist`](../skills/terraform-specialist/): Infrastructure as Code mastery.
- [`environment-setup-guide`](../skills/environment-setup-guide/): Standardization for teams.
- [`deployment-procedures`](../skills/deployment-procedures/): Safe rollout strategies.
- [`bash-linux`](../skills/bash-linux/): Terminal wizardry.
### 📊 The "Observability & Monitoring" Pack
_For production reliability._
- [`observability-engineer`](../skills/observability-engineer/): Comprehensive monitoring systems.
- [`distributed-tracing`](../skills/distributed-tracing/): Track requests across microservices.
- [`slo-implementation`](../skills/slo-implementation/): Service Level Objectives.
- [`incident-responder`](../skills/incident-responder/): Rapid incident response.
- [`postmortem-writing`](../skills/postmortem-writing/): Blameless postmortems.
- [`performance-engineer`](../skills/performance-engineer/): Application performance optimization.
---
## 📊 Data & Analytics
### 📊 The "Data & Analytics" Pack
_For making sense of the numbers._
- [`analytics-tracking`](../skills/analytics-tracking/): Set up GA4/PostHog correctly.
- [`claude-d3js-skill`](../skills/claude-d3js-skill/): Beautiful custom visualizations with D3.js.
- [`sql-pro`](../skills/sql-pro/): Modern SQL with cloud-native databases.
- [`postgres-best-practices`](../skills/postgres-best-practices/): Postgres optimization.
- [`ab-test-setup`](../skills/ab-test-setup/): Validated learning.
- [`database-architect`](../skills/database-architect/): Database design from scratch.
### 🔄 The "Data Engineering" Pack
_For building data pipelines._
- [`data-engineer`](../skills/data-engineer/): Data pipeline architecture.
- [`airflow-dag-patterns`](../skills/airflow-dag-patterns/): Apache Airflow DAGs.
- [`dbt-transformation-patterns`](../skills/dbt-transformation-patterns/): Analytics engineering.
- [`vector-database-engineer`](../skills/vector-database-engineer/): Vector databases for RAG.
- [`embedding-strategies`](../skills/embedding-strategies/): Embedding model selection.
---
## 🎨 Creative & Content
### 🎨 The "Creative Director" Pack
_For visuals, content, and branding._
- [`canvas-design`](../skills/canvas-design/): Generate posters and diagrams.
- [`frontend-design`](../skills/frontend-design/): UI aesthetics.
- [`content-creator`](../skills/content-creator/): SEO-optimized blog posts.
- [`copy-editing`](../skills/copy-editing/): Polish your prose.
- [`algorithmic-art`](../skills/algorithmic-art/): Code-generated masterpieces.
- [`interactive-portfolio`](../skills/interactive-portfolio/): Portfolios that land jobs.
---
## 🐞 Quality Assurance
### 🐞 The "QA & Testing" Pack
_For breaking things before users do._
- [`test-driven-development`](../skills/test-driven-development/): Red, Green, Refactor.
- [`systematic-debugging`](../skills/systematic-debugging/): Debug like Sherlock Holmes.
- [`browser-automation`](../skills/browser-automation/): End-to-end testing with Playwright.
- [`e2e-testing-patterns`](../skills/e2e-testing-patterns/): Reliable E2E test suites.
- [`ab-test-setup`](../skills/ab-test-setup/): Validated experiments.
- [`code-review-checklist`](../skills/code-review-checklist/): Catch bugs in PRs.
- [`test-fixing`](../skills/test-fixing/): Fix failing tests systematically.
---
## 🔧 Specialized Packs
### 📱 The "Mobile Developer" Pack
_For iOS, Android, and cross-platform apps._
- [`mobile-developer`](../skills/mobile-developer/): Cross-platform mobile development.
- [`react-native-architecture`](../skills/react-native-architecture/): React Native with Expo.
- [`flutter-expert`](../skills/flutter-expert/): Flutter multi-platform apps.
- [`ios-developer`](../skills/ios-developer/): iOS development with Swift.
- [`app-store-optimization`](../skills/app-store-optimization/): ASO for App Store and Play Store.
### 🔗 The "Integration & APIs" Pack
_For connecting services and building integrations._
- [`stripe-integration`](../skills/stripe-integration/): Payments and subscriptions.
- [`twilio-communications`](../skills/twilio-communications/): SMS, voice, WhatsApp.
- [`hubspot-integration`](../skills/hubspot-integration/): CRM integration.
- [`plaid-fintech`](../skills/plaid-fintech/): Bank account linking and ACH.
- [`algolia-search`](../skills/algolia-search/): Search implementation.
### 🎯 The "Architecture & Design" Pack
_For system design and technical decisions._
- [`senior-architect`](../skills/senior-architect/): Comprehensive software architecture.
- [`architecture-patterns`](../skills/architecture-patterns/): Clean Architecture, DDD, Hexagonal.
- [`microservices-patterns`](../skills/microservices-patterns/): Microservices architecture.
- [`event-sourcing-architect`](../skills/event-sourcing-architect/): Event sourcing and CQRS.
- [`architecture-decision-records`](../skills/architecture-decision-records/): Document technical decisions.
---
## 📚 How to Use Bundles
### Installation
1. **Clone the repository:**
```bash
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
2. **Or use the installer:**
```bash
npx antigravity-awesome-skills
```
### Using Skills
Once installed, reference skills in your AI assistant:
- **Claude Code**: `>> @skill-name help me...`
- **Cursor**: `@skill-name` in chat
- **Gemini CLI**: `Use skill-name...`
### Customizing Bundles
You can create your own bundle by:
1. Copying skill folders to your `.agent/skills/` directory
2. Or referencing multiple skills in a single conversation
---
## 🎓 Learning Paths
### Beginner → Intermediate → Advanced
**Web Development:**
1. Start: `Essentials` → `Web Wizard`
2. Grow: `Full-Stack Developer` → `Architecture & Design`
3. Master: `Observability & Monitoring` → `Security Developer`
**AI/ML:**
1. Start: `Essentials` → `Agent Architect`
2. Grow: `LLM Application Developer` → `Data Engineering`
3. Master: Advanced RAG and agent orchestration
**Security:**
1. Start: `Essentials` → `Security Developer`
2. Grow: `Security Engineer` → Advanced pentesting
3. Master: Red team tactics and threat modeling
---
## 🤝 Contributing
Found a skill that should be in a bundle? Or want to create a new bundle? [Open an issue](https://github.com/sickn33/antigravity-awesome-skills/issues) or submit a PR!
---
## 📖 Related Documentation
- [Getting Started Guide](GETTING_STARTED.md)
- [Full Skill Catalog](../CATALOG.md)
- [Contributing Guide](../CONTRIBUTING.md)
---
_Last updated: January 2026 | Total Skills: 560+ | Total Bundles: 20+_

View File

@@ -1,24 +1,23 @@
# CI Drift Fix Guide
**Problem**: The failing job is caused by uncommitted changes detected in `README.md` or `skills_index.json` after the update scripts run.
**Problem**: The failing job is caused by uncommitted changes detected in `README.md`, `skills_index.json`, or catalog files after the update scripts run.
**Error**:
```
❌ Detected uncommitted changes in README.md or skills_index.json. Please run scripts locally and commit.
❌ Detected uncommitted changes produced by registry/readme/catalog scripts.
```
**Cause**:
Scripts like `scripts/generate_index.py` and `scripts/update_readme.py` modify `README.md` and `skills_index.json`, but the workflow expects these files to have no changes after the scripts are run. Any differences mean the committed repo is out-of-sync with what the generation scripts produce.
Scripts like `scripts/generate_index.py`, `scripts/update_readme.py`, and `scripts/build-catalog.js` modify `README.md`, `skills_index.json`, `data/catalog.json`, `data/bundles.json`, `data/aliases.json`, and `CATALOG.md`. The workflow expects these files to have no changes after the scripts run. Any differences mean the committed repo is out-of-sync with what the generation scripts produce.
**How to Fix (DO THIS EVERY TIME):**
1. Run the **FULL Validation Chain** locally to regenerate `README.md` e `skills_index.json`:
1. Run the **FULL Validation Chain** locally:
```bash
python3 scripts/validate_skills.py
python3 scripts/generate_index.py
python3 scripts/update_readme.py
npm run chain
npm run catalog
```
2. Check for changes:
@@ -30,10 +29,10 @@ Scripts like `scripts/generate_index.py` and `scripts/update_readme.py` modify `
3. Commit and push any updates:
```bash
git add README.md skills_index.json
git add README.md skills_index.json data/catalog.json data/bundles.json data/aliases.json CATALOG.md
git commit -m "chore: sync generated registry files"
git push
```
**Summary**:
Always commit and push all changes produced by the registry or readme update scripts. This keeps the CI workflow passing by ensuring the repository and generated files are synced.
Always commit and push all changes produced by the registry, readme, and catalog scripts. This keeps the CI workflow passing by ensuring the repository and generated files are synced.

View File

@@ -11,11 +11,11 @@
Skills are specialized instruction files that teach AI assistants how to handle specific tasks. Think of them as expert knowledge modules that your AI can load on-demand.
**Simple analogy:** Just like you might consult different experts (a lawyer, a doctor, a mechanic), these skills let your AI become an expert in different areas when you need them.
### Do I need to install all 256+ skills?
### Do I need to install all 560+ skills?
**No!** When you clone the repository, all skills are available, but your AI only loads them when you explicitly invoke them with `@skill-name`.
It's like having a library - all books are there, but you only read the ones you need.
**Pro Tip:** Use [Starter Packs](docs/BUNDLES.md) to install only what matches your role.
**Pro Tip:** Use [Starter Packs](BUNDLES.md) to install only what matches your role.
### Which AI tools work with these skills?
@@ -41,7 +41,7 @@ The skill files themselves are stored locally on your computer, but your AI assi
---
## 🔒 Security & Trust (V3 Update)
## 🔒 Security & Trust (V4 Update)
### What do the Risk Labels mean?
@@ -116,7 +116,7 @@ Use the `@` symbol followed by the skill name:
### How do I know which skill to use?
1. **Browse the README**: Check the [Full Skill Registry](README.md#full-skill-registry-256256).
1. **Browse the catalog**: Check the [Skill Catalog](../CATALOG.md).
2. **Search**: `ls skills/ | grep "keyword"`
3. **Ask your AI**: "What skills do you have for testing?"
@@ -152,11 +152,11 @@ Include:
- Fix typos
- Add examples
- Improve docs
Check out [CONTRIBUTING.md](CONTRIBUTING.md) for instructions.
Check out [CONTRIBUTING.md](../CONTRIBUTING.md) for instructions.
### My PR failed "Quality Bar" check. Why?
V3 introduces automated quality control. Your skill might be missing:
V4 introduces automated quality control. Your skill might be missing:
1. A valid `description`.
2. Usage examples.

View File

@@ -1,4 +1,4 @@
# Getting Started with Antigravity Awesome Skills (V3)
# Getting Started with Antigravity Awesome Skills (V4)
**New here? This guide will help you supercharge your AI Agent in 5 minutes.**
@@ -15,21 +15,29 @@ AI Agents (like **Claude Code**, **Gemini**, **Cursor**) are smart, but they lac
## ⚡️ Quick Start: The "Starter Packs"
Don't panic about the 256+ skills. You don't need them all at once.
Don't panic about the 560+ skills. You don't need them all at once.
We have curated **Starter Packs** to get you running immediately.
### 1. Install the Repo
Copy the skills to your agent's folder:
**Option A — npx (easiest):**
```bash
# Universal Installation (works for most agents)
npx antigravity-awesome-skills
```
This clones to `~/.agent/skills` by default. Use `--cursor`, `--claude`, or `--gemini` to install for a specific tool, or `--path <dir>` for a custom location. Run `npx antigravity-awesome-skills --help` for details.
**Option B — git clone:**
```bash
# Universal (works for most agents)
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
### 2. Pick Your Persona
Find the bundle that matches your role (see [docs/BUNDLES.md](docs/BUNDLES.md)):
Find the bundle that matches your role (see [BUNDLES.md](BUNDLES.md)):
| Persona | Bundle Name | What's Inside? |
| :-------------------- | :------------- | :------------------------------------------------ |
@@ -76,7 +84,7 @@ Once installed, just talk to your AI naturally.
---
## 🛡️ Trust & Safety (New in V3)
## 🛡️ Trust & Safety (New in V4)
We classify skills so you know what you're running:
@@ -84,13 +92,13 @@ We classify skills so you know what you're running:
- 🔵 **Safe**: Community skills that are non-destructive (Read-only/Planning).
- 🔴 **Risk**: Skills that modify systems or perform security tests (Authorized Use Only).
_Check the [Full Registry](README.md#full-skill-registry-256256) for risk labels._
_Check the [Skill Catalog](../CATALOG.md) for the full list._
---
## ❓ FAQ
**Q: Do I need to install all 250 skills?**
**Q: Do I need to install all 560 skills?**
A: You clone the whole repo, but your AI only _reads_ the ones you ask for (or that are relevant). It's lightweight!
**Q: Can I make my own skills?**
@@ -103,6 +111,6 @@ A: Yes, MIT License. Open Source forever.
## ⏭️ Next Steps
1. [Browse the Bundles](docs/BUNDLES.md)
2. [See Real-World Examples](docs/EXAMPLES.md)
3. [Contribute a Skill](CONTRIBUTING.md)
1. [Browse the Bundles](BUNDLES.md)
2. [See Real-World Examples](EXAMPLES.md)
3. [Contribute a Skill](../CONTRIBUTING.md)

View File

@@ -57,8 +57,9 @@ We also categorize skills by who maintains them:
## How to Validate Your Skill
Run the validator script before submitting a PR:
The canonical validator is `scripts/validate_skills.py`. Run `npm run validate` (or `npm run validate:strict`) before submitting a PR:
```bash
python3 scripts/validate_skills.py --strict
npm run validate # soft mode (warnings only)
npm run validate:strict # strict mode (CI uses this)
```

View File

@@ -14,6 +14,64 @@ If you recognize your work here and it is not properly attributed, please open a
| `react-patterns` | [React Docs](https://react.dev/) | CC-BY | Official patterns. |
| **All Official Skills** | [Anthropic / Google / OpenAI] | Proprietary | Usage encouraged by vendors. |
## Skills from VoltAgent/awesome-agent-skills
The following skills were added from the curated collection at [VoltAgent/awesome-agent-skills](https://github.com/VoltAgent/awesome-agent-skills):
### Official Team Skills
| Skill | Original Source | License | Notes |
| :---- | :-------------- | :------ | :---- |
| `vercel-deploy-claimable` | [Vercel Labs](https://github.com/vercel-labs/agent-skills) | MIT | Official Vercel skill |
| `design-md` | [Google Labs (Stitch)](https://github.com/google-labs-code/stitch-skills) | Compatible | Google Labs Stitch skills |
| `hugging-face-cli`, `hugging-face-jobs` | [Hugging Face](https://github.com/huggingface/skills) | Compatible | Official Hugging Face skills |
| `culture-index`, `fix-review`, `sharp-edges` | [Trail of Bits](https://github.com/trailofbits/skills) | Compatible | Security skills from Trail of Bits |
| `expo-deployment`, `upgrading-expo` | [Expo](https://github.com/expo/skills) | Compatible | Official Expo skills |
| `commit`, `create-pr`, `find-bugs`, `iterate-pr` | [Sentry](https://github.com/getsentry/skills) | Compatible | Sentry dev team skills |
| `using-neon` | [Neon](https://github.com/neondatabase/agent-skills) | Compatible | Neon Postgres best practices |
| `fal-audio`, `fal-generate`, `fal-image-edit`, `fal-platform`, `fal-upscale`, `fal-workflow` | [fal.ai Community](https://github.com/fal-ai-community/skills) | Compatible | fal.ai AI model skills |
### Community Skills
| Skill | Original Source | License | Notes |
| :---- | :-------------- | :------ | :---- |
| `automate-whatsapp`, `observe-whatsapp` | [gokapso](https://github.com/gokapso/agent-skills) | Compatible | WhatsApp automation skills |
| `readme` | [Shpigford](https://github.com/Shpigford/skills) | Compatible | README generation |
| `screenshots` | [Shpigford](https://github.com/Shpigford/skills) | Compatible | Marketing screenshots |
| `aws-skills` | [zxkane](https://github.com/zxkane/aws-skills) | Compatible | AWS development patterns |
| `deep-research` | [sanjay3290](https://github.com/sanjay3290/ai-skills) | Compatible | Gemini Deep Research Agent |
| `ffuf-claude-skill` | [jthack](https://github.com/jthack/ffuf_claude_skill) | Compatible | Web fuzzing with ffuf |
| `ui-skills` | [ibelick](https://github.com/ibelick/ui-skills) | Compatible | UI development constraints |
| `vexor` | [scarletkc](https://github.com/scarletkc/vexor) | Compatible | Vector-powered CLI |
| `pypict-skill` | [omkamal](https://github.com/omkamal/pypict-claude-skill) | Compatible | Pairwise test generation |
| `makepad-skills` | [ZhangHanDong](https://github.com/ZhangHanDong/makepad-skills) | Compatible | Makepad UI development |
| `swiftui-expert-skill` | [AvdLee](https://github.com/AvdLee/SwiftUI-Agent-Skill) | Compatible | SwiftUI best practices |
| `threejs-skills` | [CloudAI-X](https://github.com/CloudAI-X/threejs-skills) | Compatible | Three.js 3D experiences |
| `claude-scientific-skills` | [K-Dense-AI](https://github.com/K-Dense-AI/claude-scientific-skills) | Compatible | Scientific research skills |
| `claude-win11-speckit-update-skill` | [NotMyself](https://github.com/NotMyself/claude-win11-speckit-update-skill) | Compatible | Windows 11 management |
| `imagen` | [sanjay3290](https://github.com/sanjay3290/ai-skills) | Compatible | Google Gemini image generation |
| `security-bluebook-builder` | [SHADOWPR0](https://github.com/SHADOWPR0/security-bluebook-builder) | Compatible | Security documentation |
| `claude-ally-health` | [huifer](https://github.com/huifer/Claude-Ally-Health) | Compatible | Health assistant |
| `clarity-gate` | [frmoretto](https://github.com/frmoretto/clarity-gate) | Compatible | RAG quality verification |
| `n8n-code-python`, `n8n-mcp-tools-expert`, `n8n-node-configuration` | [czlonkowski](https://github.com/czlonkowski/n8n-skills) | Compatible | n8n automation skills |
| `varlock-claude-skill` | [wrsmith108](https://github.com/wrsmith108/varlock-claude-skill) | Compatible | Secure environment variables |
| `beautiful-prose` | [SHADOWPR0](https://github.com/SHADOWPR0/beautiful_prose) | Compatible | Writing style guide |
| `claude-speed-reader` | [SeanZoR](https://github.com/SeanZoR/claude-speed-reader) | Compatible | Speed reading tool |
| `skill-seekers` | [yusufkaraaslan](https://github.com/yusufkaraaslan/Skill_Seekers) | Compatible | Skill conversion tool |
- **frontend-slides** - [zarazhangrui](https://github.com/zarazhangrui/frontend-slides)
- **linear-claude-skill** - [wrsmith108](https://github.com/wrsmith108/linear-claude-skill)
- **skill-rails-upgrade** - [robzolkos](https://github.com/robzolkos/skill-rails-upgrade)
- **context-fundamentals** - [muratcankoylan](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)
- **context-degradation** - [muratcankoylan](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)
- **context-compression** - [muratcankoylan](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)
- **context-optimization** - [muratcankoylan](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)
- **multi-agent-patterns** - [muratcankoylan](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)
- **tool-design** - [muratcankoylan](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)
- **evaluation** - [muratcankoylan](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)
- **memory-systems** - [muratcankoylan](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)
- **terraform-skill** - [antonbabenko](https://github.com/antonbabenko/terraform-skill)
## License Policy
- **Code**: All original code in this repository is **MIT**.

View File

@@ -31,9 +31,7 @@
antigravity-awesome-skills/
├── 📄 README.md ← Overview & skill list
├── 📄 GETTING_STARTED.md ← Start here! (NEW)
├── 📄 CONTRIBUTING.md ← How to contribute
├── 📄 FAQ.md ← Troubleshooting
├── 📁 skills/ ← All 250+ skills live here
│ │
@@ -54,6 +52,8 @@ antigravity-awesome-skills/
│ └── 📄 MAINTENANCE.md ← Maintainers Guide
└── 📁 docs/ ← Documentation
├── 📄 GETTING_STARTED.md ← Start here! (NEW)
├── 📄 FAQ.md ← Troubleshooting
├── 📄 BUNDLES.md ← Starter Packs (NEW)
├── 📄 QUALITY_BAR.md ← Quality Standards
├── 📄 SKILL_ANATOMY.md ← How skills work
@@ -456,7 +456,7 @@ START HERE
│ 5. Submit PR │
│ │
│ 🆘 HELP │
│ • GETTING_STARTED.md - Basics
│ • docs/GETTING_STARTED.md - Basics │
│ • CONTRIBUTING.md - How to contribute │
│ • SKILL_ANATOMY.md - Deep dive │
│ • GitHub Issues - Ask questions │
@@ -505,7 +505,7 @@ Month 1: Regular contributor
**Visual learner?** This guide should help! Still have questions? Check out:
- [GETTING_STARTED.md](../GETTING_STARTED.md) - Text-based intro
- [GETTING_STARTED.md](GETTING_STARTED.md) - Text-based intro
- [SKILL_ANATOMY.md](SKILL_ANATOMY.md) - Detailed breakdown
- [CONTRIBUTING.md](../CONTRIBUTING.md) - How to contribute

View File

@@ -1,148 +0,0 @@
# 📦 Các Gói Skill Của Antigravity (Bundles)
Không biết bắt đầu từ đâu? Đừng lo. Hãy chọn ngay một gói (Bundle) bên dưới để sở hữu bộ kỹ năng "trấn phái" phù hợp nhất với vai trò của bạn.
---
## 🚀 Gói "Cơ Bản" (The Essentials Starter Pack)
_Dành cho tất cả mọi người. Mới nhập môn thì cài bộ này trước._
- `concise-planning`: Luôn bắt đầu mọi việc bằng một kế hoạch ngắn gọn.
- `lint-and-validate`: Tự động giữ cho code sạch đẹp.
- `git-pushing`: Lưu trữ kết quả làm việc an toàn lên Git.
- `kaizen`: Tư duy cải tiến liên tục (nhỏ nhưng đều đặn).
---
## 🛡️ Gói "Kỹ Sư Bảo Mật" (The Security Engineer Pack)
_Dành cho pentester, chuyên gia audit và hacker mũ trắng._
- `ethical-hacking-methodology`: Cuốn "Kinh Thánh" về ethical hacking.
- `burp-suite-testing`: Quét lỗ hổng bảo mật Web.
- `owasp-top-10`: Kiểm tra nhanh các lỗi bảo mật phổ biến nhất.
- `linux-privilege-escalation`: Đánh giá bảo mật nâng cao cho Linux.
- `cloud-penetration-testing`: Bảo mật đám mây AWS/Azure/GCP.
---
## 🌐 Gói "Phù Thủy Web" (The Web Wizard Pack)
_Dành cho anh em Dev xây dựng các web app hiện đại, hiệu năng cao._
- `frontend-design`: Hướng dẫn về thẩm mỹ và nguyên tắc UI.
- `react-patterns`: Các bài thực hành tốt nhất (best practices) cho React.
- `tailwind-mastery`: Làm chủ CSS siêu tốc.
- `form-cro`: Tối ưu hóa các biểu mẫu (form) để tăng tỷ lệ chuyển đổi.
- `seo-audit`: Giúp web của bạn lên top Google.
---
## 🤖 Gói "Kiến Trúc Sư AI" (The Agent Architect Pack)
_Dành cho người xây dựng hệ thống AI._
- `agent-evaluation`: Kiểm thử và đánh giá Agent của bạn.
- `langgraph`: Xây dựng các luồng agent có trạng thái (stateful).
- `mcp-builder`: Tự chế tạo công cụ (tools) riêng cho AI.
- `prompt-engineering`: Làm chủ nghệ thuật ra lệnh cho LLM.
---
## 🎮 Gói "Làm Game Indie" (The Indie Game Dev Pack)
_Dành cho người làm game với sự trợ giúp của AI._
- `game-development/game-design`: Cơ chế và vòng lặp game (game loops).
- `game-development/2d-games`: Sprites và vật lý 2D.
- `game-development/3d-games`: Mô hình và đổ bóng (shaders) 3D.
- `game-development/unity-csharp`: Làm chủ C# scripting trong Unity.
- `algorithmic-art`: Tạo tài nguyên game bằng code nghệ thuật.
---
## 🐍 Gói "Trùm Python" (The Python Pro Pack)
_Dành cho đội Backend và khoa học dữ liệu._
- `python-patterns`: Viết code Python chuẩn chỉ (idiomatic).
- `poetry-manager`: Quản lý thư viện phụ thuộc (dependency) "không đau đầu".
- `pytest-mastery`: Làm chủ các framework kiểm thử.
- `fastapi-expert`: Xây dựng API hiệu năng cao.
- `django-guide`: Framework "pin trâu" cho mọi tính năng (batteries-included).
---
## 🦄 Gói "Khởi Nghiệp" (The Startup Founder Pack)
_Dành cho người xây sản phẩm, không chỉ mỗi code._
- `product-requirements-doc`: Định nghĩa rõ những gì cần làm.
- `competitor-analysis`: Biết người biết ta, trăm trận trăm thắng.
- `pitch-deck-creator`: Gọi vốn (hoặc đơn giản là trình bày ý tưởng).
- `landing-page-copy`: Viết nội dung bán hàng "đi vào lòng người".
- `stripe-integration`: Tích hợp thanh toán để lụm tiền.
---
## 🌧️ Gói "DevOps & Cloud" (The DevOps Pack)
_Dành cho người lo hạ tầng và mở rộng hệ thống._
- `docker-expert`: Bậc thầy về container.
- `aws-serverless`: Triển khai không máy chủ trên AWS (Lambda, DynamoDB).
- `environment-setup-guide`: Chuẩn hóa môi trường cho cả team.
- `deployment-procedures`: Chiến lược rollout an toàn.
- `bash-linux`: Phù thủy dòng lệnh Terminal.
---
## 📊 Gói "Dữ Liệu & Phân Tích" (The Data Pack)
_Dành cho người thích các con số._
- `analytics-tracking`: Cài đặt GA4/PostHog chuẩn ngay từ đầu.
- `d3-viz`: Vẽ biểu đồ tùy chỉnh tuyệt đẹp.
- `sql-mastery`: Viết câu truy vấn (query) tối ưu.
- `ab-test-setup`: Học hỏi dựa trên dữ liệu thực tế.
---
## 🎨 Gói "Giám Đốc Sáng Tạo" (The Creative Director Pack)
_Dành cho hình ảnh, nội dung và thương hiệu._
- `canvas-design`: Tạo poster và sơ đồ.
- `frontend-design`: Thẩm mỹ giao diện.
- `content-creator`: Viết blog chuẩn SEO.
- `copy-editing`: Chuốt lại câu từ cho mượt.
- `algorithmic-art`: Tạo kiệt tác bằng code.
---
## 🐞 Gói "Kiểm Thử & QA" (The QA & Testing Pack)
_Dành cho người "đập phá" trước khi người dùng kịp làm._
- `test-driven-development`: Quy trình Đỏ, Xanh, Refactor.
- `systematic-debugging`: Thám tử Sherlock Holmes trong làng code.
- `browser-automation`: Test toàn trình (E2E) với Playwright.
- `ab-test-setup`: Thử nghiệm có kiểm chứng.
- `code-review-checklist`: Bắt lỗi ngay trong Pull Request.
---
## 🖌️ Gói "Thiết Kế Web" (The Web Designer Pack)
_Dành cho trải nghiệm điểm ảnh hoàn hảo (pixel-perfect)._
- `ui-ux-pro-max`: Hệ thống thiết kế (Design systems) cao cấp.
- `frontend-design`: Nền tảng của cái đẹp.
- `3d-web-experience`: Ma thuật với Three.js & R3F.
- `canvas-design`: Hình ảnh tĩnh/poster.
- `responsive-layout`: Nguyên tắc "Mobile-first" (Di động trước tiên).
---
_Để sử dụng một gói, bạn chỉ cần copy tên các skill vào thư mục `.agent/skills` hoặc gọi chúng trực tiếp với agent của bạn nhé._

View File

@@ -1,239 +0,0 @@
# 🤝 Hướng Dẫn Đóng Góp - V3 Enterprise Edition
[Đọc bản gốc tiếng Anh](./CONTRIBUTING.md)
**Cảm ơn bạn đã quan tâm và muốn đóng góp cho dự án!**
Tài liệu này sẽ hướng dẫn bạn quy trình đóng góp một cách cụ thể, ngay cả khi bạn chưa từng tham gia dự án mã nguồn mở nào.
Trong phiên bản V3, chúng tôi đặt ra tiêu chuẩn chất lượng cao hơn. Vui lòng đọc kỹ phần **Tiêu Chuẩn Chất Lượng Mới** bên dưới.
---
## 🧐 "Thước Đo Chất Lượng" (Tiêu Chuẩn V3)
**Lưu ý quan trọng cho Skill mới:** Mọi skill được gửi lên đều phải vượt qua **Quy Trình Kiểm Tra 5 Điểm** (xem chi tiết tại `docs/QUALITY_BAR.md`):
1. **Metadata (Siêu dữ liệu)**: Khai báo Frontmatter chính xác (gồm `name`, `description`).
2. **Safety (An toàn)**: Tuyệt đối không chứa lệnh gây nguy hiểm nếu không gắn nhãn "Risk".
3. **Clarity (Rõ ràng)**: Mục "When to use" (Khi nào sử dụng) phải được mô tả cụ thể, dễ hiểu.
4. **Examples (Ví dụ)**: Phải cung cấp ít nhất một ví dụ thực tế có thể copy-paste và chạy được ngay.
5. **Actions (Hành động)**: Phải đưa ra các bước thực hiện cụ thể, tránh nói chung chung kiểu "hãy suy nghĩ về...".
---
## Các Cách Đóng Góp
Bạn không cần phải là chuyên gia mới có thể đóng góp! Dưới đây là những việc mà bất kỳ ai cũng có thể làm để hỗ trợ dự án:
### 1. Cải Thiện Tài Liệu (Dễ nhất!)
- Sửa lỗi chính tả, ngữ pháp.
- Viết lại các đoạn hướng dẫn cho dễ hiểu hơn.
- Bổ sung ví dụ minh họa cho các skill hiện có.
- Dịch tài liệu sang ngôn ngữ khác (Như bản dịch tiếng Việt này chẳng hạn!).
### 2. Báo Cáo Vấn Đề (Issues)
- Thấy chỗ nào khó hiểu? Hãy phản hồi cho chúng tôi!
- Skill chạy không đúng? Hãy báo lỗi ngay!
- Có ý tưởng hay ho? Chúng tôi rất muốn lắng nghe!
### 3. Tạo Skill Mới
- Đóng gói kiến thức chuyên môn của bạn thành một skill.
- Bổ sung những mảng kiến thức còn thiếu trong kho tàng skill hiện tại.
- Nâng cấp và cải thiện các skill đã có.
### 4. Kiểm Tra và Xác Thực
- Chạy thử các skill và báo cáo kết quả (cái nào ổn, cái nào lỗi).
- Test trên nhiều công cụ AI khác nhau (Claude, ChatGPT, Gemini...).
- Đề xuất các cải tiến về hiệu năng hoặc trải nghiệm.
---
## Quy Trình Tạo Một Skill Mới
### Hướng Dẫn Từng Bước
#### Bước 1: Chọn Chủ Đề
Hãy tự hỏi: "Mình ước gì con AI của mình biết rành rẽ về cái gì nhỉ?".
Ví dụ: "Mình thạo Docker, để mình viết một skill dạy nó dùng Docker cho chuẩn".
#### Bước 2: Tạo Cấu Trúc Thư Mục
Tất cả skill nằm trong thư mục `skills/`. Hãy đặt tên thư mục theo kiểu `kebab-case` (chữ thường, nối bằng gạch ngang).
```bash
# Vào thư mục skills
cd skills/
# Tạo thư mục cho skill mới
mkdir my-awesome-skill
cd my-awesome-skill
# Tạo file nội dung SKILL.md
touch SKILL.md
```
#### Bước 3: Viết Nội Dung SKILL.md
Mọi skill đều phải tuân theo cấu trúc cơ bản sau. **Hãy copy mẫu này để bắt đầu:**
```markdown
---
name: my-awesome-skill
description: "Mô tả ngắn gọn (1 dòng) về công dụng của skill này"
---
# Tên Skill
## Tổng Quan
Giải thích skill này dùng để làm gì và bối cảnh sử dụng.
## Khi Nào Nên Dùng (When to Use)
- Dùng khi [trường hợp 1]
- Dùng khi [trường hợp 2]
## Cách Hoạt Động
Hướng dẫn từng bước chi tiết để AI làm theo...
## Ví Dụ Minh Họa
### Ví Dụ 1
\`\`\`
code example here
\`\`\`
## Lưu Ý / Best Practices
- ✅ Nên làm: ...
- ❌ Tránh làm: ...
```
#### Bước 4: Kiểm Tra (QUAN TRỌNG VỚI V3)
Chạy script kiểm tra (validation) trên máy của bạn. **Chúng tôi sẽ không merge các PR nếu chưa qua bước này.**
```bash
# Chế độ thường (chỉ hiện cảnh báo)
python3 scripts/validate_skills.py
# Chế độ nghiêm ngặt (giống hệ thống CI)
python3 scripts/validate_skills.py --strict
```
Script này sẽ check:
- ✅ File `SKILL.md` đã có chưa?
- ✅ Frontmatter khai báo đúng chưa?
- ✅ Tên skill có khớp với tên thư mục không?
- ✅ Có đạt chuẩn chất lượng (Quality Bar) không?
#### Bước 5: Gửi Skill (Pull Request)
```bash
git add skills/my-awesome-skill/
git commit -m "feat: add my-awesome-skill"
git push origin my-branch
```
---
## Mẫu Template Chuẩn (Copy & Paste)
Để tiết kiệm thời gian, bạn hãy dùng mẫu đầy đủ này:
```markdown
---
name: your-skill-name
description: "Mô tả ngắn gọn công dụng và thời điểm dùng skill này"
---
# Tên Skill
## Tổng Quan
[2-3 câu giới thiệu ngắn gọn về chức năng của skill]
## Khi Nào Nên Dùng
- Khi bạn cần [làm việc A]
- Khi bạn muốn [đạt kết quả B]
## Hướng Dẫn Chi Tiết
### 1. [Bước đầu tiên]
[Mô tả các thực hiện]
## Ví Dụ
### Ví Dụ 1: [Tên trường hợp cụ thể]
\`\`\`language
// Code mẫu
\`\`\`
## Best Practices
-**Nên:** [Thói quen tốt]
-**Không nên:** [Điều cần tránh]
## Xử Lý Sự Cố (Troubleshooting)
**Vấn Đề:** [Lỗi thường gặp]
**Giải Pháp:** [Cách khắc phục]
```
---
## Quy Tắc Viết Commit Message
Vui lòng sử dụng các tiền tố sau để phân loại commit:
- `feat:` - Thêm skill mới hoặc tính năng lớn.
- `docs:` - Cập nhật/sửa đổi tài liệu.
- `fix:` - Sửa lỗi (bug fix).
- `refactor:` - Tối ưu code nhưng không đổi tính năng.
- `test:` - Thêm hoặc sửa test.
- `chore:` - Các việc vặt, bảo trì hệ thống.
**Ví dụ:**
```
feat: add kubernetes-deployment skill
docs: improve getting started guide
fix: correct typo in stripe-integration skill
```
---
## Tài Liệu Tham Khảo
### Cho người mới dùng Git/GitHub
- [Hướng dẫn Hello World của GitHub](https://guides.github.com/activities/hello-world/)
- [Git Cơ bản](https://git-scm.com/book/en/v2/Getting-Started-Git-Basics)
### Cho người mới viết Markdown
- [Hướng dẫn Markdown](https://www.markdownguide.org/basic-syntax/)
---
## Quy Tắc Ứng Xử (Code of Conduct)
- Tôn trọng và hòa nhã với mọi người.
- Luôn chào đón thành viên mới.
- Góp ý mang tính xây dựng, tích cực.
- **Nghiêm cấm nội dung độc hại**: Xem chi tiết tại `docs/SECURITY_GUARDRAILS.md`.
---
**Cảm ơn bạn đã góp phần xây dựng dự án!**
Mỗi đóng góp của bạn, dù là nhỏ nhất, đều rất đáng quý. Dù chỉ là sửa lỗi chính tả hay viết hẳn một skill mới - bạn đang trực tiếp giúp đỡ hàng ngàn lập trình viên khác làm việc hiệu quả hơn!

View File

@@ -1,56 +0,0 @@
# 🧪 Ví Dụ Thực Tế ("Sách dạy nấu ăn Antigravity")
Skill đứng một mình đã mạnh, nhưng khi kết hợp lại thì "vô đối".
Dưới đây là 3 kịch bản phổ biến và cách giải quyết chúng bằng kho tàng này.
## 🥘 Công thức 1: "Kiểm toán Code cũ" (The Legacy Code Audit)
_Tình huống: Bạn vừa phải nhận lại một dự án Node.js 5 năm tuổi siêu lộn xộn. Bạn cần dọn dẹp nó một cách an toàn._
**Các Skill cần dùng:**
1. `concise-planning` (Để vẽ bản đồ cho đống hỗn độn)
2. `lint-and-validate` (Để tìm lỗi)
3. `security-review` (Để tìm lỗ hổng)
**Quy trình (Workflow):**
1. **Lập kế hoạch**: "Này Agent, dùng `concise-planning` để tạo checklist refactor lại thư mục `src/legacy-api.js` cho tôi."
2. **Kiểm toán**: "Chạy `security-review` trên file `package.json` để xem có thư viện nào dính lỗi bảo mật không."
3. **Sửa lỗi**: "Dùng các quy tắc của `lint-and-validate` để tự sửa lỗi định dạng trong thư mục `src/`."
---
## 🥘 Công thức 2: "Web App Hiện Đại" (The Modern Web App)
_Tình huống: Bạn cần dựng một trang Landing Page có hiệu năng cao trong vòng 2 tiếng._
**Các Skill cần dùng:**
1. `frontend-design` (Để lo phần thẩm mỹ)
2. `react-patterns` (Để lo phần cấu trúc code)
3. `tailwind-mastery` (Để code giao diện siêu tốc)
**Quy trình (Workflow):**
1. **Thiết kế**: "Dùng `frontend-design` tạo cho tôi một bảng màu và font chữ theo phong cách 'Quán Cà phê Cyberpunk'."
2. **Dựng khung**: "Khởi tạo dự án Vite. Sau đó áp dụng `react-patterns` để viết component 'Hero'."
3. **Tạo kiểu**: "Dùng `tailwind-mastery` làm cho mấy cái nút bấm có hiệu ứng kính (glassmorphism) và chuẩn mobile giúp tôi."
---
## 🥘 Công thức 3: "Kiến Trúc Sư Agent" (The Agent Architect)
_Tình huống: Bạn muốn xây một con AI agent riêng có khả năng tự kiểm tra code của chính nó._
**Các Skill cần dùng:**
1. `mcp-builder` (Để xây công cụ)
2. `agent-evaluation` (Để kiểm tra độ tin cậy)
3. `prompt-engineering` (Để tinh chỉnh câu lệnh)
**Quy trình (Workflow):**
1. **Xây dựng**: "Dùng `mcp-builder` để tạo một công cụ tên là `verify-file`."
2. **Ra lệnh**: "Áp dụng các mẫu `prompt-engineering` vào System Prompt để đảm bảo con agent luôn kiểm tra đường dẫn file trước khi làm gì đó."
3. **Kiểm thử**: "Chạy `agent-evaluation` để đo xem tần suất con agent này tìm sai file là bao nhiêu phần trăm."

View File

@@ -1,178 +0,0 @@
# ❓ Câu Hỏi Thường Gặp (FAQ)
**Bạn có thắc mắc?** Đừng lo, bạn không cô đơn đâu! Dưới đây là giải đáp cho những câu hỏi phổ biến nhất về Antigravity Awesome Skills.
---
## 🎯 Câu hỏi chung
### "Skill" rốt cuộc là cái gì?
Skills thực chất là các file hướng dẫn chuyên biệt dùng để dạy cho trợ lý AI cách xử lý một tác vụ cụ thể. Hãy coi nó như những module kiến thức chuyên gia mà AI của bạn có thể "nạp" vào khi cần.
**Ví dụ dễ hiểu:** Giống như trong phim Ma Trận, khi Neo cần biết lái trực thăng, anh ấy tải chương trình lái trực thăng vào não. Skills ở đây cũng y hệt vậy, giúp biến AI của bạn thành chuyên gia trong từng lĩnh vực (luật sư, bác sĩ, thợ máy...) tùy theo nhu cầu của bạn.
### Tôi có phải cài hết hơn 250 skill không?
**Không hề!** Khi bạn clone cái kho này về, toàn bộ skills sẽ nằm sẵn trong máy, NHƯNG AI của bạn chỉ thực sự đọc và load kỹ năng nào mà bạn gọi tên (bằng lệnh `@tên-skill`) thôi.
Nó giống như một thư viện sách: sách thì đầy trên kệ, nhưng bạn chỉ cần rút đúng cuốn bạn định đọc.
**Mẹo:** Dùng các [Gói Khởi Điểm (Starter Packs)](../BUNDLES.vi.md) để cài bộ phù hợp với công việc của bạn cho gọn.
### Những công cụ AI nào dùng được mấy skill này?
-**Claude Code** (Anthropic CLI)
-**Gemini CLI** (Google)
-**Codex CLI** (OpenAI)
-**Cursor** (AI IDE)
-**Antigravity IDE**
-**OpenCode**
- ⚠️ **GitHub Copilot** (Hỗ trợ một phần, phải copy-paste thủ công)
### Dùng cái này có mất phí không?
**Hoàn toàn miễn phí!** Dự án này dùng Giấy phép MIT.
- ✅ Miễn phí cho dùng cá nhân
- ✅ Miễn phí cho thương mại/công ty
- ✅ Bạn thoải mái sửa đổi code
### Skills có chạy offline không?
Bản thân các file skill nằm trên máy bạn (offline), nhưng trợ lý AI (Claude, Gemini...) thì vẫn cần mạng internet để hoạt động nhé.
---
## 🔒 Độ Tin Cậy & An Toàn (Cập nhật V3)
### Mấy cái "Nhãn Rủi Ro" (Risk Label) nghĩa là sao?
Để đảm bảo an toàn, chúng tôi phân loại skill theo màu:
-**Safe (Trắng/Xanh)**: Skill an toàn, chỉ đọc, lập kế hoạch hoặc vô hại.
- 🔴 **Risk (Đỏ)**: Skill có khả năng chỉnh sửa/xóa file hệ thống, hoặc dùng để quét mạng (pentest). **Cần cẩn trọng khi dùng.**
- 🟣 **Official (Tím)**: Skill chính chủ do các nhà cung cấp uy tín (Anthropic, DeepMind...) bảo trì.
### Dùng skill này có sợ bị hack máy không?
**Không.** Skill chỉ là file văn bản (text). Tuy nhiên, nó chứa hướng dẫn để AI chạy lệnh. Nếu skill bảo "xóa hết file đi", một con AI ngây thơ có thể sẽ làm thật.
_Do đó: Luôn kiểm tra Nhãn Rủi Ro và đọc qua nội dung skill trước khi dùng._
---
## 📦 Cài đặt & Thiết lập
### Tôi nên cài skill vào đâu?
Đường dẫn chuẩn nhất dùng được cho hầu hết công cụ là `.agent/skills/`:
```bash
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
**Đường dẫn riêng cho từng tool:**
- Claude Code: `.claude/skills/`
- Gemini CLI: `.gemini/skills/`
- Cursor: `.cursor/skills/` hoặc thư mục gốc của dự án
### Dùng trên Windows có được không?
**Được**, nhưng lưu ý là một số skill "Official" có dùng **symlinks** (liên kết tượng trưng) mà Windows mặc định hỗ trợ hơi kém.
Hãy chạy lệnh git này để bật hỗ trợ symlink:
```bash
git clone -c core.symlinks=true https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
Hoặc bật chế độ "Developer Mode" trong phần Settings của Windows.
### Cập nhật skill kiểu gì?
Chỉ cần vào thư mục đó và pull code mới về là xong:
```bash
cd .agent/skills
git pull origin main
```
---
## 🛠️ Cách sử dụng
### Gọi skill như thế nào?
Dùng ký tự `@` cộng với tên skill:
```
@brainstorming giúp tôi thiết kế một app quản lý công việc
```
### Dùng nhiều skill cùng lúc được không?
**Được luôn!** Bạn có thể kết hợp (combo) nhiều skill:
```
@brainstorming lên ý tưởng cho tôi, xong rồi dùng @writing-plans để ra list công việc cụ thể nhé.
```
### Làm sao biết nên dùng skill nào?
1. **Đọc file README**: Xem [Danh sách đầy đủ các skill](README.vi.md#trọn-bộ-danh-sách-256-kỹ-năng-full-list).
2. **Tìm kiếm**: `ls skills/ | grep "từ-khóa"` (ví dụ tìm "test", "security").
3. **Hỏi chính con AI**: "Cậu có skill nào liên quan đến testing không?"
---
## 🏗️ Xử lý sự cố (Troubleshooting)
### AI của tôi không nhận diện được skill
**Nguyên nhân có thể:**
1. **Sai đường dẫn cài đặt**: Kiểm tra lại tài liệu của tool bạn dùng. Thử đường dẫn `.agent/skills/` xem sao.
2. **Cần khởi động lại**: Thử tắt đi bật lại AI/IDE sau khi cài đặt.
3. **Gõ sai tên**: Bạn có gõ `@brain-storming` thay vì `@brainstorming` không?
### Skill đưa ra lời khuyên sai hoặc lỗi thời
Làm ơn hãy [Báo lỗi (Open Issue)](https://github.com/sickn33/antigravity-awesome-skills/issues) giúp chúng tôi!
Nhớ ghi rõ:
- Skill nào bị lỗi
- Lỗi là gì
- Đáng lẽ nó phải làm gì
---
## 🤝 Đóng góp (Contribution)
### Tôi là người mới (newbie). Tôi đóng góp được không?
**Hoan nghênh nhiệt liệt!** Chúng tôi rất quý trọng các đóng góp từ người mới.
- Sửa lỗi chính tả
- Thêm ví dụ
- Cải thiện tài liệu
Xem hướng dẫn tại [CONTRIBUTING.vi.md](CONTRIBUTING.vi.md) nhé.
### Tôi gửi PR nhưng bị trượt bài kiểm tra "Quality Bar". Tại sao?
Bản V3 có hệ thống kiểm tra chất lượng tự động. Skill của bạn có thể đang thiếu:
1. Phần `description` (mô tả).
2. Các ví dụ sử dụng mẫu.
Hãy chạy `python3 scripts/validate_skills.py` trên máy để tự kiểm tra trước khi đẩy code lên nhé.
### Tôi có được sửa các skill "Official" không?
**Không.** Các skill Official (trong thư mục `skills/official/`) là bản sao (mirror) từ nhà cung cấp gốc. Nếu thấy lỗi, hãy mở Issue báo cáo thay vì sửa trực tiếp.
---
## 💡 Mẹo hay cho chuyên gia (Pro Tips)
- Luôn bắt đầu bằng `@brainstorming` trước khi xây dựng cái gì mới.
- Dùng `@systematic-debugging` khi bí bách vì bug.
- Thử `@test-driven-development` để code "xịn" hơn.
- Khám phá `@skill-creator` để tự tạo skill riêng cho mình.
**Vẫn còn thắc mắc?** [Vào đây thảo luận](https://github.com/sickn33/antigravity-awesome-skills/discussions) nhé, chúng tôi sẽ hỗ trợ hết mình! 🙌

View File

@@ -1,110 +0,0 @@
# Bắt đầu với Antigravity Awesome Skills (V3)
[Đọc bản gốc tiếng Anh](./GETTING_STARTED.md)
**Bạn là người mới? Hướng dẫn này sẽ giúp bạn "nâng cấp" trí tuệ cho AI Agent chỉ trong 5 phút.**
---
## 🤔 "Skill" là gì?
Các trợ lý AI (như **Claude Code**, **Gemini**, **Cursor**) vốn rất thông minh, nhưng chúng thường thiếu kiến thức chuyên sâu về bộ công cụ cụ thể mà bạn đang dùng.
**Skills** chính là những cuốn "cẩm nang hướng dẫn" (file markdown) giúp dạy cho AI biết cách thực hiện từng tác vụ chuyên biệt một cách chuẩn xác nhất.
**Hãy tưởng tượng:** AI của bạn là một thực tập sinh thiên tài. **Skills** chính là các quy trình chuẩn (SOPs) giúp biến cậu thực tập sinh đó thành một Kỹ sư Cao cấp (Senior Engineer) dày dặn kinh nghiệm.
---
## ⚡️ Bắt đầu nhanh: Dùng "Gói Khởi Điểm" (Starter Packs)
Đừng bị choáng ngợp bởi con số 256+ skill. Bạn không cần phải dùng hết tát cả cùng lúc.
Chúng tôi đã soạn sẵn các **Gói Khởi Điểm** để bạn có thể bắt tay vào việc ngay.
### 1. Cài đặt Repo
Clone toàn bộ kho skill này vào thư mục cấu hình của agent:
```bash
# Cách cài đặt chung (áp dụng cho hầu hết các loại agent)
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
### 2. Chọn Gói phù hợp với Vai trò (Persona)
Hãy tìm gói (Bundle) phù hợp nhất với công việc của bạn (xem chi tiết tại [docs/BUNDLES.vi.md](../BUNDLES.vi.md)):
| Vai Trò | Tên Gói | Gồm những gì? |
| :-------------------- | :------------- | :------------------------------------------------ |
| **Web Developer** | `Web Wizard` | React Patterns, bí kíp Tailwind, Thiết kế Frontend|
| **Security Engineer** | `Hacker Pack` | OWASP, Metasploit, Quy trình Pentest |
| **Manager / PM** | `Product Pack` | Brainstorming, Lập kế hoạch, SEO, Chiến lược |
| **Bất kỳ ai** | `Essentials` | Clean Code, Lập kế hoạch, Kiểm tra code (Cơ bản) |
---
## 🚀 Cách sử dụng Skill
Sau khi cài đặt xong, bạn cứ trò chuyện với AI như bình thường.
### Ví dụ 1: Lên kế hoạch tính năng (Gói **Essentials**)
> "Dùng **@brainstorming** giúp tôi lên ý tưởng cho luồng đăng nhập (login flow) mới."
**Kết quả:** AI sẽ kích hoạt skill brainstorming, đặt các câu hỏi định hướng, và cuối cùng soạn ra một bản đặc tả (spec) chuyên nghiệp cho bạn.
### Ví dụ 2: Rà soát Code (Gói **Web Wizard**)
> "Chạy **@lint-and-validate** trên file này và sửa các lỗi giúp tôi."
**Kết quả:** AI sẽ tuân thủ nghiêm ngặt các quy tắc linting đã được định nghĩa trong skill để dọn dẹp và chuẩn hóa code của bạn.
### Ví dụ 3: Kiểm toán Bảo mật (Gói **Hacker Pack**)
> "Dùng **@api-security-best-practices** để review các API endpoint này xem có lỗ hổng nào không."
**Kết quả:** AI sẽ đóng vai chuyên gia bảo mật, rà soát code của bạn dựa trên các tiêu chuẩn an toàn của OWASP.
---
## 🔌 Các công cụ hỗ trợ
| Công cụ | Trạng thái | Đường dẫn cài đặt |
| :-------------- | :-------------- | :---------------- |
| **Claude Code** | ✅ Hỗ trợ tốt | `.claude/skills/` |
| **Gemini CLI** | ✅ Hỗ trợ tốt | `.gemini/skills/` |
| **Antigravity** | ✅ Mặc định | `.agent/skills/` |
| **Cursor** | ✅ Mặc định | `.cursor/skills/` |
| **Copilot** | ⚠️ Chỉ Text | Phải copy-paste thủ công |
---
## 🛡️ Độ Tin Cậy & An Toàn (Mới)
Để bạn yên tâm sử dụng, chúng tôi phân loại skill theo các nhãn sau:
- 🟣 **Official**: Skill chính chủ, được bảo trì bởi Anthropic/Google hoặc các nhà cung cấp uy tín (Độ tin cậy cao).
- 🔵 **Safe**: Skill do cộng đồng đóng góp, an toàn, không gây hại (thường là skill đọc hoặc lập kế hoạch).
- 🔴 **Risk**: Skill có khả năng sửa đổi hệ thống hoặc thực hiện các bài test bảo mật (Chỉ dùng khi bạn hiểu rõ và cho phép).
_Xem [Danh sách đầy đủ](README.vi.md#danh-sách-skill-đầy-đủ-256256) để biết nhãn rủi ro của từng skill._
---
## ❓ Câu hỏi thường gặp (FAQ)
**H: Tôi có bắt buộc phải cài hết 250 skill không?**
Đ: Bạn clone cả repo về, nhưng AI chỉ _đọc_ đúng cái skill mà bạn gọi (hoặc liên quan) thôi. Nên nó rất nhẹ, không lo nặng máy!
**H: Tôi tự viết skill riêng được không?**
Đ: Được chứ! Hãy dùng skill **@skill-creator** để nó hướng dẫn bạn tạo skill mới từ A-Z.
**H: Dùng cái này có mất phí không?**
Đ: Hoàn toàn miễn phí. Giấy phép MIT. Mã nguồn mở mãi mãi.
---
## ⏭️ Bước tiếp theo
1. [Xem chi tiết các Gói (Bundles)](../BUNDLES.vi.md)
2. [Tham khảo các ví dụ thực tế](../EXAMPLES.vi.md)
3. [Đóng góp Skill cho cộng đồng](CONTRIBUTING.vi.md)

View File

@@ -1,479 +0,0 @@
# 🌌 Antigravity Awesome Skills: Kho Tàng 256+ Kỹ Năng Agentic cho Claude Code, Gemini CLI, Cursor & Copilot
[Đọc bản gốc tiếng Anh](../../README.md)
> **Bộ sưu tập "quyền năng" tối thượng gồm hơn 256 kỹ năng giúp bạn làm chủ các Trợ lý Lập trình AI như Claude Code, Gemini CLI, Codex CLI, Antigravity IDE, GitHub Copilot, Cursor và OpenCode**
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Claude Code](https://img.shields.io/badge/Claude%20Code-Anthropic-purple)](https://claude.ai)
[![Gemini CLI](https://img.shields.io/badge/Gemini%20CLI-Google-blue)](https://github.com/google-gemini/gemini-cli)
[![Codex CLI](https://img.shields.io/badge/Codex%20CLI-OpenAI-green)](https://github.com/openai/codex)
[![Cursor](https://img.shields.io/badge/Cursor-AI%20IDE-orange)](https://cursor.sh)
[![Copilot](https://img.shields.io/badge/GitHub%20Copilot-VSCode-lightblue)](https://github.com/features/copilot)
[![OpenCode](https://img.shields.io/badge/OpenCode-CLI-gray)](https://github.com/opencode-ai/opencode)
[![Antigravity](https://img.shields.io/badge/Antigravity-DeepMind-red)](https://github.com/sickn33/antigravity-awesome-skills)
**Antigravity Awesome Skills** không chỉ là một danh sách, mà là một kho vũ khí hạng nặng đã được kiểm chứng thực tế. Nó bao gồm **256 kỹ năng chuyên biệt** giúp AI hoạt động hiệu quả tối đa trên mọi nền tảng trợ lý lập trình phổ biến hiện nay:
- 🟣 **Claude Code** (Anthropic CLI)
- 🔵 **Gemini CLI** (Google DeepMind)
- 🟢 **Codex CLI** (OpenAI)
- 🔴 **Antigravity IDE** (Google DeepMind)
- 🩵 **GitHub Copilot** (VSCode Extension)
- 🟠 **Cursor** (AI-native IDE)
-**OpenCode** (Open-source CLI)
Dự án này cung cấp những kỹ năng then chốt để biến trợ lý AI của bạn từ một công cụ chat đơn thuần thành một **đội ngũ kỹ thuật số toàn năng (full-stack digital agency)**. Chúng tôi tích hợp cả những quy trình chuẩn mực từ các ông lớn như **Anthropic**, **OpenAI**, **Google**, **Supabase**, và **Vercel Labs**.
## Mục Lục - Đi tắt đón đầu
- [🚀 Bạn mới dùng lần đầu? Hãy đọc phần này trước!](#bạn-mới-dùng-lần-đầu-hãy-đọc-phần-này-trước)
- [🔌 Các công cụ hỗ trợ & Cách ra lệnh cho AI](#các-công-cụ-hỗ-trợ--cách-ra-lệnh-cho-ai)
- [📦 Phân loại các nhóm Kỹ năng & Tính năng](#phân-loại-các-nhóm-kỹ-năng--tính-năng)
- [🎁 Các gói Kỹ năng chọn lọc theo nghề (Bundles)](#các-gói-kỹ-năng-chọn-lọc-theo-nghề-bundles)
- [📜 Trọn bộ danh sách 256 Kỹ năng (Full list)](#trọn-bộ-danh-sách-256-kỹ-năng-full-list)
- [🛠️ Hướng dẫn cài đặt nhanh](#hướng-dẫn-cài-đặt-nhanh)
- [🤝 Bạn muốn đóng góp?](#bạn-muốn-đóng-góp)
- [👥 Lời cảm ơn & Nguồn tham khảo](#lời-cảm-ơn--nguồn-tham-khảo)
- [⚖️ Bản quyền (License)](#bản-quyền-license)
- [👥 Những người hùng đã đóng góp](#những-người-hùng-đã-đóng-góp)
- [🌟 Lịch sử phát triển](#lịch-sử-phát-triển)
---
## Bạn mới dùng lần đầu? Hãy đọc phần này trước!
**Chào mừng bạn đến với phiên bản V3 Enterprise.**
Đây không phải là một danh sách chứa mấy đoạn code rời rạc. Hãy coi đây là một **hệ điều hành kiến thức** hoàn chỉnh giúp AI Agent của bạn thông minh hơn gấp bội.
### 1. 🐣 Hiểu đơn giản: Cái này để làm gì?
Các AI Agent (như Claude Code, Cursor, hay Gemini) rất thông minh, nhưng chúng giống như những siêu máy tính chưa được cài phần mềm chuyên dụng. Chúng không thể tự biết "Quy trình Deploy chuẩn của công ty A" hay "Cách viết code AWS CloudFormation không lỗi".
**Skills (Kỹ năng)** ở đây chính là những file hướng dẫn nhỏ (dạng markdown), đóng vai trò như sách giáo khoa, dạy cho AI biết cách thực hiện từng đầu việc cụ thể một cách chuẩn chỉ, trăm lần như một.
### 2. ⚡️ Cách dùng nhanh nhất (Dùng các Gói có sẵn)
Bạn không việc gì phải cài thủ công từng cái trong số 256 skill kia. Chúng tôi đã gom nhóm sẵn thành các **Gói Khởi Điểm (Starter Packs)** phù hợp với từng nhu cầu:
1. **Tải repo này về máy**:
```bash
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
2. **Chọn vai trò của bạn** (Xem chi tiết tại [docs/BUNDLES.md](BUNDLES.md)):
- **Lập trình viên Web?** 👉 chọn gói `Web Wizard`.
- **Chuyên gia Bảo mật/Hacker?** 👉 chọn gói `Security Engineer`.
- **Muốn dùng thử cho biết?** 👉 chọn gói `Essentials` (Cơ bản).
### 3. 🧠 Dùng như thế nào?
Cài xong rồi thì bạn cứ ra lệnh cho con AI như nói chuyện bình thường thôi:
> "Dùng skill **@brainstorming** để giúp tôi lên ý tưởng cho một dự án phần mềm quản lý kho."
> "Chạy **@lint-and-validate** trên file code này xem có lỗi cú pháp nào không."
👉 **[Xem Hướng dẫn chi tiết cho người mới bắt đầu (Tiếng Việt)](GETTING_STARTED.md)**
---
## Các công cụ hỗ trợ & Cách ra lệnh cho AI
Các skill này được viết theo chuẩn **SKILL.md** quốc tế, nên bạn dùng trợ lý ảo nào nó cũng hiểu được, miễn là có hỗ trợ tính năng agentic skills.
| Tên Công cụ | Loại | Ví dụ câu lệnh mẫu | Thư mục cài đặt chuẩn |
| :-------------- | :--- | :-------------------------------- | :-------------------- |
| **Claude Code** | CLI | `>> /skill-name help me...` | `.claude/skills/` |
| **Gemini CLI** | CLI | `(User Prompt) Use skill-name...` | `.gemini/skills/` |
| **Antigravity** | IDE | `(Agent Mode) Use skill...` | `.agent/skills/` |
| **Cursor** | IDE | `@skill-name (gõ trong Chat)` | `.cursor/skills/` |
| **Copilot** | Ext | `(Copy nội dung dán vào chat)` | N/A |
> [!TIP]
> **Lời khuyên**: Tốt nhất bạn nên cài vào thư mục `.agent/skills/`. Hầu hết các công cụ mới bây giờ (như Antigravity) đều tự động tìm trong thư mục này, rất tiện.
> [!WARNING]
> **Lưu ý cho người dùng Windows**: Repo này có dùng **symlinks** (đường dẫn tắt) cho các skill chính chủ.
> Để tránh lỗi, bạn cần bật Developer Mode trên Windows hoặc chạy Git dưới quyền Admin:
> `git clone -c core.symlinks=true https://github.com/...`
---
Dù bạn đang dùng **Gemini CLI**, **Claude Code**, **Codex CLI**, **Cursor**, **GitHub Copilot**, **Antigravity**, hay **OpenCode**, bộ skill này được thiết kế theo tiêu chí "cắm là chạy" (plug-and-play), giúp tăng sức mạnh cho trợ lý AI của bạn tức thì.
Đây là nơi hội tụ tinh hoa từ cộng đồng mã nguồn mở, giúp biến trợ lý AI của bạn thành một "siêu nhân": code giỏi, thiết kế đẹp, lại còn rành bảo mật và biết làm cả marketing.
## Phân loại các nhóm Kỹ năng & Tính năng
Kho tàng này được chia thành các nhóm chuyên môn để bạn dễ tìm kiếm:
| Nhóm Kỹ Năng | Số lượng | Những cái tên nổi bật nên thử ngay |
| :----------------------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------- |
| **🛸 Tự Động Hóa & Agent** | **(13)** | Loki Mode (Chế độ Startup tự động), Code theo kiểu Agent con (Subagent), Điều phối Agent chạy song song, Tự tạo Skill mới |
| **🔌 Kết Nối & APIs** | **(35)** | Stripe, Firebase, Supabase, Vercel, Clerk Auth, Twilio, Discord Bot, Slack Bot, GraphQL, AWS Serverless |
| **🛡️ Bảo Mật & An Ninh** | **(32)** | Ethical Hacking, Metasploit, Burp Suite, SQLMap, Tấn công Active Directory, Kiểm thử AWS/Cloud, Top 100 lỗi OWASP |
| **🎨 Sáng Tạo & Thiết Kế** | **(21)** | UI/UX Pro Max, Thiết kế Frontend, Canvas, Tạo nghệ thuật bằng code, Theme Factory, Vẽ biểu đồ D3 |
| **🛠️ Kỹ Thuật Lập Trình** | **(44)** | TDD (Test trước code sau), Debug có hệ thống, React Patterns, Chuẩn Backend/Frontend, Kiến trúc phần mềm |
| **🏗️ Hạ Tầng & Git** | **(13)** | Shell Scripting, Git Worktrees, Git Pushing, Conventional Commits (Commit chuẩn), Sắp xếp file, Tự động hóa GitHub Workflow |
| **🤖 AI & LLM** | **(27)** | Voice AI Engine, LangGraph, CrewAI, Kỹ sư RAG, Prompt Engineer, Tự động hóa trình duyệt, Hệ thống bộ nhớ cho Agent |
| **🔄 Quy Trình Làm Việc** | **(19)** | Lập kế hoạch, Thực thi kế hoạch, Soát xét code (Code Review), Kiểm tra kỹ lưỡng trước khi bàn giao |
| **📄 Xử Lý Tài Liệu** | **(5)** | Làm việc với file Word (DOCX), PDF, PowerPoint (PPTX), Excel (XLSX) - Bản chính chủ |
| **🧪 Kiểm Thử (Testing)** | **(8)** | Test ứng dụng Web, Tự động hóa với Playwright, Sửa lỗi Test, Các mẫu Testing chuẩn |
| **📈 Sản Phẩm & Chiến Lược** | **(4)** | Bộ công cụ cho Product Manager (PM), Sáng tạo nội dung, Tối ưu App Store (ASO), Brainstorming ý tưởng |
| **📣 Marketing & Tăng Trưởng** | **(26)** | Tối ưu chuyển đổi (CRO), Viết lời quảng cáo (Copywriting), SEO Audit, Chạy Ads, Gửi Email tự động, Chiến lược giá |
| **🚀 Công Cụ cho Maker** | **(8)** | Ra mắt Micro-SaaS, Làm Extension trình duyệt, Tạo Bot Telegram, Xây dựng AI Wrapper, Tạo nội dung Viral |
## Các gói Kỹ năng chọn lọc theo nghề (Bundles)
Hãy ghé thăm trang [docs/BUNDLES.md](BUNDLES.md) để xem các **Gói Khởi Điểm** và chọn cho mình bộ đồ nghề ưng ý nhất thay vì phải tự nhặt từng cái.
## Trọn bộ danh sách 256 Kỹ năng (Full list)
> [!NOTE]
> **Về các Skill xử lý tài liệu**: Với các định dạng như Word, PDF, Excel, PowerPoint, chúng tôi có 2 bản: **bản cộng đồng (community)** và **bản chính chủ (official Anthropic)**. Khi bạn chạy trên máy, hệ thống sẽ ưu tiên dùng bản chính chủ (xịn hơn).
_(Lưu ý: Bảng dưới đây giữ nguyên tên tiếng Anh của Skill để bạn dễ tra cứu trong code, còn phần mô tả đã được dịch sang tiếng Việt)_
| Tên Skill (Tên lệnh) | Rủi ro | Mô tả công dụng | Đường dẫn file |
| :-------------------------------------------------- | :----- | :---------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------- |
| **2d-games** | ⚪ | Nguyên tắc phát triển game 2D. Sprites, tilemaps, vật lý, camera. | `skills/game-development/2d-games` |
| **3d-games** | ⚪ | Nguyên tắc phát triển game 3D. Rendering, shaders, vật lý, camera. | `skills/game-development/3d-games` |
| **3d-web-experience** | ⚪ | Chuyên gia xây dựng trải nghiệm 3D cho web - Three.js, React Three Fiber, Spline, WebGL. Bao gồm cấu hình sản phẩm, portfolio 3D, website nhập vai. | `skills/3d-web-experience` |
| **ab-test-setup** | ⚪ | Hướng dẫn cấu trúc thiết lập A/B test với các cổng kiểm soát bắt buộc cho giả thuyết, chỉ số và sự sẵn sàng thực thi. | `skills/ab-test-setup` |
| **Active Directory Attacks** | ⚪ | Dùng khi user yêu cầu "tấn công Active Directory", "khai thác AD", "Kerberoasting", "DCSync", "pass-the-hash", "BloodHound", "Golden Ticket"... | `skills/active-directory-attacks` |
| **address-github-comments** | ⚪ | Dùng khi bạn cần giải quyết các comment review hoặc issue trên GitHub Pull Request đang mở bằng gh CLI. | `skills/address-github-comments` |
| **agent-evaluation** | ⚪ | Kiểm thử và đánh giá chuẩn (benchmark) các LLM agent, bao gồm kiểm tra hành vi, đánh giá năng lực, chỉ số độ tin cậy và giám sát production. | `skills/agent-evaluation` |
| **agent-manager-skill** | ⚪ | Quản lý nhiều CLI agent cục bộ thông qua tmux sessions (start/stop/monitor/assign) với lịch trình cron-friendly. | `skills/agent-manager-skill` |
| **agent-memory-mcp** | ⚪ | Hệ thống bộ nhớ lai cung cấp quản lý tri thức bền vững, có thể tìm kiếm cho AI agents (Kiến trúc, Mẫu, Quyết định). | `skills/agent-memory-mcp` |
| **agent-memory-systems** | ⚪ | Skill bao trùm kiến trúc bộ nhớ agent: ngắn hạn (context window), dài hạn (vector stores), và các kiến trúc nhận thức để tổ chức chúng. | `skills/agent-memory-systems` |
| **agent-tool-builder** | ⚪ | Thiết kế công cụ từ schema đến xử lý lỗi. JSON Schema best practices, viết mô tả giúp LLM hiểu, validation, và chuẩn MCP mới nổi. | `skills/agent-tool-builder` |
| **ai-agents-architect** | ⚪ | Chuyên gia thiết kế và xây dựng các AI agent tự chủ. Làm chủ việc sử dụng công cụ, hệ thống bộ nhớ, chiến lược lập kế hoạch và điều phối đa tác nhân. | `skills/ai-agents-architect` |
| **ai-product** | ⚪ | Các mẫu tích hợp LLM, kiến trúc RAG, prompt engineering mở rộng, AI UX mà người dùng tin tưởng, và tối ưu hóa chi phí. | `skills/ai-product` |
| **ai-wrapper-product** | ⚪ | Chuyên gia xây dựng các sản phẩm bao bọc (wrap) AI APIs (OpenAI, Anthropic...) thành các công cụ tập trung giải quyết vấn đề cụ thể. | `skills/ai-wrapper-product` |
| **algolia-search** | ⚪ | Các mẫu chuyên gia để triển khai tìm kiếm Algolia, chiến lược đánh chỉ mục (indexing), React InstantSearch và tinh chỉnh độ liên quan. | `skills/algolia-search` |
| **algorithmic-art** | ⚪ | Tạo nghệ thuật thuật toán sử dụng p5.js với tính ngẫu nhiên có hạt giống (seeded randomness) và tham số tương tác. | `skills/algorithmic-art` |
| **analytics-tracking** | ⚪ | Thiết kế, kiểm toán và cải thiện hệ thống theo dõi phân tích (GA4, GTM, product analytics, events, conversions, UTMs). | `skills/analytics-tracking` |
| **API Fuzzing for Bug Bounty** | ⚪ | Dùng khi user yêu cầu "test bảo mật API", "fuzz APIs", "tìm lỗi IDOR", "test REST/GraphQL API", "kiểm thử xâm nhập API". | `skills/api-fuzzing-bug-bounty` |
| **api-documentation-generator** | ⚪ | Tạo tài liệu API toàn diện, thân thiện với lập trình viên từ code, bao gồm endpoints, tham số, ví dụ. | `skills/api-documentation-generator` |
| **api-patterns** | ⚪ | Nguyên tắc thiết kế API và ra quyết định. Chọn REST vs GraphQL vs tRPC, định dạng phản hồi, versioning, phân trang. | `skills/api-patterns` |
| **api-security-best-practices** | ⚪ | Triển khai các mẫu thiết kế API bảo mật bao gồm xác thực, phân quyền, validate đầu vào, rate limiting. | `skills/api-security-best-practices` |
| **app-builder** | ⚪ | Bộ điều phối xây dựng ứng dụng chính. Tạo ứng dụng full-stack từ yêu cầu ngôn ngữ tự nhiên. Xác định loại dự án, chọn tech stack. | `skills/app-builder` |
| **app-store-optimization** | ⚪ | Bộ công cụ ASO hoàn chỉnh để nghiên cứu, tối ưu hóa và theo dõi hiệu suất ứng dụng trên Apple App Store và Google Play Store. | `skills/app-store-optimization` |
| **architecture** | ⚪ | Khung ra quyết định kiến trúc. Phân tích yêu cầu, đánh giá đánh đổi (trade-off), tài liệu hóa ADR. | `skills/architecture` |
| **autonomous-agent-patterns** | ⚪ | Các mẫu thiết kế để xây dựng coding agent tự chủ. Tích hợp công cụ, hệ thống quyền, tự động hóa trình duyệt, quy trình human-in-the-loop. | `skills/autonomous-agent-patterns` |
| **autonomous-agents** | ⚪ | Skill bao trùm các vòng lặp agent (ReAct, Plan-Execute), phân rã mục tiêu, mẫu phản tư (reflection), và độ tin cậy trong production. | `skills/autonomous-agents` |
| **avalonia-layout-zafiro** | ⚪ | Hướng dẫn layout Avalonia UI hiện đại sử dụng Zafiro.Avalonia, nhấn mạnh style chia sẻ, component generic. | `skills/avalonia-layout-zafiro` |
| **avalonia-viewmodels-zafiro** | ⚪ | Các mẫu tạo ViewModel và Wizard tối ưu cho Avalonia sử dụng Zafiro và ReactiveUI. | `skills/avalonia-viewmodels-zafiro` |
| **avalonia-zafiro-development** | ⚪ | Các quy tắc bắt buộc, quy ước và hành vi để phát triển Avalonia UI sử dụng bộ công cụ Zafiro. | `skills/avalonia-zafiro-development` |
| **AWS Penetration Testing** | ⚪ | Dùng khi user yêu cầu "pentest AWS", "test bảo mật AWS", "khai thác IAM", "leo thang đặc quyền AWS", "test S3 bucket", "SSRF metadata"... | `skills/aws-penetration-testing` |
| **aws-serverless** | ⚪ | Kỹ năng chuyên sâu xây dựng ứng dụng serverless ready-for-production trên AWS (Lambda, API Gateway, DynamoDB, SQS/SNS, SAM/CDK). | `skills/aws-serverless` |
| **azure-functions** | ⚪ | Các mẫu chuyên gia phát triển Azure Functions bao gồm isolated worker model, Durable Functions, tối ưu cold start. | `skills/azure-functions` |
| **backend-dev-guidelines** | ⚪ | Tiêu chuẩn phát triển backend (có quan điểm riêng) cho Node.js + Express + TypeScript microservices. | `skills/backend-dev-guidelines` |
| **backend-patterns** | ⚪ | Các mẫu kiến trúc backend, thiết kế API, tối ưu database, và best practices phía server cho Node.js, Express, Next.js API routes. | `skills/cc-skill-backend-patterns` |
| **bash-linux** | ⚪ | Các mẫu Bash/Linux terminal. Các lệnh quan trọng, piping, xử lý lỗi, scripting. | `skills/bash-linux` |
| **behavioral-modes** | ⚪ | Các chế độ vận hành AI (brainstorm, implement, debug, review, teach, ship, orchestrate). | `skills/behavioral-modes` |
| **blockrun** | ⚪ | Dùng khi user cần các khả năng mà Claude thiếu (tạo ảnh, dữ liệu X/Twitter thời gian thực) hoặc yêu cầu dùng model ngoài ("use gpt", "dall-e"). | `skills/blockrun` |
| **brainstorming** | ⚪ | Dùng skill này trước bất kỳ công việc sáng tạo hay xây dựng nào. Biến ý tưởng mơ hồ thành thiết kế đã được kiểm chứng. | `skills/brainstorming` |
| **brand-guidelines** | ⚪ | Áp dụng màu sắc và font chữ thương hiệu chính thức của Anthropic (Bản Official). | `skills/brand-guidelines-anthropic` |
| **brand-guidelines** | ⚪ | Áp dụng màu sắc và font chữ thương hiệu chính thức của Anthropic (Bản Community). | `skills/brand-guidelines-community` |
| **Broken Authentication Testing** | ⚪ | Hướng dẫn kiểm tra lỗi xác thực, quản lý phiên, credential stuffing, chính sách mật khẩu, session fixation. | `skills/broken-authentication` |
| **browser-automation** | ⚪ | Tự động hóa trình duyệt với Playwright (khuyên dùng) và Puppeteer. Các mẫu để test, scrape, và điều khiển agent. | `skills/browser-automation` |
| **browser-extension-builder** | ⚪ | Chuyên gia xây dựng extension trình duyệt (Chrome, Firefox, cross-browser). Manifest v3, content scripts, popup UI. | `skills/browser-extension-builder` |
| **bullmq-specialist** | ⚪ | Chuyên gia BullMQ cho hàng đợi job Redis, xử lý nền (background processing) tin cậy trong Node.js/TypeScript. | `skills/bullmq-specialist` |
| **bun-development** | ⚪ | Phát triển JavaScript/TypeScript hiện đại với Bun runtime. Quản lý gói, bundling, testing, và di chuyển từ Node.js. | `skills/bun-development` |
| **Burp Suite Web Application Testing** | ⚪ | Hướng dẫn sử dụng Burp Suite: intercept traffic, modify requests, scan vulnerabilities, dùng Repeater. | `skills/burp-suite-testing` |
| **busybox-on-windows** | ⚪ | Cách sử dụng bản build Win32 của BusyBox để chạy các công cụ dòng lệnh UNIX tiêu chuẩn trên Windows. | `skills/busybox-on-windows` |
| **canvas-design** | ⚪ | Tạo nghệ thuật thị giác đẹp mắt trong tài liệu .png và .pdf sử dụng triết lý thiết kế. | `skills/canvas-design` |
| **cc-skill-continuous-learning** | ⚪ | Kỹ năng phát triển từ everything-claude-code | `skills/cc-skill-continuous-learning` |
| **cc-skill-project-guidelines-example** | ⚪ | Skill Hướng Dẫn Dự Án (Ví dụ minh họa) | `skills/cc-skill-project-guidelines-example` |
| **cc-skill-strategic-compact** | ⚪ | Kỹ năng phát triển từ everything-claude-code | `skills/cc-skill-strategic-compact` |
| **Claude Code Guide** | ⚪ | Hướng dẫn tổng thể để sử dụng Claude Code hiệu quả. Cấu hình, chiến lược prompt, từ khóa "Thinking", debug. | `skills/claude-code-guide` |
| **clean-code** | ⚪ | Tiêu chuẩn code thực dụng - súc tích, trực tiếp, không over-engineering, không comment thừa thãi. | `skills/clean-code` |
| **clerk-auth** | ⚪ | Các mẫu chuyên gia cho tích hợp Clerk auth, middleware, organizations, webhooks, và đồng bộ user. | `skills/clerk-auth` |
| **clickhouse-io** | ⚪ | Các mẫu database ClickHouse, tối ưu query, analytics, và best practices kỹ thuật dữ liệu. | `skills/cc-skill-clickhouse-io` |
| **Cloud Penetration Testing** | ⚪ | Hướng dẫn pentest AWS, Azure, GCP. Enumeration tài nguyên, khai thác cấu hình sai, lấy secrets, audit hạ tầng. | `skills/cloud-penetration-testing` |
| **code-review-checklist** | ⚪ | Danh sách kiểm tra toàn diện để thực hiện code review kỹ lưỡng (chức năng, bảo mật, hiệu năng, bảo trì). | `skills/code-review-checklist` |
| **codex-review** | ⚪ | Code review chuyên nghiệp với tạo CHANGELOG tự động, tích hợp với Codex AI. | `skills/codex-review` |
| **coding-standards** | ⚪ | Tiêu chuẩn code phổ quát, best practices và pattern cho TypeScript, JavaScript, React, và Node.js. | `skills/cc-skill-coding-standards` |
| **competitor-alternatives** | ⚪ | Tạo các trang so sánh đối thủ hoặc trang thay thế (alternative pages) cho SEO và hỗ trợ bán hàng. | `skills/competitor-alternatives` |
| **computer-use-agents** | ⚪ | Xây dựng AI agent tương tác máy tính như con người (nhìn màn hình, di chuột, click, gõ phím). | `skills/computer-use-agents` |
| **concise-planning** | ⚪ | Dùng khi user yêu cầu một kế hoạch cho tác vụ code, tạo ra checklist rõ ràng, khả thi và nguyên tử (atomic). | `skills/concise-planning` |
| **content-creator** | ⚪ | Tạo nội dung marketing tối ưu SEO với giọng văn thương hiệu nhất quán. Bao gồm phân tích giọng văn, tối ưu SEO. | `skills/content-creator` |
| **context-window-management** | ⚪ | Các chiến lược quản lý cửa sổ ngữ cảnh LLM bao gồm tóm tắt, cắt tỉa (trimming), định tuyến (routing). | `skills/context-window-management` |
| **context7-auto-research** | ⚪ | Tự động lấy tài liệu thư viện/framework mới nhất cho Claude Code thông qua Context7 API. | `skills/context7-auto-research` |
| **conversation-memory** | ⚪ | Hệ thống bộ nhớ bền vững cho hội thoại LLM bao gồm ngắn hạn, dài hạn và bộ nhớ dựa trên thực thể. | `skills/conversation-memory` |
| **copy-editing** | ⚪ | Dùng khi user muốn chỉnh sửa, review hoặc cải thiện nội dung marketing hiện có. Cách tiếp cận hệ thống qua nhiều lượt quét. | `skills/copy-editing` |
| **copywriting** | ⚪ | Dùng khi viết, viết lại hoặc cải thiện nội dung marketing cho bất kỳ trang nào (landing page, pricing, about...). | `skills/copywriting` |
| **core-components** | ⚪ | Thư viện component cốt lõi và các mẫu hệ thống thiết kế (design system). | `skills/core-components` |
| **crewai** | ⚪ | Chuyên gia CrewAI - framework đa tác nhân (multi-agent) dựa trên vai trò. Thiết kế agent, task, orchestrate crew. | `skills/crewai` |
| **Cross-Site Scripting and HTML Injection Testing** | ⚪ | Hướng dẫn test lỗi XSS, HTML injection, khai thác injection phía client, đánh cắp cookie. | `skills/xss-html-injection` |
| **d3-viz** | ⚪ | Tạo trực quan hóa dữ liệu tương tác bằng d3.js. Biểu đồ tùy chỉnh, đồ thị mạng, bản đồ địa lý. | `skills/claude-d3js-skill` |
| **daily-news-report** | ⚪ | Dựa trên danh sách URL, cào nội dung, lọc tin kỹ thuật chất lượng cao và tạo báo cáo Markdown hàng ngày. | `skills/daily-news-report` |
| **database-design** | ⚪ | Nguyên tắc thiết kế cơ sở dữ liệu. Thiết kế schema, chiến lược index, chọn ORM, serverless databases. | `skills/database-design` |
| **deployment-procedures** | ⚪ | Nguyên tắc triển khai production. Quy trình deploy an toàn, chiến lược rollback, xác thực. | `skills/deployment-procedures` |
| **design-orchestration** | ⚪ | Điều phối quy trình thiết kế thông qua brainstorming, review đa tác nhân, và sẵn sàng thực thi theo đúng thứ tự. | `skills/design-orchestration` |
| **discord-bot-architect** | ⚪ | Kỹ năng chuyên sâu xây dựng Discord bot production-ready. Discord.js, Pycord, slash commands, sharding. | `skills/discord-bot-architect` |
| **dispatching-parallel-agents** | ⚪ | Dùng khi đối mặt với 2+ nhiệm vụ độc lập có thể thực hiện mà không chia sẻ trạng thái hoặc phụ thuộc tuần tự. | `skills/dispatching-parallel-agents` |
| **doc-coauthoring** | ⚪ | Hướng dẫn quy trình đồng tác giả tài liệu (proposal, technical spec, decision docs). | `skills/doc-coauthoring` |
| **docker-expert** | ⚪ | Chuyên gia Docker containerization. Multi-stage builds, tối ưu image, bảo mật container, Docker Compose orchestration. | `skills/docker-expert` |
| **documentation-templates** | ⚪ | Các mẫu tài liệu và hướng dẫn cấu trúc. README, API docs, comment code, tài liệu thân thiện với AI. | `skills/documentation-templates` |
| **docx** | ⚪ | Xử lý tài liệu .docx toàn diện: Tạo mới, chỉnh sửa, theo dõi thay đổi (tracked changes), comment. (Bản Official) | `skills/docx-official` |
| **email-sequence** | ⚪ | Tạo hoặc tối ưu chuỗi email (drip campaign), luồng email tự động, email vòng đời (lifecycle). | `skills/email-sequence` |
| **email-systems** | ⚪ | Kiến thức về hệ thống email: transactional email, marketing automation, deliverability, và các quyết định hạ tầng. | `skills/email-systems` |
| **environment-setup-guide** | ⚪ | Hướng dẫn thiết lập môi trường phát triển với các công cụ, dependencies và cấu hình phù hợp. | `skills/environment-setup-guide` |
| **Ethical Hacking Methodology** | ⚪ | Phương pháp và kỹ thuật one hacker đạo đức toàn diện: trinh sát, quét, khai thác, viết báo cáo. | `skills/ethical-hacking-methodology` |
| **exa-search** | ⚪ | Tìm kiếm ngữ nghĩa, khám phá nội dung tương tự và nghiên cứu có cấu trúc sử dụng Exa API. | `skills/exa-search` |
| **executing-plans** | ⚪ | Dùng khi bạn đã có một kế hoạch triển khai (implementation plan) để thực thi trong một phiên làm việc riêng. | `skills/executing-plans` |
| **File Path Traversal Testing** | ⚪ | Hướng dẫn test lỗi Directory Traversal, LFI, đọc file tùy ý trên server. | `skills/file-path-traversal` |
| **file-organizer** | ⚪ | Tổ chức file và folder thông minh dựa trên ngữ cảnh, tìm file trùng lặp, đề xuất cấu trúc tốt hơn. | `skills/file-organizer` |
| **file-uploads** | ⚪ | Chuyên gia xử lý upload file và lưu trữ đám mây (S3, R2, presigned URLs, multipart uploads). | `skills/file-uploads` |
| **finishing-a-development-branch** | ⚪ | Dùng khi hoàn thành cài đặt, tất cả test đã pass, và cần quyết định cách tích hợp (merge, PR, cleanup). | `skills/finishing-a-development-branch` |
| **firebase** | ⚪ | Chuyên gia Firebase: Authentication, Firestore, Realtime Database, Cloud Functions, Storage, Hosting. | `skills/firebase` |
| **firecrawl-scraper** | ⚪ | Deep web scraping, chụp ảnh màn hình, phân tích PDF, và cào website sử dụng Firecrawl API. | `skills/firecrawl-scraper` |
| **form-cro** | ⚪ | Tối ưu hóa bất kỳ form nào KHÔNG phải là đăng ký tài khoản (lead capture, contact, checkout...). | `skills/form-cro` |
| **free-tool-strategy** | ⚪ | Lên kế hoạch, đánh giá hoặc xây dựng công cụ miễn phí cho mục đích marketing (engineering as marketing). | `skills/free-tool-strategy` |
| **frontend-design** | ⚪ | Tạo giao diện frontend đặc sắc, chất lượng cao, thẩm mỹ có chủ đích (không chung chung). | `skills/frontend-design` |
| **frontend-dev-guidelines** | ⚪ | Tiêu chuẩn phát triển frontend (có quan điểm riêng) cho ứng dụng React + TypeScript hiện đại. | `skills/frontend-dev-guidelines` |
| **frontend-patterns** | ⚪ | Các pattern frontend cho React, Next.js, quản lý state, tối ưu hiệu năng. | `skills/cc-skill-frontend-patterns` |
| **game-art** | ⚪ | Nguyên tắc nghệ thuật game. Chọn phong cách hình ảnh, pipeline tài sản, quy trình hoạt hình. | `skills/game-development/game-art` |
| **game-audio** | ⚪ | Nguyên tắc âm thanh game. Thiết kế âm thanh, tích hợp nhạc, hệ thống âm thanh thích ứng. | `skills/game-development/game-audio` |
| **game-design** | ⚪ | Nguyên tắc thiết kế game. Cấu trúc GDD, cân bằng game, tâm lý người chơi. | `skills/game-development/game-design` |
| **game-development** | ⚪ | Bộ điều phối phát triển game. Định tuyến đến các skill cụ thể theo nền tảng dựa trên nhu cầu dự án. | `skills/game-development` |
| **gcp-cloud-run** | ⚪ | Kỹ năng chuyên sâu xây dựng ứng dụng serverless trên GCP (Cloud Run, Cloud Run Functions, Pub/Sub). | `skills/gcp-cloud-run` |
| **geo-fundamentals** | ⚪ | Generative Engine Optimization (GEO) cho các công cụ tìm kiếm AI (ChatGPT, Claude, Perplexity). | `skills/geo-fundamentals` |
| **git-pushing** | ⚪ | Stage, commit, và push thay đổi git với commit message chuẩn "conventional commit". | `skills/git-pushing` |
| **github-workflow-automation** | ⚪ | Tự động hóa quy trình GitHub với sự hỗ trợ của AI (PR reviews, issue triage, CI/CD, Git operations). | `skills/github-workflow-automation` |
| **graphql** | ⚪ | Thiết kế schema GraphQL, resolvers, DataLoader ngăn chặn N+1, federation cho microservices. | `skills/graphql` |
| **HTML Injection Testing** | ⚪ | Hướng dẫn test lỗi HTML injection, deface ứng dụng web, content injection. | `skills/html-injection-testing` |
| **hubspot-integration** | ⚪ | Các mẫu tích hợp HubSpot CRM bao gồm OAuth, CRM objects, webhooks, custom objects. | `skills/hubspot-integration` |
| **i18n-localization** | ⚪ | Các mẫu Quốc tế hóa (i18n) và Bản địa hóa (localization). Phát hiện chuỗi hardcoded, quản lý dịch. | `skills/i18n-localization` |
| **IDOR Vulnerability Testing** | ⚪ | Hướng dẫn test lỗi IDOR (Insecure Direct Object References), broken access control. | `skills/idor-testing` |
| **inngest** | ⚪ | Chuyên gia Inngest cho background jobs serverless-first, luồng công việc theo sự kiện (event-driven). | `skills/inngest` |
| **interactive-portfolio** | ⚪ | Chuyên gia xây dựng portfolio giúp trúng tuyển công việc và khách hàng - không chỉ show tác phẩm mà tạo trải nghiệm. | `skills/interactive-portfolio` |
| **internal-comms** | ⚪ | Tài nguyên viết truyền thông nội bộ (official Anthropic context). | `skills/internal-comms-anthropic` |
| **internal-comms** | ⚪ | Tài nguyên viết truyền thông nội bộ (community context). | `skills/internal-comms-community` |
| **javascript-mastery** | ⚪ | Tài liệu tham khảo JavaScript toàn diện bao gồm 33+ khái niệm cốt lõi mọi developer cần biết. | `skills/javascript-mastery` |
| **kaizen** | ⚪ | Hướng dẫn cải tiến liên tục, phòng chống lỗi (error proofing) và tiêu chuẩn hóa. | `skills/kaizen` |
| **langfuse** | ⚪ | Chuyên gia Langfuse - nền tảng LLM observability. Tracing, quản lý prompt, đánh giá (evaluation). | `skills/langfuse` |
| **langgraph** | ⚪ | Chuyên gia LangGraph - framework xây dựng ứng dụng AI đa tác nhân có trạng thái (stateful). | `skills/langgraph` |
| **last30days** | ⚪ | Nghiên cứu một chủ đề trong 30 ngày qua trên Reddit + X + Web, trở thành chuyên gia và viết prompt. | `skills/last30days` |
| **launch-strategy** | ⚪ | Lên kế hoạch ra mắt sản phẩm, công bố tính năng, chiến lược go-to-market. | `skills/launch-strategy` |
| **lint-and-validate** | ⚪ | Quy trình kiểm soát chất lượng tự động, linting và phân tích tĩnh (static analysis). | `skills/lint-and-validate` |
| **Linux Privilege Escalation** | ⚪ | Hướng dẫn leo thang đặc quyền trên Linux: sudo, SUID, cron jobs, kernel exploits. | `skills/linux-privilege-escalation` |
| **Linux Production Shell Scripts** | ⚪ | Các mẫu shell script production-ready cho quản trị hệ thống Linux. | `skills/linux-shell-scripting` |
| **llm-app-patterns** | ⚪ | Các mẫu production-ready để xây dựng ứng dụng LLM (RAG pipelines, agent architectures, LLMOps). | `skills/llm-app-patterns` |
| **loki-mode** | ⚪ | Hệ thống startup tự động đa tác nhân cho Claude Code. Điều phối 100+ agent chuyên biệt. (Yêu cầu cờ --dangerously-skip-permissions). | `skills/loki-mode` |
| **marketing-ideas** | ⚪ | Cung cấp chiến lược marketing đã được kiểm chứng và ý tưởng tăng trưởng cho SaaS/software. | `skills/marketing-ideas` |
| **marketing-psychology** | ⚪ | Áp dụng khoa học hành vi và mô hình tư duy vào các quyết định marketing. | `skills/marketing-psychology` |
| **mcp-builder** | ⚪ | Hướng dẫn tạo MCP (Model Context Protocol) servers chất lượng cao (Python/Node). | `skills/mcp-builder` |
| **Metasploit Framework** | ⚪ | Hướng dẫn sử dụng Metasploit: msfconsole, msfvenom, post-exploitation, auxiliary modules. | `skills/metasploit-framework` |
| **micro-saas-launcher** | ⚪ | Chuyên gia ra mắt sản phẩm SaaS nhỏ (micro-SaaS) nhanh chóng - tiếp cận kiểu indie hacker. | `skills/micro-saas-launcher` |
| **mobile-design** | ⚪ | Học thuyết thiết kế và kỹ thuật mobile-first cho iOS và Android (React Native, Flutter, Native). | `skills/mobile-design` |
| **mobile-games** | ⚪ | Nguyên tắc phát triển game mobile. Cảm ứng, pin, hiệu năng, app stores. | `skills/game-development/mobile-games` |
| **moodle-external-api-development** | ⚪ | Tạo web service APIs tùy chỉnh bên ngoài cho Moodle LMS. | `skills/moodle-external-api-development` |
| **multi-agent-brainstorming** | ⚪ | Điều phối quy trình đánh giá thiết kế đa tác nhân tuần tự, có cấu trúc để giảm rủi ro. | `skills/multi-agent-brainstorming` |
| **multiplayer** | ⚪ | Nguyên tắc phát triển game multiplayer. Kiến trúc, mạng, đồng bộ hóa. | `skills/game-development/multiplayer` |
| **neon-postgres** | ⚪ | Các mẫu chuyên gia cho Neon serverless Postgres, branching, connection pooling. | `skills/neon-postgres` |
| **nestjs-expert** | ⚪ | Chuyên gia framework Nest.js: module architecture, dependency injection, guards, interceptors. | `skills/nestjs-expert` |
| **Network 101** | ⚪ | Hướng dẫn cơ bản về mạng: thiết lập web server, HTTP/HTTPS, SNMP, SMB, test services. | `skills/network-101` |
| **nextjs-best-practices** | ⚪ | Nguyên tắc Next.js App Router. Server Components, data fetching, routing patterns. | `skills/nextjs-best-practices` |
| **nextjs-supabase-auth** | ⚪ | Tích hợp chuyên gia Supabase Auth với Next.js App Router. | `skills/nextjs-supabase-auth` |
| **nodejs-best-practices** | ⚪ | Nguyên tắc phát triển Node.js. Chọn framework, async patterns, bảo mật. | `skills/nodejs-best-practices` |
| **nosql-expert** | ⚪ | Hướng dẫn chuyên môn cho databases NoSQL phân tán (Cassandra, DynamoDB). | `skills/nosql-expert` |
| **notebooklm** | ⚪ | Truy vấn Google NotebookLM notebooks trực tiếp từ Claude Code để có câu trả lời có trích dẫn. | `skills/notebooklm` |
| **notion-template-business** | ⚪ | Chuyên gia xây dựng và bán Notion templates như một mô hình kinh doanh. | `skills/notion-template-business` |
| **obsidian-clipper-template-creator** | ⚪ | Hướng dẫn tạo template cho Obsidian Web Clipper. | `skills/obsidian-clipper-template-creator` |
| **onboarding-cro** | ⚪ | Tối ưu hóa onboarding sau đăng ký, kích hoạt người dùng (user activation), time-to-value. | `skills/onboarding-cro` |
| **page-cro** | ⚪ | Phân tích và tối ưu hóa các trang đơn lẻ (homepage, landing page) để tăng tỷ lệ chuyển đổi. | `skills/page-cro` |
| **paid-ads** | ⚪ | Hỗ trợ chiến dịch quảng cáo trả phí trên Google Ads, Meta, LinkedIn, Twitter/X. | `skills/paid-ads` |
| **parallel-agents** | ⚪ | Các mẫu điều phối đa tác nhân song song (parallel orchestration). | `skills/parallel-agents` |
| **paywall-upgrade-cro** | ⚪ | Tạo hoặc tối ưu in-app paywalls, màn hình nâng cấp, upsell modals. | `skills/paywall-upgrade-cro` |
| **pc-games** | ⚪ | Nguyên tắc phát triển game PC/Console. Chọn engine, tối ưu hóa. | `skills/game-development/pc-games` |
| **pdf** | ⚪ | Bộ công cụ xử lý PDF toàn diện: trích xuất text/table, merge/split, xử lý form. (Bản Official) | `skills/pdf-official` |
| **Pentest Checklist** | ⚪ | Danh sách kiểm tra và lên kế hoạch cho một cuộc kiểm thử xâm nhập (pentest). | `skills/pentest-checklist` |
| **Pentest Commands** | ⚪ | Các lệnh pentest thiết yếu: nmap, metasploit, hydra, john, nikto... | `skills/pentest-commands` |
| **performance-profiling** | ⚪ | Nguyên tắc hồ sơ hiệu năng (profiling). Đo lường, phân tích và tối ưu hóa. | `skills/performance-profiling` |
| **personal-tool-builder** | ⚪ | Chuyên gia xây dựng các công cụ tùy chỉnh (custom tools) để giải quyết vấn đề cá nhân (scratch your own itch). | `skills/personal-tool-builder` |
| **plaid-fintech** | ⚪ | Các mẫu tích hợp Plaid API: Link token, transactions sync, identity verification, ACH auth. | `skills/plaid-fintech` |
| **plan-writing** | ⚪ | Lập kế hoạch tác vụ có cấu trúc với các phân rã rõ ràng, phụ thuộc và tiêu chí xác minh. | `skills/plan-writing` |
| **planning-with-files** | ⚪ | Triển khai lập kế hoạch dựa trên file kiểu Manus (task_plan.md, findings.md...) cho các tác vụ phức tạp. | `skills/planning-with-files` |
| **playwright-skill** | ⚪ | Tự động hóa trình duyệt hoàn chỉnh với Playwright. Test web, fill forms, screenshots. | `skills/playwright-skill` |
| **popup-cro** | ⚪ | Tạo và tối ưu popups, modals, overlays để tăng chuyển đổi mà không gây khó chịu. | `skills/popup-cro` |
| **powershell-windows** | ⚪ | Các mẫu PowerShell Windows. Cạm bẫy quan trọng, cú pháp operator, xử lý lỗi. | `skills/powershell-windows` |
| **pptx** | ⚪ | Tạo, chỉnh sửa và phân tích bài thuyết trình PowerPoint (.pptx). (Bản Official) | `skills/pptx-official` |
| **pricing-strategy** | ⚪ | Thiết kế chiến lược giá, đóng gói và kiếm tiền dựa trên giá trị và mục tiêu tăng trưởng. | `skills/pricing-strategy` |
| **prisma-expert** | ⚪ | Chuyên gia Prisma ORM: thiết kế schema, migrations, tối ưu query. | `skills/prisma-expert` |
| **Privilege Escalation Methods** | ⚪ | Các phương pháp leo thang đặc quyền chung: post-exploitation cho Linux/Windows. | `skills/privilege-escalation-methods` |
| **product-manager-toolkit** | ⚪ | Bộ công cụ toàn diện cho Product Manager (RICE, phỏng vấn khách hàng, PRD, GTM). | `skills/product-manager-toolkit` |
| **production-code-audit** | ⚪ | Tự động quét sâu codebase, hiểu kiến trúc và chuyển đổi sang chất lượng production-grade. | `skills/production-code-audit` |
| **programmatic-seo** | ⚪ | Thiết kế và đánh giá chiến lược SEO lập trình (programmatic SEO) để tạo trang quy mô lớn. | `skills/programmatic-seo` |
| **prompt-caching** | ⚪ | Các chiến lược caching cho LLM prompts (Anthropic prompt caching, CAG). | `skills/prompt-caching` |
| **prompt-engineer** | ⚪ | Chuyên gia thiết kế prompt hiệu quả cho ứng dụng LLM. Few-shot, Chain of Thought... | `skills/prompt-engineer` |
| **prompt-engineering** | ⚪ | Hướng dẫn chuyên gia về các mẫu prompt engineering, best practices và kỹ thuật tối ưu hóa. | `skills/prompt-engineering` |
| **prompt-library** | ⚪ | Bộ sưu tập các prompt chất lượng cao được tuyển chọn cho nhiều trường hợp sử dụng. | `skills/prompt-library` |
| **python-patterns** | ⚪ | Nguyên tắc phát triển Python. Chọn framework, async patterns, type hints. | `skills/python-patterns` |
| **rag-engineer** | ⚪ | Chuyên gia xây dựng hệ thống RAG (Retrieval-Augmented Generation). | `skills/rag-engineer` |
| **rag-implementation** | ⚪ | Các mẫu triển khai RAG bao gồm chunking, embeddings, vector stores. | `skills/rag-implementation` |
| **react-patterns** | ⚪ | Các mẫu React hiện đại. Hooks, composition, hiệu năng, TypeScript best practices. | `skills/react-patterns` |
| **react-ui-patterns** | ⚪ | Các mẫu React UI hiện đại cho loading states, error handling, và data fetching. | `skills/react-ui-patterns` |
| **receiving-code-review** | ⚪ | Dùng khi nhận phản hồi code review, trước khi thực hiện để xác minh kỹ thuật. | `skills/receiving-code-review` |
| **Red Team Tools and Methodology** | ⚪ | Phương pháp và công cụ Red Team: bug bounty hunting, trinh sát tự động, XSS hunting... | `skills/red-team-tools` |
| **red-team-tactics** | ⚪ | Nguyên tắc chiến thuật Red Team dựa trên MITRE ATT&CK. | `skills/red-team-tactics` |
| **referral-program** | ⚪ | Tạo, tối ưu và phân tích chương trình giới thiệu, affiliate, hoặc chiến lược truyền miệng. | `skills/referral-program` |
| **remotion-best-practices** | ⚪ | Best practices cho Remotion - Tạo video bằng React. | `skills/remotion-best-practices` |
| **requesting-code-review** | ⚪ | Dùng khi hoàn thành tác vụ, trước khi merge để xác minh công việc đáp ứng yêu cầu. | `skills/requesting-code-review` |
| **research-engineer** | ⚪ | Kỹ sư nghiên cứu học thuật không khoan nhượng. Tập trung vào tính chính xác lý thuyết và xác minh hình thức. | `skills/research-engineer` |
| **salesforce-development** | ⚪ | Các mẫu chuyên gia phát triển Salesforce (LWC, Apex, APIs, Salesforce DX). | `skills/salesforce-development` |
| **schema-markup** | ⚪ | Thiết kế, validate và tối ưu schema.org structured data cho SEO. | `skills/schema-markup` |
| **scroll-experience** | ⚪ | Chuyên gia xây dựng trải nghiệm cuộn (scroll-driven experiences) - parallax, scrollytelling. | `skills/scroll-experience` |
| **Security Scanning Tools** | ⚪ | Hướng dẫn sử dụng các công cụ quét bảo mật mạng, web, cloud. | `skills/scanning-tools` |
| **security-review** | ⚪ | Danh sách kiểm tra bảo mật toàn diện khi thêm auth, xử lý input, secrets, API. | `skills/cc-skill-security-review` |
| **segment-cdp** | ⚪ | Các mẫu chuyên gia cho Segment CDP (Analytics.js, Protocols, identity resolution). | `skills/segment-cdp` |
| **senior-architect** | ⚪ | Kỹ năng kiến trúc phần mềm toàn diện cho việc thiết kế hệ thống mở rộng, dễ bảo trì. | `skills/senior-architect` |
| **senior-fullstack** | ⚪ | Kỹ năng phát triển fullstack toàn diện (React, Next.js, Node.js, GraphQL, PostgreSQL). | `skills/senior-fullstack` |
| **seo-audit** | ⚪ | Chẩn đoán và kiểm toán các vấn đề SEO ảnh hưởng đến khả năng thu thập dữ liệu, lập chỉ mục và xếp hạng. | `skills/seo-audit` |
| **seo-fundamentals** | ⚪ | Các nguyên tắc cốt lõi của SEO (E-E-A-T, Core Web Vitals, nền tảng kỹ thuật). | `skills/seo-fundamentals` |
| **server-management** | ⚪ | Nguyên tắc quản lý máy chủ. Quản lý quy trình, giám sát, mở rộng. | `skills/server-management` |
| **Shodan Reconnaissance and Pentesting** | ⚪ | Hướng dẫn sử dụng Shodan để trinh sát và pentest: tìm thiết bị lộ lọt, scan IP ranges... | `skills/shodan-reconnaissance` |
| **shopify-apps** | ⚪ | Các mẫu chuyên gia phát triển ứng dụng Shopify (Remix, App Bridge, GraphQL Admin API). | `skills/shopify-apps` |
| **shopify-development** | ⚪ | Xây dựng Shopify apps, extensions, themes dùng GraphQL, CLI, Polaris, Liquid. | `skills/shopify-development` |
| **signup-flow-cro** | ⚪ | Tối ưu hóa quy trình đăng ký, tạo tài khoản, kích hoạt dùng thử. | `skills/signup-flow-cro` |
| **skill-creator** | ⚪ | Hướng dẫn tạo skill hiệu quả. Dùng khi user muốn tạo skill mới hoặc cập nhật skill cũ. | `skills/skill-creator` |
| **skill-developer** | ⚪ | Tạo và quản lý Claude Code skills theo best practices của Anthropic. | `skills/skill-developer` |
| **slack-bot-builder** | ⚪ | Xây dựng Slack apps sử dụng Bolt framework (Python/JS/Java). Block Kit, slash commands. | `skills/slack-bot-builder` |
| **slack-gif-creator** | ⚪ | Kiến thức và tiện ích để tạo GIF hoạt hình tối ưu cho Slack. | `skills/slack-gif-creator` |
| **SMTP Penetration Testing** | ⚪ | Hướng dẫn pentest SMTP: enumerate users, open mail relays, brute force. | `skills/smtp-penetration-testing` |
| **social-content** | ⚪ | Hỗ trợ tạo, lên lịch, tối ưu nội dung mạng xã hội (LinkedIn, Twitter, Instagram...). | `skills/social-content` |
| **software-architecture** | ⚪ | Hướng dẫn kiến trúc phần mềm tập trung vào chất lượng. | `skills/software-architecture` |
| **SQL Injection Testing** | ⚪ | Hướng dẫn test lỗi SQL Injection (SQLi), khai thác lỗ hổng truy vấn database. | `skills/sql-injection-testing` |
| **SQLMap Database Penetration Testing** | ⚪ | Hướng dẫn sử dụng SQLMap để tự động hóa test SQL injection và dump database. | `skills/sqlmap-database-pentesting` |
| **SSH Penetration Testing** | ⚪ | Hướng dẫn pentest SSH: enumerate config, brute force, exploit vulnerabilities. | `skills/ssh-penetration-testing` |
| **stripe-integration** | ⚪ | Hướng dẫn tích hợp Stripe toàn diện: Payments, subscriptions, billing portal, webhooks. | `skills/stripe-integration` |
| **subagent-driven-development** | ⚪ | Dùng khi thực thi kế hoạch triển khai với các nhiệm vụ độc lập trong phiên hiện tại. | `skills/subagent-driven-development` |
| **supabase-postgres-best-practices** | ⚪ | Tối ưu hóa hiệu năng Postgres và best practices từ Supabase. | `skills/postgres-best-practices` |
| **systematic-debugging** | ⚪ | Dùng khi gặp bug, test fail hoặc hành vi không mong muốn, trước khi đề xuất sửa lỗi. | `skills/systematic-debugging` |
| **tailwind-patterns** | ⚪ | Nguyên tắc Tailwind CSS v4. Cấu hình CSS-first, container queries, design token. | `skills/tailwind-patterns` |
| **tavily-web** | ⚪ | Tìm kiếm web, trích xuất nội dung, crawling và nghiên cứu sử dụng Tavily API. | `skills/tavily-web` |
| **tdd-workflow** | ⚪ | Quy trình Test-Driven Development (TDD). Vòng lặp RED-GREEN-REFACTOR. | `skills/tdd-workflow` |
| **telegram-bot-builder** | ⚪ | Chuyên gia xây dựng Telegram bot. Bot API, UX, kiếm tiền, scaling. | `skills/telegram-bot-builder` |
| **telegram-mini-app** | ⚪ | Chuyên gia xây dựng Telegram Mini Apps (TWA). Hệ sinh thái TON, payments, auth. | `skills/telegram-mini-app` |
| **templates** | ⚪ | Các mẫu khung dự án (project scaffolding) cho ứng dụng mới. | `skills/app-builder/templates` |
| **test-driven-development** | ⚪ | Dùng khi triển khai tính năng hoặc sửa lỗi, trước khi viết code triển khai. | `skills/test-driven-development` |
| **test-fixing** | ⚪ | Chạy test và sửa lỗi systematically. | `skills/test-fixing` |
| **testing-patterns** | ⚪ | Các mẫu Jest testing, factory functions, mocking strategies, TDD workflow. | `skills/testing-patterns` |
| **theme-factory** | ⚪ | Bộ công cụ tạo theme cho các artifact (slides, docs, landing pages). 10 pre-set themes. | `skills/theme-factory` |
| **Top 100 Web Vulnerabilities Reference** | ⚪ | Tham chiếu toàn diện về Top 100 lỗ hổng web (OWASP-aligned). | `skills/top-web-vulnerabilities` |
| **trigger-dev** | ⚪ | Chuyên gia Trigger.dev cho background jobs, AI workflows, reliable async execution. | `skills/trigger-dev` |
| **twilio-communications** | ⚪ | Xây dựng tính năng giao tiếp với Twilio: SMS, Voice, WhatsApp, Verify (2FA). | `skills/twilio-communications` |
| **typescript-expert** | ⚪ | Chuyên gia TypeScript/JavaScript: type-level programming, tối ưu hiệu năng, monorepo. | `skills/typescript-expert` |
| **ui-ux-pro-max** | ⚪ | Trí tuệ thiết kế UI/UX. 50 kiểu, 21 bảng màu, 50 cặp font... Shadow, gradient, layout. | `skills/ui-ux-pro-max` |
| **upstash-qstash** | ⚪ | Chuyên gia Upstash QStash cho serverless message queues, scheduled jobs. | `skills/upstash-qstash` |
| **using-git-worktrees** | ⚪ | Dùng khi bắt đầu công việc tính năng cần cô lập, tạo git worktrees. | `skills/using-git-worktrees` |
| **using-superpowers** | ⚪ | Dùng khi bắt đầu hội thoại - thiết lập cách tìm và dùng skill. | `skills/using-superpowers` |
| **vercel-deployment** | ⚪ | Kiến thức chuyên gia để deploy lên Vercel với Next.js. | `skills/vercel-deployment` |
| **vercel-react-best-practices** | ⚪ | Hướng dẫn tối ưu hiệu năng React và Next.js từ Vercel Engineering. | `skills/react-best-practices` |
| **verification-before-completion** | ⚪ | Dùng trước khi tuyên bố hoàn thành, chạy lệnh xác minh và xác nhận output. | `skills/verification-before-completion` |
| **viral-generator-builder** | ⚪ | Chuyên gia xây dựng các công cụ tạo nội dung viral (quiz, name generator, avatar creator). | `skills/viral-generator-builder` |
| **voice-agents** | ⚪ | Xây dựng voice agents - giao tiếp tự nhiên với AI. Xử lý độ trễ, ngắt lời. | `skills/voice-agents` |
| **voice-ai-development** | ⚪ | Chuyên gia phát triển ứng dụng Voice AI (OpenAI Realtime API, Vapi, Deepgram). | `skills/voice-ai-development` |
| **voice-ai-engine-development** | ⚪ | Xây dựng voice engines AI thời gian thực sử dụng async worker pipelines. | `skills/voice-ai-engine-development` |
| **vr-ar** | ⚪ | Nguyên tắc phát triển VR/AR. Thoải mái, tương tác, hiệu năng. | `skills/game-development/vr-ar` |
| **vulnerability-scanner** | ⚪ | Nguyên tắc phân tích lỗ hổng nâng cao. OWASP 2025, Supply Chain Security. | `skills/vulnerability-scanner` |
| **web-artifacts-builder** | ⚪ | Bộ công cụ tạo artifact web phức tạp, đa thành phần (React, Tailwind, shadcn/ui). | `skills/web-artifacts-builder` |
| **web-design-guidelines** | ⚪ | Review code UI tuân thủ Web Interface Guidelines. | `skills/web-design-guidelines` |
| **web-games** | ⚪ | Nguyên tắc phát triển game web. Framework, WebGPU, PWA. | `skills/game-development/web-games` |
| **web-performance-optimization** | ⚪ | Tối ưu hóa hiệu năng website và ứng dụng web (Core Web Vitals, bundle size). | `skills/web-performance-optimization` |
| **webapp-testing** | ⚪ | Bộ công cụ tương tác và test ứng dụng web cục bộ sử dụng Playwright. | `skills/webapp-testing` |
| **Windows Privilege Escalation** | ⚪ | Hướng dẫn leo thang đặc quyền trên Windows: misconfigurations, post-exploitation. | `skills/windows-privilege-escalation` |
| **Wireshark Network Traffic Analysis** | ⚪ | Hướng dẫn phân tích lưu lượng mạng bằng Wireshark: capture packets, filter, analyze protocols. | `skills/wireshark-analysis` |
| **WordPress Penetration Testing** | ⚪ | Hướng dẫn pentest WordPress: scan vulnerabilities, enumerate plugins, exploit hacks. | `skills/wordpress-penetration-testing` |
| **workflow-automation** | ⚪ | Tự động hóa quy trình (n8n, Temporal, Inngest). Biến script dễ vỡ thành automation bền vững. | `skills/workflow-automation` |
| **writing-plans** | ⚪ | Dùng khi bạn có spec hoặc yêu cầu cho tác vụ đa bước, trước khi viết code. | `skills/writing-plans` |
| **writing-skills** | ⚪ | Dùng khi tạo skill mới, chỉnh sửa skill, hoặc xác minh skill hoạt động. | `skills/writing-skills` |
| **xlsx** | ⚪ | Xử lý bảng tính toàn diện: Tạo mới, công thức, định dạng, phân tích dữ liệu. (Bản Official) | `skills/xlsx-official` |
| **zapier-make-patterns** | ⚪ | Các mẫu tự động hóa No-code (Zapier, Make). Khi nào dùng, cạm bẫy, và khi nào nên code. | `skills/zapier-make-patterns` |
---
## Hướng dẫn cài đặt nhanh
Để sở hữu bộ skill này cho **Claude Code**, **Gemini CLI**, **Codex CLI**, **Cursor**, **Antigravity**, hay **OpenCode**, bạn chỉ cần clone repo này vào thư mục skills tương ứng của agent:
```bash
# Cài đặt chung (Dùng được cho đa số công cụ)
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
# Dành riêng cho Claude Code
git clone https://github.com/sickn33/antigravity-awesome-skills.git .claude/skills
# Dành riêng cho Gemini CLI
git clone https://github.com/sickn33/antigravity-awesome-skills.git .gemini/skills
# Dành riêng cho Cursor
git clone https://github.com/sickn33/antigravity-awesome-skills.git .cursor/skills
```
---
## Bạn muốn đóng góp?
Chúng tôi nồng nhiệt chào đón mọi đóng góp từ cộng đồng! Để thêm một skill mới, bạn làm như sau:
1. **Fork** repository này về.
2. **Tạo thư mục mới** trong `skills/` cho skill của bạn.
3. **Thêm file `SKILL.md`** với đầy đủ frontmatter (name và description) theo mẫu.
4. **Chạy kiểm tra (validation)**: `python3 scripts/validate_skills.py`.
5. **Gửi Pull Request**.
Vui lòng đảm bảo skill của bạn tuân thủ các quy chuẩn (best practices) của Antigravity/Claude Code nhé.
---
## Lời cảm ơn & Nguồn tham khảo
Chúng tôi phát triển dự án này dựa trên những nền tảng tri thức vững chắc từ những người đi trước.
👉 **[Xem danh sách ghi nhận đầy đủ](SOURCES.md)**
Các nguồn cảm hứng và đóng góp to lớn bao gồm:
- **HackTricks**
- **OWASP**
- **Anthropic / OpenAI / Google**
- **Cộng đồng nguồn mở (Open Source Community)**
---
## Bản quyền (License)
Dự án được phát hành dưới giấy phép MIT. Xem file [LICENSE](../../LICENSE) để biết thêm chi tiết.
---
## Những người hùng đã đóng góp
Chúng tôi trân trọng mọi sự đóng góp của các bạn!
- [sck_0](https://github.com/sck_0)
- [Munir Abbasi](https://github.com/munirabbasi)
- [Mohammad Faiz](https://github.com/mohdfaiz2k9)
- [GuppyTheCat](https://github.com/GuppyTheCat)
- [sickn33](https://github.com/sickn33)
- [Ianj332](https://github.com/Ianj332)
- [Tiger-Foxx](https://github.com/Tiger-Foxx)
- [arathiesh](https://github.com/arathiesh)
- [1bcMax](https://github.com/1bcMax)
- [Ahmed Rehan](https://github.com/ar27111994)
- [BenedictKing](https://github.com/BenedictKing)
- [Nguyen Huu Loc](https://github.com/LocNguyenSGU)
- [Owen Wu](https://github.com/yubing744)
- [SuperJMN](https://github.com/SuperJMN)
- [Viktor Ferenczi](https://github.com/viktor-ferenczi)
- [krisnasantosa15](https://github.com/krisnasantosa15)
- [zebbern](https://github.com/zebbern)
- [vuth-dogo](https://github.com/vuth-dogo)
- [Takura](https://github.com/taksrules)
- [rafy](https://github.com/raeef1001)
- [Đỗ Khắc Gia Khoa](https://github.com/dokhacgiakhoa)
## Lịch sử phát triển
[![Star History Chart](https://api.star-history.com/svg?repos=sickn33/antigravity-awesome-skills&type=date&legend=top-left)](https://www.star-history.com/#sickn33/antigravity-awesome-skills&type=date&legend=top-left)

View File

@@ -1,21 +0,0 @@
# 📜 Nguồn Tham Khảo & Ghi Nhận
Chúng tôi tin vào việc tôn trọng quyền tác giả và nguồn gốc tri thức.
Nếu bạn thấy tác phẩm của mình ở đây mà chưa được ghi nhận xứng đáng, vui lòng mở Issue để chúng tôi cập nhật.
| Skill / Danh mục | Nguồn Gốc | Giấy Phép | Ghi chú |
| :-------------------------- | :----------------------------------------------------- | :------------- | :---------------------------- |
| `cloud-penetration-testing` | [HackTricks](https://book.hacktricks.xyz/) | MIT / CC-BY-SA | Đã điều chỉnh cho Agent dùng. |
| `active-directory-attacks` | [HackTricks](https://book.hacktricks.xyz/) | MIT / CC-BY-SA | Đã điều chỉnh cho Agent dùng. |
| `owasp-top-10` | [OWASP](https://owasp.org/) | CC-BY-SA | Phương pháp luận đã điều chỉnh.|
| `burp-suite-testing` | [PortSwigger](https://portswigger.net/burp) | N/A | Chỉ hướng dẫn sử dụng (không kèm phần mềm). |
| `crewai` | [CrewAI](https://github.com/joaomdmoura/crewAI) | MIT | Hướng dẫn Framework. |
| `langgraph` | [LangGraph](https://github.com/langchain-ai/langgraph) | MIT | Hướng dẫn Framework. |
| `react-patterns` | [React Docs](https://react.dev/) | CC-BY | Các mẫu chính thức. |
| **Các Skill Official** | [Anthropic / Google / OpenAI] | Độc quyền | Được khuyến khích sử dụng bởi nhà cung cấp. |
## Chính sách Giấy phép
- **Mã nguồn (Code)**: Tất cả code gốc trong repo này là **MIT**.
- **Nội dung (Content)**: Tài liệu là **CC-BY-4.0**.
- **Bên thứ ba**: Chúng tôi tôn trọng giấy phép gốc. Nếu một skill được import là GPL, nó sẽ được ghi chú rõ ràng hoặc loại bỏ (chúng tôi ưu tiên tương thích MIT/Apache).

View File

@@ -0,0 +1,124 @@
# 📦 Gói Kỹ năng Antigravity (Skill Bundles)
Bạn không biết bắt đầu từ đâu? Hãy chọn một gói dưới đây để sỡ hữu bộ kỹ năng được tuyển chọn phù hợp cho vai trò của bạn.
## 🚀 Gói Khởi đầu "Thiết yếu" (Essentials)
_Dành cho tất cả mọi người. Hãy cài đặt những kỹ năng này đầu tiên._
- `concise-planning`: Luôn bắt đầu bằng một kế hoạch.
- `lint-and-validate`: Giữ code sạch sẽ một cách tự động.
- `git-pushing`: Lưu công việc của bạn một cách an toàn.
- `kaizen`: Tư duy cải tiến liên tục.
## 🛡️ Gói "Kỹ sư Bảo mật" (Security Engineer)
_Dành cho pentesting, kiểm tra (auditing) và tăng cường bảo mật (hardening)._
- `ethical-hacking-methodology`: "Kinh thánh" về hacking đạo đức.
- `burp-suite-testing`: Quét lỗ hổng web.
- `owasp-top-10`: Kiểm tra các lỗi phổ biến nhất.
- `linux-privilege-escalation`: Đánh giá bảo mật Linux nâng cao.
- `cloud-penetration-testing`: Bảo mật AWS/Azure/GCP.
## 🌐 Gói "Phù thủy Web" (Web Wizard)
_Để xây dựng các ứng dụng web hiện đại, hiệu suất cao._
- `frontend-design`: Hướng dẫn về UI và thẩm mỹ.
- `react-patterns`: Các thực hành tốt nhất cho React (nếu có sẵn).
- `tailwind-patterns`: Siêu năng lực tạo kiểu (styling).
- `form-cro`: Tối ưu hóa các biểu mẫu để tăng tỷ lệ chuyển đổi.
- `seo-audit`: Giúp trang web của bạn xuất hiện trên Google.
## 🤖 Gói "Kiến trúc sư Agent" (Agent Architect)
_Để xây dựng các hệ thống AI._
- `agent-evaluation`: Kiểm tra các trợ lý AI (agents) của bạn.
- `langgraph`: Xây dựng quy trình làm việc agent có trạng thái (stateful).
- `mcp-builder`: Tự tạo các công cụ của riêng bạn.
- `prompt-engineering`: Làm chủ nghệ thuật giao tiếp với LLM.
## 🎮 Gói "Lập trình viên Game Độc lập" (Indie Game Dev)
_Đế xây dựng trò chơi với sự trợ giúp của AI._
- `game-development/game-design`: Cơ chế và vòng lặp trò chơi.
- `game-development/2d-games`: Sprite và vật lý 2D.
- `game-development/3d-games`: Mô hình 3D và shader.
- `game-development/unity-csharp`: Làm chủ lập trình C#.
- `algorithmic-art`: Tạo tài nguyên game (assets) bằng code.
## 🐍 Gói "Chuyên gia Python" (Python Pro)
_Dành cho những người làm backend và các nhà khoa học dữ liệu._
- `python-patterns`: Viết code Python chuẩn mực (idiomatic).
- `poetry-manager`: Quản lý phụ thuộc (dependencies) hiệu quả.
- `pytest-mastery`: Các framework kiểm thử.
- `fastapi-expert`: Xây dựng API hiệu suất cao.
- `django-guide`: Framework đầy đủ tính năng "battery-included".
## 🦄 Gói "Người sáng lập Startup" (Startup Founder)
_Để xây dựng sản phẩm, không chỉ là viết code._
- `product-requirements-doc`: Định nghĩa những gì cần xây dựng.
- `competitor-analysis`: Biết rõ đối thủ của bạn là ai.
- `pitch-deck-creator`: Gọi vốn (hoặc chỉ để giải thích ý tưởng của bạn).
- `landing-page-copy`: Viết nội dung bán hàng hiệu quả.
- `stripe-integration`: Phương thức thanh toán.
## 🌧️ Gói "DevOps & Cloud"
_Dành cho hạ tầng và mở rộng hệ thống._
- `docker-expert`: Làm chủ container và build đa giai đoạn.
- `aws-serverless`: Sử dụng serverless trên AWS (Lambda, DynamoDB).
- `environment-setup-guide`: Chuẩn hóa cho các đội ngũ.
- `deployment-procedures`: Chiến lược triển khai an toàn.
- `bash-linux`: Làm chủ dòng lệnh Terminal.
## 📊 Gói "Dữ liệu & Phân tích" (Data & Analytics)
_Để hiểu rõ các con số._
- `analytics-tracking`: Thiết lập GA4/PostHog chính xác.
- `d3-viz`: Các hình ảnh hóa dữ liệu tùy chỉnh đẹp mắt.
- `sql-mastery`: Viết truy vấn tốt hơn (Skill cộng đồng).
- `ab-test-setup`: Học hỏi từ thực nghiệm đã xác thực.
## 🎨 Gói "Giám đốc Sáng tạo" (Creative Director)
_Dành cho hình ảnh, nội dung và thương hiệu._
- `canvas-design`: Tạo poster và sơ đồ.
- `frontend-design`: Thẩm mỹ UI.
- `content-creator`: Các bài blog tối ưu hóa SEO.
- `copy-editing`: Trau chuốt nội dung văn bản.
- `algorithmic-art`: Các tác phẩm nghệ thuật tạo bằng code.
## 🐞 Gói "QA & Kiểm thử" (QA & Testing)
_Để phát hiện lỗi trước khi người dùng thấy._
- `test-driven-development`: Red, Green, Refactor.
- `systematic-debugging`: "Sherlock Holmes" trong thế giới code.
- `browser-automation`: Kiểm thử đầu cuối (E2E) với Playwright.
- `ab-test-setup`: Các thử nghiệm đã được xác thực.
- `code-review-checklist`: Phát hiện lỗi trong các Pull Request.
## 🖌️ Gói "Thiết kế Web" (Web Designer)
_Để tạo ra những trải nghiệm hoàn hảo đến từng pixel._
- `ui-ux-pro-max`: Hệ thống thiết kế/tokens cao cấp.
- `frontend-design`: Nền tảng của thẩm mỹ.
- `3d-web-experience`: Ma thuật của Three.js & R3F.
- `canvas-design`: Hình ảnh tĩnh/poster.
- `responsive-layout`: Các nguyên tắc ưu tiên di động (Mobile-first).
---
_Để sử dụng một gói kỹ năng, chỉ cần copy tên các skill vào thư mục `.agent/skills` của bạn hoặc yêu cầu trợ lý AI sử dụng chúng._

View File

@@ -0,0 +1,236 @@
# 🤝 Hướng dẫn Đóng góp - Phiên bản V3 Enterprise
**Cảm ơn bạn đã muốn làm cho repository này trở nên tốt hơn!** Hướng dẫn này sẽ chỉ cho bạn chính xác cách thức đóng góp, ngay cả khi bạn là người mới đối với mã nguồn mở.
Với phiên bản V3, chúng tôi đã nâng cao các tiêu chuẩn về chất lượng. Vui lòng đọc kỹ **Tiêu chuẩn Chất lượng mới** bên dưới.
---
## 🧐 "Quy chuẩn Chất lượng" (Quality Bar - Tiêu chuẩn V3)
**Quan trọng đối với các skill mới:** Mỗi skill được gửi đi phải vượt qua **5 bước Kiểm tra Chất lượng** (xem `docs/vietnamese/QUALITY_BAR.md` để biết chi tiết):
1. **Siêu dữ liệu (Metadata)**: Phần Frontmatter chính xác (`name`, `description`).
2. **An toàn (Safety)**: Không chứa các lệnh gây hại mà không có nhãn rủi ro ("Risk").
3. **Rõ ràng (Clarity)**: Có phần "Khi nào nên dùng" (When to use) rõ ràng.
4. **Ví dụ (Examples)**: Ít nhất một ví dụ sử dụng có thể sao chép và dùng được ngay.
5. **Hành động (Actions)**: Phải định nghĩa các bước hành động cụ thể cho AI, không chỉ là các "ý nghĩ".
---
## Các Cách để Đóng góp
Bạn không cần phải là một chuyên gia! Dưới đây là những cách mà bất kỳ ai cũng có thể giúp đỡ:
### 1. Cải thiện Tài liệu (Dễ nhất!)
- Sửa lỗi chính tả hoặc ngữ pháp.
- Làm cho các giải thích trở nên rõ ràng hơn.
- Thêm ví dụ vào các kỹ năng hiện có.
- Dịch tài liệu sang các ngôn ngữ khác.
### 2. Báo cáo Vấn đề (Issues)
- Thấy điều gì đó khó hiểu? Hãy cho chúng tôi biết!
- Kỹ năng không hoạt động? Hãy báo cho chúng tôi!
- Bạn có đề xuất? Chúng tôi luôn sẵn sàng lắng nghe!
### 3. Tạo Kỹ năng (Skill) mới
- Chia sẻ chuyên môn của bạn dưới dạng một kỹ năng.
- Lấp đầy các khoảng trống trong bộ sưu tập hiện tại.
- Cải thiện các kỹ năng sẵn có.
### 4. Kiểm thử và Xác thực
- Thử nghiệm các kỹ năng và báo cáo những gì hoạt động hoặc không hoạt động.
- Kiểm tra trên các công cụ AI khác nhau.
- Đề xuất các cải tiến.
---
## Cách Tạo một Kỹ năng mới
### Hướng dẫn Từng bước
#### Bước 1: Chọn Chủ đề cho Kỹ năng của bạn
Hãy tự hỏi: "Tôi ước trợ lý AI của mình hiểu rõ hơn về điều gì?".
Ví dụ: "Tôi giỏi về Docker, tôi sẽ tạo một kỹ năng về Docker".
#### Bước 2: Tạo Cấu trúc Thư mục
Các kỹ năng nằm trong thư mục `skills/`. Sử dụng định dạng `kebab-case` cho tên thư mục.
```bash
# Di chuyển đến thư mục skills
cd skills/
# Tạo thư mục cho skill của bạn
mkdir my-awesome-skill
cd my-awesome-skill
# Tạo file SKILL.md
touch SKILL.md
```
#### Bước 3: Viết Nội dung cho SKILL.md
Mỗi kỹ năng đều cần cấu trúc cơ bản này. **Hãy sao chép mẫu dưới đây:**
```markdown
---
name: my-awesome-skill
description: "Mô tả ngắn gọn về chức năng của skill này"
---
# Tiêu đề Skill
## Tổng quan
Giải thích skill này làm gì và khi nào nên sử dụng nó.
## Khi nào nên sử dụng Skill này
- Sử dụng khi [tình huống 1]
- Sử dụng khi [tình huống 2]
## Cách hoạt động
Hướng dẫn chi tiết từng bước cho AI...
## Ví dụ
### Ví dụ 1
\`\`\`
code ví dụ ở đây
\`\`\`
## Thực hành tốt nhất
- ✅ Nên làm điều này
- ❌ Không nên làm điều này
```
#### Bước 4: Xác thực (BƯỚC V3 QUAN TRỌNG)
Chạy script xác thực (validation) tại máy của bạn. **Chúng tôi sẽ không chấp nhận các Pull Request (PR) thất bại ở bước kiểm tra này.**
```bash
# Chế độ nhẹ (chỉ cảnh báo)
python3 scripts/validate_skills.py
# Chế độ nghiêm ngặt (chế độ mà hệ thống CI sẽ chạy)
python3 scripts/validate_skills.py --strict
```
Bước này sẽ kiểm tra:
- ✅ File `SKILL.md` có tồn tại hay không.
- ✅ Phần Frontmatter có chính xác không.
- ✅ Tên (Name) có khớp với tên thư mục không.
- ✅ Có vượt qua các kiểm tra của Quality Bar không.
#### Bước 5: Gửi Kỹ năng của bạn
```bash
git add skills/my-awesome-skill/
git commit -m "feat: add my-awesome-skill"
git push origin my-branch
```
---
## Bản mẫu (Template) Kỹ năng (Copy & Paste)
Tiết kiệm thời gian! Hãy sao chép bản mẫu này:
```markdown
---
name: your-skill-name
description: "Mô tả trong một câu về chức năng của skill và khi nào cần dùng"
---
# Tên Kỹ năng của bạn
## Tổng quan
[2-3 câu giải thích skill này làm gì]
## Khi nào nên sử dụng Skill này
- Sử dụng khi bạn cần [tình huống 1]
- Sử dụng khi bạn muốn [tình huống 2]
## Hướng dẫn Từng bước
### 1. [Tên Bước đầu tiên]
[Hướng dẫn chi tiết]
## Ví dụ
### Ví dụ 1: [Tên Trường hợp sử dụng]
\`\`\`language
// Code ví dụ ở đây
\`\`\`
## Thực hành tốt nhất
-**Nên:** [Thực hành tốt]
-**Không nên:** [Điều cần tránh]
## Xử lý Sự cố
**Vấn đề:** [Lỗi thường gặp]
**Giải pháp:** [Cách khắc phục]
```
---
## Hướng dẫn về Thông điệp Commit (Commit Message)
Sử dụng các tiền tố sau:
- `feat:` - Kỹ năng mới hoặc tính năng lớn.
- `docs:` - Cải thiện tài liệu hướng dẫn.
- `fix:` - Sửa lỗi.
- `refactor:` - Cải thiện code mà không thay đổi chức năng.
- `test:` - Thêm hoặc cập nhật các bài kiểm tra.
- `chore:` - Các tác vụ bảo trì.
**Ví dụ:**
```
feat: add kubernetes-deployment skill
docs: improve getting started guide
fix: correct typo in stripe-integration skill
```
---
## Tài liệu Học tập
### Bạn mới sử dụng Git/GitHub?
- [Hướng dẫn Hello World của GitHub](https://guides.github.com/activities/hello-world/)
- [Cơ bản về Git](https://git-scm.com/book/en/v2/Getting-Started-Git-Basics)
### Bạn mới sử dụng Markdown?
- [Hướng dẫn Markdown](https://www.markdownguide.org/basic-syntax/)
---
## Quy tắc Ứng xử (Code of Conduct)
- Luôn tôn trọng và hòa nhập.
- Chào đón những người mới.
- Tập trung vào các phản hồi mang tính xây dựng.
- **Không chứa nội dung gây hại**: Xem `docs/vietnamese/SECURITY_GUARDRAILS.md`.
---
**Cảm ơn bạn đã làm cho dự án này trở nên tốt đẹp hơn cho mọi người!**
Mọi sự đóng góp, dù nhỏ đến đâu, đều tạo nên sự khác biệt. Dù bạn sửa một lỗi chính tả, cải thiện một câu văn, hay tạo ra một kỹ năng hoàn toàn mới - bạn đang giúp đỡ hàng ngàn lập trình viên khác!

View File

@@ -0,0 +1,56 @@
# 🧪 Ví dụ Thực tế ("Sổ tay Nấu ăn Antigravity")
Các kỹ năng (skills) vốn dĩ đã mạnh mẽ khi đứng riêng lẻ, nhưng chúng sẽ trở nên không thể ngăn cản khi được kết hợp lại với nhau.
Dưới đây là ba tình huống phổ biến và cách giải quyết chúng bằng cách sử dụng repository này.
## 🥘 Công thức 1: "Kiểm tra Code cũ (Legacy Code Audit)"
_Tình huống: Bạn vừa tiếp nhận một repository Node.js 5 năm tuổi đang rất hỗn loạn. Bạn cần sửa nó một cách an toàn._
**Các Skill sử dụng:**
1. `concise-planning` (Để lập bản đồ cho sự hỗn loạn)
2. `lint-and-validate` (Để tìm ra lỗi)
3. `security-audit` (Để tìm ra lỗ hổng bảo mật)
**Quy trình làm việc (Workflow):**
1. **Lập kế hoạch**: "Agent, hãy dùng `concise-planning` để tạo một danh sách kiểm tra (checklist) cho việc tái cấu trúc (refactoring) file `src/legacy-api.js`."
2. **Kiểm tra**: "Chạy `security-audit` trên file `package.json` để tìm các thư viện phụ thuộc có lỗ hổng bảo mật."
3. **Sửa lỗi**: "Sử dụng các quy tắc của `lint-and-validate` để tự động sửa các lỗi định dạng trong thư mục `src/`."
---
## 🥘 Công thức 2: "Ứng dụng Web hiện đại"
_Tình huống: Bạn cần xây dựng một trang Landing Page hiệu suất cao trong vòng 2 giờ._
**Các Skill sử dụng:**
1. `frontend-design` (Để đảm bảo tính thẩm mỹ)
2. `react-patterns` (Để xây dựng cấu trúc)
3. `tailwind-mastery` (Để tăng tốc độ triển khai)
**Quy trình làm việc (Workflow):**
1. **Thiết kế**: "Hãy sử dụng `frontend-design` để tạo bảng màu và kiểu chữ cho một 'Quán cà phê phong cách Cyberpunk'."
2. **Khởi tạo**: "Khởi tạo một dự án Vite. Sau đó áp dụng `react-patterns` để tạo component 'Hero'."
3. **Định dạng kiểu dáng**: "Sử dụng `tailwind-mastery` để làm cho các nút bấm có hiệu ứng glassmorphic (hiệu ứng kính mờ) và phản hồi tốt trên nhiều thiết bị (responsive)."
---
## 🥘 Công thức 3: "Kiến trúc sư Agent"
_Tình huống: Bạn muốn xây dựng một trợ lý AI (agent) tùy chỉnh có khả năng tự xác minh mã code của chính nó._
**Các Skill sử dụng:**
1. `mcp-builder` (Để xây dựng công cụ)
2. `agent-evaluation` (Để kiểm tra độ tin cậy)
3. `prompt-engineering` (Để trau chuốt các hướng dẫn)
**Quy trình làm việc (Workflow):**
1. **Xây dựng**: "Sử dụng `mcp-builder` để tạo một công cụ `verify-file`."
2. **Hướng dẫn**: "Áp dụng các mẫu `prompt-engineering` vào System Prompt để agent luôn kiểm tra lại đường dẫn file."
3. **Kiểm tra**: "Chạy `agent-evaluation` để đo lường tần suất agent thất bại trong việc tìm file."

178
docs/vietnamese/FAQ.vi.md Normal file
View File

@@ -0,0 +1,178 @@
# ❓ Câu hỏi thường gặp (FAQ)
**Bạn có thắc mắc?** Bạn không hề cô đơn! Dưới đây là câu trả lời cho những câu hỏi thường gặp nhất về Antigravity Awesome Skills.
---
## 🎯 Câu hỏi Chung
### "Skills" (kỹ năng) chính xác là gì?
Skills là các tệp hướng dẫn chuyên biệt dạy cho các trợ lý AI cách xử lý những tác vụ cụ thể. Hãy coi chúng như những mô-đun kiến thức chuyên gia mà AI của bạn có thể tải khi cần.
**Một so sánh đơn giản:** Giống như việc bạn tham khảo ý kiến của các chuyên gia khác nhau (luật sư, bác sĩ, thợ máy), những kỹ năng này giúp AI của bạn trở thành chuyên gia trong các lĩnh vực khác nhau khi bạn cần.
### Tôi có cần phải cài đặt tất cả hơn 560 skills không?
**Không!** Khi bạn clone (tải bản sao) repository này, tất cả các kỹ năng đều có sẵn, nhưng AI của bạn chỉ tải chúng khi bạn yêu cầu rõ ràng bằng lệnh `@ten-skill`.
Nó giống như việc sở hữu một thư viện - tất cả sách đều ở đó, nhưng bạn chỉ đọc những cuốn bạn cần thôi.
**Mẹo:** Sử dụng [Bản mẫu Khởi đầu (Starter Packs)](BUNDLES.vi.md) để chỉ cài đặt những gì phù hợp với vai trò của bạn.
### Những công cụ AI nào hoạt động với các kỹ năng này?
-**Claude Code** (Dòng lệnh CLI của Anthropic)
-**Gemini CLI** (Google)
-**Codex CLI** (OpenAI)
-**Cursor** (IDE tích hợp AI)
-**Antigravity IDE**
-**OpenCode**
- ⚠️ **GitHub Copilot** (Hỗ trợ một phần qua việc copy-paste)
### Những kỹ năng này có được sử dụng miễn phí không?
**Có!** Repository này được cấp phép theo giấy phép MIT License.
- ✅ Miễn phí cho sử dụng cá nhân.
- ✅ Miễn phí cho sử dụng thương mại.
- ✅ Bạn có thể sửa đổi chúng.
### Các kỹ năng có hoạt động ngoại tuyến (offline) không?
Bản thân các file skill được lưu trữ cục bộ trên máy tính của bạn, nhưng trợ lý AI của bạn vẫn cần kết nối internet để hoạt động.
---
## 🔒 Bảo mật & Tin cậy (Cập nhật V4)
### Các Nhãn rủi ro (Risk Labels) có ý nghĩa gì?
Chúng tôi phân loại các kỹ năng để bạn biết mình đang chạy cái gì:
-**Safe (Trắng/Xanh)**: Các kỹ năng chỉ đọc, lập kế hoạch hoặc vô hại.
- 🔴 **Risk (Đỏ)**: Các kỹ năng sửa đổi file (xóa), sử dụng công cụ quét mạng, hoặc thực hiện các hành động có tính phá hủy. **Hãy sử dụng thận trọng.**
- 🟣 **Official (Tím)**: Được duy trì bởi các nhà cung cấp tin cậy (Anthropic, DeepMind, v.v.).
### Những kỹ năng này có thể hack máy tính của tôi không?
**Không.** Kỹ năng là các file văn bản. Tuy nhiên, chúng *hướng dẫn* AI chạy các dòng lệnh. Nếu một skill nói "xóa toàn bộ file", một AI tuân thủ có thể sẽ thử làm việc đó.
_Luôn kiểm tra nhãn rủi ro và xem xét mã nguồn trước khi dùng._
---
## 📦 Cài đặt & Thiết lập
### Tôi nên cài đặt các kỹ năng này ở đâu?
Đường dẫn phổ biến nhất hoạt động với mạng lưới các công cụ AI là `.agent/skills/`:
```bash
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
**Các đường dẫn cụ thể cho từng công cụ:**
- Claude Code: `.claude/skills/`
- Gemini CLI: `.gemini/skills/`
- Cursor: `.cursor/skills/` hoặc gốc của dự án.
### Repo này có hoạt động trên Windows không?
**Có**, nhưng một số kỹ năng "Official" (chính thức) sử dụng **symlinks** (liên kết tượng trưng) mà Windows xử lý không tốt theo mặc định.
Hãy chạy git clone với lệnh sau:
```bash
git clone -c core.symlinks=true https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
Hoặc bật "Chế độ Nhà phát triển" (Developer Mode) trong phần Cài đặt của Windows.
### Làm thế nào để cập nhật các kỹ năng?
Chuyển hướng đến thư mục chứa kỹ năng của bạn và kéo (pull) những thay đổi mới nhất:
```bash
cd .agent/skills
git pull origin main
```
---
## 🛠️ Cách sử dụng Skills
### Làm thế nào để gọi một kỹ năng?
Sử dụng biểu tượng `@` theo sau là tên skill:
```bash
@brainstorming giúp tôi thiết kế một ứng dụng todo
```
### Tôi có thể dùng nhiều kỹ năng cùng một lúc không?
**Có!** Bạn có thể gọi nhiều kỹ năng:
```bash
@brainstorming giúp tôi thiết kế phần này, sau đó dùng @writing-plans để tạo danh sách nhiệm vụ.
```
### Làm thế nào để tôi biết nên dùng kỹ năng nào?
1. **Duyệt qua danh mục**: Xem [Danh mục Skill (Skill Catalog)](../CATALOG.vi.md).
2. **Tìm kiếm**: `ls skills/ | grep "từ-khóa"`
3. **Hỏi AI của bạn**: "Bạn có kỹ năng nào để kiểm thử (testing) không?"
---
## 🏗️ Xử lý sự cố
### Trợ lý AI của tôi không nhận diện được kỹ năng
**Các nguyên nhân có thể xảy ra:**
1. **Sai đường dẫn cài đặt**: Kiểm tra tài liệu hướng dẫn của công cụ bạn dùng. Hãy thử `.agent/skills/`.
2. **Cần khởi động lại**: Khởi động lại AI/IDE sau khi cài đặt.
3. **Lỗi đánh máy**: Bạn có gõ lầm `@brain-storming` thay vì `@brainstorming` không?
### Một kỹ năng đưa ra lời khuyên sai hoặc lỗi thời
Hãy [Mở một issue](https://github.com/sickn33/antigravity-awesome-skills/issues)!
Vui lòng gửi kèm:
- Skill nào?
- Điều gì đã xảy ra?
- Đáng lẽ điều gì nên xảy ra?
---
## 🤝 Đóng góp
### Tôi là người mới đối với mã nguồn mở. Tôi có thể đóng góp không?
**Chắc chắn là có!** Chúng tôi chào đón những người mới bắt đầu.
- Sửa lỗi đánh máy.
- Thêm ví dụ.
- Cải thiện tài liệu hướng dẫn.
Hãy xem [CONTRIBUTING.md](../CONTRIBUTING.vi.md) để biết hướng dẫn chi tiết.
### Pull Request (PR) của tôi thất bại khi kiểm tra "Quality Bar". Tại sao?
Phiên bản V3 áp dụng kiểm soát chất lượng tự động. Skill của bạn có thể đang thiếu:
1. Một `description` (mô tả) hợp lệ.
2. Các ví dụ sử dụng.
Hãy chạy `python3 scripts/validate_skills.py` cục bộ để kiểm tra trước khi đẩy code lên.
### Tôi có thể cập nhật các kỹ năng "Official" không?
**Không.** Các kỹ năng chính thức (trong thư mục `skills/official/`) được đồng bộ từ các nhà cung cấp. Thay vào đó, hãy mở một issue để báo lỗi.
---
## 💡 Mẹo Chuyên nghiệp
- Bắt đầu với `@brainstorming` trước khi xây dựng bất kỳ thứ gì mới.
- Sử dụng `@systematic-debugging` khi gặp lỗi khó nhằn.
- Thử `@test-driven-development` để code có chất lượng tốt hơn.
- Khám phá `@skill-creator` để tự tạo kỹ năng của riêng bạn.
**Vẫn còn thắc mắc?** [Mở một cuộc thảo luận (Discussion)](https://github.com/sickn33/antigravity-awesome-skills/discussions) và chúng tôi sẽ giúp bạn! 🙌

View File

@@ -0,0 +1,108 @@
# Hướng dẫn Bắt đầu với Antigravity Awesome Skills (V4)
**Bạn mới đến đây? Hướng dẫn này sẽ giúp bạn tăng cường sức mạnh cho trợ lý trợ lý AI của mình chỉ trong 5 phút.**
---
## 🤔 "Skills" (Kỹ năng) là gì?
Các trợ lý AI (như **Claude Code**, **Gemini**, **Cursor**) rất thông minh, nhưng chúng thiếu kiến thức cụ thể về các công cụ và quy trình làm việc của bạn.
**Skills** là các hướng dẫn sử dụng chuyên biệt (dưới dạng file markdown) dạy cho AI của bạn cách thực hiện các tác vụ cụ thể một cách hoàn hảo trong mọi lần thực hiện.
**Một phép so sánh:** AI của bạn là một thực tập sinh xuất sắc. **Skills** là các SOP (Quy trình vận hành tiêu chuẩn) biến họ thành một Kỹ sư cao cấp.
---
## ⚡️ Khởi động nhanh: Các "Gói khởi đầu" (Starter Packs)
Đừng lo lắng về con số hơn 560 kỹ năng. Bạn không cần dùng tất cả chúng cùng một lúc.
Chúng tôi đã tuyển chọn các **Gói khởi đầu** để bạn có thể bắt đầu sử dụng ngay lập tức.
### 1. Cài đặt Repository
Sao chép các kỹ năng vào thư mục agent của bạn:
```bash
# Cài đặt phổ thông (hoạt động với hầu hết các agent)
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
### 2. Chọn vai trò của bạn
Tìm gói kỹ năng phù hợp với vị trí của bạn (xem [BUNDLES.md](BUNDLES.vi.md)):
| Vai trò | Tên Gói kỹ năng | Bên trong có những gì? |
| :-------------------- | :-------------- | :------------------------------------------------ |
| **Web Developer** | `Web Wizard` | React Patterns, Tailwind mastery, Frontend Design |
| **Security Engineer** | `Hacker Pack` | OWASP, Metasploit, Pentest Methodology |
| **Manager / PM** | `Product Pack` | Brainstorming, Planning, SEO, Strategy |
| **Cơ bản cho tất cả** | `Essentials` | Clean Code, Planning, Validation (Những thứ cơ bản nhất) |
---
## 🚀 Cách sử dụng một Skill
Sau khi cài đặt, bạn chỉ cần trò chuyện với AI một cách tự nhiên.
### Ví dụ 1: Lập kế hoạch cho một Tính năng (**Essentials**)
> "Sử dụng **@brainstorming** để giúp tôi thiết kế một luồng đăng nhập mới."
**Điều gì sẽ xảy ra:** AI sẽ tải kỹ năng brainstorming, đặt cho bạn các câu hỏi có cấu trúc và tạo ra một bản đặc tả chuyên nghiệp.
### Ví dụ 2: Kiểm tra Code của bạn (**Web Wizard**)
> "Chạy **@lint-and-validate** trên file này và sửa các lỗi."
**Điều gì sẽ xảy ra:** AI sẽ tuân theo các quy tắc linting nghiêm ngặt được định nghĩa trong skill để làm sạch code của bạn.
### Ví dụ 3: Kiểm tra Bảo mật (**Hacker Pack**)
> "Sử dụng **@api-security-best-practices** để xem xét các endpoint API của tôi."
**Điều gì sẽ xảy ra:** AI sẽ kiểm tra code của bạn dựa trên các tiêu chuẩn OWASP.
---
## 🔌 Các công cụ được hỗ trợ
| Công cụ | Trạng thái | Đường dẫn |
| :--------------- | :-------------- | :---------------- |
| **Claude Code** | ✅ Hỗ trợ đầy đủ | `.claude/skills/` |
| **Gemini CLI** | ✅ Hỗ trợ đầy đủ | `.gemini/skills/` |
| **Antigravity** | ✅ Hỗ trợ gốc | `.agent/skills/` |
| **Cursor** | ✅ Hỗ trợ gốc | `.cursor/skills/` |
| **Copilot** | ⚠️ Chỉ văn bản | Copy-paste thủ công |
---
## 🛡️ Sự tin cậy & An toàn (Mới trong bản V4)
Chúng tôi phân loại các kỹ năng để bạn biết mình đang chạy những gì:
- 🟣 **Official (Chính thức)**: Được duy trì bởi Anthropic/Google/Nhà cung cấp (Độ tin cậy cao).
- 🔵 **Safe (An toàn)**: Các kỹ năng cộng đồng không gây hại (Chỉ đọc/Lập kế hoạch).
- 🔴 **Risk (Rủi ro)**: Các kỹ năng sửa đổi hệ thống hoặc thực hiện kiểm thử bảo mật (Sử dụng khi được cấp phép).
_Kiểm tra [Danh mục Skill (Skill Catalog)](../CATALOG.vi.md) để xem danh sách đầy đủ._
---
## ❓ FAQ
**H: Tôi có cần cài đặt tất cả 560 kỹ năng không?**
Đ: Bạn tải toàn bộ repo về, nhưng AI của bạn chỉ _đọc_ những kỹ năng bạn yêu cầu (hoặc những kỹ năng có liên quan). Nó rất nhẹ!
**H: Tôi có thể tự tạo kỹ năng cho riêng mình không?**
Đ: Có! Sử dụng kỹ năng **@skill-creator** để tự xây dựng.
**H: Nó có miễn phí không?**
Đ: Có, Giấy phép MIT. Mã nguồn mở mãi mãi.
---
## ⏭️ Các bước tiếp theo
1. [Duyệt qua các Gói kỹ năng (Bundles)](BUNDLES.vi.md)
2. [Xem các Ví dụ thực tế (Examples)](EXAMPLES.vi.md)
3. [Đóng góp một Skill mới](../CONTRIBUTING.vi.md)

View File

@@ -0,0 +1,64 @@
# 🏆 Tiêu chuẩn Chất lượng & Xác thực
Để biến **Antigravity Awesome Skills** từ một tập hợp các script thành một nền tảng đáng tin cậy, mỗi skill (kỹ năng) phải đáp ứng một tiêu chuẩn cụ thể về chất lượng và an toàn.
## Huy hiệu "Đã xác thực" (Validated) ✅
Một skill chỉ nhận được huy hiệu "Đã xác thực" nếu nó vượt qua **5 bước kiểm tra tự động** sau:
### 1. Tính toàn vẹn của siêu dữ liệu (Metadata Integrity)
Phần frontmatter trong `SKILL.md` phải là mã YAML hợp lệ và chứa:
- `name`: Định dạng Kebab-case, khớp với tên thư mục.
- `description`: Dưới 200 ký tự, nêu rõ giá trị mang lại.
- `risk`: Thuộc một trong các loại `[none, safe, critical, offensive]`.
- `source`: URL dẫn đến nguồn gốc (hoặc "self" nếu là nội dung gốc).
### 2. Điều kiện kích hoạt rõ ràng ("Khi nào nên dùng")
Skill BẮT BUỘC phải có một phần nêu rõ thời điểm nên kích hoạt nó.
- **Tốt**: "Sử dụng khi người dùng yêu cầu debug (gỡ lỗi) một component React."
- **Tệ**: "Skill này giúp bạn xử lý code."
### 3. Phân loại An toàn & Rủi ro
Mỗi skill phải khai báo mức độ rủi ro của nó:
- 🟢 **none**: Chỉ là văn bản/tư duy thuần túy (ví dụ: Brainstorming).
- 🔵 **safe**: Đọc file, chạy các lệnh an toàn (ví dụ: Linter).
- 🟠 **critical**: Sửa đổi trạng thái, xóa file, push lên môi trường production (ví dụ: Git Push).
- 🔴 **offensive**: Các công cụ Pentesting/Red Team. **BẮT BUỘC** phải có cảnh báo "Chỉ dành cho mục đích sử dụng đã được cấp phép".
### 4. Ví dụ thực tế (Copy-Pasteable)
Ít nhất một khối code hoặc ví dụ tương tác mà người dùng (hoặc agent) có thể sử dụng ngay lập tức.
### 5. Giới hạn rõ ràng (Explicit Limitations)
Danh sách các trường hợp biên hoặc những việc mà skill _không thể_ thực hiện.
- _Ví dụ_: "Không hoạt động trên Windows nếu không có WSL."
---
## Các cấp độ Hỗ trợ
Chúng tôi cũng phân loại skill dựa trên người duy trì chúng:
| Cấp độ | Huy hiệu | Ý nghĩa |
| :------------ | :------- | :--------------------------------------------------- |
| **Official** | 🟣 | Do đội ngũ cốt lõi duy trì. Độ tin cậy cao. |
| **Community** | ⚪ | Do cộng đồng đóng góp. Hỗ trợ theo khả năng tốt nhất. |
| **Verified** | ✨ | Skill cộng đồng đã vượt qua vòng kiểm duyệt thủ công chuyên sâu. |
---
## Cách Xác thực Skill của bạn
Chạy script xác thực trước khi gửi Pull Request (PR):
```bash
python3 scripts/validate_skills.py --strict
```

View File

@@ -0,0 +1,190 @@
# 🌌 Antigravity Awesome Skills: 560+ Kỹ năng (Skills) cho Claude Code, Gemini CLI, Cursor, Copilot và nhiều hơn nữa
> **Bộ sưu tập tối ưu gồm hơn 560 Kỹ năng Phổ quát cho các Trợ lý Lập trình AI — Claude Code, Gemini CLI, Codex CLI, Antigravity IDE, GitHub Copilot, Cursor, OpenCode**
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Claude Code](https://img.shields.io/badge/Claude%20Code-Anthropic-purple)](https://claude.ai)
[![Gemini CLI](https://img.shields.io/badge/Gemini%20CLI-Google-blue)](https://github.com/google-gemini/gemini-cli)
[![Codex CLI](https://img.shields.io/badge/Codex%20CLI-OpenAI-green)](https://github.com/openai/codex)
[![Cursor](https://img.shields.io/badge/Cursor-AI%20IDE-orange)](https://cursor.sh)
[![Copilot](https://img.shields.io/badge/GitHub%20Copilot-VSCode-lightblue)](https://github.com/features/copilot)
[![OpenCode](https://img.shields.io/badge/OpenCode-CLI-gray)](https://github.com/opencode-ai/opencode)
[![Antigravity](https://img.shields.io/badge/Antigravity-DeepMind-red)](https://github.com/sickn33/antigravity-awesome-skills)
**Antigravity Awesome Skills** là một thư viện được tuyển chọn và kiểm chứng kỹ lưỡng với **560 kỹ năng hiệu suất cao** được thiết kế để hoạt động mượt mà trên tất cả các trợ lý lập trình AI lớn:
- 🟣 **Claude Code** (Anthropic CLI)
- 🔵 **Gemini CLI** (Google DeepMind)
- 🟢 **Codex CLI** (OpenAI)
- 🔴 **Antigravity IDE** (Google DeepMind)
- 🩵 **GitHub Copilot** (VSCode Extension)
- 🟠 **Cursor** (AI-native IDE)
-**OpenCode** (Mã nguồn mở CLI)
**Chào mừng bạn đến với Phiên bản V4.0.0 Enterprise.** Đây không chỉ là một danh sách các tập lệnh (scripts); nó là một hệ điều hành hoàn chỉnh cho Trợ lý AI của bạn.
### 1. 🐣 Bối cảnh: Đây là gì?
**Antigravity Awesome Skills** (Phiên bản 4.0.0) là một bản nâng cấp khổng lồ cho khả năng của AI.
Các trợ lý AI (như Claude Code, Cursor, hoặc Gemini) rất thông minh, nhưng chúng thiếu các **công cụ chuyên biệt**. Chúng không biết "Quy trình Triển khai" của công ty bạn hoặc cú pháp cụ thể cho "AWS CloudFormation".
**Skills** là các tệp markdown nhỏ dạy cho chúng cách thực hiện những tác vụ cụ thể này một cách chính xác trong mọi lần thực thi.
...
Repository này cung cấp các kỹ năng thiết yếu để biến trợ lý AI của bạn thành một **đội ngũ chuyên gia số toàn năng**, bao gồm các khả năng chính thức từ **Anthropic**, **OpenAI**, **Google**, **Supabase**, và **Vercel Labs**.
...
Cho dù bạn đang sử dụng **Gemini CLI**, **Claude Code**, **Codex CLI**, **Cursor**, **GitHub Copilot**, **Antigravity**, hay **OpenCode**, những kỹ năng này được thiết kế để có thể sử dụng ngay lập tức và tăng cường sức mạnh cho trợ lý AI của bạn.
Repository này tập hợp những khả năng tốt nhất từ khắp cộng đồng mã nguồn mở, biến trợ lý AI của bạn thành một đội ngũ chuyên gia số toàn năng có khả năng Kỹ thuật, Thiết kế, Bảo mật, Marketing và Vận hành Tự động.
## Tính năng & Danh mục
Repository được tổ chức thành các lĩnh vực chuyên biệt để biến AI của bạn thành một chuyên gia trên toàn bộ vòng đời phát triển phần mềm:
| Danh mục | Trọng tâm | Ví dụ kỹ năng |
| :--- | :--- | :--- |
| Kiến trúc (52) | Thiết kế hệ thống, ADRs, C4 và các mẫu có thể mở rộng | `architecture`, `c4-context`, `senior-architect` |
| Kinh doanh (35) | Tăng trưởng, định giá, CRO, SEO và thâm nhập thị trường | `copywriting`, `pricing-strategy`, `seo-audit` |
| Dữ liệu & AI (81) | Ứng dụng LLM, RAG, agents, khả năng quan sát, phân tích | `rag-engineer`, `prompt-engineer`, `langgraph` |
| Phát triển (72) | Làm chủ ngôn ngữ, mẫu thiết kế framework, chất lượng code | `typescript-expert`, `python-patterns`, `react-patterns` |
| Tổng quát (95) | Lập kế hoạch, tài liệu, vận hành sản phẩm, viết bài, hướng dẫn | `brainstorming`, `doc-coauthoring`, `writing-plans` |
| Hạ tầng (72) | DevOps, cloud, serverless, triển khai, CI/CD | `docker-expert`, `aws-serverless`, `vercel-deployment` |
| Bảo mật (107) | AppSec, pentesting, phân tích lỗ hổng, tuân thủ | `api-security-best-practices`, `sql-injection-testing`, `vulnerability-scanner` |
| Kiểm thử (21) | TDD, thiết kế kiểm thử, sửa lỗi, quy trình QA | `test-driven-development`, `testing-patterns`, `test-fixing` |
| Quy trình (17) | Tự động hóa, điều phối, công việc, agents | `workflow-automation`, `inngest`, `trigger-dev` |
## Bộ sưu tập Tuyển chọn
[Xem các Gói khởi đầu tại docs/vietnamese/BUNDLES.md](docs/vietnamese/BUNDLES.vi.md) để tìm bộ công cụ hoàn hảo cho vai trò của bạn.
## Duyệt hơn 560 Kỹ năng
Chúng tôi đã chuyển danh sách đầy đủ các kỹ năng sang một danh mục riêng biệt để giữ cho file README này gọn gàng.
👉 **[Xem Danh mục Kỹ năng Đầy đủ (CATALOG.vi.md)](CATALOG.vi.md)**
## Cài đặt
Để sử dụng các kỹ năng này với **Claude Code**, **Gemini CLI**, **Codex CLI**, **Cursor**, **Antigravity**, hoặc **OpenCode**, hãy clone repository này vào thư mục kỹ năng của assistant của bạn:
```bash
# Cài đặt phổ thông (hoạt động với hầu hết các công cụ)
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
# Dành riêng cho Claude Code
git clone https://github.com/sickn33/antigravity-awesome-skills.git .claude/skills
# Dành riêng cho Gemini CLI
git clone https://github.com/sickn33/antigravity-awesome-skills.git .gemini/skills
# Dành riêng cho Cursor
git clone https://github.com/sickn33/antigravity-awesome-skills.git .cursor/skills
```
---
## Cách thức Đóng góp
Chúng tôi chào đón mọi sự đóng góp từ cộng đồng! Để thêm một kỹ năng mới:
1. **Fork** repository.
2. **Tạo một thư mục mới** bên trong `skills/` cho kỹ năng của bạn.
3. **Thêm file `SKILL.md`** với phần frontmatter bắt buộc (tên và mô tả).
4. **Chạy kiểm tra xác thực**: `python3 scripts/validate_skills.py`.
5. **Gửi một Pull Request**.
Vui lòng đảm bảo kỹ năng của bạn tuân thủ các thực hành tốt nhất của Antigravity/Claude Code.
---
## Người đóng góp & Ghi công
Chúng tôi đứng trên vai của những người khổng lồ.
👉 **[Xem Sổ cái Ghi công Đầy đủ (docs/vietnamese/SOURCES.vi.md)](docs/vietnamese/SOURCES.vi.md)**
Các nguồn đóng góp và nguồn chính bao gồm:
- **HackTricks**
- **OWASP**
- **Anthropic / OpenAI / Google**
- **Cộng đồng mã nguồn mở**
Bộ sưu tập này sẽ không thể hình thành nếu không có công việc tuyệt vời của cộng đồng Claude Code và các nguồn chính thức:
### Các nguồn Chính thức
- **[anthropics/skills](https://github.com/anthropics/skills)**: Thư mục skill chính thức của Anthropic - Xử lý tài liệu (DOCX, PDF, PPTX, XLSX), Hướng dẫn thương hiệu, Giao tiếp nội bộ.
- **[anthropics/claude-cookbooks](https://github.com/anthropics/claude-cookbooks)**: Các notebook và công thức chính thức để xây dựng với Claude.
- **[remotion-dev/skills](https://github.com/remotion-dev/skills)**: Skills chính thức của Remotion - Tạo video trong React với 28 quy tắc mô-đun.
- **[vercel-labs/agent-skills](https://github.com/vercel-labs/agent-skills)**: Skills chính thức của Vercel Labs - Thực hành tốt nhất cho React, Hướng dẫn thiết kế Web.
- **[openai/skills](https://github.com/openai/skills)**: Danh mục skill của OpenAI Codex - Các kỹ năng của Agent, Trình tạo Skill, Lập kế hoạch Súc tích.
- **[supabase/agent-skills](https://github.com/supabase/agent-skills)**: Skills chính thức của Supabase - Thực hành tốt nhất cho Postgres.
### Những người đóng góp từ Cộng đồng
- **[rmyndharis/antigravity-skills](https://github.com/rmyndharis/antigravity-skills)**: Cho sự đóng góp khổng lồ của hơn 300+ kỹ năng Enterprise và logic tạo danh mục.
- **[obra/superpowers](https://github.com/obra/superpowers)**: Bản "Superpowers" gốc bởi Jesse Vincent.
- **[guanyang/antigravity-skills](https://github.com/guanyang/antigravity-skills)**: Các bản mở rộng Antigravity cốt lõi.
- **[diet103/claude-code-infrastructure-showcase](https://github.com/diet103/claude-code-infrastructure-showcase)**: Cơ sở hạ tầng và Hướng dẫn cho Backend/Frontend.
- **[ChrisWiles/claude-code-showcase](https://github.com/ChrisWiles/claude-code-showcase)**: Các mẫu React UI và Hệ thống Thiết kế.
- **[travisvn/awesome-claude-skills](https://github.com/travisvn/awesome-claude-skills)**: Loki Mode và tích hợp Playwright.
- **[zebbern/claude-code-guide](https://github.com/zebbern/claude-code-guide)**: Bộ công cụ bảo mật toàn diện & Hướng dẫn (Nguồn cho khoảng 60 kỹ năng mới).
- **[alirezarezvani/claude-skills](https://github.com/alirezarezvani/claude-skills)**: Bộ công cụ Kỹ sư cao cấp và PM.
- **[karanb192/awesome-claude-skills](https://github.com/karanb192/awesome-claude-skills)**: Một danh sách khổng lồ các kỹ năng đã được xác thực cho Claude Code.
- **[zircote/.claude](https://github.com/zircote/.claude)**: Tham chiếu kỹ năng phát triển cho Shopify.
- **[vibeforge1111/vibeship-spawner-skills](https://github.com/vibeforge1111/vibeship-spawner-skills)**: Trợ lý AI, Tích hợp, Công cụ của nhà sáng tạo (57 kỹ năng, Apache 2.0).
- **[coreyhaines31/marketingskills](https://github.com/coreyhaines31/marketingskills)**: Các kỹ năng Marketing cho CRO, copywriting, SEO, quảng cáo trả phí và tăng trưởng (23 kỹ năng, MIT).
- **[vudovn/antigravity-kit](https://github.com/vudovn/antigravity-kit)**: Các mẫu AI Agent với Kỹ năng, Agents và Quy trình làm việc (33 kỹ năng, MIT).
- **[affaan-m/everything-claude-code](https://github.com/affaan-m/everything-claude-code)**: Bộ sưu tập cấu hình Claude Code đầy đủ từ người chiến thắng cuộc thi hackathon của Anthropic - chỉ phần kỹ năng (8 kỹ năng, MIT).
- **[webzler/agentMemory](https://github.com/webzler/agentMemory)**: Nguồn cho kỹ năng agent-memory-mcp.
- **[sstklen/claude-api-cost-optimization](https://github.com/sstklen/claude-api-cost-optimization)**: Tiết kiệm 50-90% chi phí Claude API với các chiến lược tối ưu hóa thông minh (MIT).
### Nguồn cảm hứng
- **[f/awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts)**: Cảm hứng cho Thư viện Prompt.
- **[leonardomso/33-js-concepts](https://github.com/leonardomso/33-js-concepts)**: Cảm hứng cho việc Làm chủ JavaScript.
---
## Giấy phép
Giấy phép MIT. Xem file [LICENSE](LICENSE) để biết chi tiết.
## Cộng đồng
- [Cộng đồng (Community Guidelines)](docs/vietnamese/COMMUNITY_GUIDELINES.vi.md)
- [Chính sách Bảo mật (Security Policy)](docs/vietnamese/SECURITY_GUARDRAILS.vi.md)
---
## Những người đóng góp cho Repo
Chúng tôi chính thức cảm ơn những người đóng góp sau đây đã giúp làm cho repository này trở nên tuyệt vời!
- [mvanhorn](https://github.com/mvanhorn)
- [rookie-ricardo](https://github.com/rookie-ricardo)
- [sck_0](https://github.com/sck_0)
- [Munir Abbasi](https://github.com/munirabbasi)
- [Mohammad Faiz](https://github.com/mohdfaiz2k9)
- [Ianj332](https://github.com/Ianj332)
- [sickn33](https://github.com/sickn33)
- [GuppyTheCat](https://github.com/GuppyTheCat)
- [Tiger-Foxx](https://github.com/Tiger-Foxx)
- [arathiesh](https://github.com/arathiesh)
- [1bcMax](https://github.com/1bcMax)
- [Ahmed Rehan](https://github.com/ar27111994)
- [BenedictKing](https://github.com/BenedictKing)
- [Nguyen Huu Loc](https://github.com/LocNguyenSGU)
- [Owen Wu](https://github.com/yubing744)
- [SuperJMN](https://github.com/SuperJMN)
- [Viktor Ferenczi](https://github.com/viktor-ferenczi)
- [krisnasantosa15](https://github.com/krisnasantosa15)
- [raeef1001](https://github.com/raeef1001)
- [taksrules](https://github.com/taksrules)
- [zebbern](https://github.com/zebbern)
- [Đỗ Khắc Gia Khoa](https://github.com/dokhacgiakhoa)
- [vuth-dogo](https://github.com/vuth-dogo)
## Lịch sử Star
[![Star History Chart](https://api.star-history.com/svg?repos=sickn33/antigravity-awesome-skills&type=date&legend=top-left)](https://www.star-history.com/#sickn33/antigravity-awesome-skills&type=date&legend=top-left)

View File

@@ -0,0 +1,19 @@
# Chính sách Bảo mật (Security Policy)
## Các Phiên bản được Hỗ trợ
Chúng tôi theo dõi nhánh `main`.
## Báo cáo Lỗ hổng
**KHÔNG** mở Issue công khai cho các lỗ hổng bảo mật.
Nếu bạn tìm thấy một lỗ hổng bảo mật (ví dụ: một kỹ năng vượt qua kiểm tra "Sử dụng có Phép" hoặc thực thi mã độc hại mà không cảnh báo):
1. Email: `security@antigravity.dev` (Placeholder)
2. Hoặc mở một **Private Advisory** (Cảnh báo Bảo mật Riêng tư) trên repository này.
## Chính sách Kỹ năng Tấn công (Offensive Skills Policy)
Vui lòng đọc [Rào chắn Bảo mật (Security Guardrails)](docs/vietnamese/SECURITY_GUARDRAILS.vi.md) của chúng tôi.
Tất cả các kỹ năng tấn công (offensive skills) chỉ dành nghiêm ngặt cho **mục đích giáo dục và hoạt động chuyên nghiệp đã được cấp phép**.

View File

@@ -0,0 +1,51 @@
# 🛡️ Chính sách Bảo mật & Rào chắn An toàn (Guardrails)
Antigravity Awesome Skills là một bộ công cụ mạnh mẽ. Và quyền lực lớn luôn đi kèm với trách nhiệm lớn. Tài liệu này xác định **Quy tắc Ứng xử** cho tất cả các khả năng bảo mật và tấn công trong repository này.
## 🔴 Chính sách đối với Skill Tấn công (Vạch kẻ đỏ)
**Skill Tấn công là gì?**
Bất kỳ kỹ năng (skill) nào được thiết kế để xâm nhập, khai thác, làm gián đoạn hoặc mô phỏng tấn công chống lại các hệ thống.
_Ví dụ: Pentesting (Kiểm thử xâm nhập), SQL Injection, Mô phỏng Phishing, Red Teaming._
### 1. Tuyên bố từ chối trách nhiệm "Chỉ dành cho mục đích sử dụng đã được phê duyệt"
Mỗi skill tấn công **BẮT BUỘC** phải bắt đầu bằng tuyên bố từ chối trách nhiệm chính xác như sau trong file `SKILL.md`:
> **⚠️ CHỈ DÀNH CHO MỤC ĐÍCH SỬ DỤNG ĐÃ ĐƯỢC PHÊ DUYỆT**
> Skill này chỉ dành cho mục đích giáo dục hoặc đánh giá bảo mật đã được cấp phép.
> Bạn phải có sự cho phép rõ ràng bằng văn bản từ chủ sở hữu hệ thống trước khi sử dụng công cụ này.
> Việc lạm dụng công cụ này là bất hợp pháp và bị nghiêm cấm hoàn toàn.
### 2. Yêu cầu Xác nhận từ Người dùng
Các skill tấn công **KHÔNG BAO GIỜ** được chạy hoàn toàn tự động một cách tự ý (autonomously).
- **Yêu cầu**: Mô tả hoặc hướng dẫn của skill phải yêu cầu agent (trợ lý AI) *hỏi xác nhận của người dùng* trước khi thực thi bất kỳ lệnh khai thác hoặc tấn công nào.
- **Hướng dẫn cho Agent**: "Yêu cầu người dùng xác minh URL/IP mục tiêu trước khi chạy."
### 3. Thiết kế để An toàn
- **Không chứa mã độc (Weaponized Payloads)**: Các skill không được bao gồm malware hoạt động, ransomware, hoặc các mã khai thác không mang tính giáo dục.
- **Khuyến nghị dùng Sandbox**: Các hướng dẫn nên khuyến nghị chạy trong môi trường cô lập (Docker/VM).
---
## 🔵 Chính sách đối với Skill Phòng thủ
**Skill Phòng thủ là gì?**
Các công cụ dùng để tăng cường bảo mật (hardening), kiểm tra (auditing), giám sát (monitoring), hoặc bảo vệ hệ thống.
_Ví dụ: Linting (Kiểm tra lỗi code), Phân tích Log, Kiểm tra Cấu hình._
- **Quyền riêng tư dữ liệu**: Các kỹ năng phòng thủ không được tải dữ liệu lên các máy chủ bên thứ ba mà không có sự đồng ý rõ ràng của người dùng.
- **Không gây hư tổn (Non-Destructive)**: Các quy trình kiểm tra (audits) nên mặc định ở chế độ chỉ đọc (read-only).
---
## ⚖️ Tuyên bố Pháp lý
Bằng việc sử dụng repository này, bạn đồng ý rằng:
1. Bạn tự chịu trách nhiệm về hành động của mình.
2. Các tác giả và người đóng góp không chịu trách nhiệm cho bất kỳ thiệt hại nào do các công cụ này gây ra.
3. Bạn sẽ tuân thủ tất cả các luật địa phương, tiểu bang và liên bang liên quan đến an ninh mạng.

View File

@@ -0,0 +1,106 @@
# Thư mục Kỹ năng (Skills Directory)
**Chào mừng đến với thư mục Kỹ năng!** Đây là nơi tập hợp tất cả 179+ kỹ năng AI chuyên biệt.
## 🤔 Kỹ năng là gì?
Kỹ năng là các bộ hướng dẫn chuyên biệt dạy trợ lý AI cách xử lý các tác vụ cụ thể. Hãy nghĩ về chúng như các module kiến thức chuyên gia mà AI của bạn có thể tải theo yêu cầu.
**Hình dung đơn giản:** Giống như bạn có thể tham khảo ý kiến các chuyên gia khác nhau (một nhà thiết kế, một chuyên gia bảo mật, một chuyên gia Marketing), các kỹ năng cho phép AI trở thành chuyên gia trong các lĩnh vực khác nhau ngay khi bạn cần.
---
## 📂 Cấu trúc Thư mục
Mỗi kỹ năng nằm trong thư mục riêng với cấu trúc sau:
```
skills/
├── skill-name/ # Thư mục kỹ năng riêng lẻ
│ ├── SKILL.md # Định nghĩa kỹ năng chính (bắt buộc)
│ ├── scripts/ # Scripts hỗ trợ (tùy chọn)
│ ├── examples/ # Ví dụ sử dụng (tùy chọn)
│ └── resources/ # Templates & tài nguyên (tùy chọn)
```
**Lưu ý quan trọng:** Chỉ file `SKILL.md` là bắt buộc. Mọi thứ khác là tùy chọn!
---
## Cách sử dụng Kỹ năng
### Bước 1: Đảm bảo kỹ năng đã được thiết lập
Các file kỹ năng nên nằm trong thư mục `.agent/skills/` của bạn (hoặc `.claude/skills/`, `.gemini/skills/`, v.v.)
### Bước 2: Kích hoạt kỹ năng trong cuộc trò chuyện với AI
Sử dụng biểu tượng `@` theo sau bởi tên kỹ năng:
```
@brainstorming giúp tôi thiết kế một ứng dụng todo
```
hoặc
```
@stripe-integration thêm xử lý thanh toán vào ứng dụng của tôi
```
### Bước 3: AI trở thành chuyên gia
AI tải kiến thức của kỹ năng đó và giúp bạn với chuyên môn đặc thù!
---
## Tìm kiếm Kỹ năng
### Cách 1: Duyệt thư mục này
```bash
ls skills/
```
### Cách 2: Tìm kiếm theo từ khóa
```bash
ls skills/ | grep "từ khóa"
```
### Cách 3: Kiểm tra README chính
Xem [README chính](../README.vi.md) để biết danh sách đầy đủ tất cả 179+ kỹ năng được tổ chức theo danh mục.
---
## 💡 Các Kỹ năng Phổ biến để Thử nghiệm
**Cho người mới bắt đầu:**
- `@brainstorming` - Thiết kế trước khi code
- `@systematic-debugging` - Sửa lỗi một cách có phương pháp
- `@git-pushing` - Commit với thông báo tốt
**Cho lập trình viên:**
- `@test-driven-development` - Viết test trước
- `@react-best-practices` - Các mẫu React hiện đại
- `@senior-fullstack` - Phát triển Full-stack
**Cho bảo mật:**
- `@ethical-hacking-methodology` - Cơ bản về bảo mật
- `@burp-suite-testing` - Kiểm thử bảo mật ứng dụng web
---
## Tạo Kỹ năng Riêng của Bạn
Muốn tạo một kỹ năng mới? Hãy xem:
1. [CONTRIBUTING.vi.md](../docs/vietnamese/CONTRIBUTING.vi.md) - Cách đóng góp
2. [docs/vietnamese/SKILL_ANATOMY.vi.md](../docs/vietnamese/SKILL_ANATOMY.vi.md) - Hướng dẫn cấu trúc kỹ năng
3. `@skill-creator` - Sử dụng kỹ năng này để tạo kỹ năng mới!
---
## Tài liệu Tham khảo
- **[Bắt đầu](../docs/vietnamese/GETTING_STARTED.vi.md)** - Hướng dẫn bắt đầu nhanh
- **[Ví dụ](../docs/vietnamese/EXAMPLES.vi.md)** - Ví dụ sử dụng thực tế
- **[FAQ](../docs/vietnamese/FAQ.vi.md)** - Các câu hỏi thường gặp
- **[Hướng dẫn Trực quan](../docs/vietnamese/VISUAL_GUIDE.vi.md)** - Biểu đồ và lưu đồ
---
**Cần trợ giúp?** Kiểm tra [FAQ](../docs/vietnamese/FAQ.vi.md) hoặc mở một issue trên GitHub!

View File

@@ -0,0 +1,605 @@
# Cấu trúc của một Skill - Hiểu về Hệ thống
**Bạn muốn hiểu cách các skill (kỹ năng) hoạt động bên trong?** Hướng dẫn này sẽ phân tích chi tiết từng phần của một file skill.
---
## 📁 Cấu trúc Thư mục Cơ bản
```
skills/
└── my-skill-name/
├── SKILL.md ← Bắt buộc: Định nghĩa skill chính
├── examples/ ← Tùy chọn: Các file ví dụ
│ ├── example1.js
│ └── example2.py
├── scripts/ ← Tùy chọn: Các script hỗ trợ
│ └── helper.sh
├── templates/ ← Tùy chọn: Các bản mẫu code (templates)
│ └── template.tsx
├── references/ ← Tùy chọn: Tài liệu tham khảo
│ └── api-docs.md
└── README.md ← Tùy chọn: Tài liệu bổ sung
```
**Quy tắc Cốt lõi:** Chỉ có file `SKILL.md` là bắt buộc. Tất cả những thành phần khác đều là tùy chọn!
---
## Cấu trúc file SKILL.md
Mỗi file `SKILL.md` có hai phần chính:
### 1. Frontmatter (Siêu dữ liệu - Metadata)
### 2. Nội dung (Hướng dẫn - Instructions)
Hãy cùng phân tích chi tiết từng phần:
---
## Phần 1: Frontmatter
Frontmatter nằm ở ngay đầu file, được bao bọc bởi cặp `---`:
```markdown
---
name: my-skill-name
description: "Mô tả ngắn gọn về chức năng của skill này"
---
```
### Các trường Bắt buộc
#### `name`
- **Định nghĩa:** Mã định danh của skill.
- **Định dạng:** chữ-thường-có-dấu-gạch-ngang (kebab-case).
- **Yêu cầu:** Phải khớp hoàn toàn với tên thư mục.
- **Ví dụ:** `stripe-integration`
#### `description`
- **Định nghĩa:** Tóm tắt chức năng trong một câu.
- **Định dạng:** Chuỗi ký tự nằm trong dấu ngoặc kép.
- **Độ dài:** Nên dưới 150 ký tự.
- **Ví dụ:** `"Các mẫu tích hợp thanh toán Stripe bao gồm checkout, đăng ký gói (subscriptions) và webhooks"`
### Các trường Tùy chọn
Một số skill bao gồm thêm siêu dữ liệu bổ sung:
```markdown
---
name: my-skill-name
description: "Mô tả ngắn"
risk: "safe" # safe | risk | official
source: "community"
tags: ["react", "typescript"]
---
```
---
## Phần 2: Nội dung
Sau phần frontmatter là nội dung thực tế của skill. Dưới đây là cấu trúc được đề xuất:
### Các mục Đề xuất
#### 1. Tiêu đề (H1)
```markdown
# Tiêu đề Skill
```
- Sử dụng tiêu đề rõ ràng, mang tính mô tả.
- Thường khớp hoặc mở rộng từ tên skill.
#### 2. Tổng quan (Overview)
```markdown
## Tổng quan
Một giải thích ngắn gọn về chức năng của skill và lý do tại sao nó tồn tại.
Khoảng 2-4 câu là lý tưởng.
```
#### 3. Khi nào cần sử dụng (When to Use)
```markdown
## Khi nào nên sử dụng Skill này
- Sử dụng khi bạn cần [tình huống 1]
- Sử dụng khi làm việc với [tình huống 2]
- Sử dụng khi người dùng hỏi về [tình huống 3]
```
**Tại sao điều này quan trọng:** Giúp AI biết khi nào cần kích hoạt skill này.
#### 4. Hướng dẫn Cốt lõi (Core Instructions)
```markdown
## Cách hoạt động
### Bước 1: [Hành động]
Hướng dẫn chi tiết...
### Bước 2: [Hành động]
Hướng dẫn thêm...
```
**Đây là linh hồn của skill** - các bước rõ ràng và có thể thực hiện được.
#### 5. Ví dụ (Examples)
```markdown
## Ví dụ
### Ví dụ 1: [Trường hợp sử dụng]
\`\`\`javascript
// Code ví dụ
\`\`\`
### Ví dụ 2: [Trường hợp sử dụng khác]
\`\`\`javascript
// Thêm code
\`\`\`
```
**Tại sao ví dụ lại quan trọng:** Chúng cho AI thấy chính xác kết quả đầu ra tốt trông như thế nào.
#### 6. Thực hành Tốt nhất (Best Practices)
```markdown
## Thực hành Tốt nhất
- ✅ Nên làm điều này
- ✅ Cũng nên làm điều này
- ❌ Không nên làm điều này
- ❌ Tránh điều này
```
#### 7. Các lỗi thường gặp (Common Pitfalls)
```markdown
## Các lỗi thường gặp
- **Vấn đề:** Mô tả lỗi
**Giải pháp:** Cách khắc phục
```
#### 8. Các Skill liên quan (Related Skills)
```markdown
## Các Skill liên quan
- `@other-skill` - Khi nào nên dùng skill này thay thế
- `@complementary-skill` - Cách các skill này hoạt động cùng nhau
```
---
## Viết Hướng dẫn Hiệu quả
### Sử dụng Ngôn ngữ Rõ ràng, Trực tiếp
**❌ Không tốt:**
```markdown
Bạn có lẽ nên cân nhắc việc kiểm tra xem người dùng đã xác thực hay chưa.
```
**✅ Tốt:**
```markdown
Kiểm tra xem người dùng đã được xác thực chưa trước khi tiếp tục.
```
### Sử dụng Động từ Hành động
**❌ Không tốt:**
```markdown
File nên được tạo ra...
```
**✅ Tốt:**
```markdown
Tạo file...
```
### Cụ thể và Chi tiết
**❌ Không tốt:**
```markdown
Thiết lập cơ sở dữ liệu một cách chính xác.
```
**✅ Tốt:**
```markdown
1. Tạo cơ sở dữ liệu PostgreSQL
2. Chạy migration: `npm run migrate`
3. Nạp dữ liệu ban đầu (seed): `npm run seed`
```
---
## Các Thành phần Tùy chọn
### Thư mục Scripts
Nếu skill của bạn cần các script hỗ trợ:
```
scripts/
├── setup.sh ← Tự động hóa thiết lập
├── validate.py ← Công cụ kiểm tra (validation)
└── generate.js ← Công cụ tạo code (generators)
```
**Tham chiếu chúng trong SKILL.md:**
```markdown
Chạy script thiết lập:
\`\`\`bash
bash scripts/setup.sh
\`\`\`
```
### Thư mục Examples
Các ví dụ thực tế minh họa skill:
```
examples/
├── basic-usage.js
├── advanced-pattern.ts
└── full-implementation/
├── index.js
└── config.json
```
### Thư mục Templates
Các mẫu code có thể tái sử dụng:
```
templates/
├── component.tsx
├── test.spec.ts
└── config.json
```
**Tham chiếu trong SKILL.md:**
```markdown
Sử dụng bản mẫu này làm điểm bắt đầu:
\`\`\`typescript
{{#include templates/component.tsx}}
\`\`\`
```
### Thư mục References
Tài liệu bên ngoài hoặc tham chiếu API:
```
references/
├── api-docs.md
├── best-practices.md
└── troubleshooting.md
```
---
## Hướng dẫn về Quy mô Skill
### Skill Tối giản (Minimum Viable Skill)
- **Frontmatter:** name + description
- **Nội dung:** 100-200 từ
- **Các mục:** Tổng quan + Hướng dẫn
### Skill Tiêu chuẩn (Standard Skill)
- **Frontmatter:** name + description
- **Nội dung:** 300-800 từ
- **Các mục:** Tổng quan + Khi nào sử dụng + Hướng dẫn + Ví dụ
### Skill Toàn diện (Comprehensive Skill)
- **Frontmatter:** name + description + các trường tùy chọn
- **Nội dung:** 800-2000 từ
- **Các mục:** Đầy đủ tất cả các mục đề xuất
- **Bổ sung:** Scripts, ví dụ, templates
**Quy tắc ngón tay cái:** Bắt đầu nhỏ, mở rộng dựa trên phản hồi.
---
## Thực hành Tốt nhất về Định dạng
### Sử dụng Markdown Hiệu quả
#### Khối Code (Code Blocks)
Luôn chỉ định ngôn ngữ:
```markdown
\`\`\`javascript
const example = "code";
\`\`\`
```
#### Danh sách (Lists)
Sử dụng định dạng nhất quán:
```markdown
- Mục 1
- Mục 2
- Mục con 2.1
- Mục con 2.2
```
#### Nhấn mạnh (Emphasis)
- **In đậm** cho các thuật ngữ quan trọng: `**quan trọng**`
- _In nghiêng_ để nhấn mạnh: `*nhấn mạnh*`
- `Code` cho lệnh hoặc code: `` `code` ``
#### Liên kết (Links)
```markdown
[Văn bản liên kết](https://example.com)
```
---
## ✅ Danh mục Kiểm tra Chất lượng (Quality Checklist)
Trước khi hoàn tất skill của bạn:
### Chất lượng Nội dung
- [ ] Hướng dẫn rõ ràng và có thể thực hiện được.
- [ ] Ví dụ thực tế và hữu ích.
- [ ] Không có lỗi chính tả hoặc ngữ pháp.
- [ ] Độ chính xác kỹ thuật đã được xác minh.
### Cấu trúc
- [ ] Frontmatter là YAML hợp lệ.
- [ ] Tên (Name) khớp với tên thư mục.
- [ ] Các phần được sắp xếp logic.
- [ ] Các tiêu đề tuân thủ cấp bậc (H1 → H2 → H3).
### Tính đầy đủ
- [ ] Phần Tổng quan giải thích "tại sao".
- [ ] Hướng dẫn giải thích "làm thế nào".
- [ ] Ví dụ cho thấy "cái gì".
- [ ] Các trường hợp biên (edge cases) được đề cập.
### Khả năng sử dụng
- [ ] Một người mới bắt đầu có thể làm theo.
- [ ] Một chuyên gia thấy nó hữu ích.
- [ ] AI có thể phân tích chính xác.
- [ ] Nó giải quyết một vấn đề thực tế.
---
## 🔍 Phân tích Ví dụ Thực tế
Hãy phân tích một skill thực tế: `brainstorming`
```markdown
---
name: brainstorming
description: "Bạn PHẢI sử dụng skill này trước bất kỳ công việc sáng tạo nào..."
---
```
**Phân tích:**
- ✅ Tên rõ ràng.
- ✅ Mô tả mạnh mẽ với tính cấp bách ("PHẢI sử dụng").
- ✅ Giải thích khi nào nên dùng.
```markdown
# Brainstorming Ý tưởng thành Thiết kế
## Tổng quan
Giúp chuyển đổi ý tưởng thành các thiết kế hoàn chỉnh...
```
**Phân tích:**
- ✅ Tiêu đề rõ ràng.
- ✅ Tổng quan súc tích.
- ✅ Giải thích giá trị mang lại.
```markdown
## Quy trình
**Hiểu ý tưởng:**
- Kiểm tra trạng thái dự án hiện tại trước.
- Đặt câu hỏi từng cái một.
```
**Phân tích:**
- ✅ Được chia thành các giai đoạn rõ ràng.
- ✅ Các bước cụ thể, có thể hành động.
- ✅ Dễ dàng thực hiện theo.
---
## Các Mẫu Nâng cao
### Logic có Điều kiện
```markdown
## Hướng dẫn
Nếu người dùng đang làm việc với React:
- Sử dụng functional components.
- Ưu tiên hooks hơn class components.
Nếu người dùng đang làm việc với Vue:
- Sử dụng Composition API.
- Tuân theo các mẫu của Vue 3.
```
### Tiết lộ Lũy tiến (Progressive Disclosure)
```markdown
## Cách dùng Cơ bản
[Hướng dẫn đơn giản cho các trường hợp phổ biến]
## Cách dùng Nâng cao
[Các mẫu phức tạp cho người dùng chuyên sâu]
```
### Tham chiếu Chéo (Cross-References)
```markdown
## Các Luồng công việc liên quan
1. Đầu tiên, dùng `@brainstorming` để thiết kế.
2. Sau đó, dùng `@writing-plans` để lập kế hoạch.
3. Cuối cùng, dùng `@test-driven-development` để triển khai.
```
---
## Đo lường Hiệu quả của Skill
Cách để biết skill của bạn có tốt hay không:
### Kiểm tra Tính Rõ ràng
- Người không quen thuộc với chủ đề có thể làm theo không?
- Có hướng dẫn nào mơ hồ không?
### Kiểm tra Tính Đầy đủ
- Nó có bao quát trường hợp thuận lợi (happy path) không?
- Nó có xử lý các trường hợp biên không?
- Các kịch bản lỗi đã được giải quyết chưa?
### Kiểm tra Tính Hữu ích
- Nó có giải quyết một vấn đề thực tế không?
- Chính bạn có sử dụng nó không?
- Nó có giúp tiết kiệm thời gian hoặc cải thiện chất lượng không?
---
## Học hỏi từ các Skill hiện có
### Nghiên cứu các Ví dụ sau
**Dành cho Người mới:**
- `skills/brainstorming/SKILL.md` - Cấu trúc rõ ràng.
- `skills/git-pushing/SKILL.md` - Đơn giản và tập trung.
- `skills/copywriting/SKILL.md` - Ví dụ tốt.
**Dành cho Nâng cao:**
- `skills/systematic-debugging/SKILL.md` - Toàn diện.
- `skills/react-best-practices/SKILL.md` - Nhiều file.
- `skills/loki-mode/SKILL.md` - Các luồng công việc phức tạp.
---
## 💡 Mẹo Chuyên nghiệp
1. **Bắt đầu với phần "Khi nào sử dụng"** - Điều này làm rõ mục đích của skill.
2. **Viết ví dụ trước** - Chúng giúp bạn hiểu những gì bạn đang dạy.
3. **Kiểm tra với AI** - Xem liệu nó có thực sự hoạt động trước khi gửi.
4. **Nhận phản hồi** - Nhờ người khác xem qua skill của bạn.
5. **Cải thiện liên tục** - Skill sẽ tốt lên theo thời gian dựa trên việc sử dụng.
---
## Các lỗi Thường gặp cần Tránh
### ❌ Lỗi 1: Quá mơ hồ
```markdown
## Hướng dẫn
Làm cho code tốt hơn.
```
**✅ Khắc phục:**
```markdown
## Hướng dẫn
1. Tách các logic lặp lại thành các hàm.
2. Thêm xử lý lỗi cho các trường hợp biên.
3. Viết unit tests cho các chức năng cốt lõi.
```
### ❌ Lỗi 2: Quá phức tạp
```markdown
## Hướng dẫn
[5000 từ chứa đầy thuật ngữ kỹ thuật dày đặc]
```
**✅ Khắc phục:**
Chia nhỏ thành nhiều skill hoặc sử dụng phương pháp tiết lộ lũy tiến.
### ❌ Lỗi 3: Không có ví dụ
```markdown
## Hướng dẫn
[Hướng dẫn mà không có bất kỳ ví dụ code nào]
```
**✅ Khắc phục:**
Thêm ít nhất 2-3 ví dụ thực tế.
### ❌ Lỗi 4: Thông tin lỗi thời
```markdown
Sử dụng React class components...
```
**✅ Khắc phục:**
Luôn cập nhật skill với các thực hành tốt nhất hiện tại.
---
## 🎯 Các bước Tiếp theo
1. **Đọc 3-5 skill hiện có** để thấy các phong cách khác nhau.
2. **Thử dùng bản mẫu skill** từ file `CONTRIBUTING.md`.
3. **Tạo một skill đơn giản** cho lĩnh vực bạn am hiểu.
4. **Kiểm tra nó** với trợ lý AI của bạn.
5. **Chia sẻ nó** qua Pull Request.
---
**Hãy nhớ rằng:** Mọi chuyên gia đều từng là người mới bắt đầu. Hãy bắt đầu đơn giản, học hỏi từ phản hồi và cải thiện theo thời gian! 🚀

View File

@@ -0,0 +1,21 @@
# 📜 Nguồn gốc & Ghi công
Chúng tôi tin tưởng vào việc ghi nhận công sức một cách xứng đáng.
Nếu bạn nhận ra tác phẩm của mình ở đây mà chưa được ghi công đúng cách, vui lòng mở một Issue (Báo lỗi).
| Kỹ năng / Danh mục | Nguồn gốc | Giấy phép | Ghi chú |
| :-------------------------- | :----------------------------------------------------- | :------------- | :---------------------------- |
| `cloud-penetration-testing` | [HackTricks](https://book.hacktricks.xyz/) | MIT / CC-BY-SA | Được chuyển đổi cho trợ lý AI.|
| `active-directory-attacks` | [HackTricks](https://book.hacktricks.xyz/) | MIT / CC-BY-SA | Được chuyển đổi cho trợ lý AI.|
| `owasp-top-10` | [OWASP](https://owasp.org/) | CC-BY-SA | Chuyển đổi từ phương pháp gốc.|
| `burp-suite-testing` | [PortSwigger](https://portswigger.net/burp) | Không có | Chỉ là hướng dẫn sử dụng. |
| `crewai` | [CrewAI](https://github.com/joaomdmoura/crewAI) | MIT | Hướng dẫn về framework. |
| `langgraph` | [LangGraph](https://github.com/langchain-ai/langgraph) | MIT | Hướng dẫn về framework. |
| `react-patterns` | [React Docs](https://react.dev/) | CC-BY | Các mẫu thiết kế chính thức. |
| **Tất cả Skill Chính thức** | [Anthropic / Google / OpenAI] | Bản quyền riêng| Được khuyến khích bởi nhà CC. |
## Chính sách Giấy phép
- **Mã nguồn (Code)**: Tất cả mã nguồn gốc trong repository này tuân theo giấy phép **MIT**.
- **Nội dung (Content)**: Tài liệu hướng dẫn tuân theo giấy phép **CC-BY-4.0**.
- **Bên thứ ba**: Chúng tôi tôn trọng giấy phép từ phía nguồn gốc của các tài liệu. Nếu một kỹ năng được nhập về có giấy phép GPL, nó sẽ được đánh dấu rõ ràng hoặc bị loại trừ (chúng tôi hướng tới sự tương thích với MIT/Apache).

View File

@@ -0,0 +1,65 @@
# 🗺️ Kế hoạch Dịch thuật (Translation Master Plan)
Tài liệu này dùng để theo dõi tiến độ dịch thuật toàn bộ repository `antigravity-awesome-skills` sang tiếng Việt.
**Mục tiêu:** Dịch toàn bộ 560+ kỹ năng và tài liệu hướng dẫn.
**Quy tắc:**
1. Giữ nguyên cấu trúc thư mục gốc.
2. File dịch được lưu tại `docs/vietnamese/skills/<category>/<skill-name>.vi.md`.
3. Sử dụng văn phong chuyên nghiệp, dễ hiểu cho lập trình viên Việt Nam.
---
## 📊 Tổng quan Tiến độ
- [x] **Giai đoạn 0: Thiết lập & Core Docs** (README, CONTRIBUTING, v.v.)
- [x] **Giai đoạn 1: Essentials Bundle** (Các kỹ năng cốt lõi)
- [ ] **Giai đoạn 2: Development & Security** (Kỹ năng lập trình & bảo mật)
- [ ] **Giai đoạn 3: Data & AI, Infrastructure** (Dữ liệu, AI và Hạ tầng)
- [ ] **Giai đoạn 4: Architecture & General** (Kiến trúc & Các kỹ năng chung)
- [ ] **Giai đoạn 5: Business, Testing & Workflow** (Kinh doanh, Kiểm thử & Quy trình)
---
## ✅ Chi tiết Công việc
### 🟢 Giai đoạn 0: Tài liệu Gốc (Core Documentation)
- [x] `README.vi.md`
- [x] `docs/vietnamese/BUNDLES.vi.md`
- [x] `docs/vietnamese/CONTRIBUTING.vi.md`
- [x] `docs/vietnamese/EXAMPLES.vi.md`
- [x] `docs/vietnamese/FAQ.vi.md`
- [x] `docs/vietnamese/GETTING_STARTED.vi.md`
- [x] `docs/vietnamese/QUALITY_BAR.vi.md`
- [x] `docs/vietnamese/SECURITY_GUARDRAILS.vi.md`
- [x] `docs/vietnamese/SKILL_ANATOMY.vi.md`
- [x] `docs/vietnamese/SOURCES.vi.md`
- [x] `docs/vietnamese/VISUAL_GUIDE.vi.md`
- [x] `docs/vietnamese/SECURITY.vi.md`
- [x] `docs/vietnamese/SKILLS_README.vi.md`
### 🟢 Giai đoạn 1: Essentials Bundle (Core Skills)
> **TRẠNG THÁI: GIỮ NGUYÊN TIẾNG ANH (KEPT IN ENGLISH)**
> *Lý do: Các file Skill đóng vai trò là System Prompts cho AI Agent. Việc dịch sang tiếng Việt có thể làm giảm hiệu suất và độ chính xác của Agent.*
### 🟡 Giai đoạn 2 - 5: All Other Skills
> **TRẠNG THÁI: GIỮ NGUYÊN TIẾNG ANH (KEPT IN ENGLISH)**
> *Lý do: Tương tự như trên, giữ nguyên bản gốc để đảm bảo tính tương thích tốt nhất với các mô hình AI.*
---
## 🎯 Kết luận
- **Phần dành cho Con người (Human-facing Docs):** Đã dịch hoàn tất (`README`, `DOCS`, v.v.).
- **Phần dành cho AI (Agent Skills):** Giữ nguyên Tiếng Anh.
Dự án đã đạt trạng thái sẵn sàng sử dụng cho người dùng Việt Nam (với tài liệu hướng dẫn tiếng Việt) mà vẫn đảm bảo sức mạnh cốt lõi của Agent (với Skills tiếng Anh).
---
## 📝 Nhật ký Thay đổi (Changelog)
- **2026-01-29**:
- Hoàn thành Giai đoạn 0 (Docs).
- Hoàn thành Giai đoạn 1 (Essentials).
- Cấu trúc lại repo: Chuyển toàn bộ bản dịch vào `docs/vietnamese/`.

View File

@@ -1,135 +1,134 @@
# Hướng Dẫn Nhanh Bằng Hình nh (Visual Quick Start)
# Hướng dẫn Nhanh bằng Hình nh (Visual Guide)
**Trăm nghe không bằng một thấy!** Hướng dẫn này sử dụng sơ đồ và ví dụ trực quan để giúp bạn hiểu cách hoạt động của Skills.
**Học qua hình ảnh!** Hướng dẫn này sử dụng các sơ đồ và ví dụ trực quan để giúp bạn hiểu về các kỹ năng (skills).
---
## Bức Tranh Toàn Cảnh
## Cái nhìn Tổng quan
```
┌─────────────────────────────────────────────────────────────┐
│ BẠN (Lập trình viên)
BẠN (Lập trình viên) │
│ ↓ │
│ "Giúp tôi xây dựng hệ thống thanh toán nhé"
"Giúp tôi xây dựng hệ thống thanh toán"
│ ↓ │
1├─────────────────────────────────────────────────────────────┤
TRỢ LÝ AI
├─────────────────────────────────────────────────────────────┤
│ TRỢ LÝ AI (AI ASSISTANT)
│ ↓ │
Nạp skill @stripe-integration
Tải kỹ năng @stripe-integration │
│ ↓ │
Trở thành chuyên gia thanh toán Stripe │
│ ↓ │
│ Cung cấp hướng dẫn chuyên sâu kèm code mẫu │
│ Trở thành chuyên gia về thanh toán Stripe │
│ ↓ │
│ Cung cấp hỗ trợ chuyên sâu kèm các ví dụ code │
└─────────────────────────────────────────────────────────────┘
```
---
## 📦 Cấu trúc Thư mục (Trực quan)
## 📦 Cấu trúc Repository (Trực quan)
```
antigravity-awesome-skills/
├── 📄 README.vi.md ← Tổng quan & Danh sách (Bắt đầu ở đây)
├── 📄 GETTING_STARTED.vi.md ← Hướng dẫn nhập môn
├── 📄 CONTRIBUTING.vi.md ← Hướng dẫn đóng góp
├── 📄 FAQ.vi.md ← Câu hỏi thường gặp
├── 📄 README.md ← Tổng quan & danh sách skill
├── 📄 CONTRIBUTING.md ← Cách thức đóng góp
├── 📁 skills/ ← Hơn 250 skill nằm ở đây
├── 📁 skills/ ← Nơi chứa tất cả hơn 250 skills
│ │
│ ├── 📁 brainstorming/
│ │ └── 📄 SKILL.md ← Định nghĩa Skill
│ │ └── 📄 SKILL.md ← Định nghĩa skill
│ │
│ ├── 📁 stripe-integration/
│ │ ├── 📄 SKILL.md
│ │ └── 📁 examples/ ← Các ví dụ đi kèm
│ │ └── 📁 examples/ ← Các phần bổ sung tùy chọn
│ │
│ └── ... (250+ skill khác)
│ └── ... (Hơn 250 skills khác)
├── 📁 scripts/ ← Các công cụ quản lý
│ ├── validate_skills.py ← Trình kiểm tra chất lượng
│ └── generate_index.py ← Trình tạo mục lục
├── 📁 scripts/ ← Quản lý & Xác thực
│ ├── validate_skills.py ← Công cụ kiểm soát chất lượng
│ └── generate_index.py ← Công cụ tạo danh mục (registry)
├── 📁 .github/
│ └── 📄 MAINTENANCE.md ← Hướng dẫn bảo trì
│ └── 📄 MAINTENANCE.md ← Hướng dẫn cho người duy trì
└── 📁 docs/ ← Tài liệu
├── 📄 BUNDLES.vi.md ← Gói khởi điểm (Starter Packs)
└── 📁 docs/ ← Tài liệu hướng dẫn
├── 📄 GETTING_STARTED.md ← Bắt đầu tại đây! (MỚI)
├── 📄 FAQ.md ← Giải đáp thắc mắc
├── 📄 BUNDLES.md ← Gói khởi đầu (MỚI)
├── 📄 QUALITY_BAR.md ← Tiêu chuẩn chất lượng
├── 📄 SKILL_ANATOMY.md ← Cấu tạo của một skill
└── 📄 VISUAL_GUIDE.vi.md ← Chính là file này!
├── 📄 SKILL_ANATOMY.md ← Cách thức skill hoạt động
└── 📄 VISUAL_GUIDE.md ← Chính là file này!
```
---
## Cách Skill hoạt động (Sơ đồ luồng)
## Cách Skills Hoạt động (Sơ đồ Luồng)
```
┌──────────────┐
│ 1. CÀI ĐẶT │ Copy skills vào thư mục .agent/skills/
│ 1. CÀI ĐẶT │ Sao chép skills vào .agent/skills/
1 └──────┬───────┘
┌──────────────┐
│ 2. GỌI LỆNH │ Gõ: @ten-skill trong chat với AI
└──────┬───────┘
┌──────────────┐
2. RA LỆNH │ Gõ: @ten-skill trong khung chat với AI
3. TẢI DỮ LIỆU│ AI đọc file SKILL.md
└──────┬───────┘
┌──────────────┐
3. NẠP │ AI đọc nội dung file SKILL.md
4. THỰC THI │ AI tuân theo hướng dẫn trong skill
└──────┬───────┘
┌──────────────┐
4. THỰC THI │ AI làm theo hướng dẫn trong skill
└──────┬───────┘
┌──────────────┐
│ 5. KẾT QUẢ │ Bạn nhận được sự hỗ trợ chuyên sâu!
5. KẾT QUẢ │ Bạn nhận được hỗ trợ chuyên sâu!
└──────────────┘
```
---
## 🎯 Phân loại Skill (Bản đồ tư duy)
## 🎯 Phân loại Skills (Bản đồ Trực quan)
```
┌─────────────────────────┐
│ 250+ SKILL TUYỆT ĐỈNH
│ 250+ AWESOME SKILLS
└────────────┬────────────┘
┌────────────────────────┼────────────────────────┐
│ │ │
┌────▼────┐ ┌──────▼──────┐ ┌──────▼──────┐
│ SÁNG TẠO│ │ PHÁT TRIỂN │ │ BẢO MẬT │
│ SÁNG TẠO│ │ PHÁT TRIỂN │ │ BẢO MẬT
│ (10) │ │ (25) │ │ (50) │
└────┬────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
• Thiết kế UI/UX • TDD (Test) • Ethical Hacking
• Thiết kế UI/UX • TDD • Hacking Đạo đức
• Nghệ thuật Canvas • Debugging • Metasploit
Tạo Theme • React Patterns • Burp Suite
Giao diện/Themes • Mẫu thiết kế React • Burp Suite
• SQLMap
│ │ │
└────────────────────────┼────────────────────────┘
│ │ │
└────────────────────────┼────────────────────────┘
┌────────────────────────┼────────────────────────┐
│ │ │
┌────▼────┐ ┌──────▼──────┐ ┌──────▼──────┐
│ AI │ │ TÀI LIỆU │ │ MARKETING │
│ AI │ │ TÀI LIỆU │ │ MARKETING │
│ (30) │ │ (4) │ │ (23) │
└────┬────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
• Hệ thống RAG • DOCX • SEO
• LangGraph • PDF • Viết quảng cáo
• LangGraph • PDF • Copywriting
• Prompt Eng. • PPTX • CRO
• Voice Agents • XLSX • Chạy Ads
• Voice Agents • XLSX • Quảng cáo trả phí
```
---
## Giải phẫu một Skill
## Cấu trúc File Skill (Trực quan)
````
┌─────────────────────────────────────────────────────────┐
@@ -137,33 +136,33 @@ antigravity-awesome-skills/
├─────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────┐ │
│ │ FRONTMATTER (Metadata - Dữ liệu mô tả) │ │
│ │ FRONTMATTER (Siêu dữ liệu) │ │
│ │ ───────────────────────────────────────────── │ │
│ │ --- │ │
│ │ name: my-skill │ │
│ │ description: "Skill này làm cái gì" │ │
│ │ description: "Công dụng của skill này" │ │
│ │ --- │ │
│ └───────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────┐ │
│ │ CONTENT (Nội dung hướng dẫn) │ │
│ │ NỘI DUNG (Hướng dẫn) │ │
│ │ ───────────────────────────────────────────── │ │
│ │ │ │
│ │ # Tên Skill │ │
│ │ # Tiêu đề Skill │ │
│ │ │ │
│ │ ## Tổng quan │ │
│ │ Skill này giúp bạn... │ │
│ │ Skill này làm gì... │ │
│ │ │ │
│ │ ## Khi nào dùng │ │
│ │ - ng khi... │ │
│ │ ## Khi nào nên dùng │ │
│ │ - Sử dụng khi... │ │
│ │ │ │
│ │ ## Hướng dẫn │ │
│ │ 1. Bước một... │ │
│ │ 2. Bước hai... │ │
│ │ 1. Bước đầu tiên... │ │
│ │ 2. Bước thứ hai... │ │
│ │ │ │
│ │ ## Ví dụ │ │
│ │ ```javascript │ │
│ │ // Code mẫu │ │
│ │ // Code ví dụ │ │
│ │ ``` │ │
│ │ │ │
│ └───────────────────────────────────────────────┘ │
@@ -173,35 +172,35 @@ antigravity-awesome-skills/
---
## Quy trình cài đặt (Các bước trực quan)
## Cài đặt (Các bước Trực quan)
### Bước 1: Clone Repo về máy
### Bước 1: Sao chép Repository
```
┌─────────────────────────────────────────┐
│ Terminal (Dòng lệnh)
│ Terminal
├─────────────────────────────────────────┤
│ $ git clone https://github.com/ │
│ sickn33/antigravity-awesome-skills │
│ .agent/skills │
│ │
│ ✓ Cloning into '.agent/skills'...
│ ✓ Done!
1└─────────────────────────────────────────┘
│ ✓ Đang sao chép vào '.agent/skills'... │
│ ✓ Hoàn tất!
└─────────────────────────────────────────┘
```
### Bước 2: Kiểm tra cài đặt
### Bước 2: Xác minh Cài đặt
```
┌─────────────────────────────────────────┐
│ File Explorer (Quản lý file)
│ File Explorer
├─────────────────────────────────────────┤
│ 📁 .agent/ │
│ └── 📁 skills/ │
│ ├── 📁 brainstorming/ │
│ ├── 📁 stripe-integration/ │
│ ├── 📁 react-best-practices/ │
│ └── ... (250+ cái nữa)
│ └── ... (Thêm 176 mục nữa) │
└─────────────────────────────────────────┘
```
@@ -212,124 +211,125 @@ antigravity-awesome-skills/
│ AI Assistant Chat │
├─────────────────────────────────────────┤
│ Bạn: @brainstorming giúp tôi thiết kế │
│ một cái app to-do list
│ một ứng dụng todo
│ │
│ AI: Tuyệt! Để tôi giúp bạn suy nghĩ.
Trước tiên, hãy xác định yêu cầu.
│ AI: Tuyệt vời! Hãy để tôi giúp bạn suy │
nghĩ kỹ về việc này. Đầu tiên, hãy
│ tìm hiểu các yêu cầu của bạn... │
│ │
│ Mục đích chính là gì?
│ a) Quản lý việc cá nhân
│ b) Cộng tác nhóm │
│ Mục đích sử dụng chính là gì? │
│ a) Quản lý công việc cá nhân │
│ b) Hợp tác nhóm
│ c) Lập kế hoạch dự án │
└─────────────────────────────────────────┘
```
---
## Ví dụ: Một phiên làm việc thực tế
## Ví dụ: Sử dụng Skill (Từng bước)
### Tình huống: Bạn muốn tích hợp thanh toán Stripe
### Tình huống: Bạn muốn thêm thanh toán Stripe vào ứng dụng của mình
```
┌─────────────────────────────────────────────────────────────┐
│ BƯỚC 1: Xác định nhu cầu │
│ BƯỚC 1: Xác định Nhu cầu │
├─────────────────────────────────────────────────────────────┤
│ "Tôi cần thêm tính năng thanh toán vào app"
│ "Tôi cần thêm xử lý thanh toán vào ứng dụng của mình"
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ BƯỚC 2: Tìm Skill phù hợp
│ BƯỚC 2: Tìm đúng Skill
├─────────────────────────────────────────────────────────────┤
│ Tìm kiếm: "payment" hoặc "stripe" │
│ Tìm thấy: @stripe-integration │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ BƯỚC 3: Gọi Skill
│ BƯỚC 3: Gọi lệnh Skill │
├─────────────────────────────────────────────────────────────┤
│ Bạn: @stripe-integration giúp tôi thêm tính năng gói subs
│ Bạn: @stripe-integration giúp tôi thêm thanh toán định kỳ
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ BƯỚC 4: AI nạp kiến thức
│ BƯỚC 4: AI Tải Kiến thức của Skill
├─────────────────────────────────────────────────────────────┤
│ • Các pattern API của Stripe
│ • Các mẫu Stripe API
│ • Xử lý Webhook │
│ • Quản lý gói đăng ký (Subscription) │
│ • Các bài thực hành tốt nhất (Best practices)
│ • Thực hành tốt nhất
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ BƯỚC 5: Nhận hỗ trợ chuyên gia │
│ BƯỚC 5: Nhận Hỗ trợ Chuyên gia │
├─────────────────────────────────────────────────────────────┤
│ AI cung cấp: │
│ • Code mẫu
│ • Hướng dẫn cài đặt
│ • Lưu ý bảo mật
│ • Chiến lược kiểm thử (Testing)
│ • Các ví dụ code
│ • Hướng dẫn thiết lập
│ • Các lưu ý về bảo mật │
│ • Chiến lược kiểm thử
└─────────────────────────────────────────────────────────────┘
```
---
## Cách tìm kiếm Skill (Hướng dẫn hình ảnh)
## Tìm kiếm Skills (Hướng dẫn Trực quan)
### Cách 1: Duyệt theo Danh mục
```
README.vi.md → Cuộn xuống "Danh sách Skill đầy đủ" → Tìm nhóm → Chọn skill
README.md → Cuộn xuống "Full Skill Registry" → Tìm danh mục → Chọn skill
```
### Cách 2: Tìm theo từ khóa
### Cách 2: Tìm theo Từ khóa
```
Terminal → ls skills/ | grep "từ-khóa" → Thấy các skill khớp
Terminal → ls skills/ | grep "từ-khóa" → Xem các skill khớp
```
### Cách 3: Dùng file Index
### Cách 3: Sử dụng Index
```
Mở skills_index.json → Ctrl+F tìm từ khóa → Lấy đường dẫn skill
Mở file skills_index.json → Tìm từ khóa → Tìm đường dẫn đến skill
```
---
## Quy trình tạo Skill đầu tay của bạn
## Tạo Skill đầu tiên của bạn (Quy trình Trực quan)
```
┌──────────────┐
│ 1. Ý TƯỞNG │ "Tôi muốn chia sẻ kiến thức Docker của mình"
│ 1. Ý TƯỞNG │ "Tôi muốn chia sẻ kiến thức về Docker"
└──────┬───────┘
┌──────────────┐
│ 2. TẠO FOLDER│ mkdir skills/docker-mastery
│ 2. KHỞI TẠO │ mkdir skills/docker-mastery
└──────┬───────┘ touch skills/docker-mastery/SKILL.md
┌──────────────┐
│ 3. VIẾT │ Thêm frontmatter + nội dung
└──────┬───────┘ (Dùng mẫu trong CONTRIBUTING.vi.md)
└──────┬───────┘ (Dùng template từ CONTRIBUTING.vi.md)
┌──────────────┐
│ 4. THỬ │ Copy vào .agent/skills/
└──────┬───────┘ Thử gọi: @docker-mastery
│ 4. KIỂM THỬ │ Sao chép vào .agent/skills/
└──────┬───────┘ Thử: @docker-mastery
┌──────────────┐
│ 5. KIỂM TRA │ python3 scripts/validate_skills.py
│ 5. XÁC THỰC │ python3 scripts/validate_skills.py
└──────┬───────┘
┌──────────────┐
│ 6. NỘP BÀI │ git commit + push + Pull Request
│ 6. GỬI ĐI │ git commit + push + Pull Request
└──────────────┘
```
---
## Các cấp độ phức tạp của Skill
## Các Cấp độ Phức tạp của Skill
```
┌─────────────────────────────────────────────────────────────┐
@@ -339,48 +339,48 @@ Mở skills_index.json → Ctrl+F tìm từ khóa → Lấy đường dẫn skil
│ ĐƠN GIẢN TIÊU CHUẨN PHỨC TẠP │
│ ──────── ────────── ──────── │
│ │
│ • 1 file • 1 file • Nhiều file
│ • 100-200 từ • 300-800 từ • 800-2000 │
│ • Cấu trúc cơ bản • Cấu trúc đầy đủ • Scripts
│ • Không phụ kiện • Có ví dụ • Có ví dụ │
│ • Best practices • Template
│ • Docs
│ Ví dụ: Ví dụ: Ví dụ: │
│ git-pushing brainstorming loki-mode │
│ • 1 file • 1 file • Nhiều file
│ • 100-200 từ • 300-800 từ • 800-2000 từ
│ • Cấu trúc cơ bản • Cấu trúc đầy đủ • Có scripts │
│ • Không có phần phụ • Có ví dụ • Có ví dụ
│ • Thực hành tốt nhất • Có template│
│ • Có tài liệu
│ Ví dụ: Ví dụ: Ví dụ:
│ git-pushing brainstorming loki-mode
│ │
└─────────────────────────────────────────────────────────────┘
```
---
## Tác động của việc Đóng góp (Quy trình nhân qu)
## 🎯 Tác động của việc Đóng góp (Trực quan)
```
Đóng góp của BẠN
Sự đóng góp của bạn
├─→ Cải thiện Tài liệu
├─→ Cải thiện tài liệu hướng dẫn
│ │
│ └─→ Giúp hàng ngàn lập trình viên đỡ bỡ ngỡ
│ └─→ Giúp hàng ngàn dev dễ hiểu hơn
├─→ Tạo Skill mới
├─→ Tạo ra Skill mới
│ │
│ └─→ Mở ra khả năng mới cho mọi người
│ └─→ Mang lại khả năng mới cho mọi người
├─→ Sửa lỗi (Bug/Typo)
├─→ Sửa lỗi/Lỗi chính tả
│ │
│ └─→ Tránh nhầm lẫn cho người sau
│ └─→ Tránh hiểu lầm cho người dùng tương lai
└─→ Thêm ví dụ
└─→ Giúp người mới học nhanh hơn
└─→ Giúp người mới học dễ dàng hơn
```
---
## Lộ trình học tập (Roadmap trực quan)
## Lộ trình Học tập (Roadmap Trực quan)
```
BẮT ĐẦU ĐÂY
BẮT ĐẦU TẠI ĐÂY
┌─────────────────┐
@@ -390,8 +390,8 @@ BẮT ĐẦU Ở ĐÂY
┌─────────────────┐
│ Thử 2-3 Skill
│ với AI Assistant
│ Thử dùng 2-3 Skill│
│ với Trợ lý AI
└────────┬────────┘
@@ -402,13 +402,13 @@ BẮT ĐẦU Ở ĐÂY
┌─────────────────┐
│ Nghiên cứu code
của Skill có sẵn
│ Nghiên cứu
│ Skills hiện
└────────┬────────┘
┌─────────────────┐
│ Tạo một Skill │
│ Tạo Skill
│ đơn giản │
└────────┬────────┘
@@ -420,67 +420,93 @@ BẮT ĐẦU Ở ĐÂY
┌─────────────────┐
│ Gửi PR (Nộp bài)
│ Gửi PR
└────────┬────────┘
CONTRIBUTOR! 🎉
TRỞ THÀNH CONTRIBUTOR! 🎉
```
---
## Mẹo nhanh (Cheatsheet)
## 💡 Mẹo Nhanh (Bản ghi chú Trực quan)
```
┌─────────────────────────────────────────────────────────────┐
TRA CỨU NHANH
THAM KHẢO NHANH │
├─────────────────────────────────────────────────────────────┤
│ │
│ 📥 CÀI ĐẶT │
│ git clone [repo] .agent/skills │
│ │
│ 🎯 DÙNG
│ 🎯 SỬ DỤNG
@ten-skill [yêu cầu của bạn] │
│ │
│ 🔍 TÌM
│ 🔍 TÌM KIẾM
│ ls skills/ | grep "từ-khóa" │
│ │
│ ✅ KIỂM TRA
│ ✅ XÁC THỰC
│ python3 scripts/validate_skills.py │
│ │
│ 📝 TẠO
│ 1. mkdir skills/ten-skill
│ 2. Tạo SKILL.md frontmatter
│ 3. Viết nội dung │
│ 4. Test & validate
│ 5. Gửi PR
│ 📝 TẠO SKILL
│ 1. mkdir skills/ten-skill-cua-ban
│ 2. Tạo SKILL.md với frontmatter │
│ 3. Thêm nội dung │
│ 4. Thử nghiệm & xác thực
│ 5. Gửi Pull Request (PR)
│ │
│ 🆘 TRỢ GIÚP │
│ • GETTING_STARTED.vi.md - Cơ bản
│ • CONTRIBUTING.vi.md - Cách đóng góp │
│ • SKILL_ANATOMY.md - Chuyên sâu
│ • GitHub Issues - Hỏi đáp
│ • docs/GETTING_STARTED.md - Cơ bản │
│ • CONTRIBUTING.md - Cách đóng góp
│ • SKILL_ANATOMY.md - Tìm hiểu sâu │
│ • GitHub Issues - Đặt câu hỏi
│ │
└─────────────────────────────────────────────────────────────┘
```
---
## Bước tiếp theo
## Câu chuyện Thành công (Dòng thời gian Trực quan)
1. ✅ **Hiểu** cấu trúc qua hình ảnh
2. ✅ **Cài đặt** skills vào công cụ AI của bạn
3. ✅ **Thử** 2-3 skill thuộc các nhóm khác nhau
4. ✅ **Đọc** CONTRIBUTING.vi.md
5. ✅ **Tạo** skill đầu tay
6. ✅ **Chia sẻ** với cộng đồng
```
Ngày 1: Cài đặt skills
└─→ "Oa, @brainstorming đã giúp mình thiết kế ứng dụng!"
Ngày 3: Dùng 5 skills khác nhau
└─→ "Những kỹ năng này giúp mình tiết kiệm bao nhiêu thời gian!"
Tuần 1: Tạo skill đầu tiên
└─→ "Mình đã chia sẻ kiến thức của mình dưới dạng một skill!"
Tuần 2: Skill được gộp (merge) vào máy chủ
└─→ "Kỹ năng của mình đang giúp đỡ người khác! 🎉"
Tháng 1: Trở thành người đóng góp thường xuyên
└─→ "Mình đã đóng góp 5 skills và cải thiện rất nhiều tài liệu!"
```
---
**Bạn học qua hình ảnh tốt hơn?** Hy vọng hướng dẫn này giúp ích! Nếu còn thắc mắc, hãy xem thêm:
## Các Bước Tiếp theo
- [GETTING_STARTED.vi.md](../GETTING_STARTED.vi.md) - Hướng dẫn dạng chữ
- [SKILL_ANATOMY.md](SKILL_ANATOMY.md) - Phân tích chi tiết (Tiếng Anh)
- [CONTRIBUTING.vi.md](../CONTRIBUTING.vi.md) - Cách đóng góp
1. ✅ **Hiểu** cấu trúc trực quan.
2. ✅ **Cài đặt** skills vào công cụ AI của bạn.
3. ✅ **Thử dùng** 2-3 skills từ các danh mục khác nhau.
4. ✅ **Đọc** file CONTRIBUTING.md.
5. ✅ **Tạo** skill đầu tiên của bạn.
6. ✅ **Chia sẻ** với cộng đồng.
**Sẵn sàng đóng góp chưa?** Triển khai thôi! 💪
---
**Bạn là người học qua hình ảnh?** Hy vọng hướng dẫn này sẽ giúp ích! Bạn vẫn còn thắc mắc? Hãy kiểm tra:
- [GETTING_STARTED.md](GETTING_STARTED.vi.md) - Giới thiệu bằng văn bản.
- [SKILL_ANATOMY.md](SKILL_ANATOMY.vi.md) - Phân tích chi tiết.
- [CONTRIBUTING.md](../CONTRIBUTING.vi.md) - Cách thức đóng góp.
**Sẵn sàng đóng góp?** Bạn làm được mà! 💪

1
node_modules/.bin/yaml generated vendored
View File

@@ -1 +0,0 @@
../yaml/bin.mjs

13
node_modules/yaml/LICENSE generated vendored
View File

@@ -1,13 +0,0 @@
Copyright Eemeli Aro <eemeli@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.

172
node_modules/yaml/README.md generated vendored
View File

@@ -1,172 +0,0 @@
# YAML <a href="https://www.npmjs.com/package/yaml"><img align="right" src="https://badge.fury.io/js/yaml.svg" title="npm package" /></a>
`yaml` is a definitive library for [YAML](https://yaml.org/), the human friendly data serialization standard.
This library:
- Supports both YAML 1.1 and YAML 1.2 and all common data schemas,
- Passes all of the [yaml-test-suite](https://github.com/yaml/yaml-test-suite) tests,
- Can accept any string as input without throwing, parsing as much YAML out of it as it can, and
- Supports parsing, modifying, and writing YAML comments and blank lines.
The library is released under the ISC open source license, and the code is [available on GitHub](https://github.com/eemeli/yaml/).
It has no external dependencies and runs on Node.js as well as modern browsers.
For the purposes of versioning, any changes that break any of the documented endpoints or APIs will be considered semver-major breaking changes.
Undocumented library internals may change between minor versions, and previous APIs may be deprecated (but not removed).
The minimum supported TypeScript version of the included typings is 3.9;
for use in earlier versions you may need to set `skipLibCheck: true` in your config.
This requirement may be updated between minor versions of the library.
For more information, see the project's documentation site: [**eemeli.org/yaml**](https://eemeli.org/yaml/)
For build instructions and contribution guidelines, see [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md).
To install:
```sh
npm install yaml
# or
deno add jsr:@eemeli/yaml
```
**Note:** These docs are for `yaml@2`. For v1, see the [v1.10.0 tag](https://github.com/eemeli/yaml/tree/v1.10.0) for the source and [eemeli.org/yaml/v1](https://eemeli.org/yaml/v1/) for the documentation.
## API Overview
The API provided by `yaml` has three layers, depending on how deep you need to go: [Parse & Stringify](https://eemeli.org/yaml/#parse-amp-stringify), [Documents](https://eemeli.org/yaml/#documents), and the underlying [Lexer/Parser/Composer](https://eemeli.org/yaml/#parsing-yaml).
The first has the simplest API and "just works", the second gets you all the bells and whistles supported by the library along with a decent [AST](https://eemeli.org/yaml/#content-nodes), and the third lets you get progressively closer to YAML source, if that's your thing.
A [command-line tool](https://eemeli.org/yaml/#command-line-tool) is also included.
### Parse & Stringify
```js
import { parse, stringify } from 'yaml'
```
- [`parse(str, reviver?, options?): value`](https://eemeli.org/yaml/#yaml-parse)
- [`stringify(value, replacer?, options?): string`](https://eemeli.org/yaml/#yaml-stringify)
### Documents
<!-- prettier-ignore -->
```js
import {
Document,
isDocument,
parseAllDocuments,
parseDocument
} from 'yaml'
```
- [`Document`](https://eemeli.org/yaml/#documents)
- [`constructor(value, replacer?, options?)`](https://eemeli.org/yaml/#creating-documents)
- [`#contents`](https://eemeli.org/yaml/#content-nodes)
- [`#directives`](https://eemeli.org/yaml/#stream-directives)
- [`#errors`](https://eemeli.org/yaml/#errors)
- [`#warnings`](https://eemeli.org/yaml/#errors)
- [`isDocument(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
- [`parseAllDocuments(str, options?): Document[]`](https://eemeli.org/yaml/#parsing-documents)
- [`parseDocument(str, options?): Document`](https://eemeli.org/yaml/#parsing-documents)
### Content Nodes
<!-- prettier-ignore -->
```js
import {
isAlias, isCollection, isMap, isNode,
isPair, isScalar, isSeq, Scalar,
visit, visitAsync, YAMLMap, YAMLSeq
} from 'yaml'
```
- [`isAlias(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
- [`isCollection(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
- [`isMap(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
- [`isNode(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
- [`isPair(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
- [`isScalar(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
- [`isSeq(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
- [`new Scalar(value)`](https://eemeli.org/yaml/#scalar-values)
- [`new YAMLMap()`](https://eemeli.org/yaml/#collections)
- [`new YAMLSeq()`](https://eemeli.org/yaml/#collections)
- [`doc.createAlias(node, name?): Alias`](https://eemeli.org/yaml/#creating-nodes)
- [`doc.createNode(value, options?): Node`](https://eemeli.org/yaml/#creating-nodes)
- [`doc.createPair(key, value): Pair`](https://eemeli.org/yaml/#creating-nodes)
- [`visit(node, visitor)`](https://eemeli.org/yaml/#finding-and-modifying-nodes)
- [`visitAsync(node, visitor)`](https://eemeli.org/yaml/#finding-and-modifying-nodes)
### Parsing YAML
```js
import { Composer, Lexer, Parser } from 'yaml'
```
- [`new Lexer().lex(src)`](https://eemeli.org/yaml/#lexer)
- [`new Parser(onNewLine?).parse(src)`](https://eemeli.org/yaml/#parser)
- [`new Composer(options?).compose(tokens)`](https://eemeli.org/yaml/#composer)
## YAML.parse
```yaml
# file.yml
YAML:
- A human-readable data serialization language
- https://en.wikipedia.org/wiki/YAML
yaml:
- A complete JavaScript implementation
- https://www.npmjs.com/package/yaml
```
```js
import fs from 'fs'
import YAML from 'yaml'
YAML.parse('3.14159')
// 3.14159
YAML.parse('[ true, false, maybe, null ]\n')
// [ true, false, 'maybe', null ]
const file = fs.readFileSync('./file.yml', 'utf8')
YAML.parse(file)
// { YAML:
// [ 'A human-readable data serialization language',
// 'https://en.wikipedia.org/wiki/YAML' ],
// yaml:
// [ 'A complete JavaScript implementation',
// 'https://www.npmjs.com/package/yaml' ] }
```
## YAML.stringify
```js
import YAML from 'yaml'
YAML.stringify(3.14159)
// '3.14159\n'
YAML.stringify([true, false, 'maybe', null])
// `- true
// - false
// - maybe
// - null
// `
YAML.stringify({ number: 3, plain: 'string', block: 'two\nlines\n' })
// `number: 3
// plain: string
// block: |
// two
// lines
// `
```
---
Browser testing provided by:
<a href="https://www.browserstack.com/open-source">
<img width=200 src="https://eemeli.org/yaml/images/browserstack.svg" alt="BrowserStack" />
</a>

11
node_modules/yaml/bin.mjs generated vendored
View File

@@ -1,11 +0,0 @@
#!/usr/bin/env node
import { UserError, cli, help } from './dist/cli.mjs'
cli(process.stdin, error => {
if (error instanceof UserError) {
if (error.code === UserError.ARGS) console.error(`${help}\n`)
console.error(error.message)
process.exitCode = error.code
} else if (error) throw error
})

View File

@@ -1,88 +0,0 @@
import { isNode } from '../nodes/identity.js';
import { Scalar } from '../nodes/Scalar.js';
import { YAMLMap } from '../nodes/YAMLMap.js';
import { YAMLSeq } from '../nodes/YAMLSeq.js';
import { resolveBlockMap } from './resolve-block-map.js';
import { resolveBlockSeq } from './resolve-block-seq.js';
import { resolveFlowCollection } from './resolve-flow-collection.js';
function resolveCollection(CN, ctx, token, onError, tagName, tag) {
const coll = token.type === 'block-map'
? resolveBlockMap(CN, ctx, token, onError, tag)
: token.type === 'block-seq'
? resolveBlockSeq(CN, ctx, token, onError, tag)
: resolveFlowCollection(CN, ctx, token, onError, tag);
const Coll = coll.constructor;
// If we got a tagName matching the class, or the tag name is '!',
// then use the tagName from the node class used to create it.
if (tagName === '!' || tagName === Coll.tagName) {
coll.tag = Coll.tagName;
return coll;
}
if (tagName)
coll.tag = tagName;
return coll;
}
function composeCollection(CN, ctx, token, props, onError) {
const tagToken = props.tag;
const tagName = !tagToken
? null
: ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
if (token.type === 'block-seq') {
const { anchor, newlineAfterProp: nl } = props;
const lastProp = anchor && tagToken
? anchor.offset > tagToken.offset
? anchor
: tagToken
: (anchor ?? tagToken);
if (lastProp && (!nl || nl.offset < lastProp.offset)) {
const message = 'Missing newline after block sequence props';
onError(lastProp, 'MISSING_CHAR', message);
}
}
const expType = token.type === 'block-map'
? 'map'
: token.type === 'block-seq'
? 'seq'
: token.start.source === '{'
? 'map'
: 'seq';
// shortcut: check if it's a generic YAMLMap or YAMLSeq
// before jumping into the custom tag logic.
if (!tagToken ||
!tagName ||
tagName === '!' ||
(tagName === YAMLMap.tagName && expType === 'map') ||
(tagName === YAMLSeq.tagName && expType === 'seq')) {
return resolveCollection(CN, ctx, token, onError, tagName);
}
let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
if (!tag) {
const kt = ctx.schema.knownTags[tagName];
if (kt?.collection === expType) {
ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
tag = kt;
}
else {
if (kt) {
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
}
else {
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
}
return resolveCollection(CN, ctx, token, onError, tagName);
}
}
const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;
const node = isNode(res)
? res
: new Scalar(res);
node.range = coll.range;
node.tag = tagName;
if (tag?.format)
node.format = tag.format;
return node;
}
export { composeCollection };

View File

@@ -1,43 +0,0 @@
import { Document } from '../doc/Document.js';
import { composeNode, composeEmptyNode } from './compose-node.js';
import { resolveEnd } from './resolve-end.js';
import { resolveProps } from './resolve-props.js';
function composeDoc(options, directives, { offset, start, value, end }, onError) {
const opts = Object.assign({ _directives: directives }, options);
const doc = new Document(undefined, opts);
const ctx = {
atKey: false,
atRoot: true,
directives: doc.directives,
options: doc.options,
schema: doc.schema
};
const props = resolveProps(start, {
indicator: 'doc-start',
next: value ?? end?.[0],
offset,
onError,
parentIndent: 0,
startOnNewline: true
});
if (props.found) {
doc.directives.docStart = true;
if (value &&
(value.type === 'block-map' || value.type === 'block-seq') &&
!props.hasNewline)
onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');
}
// @ts-expect-error If Contents is set, let's trust the user
doc.contents = value
? composeNode(ctx, value, props, onError)
: composeEmptyNode(ctx, props.end, start, null, props, onError);
const contentEnd = doc.contents.range[2];
const re = resolveEnd(end, contentEnd, false, onError);
if (re.comment)
doc.comment = re.comment;
doc.range = [offset, contentEnd, re.offset];
return doc;
}
export { composeDoc };

View File

@@ -1,102 +0,0 @@
import { Alias } from '../nodes/Alias.js';
import { isScalar } from '../nodes/identity.js';
import { composeCollection } from './compose-collection.js';
import { composeScalar } from './compose-scalar.js';
import { resolveEnd } from './resolve-end.js';
import { emptyScalarPosition } from './util-empty-scalar-position.js';
const CN = { composeNode, composeEmptyNode };
function composeNode(ctx, token, props, onError) {
const atKey = ctx.atKey;
const { spaceBefore, comment, anchor, tag } = props;
let node;
let isSrcToken = true;
switch (token.type) {
case 'alias':
node = composeAlias(ctx, token, onError);
if (anchor || tag)
onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');
break;
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar':
case 'block-scalar':
node = composeScalar(ctx, token, tag, onError);
if (anchor)
node.anchor = anchor.source.substring(1);
break;
case 'block-map':
case 'block-seq':
case 'flow-collection':
node = composeCollection(CN, ctx, token, props, onError);
if (anchor)
node.anchor = anchor.source.substring(1);
break;
default: {
const message = token.type === 'error'
? token.message
: `Unsupported token (type: ${token.type})`;
onError(token, 'UNEXPECTED_TOKEN', message);
node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
isSrcToken = false;
}
}
if (anchor && node.anchor === '')
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
if (atKey &&
ctx.options.stringKeys &&
(!isScalar(node) ||
typeof node.value !== 'string' ||
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
const msg = 'With stringKeys, all keys must be strings';
onError(tag ?? token, 'NON_STRING_KEY', msg);
}
if (spaceBefore)
node.spaceBefore = true;
if (comment) {
if (token.type === 'scalar' && token.source === '')
node.comment = comment;
else
node.commentBefore = comment;
}
// @ts-expect-error Type checking misses meaning of isSrcToken
if (ctx.options.keepSourceTokens && isSrcToken)
node.srcToken = token;
return node;
}
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
const token = {
type: 'scalar',
offset: emptyScalarPosition(offset, before, pos),
indent: -1,
source: ''
};
const node = composeScalar(ctx, token, tag, onError);
if (anchor) {
node.anchor = anchor.source.substring(1);
if (node.anchor === '')
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
}
if (spaceBefore)
node.spaceBefore = true;
if (comment) {
node.comment = comment;
node.range[2] = end;
}
return node;
}
function composeAlias({ options }, { offset, source, end }, onError) {
const alias = new Alias(source.substring(1));
if (alias.source === '')
onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');
if (alias.source.endsWith(':'))
onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);
const valueEnd = offset + source.length;
const re = resolveEnd(end, valueEnd, options.strict, onError);
alias.range = [offset, valueEnd, re.offset];
if (re.comment)
alias.comment = re.comment;
return alias;
}
export { composeEmptyNode, composeNode };

View File

@@ -1,86 +0,0 @@
import { isScalar, SCALAR } from '../nodes/identity.js';
import { Scalar } from '../nodes/Scalar.js';
import { resolveBlockScalar } from './resolve-block-scalar.js';
import { resolveFlowScalar } from './resolve-flow-scalar.js';
function composeScalar(ctx, token, tagToken, onError) {
const { value, type, comment, range } = token.type === 'block-scalar'
? resolveBlockScalar(ctx, token, onError)
: resolveFlowScalar(token, ctx.options.strict, onError);
const tagName = tagToken
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
: null;
let tag;
if (ctx.options.stringKeys && ctx.atKey) {
tag = ctx.schema[SCALAR];
}
else if (tagName)
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
else if (token.type === 'scalar')
tag = findScalarTagByTest(ctx, value, token, onError);
else
tag = ctx.schema[SCALAR];
let scalar;
try {
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
scalar = isScalar(res) ? res : new Scalar(res);
}
catch (error) {
const msg = error instanceof Error ? error.message : String(error);
onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);
scalar = new Scalar(value);
}
scalar.range = range;
scalar.source = value;
if (type)
scalar.type = type;
if (tagName)
scalar.tag = tagName;
if (tag.format)
scalar.format = tag.format;
if (comment)
scalar.comment = comment;
return scalar;
}
function findScalarTagByName(schema, value, tagName, tagToken, onError) {
if (tagName === '!')
return schema[SCALAR]; // non-specific tag
const matchWithTest = [];
for (const tag of schema.tags) {
if (!tag.collection && tag.tag === tagName) {
if (tag.default && tag.test)
matchWithTest.push(tag);
else
return tag;
}
}
for (const tag of matchWithTest)
if (tag.test?.test(value))
return tag;
const kt = schema.knownTags[tagName];
if (kt && !kt.collection) {
// Ensure that the known tag is available for stringifying,
// but does not get used by default.
schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));
return kt;
}
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
return schema[SCALAR];
}
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
tag.test?.test(value)) || schema[SCALAR];
if (schema.compat) {
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
schema[SCALAR];
if (tag.tag !== compat.tag) {
const ts = directives.tagString(tag.tag);
const cs = directives.tagString(compat.tag);
const msg = `Value may be parsed as either ${ts} or ${cs}`;
onError(token, 'TAG_RESOLVE_FAILED', msg, true);
}
}
return tag;
}
export { composeScalar };

View File

@@ -1,217 +0,0 @@
import { Directives } from '../doc/directives.js';
import { Document } from '../doc/Document.js';
import { YAMLWarning, YAMLParseError } from '../errors.js';
import { isCollection, isPair } from '../nodes/identity.js';
import { composeDoc } from './compose-doc.js';
import { resolveEnd } from './resolve-end.js';
function getErrorPos(src) {
if (typeof src === 'number')
return [src, src + 1];
if (Array.isArray(src))
return src.length === 2 ? src : [src[0], src[1]];
const { offset, source } = src;
return [offset, offset + (typeof source === 'string' ? source.length : 1)];
}
function parsePrelude(prelude) {
let comment = '';
let atComment = false;
let afterEmptyLine = false;
for (let i = 0; i < prelude.length; ++i) {
const source = prelude[i];
switch (source[0]) {
case '#':
comment +=
(comment === '' ? '' : afterEmptyLine ? '\n\n' : '\n') +
(source.substring(1) || ' ');
atComment = true;
afterEmptyLine = false;
break;
case '%':
if (prelude[i + 1]?.[0] !== '#')
i += 1;
atComment = false;
break;
default:
// This may be wrong after doc-end, but in that case it doesn't matter
if (!atComment)
afterEmptyLine = true;
atComment = false;
}
}
return { comment, afterEmptyLine };
}
/**
* Compose a stream of CST nodes into a stream of YAML Documents.
*
* ```ts
* import { Composer, Parser } from 'yaml'
*
* const src: string = ...
* const tokens = new Parser().parse(src)
* const docs = new Composer().compose(tokens)
* ```
*/
class Composer {
constructor(options = {}) {
this.doc = null;
this.atDirectives = false;
this.prelude = [];
this.errors = [];
this.warnings = [];
this.onError = (source, code, message, warning) => {
const pos = getErrorPos(source);
if (warning)
this.warnings.push(new YAMLWarning(pos, code, message));
else
this.errors.push(new YAMLParseError(pos, code, message));
};
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
this.directives = new Directives({ version: options.version || '1.2' });
this.options = options;
}
decorate(doc, afterDoc) {
const { comment, afterEmptyLine } = parsePrelude(this.prelude);
//console.log({ dc: doc.comment, prelude, comment })
if (comment) {
const dc = doc.contents;
if (afterDoc) {
doc.comment = doc.comment ? `${doc.comment}\n${comment}` : comment;
}
else if (afterEmptyLine || doc.directives.docStart || !dc) {
doc.commentBefore = comment;
}
else if (isCollection(dc) && !dc.flow && dc.items.length > 0) {
let it = dc.items[0];
if (isPair(it))
it = it.key;
const cb = it.commentBefore;
it.commentBefore = cb ? `${comment}\n${cb}` : comment;
}
else {
const cb = dc.commentBefore;
dc.commentBefore = cb ? `${comment}\n${cb}` : comment;
}
}
if (afterDoc) {
Array.prototype.push.apply(doc.errors, this.errors);
Array.prototype.push.apply(doc.warnings, this.warnings);
}
else {
doc.errors = this.errors;
doc.warnings = this.warnings;
}
this.prelude = [];
this.errors = [];
this.warnings = [];
}
/**
* Current stream status information.
*
* Mostly useful at the end of input for an empty stream.
*/
streamInfo() {
return {
comment: parsePrelude(this.prelude).comment,
directives: this.directives,
errors: this.errors,
warnings: this.warnings
};
}
/**
* Compose tokens into documents.
*
* @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
* @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
*/
*compose(tokens, forceDoc = false, endOffset = -1) {
for (const token of tokens)
yield* this.next(token);
yield* this.end(forceDoc, endOffset);
}
/** Advance the composer by one CST token. */
*next(token) {
switch (token.type) {
case 'directive':
this.directives.add(token.source, (offset, message, warning) => {
const pos = getErrorPos(token);
pos[0] += offset;
this.onError(pos, 'BAD_DIRECTIVE', message, warning);
});
this.prelude.push(token.source);
this.atDirectives = true;
break;
case 'document': {
const doc = composeDoc(this.options, this.directives, token, this.onError);
if (this.atDirectives && !doc.directives.docStart)
this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line');
this.decorate(doc, false);
if (this.doc)
yield this.doc;
this.doc = doc;
this.atDirectives = false;
break;
}
case 'byte-order-mark':
case 'space':
break;
case 'comment':
case 'newline':
this.prelude.push(token.source);
break;
case 'error': {
const msg = token.source
? `${token.message}: ${JSON.stringify(token.source)}`
: token.message;
const error = new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg);
if (this.atDirectives || !this.doc)
this.errors.push(error);
else
this.doc.errors.push(error);
break;
}
case 'doc-end': {
if (!this.doc) {
const msg = 'Unexpected doc-end without preceding document';
this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg));
break;
}
this.doc.directives.docEnd = true;
const end = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);
this.decorate(this.doc, true);
if (end.comment) {
const dc = this.doc.comment;
this.doc.comment = dc ? `${dc}\n${end.comment}` : end.comment;
}
this.doc.range[2] = end.offset;
break;
}
default:
this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`));
}
}
/**
* Call at end of input to yield any remaining document.
*
* @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
* @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
*/
*end(forceDoc = false, endOffset = -1) {
if (this.doc) {
this.decorate(this.doc, true);
yield this.doc;
this.doc = null;
}
else if (forceDoc) {
const opts = Object.assign({ _directives: this.directives }, this.options);
const doc = new Document(undefined, opts);
if (this.atDirectives)
this.onError(endOffset, 'MISSING_CHAR', 'Missing directives-end indicator line');
doc.range = [0, endOffset, endOffset];
this.decorate(doc, false);
yield doc;
}
}
}
export { Composer };

View File

@@ -1,115 +0,0 @@
import { Pair } from '../nodes/Pair.js';
import { YAMLMap } from '../nodes/YAMLMap.js';
import { resolveProps } from './resolve-props.js';
import { containsNewline } from './util-contains-newline.js';
import { flowIndentCheck } from './util-flow-indent-check.js';
import { mapIncludes } from './util-map-includes.js';
const startColMsg = 'All mapping items must start at the same column';
function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
const NodeClass = tag?.nodeClass ?? YAMLMap;
const map = new NodeClass(ctx.schema);
if (ctx.atRoot)
ctx.atRoot = false;
let offset = bm.offset;
let commentEnd = null;
for (const collItem of bm.items) {
const { start, key, sep, value } = collItem;
// key properties
const keyProps = resolveProps(start, {
indicator: 'explicit-key-ind',
next: key ?? sep?.[0],
offset,
onError,
parentIndent: bm.indent,
startOnNewline: true
});
const implicitKey = !keyProps.found;
if (implicitKey) {
if (key) {
if (key.type === 'block-seq')
onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'A block sequence may not be used as an implicit map key');
else if ('indent' in key && key.indent !== bm.indent)
onError(offset, 'BAD_INDENT', startColMsg);
}
if (!keyProps.anchor && !keyProps.tag && !sep) {
commentEnd = keyProps.end;
if (keyProps.comment) {
if (map.comment)
map.comment += '\n' + keyProps.comment;
else
map.comment = keyProps.comment;
}
continue;
}
if (keyProps.newlineAfterProp || containsNewline(key)) {
onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');
}
}
else if (keyProps.found?.indent !== bm.indent) {
onError(offset, 'BAD_INDENT', startColMsg);
}
// key value
ctx.atKey = true;
const keyStart = keyProps.end;
const keyNode = key
? composeNode(ctx, key, keyProps, onError)
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
if (ctx.schema.compat)
flowIndentCheck(bm.indent, key, onError);
ctx.atKey = false;
if (mapIncludes(ctx, map.items, keyNode))
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
// value properties
const valueProps = resolveProps(sep ?? [], {
indicator: 'map-value-ind',
next: value,
offset: keyNode.range[2],
onError,
parentIndent: bm.indent,
startOnNewline: !key || key.type === 'block-scalar'
});
offset = valueProps.end;
if (valueProps.found) {
if (implicitKey) {
if (value?.type === 'block-map' && !valueProps.hasNewline)
onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'Nested mappings are not allowed in compact mappings');
if (ctx.options.strict &&
keyProps.start < valueProps.found.offset - 1024)
onError(keyNode.range, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit block mapping key');
}
// value value
const valueNode = value
? composeNode(ctx, value, valueProps, onError)
: composeEmptyNode(ctx, offset, sep, null, valueProps, onError);
if (ctx.schema.compat)
flowIndentCheck(bm.indent, value, onError);
offset = valueNode.range[2];
const pair = new Pair(keyNode, valueNode);
if (ctx.options.keepSourceTokens)
pair.srcToken = collItem;
map.items.push(pair);
}
else {
// key with no value
if (implicitKey)
onError(keyNode.range, 'MISSING_CHAR', 'Implicit map keys need to be followed by map values');
if (valueProps.comment) {
if (keyNode.comment)
keyNode.comment += '\n' + valueProps.comment;
else
keyNode.comment = valueProps.comment;
}
const pair = new Pair(keyNode);
if (ctx.options.keepSourceTokens)
pair.srcToken = collItem;
map.items.push(pair);
}
}
if (commentEnd && commentEnd < offset)
onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');
map.range = [bm.offset, offset, commentEnd ?? offset];
return map;
}
export { resolveBlockMap };

View File

@@ -1,198 +0,0 @@
import { Scalar } from '../nodes/Scalar.js';
function resolveBlockScalar(ctx, scalar, onError) {
const start = scalar.offset;
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
if (!header)
return { value: '', type: null, comment: '', range: [start, start, start] };
const type = header.mode === '>' ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL;
const lines = scalar.source ? splitLines(scalar.source) : [];
// determine the end of content & start of chomping
let chompStart = lines.length;
for (let i = lines.length - 1; i >= 0; --i) {
const content = lines[i][1];
if (content === '' || content === '\r')
chompStart = i;
else
break;
}
// shortcut for empty contents
if (chompStart === 0) {
const value = header.chomp === '+' && lines.length > 0
? '\n'.repeat(Math.max(1, lines.length - 1))
: '';
let end = start + header.length;
if (scalar.source)
end += scalar.source.length;
return { value, type, comment: header.comment, range: [start, end, end] };
}
// find the indentation level to trim from start
let trimIndent = scalar.indent + header.indent;
let offset = scalar.offset + header.length;
let contentStart = 0;
for (let i = 0; i < chompStart; ++i) {
const [indent, content] = lines[i];
if (content === '' || content === '\r') {
if (header.indent === 0 && indent.length > trimIndent)
trimIndent = indent.length;
}
else {
if (indent.length < trimIndent) {
const message = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator';
onError(offset + indent.length, 'MISSING_CHAR', message);
}
if (header.indent === 0)
trimIndent = indent.length;
contentStart = i;
if (trimIndent === 0 && !ctx.atRoot) {
const message = 'Block scalar values in collections must be indented';
onError(offset, 'BAD_INDENT', message);
}
break;
}
offset += indent.length + content.length + 1;
}
// include trailing more-indented empty lines in content
for (let i = lines.length - 1; i >= chompStart; --i) {
if (lines[i][0].length > trimIndent)
chompStart = i + 1;
}
let value = '';
let sep = '';
let prevMoreIndented = false;
// leading whitespace is kept intact
for (let i = 0; i < contentStart; ++i)
value += lines[i][0].slice(trimIndent) + '\n';
for (let i = contentStart; i < chompStart; ++i) {
let [indent, content] = lines[i];
offset += indent.length + content.length + 1;
const crlf = content[content.length - 1] === '\r';
if (crlf)
content = content.slice(0, -1);
/* istanbul ignore if already caught in lexer */
if (content && indent.length < trimIndent) {
const src = header.indent
? 'explicit indentation indicator'
: 'first line';
const message = `Block scalar lines must not be less indented than their ${src}`;
onError(offset - content.length - (crlf ? 2 : 1), 'BAD_INDENT', message);
indent = '';
}
if (type === Scalar.BLOCK_LITERAL) {
value += sep + indent.slice(trimIndent) + content;
sep = '\n';
}
else if (indent.length > trimIndent || content[0] === '\t') {
// more-indented content within a folded block
if (sep === ' ')
sep = '\n';
else if (!prevMoreIndented && sep === '\n')
sep = '\n\n';
value += sep + indent.slice(trimIndent) + content;
sep = '\n';
prevMoreIndented = true;
}
else if (content === '') {
// empty line
if (sep === '\n')
value += '\n';
else
sep = '\n';
}
else {
value += sep + content;
sep = ' ';
prevMoreIndented = false;
}
}
switch (header.chomp) {
case '-':
break;
case '+':
for (let i = chompStart; i < lines.length; ++i)
value += '\n' + lines[i][0].slice(trimIndent);
if (value[value.length - 1] !== '\n')
value += '\n';
break;
default:
value += '\n';
}
const end = start + header.length + scalar.source.length;
return { value, type, comment: header.comment, range: [start, end, end] };
}
function parseBlockScalarHeader({ offset, props }, strict, onError) {
/* istanbul ignore if should not happen */
if (props[0].type !== 'block-scalar-header') {
onError(props[0], 'IMPOSSIBLE', 'Block scalar header not found');
return null;
}
const { source } = props[0];
const mode = source[0];
let indent = 0;
let chomp = '';
let error = -1;
for (let i = 1; i < source.length; ++i) {
const ch = source[i];
if (!chomp && (ch === '-' || ch === '+'))
chomp = ch;
else {
const n = Number(ch);
if (!indent && n)
indent = n;
else if (error === -1)
error = offset + i;
}
}
if (error !== -1)
onError(error, 'UNEXPECTED_TOKEN', `Block scalar header includes extra characters: ${source}`);
let hasSpace = false;
let comment = '';
let length = source.length;
for (let i = 1; i < props.length; ++i) {
const token = props[i];
switch (token.type) {
case 'space':
hasSpace = true;
// fallthrough
case 'newline':
length += token.source.length;
break;
case 'comment':
if (strict && !hasSpace) {
const message = 'Comments must be separated from other tokens by white space characters';
onError(token, 'MISSING_CHAR', message);
}
length += token.source.length;
comment = token.source.substring(1);
break;
case 'error':
onError(token, 'UNEXPECTED_TOKEN', token.message);
length += token.source.length;
break;
/* istanbul ignore next should not happen */
default: {
const message = `Unexpected token in block scalar header: ${token.type}`;
onError(token, 'UNEXPECTED_TOKEN', message);
const ts = token.source;
if (ts && typeof ts === 'string')
length += ts.length;
}
}
}
return { mode, indent, chomp, comment, length };
}
/** @returns Array of lines split up as `[indent, content]` */
function splitLines(source) {
const split = source.split(/\n( *)/);
const first = split[0];
const m = first.match(/^( *)/);
const line0 = m?.[1]
? [m[1], first.slice(m[1].length)]
: ['', first];
const lines = [line0];
for (let i = 1; i < split.length; i += 2)
lines.push([split[i], split[i + 1]]);
return lines;
}
export { resolveBlockScalar };

View File

@@ -1,49 +0,0 @@
import { YAMLSeq } from '../nodes/YAMLSeq.js';
import { resolveProps } from './resolve-props.js';
import { flowIndentCheck } from './util-flow-indent-check.js';
function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {
const NodeClass = tag?.nodeClass ?? YAMLSeq;
const seq = new NodeClass(ctx.schema);
if (ctx.atRoot)
ctx.atRoot = false;
if (ctx.atKey)
ctx.atKey = false;
let offset = bs.offset;
let commentEnd = null;
for (const { start, value } of bs.items) {
const props = resolveProps(start, {
indicator: 'seq-item-ind',
next: value,
offset,
onError,
parentIndent: bs.indent,
startOnNewline: true
});
if (!props.found) {
if (props.anchor || props.tag || value) {
if (value?.type === 'block-seq')
onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');
else
onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
}
else {
commentEnd = props.end;
if (props.comment)
seq.comment = props.comment;
continue;
}
}
const node = value
? composeNode(ctx, value, props, onError)
: composeEmptyNode(ctx, props.end, start, null, props, onError);
if (ctx.schema.compat)
flowIndentCheck(bs.indent, value, onError);
offset = node.range[2];
seq.items.push(node);
}
seq.range = [bs.offset, offset, commentEnd ?? offset];
return seq;
}
export { resolveBlockSeq };

View File

@@ -1,37 +0,0 @@
function resolveEnd(end, offset, reqSpace, onError) {
let comment = '';
if (end) {
let hasSpace = false;
let sep = '';
for (const token of end) {
const { source, type } = token;
switch (type) {
case 'space':
hasSpace = true;
break;
case 'comment': {
if (reqSpace && !hasSpace)
onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
const cb = source.substring(1) || ' ';
if (!comment)
comment = cb;
else
comment += sep + cb;
sep = '';
break;
}
case 'newline':
if (comment)
sep += source;
hasSpace = true;
break;
default:
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`);
}
offset += source.length;
}
}
return { comment, offset };
}
export { resolveEnd };

View File

@@ -1,207 +0,0 @@
import { isPair } from '../nodes/identity.js';
import { Pair } from '../nodes/Pair.js';
import { YAMLMap } from '../nodes/YAMLMap.js';
import { YAMLSeq } from '../nodes/YAMLSeq.js';
import { resolveEnd } from './resolve-end.js';
import { resolveProps } from './resolve-props.js';
import { containsNewline } from './util-contains-newline.js';
import { mapIncludes } from './util-map-includes.js';
const blockMsg = 'Block collections are not allowed within flow collections';
const isBlock = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');
function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
const isMap = fc.start.source === '{';
const fcName = isMap ? 'flow map' : 'flow sequence';
const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap : YAMLSeq));
const coll = new NodeClass(ctx.schema);
coll.flow = true;
const atRoot = ctx.atRoot;
if (atRoot)
ctx.atRoot = false;
if (ctx.atKey)
ctx.atKey = false;
let offset = fc.offset + fc.start.source.length;
for (let i = 0; i < fc.items.length; ++i) {
const collItem = fc.items[i];
const { start, key, sep, value } = collItem;
const props = resolveProps(start, {
flow: fcName,
indicator: 'explicit-key-ind',
next: key ?? sep?.[0],
offset,
onError,
parentIndent: fc.indent,
startOnNewline: false
});
if (!props.found) {
if (!props.anchor && !props.tag && !sep && !value) {
if (i === 0 && props.comma)
onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);
else if (i < fc.items.length - 1)
onError(props.start, 'UNEXPECTED_TOKEN', `Unexpected empty item in ${fcName}`);
if (props.comment) {
if (coll.comment)
coll.comment += '\n' + props.comment;
else
coll.comment = props.comment;
}
offset = props.end;
continue;
}
if (!isMap && ctx.options.strict && containsNewline(key))
onError(key, // checked by containsNewline()
'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');
}
if (i === 0) {
if (props.comma)
onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);
}
else {
if (!props.comma)
onError(props.start, 'MISSING_CHAR', `Missing , between ${fcName} items`);
if (props.comment) {
let prevItemComment = '';
loop: for (const st of start) {
switch (st.type) {
case 'comma':
case 'space':
break;
case 'comment':
prevItemComment = st.source.substring(1);
break loop;
default:
break loop;
}
}
if (prevItemComment) {
let prev = coll.items[coll.items.length - 1];
if (isPair(prev))
prev = prev.value ?? prev.key;
if (prev.comment)
prev.comment += '\n' + prevItemComment;
else
prev.comment = prevItemComment;
props.comment = props.comment.substring(prevItemComment.length + 1);
}
}
}
if (!isMap && !sep && !props.found) {
// item is a value in a seq
// → key & sep are empty, start does not include ? or :
const valueNode = value
? composeNode(ctx, value, props, onError)
: composeEmptyNode(ctx, props.end, sep, null, props, onError);
coll.items.push(valueNode);
offset = valueNode.range[2];
if (isBlock(value))
onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
}
else {
// item is a key+value pair
// key value
ctx.atKey = true;
const keyStart = props.end;
const keyNode = key
? composeNode(ctx, key, props, onError)
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
if (isBlock(key))
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
ctx.atKey = false;
// value properties
const valueProps = resolveProps(sep ?? [], {
flow: fcName,
indicator: 'map-value-ind',
next: value,
offset: keyNode.range[2],
onError,
parentIndent: fc.indent,
startOnNewline: false
});
if (valueProps.found) {
if (!isMap && !props.found && ctx.options.strict) {
if (sep)
for (const st of sep) {
if (st === valueProps.found)
break;
if (st.type === 'newline') {
onError(st, 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');
break;
}
}
if (props.start < valueProps.found.offset - 1024)
onError(valueProps.found, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit flow sequence key');
}
}
else if (value) {
if ('source' in value && value.source?.[0] === ':')
onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);
else
onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);
}
// value value
const valueNode = value
? composeNode(ctx, value, valueProps, onError)
: valueProps.found
? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError)
: null;
if (valueNode) {
if (isBlock(value))
onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
}
else if (valueProps.comment) {
if (keyNode.comment)
keyNode.comment += '\n' + valueProps.comment;
else
keyNode.comment = valueProps.comment;
}
const pair = new Pair(keyNode, valueNode);
if (ctx.options.keepSourceTokens)
pair.srcToken = collItem;
if (isMap) {
const map = coll;
if (mapIncludes(ctx, map.items, keyNode))
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
map.items.push(pair);
}
else {
const map = new YAMLMap(ctx.schema);
map.flow = true;
map.items.push(pair);
const endRange = (valueNode ?? keyNode).range;
map.range = [keyNode.range[0], endRange[1], endRange[2]];
coll.items.push(map);
}
offset = valueNode ? valueNode.range[2] : valueProps.end;
}
}
const expectedEnd = isMap ? '}' : ']';
const [ce, ...ee] = fc.end;
let cePos = offset;
if (ce?.source === expectedEnd)
cePos = ce.offset + ce.source.length;
else {
const name = fcName[0].toUpperCase() + fcName.substring(1);
const msg = atRoot
? `${name} must end with a ${expectedEnd}`
: `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
onError(offset, atRoot ? 'MISSING_CHAR' : 'BAD_INDENT', msg);
if (ce && ce.source.length !== 1)
ee.unshift(ce);
}
if (ee.length > 0) {
const end = resolveEnd(ee, cePos, ctx.options.strict, onError);
if (end.comment) {
if (coll.comment)
coll.comment += '\n' + end.comment;
else
coll.comment = end.comment;
}
coll.range = [fc.offset, cePos, end.offset];
}
else {
coll.range = [fc.offset, cePos, cePos];
}
return coll;
}
export { resolveFlowCollection };

View File

@@ -1,223 +0,0 @@
import { Scalar } from '../nodes/Scalar.js';
import { resolveEnd } from './resolve-end.js';
function resolveFlowScalar(scalar, strict, onError) {
const { offset, type, source, end } = scalar;
let _type;
let value;
const _onError = (rel, code, msg) => onError(offset + rel, code, msg);
switch (type) {
case 'scalar':
_type = Scalar.PLAIN;
value = plainValue(source, _onError);
break;
case 'single-quoted-scalar':
_type = Scalar.QUOTE_SINGLE;
value = singleQuotedValue(source, _onError);
break;
case 'double-quoted-scalar':
_type = Scalar.QUOTE_DOUBLE;
value = doubleQuotedValue(source, _onError);
break;
/* istanbul ignore next should not happen */
default:
onError(scalar, 'UNEXPECTED_TOKEN', `Expected a flow scalar value, but found: ${type}`);
return {
value: '',
type: null,
comment: '',
range: [offset, offset + source.length, offset + source.length]
};
}
const valueEnd = offset + source.length;
const re = resolveEnd(end, valueEnd, strict, onError);
return {
value,
type: _type,
comment: re.comment,
range: [offset, valueEnd, re.offset]
};
}
function plainValue(source, onError) {
let badChar = '';
switch (source[0]) {
/* istanbul ignore next should not happen */
case '\t':
badChar = 'a tab character';
break;
case ',':
badChar = 'flow indicator character ,';
break;
case '%':
badChar = 'directive indicator character %';
break;
case '|':
case '>': {
badChar = `block scalar indicator ${source[0]}`;
break;
}
case '@':
case '`': {
badChar = `reserved character ${source[0]}`;
break;
}
}
if (badChar)
onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);
return foldLines(source);
}
function singleQuotedValue(source, onError) {
if (source[source.length - 1] !== "'" || source.length === 1)
onError(source.length, 'MISSING_CHAR', "Missing closing 'quote");
return foldLines(source.slice(1, -1)).replace(/''/g, "'");
}
function foldLines(source) {
/**
* The negative lookbehind here and in the `re` RegExp is to
* prevent causing a polynomial search time in certain cases.
*
* The try-catch is for Safari, which doesn't support this yet:
* https://caniuse.com/js-regexp-lookbehind
*/
let first, line;
try {
first = new RegExp('(.*?)(?<![ \t])[ \t]*\r?\n', 'sy');
line = new RegExp('[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n', 'sy');
}
catch {
first = /(.*?)[ \t]*\r?\n/sy;
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
}
let match = first.exec(source);
if (!match)
return source;
let res = match[1];
let sep = ' ';
let pos = first.lastIndex;
line.lastIndex = pos;
while ((match = line.exec(source))) {
if (match[1] === '') {
if (sep === '\n')
res += sep;
else
sep = '\n';
}
else {
res += sep + match[1];
sep = ' ';
}
pos = line.lastIndex;
}
const last = /[ \t]*(.*)/sy;
last.lastIndex = pos;
match = last.exec(source);
return res + sep + (match?.[1] ?? '');
}
function doubleQuotedValue(source, onError) {
let res = '';
for (let i = 1; i < source.length - 1; ++i) {
const ch = source[i];
if (ch === '\r' && source[i + 1] === '\n')
continue;
if (ch === '\n') {
const { fold, offset } = foldNewline(source, i);
res += fold;
i = offset;
}
else if (ch === '\\') {
let next = source[++i];
const cc = escapeCodes[next];
if (cc)
res += cc;
else if (next === '\n') {
// skip escaped newlines, but still trim the following line
next = source[i + 1];
while (next === ' ' || next === '\t')
next = source[++i + 1];
}
else if (next === '\r' && source[i + 1] === '\n') {
// skip escaped CRLF newlines, but still trim the following line
next = source[++i + 1];
while (next === ' ' || next === '\t')
next = source[++i + 1];
}
else if (next === 'x' || next === 'u' || next === 'U') {
const length = { x: 2, u: 4, U: 8 }[next];
res += parseCharCode(source, i + 1, length, onError);
i += length;
}
else {
const raw = source.substr(i - 1, 2);
onError(i - 1, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
res += raw;
}
}
else if (ch === ' ' || ch === '\t') {
// trim trailing whitespace
const wsStart = i;
let next = source[i + 1];
while (next === ' ' || next === '\t')
next = source[++i + 1];
if (next !== '\n' && !(next === '\r' && source[i + 2] === '\n'))
res += i > wsStart ? source.slice(wsStart, i + 1) : ch;
}
else {
res += ch;
}
}
if (source[source.length - 1] !== '"' || source.length === 1)
onError(source.length, 'MISSING_CHAR', 'Missing closing "quote');
return res;
}
/**
* Fold a single newline into a space, multiple newlines to N - 1 newlines.
* Presumes `source[offset] === '\n'`
*/
function foldNewline(source, offset) {
let fold = '';
let ch = source[offset + 1];
while (ch === ' ' || ch === '\t' || ch === '\n' || ch === '\r') {
if (ch === '\r' && source[offset + 2] !== '\n')
break;
if (ch === '\n')
fold += '\n';
offset += 1;
ch = source[offset + 1];
}
if (!fold)
fold = ' ';
return { fold, offset };
}
const escapeCodes = {
'0': '\0', // null character
a: '\x07', // bell character
b: '\b', // backspace
e: '\x1b', // escape character
f: '\f', // form feed
n: '\n', // line feed
r: '\r', // carriage return
t: '\t', // horizontal tab
v: '\v', // vertical tab
N: '\u0085', // Unicode next line
_: '\u00a0', // Unicode non-breaking space
L: '\u2028', // Unicode line separator
P: '\u2029', // Unicode paragraph separator
' ': ' ',
'"': '"',
'/': '/',
'\\': '\\',
'\t': '\t'
};
function parseCharCode(source, offset, length, onError) {
const cc = source.substr(offset, length);
const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
const code = ok ? parseInt(cc, 16) : NaN;
if (isNaN(code)) {
const raw = source.substr(offset - 2, length + 2);
onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
return raw;
}
return String.fromCodePoint(code);
}
export { resolveFlowScalar };

View File

@@ -1,146 +0,0 @@
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
let spaceBefore = false;
let atNewline = startOnNewline;
let hasSpace = startOnNewline;
let comment = '';
let commentSep = '';
let hasNewline = false;
let reqSpace = false;
let tab = null;
let anchor = null;
let tag = null;
let newlineAfterProp = null;
let comma = null;
let found = null;
let start = null;
for (const token of tokens) {
if (reqSpace) {
if (token.type !== 'space' &&
token.type !== 'newline' &&
token.type !== 'comma')
onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
reqSpace = false;
}
if (tab) {
if (atNewline && token.type !== 'comment' && token.type !== 'newline') {
onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
}
tab = null;
}
switch (token.type) {
case 'space':
// At the doc level, tabs at line start may be parsed
// as leading white space rather than indentation.
// In a flow collection, only the parser handles indent.
if (!flow &&
(indicator !== 'doc-start' || next?.type !== 'flow-collection') &&
token.source.includes('\t')) {
tab = token;
}
hasSpace = true;
break;
case 'comment': {
if (!hasSpace)
onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
const cb = token.source.substring(1) || ' ';
if (!comment)
comment = cb;
else
comment += commentSep + cb;
commentSep = '';
atNewline = false;
break;
}
case 'newline':
if (atNewline) {
if (comment)
comment += token.source;
else if (!found || indicator !== 'seq-item-ind')
spaceBefore = true;
}
else
commentSep += token.source;
atNewline = true;
hasNewline = true;
if (anchor || tag)
newlineAfterProp = token;
hasSpace = true;
break;
case 'anchor':
if (anchor)
onError(token, 'MULTIPLE_ANCHORS', 'A node can have at most one anchor');
if (token.source.endsWith(':'))
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
anchor = token;
start ?? (start = token.offset);
atNewline = false;
hasSpace = false;
reqSpace = true;
break;
case 'tag': {
if (tag)
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
tag = token;
start ?? (start = token.offset);
atNewline = false;
hasSpace = false;
reqSpace = true;
break;
}
case indicator:
// Could here handle preceding comments differently
if (anchor || tag)
onError(token, 'BAD_PROP_ORDER', `Anchors and tags must be after the ${token.source} indicator`);
if (found)
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`);
found = token;
atNewline =
indicator === 'seq-item-ind' || indicator === 'explicit-key-ind';
hasSpace = false;
break;
case 'comma':
if (flow) {
if (comma)
onError(token, 'UNEXPECTED_TOKEN', `Unexpected , in ${flow}`);
comma = token;
atNewline = false;
hasSpace = false;
break;
}
// else fallthrough
default:
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.type} token`);
atNewline = false;
hasSpace = false;
}
}
const last = tokens[tokens.length - 1];
const end = last ? last.offset + last.source.length : offset;
if (reqSpace &&
next &&
next.type !== 'space' &&
next.type !== 'newline' &&
next.type !== 'comma' &&
(next.type !== 'scalar' || next.source !== '')) {
onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
}
if (tab &&
((atNewline && tab.indent <= parentIndent) ||
next?.type === 'block-map' ||
next?.type === 'block-seq'))
onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
return {
comma,
found,
spaceBefore,
comment,
hasNewline,
anchor,
tag,
newlineAfterProp,
end,
start: start ?? end
};
}
export { resolveProps };

View File

@@ -1,34 +0,0 @@
function containsNewline(key) {
if (!key)
return null;
switch (key.type) {
case 'alias':
case 'scalar':
case 'double-quoted-scalar':
case 'single-quoted-scalar':
if (key.source.includes('\n'))
return true;
if (key.end)
for (const st of key.end)
if (st.type === 'newline')
return true;
return false;
case 'flow-collection':
for (const it of key.items) {
for (const st of it.start)
if (st.type === 'newline')
return true;
if (it.sep)
for (const st of it.sep)
if (st.type === 'newline')
return true;
if (containsNewline(it.key) || containsNewline(it.value))
return true;
}
return false;
default:
return true;
}
}
export { containsNewline };

View File

@@ -1,26 +0,0 @@
function emptyScalarPosition(offset, before, pos) {
if (before) {
pos ?? (pos = before.length);
for (let i = pos - 1; i >= 0; --i) {
let st = before[i];
switch (st.type) {
case 'space':
case 'comment':
case 'newline':
offset -= st.source.length;
continue;
}
// Technically, an empty scalar is immediately after the last non-empty
// node, but it's more useful to place it after any whitespace.
st = before[++i];
while (st?.type === 'space') {
offset += st.source.length;
st = before[++i];
}
break;
}
}
return offset;
}
export { emptyScalarPosition };

View File

@@ -1,15 +0,0 @@
import { containsNewline } from './util-contains-newline.js';
function flowIndentCheck(indent, fc, onError) {
if (fc?.type === 'flow-collection') {
const end = fc.end[0];
if (end.indent === indent &&
(end.source === ']' || end.source === '}') &&
containsNewline(fc)) {
const msg = 'Flow end indicator should be more indented than parent';
onError(end, 'BAD_INDENT', msg, true);
}
}
}
export { flowIndentCheck };

View File

@@ -1,13 +0,0 @@
import { isScalar } from '../nodes/identity.js';
function mapIncludes(ctx, items, search) {
const { uniqueKeys } = ctx.options;
if (uniqueKeys === false)
return false;
const isEqual = typeof uniqueKeys === 'function'
? uniqueKeys
: (a, b) => a === b || (isScalar(a) && isScalar(b) && a.value === b.value);
return items.some(pair => isEqual(pair.key, search));
}
export { mapIncludes };

View File

@@ -1,335 +0,0 @@
import { Alias } from '../nodes/Alias.js';
import { isEmptyPath, collectionFromPath } from '../nodes/Collection.js';
import { NODE_TYPE, DOC, isNode, isCollection, isScalar } from '../nodes/identity.js';
import { Pair } from '../nodes/Pair.js';
import { toJS } from '../nodes/toJS.js';
import { Schema } from '../schema/Schema.js';
import { stringifyDocument } from '../stringify/stringifyDocument.js';
import { anchorNames, findNewAnchor, createNodeAnchors } from './anchors.js';
import { applyReviver } from './applyReviver.js';
import { createNode } from './createNode.js';
import { Directives } from './directives.js';
class Document {
constructor(value, replacer, options) {
/** A comment before this Document */
this.commentBefore = null;
/** A comment immediately after this Document */
this.comment = null;
/** Errors encountered during parsing. */
this.errors = [];
/** Warnings encountered during parsing. */
this.warnings = [];
Object.defineProperty(this, NODE_TYPE, { value: DOC });
let _replacer = null;
if (typeof replacer === 'function' || Array.isArray(replacer)) {
_replacer = replacer;
}
else if (options === undefined && replacer) {
options = replacer;
replacer = undefined;
}
const opt = Object.assign({
intAsBigInt: false,
keepSourceTokens: false,
logLevel: 'warn',
prettyErrors: true,
strict: true,
stringKeys: false,
uniqueKeys: true,
version: '1.2'
}, options);
this.options = opt;
let { version } = opt;
if (options?._directives) {
this.directives = options._directives.atDocument();
if (this.directives.yaml.explicit)
version = this.directives.yaml.version;
}
else
this.directives = new Directives({ version });
this.setSchema(version, options);
// @ts-expect-error We can't really know that this matches Contents.
this.contents =
value === undefined ? null : this.createNode(value, _replacer, options);
}
/**
* Create a deep copy of this Document and its contents.
*
* Custom Node values that inherit from `Object` still refer to their original instances.
*/
clone() {
const copy = Object.create(Document.prototype, {
[NODE_TYPE]: { value: DOC }
});
copy.commentBefore = this.commentBefore;
copy.comment = this.comment;
copy.errors = this.errors.slice();
copy.warnings = this.warnings.slice();
copy.options = Object.assign({}, this.options);
if (this.directives)
copy.directives = this.directives.clone();
copy.schema = this.schema.clone();
// @ts-expect-error We can't really know that this matches Contents.
copy.contents = isNode(this.contents)
? this.contents.clone(copy.schema)
: this.contents;
if (this.range)
copy.range = this.range.slice();
return copy;
}
/** Adds a value to the document. */
add(value) {
if (assertCollection(this.contents))
this.contents.add(value);
}
/** Adds a value to the document. */
addIn(path, value) {
if (assertCollection(this.contents))
this.contents.addIn(path, value);
}
/**
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
*
* If `node` already has an anchor, `name` is ignored.
* Otherwise, the `node.anchor` value will be set to `name`,
* or if an anchor with that name is already present in the document,
* `name` will be used as a prefix for a new unique anchor.
* If `name` is undefined, the generated anchor will use 'a' as a prefix.
*/
createAlias(node, name) {
if (!node.anchor) {
const prev = anchorNames(this);
node.anchor =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
!name || prev.has(name) ? findNewAnchor(name || 'a', prev) : name;
}
return new Alias(node.anchor);
}
createNode(value, replacer, options) {
let _replacer = undefined;
if (typeof replacer === 'function') {
value = replacer.call({ '': value }, '', value);
_replacer = replacer;
}
else if (Array.isArray(replacer)) {
const keyToStr = (v) => typeof v === 'number' || v instanceof String || v instanceof Number;
const asStr = replacer.filter(keyToStr).map(String);
if (asStr.length > 0)
replacer = replacer.concat(asStr);
_replacer = replacer;
}
else if (options === undefined && replacer) {
options = replacer;
replacer = undefined;
}
const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};
const { onAnchor, setAnchors, sourceObjects } = createNodeAnchors(this,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
anchorPrefix || 'a');
const ctx = {
aliasDuplicateObjects: aliasDuplicateObjects ?? true,
keepUndefined: keepUndefined ?? false,
onAnchor,
onTagObj,
replacer: _replacer,
schema: this.schema,
sourceObjects
};
const node = createNode(value, tag, ctx);
if (flow && isCollection(node))
node.flow = true;
setAnchors();
return node;
}
/**
* Convert a key and a value into a `Pair` using the current schema,
* recursively wrapping all values as `Scalar` or `Collection` nodes.
*/
createPair(key, value, options = {}) {
const k = this.createNode(key, null, options);
const v = this.createNode(value, null, options);
return new Pair(k, v);
}
/**
* Removes a value from the document.
* @returns `true` if the item was found and removed.
*/
delete(key) {
return assertCollection(this.contents) ? this.contents.delete(key) : false;
}
/**
* Removes a value from the document.
* @returns `true` if the item was found and removed.
*/
deleteIn(path) {
if (isEmptyPath(path)) {
if (this.contents == null)
return false;
// @ts-expect-error Presumed impossible if Strict extends false
this.contents = null;
return true;
}
return assertCollection(this.contents)
? this.contents.deleteIn(path)
: false;
}
/**
* Returns item at `key`, or `undefined` if not found. By default unwraps
* scalar values from their surrounding node; to disable set `keepScalar` to
* `true` (collections are always returned intact).
*/
get(key, keepScalar) {
return isCollection(this.contents)
? this.contents.get(key, keepScalar)
: undefined;
}
/**
* Returns item at `path`, or `undefined` if not found. By default unwraps
* scalar values from their surrounding node; to disable set `keepScalar` to
* `true` (collections are always returned intact).
*/
getIn(path, keepScalar) {
if (isEmptyPath(path))
return !keepScalar && isScalar(this.contents)
? this.contents.value
: this.contents;
return isCollection(this.contents)
? this.contents.getIn(path, keepScalar)
: undefined;
}
/**
* Checks if the document includes a value with the key `key`.
*/
has(key) {
return isCollection(this.contents) ? this.contents.has(key) : false;
}
/**
* Checks if the document includes a value at `path`.
*/
hasIn(path) {
if (isEmptyPath(path))
return this.contents !== undefined;
return isCollection(this.contents) ? this.contents.hasIn(path) : false;
}
/**
* Sets a value in this document. For `!!set`, `value` needs to be a
* boolean to add/remove the item from the set.
*/
set(key, value) {
if (this.contents == null) {
// @ts-expect-error We can't really know that this matches Contents.
this.contents = collectionFromPath(this.schema, [key], value);
}
else if (assertCollection(this.contents)) {
this.contents.set(key, value);
}
}
/**
* Sets a value in this document. For `!!set`, `value` needs to be a
* boolean to add/remove the item from the set.
*/
setIn(path, value) {
if (isEmptyPath(path)) {
// @ts-expect-error We can't really know that this matches Contents.
this.contents = value;
}
else if (this.contents == null) {
// @ts-expect-error We can't really know that this matches Contents.
this.contents = collectionFromPath(this.schema, Array.from(path), value);
}
else if (assertCollection(this.contents)) {
this.contents.setIn(path, value);
}
}
/**
* Change the YAML version and schema used by the document.
* A `null` version disables support for directives, explicit tags, anchors, and aliases.
* It also requires the `schema` option to be given as a `Schema` instance value.
*
* Overrides all previously set schema options.
*/
setSchema(version, options = {}) {
if (typeof version === 'number')
version = String(version);
let opt;
switch (version) {
case '1.1':
if (this.directives)
this.directives.yaml.version = '1.1';
else
this.directives = new Directives({ version: '1.1' });
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
break;
case '1.2':
case 'next':
if (this.directives)
this.directives.yaml.version = version;
else
this.directives = new Directives({ version });
opt = { resolveKnownTags: true, schema: 'core' };
break;
case null:
if (this.directives)
delete this.directives;
opt = null;
break;
default: {
const sv = JSON.stringify(version);
throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);
}
}
// Not using `instanceof Schema` to allow for duck typing
if (options.schema instanceof Object)
this.schema = options.schema;
else if (opt)
this.schema = new Schema(Object.assign(opt, options));
else
throw new Error(`With a null YAML version, the { schema: Schema } option is required`);
}
// json & jsonArg are only used from toJSON()
toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
const ctx = {
anchors: new Map(),
doc: this,
keep: !json,
mapAsMap: mapAsMap === true,
mapKeyWarned: false,
maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
};
const res = toJS(this.contents, jsonArg ?? '', ctx);
if (typeof onAnchor === 'function')
for (const { count, res } of ctx.anchors.values())
onAnchor(res, count);
return typeof reviver === 'function'
? applyReviver(reviver, { '': res }, '', res)
: res;
}
/**
* A JSON representation of the document `contents`.
*
* @param jsonArg Used by `JSON.stringify` to indicate the array index or
* property name.
*/
toJSON(jsonArg, onAnchor) {
return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });
}
/** A YAML representation of the document. */
toString(options = {}) {
if (this.errors.length > 0)
throw new Error('Document with errors cannot be stringified');
if ('indent' in options &&
(!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {
const s = JSON.stringify(options.indent);
throw new Error(`"indent" option must be a positive integer, not ${s}`);
}
return stringifyDocument(this, options);
}
}
function assertCollection(contents) {
if (isCollection(contents))
return true;
throw new Error('Expected a YAML collection as document contents');
}
export { Document };

View File

@@ -1,71 +0,0 @@
import { isScalar, isCollection } from '../nodes/identity.js';
import { visit } from '../visit.js';
/**
* Verify that the input string is a valid anchor.
*
* Will throw on errors.
*/
function anchorIsValid(anchor) {
if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
const sa = JSON.stringify(anchor);
const msg = `Anchor must not contain whitespace or control characters: ${sa}`;
throw new Error(msg);
}
return true;
}
function anchorNames(root) {
const anchors = new Set();
visit(root, {
Value(_key, node) {
if (node.anchor)
anchors.add(node.anchor);
}
});
return anchors;
}
/** Find a new anchor name with the given `prefix` and a one-indexed suffix. */
function findNewAnchor(prefix, exclude) {
for (let i = 1; true; ++i) {
const name = `${prefix}${i}`;
if (!exclude.has(name))
return name;
}
}
function createNodeAnchors(doc, prefix) {
const aliasObjects = [];
const sourceObjects = new Map();
let prevAnchors = null;
return {
onAnchor: (source) => {
aliasObjects.push(source);
prevAnchors ?? (prevAnchors = anchorNames(doc));
const anchor = findNewAnchor(prefix, prevAnchors);
prevAnchors.add(anchor);
return anchor;
},
/**
* With circular references, the source node is only resolved after all
* of its child nodes are. This is why anchors are set only after all of
* the nodes have been created.
*/
setAnchors: () => {
for (const source of aliasObjects) {
const ref = sourceObjects.get(source);
if (typeof ref === 'object' &&
ref.anchor &&
(isScalar(ref.node) || isCollection(ref.node))) {
ref.node.anchor = ref.anchor;
}
else {
const error = new Error('Failed to resolve repeated object (this should not happen)');
error.source = source;
throw error;
}
}
},
sourceObjects
};
}
export { anchorIsValid, anchorNames, createNodeAnchors, findNewAnchor };

View File

@@ -1,55 +0,0 @@
/**
* Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec,
* in section 24.5.1.1 "Runtime Semantics: InternalizeJSONProperty" of the
* 2021 edition: https://tc39.es/ecma262/#sec-json.parse
*
* Includes extensions for handling Map and Set objects.
*/
function applyReviver(reviver, obj, key, val) {
if (val && typeof val === 'object') {
if (Array.isArray(val)) {
for (let i = 0, len = val.length; i < len; ++i) {
const v0 = val[i];
const v1 = applyReviver(reviver, val, String(i), v0);
// eslint-disable-next-line @typescript-eslint/no-array-delete
if (v1 === undefined)
delete val[i];
else if (v1 !== v0)
val[i] = v1;
}
}
else if (val instanceof Map) {
for (const k of Array.from(val.keys())) {
const v0 = val.get(k);
const v1 = applyReviver(reviver, val, k, v0);
if (v1 === undefined)
val.delete(k);
else if (v1 !== v0)
val.set(k, v1);
}
}
else if (val instanceof Set) {
for (const v0 of Array.from(val)) {
const v1 = applyReviver(reviver, val, v0, v0);
if (v1 === undefined)
val.delete(v0);
else if (v1 !== v0) {
val.delete(v0);
val.add(v1);
}
}
}
else {
for (const [k, v0] of Object.entries(val)) {
const v1 = applyReviver(reviver, val, k, v0);
if (v1 === undefined)
delete val[k];
else if (v1 !== v0)
val[k] = v1;
}
}
}
return reviver.call(obj, key, val);
}
export { applyReviver };

View File

@@ -1,88 +0,0 @@
import { Alias } from '../nodes/Alias.js';
import { isNode, isPair, MAP, SEQ, isDocument } from '../nodes/identity.js';
import { Scalar } from '../nodes/Scalar.js';
const defaultTagPrefix = 'tag:yaml.org,2002:';
function findTagObject(value, tagName, tags) {
if (tagName) {
const match = tags.filter(t => t.tag === tagName);
const tagObj = match.find(t => !t.format) ?? match[0];
if (!tagObj)
throw new Error(`Tag ${tagName} not found`);
return tagObj;
}
return tags.find(t => t.identify?.(value) && !t.format);
}
function createNode(value, tagName, ctx) {
if (isDocument(value))
value = value.contents;
if (isNode(value))
return value;
if (isPair(value)) {
const map = ctx.schema[MAP].createNode?.(ctx.schema, null, ctx);
map.items.push(value);
return map;
}
if (value instanceof String ||
value instanceof Number ||
value instanceof Boolean ||
(typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere
) {
// https://tc39.es/ecma262/#sec-serializejsonproperty
value = value.valueOf();
}
const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;
// Detect duplicate references to the same object & use Alias nodes for all
// after first. The `ref` wrapper allows for circular references to resolve.
let ref = undefined;
if (aliasDuplicateObjects && value && typeof value === 'object') {
ref = sourceObjects.get(value);
if (ref) {
ref.anchor ?? (ref.anchor = onAnchor(value));
return new Alias(ref.anchor);
}
else {
ref = { anchor: null, node: null };
sourceObjects.set(value, ref);
}
}
if (tagName?.startsWith('!!'))
tagName = defaultTagPrefix + tagName.slice(2);
let tagObj = findTagObject(value, tagName, schema.tags);
if (!tagObj) {
if (value && typeof value.toJSON === 'function') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
value = value.toJSON();
}
if (!value || typeof value !== 'object') {
const node = new Scalar(value);
if (ref)
ref.node = node;
return node;
}
tagObj =
value instanceof Map
? schema[MAP]
: Symbol.iterator in Object(value)
? schema[SEQ]
: schema[MAP];
}
if (onTagObj) {
onTagObj(tagObj);
delete ctx.onTagObj;
}
const node = tagObj?.createNode
? tagObj.createNode(ctx.schema, value, ctx)
: typeof tagObj?.nodeClass?.from === 'function'
? tagObj.nodeClass.from(ctx.schema, value, ctx)
: new Scalar(value);
if (tagName)
node.tag = tagName;
else if (!tagObj.default)
node.tag = tagObj.tag;
if (ref)
ref.node = node;
return node;
}
export { createNode };

View File

@@ -1,176 +0,0 @@
import { isNode } from '../nodes/identity.js';
import { visit } from '../visit.js';
const escapeChars = {
'!': '%21',
',': '%2C',
'[': '%5B',
']': '%5D',
'{': '%7B',
'}': '%7D'
};
const escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, ch => escapeChars[ch]);
class Directives {
constructor(yaml, tags) {
/**
* The directives-end/doc-start marker `---`. If `null`, a marker may still be
* included in the document's stringified representation.
*/
this.docStart = null;
/** The doc-end marker `...`. */
this.docEnd = false;
this.yaml = Object.assign({}, Directives.defaultYaml, yaml);
this.tags = Object.assign({}, Directives.defaultTags, tags);
}
clone() {
const copy = new Directives(this.yaml, this.tags);
copy.docStart = this.docStart;
return copy;
}
/**
* During parsing, get a Directives instance for the current document and
* update the stream state according to the current version's spec.
*/
atDocument() {
const res = new Directives(this.yaml, this.tags);
switch (this.yaml.version) {
case '1.1':
this.atNextDocument = true;
break;
case '1.2':
this.atNextDocument = false;
this.yaml = {
explicit: Directives.defaultYaml.explicit,
version: '1.2'
};
this.tags = Object.assign({}, Directives.defaultTags);
break;
}
return res;
}
/**
* @param onError - May be called even if the action was successful
* @returns `true` on success
*/
add(line, onError) {
if (this.atNextDocument) {
this.yaml = { explicit: Directives.defaultYaml.explicit, version: '1.1' };
this.tags = Object.assign({}, Directives.defaultTags);
this.atNextDocument = false;
}
const parts = line.trim().split(/[ \t]+/);
const name = parts.shift();
switch (name) {
case '%TAG': {
if (parts.length !== 2) {
onError(0, '%TAG directive should contain exactly two parts');
if (parts.length < 2)
return false;
}
const [handle, prefix] = parts;
this.tags[handle] = prefix;
return true;
}
case '%YAML': {
this.yaml.explicit = true;
if (parts.length !== 1) {
onError(0, '%YAML directive should contain exactly one part');
return false;
}
const [version] = parts;
if (version === '1.1' || version === '1.2') {
this.yaml.version = version;
return true;
}
else {
const isValid = /^\d+\.\d+$/.test(version);
onError(6, `Unsupported YAML version ${version}`, isValid);
return false;
}
}
default:
onError(0, `Unknown directive ${name}`, true);
return false;
}
}
/**
* Resolves a tag, matching handles to those defined in %TAG directives.
*
* @returns Resolved tag, which may also be the non-specific tag `'!'` or a
* `'!local'` tag, or `null` if unresolvable.
*/
tagName(source, onError) {
if (source === '!')
return '!'; // non-specific tag
if (source[0] !== '!') {
onError(`Not a valid tag: ${source}`);
return null;
}
if (source[1] === '<') {
const verbatim = source.slice(2, -1);
if (verbatim === '!' || verbatim === '!!') {
onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
return null;
}
if (source[source.length - 1] !== '>')
onError('Verbatim tags must end with a >');
return verbatim;
}
const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
if (!suffix)
onError(`The ${source} tag has no suffix`);
const prefix = this.tags[handle];
if (prefix) {
try {
return prefix + decodeURIComponent(suffix);
}
catch (error) {
onError(String(error));
return null;
}
}
if (handle === '!')
return source; // local tag
onError(`Could not resolve tag: ${source}`);
return null;
}
/**
* Given a fully resolved tag, returns its printable string form,
* taking into account current tag prefixes and defaults.
*/
tagString(tag) {
for (const [handle, prefix] of Object.entries(this.tags)) {
if (tag.startsWith(prefix))
return handle + escapeTagName(tag.substring(prefix.length));
}
return tag[0] === '!' ? tag : `!<${tag}>`;
}
toString(doc) {
const lines = this.yaml.explicit
? [`%YAML ${this.yaml.version || '1.2'}`]
: [];
const tagEntries = Object.entries(this.tags);
let tagNames;
if (doc && tagEntries.length > 0 && isNode(doc.contents)) {
const tags = {};
visit(doc.contents, (_key, node) => {
if (isNode(node) && node.tag)
tags[node.tag] = true;
});
tagNames = Object.keys(tags);
}
else
tagNames = [];
for (const [handle, prefix] of tagEntries) {
if (handle === '!!' && prefix === 'tag:yaml.org,2002:')
continue;
if (!doc || tagNames.some(tn => tn.startsWith(prefix)))
lines.push(`%TAG ${handle} ${prefix}`);
}
return lines.join('\n');
}
}
Directives.defaultYaml = { explicit: false, version: '1.2' };
Directives.defaultTags = { '!!': 'tag:yaml.org,2002:' };
export { Directives };

View File

@@ -1,57 +0,0 @@
class YAMLError extends Error {
constructor(name, pos, code, message) {
super();
this.name = name;
this.code = code;
this.message = message;
this.pos = pos;
}
}
class YAMLParseError extends YAMLError {
constructor(pos, code, message) {
super('YAMLParseError', pos, code, message);
}
}
class YAMLWarning extends YAMLError {
constructor(pos, code, message) {
super('YAMLWarning', pos, code, message);
}
}
const prettifyError = (src, lc) => (error) => {
if (error.pos[0] === -1)
return;
error.linePos = error.pos.map(pos => lc.linePos(pos));
const { line, col } = error.linePos[0];
error.message += ` at line ${line}, column ${col}`;
let ci = col - 1;
let lineStr = src
.substring(lc.lineStarts[line - 1], lc.lineStarts[line])
.replace(/[\n\r]+$/, '');
// Trim to max 80 chars, keeping col position near the middle
if (ci >= 60 && lineStr.length > 80) {
const trimStart = Math.min(ci - 39, lineStr.length - 79);
lineStr = '…' + lineStr.substring(trimStart);
ci -= trimStart - 1;
}
if (lineStr.length > 80)
lineStr = lineStr.substring(0, 79) + '…';
// Include previous line in context if pointing at line start
if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {
// Regexp won't match if start is trimmed
let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);
if (prev.length > 80)
prev = prev.substring(0, 79) + '…\n';
lineStr = prev + lineStr;
}
if (/[^ ]/.test(lineStr)) {
let count = 1;
const end = error.linePos[1];
if (end?.line === line && end.col > col) {
count = Math.max(1, Math.min(end.col - col, 80 - ci));
}
const pointer = ' '.repeat(ci) + '^'.repeat(count);
error.message += `:\n\n${lineStr}\n${pointer}\n`;
}
};
export { YAMLError, YAMLParseError, YAMLWarning, prettifyError };

View File

@@ -1,17 +0,0 @@
export { Composer } from './compose/composer.js';
export { Document } from './doc/Document.js';
export { Schema } from './schema/Schema.js';
export { YAMLError, YAMLParseError, YAMLWarning } from './errors.js';
export { Alias } from './nodes/Alias.js';
export { isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq } from './nodes/identity.js';
export { Pair } from './nodes/Pair.js';
export { Scalar } from './nodes/Scalar.js';
export { YAMLMap } from './nodes/YAMLMap.js';
export { YAMLSeq } from './nodes/YAMLSeq.js';
import * as cst from './parse/cst.js';
export { cst as CST };
export { Lexer } from './parse/lexer.js';
export { LineCounter } from './parse/line-counter.js';
export { Parser } from './parse/parser.js';
export { parse, parseAllDocuments, parseDocument, stringify } from './public-api.js';
export { visit, visitAsync } from './visit.js';

View File

@@ -1,11 +0,0 @@
function debug(logLevel, ...messages) {
if (logLevel === 'debug')
console.log(...messages);
}
function warn(logLevel, warning) {
if (logLevel === 'debug' || logLevel === 'warn') {
console.warn(warning);
}
}
export { debug, warn };

View File

@@ -1,114 +0,0 @@
import { anchorIsValid } from '../doc/anchors.js';
import { visit } from '../visit.js';
import { ALIAS, isAlias, isCollection, isPair, hasAnchor } from './identity.js';
import { NodeBase } from './Node.js';
import { toJS } from './toJS.js';
class Alias extends NodeBase {
constructor(source) {
super(ALIAS);
this.source = source;
Object.defineProperty(this, 'tag', {
set() {
throw new Error('Alias nodes cannot have tags');
}
});
}
/**
* Resolve the value of this alias within `doc`, finding the last
* instance of the `source` anchor before this node.
*/
resolve(doc, ctx) {
let nodes;
if (ctx?.aliasResolveCache) {
nodes = ctx.aliasResolveCache;
}
else {
nodes = [];
visit(doc, {
Node: (_key, node) => {
if (isAlias(node) || hasAnchor(node))
nodes.push(node);
}
});
if (ctx)
ctx.aliasResolveCache = nodes;
}
let found = undefined;
for (const node of nodes) {
if (node === this)
break;
if (node.anchor === this.source)
found = node;
}
return found;
}
toJSON(_arg, ctx) {
if (!ctx)
return { source: this.source };
const { anchors, doc, maxAliasCount } = ctx;
const source = this.resolve(doc, ctx);
if (!source) {
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
throw new ReferenceError(msg);
}
let data = anchors.get(source);
if (!data) {
// Resolve anchors for Node.prototype.toJS()
toJS(source, null, ctx);
data = anchors.get(source);
}
/* istanbul ignore if */
if (data?.res === undefined) {
const msg = 'This should not happen: Alias anchor was not resolved?';
throw new ReferenceError(msg);
}
if (maxAliasCount >= 0) {
data.count += 1;
if (data.aliasCount === 0)
data.aliasCount = getAliasCount(doc, source, anchors);
if (data.count * data.aliasCount > maxAliasCount) {
const msg = 'Excessive alias count indicates a resource exhaustion attack';
throw new ReferenceError(msg);
}
}
return data.res;
}
toString(ctx, _onComment, _onChompKeep) {
const src = `*${this.source}`;
if (ctx) {
anchorIsValid(this.source);
if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
throw new Error(msg);
}
if (ctx.implicitKey)
return `${src} `;
}
return src;
}
}
function getAliasCount(doc, node, anchors) {
if (isAlias(node)) {
const source = node.resolve(doc);
const anchor = anchors && source && anchors.get(source);
return anchor ? anchor.count * anchor.aliasCount : 0;
}
else if (isCollection(node)) {
let count = 0;
for (const item of node.items) {
const c = getAliasCount(doc, item, anchors);
if (c > count)
count = c;
}
return count;
}
else if (isPair(node)) {
const kc = getAliasCount(doc, node.key, anchors);
const vc = getAliasCount(doc, node.value, anchors);
return Math.max(kc, vc);
}
return 1;
}
export { Alias };

View File

@@ -1,147 +0,0 @@
import { createNode } from '../doc/createNode.js';
import { isNode, isPair, isCollection, isScalar } from './identity.js';
import { NodeBase } from './Node.js';
function collectionFromPath(schema, path, value) {
let v = value;
for (let i = path.length - 1; i >= 0; --i) {
const k = path[i];
if (typeof k === 'number' && Number.isInteger(k) && k >= 0) {
const a = [];
a[k] = v;
v = a;
}
else {
v = new Map([[k, v]]);
}
}
return createNode(v, undefined, {
aliasDuplicateObjects: false,
keepUndefined: false,
onAnchor: () => {
throw new Error('This should not happen, please report a bug.');
},
schema,
sourceObjects: new Map()
});
}
// Type guard is intentionally a little wrong so as to be more useful,
// as it does not cover untypable empty non-string iterables (e.g. []).
const isEmptyPath = (path) => path == null ||
(typeof path === 'object' && !!path[Symbol.iterator]().next().done);
class Collection extends NodeBase {
constructor(type, schema) {
super(type);
Object.defineProperty(this, 'schema', {
value: schema,
configurable: true,
enumerable: false,
writable: true
});
}
/**
* Create a copy of this collection.
*
* @param schema - If defined, overwrites the original's schema
*/
clone(schema) {
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
if (schema)
copy.schema = schema;
copy.items = copy.items.map(it => isNode(it) || isPair(it) ? it.clone(schema) : it);
if (this.range)
copy.range = this.range.slice();
return copy;
}
/**
* Adds a value to the collection. For `!!map` and `!!omap` the value must
* be a Pair instance or a `{ key, value }` object, which may not have a key
* that already exists in the map.
*/
addIn(path, value) {
if (isEmptyPath(path))
this.add(value);
else {
const [key, ...rest] = path;
const node = this.get(key, true);
if (isCollection(node))
node.addIn(rest, value);
else if (node === undefined && this.schema)
this.set(key, collectionFromPath(this.schema, rest, value));
else
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
}
}
/**
* Removes a value from the collection.
* @returns `true` if the item was found and removed.
*/
deleteIn(path) {
const [key, ...rest] = path;
if (rest.length === 0)
return this.delete(key);
const node = this.get(key, true);
if (isCollection(node))
return node.deleteIn(rest);
else
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
}
/**
* Returns item at `key`, or `undefined` if not found. By default unwraps
* scalar values from their surrounding node; to disable set `keepScalar` to
* `true` (collections are always returned intact).
*/
getIn(path, keepScalar) {
const [key, ...rest] = path;
const node = this.get(key, true);
if (rest.length === 0)
return !keepScalar && isScalar(node) ? node.value : node;
else
return isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
}
hasAllNullValues(allowScalar) {
return this.items.every(node => {
if (!isPair(node))
return false;
const n = node.value;
return (n == null ||
(allowScalar &&
isScalar(n) &&
n.value == null &&
!n.commentBefore &&
!n.comment &&
!n.tag));
});
}
/**
* Checks if the collection includes a value with the key `key`.
*/
hasIn(path) {
const [key, ...rest] = path;
if (rest.length === 0)
return this.has(key);
const node = this.get(key, true);
return isCollection(node) ? node.hasIn(rest) : false;
}
/**
* Sets a value in this collection. For `!!set`, `value` needs to be a
* boolean to add/remove the item from the set.
*/
setIn(path, value) {
const [key, ...rest] = path;
if (rest.length === 0) {
this.set(key, value);
}
else {
const node = this.get(key, true);
if (isCollection(node))
node.setIn(rest, value);
else if (node === undefined && this.schema)
this.set(key, collectionFromPath(this.schema, rest, value));
else
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
}
}
}
export { Collection, collectionFromPath, isEmptyPath };

View File

@@ -1,38 +0,0 @@
import { applyReviver } from '../doc/applyReviver.js';
import { NODE_TYPE, isDocument } from './identity.js';
import { toJS } from './toJS.js';
class NodeBase {
constructor(type) {
Object.defineProperty(this, NODE_TYPE, { value: type });
}
/** Create a copy of this node. */
clone() {
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
if (this.range)
copy.range = this.range.slice();
return copy;
}
/** A plain JavaScript representation of this node. */
toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
if (!isDocument(doc))
throw new TypeError('A document argument is required');
const ctx = {
anchors: new Map(),
doc,
keep: true,
mapAsMap: mapAsMap === true,
mapKeyWarned: false,
maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
};
const res = toJS(this, '', ctx);
if (typeof onAnchor === 'function')
for (const { count, res } of ctx.anchors.values())
onAnchor(res, count);
return typeof reviver === 'function'
? applyReviver(reviver, { '': res }, '', res)
: res;
}
}
export { NodeBase };

View File

@@ -1,36 +0,0 @@
import { createNode } from '../doc/createNode.js';
import { stringifyPair } from '../stringify/stringifyPair.js';
import { addPairToJSMap } from './addPairToJSMap.js';
import { NODE_TYPE, PAIR, isNode } from './identity.js';
function createPair(key, value, ctx) {
const k = createNode(key, undefined, ctx);
const v = createNode(value, undefined, ctx);
return new Pair(k, v);
}
class Pair {
constructor(key, value = null) {
Object.defineProperty(this, NODE_TYPE, { value: PAIR });
this.key = key;
this.value = value;
}
clone(schema) {
let { key, value } = this;
if (isNode(key))
key = key.clone(schema);
if (isNode(value))
value = value.clone(schema);
return new Pair(key, value);
}
toJSON(_, ctx) {
const pair = ctx?.mapAsMap ? new Map() : {};
return addPairToJSMap(ctx, pair, this);
}
toString(ctx, onComment, onChompKeep) {
return ctx?.doc
? stringifyPair(this, ctx, onComment, onChompKeep)
: JSON.stringify(this);
}
}
export { Pair, createPair };

View File

@@ -1,24 +0,0 @@
import { SCALAR } from './identity.js';
import { NodeBase } from './Node.js';
import { toJS } from './toJS.js';
const isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');
class Scalar extends NodeBase {
constructor(value) {
super(SCALAR);
this.value = value;
}
toJSON(arg, ctx) {
return ctx?.keep ? this.value : toJS(this.value, arg, ctx);
}
toString() {
return String(this.value);
}
}
Scalar.BLOCK_FOLDED = 'BLOCK_FOLDED';
Scalar.BLOCK_LITERAL = 'BLOCK_LITERAL';
Scalar.PLAIN = 'PLAIN';
Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';
Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE';
export { Scalar, isScalarValue };

View File

@@ -1,144 +0,0 @@
import { stringifyCollection } from '../stringify/stringifyCollection.js';
import { addPairToJSMap } from './addPairToJSMap.js';
import { Collection } from './Collection.js';
import { MAP, isPair, isScalar } from './identity.js';
import { Pair, createPair } from './Pair.js';
import { isScalarValue } from './Scalar.js';
function findPair(items, key) {
const k = isScalar(key) ? key.value : key;
for (const it of items) {
if (isPair(it)) {
if (it.key === key || it.key === k)
return it;
if (isScalar(it.key) && it.key.value === k)
return it;
}
}
return undefined;
}
class YAMLMap extends Collection {
static get tagName() {
return 'tag:yaml.org,2002:map';
}
constructor(schema) {
super(MAP, schema);
this.items = [];
}
/**
* A generic collection parsing method that can be extended
* to other node classes that inherit from YAMLMap
*/
static from(schema, obj, ctx) {
const { keepUndefined, replacer } = ctx;
const map = new this(schema);
const add = (key, value) => {
if (typeof replacer === 'function')
value = replacer.call(obj, key, value);
else if (Array.isArray(replacer) && !replacer.includes(key))
return;
if (value !== undefined || keepUndefined)
map.items.push(createPair(key, value, ctx));
};
if (obj instanceof Map) {
for (const [key, value] of obj)
add(key, value);
}
else if (obj && typeof obj === 'object') {
for (const key of Object.keys(obj))
add(key, obj[key]);
}
if (typeof schema.sortMapEntries === 'function') {
map.items.sort(schema.sortMapEntries);
}
return map;
}
/**
* Adds a value to the collection.
*
* @param overwrite - If not set `true`, using a key that is already in the
* collection will throw. Otherwise, overwrites the previous value.
*/
add(pair, overwrite) {
let _pair;
if (isPair(pair))
_pair = pair;
else if (!pair || typeof pair !== 'object' || !('key' in pair)) {
// In TypeScript, this never happens.
_pair = new Pair(pair, pair?.value);
}
else
_pair = new Pair(pair.key, pair.value);
const prev = findPair(this.items, _pair.key);
const sortEntries = this.schema?.sortMapEntries;
if (prev) {
if (!overwrite)
throw new Error(`Key ${_pair.key} already set`);
// For scalars, keep the old node & its comments and anchors
if (isScalar(prev.value) && isScalarValue(_pair.value))
prev.value.value = _pair.value;
else
prev.value = _pair.value;
}
else if (sortEntries) {
const i = this.items.findIndex(item => sortEntries(_pair, item) < 0);
if (i === -1)
this.items.push(_pair);
else
this.items.splice(i, 0, _pair);
}
else {
this.items.push(_pair);
}
}
delete(key) {
const it = findPair(this.items, key);
if (!it)
return false;
const del = this.items.splice(this.items.indexOf(it), 1);
return del.length > 0;
}
get(key, keepScalar) {
const it = findPair(this.items, key);
const node = it?.value;
return (!keepScalar && isScalar(node) ? node.value : node) ?? undefined;
}
has(key) {
return !!findPair(this.items, key);
}
set(key, value) {
this.add(new Pair(key, value), true);
}
/**
* @param ctx - Conversion context, originally set in Document#toJS()
* @param {Class} Type - If set, forces the returned collection type
* @returns Instance of Type, Map, or Object
*/
toJSON(_, ctx, Type) {
const map = Type ? new Type() : ctx?.mapAsMap ? new Map() : {};
if (ctx?.onCreate)
ctx.onCreate(map);
for (const item of this.items)
addPairToJSMap(ctx, map, item);
return map;
}
toString(ctx, onComment, onChompKeep) {
if (!ctx)
return JSON.stringify(this);
for (const item of this.items) {
if (!isPair(item))
throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
}
if (!ctx.allNullValues && this.hasAllNullValues(false))
ctx = Object.assign({}, ctx, { allNullValues: true });
return stringifyCollection(this, ctx, {
blockItemPrefix: '',
flowChars: { start: '{', end: '}' },
itemIndent: ctx.indent || '',
onChompKeep,
onComment
});
}
}
export { YAMLMap, findPair };

View File

@@ -1,113 +0,0 @@
import { createNode } from '../doc/createNode.js';
import { stringifyCollection } from '../stringify/stringifyCollection.js';
import { Collection } from './Collection.js';
import { SEQ, isScalar } from './identity.js';
import { isScalarValue } from './Scalar.js';
import { toJS } from './toJS.js';
class YAMLSeq extends Collection {
static get tagName() {
return 'tag:yaml.org,2002:seq';
}
constructor(schema) {
super(SEQ, schema);
this.items = [];
}
add(value) {
this.items.push(value);
}
/**
* Removes a value from the collection.
*
* `key` must contain a representation of an integer for this to succeed.
* It may be wrapped in a `Scalar`.
*
* @returns `true` if the item was found and removed.
*/
delete(key) {
const idx = asItemIndex(key);
if (typeof idx !== 'number')
return false;
const del = this.items.splice(idx, 1);
return del.length > 0;
}
get(key, keepScalar) {
const idx = asItemIndex(key);
if (typeof idx !== 'number')
return undefined;
const it = this.items[idx];
return !keepScalar && isScalar(it) ? it.value : it;
}
/**
* Checks if the collection includes a value with the key `key`.
*
* `key` must contain a representation of an integer for this to succeed.
* It may be wrapped in a `Scalar`.
*/
has(key) {
const idx = asItemIndex(key);
return typeof idx === 'number' && idx < this.items.length;
}
/**
* Sets a value in this collection. For `!!set`, `value` needs to be a
* boolean to add/remove the item from the set.
*
* If `key` does not contain a representation of an integer, this will throw.
* It may be wrapped in a `Scalar`.
*/
set(key, value) {
const idx = asItemIndex(key);
if (typeof idx !== 'number')
throw new Error(`Expected a valid index, not ${key}.`);
const prev = this.items[idx];
if (isScalar(prev) && isScalarValue(value))
prev.value = value;
else
this.items[idx] = value;
}
toJSON(_, ctx) {
const seq = [];
if (ctx?.onCreate)
ctx.onCreate(seq);
let i = 0;
for (const item of this.items)
seq.push(toJS(item, String(i++), ctx));
return seq;
}
toString(ctx, onComment, onChompKeep) {
if (!ctx)
return JSON.stringify(this);
return stringifyCollection(this, ctx, {
blockItemPrefix: '- ',
flowChars: { start: '[', end: ']' },
itemIndent: (ctx.indent || '') + ' ',
onChompKeep,
onComment
});
}
static from(schema, obj, ctx) {
const { replacer } = ctx;
const seq = new this(schema);
if (obj && Symbol.iterator in Object(obj)) {
let i = 0;
for (let it of obj) {
if (typeof replacer === 'function') {
const key = obj instanceof Set ? it : String(i++);
it = replacer.call(obj, key, it);
}
seq.items.push(createNode(it, undefined, ctx));
}
}
return seq;
}
}
function asItemIndex(key) {
let idx = isScalar(key) ? key.value : key;
if (idx && typeof idx === 'string')
idx = Number(idx);
return typeof idx === 'number' && Number.isInteger(idx) && idx >= 0
? idx
: null;
}
export { YAMLSeq };

View File

@@ -1,63 +0,0 @@
import { warn } from '../log.js';
import { isMergeKey, addMergeToJSMap } from '../schema/yaml-1.1/merge.js';
import { createStringifyContext } from '../stringify/stringify.js';
import { isNode } from './identity.js';
import { toJS } from './toJS.js';
function addPairToJSMap(ctx, map, { key, value }) {
if (isNode(key) && key.addToJSMap)
key.addToJSMap(ctx, map, value);
// TODO: Should drop this special case for bare << handling
else if (isMergeKey(ctx, key))
addMergeToJSMap(ctx, map, value);
else {
const jsKey = toJS(key, '', ctx);
if (map instanceof Map) {
map.set(jsKey, toJS(value, jsKey, ctx));
}
else if (map instanceof Set) {
map.add(jsKey);
}
else {
const stringKey = stringifyKey(key, jsKey, ctx);
const jsValue = toJS(value, stringKey, ctx);
if (stringKey in map)
Object.defineProperty(map, stringKey, {
value: jsValue,
writable: true,
enumerable: true,
configurable: true
});
else
map[stringKey] = jsValue;
}
}
return map;
}
function stringifyKey(key, jsKey, ctx) {
if (jsKey === null)
return '';
// eslint-disable-next-line @typescript-eslint/no-base-to-string
if (typeof jsKey !== 'object')
return String(jsKey);
if (isNode(key) && ctx?.doc) {
const strCtx = createStringifyContext(ctx.doc, {});
strCtx.anchors = new Set();
for (const node of ctx.anchors.keys())
strCtx.anchors.add(node.anchor);
strCtx.inFlow = true;
strCtx.inStringifyKey = true;
const strKey = key.toString(strCtx);
if (!ctx.mapKeyWarned) {
let jsonStr = JSON.stringify(strKey);
if (jsonStr.length > 40)
jsonStr = jsonStr.substring(0, 36) + '..."';
warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);
ctx.mapKeyWarned = true;
}
return strKey;
}
return JSON.stringify(jsKey);
}
export { addPairToJSMap };

View File

@@ -1,36 +0,0 @@
const ALIAS = Symbol.for('yaml.alias');
const DOC = Symbol.for('yaml.document');
const MAP = Symbol.for('yaml.map');
const PAIR = Symbol.for('yaml.pair');
const SCALAR = Symbol.for('yaml.scalar');
const SEQ = Symbol.for('yaml.seq');
const NODE_TYPE = Symbol.for('yaml.node.type');
const isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS;
const isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC;
const isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP;
const isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR;
const isScalar = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR;
const isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ;
function isCollection(node) {
if (node && typeof node === 'object')
switch (node[NODE_TYPE]) {
case MAP:
case SEQ:
return true;
}
return false;
}
function isNode(node) {
if (node && typeof node === 'object')
switch (node[NODE_TYPE]) {
case ALIAS:
case MAP:
case SCALAR:
case SEQ:
return true;
}
return false;
}
const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
export { ALIAS, DOC, MAP, NODE_TYPE, PAIR, SCALAR, SEQ, hasAnchor, isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq };

View File

@@ -1,37 +0,0 @@
import { hasAnchor } from './identity.js';
/**
* Recursively convert any node or its contents to native JavaScript
*
* @param value - The input value
* @param arg - If `value` defines a `toJSON()` method, use this
* as its first argument
* @param ctx - Conversion context, originally set in Document#toJS(). If
* `{ keep: true }` is not set, output should be suitable for JSON
* stringification.
*/
function toJS(value, arg, ctx) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
if (Array.isArray(value))
return value.map((v, i) => toJS(v, String(i), ctx));
if (value && typeof value.toJSON === 'function') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
if (!ctx || !hasAnchor(value))
return value.toJSON(arg, ctx);
const data = { aliasCount: 0, count: 1, res: undefined };
ctx.anchors.set(value, data);
ctx.onCreate = res => {
data.res = res;
delete ctx.onCreate;
};
const res = value.toJSON(arg, ctx);
if (ctx.onCreate)
ctx.onCreate(res);
return res;
}
if (typeof value === 'bigint' && !ctx?.keep)
return Number(value);
return value;
}
export { toJS };

View File

@@ -1,214 +0,0 @@
import { resolveBlockScalar } from '../compose/resolve-block-scalar.js';
import { resolveFlowScalar } from '../compose/resolve-flow-scalar.js';
import { YAMLParseError } from '../errors.js';
import { stringifyString } from '../stringify/stringifyString.js';
function resolveAsScalar(token, strict = true, onError) {
if (token) {
const _onError = (pos, code, message) => {
const offset = typeof pos === 'number' ? pos : Array.isArray(pos) ? pos[0] : pos.offset;
if (onError)
onError(offset, code, message);
else
throw new YAMLParseError([offset, offset + 1], code, message);
};
switch (token.type) {
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar':
return resolveFlowScalar(token, strict, _onError);
case 'block-scalar':
return resolveBlockScalar({ options: { strict } }, token, _onError);
}
}
return null;
}
/**
* Create a new scalar token with `value`
*
* Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
* as this function does not support any schema operations and won't check for such conflicts.
*
* @param value The string representation of the value, which will have its content properly indented.
* @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.
* @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
* @param context.indent The indent level of the token.
* @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.
* @param context.offset The offset position of the token.
* @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
*/
function createScalarToken(value, context) {
const { implicitKey = false, indent, inFlow = false, offset = -1, type = 'PLAIN' } = context;
const source = stringifyString({ type, value }, {
implicitKey,
indent: indent > 0 ? ' '.repeat(indent) : '',
inFlow,
options: { blockQuote: true, lineWidth: -1 }
});
const end = context.end ?? [
{ type: 'newline', offset: -1, indent, source: '\n' }
];
switch (source[0]) {
case '|':
case '>': {
const he = source.indexOf('\n');
const head = source.substring(0, he);
const body = source.substring(he + 1) + '\n';
const props = [
{ type: 'block-scalar-header', offset, indent, source: head }
];
if (!addEndtoBlockProps(props, end))
props.push({ type: 'newline', offset: -1, indent, source: '\n' });
return { type: 'block-scalar', offset, indent, props, source: body };
}
case '"':
return { type: 'double-quoted-scalar', offset, indent, source, end };
case "'":
return { type: 'single-quoted-scalar', offset, indent, source, end };
default:
return { type: 'scalar', offset, indent, source, end };
}
}
/**
* Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.
*
* Best efforts are made to retain any comments previously associated with the `token`,
* though all contents within a collection's `items` will be overwritten.
*
* Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
* as this function does not support any schema operations and won't check for such conflicts.
*
* @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.
* @param value The string representation of the value, which will have its content properly indented.
* @param context.afterKey In most cases, values after a key should have an additional level of indentation.
* @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
* @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.
* @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
*/
function setScalarValue(token, value, context = {}) {
let { afterKey = false, implicitKey = false, inFlow = false, type } = context;
let indent = 'indent' in token ? token.indent : null;
if (afterKey && typeof indent === 'number')
indent += 2;
if (!type)
switch (token.type) {
case 'single-quoted-scalar':
type = 'QUOTE_SINGLE';
break;
case 'double-quoted-scalar':
type = 'QUOTE_DOUBLE';
break;
case 'block-scalar': {
const header = token.props[0];
if (header.type !== 'block-scalar-header')
throw new Error('Invalid block scalar header');
type = header.source[0] === '>' ? 'BLOCK_FOLDED' : 'BLOCK_LITERAL';
break;
}
default:
type = 'PLAIN';
}
const source = stringifyString({ type, value }, {
implicitKey: implicitKey || indent === null,
indent: indent !== null && indent > 0 ? ' '.repeat(indent) : '',
inFlow,
options: { blockQuote: true, lineWidth: -1 }
});
switch (source[0]) {
case '|':
case '>':
setBlockScalarValue(token, source);
break;
case '"':
setFlowScalarValue(token, source, 'double-quoted-scalar');
break;
case "'":
setFlowScalarValue(token, source, 'single-quoted-scalar');
break;
default:
setFlowScalarValue(token, source, 'scalar');
}
}
function setBlockScalarValue(token, source) {
const he = source.indexOf('\n');
const head = source.substring(0, he);
const body = source.substring(he + 1) + '\n';
if (token.type === 'block-scalar') {
const header = token.props[0];
if (header.type !== 'block-scalar-header')
throw new Error('Invalid block scalar header');
header.source = head;
token.source = body;
}
else {
const { offset } = token;
const indent = 'indent' in token ? token.indent : -1;
const props = [
{ type: 'block-scalar-header', offset, indent, source: head }
];
if (!addEndtoBlockProps(props, 'end' in token ? token.end : undefined))
props.push({ type: 'newline', offset: -1, indent, source: '\n' });
for (const key of Object.keys(token))
if (key !== 'type' && key !== 'offset')
delete token[key];
Object.assign(token, { type: 'block-scalar', indent, props, source: body });
}
}
/** @returns `true` if last token is a newline */
function addEndtoBlockProps(props, end) {
if (end)
for (const st of end)
switch (st.type) {
case 'space':
case 'comment':
props.push(st);
break;
case 'newline':
props.push(st);
return true;
}
return false;
}
function setFlowScalarValue(token, source, type) {
switch (token.type) {
case 'scalar':
case 'double-quoted-scalar':
case 'single-quoted-scalar':
token.type = type;
token.source = source;
break;
case 'block-scalar': {
const end = token.props.slice(1);
let oa = source.length;
if (token.props[0].type === 'block-scalar-header')
oa -= token.props[0].source.length;
for (const tok of end)
tok.offset += oa;
delete token.props;
Object.assign(token, { type, source, end });
break;
}
case 'block-map':
case 'block-seq': {
const offset = token.offset + source.length;
const nl = { type: 'newline', offset, indent: token.indent, source: '\n' };
delete token.items;
Object.assign(token, { type, source, end: [nl] });
break;
}
default: {
const indent = 'indent' in token ? token.indent : -1;
const end = 'end' in token && Array.isArray(token.end)
? token.end.filter(st => st.type === 'space' ||
st.type === 'comment' ||
st.type === 'newline')
: [];
for (const key of Object.keys(token))
if (key !== 'type' && key !== 'offset')
delete token[key];
Object.assign(token, { type, indent, source, end });
}
}
}
export { createScalarToken, resolveAsScalar, setScalarValue };

View File

@@ -1,61 +0,0 @@
/**
* Stringify a CST document, token, or collection item
*
* Fair warning: This applies no validation whatsoever, and
* simply concatenates the sources in their logical order.
*/
const stringify = (cst) => 'type' in cst ? stringifyToken(cst) : stringifyItem(cst);
function stringifyToken(token) {
switch (token.type) {
case 'block-scalar': {
let res = '';
for (const tok of token.props)
res += stringifyToken(tok);
return res + token.source;
}
case 'block-map':
case 'block-seq': {
let res = '';
for (const item of token.items)
res += stringifyItem(item);
return res;
}
case 'flow-collection': {
let res = token.start.source;
for (const item of token.items)
res += stringifyItem(item);
for (const st of token.end)
res += st.source;
return res;
}
case 'document': {
let res = stringifyItem(token);
if (token.end)
for (const st of token.end)
res += st.source;
return res;
}
default: {
let res = token.source;
if ('end' in token && token.end)
for (const st of token.end)
res += st.source;
return res;
}
}
}
function stringifyItem({ start, key, sep, value }) {
let res = '';
for (const st of start)
res += st.source;
if (key)
res += stringifyToken(key);
if (sep)
for (const st of sep)
res += st.source;
if (value)
res += stringifyToken(value);
return res;
}
export { stringify };

View File

@@ -1,97 +0,0 @@
const BREAK = Symbol('break visit');
const SKIP = Symbol('skip children');
const REMOVE = Symbol('remove item');
/**
* Apply a visitor to a CST document or item.
*
* Walks through the tree (depth-first) starting from the root, calling a
* `visitor` function with two arguments when entering each item:
* - `item`: The current item, which included the following members:
* - `start: SourceToken[]` Source tokens before the key or value,
* possibly including its anchor or tag.
* - `key?: Token | null` Set for pair values. May then be `null`, if
* the key before the `:` separator is empty.
* - `sep?: SourceToken[]` Source tokens between the key and the value,
* which should include the `:` map value indicator if `value` is set.
* - `value?: Token` The value of a sequence item, or of a map pair.
* - `path`: The steps from the root to the current node, as an array of
* `['key' | 'value', number]` tuples.
*
* The return value of the visitor may be used to control the traversal:
* - `undefined` (default): Do nothing and continue
* - `visit.SKIP`: Do not visit the children of this token, continue with
* next sibling
* - `visit.BREAK`: Terminate traversal completely
* - `visit.REMOVE`: Remove the current item, then continue with the next one
* - `number`: Set the index of the next step. This is useful especially if
* the index of the current token has changed.
* - `function`: Define the next visitor for this item. After the original
* visitor is called on item entry, next visitors are called after handling
* a non-empty `key` and when exiting the item.
*/
function visit(cst, visitor) {
if ('type' in cst && cst.type === 'document')
cst = { start: cst.start, value: cst.value };
_visit(Object.freeze([]), cst, visitor);
}
// Without the `as symbol` casts, TS declares these in the `visit`
// namespace using `var`, but then complains about that because
// `unique symbol` must be `const`.
/** Terminate visit traversal completely */
visit.BREAK = BREAK;
/** Do not visit the children of the current item */
visit.SKIP = SKIP;
/** Remove the current item */
visit.REMOVE = REMOVE;
/** Find the item at `path` from `cst` as the root */
visit.itemAtPath = (cst, path) => {
let item = cst;
for (const [field, index] of path) {
const tok = item?.[field];
if (tok && 'items' in tok) {
item = tok.items[index];
}
else
return undefined;
}
return item;
};
/**
* Get the immediate parent collection of the item at `path` from `cst` as the root.
*
* Throws an error if the collection is not found, which should never happen if the item itself exists.
*/
visit.parentCollection = (cst, path) => {
const parent = visit.itemAtPath(cst, path.slice(0, -1));
const field = path[path.length - 1][0];
const coll = parent?.[field];
if (coll && 'items' in coll)
return coll;
throw new Error('Parent collection not found');
};
function _visit(path, item, visitor) {
let ctrl = visitor(item, path);
if (typeof ctrl === 'symbol')
return ctrl;
for (const field of ['key', 'value']) {
const token = item[field];
if (token && 'items' in token) {
for (let i = 0; i < token.items.length; ++i) {
const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);
if (typeof ci === 'number')
i = ci - 1;
else if (ci === BREAK)
return BREAK;
else if (ci === REMOVE) {
token.items.splice(i, 1);
i -= 1;
}
}
if (typeof ctrl === 'function' && field === 'key')
ctrl = ctrl(item, path);
}
}
return typeof ctrl === 'function' ? ctrl(item, path) : ctrl;
}
export { visit };

View File

@@ -1,98 +0,0 @@
export { createScalarToken, resolveAsScalar, setScalarValue } from './cst-scalar.js';
export { stringify } from './cst-stringify.js';
export { visit } from './cst-visit.js';
/** The byte order mark */
const BOM = '\u{FEFF}';
/** Start of doc-mode */
const DOCUMENT = '\x02'; // C0: Start of Text
/** Unexpected end of flow-mode */
const FLOW_END = '\x18'; // C0: Cancel
/** Next token is a scalar value */
const SCALAR = '\x1f'; // C0: Unit Separator
/** @returns `true` if `token` is a flow or block collection */
const isCollection = (token) => !!token && 'items' in token;
/** @returns `true` if `token` is a flow or block scalar; not an alias */
const isScalar = (token) => !!token &&
(token.type === 'scalar' ||
token.type === 'single-quoted-scalar' ||
token.type === 'double-quoted-scalar' ||
token.type === 'block-scalar');
/* istanbul ignore next */
/** Get a printable representation of a lexer token */
function prettyToken(token) {
switch (token) {
case BOM:
return '<BOM>';
case DOCUMENT:
return '<DOC>';
case FLOW_END:
return '<FLOW_END>';
case SCALAR:
return '<SCALAR>';
default:
return JSON.stringify(token);
}
}
/** Identify the type of a lexer token. May return `null` for unknown tokens. */
function tokenType(source) {
switch (source) {
case BOM:
return 'byte-order-mark';
case DOCUMENT:
return 'doc-mode';
case FLOW_END:
return 'flow-error-end';
case SCALAR:
return 'scalar';
case '---':
return 'doc-start';
case '...':
return 'doc-end';
case '':
case '\n':
case '\r\n':
return 'newline';
case '-':
return 'seq-item-ind';
case '?':
return 'explicit-key-ind';
case ':':
return 'map-value-ind';
case '{':
return 'flow-map-start';
case '}':
return 'flow-map-end';
case '[':
return 'flow-seq-start';
case ']':
return 'flow-seq-end';
case ',':
return 'comma';
}
switch (source[0]) {
case ' ':
case '\t':
return 'space';
case '#':
return 'comment';
case '%':
return 'directive-line';
case '*':
return 'alias';
case '&':
return 'anchor';
case '!':
return 'tag';
case "'":
return 'single-quoted-scalar';
case '"':
return 'double-quoted-scalar';
case '|':
case '>':
return 'block-scalar-header';
}
return null;
}
export { BOM, DOCUMENT, FLOW_END, SCALAR, isCollection, isScalar, prettyToken, tokenType };

View File

@@ -1,717 +0,0 @@
import { BOM, DOCUMENT, FLOW_END, SCALAR } from './cst.js';
/*
START -> stream
stream
directive -> line-end -> stream
indent + line-end -> stream
[else] -> line-start
line-end
comment -> line-end
newline -> .
input-end -> END
line-start
doc-start -> doc
doc-end -> stream
[else] -> indent -> block-start
block-start
seq-item-start -> block-start
explicit-key-start -> block-start
map-value-start -> block-start
[else] -> doc
doc
line-end -> line-start
spaces -> doc
anchor -> doc
tag -> doc
flow-start -> flow -> doc
flow-end -> error -> doc
seq-item-start -> error -> doc
explicit-key-start -> error -> doc
map-value-start -> doc
alias -> doc
quote-start -> quoted-scalar -> doc
block-scalar-header -> line-end -> block-scalar(min) -> line-start
[else] -> plain-scalar(false, min) -> doc
flow
line-end -> flow
spaces -> flow
anchor -> flow
tag -> flow
flow-start -> flow -> flow
flow-end -> .
seq-item-start -> error -> flow
explicit-key-start -> flow
map-value-start -> flow
alias -> flow
quote-start -> quoted-scalar -> flow
comma -> flow
[else] -> plain-scalar(true, 0) -> flow
quoted-scalar
quote-end -> .
[else] -> quoted-scalar
block-scalar(min)
newline + peek(indent < min) -> .
[else] -> block-scalar(min)
plain-scalar(is-flow, min)
scalar-end(is-flow) -> .
peek(newline + (indent < min)) -> .
[else] -> plain-scalar(min)
*/
function isEmpty(ch) {
switch (ch) {
case undefined:
case ' ':
case '\n':
case '\r':
case '\t':
return true;
default:
return false;
}
}
const hexDigits = new Set('0123456789ABCDEFabcdef');
const tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
const flowIndicatorChars = new Set(',[]{}');
const invalidAnchorChars = new Set(' ,[]{}\n\r\t');
const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
/**
* Splits an input string into lexical tokens, i.e. smaller strings that are
* easily identifiable by `tokens.tokenType()`.
*
* Lexing starts always in a "stream" context. Incomplete input may be buffered
* until a complete token can be emitted.
*
* In addition to slices of the original input, the following control characters
* may also be emitted:
*
* - `\x02` (Start of Text): A document starts with the next token
* - `\x18` (Cancel): Unexpected end of flow-mode (indicates an error)
* - `\x1f` (Unit Separator): Next token is a scalar value
* - `\u{FEFF}` (Byte order mark): Emitted separately outside documents
*/
class Lexer {
constructor() {
/**
* Flag indicating whether the end of the current buffer marks the end of
* all input
*/
this.atEnd = false;
/**
* Explicit indent set in block scalar header, as an offset from the current
* minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not
* explicitly set.
*/
this.blockScalarIndent = -1;
/**
* Block scalars that include a + (keep) chomping indicator in their header
* include trailing empty lines, which are otherwise excluded from the
* scalar's contents.
*/
this.blockScalarKeep = false;
/** Current input */
this.buffer = '';
/**
* Flag noting whether the map value indicator : can immediately follow this
* node within a flow context.
*/
this.flowKey = false;
/** Count of surrounding flow collection levels. */
this.flowLevel = 0;
/**
* Minimum level of indentation required for next lines to be parsed as a
* part of the current scalar value.
*/
this.indentNext = 0;
/** Indentation level of the current line. */
this.indentValue = 0;
/** Position of the next \n character. */
this.lineEndPos = null;
/** Stores the state of the lexer if reaching the end of incpomplete input */
this.next = null;
/** A pointer to `buffer`; the current position of the lexer. */
this.pos = 0;
}
/**
* Generate YAML tokens from the `source` string. If `incomplete`,
* a part of the last line may be left as a buffer for the next call.
*
* @returns A generator of lexical tokens
*/
*lex(source, incomplete = false) {
if (source) {
if (typeof source !== 'string')
throw TypeError('source is not a string');
this.buffer = this.buffer ? this.buffer + source : source;
this.lineEndPos = null;
}
this.atEnd = !incomplete;
let next = this.next ?? 'stream';
while (next && (incomplete || this.hasChars(1)))
next = yield* this.parseNext(next);
}
atLineEnd() {
let i = this.pos;
let ch = this.buffer[i];
while (ch === ' ' || ch === '\t')
ch = this.buffer[++i];
if (!ch || ch === '#' || ch === '\n')
return true;
if (ch === '\r')
return this.buffer[i + 1] === '\n';
return false;
}
charAt(n) {
return this.buffer[this.pos + n];
}
continueScalar(offset) {
let ch = this.buffer[offset];
if (this.indentNext > 0) {
let indent = 0;
while (ch === ' ')
ch = this.buffer[++indent + offset];
if (ch === '\r') {
const next = this.buffer[indent + offset + 1];
if (next === '\n' || (!next && !this.atEnd))
return offset + indent + 1;
}
return ch === '\n' || indent >= this.indentNext || (!ch && !this.atEnd)
? offset + indent
: -1;
}
if (ch === '-' || ch === '.') {
const dt = this.buffer.substr(offset, 3);
if ((dt === '---' || dt === '...') && isEmpty(this.buffer[offset + 3]))
return -1;
}
return offset;
}
getLine() {
let end = this.lineEndPos;
if (typeof end !== 'number' || (end !== -1 && end < this.pos)) {
end = this.buffer.indexOf('\n', this.pos);
this.lineEndPos = end;
}
if (end === -1)
return this.atEnd ? this.buffer.substring(this.pos) : null;
if (this.buffer[end - 1] === '\r')
end -= 1;
return this.buffer.substring(this.pos, end);
}
hasChars(n) {
return this.pos + n <= this.buffer.length;
}
setNext(state) {
this.buffer = this.buffer.substring(this.pos);
this.pos = 0;
this.lineEndPos = null;
this.next = state;
return null;
}
peek(n) {
return this.buffer.substr(this.pos, n);
}
*parseNext(next) {
switch (next) {
case 'stream':
return yield* this.parseStream();
case 'line-start':
return yield* this.parseLineStart();
case 'block-start':
return yield* this.parseBlockStart();
case 'doc':
return yield* this.parseDocument();
case 'flow':
return yield* this.parseFlowCollection();
case 'quoted-scalar':
return yield* this.parseQuotedScalar();
case 'block-scalar':
return yield* this.parseBlockScalar();
case 'plain-scalar':
return yield* this.parsePlainScalar();
}
}
*parseStream() {
let line = this.getLine();
if (line === null)
return this.setNext('stream');
if (line[0] === BOM) {
yield* this.pushCount(1);
line = line.substring(1);
}
if (line[0] === '%') {
let dirEnd = line.length;
let cs = line.indexOf('#');
while (cs !== -1) {
const ch = line[cs - 1];
if (ch === ' ' || ch === '\t') {
dirEnd = cs - 1;
break;
}
else {
cs = line.indexOf('#', cs + 1);
}
}
while (true) {
const ch = line[dirEnd - 1];
if (ch === ' ' || ch === '\t')
dirEnd -= 1;
else
break;
}
const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
yield* this.pushCount(line.length - n); // possible comment
this.pushNewline();
return 'stream';
}
if (this.atLineEnd()) {
const sp = yield* this.pushSpaces(true);
yield* this.pushCount(line.length - sp);
yield* this.pushNewline();
return 'stream';
}
yield DOCUMENT;
return yield* this.parseLineStart();
}
*parseLineStart() {
const ch = this.charAt(0);
if (!ch && !this.atEnd)
return this.setNext('line-start');
if (ch === '-' || ch === '.') {
if (!this.atEnd && !this.hasChars(4))
return this.setNext('line-start');
const s = this.peek(3);
if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {
yield* this.pushCount(3);
this.indentValue = 0;
this.indentNext = 0;
return s === '---' ? 'doc' : 'stream';
}
}
this.indentValue = yield* this.pushSpaces(false);
if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))
this.indentNext = this.indentValue;
return yield* this.parseBlockStart();
}
*parseBlockStart() {
const [ch0, ch1] = this.peek(2);
if (!ch1 && !this.atEnd)
return this.setNext('block-start');
if ((ch0 === '-' || ch0 === '?' || ch0 === ':') && isEmpty(ch1)) {
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
this.indentNext = this.indentValue + 1;
this.indentValue += n;
return yield* this.parseBlockStart();
}
return 'doc';
}
*parseDocument() {
yield* this.pushSpaces(true);
const line = this.getLine();
if (line === null)
return this.setNext('doc');
let n = yield* this.pushIndicators();
switch (line[n]) {
case '#':
yield* this.pushCount(line.length - n);
// fallthrough
case undefined:
yield* this.pushNewline();
return yield* this.parseLineStart();
case '{':
case '[':
yield* this.pushCount(1);
this.flowKey = false;
this.flowLevel = 1;
return 'flow';
case '}':
case ']':
// this is an error
yield* this.pushCount(1);
return 'doc';
case '*':
yield* this.pushUntil(isNotAnchorChar);
return 'doc';
case '"':
case "'":
return yield* this.parseQuotedScalar();
case '|':
case '>':
n += yield* this.parseBlockScalarHeader();
n += yield* this.pushSpaces(true);
yield* this.pushCount(line.length - n);
yield* this.pushNewline();
return yield* this.parseBlockScalar();
default:
return yield* this.parsePlainScalar();
}
}
*parseFlowCollection() {
let nl, sp;
let indent = -1;
do {
nl = yield* this.pushNewline();
if (nl > 0) {
sp = yield* this.pushSpaces(false);
this.indentValue = indent = sp;
}
else {
sp = 0;
}
sp += yield* this.pushSpaces(true);
} while (nl + sp > 0);
const line = this.getLine();
if (line === null)
return this.setNext('flow');
if ((indent !== -1 && indent < this.indentNext && line[0] !== '#') ||
(indent === 0 &&
(line.startsWith('---') || line.startsWith('...')) &&
isEmpty(line[3]))) {
// Allowing for the terminal ] or } at the same (rather than greater)
// indent level as the initial [ or { is technically invalid, but
// failing here would be surprising to users.
const atFlowEndMarker = indent === this.indentNext - 1 &&
this.flowLevel === 1 &&
(line[0] === ']' || line[0] === '}');
if (!atFlowEndMarker) {
// this is an error
this.flowLevel = 0;
yield FLOW_END;
return yield* this.parseLineStart();
}
}
let n = 0;
while (line[n] === ',') {
n += yield* this.pushCount(1);
n += yield* this.pushSpaces(true);
this.flowKey = false;
}
n += yield* this.pushIndicators();
switch (line[n]) {
case undefined:
return 'flow';
case '#':
yield* this.pushCount(line.length - n);
return 'flow';
case '{':
case '[':
yield* this.pushCount(1);
this.flowKey = false;
this.flowLevel += 1;
return 'flow';
case '}':
case ']':
yield* this.pushCount(1);
this.flowKey = true;
this.flowLevel -= 1;
return this.flowLevel ? 'flow' : 'doc';
case '*':
yield* this.pushUntil(isNotAnchorChar);
return 'flow';
case '"':
case "'":
this.flowKey = true;
return yield* this.parseQuotedScalar();
case ':': {
const next = this.charAt(1);
if (this.flowKey || isEmpty(next) || next === ',') {
this.flowKey = false;
yield* this.pushCount(1);
yield* this.pushSpaces(true);
return 'flow';
}
}
// fallthrough
default:
this.flowKey = false;
return yield* this.parsePlainScalar();
}
}
*parseQuotedScalar() {
const quote = this.charAt(0);
let end = this.buffer.indexOf(quote, this.pos + 1);
if (quote === "'") {
while (end !== -1 && this.buffer[end + 1] === "'")
end = this.buffer.indexOf("'", end + 2);
}
else {
// double-quote
while (end !== -1) {
let n = 0;
while (this.buffer[end - 1 - n] === '\\')
n += 1;
if (n % 2 === 0)
break;
end = this.buffer.indexOf('"', end + 1);
}
}
// Only looking for newlines within the quotes
const qb = this.buffer.substring(0, end);
let nl = qb.indexOf('\n', this.pos);
if (nl !== -1) {
while (nl !== -1) {
const cs = this.continueScalar(nl + 1);
if (cs === -1)
break;
nl = qb.indexOf('\n', cs);
}
if (nl !== -1) {
// this is an error caused by an unexpected unindent
end = nl - (qb[nl - 1] === '\r' ? 2 : 1);
}
}
if (end === -1) {
if (!this.atEnd)
return this.setNext('quoted-scalar');
end = this.buffer.length;
}
yield* this.pushToIndex(end + 1, false);
return this.flowLevel ? 'flow' : 'doc';
}
*parseBlockScalarHeader() {
this.blockScalarIndent = -1;
this.blockScalarKeep = false;
let i = this.pos;
while (true) {
const ch = this.buffer[++i];
if (ch === '+')
this.blockScalarKeep = true;
else if (ch > '0' && ch <= '9')
this.blockScalarIndent = Number(ch) - 1;
else if (ch !== '-')
break;
}
return yield* this.pushUntil(ch => isEmpty(ch) || ch === '#');
}
*parseBlockScalar() {
let nl = this.pos - 1; // may be -1 if this.pos === 0
let indent = 0;
let ch;
loop: for (let i = this.pos; (ch = this.buffer[i]); ++i) {
switch (ch) {
case ' ':
indent += 1;
break;
case '\n':
nl = i;
indent = 0;
break;
case '\r': {
const next = this.buffer[i + 1];
if (!next && !this.atEnd)
return this.setNext('block-scalar');
if (next === '\n')
break;
} // fallthrough
default:
break loop;
}
}
if (!ch && !this.atEnd)
return this.setNext('block-scalar');
if (indent >= this.indentNext) {
if (this.blockScalarIndent === -1)
this.indentNext = indent;
else {
this.indentNext =
this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
}
do {
const cs = this.continueScalar(nl + 1);
if (cs === -1)
break;
nl = this.buffer.indexOf('\n', cs);
} while (nl !== -1);
if (nl === -1) {
if (!this.atEnd)
return this.setNext('block-scalar');
nl = this.buffer.length;
}
}
// Trailing insufficiently indented tabs are invalid.
// To catch that during parsing, we include them in the block scalar value.
let i = nl + 1;
ch = this.buffer[i];
while (ch === ' ')
ch = this.buffer[++i];
if (ch === '\t') {
while (ch === '\t' || ch === ' ' || ch === '\r' || ch === '\n')
ch = this.buffer[++i];
nl = i - 1;
}
else if (!this.blockScalarKeep) {
do {
let i = nl - 1;
let ch = this.buffer[i];
if (ch === '\r')
ch = this.buffer[--i];
const lastChar = i; // Drop the line if last char not more indented
while (ch === ' ')
ch = this.buffer[--i];
if (ch === '\n' && i >= this.pos && i + 1 + indent > lastChar)
nl = i;
else
break;
} while (true);
}
yield SCALAR;
yield* this.pushToIndex(nl + 1, true);
return yield* this.parseLineStart();
}
*parsePlainScalar() {
const inFlow = this.flowLevel > 0;
let end = this.pos - 1;
let i = this.pos - 1;
let ch;
while ((ch = this.buffer[++i])) {
if (ch === ':') {
const next = this.buffer[i + 1];
if (isEmpty(next) || (inFlow && flowIndicatorChars.has(next)))
break;
end = i;
}
else if (isEmpty(ch)) {
let next = this.buffer[i + 1];
if (ch === '\r') {
if (next === '\n') {
i += 1;
ch = '\n';
next = this.buffer[i + 1];
}
else
end = i;
}
if (next === '#' || (inFlow && flowIndicatorChars.has(next)))
break;
if (ch === '\n') {
const cs = this.continueScalar(i + 1);
if (cs === -1)
break;
i = Math.max(i, cs - 2); // to advance, but still account for ' #'
}
}
else {
if (inFlow && flowIndicatorChars.has(ch))
break;
end = i;
}
}
if (!ch && !this.atEnd)
return this.setNext('plain-scalar');
yield SCALAR;
yield* this.pushToIndex(end + 1, true);
return inFlow ? 'flow' : 'doc';
}
*pushCount(n) {
if (n > 0) {
yield this.buffer.substr(this.pos, n);
this.pos += n;
return n;
}
return 0;
}
*pushToIndex(i, allowEmpty) {
const s = this.buffer.slice(this.pos, i);
if (s) {
yield s;
this.pos += s.length;
return s.length;
}
else if (allowEmpty)
yield '';
return 0;
}
*pushIndicators() {
switch (this.charAt(0)) {
case '!':
return ((yield* this.pushTag()) +
(yield* this.pushSpaces(true)) +
(yield* this.pushIndicators()));
case '&':
return ((yield* this.pushUntil(isNotAnchorChar)) +
(yield* this.pushSpaces(true)) +
(yield* this.pushIndicators()));
case '-': // this is an error
case '?': // this is an error outside flow collections
case ':': {
const inFlow = this.flowLevel > 0;
const ch1 = this.charAt(1);
if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
if (!inFlow)
this.indentNext = this.indentValue + 1;
else if (this.flowKey)
this.flowKey = false;
return ((yield* this.pushCount(1)) +
(yield* this.pushSpaces(true)) +
(yield* this.pushIndicators()));
}
}
}
return 0;
}
*pushTag() {
if (this.charAt(1) === '<') {
let i = this.pos + 2;
let ch = this.buffer[i];
while (!isEmpty(ch) && ch !== '>')
ch = this.buffer[++i];
return yield* this.pushToIndex(ch === '>' ? i + 1 : i, false);
}
else {
let i = this.pos + 1;
let ch = this.buffer[i];
while (ch) {
if (tagChars.has(ch))
ch = this.buffer[++i];
else if (ch === '%' &&
hexDigits.has(this.buffer[i + 1]) &&
hexDigits.has(this.buffer[i + 2])) {
ch = this.buffer[(i += 3)];
}
else
break;
}
return yield* this.pushToIndex(i, false);
}
}
*pushNewline() {
const ch = this.buffer[this.pos];
if (ch === '\n')
return yield* this.pushCount(1);
else if (ch === '\r' && this.charAt(1) === '\n')
return yield* this.pushCount(2);
else
return 0;
}
*pushSpaces(allowTabs) {
let i = this.pos - 1;
let ch;
do {
ch = this.buffer[++i];
} while (ch === ' ' || (allowTabs && ch === '\t'));
const n = i - this.pos;
if (n > 0) {
yield this.buffer.substr(this.pos, n);
this.pos = i;
}
return n;
}
*pushUntil(test) {
let i = this.pos;
let ch = this.buffer[i];
while (!test(ch))
ch = this.buffer[++i];
return yield* this.pushToIndex(i, false);
}
}
export { Lexer };

View File

@@ -1,39 +0,0 @@
/**
* Tracks newlines during parsing in order to provide an efficient API for
* determining the one-indexed `{ line, col }` position for any offset
* within the input.
*/
class LineCounter {
constructor() {
this.lineStarts = [];
/**
* Should be called in ascending order. Otherwise, call
* `lineCounter.lineStarts.sort()` before calling `linePos()`.
*/
this.addNewLine = (offset) => this.lineStarts.push(offset);
/**
* Performs a binary search and returns the 1-indexed { line, col }
* position of `offset`. If `line === 0`, `addNewLine` has never been
* called or `offset` is before the first known newline.
*/
this.linePos = (offset) => {
let low = 0;
let high = this.lineStarts.length;
while (low < high) {
const mid = (low + high) >> 1; // Math.floor((low + high) / 2)
if (this.lineStarts[mid] < offset)
low = mid + 1;
else
high = mid;
}
if (this.lineStarts[low] === offset)
return { line: low + 1, col: 1 };
if (low === 0)
return { line: 0, col: offset };
const start = this.lineStarts[low - 1];
return { line: low, col: offset - start + 1 };
};
}
}
export { LineCounter };

View File

@@ -1,967 +0,0 @@
import { tokenType } from './cst.js';
import { Lexer } from './lexer.js';
function includesToken(list, type) {
for (let i = 0; i < list.length; ++i)
if (list[i].type === type)
return true;
return false;
}
function findNonEmptyIndex(list) {
for (let i = 0; i < list.length; ++i) {
switch (list[i].type) {
case 'space':
case 'comment':
case 'newline':
break;
default:
return i;
}
}
return -1;
}
function isFlowToken(token) {
switch (token?.type) {
case 'alias':
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar':
case 'flow-collection':
return true;
default:
return false;
}
}
function getPrevProps(parent) {
switch (parent.type) {
case 'document':
return parent.start;
case 'block-map': {
const it = parent.items[parent.items.length - 1];
return it.sep ?? it.start;
}
case 'block-seq':
return parent.items[parent.items.length - 1].start;
/* istanbul ignore next should not happen */
default:
return [];
}
}
/** Note: May modify input array */
function getFirstKeyStartProps(prev) {
if (prev.length === 0)
return [];
let i = prev.length;
loop: while (--i >= 0) {
switch (prev[i].type) {
case 'doc-start':
case 'explicit-key-ind':
case 'map-value-ind':
case 'seq-item-ind':
case 'newline':
break loop;
}
}
while (prev[++i]?.type === 'space') {
/* loop */
}
return prev.splice(i, prev.length);
}
function fixFlowSeqItems(fc) {
if (fc.start.type === 'flow-seq-start') {
for (const it of fc.items) {
if (it.sep &&
!it.value &&
!includesToken(it.start, 'explicit-key-ind') &&
!includesToken(it.sep, 'map-value-ind')) {
if (it.key)
it.value = it.key;
delete it.key;
if (isFlowToken(it.value)) {
if (it.value.end)
Array.prototype.push.apply(it.value.end, it.sep);
else
it.value.end = it.sep;
}
else
Array.prototype.push.apply(it.start, it.sep);
delete it.sep;
}
}
}
}
/**
* A YAML concrete syntax tree (CST) parser
*
* ```ts
* const src: string = ...
* for (const token of new Parser().parse(src)) {
* // token: Token
* }
* ```
*
* To use the parser with a user-provided lexer:
*
* ```ts
* function* parse(source: string, lexer: Lexer) {
* const parser = new Parser()
* for (const lexeme of lexer.lex(source))
* yield* parser.next(lexeme)
* yield* parser.end()
* }
*
* const src: string = ...
* const lexer = new Lexer()
* for (const token of parse(src, lexer)) {
* // token: Token
* }
* ```
*/
class Parser {
/**
* @param onNewLine - If defined, called separately with the start position of
* each new line (in `parse()`, including the start of input).
*/
constructor(onNewLine) {
/** If true, space and sequence indicators count as indentation */
this.atNewLine = true;
/** If true, next token is a scalar value */
this.atScalar = false;
/** Current indentation level */
this.indent = 0;
/** Current offset since the start of parsing */
this.offset = 0;
/** On the same line with a block map key */
this.onKeyLine = false;
/** Top indicates the node that's currently being built */
this.stack = [];
/** The source of the current token, set in parse() */
this.source = '';
/** The type of the current token, set in parse() */
this.type = '';
// Must be defined after `next()`
this.lexer = new Lexer();
this.onNewLine = onNewLine;
}
/**
* Parse `source` as a YAML stream.
* If `incomplete`, a part of the last line may be left as a buffer for the next call.
*
* Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.
*
* @returns A generator of tokens representing each directive, document, and other structure.
*/
*parse(source, incomplete = false) {
if (this.onNewLine && this.offset === 0)
this.onNewLine(0);
for (const lexeme of this.lexer.lex(source, incomplete))
yield* this.next(lexeme);
if (!incomplete)
yield* this.end();
}
/**
* Advance the parser by the `source` of one lexical token.
*/
*next(source) {
this.source = source;
if (this.atScalar) {
this.atScalar = false;
yield* this.step();
this.offset += source.length;
return;
}
const type = tokenType(source);
if (!type) {
const message = `Not a YAML token: ${source}`;
yield* this.pop({ type: 'error', offset: this.offset, message, source });
this.offset += source.length;
}
else if (type === 'scalar') {
this.atNewLine = false;
this.atScalar = true;
this.type = 'scalar';
}
else {
this.type = type;
yield* this.step();
switch (type) {
case 'newline':
this.atNewLine = true;
this.indent = 0;
if (this.onNewLine)
this.onNewLine(this.offset + source.length);
break;
case 'space':
if (this.atNewLine && source[0] === ' ')
this.indent += source.length;
break;
case 'explicit-key-ind':
case 'map-value-ind':
case 'seq-item-ind':
if (this.atNewLine)
this.indent += source.length;
break;
case 'doc-mode':
case 'flow-error-end':
return;
default:
this.atNewLine = false;
}
this.offset += source.length;
}
}
/** Call at end of input to push out any remaining constructions */
*end() {
while (this.stack.length > 0)
yield* this.pop();
}
get sourceToken() {
const st = {
type: this.type,
offset: this.offset,
indent: this.indent,
source: this.source
};
return st;
}
*step() {
const top = this.peek(1);
if (this.type === 'doc-end' && top?.type !== 'doc-end') {
while (this.stack.length > 0)
yield* this.pop();
this.stack.push({
type: 'doc-end',
offset: this.offset,
source: this.source
});
return;
}
if (!top)
return yield* this.stream();
switch (top.type) {
case 'document':
return yield* this.document(top);
case 'alias':
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar':
return yield* this.scalar(top);
case 'block-scalar':
return yield* this.blockScalar(top);
case 'block-map':
return yield* this.blockMap(top);
case 'block-seq':
return yield* this.blockSequence(top);
case 'flow-collection':
return yield* this.flowCollection(top);
case 'doc-end':
return yield* this.documentEnd(top);
}
/* istanbul ignore next should not happen */
yield* this.pop();
}
peek(n) {
return this.stack[this.stack.length - n];
}
*pop(error) {
const token = error ?? this.stack.pop();
/* istanbul ignore if should not happen */
if (!token) {
const message = 'Tried to pop an empty stack';
yield { type: 'error', offset: this.offset, source: '', message };
}
else if (this.stack.length === 0) {
yield token;
}
else {
const top = this.peek(1);
if (token.type === 'block-scalar') {
// Block scalars use their parent rather than header indent
token.indent = 'indent' in top ? top.indent : 0;
}
else if (token.type === 'flow-collection' && top.type === 'document') {
// Ignore all indent for top-level flow collections
token.indent = 0;
}
if (token.type === 'flow-collection')
fixFlowSeqItems(token);
switch (top.type) {
case 'document':
top.value = token;
break;
case 'block-scalar':
top.props.push(token); // error
break;
case 'block-map': {
const it = top.items[top.items.length - 1];
if (it.value) {
top.items.push({ start: [], key: token, sep: [] });
this.onKeyLine = true;
return;
}
else if (it.sep) {
it.value = token;
}
else {
Object.assign(it, { key: token, sep: [] });
this.onKeyLine = !it.explicitKey;
return;
}
break;
}
case 'block-seq': {
const it = top.items[top.items.length - 1];
if (it.value)
top.items.push({ start: [], value: token });
else
it.value = token;
break;
}
case 'flow-collection': {
const it = top.items[top.items.length - 1];
if (!it || it.value)
top.items.push({ start: [], key: token, sep: [] });
else if (it.sep)
it.value = token;
else
Object.assign(it, { key: token, sep: [] });
return;
}
/* istanbul ignore next should not happen */
default:
yield* this.pop();
yield* this.pop(token);
}
if ((top.type === 'document' ||
top.type === 'block-map' ||
top.type === 'block-seq') &&
(token.type === 'block-map' || token.type === 'block-seq')) {
const last = token.items[token.items.length - 1];
if (last &&
!last.sep &&
!last.value &&
last.start.length > 0 &&
findNonEmptyIndex(last.start) === -1 &&
(token.indent === 0 ||
last.start.every(st => st.type !== 'comment' || st.indent < token.indent))) {
if (top.type === 'document')
top.end = last.start;
else
top.items.push({ start: last.start });
token.items.splice(-1, 1);
}
}
}
}
*stream() {
switch (this.type) {
case 'directive-line':
yield { type: 'directive', offset: this.offset, source: this.source };
return;
case 'byte-order-mark':
case 'space':
case 'comment':
case 'newline':
yield this.sourceToken;
return;
case 'doc-mode':
case 'doc-start': {
const doc = {
type: 'document',
offset: this.offset,
start: []
};
if (this.type === 'doc-start')
doc.start.push(this.sourceToken);
this.stack.push(doc);
return;
}
}
yield {
type: 'error',
offset: this.offset,
message: `Unexpected ${this.type} token in YAML stream`,
source: this.source
};
}
*document(doc) {
if (doc.value)
return yield* this.lineEnd(doc);
switch (this.type) {
case 'doc-start': {
if (findNonEmptyIndex(doc.start) !== -1) {
yield* this.pop();
yield* this.step();
}
else
doc.start.push(this.sourceToken);
return;
}
case 'anchor':
case 'tag':
case 'space':
case 'comment':
case 'newline':
doc.start.push(this.sourceToken);
return;
}
const bv = this.startBlockValue(doc);
if (bv)
this.stack.push(bv);
else {
yield {
type: 'error',
offset: this.offset,
message: `Unexpected ${this.type} token in YAML document`,
source: this.source
};
}
}
*scalar(scalar) {
if (this.type === 'map-value-ind') {
const prev = getPrevProps(this.peek(2));
const start = getFirstKeyStartProps(prev);
let sep;
if (scalar.end) {
sep = scalar.end;
sep.push(this.sourceToken);
delete scalar.end;
}
else
sep = [this.sourceToken];
const map = {
type: 'block-map',
offset: scalar.offset,
indent: scalar.indent,
items: [{ start, key: scalar, sep }]
};
this.onKeyLine = true;
this.stack[this.stack.length - 1] = map;
}
else
yield* this.lineEnd(scalar);
}
*blockScalar(scalar) {
switch (this.type) {
case 'space':
case 'comment':
case 'newline':
scalar.props.push(this.sourceToken);
return;
case 'scalar':
scalar.source = this.source;
// block-scalar source includes trailing newline
this.atNewLine = true;
this.indent = 0;
if (this.onNewLine) {
let nl = this.source.indexOf('\n') + 1;
while (nl !== 0) {
this.onNewLine(this.offset + nl);
nl = this.source.indexOf('\n', nl) + 1;
}
}
yield* this.pop();
break;
/* istanbul ignore next should not happen */
default:
yield* this.pop();
yield* this.step();
}
}
*blockMap(map) {
const it = map.items[map.items.length - 1];
// it.sep is true-ish if pair already has key or : separator
switch (this.type) {
case 'newline':
this.onKeyLine = false;
if (it.value) {
const end = 'end' in it.value ? it.value.end : undefined;
const last = Array.isArray(end) ? end[end.length - 1] : undefined;
if (last?.type === 'comment')
end?.push(this.sourceToken);
else
map.items.push({ start: [this.sourceToken] });
}
else if (it.sep) {
it.sep.push(this.sourceToken);
}
else {
it.start.push(this.sourceToken);
}
return;
case 'space':
case 'comment':
if (it.value) {
map.items.push({ start: [this.sourceToken] });
}
else if (it.sep) {
it.sep.push(this.sourceToken);
}
else {
if (this.atIndentedComment(it.start, map.indent)) {
const prev = map.items[map.items.length - 2];
const end = prev?.value?.end;
if (Array.isArray(end)) {
Array.prototype.push.apply(end, it.start);
end.push(this.sourceToken);
map.items.pop();
return;
}
}
it.start.push(this.sourceToken);
}
return;
}
if (this.indent >= map.indent) {
const atMapIndent = !this.onKeyLine && this.indent === map.indent;
const atNextItem = atMapIndent &&
(it.sep || it.explicitKey) &&
this.type !== 'seq-item-ind';
// For empty nodes, assign newline-separated not indented empty tokens to following node
let start = [];
if (atNextItem && it.sep && !it.value) {
const nl = [];
for (let i = 0; i < it.sep.length; ++i) {
const st = it.sep[i];
switch (st.type) {
case 'newline':
nl.push(i);
break;
case 'space':
break;
case 'comment':
if (st.indent > map.indent)
nl.length = 0;
break;
default:
nl.length = 0;
}
}
if (nl.length >= 2)
start = it.sep.splice(nl[1]);
}
switch (this.type) {
case 'anchor':
case 'tag':
if (atNextItem || it.value) {
start.push(this.sourceToken);
map.items.push({ start });
this.onKeyLine = true;
}
else if (it.sep) {
it.sep.push(this.sourceToken);
}
else {
it.start.push(this.sourceToken);
}
return;
case 'explicit-key-ind':
if (!it.sep && !it.explicitKey) {
it.start.push(this.sourceToken);
it.explicitKey = true;
}
else if (atNextItem || it.value) {
start.push(this.sourceToken);
map.items.push({ start, explicitKey: true });
}
else {
this.stack.push({
type: 'block-map',
offset: this.offset,
indent: this.indent,
items: [{ start: [this.sourceToken], explicitKey: true }]
});
}
this.onKeyLine = true;
return;
case 'map-value-ind':
if (it.explicitKey) {
if (!it.sep) {
if (includesToken(it.start, 'newline')) {
Object.assign(it, { key: null, sep: [this.sourceToken] });
}
else {
const start = getFirstKeyStartProps(it.start);
this.stack.push({
type: 'block-map',
offset: this.offset,
indent: this.indent,
items: [{ start, key: null, sep: [this.sourceToken] }]
});
}
}
else if (it.value) {
map.items.push({ start: [], key: null, sep: [this.sourceToken] });
}
else if (includesToken(it.sep, 'map-value-ind')) {
this.stack.push({
type: 'block-map',
offset: this.offset,
indent: this.indent,
items: [{ start, key: null, sep: [this.sourceToken] }]
});
}
else if (isFlowToken(it.key) &&
!includesToken(it.sep, 'newline')) {
const start = getFirstKeyStartProps(it.start);
const key = it.key;
const sep = it.sep;
sep.push(this.sourceToken);
// @ts-expect-error type guard is wrong here
delete it.key;
// @ts-expect-error type guard is wrong here
delete it.sep;
this.stack.push({
type: 'block-map',
offset: this.offset,
indent: this.indent,
items: [{ start, key, sep }]
});
}
else if (start.length > 0) {
// Not actually at next item
it.sep = it.sep.concat(start, this.sourceToken);
}
else {
it.sep.push(this.sourceToken);
}
}
else {
if (!it.sep) {
Object.assign(it, { key: null, sep: [this.sourceToken] });
}
else if (it.value || atNextItem) {
map.items.push({ start, key: null, sep: [this.sourceToken] });
}
else if (includesToken(it.sep, 'map-value-ind')) {
this.stack.push({
type: 'block-map',
offset: this.offset,
indent: this.indent,
items: [{ start: [], key: null, sep: [this.sourceToken] }]
});
}
else {
it.sep.push(this.sourceToken);
}
}
this.onKeyLine = true;
return;
case 'alias':
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar': {
const fs = this.flowScalar(this.type);
if (atNextItem || it.value) {
map.items.push({ start, key: fs, sep: [] });
this.onKeyLine = true;
}
else if (it.sep) {
this.stack.push(fs);
}
else {
Object.assign(it, { key: fs, sep: [] });
this.onKeyLine = true;
}
return;
}
default: {
const bv = this.startBlockValue(map);
if (bv) {
if (bv.type === 'block-seq') {
if (!it.explicitKey &&
it.sep &&
!includesToken(it.sep, 'newline')) {
yield* this.pop({
type: 'error',
offset: this.offset,
message: 'Unexpected block-seq-ind on same line with key',
source: this.source
});
return;
}
}
else if (atMapIndent) {
map.items.push({ start });
}
this.stack.push(bv);
return;
}
}
}
}
yield* this.pop();
yield* this.step();
}
*blockSequence(seq) {
const it = seq.items[seq.items.length - 1];
switch (this.type) {
case 'newline':
if (it.value) {
const end = 'end' in it.value ? it.value.end : undefined;
const last = Array.isArray(end) ? end[end.length - 1] : undefined;
if (last?.type === 'comment')
end?.push(this.sourceToken);
else
seq.items.push({ start: [this.sourceToken] });
}
else
it.start.push(this.sourceToken);
return;
case 'space':
case 'comment':
if (it.value)
seq.items.push({ start: [this.sourceToken] });
else {
if (this.atIndentedComment(it.start, seq.indent)) {
const prev = seq.items[seq.items.length - 2];
const end = prev?.value?.end;
if (Array.isArray(end)) {
Array.prototype.push.apply(end, it.start);
end.push(this.sourceToken);
seq.items.pop();
return;
}
}
it.start.push(this.sourceToken);
}
return;
case 'anchor':
case 'tag':
if (it.value || this.indent <= seq.indent)
break;
it.start.push(this.sourceToken);
return;
case 'seq-item-ind':
if (this.indent !== seq.indent)
break;
if (it.value || includesToken(it.start, 'seq-item-ind'))
seq.items.push({ start: [this.sourceToken] });
else
it.start.push(this.sourceToken);
return;
}
if (this.indent > seq.indent) {
const bv = this.startBlockValue(seq);
if (bv) {
this.stack.push(bv);
return;
}
}
yield* this.pop();
yield* this.step();
}
*flowCollection(fc) {
const it = fc.items[fc.items.length - 1];
if (this.type === 'flow-error-end') {
let top;
do {
yield* this.pop();
top = this.peek(1);
} while (top?.type === 'flow-collection');
}
else if (fc.end.length === 0) {
switch (this.type) {
case 'comma':
case 'explicit-key-ind':
if (!it || it.sep)
fc.items.push({ start: [this.sourceToken] });
else
it.start.push(this.sourceToken);
return;
case 'map-value-ind':
if (!it || it.value)
fc.items.push({ start: [], key: null, sep: [this.sourceToken] });
else if (it.sep)
it.sep.push(this.sourceToken);
else
Object.assign(it, { key: null, sep: [this.sourceToken] });
return;
case 'space':
case 'comment':
case 'newline':
case 'anchor':
case 'tag':
if (!it || it.value)
fc.items.push({ start: [this.sourceToken] });
else if (it.sep)
it.sep.push(this.sourceToken);
else
it.start.push(this.sourceToken);
return;
case 'alias':
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar': {
const fs = this.flowScalar(this.type);
if (!it || it.value)
fc.items.push({ start: [], key: fs, sep: [] });
else if (it.sep)
this.stack.push(fs);
else
Object.assign(it, { key: fs, sep: [] });
return;
}
case 'flow-map-end':
case 'flow-seq-end':
fc.end.push(this.sourceToken);
return;
}
const bv = this.startBlockValue(fc);
/* istanbul ignore else should not happen */
if (bv)
this.stack.push(bv);
else {
yield* this.pop();
yield* this.step();
}
}
else {
const parent = this.peek(2);
if (parent.type === 'block-map' &&
((this.type === 'map-value-ind' && parent.indent === fc.indent) ||
(this.type === 'newline' &&
!parent.items[parent.items.length - 1].sep))) {
yield* this.pop();
yield* this.step();
}
else if (this.type === 'map-value-ind' &&
parent.type !== 'flow-collection') {
const prev = getPrevProps(parent);
const start = getFirstKeyStartProps(prev);
fixFlowSeqItems(fc);
const sep = fc.end.splice(1, fc.end.length);
sep.push(this.sourceToken);
const map = {
type: 'block-map',
offset: fc.offset,
indent: fc.indent,
items: [{ start, key: fc, sep }]
};
this.onKeyLine = true;
this.stack[this.stack.length - 1] = map;
}
else {
yield* this.lineEnd(fc);
}
}
}
flowScalar(type) {
if (this.onNewLine) {
let nl = this.source.indexOf('\n') + 1;
while (nl !== 0) {
this.onNewLine(this.offset + nl);
nl = this.source.indexOf('\n', nl) + 1;
}
}
return {
type,
offset: this.offset,
indent: this.indent,
source: this.source
};
}
startBlockValue(parent) {
switch (this.type) {
case 'alias':
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar':
return this.flowScalar(this.type);
case 'block-scalar-header':
return {
type: 'block-scalar',
offset: this.offset,
indent: this.indent,
props: [this.sourceToken],
source: ''
};
case 'flow-map-start':
case 'flow-seq-start':
return {
type: 'flow-collection',
offset: this.offset,
indent: this.indent,
start: this.sourceToken,
items: [],
end: []
};
case 'seq-item-ind':
return {
type: 'block-seq',
offset: this.offset,
indent: this.indent,
items: [{ start: [this.sourceToken] }]
};
case 'explicit-key-ind': {
this.onKeyLine = true;
const prev = getPrevProps(parent);
const start = getFirstKeyStartProps(prev);
start.push(this.sourceToken);
return {
type: 'block-map',
offset: this.offset,
indent: this.indent,
items: [{ start, explicitKey: true }]
};
}
case 'map-value-ind': {
this.onKeyLine = true;
const prev = getPrevProps(parent);
const start = getFirstKeyStartProps(prev);
return {
type: 'block-map',
offset: this.offset,
indent: this.indent,
items: [{ start, key: null, sep: [this.sourceToken] }]
};
}
}
return null;
}
atIndentedComment(start, indent) {
if (this.type !== 'comment')
return false;
if (this.indent <= indent)
return false;
return start.every(st => st.type === 'newline' || st.type === 'space');
}
*documentEnd(docEnd) {
if (this.type !== 'doc-mode') {
if (docEnd.end)
docEnd.end.push(this.sourceToken);
else
docEnd.end = [this.sourceToken];
if (this.type === 'newline')
yield* this.pop();
}
}
*lineEnd(token) {
switch (this.type) {
case 'comma':
case 'doc-start':
case 'doc-end':
case 'flow-seq-end':
case 'flow-map-end':
case 'map-value-ind':
yield* this.pop();
yield* this.step();
break;
case 'newline':
this.onKeyLine = false;
// fallthrough
case 'space':
case 'comment':
default:
// all other values are errors
if (token.end)
token.end.push(this.sourceToken);
else
token.end = [this.sourceToken];
if (this.type === 'newline')
yield* this.pop();
}
}
}
export { Parser };

View File

@@ -1,102 +0,0 @@
import { Composer } from './compose/composer.js';
import { Document } from './doc/Document.js';
import { prettifyError, YAMLParseError } from './errors.js';
import { warn } from './log.js';
import { isDocument } from './nodes/identity.js';
import { LineCounter } from './parse/line-counter.js';
import { Parser } from './parse/parser.js';
function parseOptions(options) {
const prettyErrors = options.prettyErrors !== false;
const lineCounter = options.lineCounter || (prettyErrors && new LineCounter()) || null;
return { lineCounter, prettyErrors };
}
/**
* Parse the input as a stream of YAML documents.
*
* Documents should be separated from each other by `...` or `---` marker lines.
*
* @returns If an empty `docs` array is returned, it will be of type
* EmptyStream and contain additional stream information. In
* TypeScript, you should use `'empty' in docs` as a type guard for it.
*/
function parseAllDocuments(source, options = {}) {
const { lineCounter, prettyErrors } = parseOptions(options);
const parser = new Parser(lineCounter?.addNewLine);
const composer = new Composer(options);
const docs = Array.from(composer.compose(parser.parse(source)));
if (prettyErrors && lineCounter)
for (const doc of docs) {
doc.errors.forEach(prettifyError(source, lineCounter));
doc.warnings.forEach(prettifyError(source, lineCounter));
}
if (docs.length > 0)
return docs;
return Object.assign([], { empty: true }, composer.streamInfo());
}
/** Parse an input string into a single YAML.Document */
function parseDocument(source, options = {}) {
const { lineCounter, prettyErrors } = parseOptions(options);
const parser = new Parser(lineCounter?.addNewLine);
const composer = new Composer(options);
// `doc` is always set by compose.end(true) at the very latest
let doc = null;
for (const _doc of composer.compose(parser.parse(source), true, source.length)) {
if (!doc)
doc = _doc;
else if (doc.options.logLevel !== 'silent') {
doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), 'MULTIPLE_DOCS', 'Source contains multiple documents; please use YAML.parseAllDocuments()'));
break;
}
}
if (prettyErrors && lineCounter) {
doc.errors.forEach(prettifyError(source, lineCounter));
doc.warnings.forEach(prettifyError(source, lineCounter));
}
return doc;
}
function parse(src, reviver, options) {
let _reviver = undefined;
if (typeof reviver === 'function') {
_reviver = reviver;
}
else if (options === undefined && reviver && typeof reviver === 'object') {
options = reviver;
}
const doc = parseDocument(src, options);
if (!doc)
return null;
doc.warnings.forEach(warning => warn(doc.options.logLevel, warning));
if (doc.errors.length > 0) {
if (doc.options.logLevel !== 'silent')
throw doc.errors[0];
else
doc.errors = [];
}
return doc.toJS(Object.assign({ reviver: _reviver }, options));
}
function stringify(value, replacer, options) {
let _replacer = null;
if (typeof replacer === 'function' || Array.isArray(replacer)) {
_replacer = replacer;
}
else if (options === undefined && replacer) {
options = replacer;
}
if (typeof options === 'string')
options = options.length;
if (typeof options === 'number') {
const indent = Math.round(options);
options = indent < 1 ? undefined : indent > 8 ? { indent: 8 } : { indent };
}
if (value === undefined) {
const { keepUndefined } = options ?? replacer ?? {};
if (!keepUndefined)
return undefined;
}
if (isDocument(value) && !_replacer)
return value.toString(options);
return new Document(value, _replacer, options).toString(options);
}
export { parse, parseAllDocuments, parseDocument, stringify };

View File

@@ -1,37 +0,0 @@
import { MAP, SCALAR, SEQ } from '../nodes/identity.js';
import { map } from './common/map.js';
import { seq } from './common/seq.js';
import { string } from './common/string.js';
import { getTags, coreKnownTags } from './tags.js';
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
class Schema {
constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
this.compat = Array.isArray(compat)
? getTags(compat, 'compat')
: compat
? getTags(null, compat)
: null;
this.name = (typeof schema === 'string' && schema) || 'core';
this.knownTags = resolveKnownTags ? coreKnownTags : {};
this.tags = getTags(customTags, this.name, merge);
this.toStringOptions = toStringDefaults ?? null;
Object.defineProperty(this, MAP, { value: map });
Object.defineProperty(this, SCALAR, { value: string });
Object.defineProperty(this, SEQ, { value: seq });
// Used by createMap()
this.sortMapEntries =
typeof sortMapEntries === 'function'
? sortMapEntries
: sortMapEntries === true
? sortMapEntriesByKey
: null;
}
clone() {
const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this));
copy.tags = this.tags.slice();
return copy;
}
}
export { Schema };

View File

@@ -1,17 +0,0 @@
import { isMap } from '../../nodes/identity.js';
import { YAMLMap } from '../../nodes/YAMLMap.js';
const map = {
collection: 'map',
default: true,
nodeClass: YAMLMap,
tag: 'tag:yaml.org,2002:map',
resolve(map, onError) {
if (!isMap(map))
onError('Expected a mapping for this tag');
return map;
},
createNode: (schema, obj, ctx) => YAMLMap.from(schema, obj, ctx)
};
export { map };

View File

@@ -1,15 +0,0 @@
import { Scalar } from '../../nodes/Scalar.js';
const nullTag = {
identify: value => value == null,
createNode: () => new Scalar(null),
default: true,
tag: 'tag:yaml.org,2002:null',
test: /^(?:~|[Nn]ull|NULL)?$/,
resolve: () => new Scalar(null),
stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source)
? source
: ctx.options.nullStr
};
export { nullTag };

View File

@@ -1,17 +0,0 @@
import { isSeq } from '../../nodes/identity.js';
import { YAMLSeq } from '../../nodes/YAMLSeq.js';
const seq = {
collection: 'seq',
default: true,
nodeClass: YAMLSeq,
tag: 'tag:yaml.org,2002:seq',
resolve(seq, onError) {
if (!isSeq(seq))
onError('Expected a sequence for this tag');
return seq;
},
createNode: (schema, obj, ctx) => YAMLSeq.from(schema, obj, ctx)
};
export { seq };

View File

@@ -1,14 +0,0 @@
import { stringifyString } from '../../stringify/stringifyString.js';
const string = {
identify: value => typeof value === 'string',
default: true,
tag: 'tag:yaml.org,2002:str',
resolve: str => str,
stringify(item, ctx, onComment, onChompKeep) {
ctx = Object.assign({ actualString: true }, ctx);
return stringifyString(item, ctx, onComment, onChompKeep);
}
};
export { string };

View File

@@ -1,19 +0,0 @@
import { Scalar } from '../../nodes/Scalar.js';
const boolTag = {
identify: value => typeof value === 'boolean',
default: true,
tag: 'tag:yaml.org,2002:bool',
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
resolve: str => new Scalar(str[0] === 't' || str[0] === 'T'),
stringify({ source, value }, ctx) {
if (source && boolTag.test.test(source)) {
const sv = source[0] === 't' || source[0] === 'T';
if (value === sv)
return source;
}
return value ? ctx.options.trueStr : ctx.options.falseStr;
}
};
export { boolTag };

View File

@@ -1,43 +0,0 @@
import { Scalar } from '../../nodes/Scalar.js';
import { stringifyNumber } from '../../stringify/stringifyNumber.js';
const floatNaN = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
resolve: str => str.slice(-3).toLowerCase() === 'nan'
? NaN
: str[0] === '-'
? Number.NEGATIVE_INFINITY
: Number.POSITIVE_INFINITY,
stringify: stringifyNumber
};
const floatExp = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
format: 'EXP',
test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
resolve: str => parseFloat(str),
stringify(node) {
const num = Number(node.value);
return isFinite(num) ? num.toExponential() : stringifyNumber(node);
}
};
const float = {
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
resolve(str) {
const node = new Scalar(parseFloat(str));
const dot = str.indexOf('.');
if (dot !== -1 && str[str.length - 1] === '0')
node.minFractionDigits = str.length - dot - 1;
return node;
},
stringify: stringifyNumber
};
export { float, floatExp, floatNaN };

View File

@@ -1,38 +0,0 @@
import { stringifyNumber } from '../../stringify/stringifyNumber.js';
const intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);
const intResolve = (str, offset, radix, { intAsBigInt }) => (intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix));
function intStringify(node, radix, prefix) {
const { value } = node;
if (intIdentify(value) && value >= 0)
return prefix + value.toString(radix);
return stringifyNumber(node);
}
const intOct = {
identify: value => intIdentify(value) && value >= 0,
default: true,
tag: 'tag:yaml.org,2002:int',
format: 'OCT',
test: /^0o[0-7]+$/,
resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),
stringify: node => intStringify(node, 8, '0o')
};
const int = {
identify: intIdentify,
default: true,
tag: 'tag:yaml.org,2002:int',
test: /^[-+]?[0-9]+$/,
resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
stringify: stringifyNumber
};
const intHex = {
identify: value => intIdentify(value) && value >= 0,
default: true,
tag: 'tag:yaml.org,2002:int',
format: 'HEX',
test: /^0x[0-9a-fA-F]+$/,
resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
stringify: node => intStringify(node, 16, '0x')
};
export { int, intHex, intOct };

View File

@@ -1,23 +0,0 @@
import { map } from '../common/map.js';
import { nullTag } from '../common/null.js';
import { seq } from '../common/seq.js';
import { string } from '../common/string.js';
import { boolTag } from './bool.js';
import { floatNaN, floatExp, float } from './float.js';
import { intOct, int, intHex } from './int.js';
const schema = [
map,
seq,
string,
nullTag,
boolTag,
intOct,
int,
intHex,
floatNaN,
floatExp,
float
];
export { schema };

View File

@@ -1,62 +0,0 @@
import { Scalar } from '../../nodes/Scalar.js';
import { map } from '../common/map.js';
import { seq } from '../common/seq.js';
function intIdentify(value) {
return typeof value === 'bigint' || Number.isInteger(value);
}
const stringifyJSON = ({ value }) => JSON.stringify(value);
const jsonScalars = [
{
identify: value => typeof value === 'string',
default: true,
tag: 'tag:yaml.org,2002:str',
resolve: str => str,
stringify: stringifyJSON
},
{
identify: value => value == null,
createNode: () => new Scalar(null),
default: true,
tag: 'tag:yaml.org,2002:null',
test: /^null$/,
resolve: () => null,
stringify: stringifyJSON
},
{
identify: value => typeof value === 'boolean',
default: true,
tag: 'tag:yaml.org,2002:bool',
test: /^true$|^false$/,
resolve: str => str === 'true',
stringify: stringifyJSON
},
{
identify: intIdentify,
default: true,
tag: 'tag:yaml.org,2002:int',
test: /^-?(?:0|[1-9][0-9]*)$/,
resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
},
{
identify: value => typeof value === 'number',
default: true,
tag: 'tag:yaml.org,2002:float',
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
resolve: str => parseFloat(str),
stringify: stringifyJSON
}
];
const jsonError = {
default: true,
tag: '',
test: /^/,
resolve(str, onError) {
onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
return str;
}
};
const schema = [map, seq].concat(jsonScalars, jsonError);
export { schema };

View File

@@ -1,96 +0,0 @@
import { map } from './common/map.js';
import { nullTag } from './common/null.js';
import { seq } from './common/seq.js';
import { string } from './common/string.js';
import { boolTag } from './core/bool.js';
import { floatNaN, floatExp, float } from './core/float.js';
import { intOct, intHex, int } from './core/int.js';
import { schema } from './core/schema.js';
import { schema as schema$1 } from './json/schema.js';
import { binary } from './yaml-1.1/binary.js';
import { merge } from './yaml-1.1/merge.js';
import { omap } from './yaml-1.1/omap.js';
import { pairs } from './yaml-1.1/pairs.js';
import { schema as schema$2 } from './yaml-1.1/schema.js';
import { set } from './yaml-1.1/set.js';
import { timestamp, intTime, floatTime } from './yaml-1.1/timestamp.js';
const schemas = new Map([
['core', schema],
['failsafe', [map, seq, string]],
['json', schema$1],
['yaml11', schema$2],
['yaml-1.1', schema$2]
]);
const tagsByName = {
binary,
bool: boolTag,
float,
floatExp,
floatNaN,
floatTime,
int,
intHex,
intOct,
intTime,
map,
merge,
null: nullTag,
omap,
pairs,
seq,
set,
timestamp
};
const coreKnownTags = {
'tag:yaml.org,2002:binary': binary,
'tag:yaml.org,2002:merge': merge,
'tag:yaml.org,2002:omap': omap,
'tag:yaml.org,2002:pairs': pairs,
'tag:yaml.org,2002:set': set,
'tag:yaml.org,2002:timestamp': timestamp
};
function getTags(customTags, schemaName, addMergeTag) {
const schemaTags = schemas.get(schemaName);
if (schemaTags && !customTags) {
return addMergeTag && !schemaTags.includes(merge)
? schemaTags.concat(merge)
: schemaTags.slice();
}
let tags = schemaTags;
if (!tags) {
if (Array.isArray(customTags))
tags = [];
else {
const keys = Array.from(schemas.keys())
.filter(key => key !== 'yaml11')
.map(key => JSON.stringify(key))
.join(', ');
throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
}
}
if (Array.isArray(customTags)) {
for (const tag of customTags)
tags = tags.concat(tag);
}
else if (typeof customTags === 'function') {
tags = customTags(tags.slice());
}
if (addMergeTag)
tags = tags.concat(merge);
return tags.reduce((tags, tag) => {
const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
if (!tagObj) {
const tagName = JSON.stringify(tag);
const keys = Object.keys(tagsByName)
.map(key => JSON.stringify(key))
.join(', ');
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
}
if (!tags.includes(tagObj))
tags.push(tagObj);
return tags;
}, []);
}
export { coreKnownTags, getTags };

View File

@@ -1,58 +0,0 @@
import { Scalar } from '../../nodes/Scalar.js';
import { stringifyString } from '../../stringify/stringifyString.js';
const binary = {
identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array
default: false,
tag: 'tag:yaml.org,2002:binary',
/**
* Returns a Buffer in node and an Uint8Array in browsers
*
* To use the resulting buffer as an image, you'll want to do something like:
*
* const blob = new Blob([buffer], { type: 'image/jpeg' })
* document.querySelector('#photo').src = URL.createObjectURL(blob)
*/
resolve(src, onError) {
if (typeof atob === 'function') {
// On IE 11, atob() can't handle newlines
const str = atob(src.replace(/[\n\r]/g, ''));
const buffer = new Uint8Array(str.length);
for (let i = 0; i < str.length; ++i)
buffer[i] = str.charCodeAt(i);
return buffer;
}
else {
onError('This environment does not support reading binary tags; either Buffer or atob is required');
return src;
}
},
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
if (!value)
return '';
const buf = value; // checked earlier by binary.identify()
let str;
if (typeof btoa === 'function') {
let s = '';
for (let i = 0; i < buf.length; ++i)
s += String.fromCharCode(buf[i]);
str = btoa(s);
}
else {
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
}
type ?? (type = Scalar.BLOCK_LITERAL);
if (type !== Scalar.QUOTE_DOUBLE) {
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
const n = Math.ceil(str.length / lineWidth);
const lines = new Array(n);
for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
lines[i] = str.substr(o, lineWidth);
}
str = lines.join(type === Scalar.BLOCK_LITERAL ? '\n' : ' ');
}
return stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
}
};
export { binary };

Some files were not shown because too many files have changed in this diff Show More