battle-skills 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +116 -0
  3. package/bin/install.js +264 -0
  4. package/package.json +29 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QuocTang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,116 @@
1
+ <div align="center">
2
+ <img src="assets/images/logo.png" alt="Battle Skills Logo" width="200"/>
3
+
4
+ # βš”οΈ Battle Skills
5
+
6
+ _Personal collection of battle-tested agentic skills for Claude Code, Cursor, Gemini CLI, Codex CLI, and more._
7
+
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ </div>
11
+
12
+ These are **real skills from real projects** β€” not theoretical patterns. Each one has been used in production and refined through actual use.
13
+
14
+ ---
15
+
16
+ ## πŸ“‘ Table of Contents
17
+
18
+ - [πŸš€ Quick Start](#-quick-start)
19
+ - [πŸ› οΈ Installation](#️-installation)
20
+ - [πŸ“¦ Features](#-features)
21
+ - [🎯 Available Skills](#-available-skills)
22
+ - [🀝 How to Contribute](#-how-to-contribute)
23
+ - [πŸ’¬ Community & Support](#-community--support)
24
+ - [πŸ‘₯ Repo Contributors](#-repo-contributors)
25
+ - [βš–οΈ License](#️-license)
26
+ - [🌟 Star History](#-star-history)
27
+
28
+ ---
29
+
30
+ ## πŸš€ Quick Start
31
+
32
+ 1. Install via your AI assistant's directory (`.claude/skills`, `.cursor/skills`, etc.)
33
+ 2. Use by naming the skill in the prompt (e.g. `Use awesome-readme to...`)
34
+ 3. Validate and build new skills easily with our included scripts.
35
+
36
+ ---
37
+
38
+ ## πŸ› οΈ Installation
39
+
40
+ **πŸ’‘ Recommended: Use the CLI Installer**
41
+
42
+ ```bash
43
+ # Install directly to your favorite AI Assistant
44
+ npx battle-skills --cursor # For Cursor
45
+ npx battle-skills --claude # For Claude Code
46
+ npx battle-skills --gemini # For Gemini CLI
47
+ npx battle-skills --antigravity # For Antigravity
48
+ npx battle-skills --path ./dir # Custom path (.agent/skills)
49
+ ```
50
+
51
+ **Alternative: Manual Git Clone**
52
+
53
+ | Tool | Install Command |
54
+ | --------------- | ------------------------------------------------------------------------ |
55
+ | **Claude Code** | `git clone https://github.com/QuocTang/battle-skills.git .claude/skills` |
56
+ | **Cursor** | `git clone https://github.com/QuocTang/battle-skills.git .cursor/skills` |
57
+ | **Gemini CLI** | `git clone https://github.com/QuocTang/battle-skills.git .gemini/skills` |
58
+ | **Universal** | `git clone https://github.com/QuocTang/battle-skills.git .agent/skills` |
59
+
60
+ **To update:** Rerun the `npx` command or `git -C <your_tool_folder>/skills pull`
61
+
62
+ ---
63
+
64
+ ## πŸ“¦ Features
65
+
66
+ - **βœ… Battle-Tested:** Real, production-grade instructions built from hard-earned experience.
67
+ - **πŸ”„ Universal Compatibility:** Works seamlessly with Claude, Cursor, Gemini CLI, and standard AI agent architectures.
68
+ - **πŸ› οΈ Self-Validating:** Includes `validate_skills.py` to ensure every skill is formatted perfectly.
69
+ - **πŸ“š Auto-Documentation:** `gen_catalog.py` keeps the `CATALOG.md` and machine-readable `skills_index.json` constantly updated.
70
+
71
+ ---
72
+
73
+ ## 🎯 Available Skills
74
+
75
+ See the full list of our current capabilities in the πŸ‘‰ **[CATALOG.md](CATALOG.md)**.
76
+
77
+ > Check out the `create-skill` guide if you want to understand how the battle skills are structured!
78
+
79
+ ---
80
+
81
+ ## 🀝 How to Contribute
82
+
83
+ We welcome contributions! Please follow these steps to add your own battle skills:
84
+
85
+ 1. **Fork** the repository.
86
+ 2. **Create a new branch** for your feature or skill.
87
+ 3. Follow the `create-skill` guide to scaffold your new skill folder and `SKILL.md`.
88
+ 4. Run `python3 scripts/validate_skills.py` and `python3 scripts/gen_catalog.py`.
89
+ 5. Update `CHANGELOG.md` and **Submit a Pull Request**.
90
+
91
+ ## πŸ’¬ Community & Support
92
+
93
+ If this repository saves you time or levels up your AI coding game, please give it a ⭐️!
94
+ Your support keeps the collection growing.
95
+
96
+ ---
97
+
98
+ ## πŸ‘₯ Repo Contributors
99
+
100
+ <a href="https://github.com/QuocTang/battle-skills/graphs/contributors">
101
+ <img src="https://contrib.rocks/image?repo=QuocTang/battle-skills" alt="Repository contributors" />
102
+ </a>
103
+
104
+ _Made with [contrib.rocks](https://contrib.rocks)._
105
+
106
+ ---
107
+
108
+ ## βš–οΈ License
109
+
110
+ MIT License. See [LICENSE](LICENSE) for details.
111
+
112
+ ---
113
+
114
+ ## 🌟 Star History
115
+
116
+ [![Star History Chart](https://api.star-history.com/svg?repos=QuocTang/battle-skills&type=Date)](https://star-history.com/#QuocTang/battle-skills&Date)
package/bin/install.js ADDED
@@ -0,0 +1,264 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require("child_process");
4
+ const path = require("path");
5
+ const fs = require("fs");
6
+ const os = require("os");
7
+
8
+ const REPO = "https://github.com/QuocTang/battle-skills.git";
9
+ const HOME = process.env.HOME || process.env.USERPROFILE || "";
10
+
11
+ function resolveDir(p) {
12
+ if (!p) return null;
13
+ const s = p.replace(/^~($|\/)/, HOME + "$1");
14
+ return path.resolve(s);
15
+ }
16
+
17
+ function parseArgs() {
18
+ const a = process.argv.slice(2);
19
+ let pathArg = null;
20
+ let versionArg = null;
21
+ let tagArg = null;
22
+ let cursor = false,
23
+ claude = false,
24
+ gemini = false,
25
+ codex = false,
26
+ antigravity = false,
27
+ kiro = false;
28
+
29
+ for (let i = 0; i < a.length; i++) {
30
+ if (a[i] === "--help" || a[i] === "-h") return { help: true };
31
+ if (a[i] === "--path" && a[i + 1]) {
32
+ pathArg = a[++i];
33
+ continue;
34
+ }
35
+ if (a[i] === "--version" && a[i + 1]) {
36
+ versionArg = a[++i];
37
+ continue;
38
+ }
39
+ if (a[i] === "--tag" && a[i + 1]) {
40
+ tagArg = a[++i];
41
+ continue;
42
+ }
43
+ if (a[i] === "--cursor") {
44
+ cursor = true;
45
+ continue;
46
+ }
47
+ if (a[i] === "--claude") {
48
+ claude = true;
49
+ continue;
50
+ }
51
+ if (a[i] === "--gemini") {
52
+ gemini = true;
53
+ continue;
54
+ }
55
+ if (a[i] === "--codex") {
56
+ codex = true;
57
+ continue;
58
+ }
59
+ if (a[i] === "--antigravity") {
60
+ antigravity = true;
61
+ continue;
62
+ }
63
+ if (a[i] === "--kiro") {
64
+ kiro = true;
65
+ continue;
66
+ }
67
+ if (a[i] === "install") continue;
68
+ }
69
+
70
+ return {
71
+ pathArg,
72
+ versionArg,
73
+ tagArg,
74
+ cursor,
75
+ claude,
76
+ gemini,
77
+ codex,
78
+ antigravity,
79
+ kiro,
80
+ };
81
+ }
82
+
83
+ function defaultDir(opts) {
84
+ if (opts.pathArg) return resolveDir(opts.pathArg);
85
+ if (opts.cursor) return path.join(HOME, ".cursor", "skills");
86
+ if (opts.claude) return path.join(HOME, ".claude", "skills");
87
+ if (opts.gemini) return path.join(HOME, ".gemini", "skills");
88
+ if (opts.codex) {
89
+ const codexHome = process.env.CODEX_HOME;
90
+ if (codexHome) return path.join(codexHome, "skills");
91
+ return path.join(HOME, ".codex", "skills");
92
+ }
93
+ if (opts.kiro) return path.join(HOME, ".kiro", "skills");
94
+ if (opts.antigravity)
95
+ return path.join(HOME, ".gemini", "antigravity", "skills");
96
+ return path.join(HOME, ".gemini", "antigravity", "skills");
97
+ }
98
+
99
+ function printHelp() {
100
+ console.log(`
101
+ battle-skills β€” installer
102
+
103
+ npx battle-skills [install] [options]
104
+
105
+ Clones the skills repo into your agent's skills directory.
106
+
107
+ Options:
108
+ --cursor Install to ~/.cursor/skills (Cursor)
109
+ --claude Install to ~/.claude/skills (Claude Code)
110
+ --gemini Install to ~/.gemini/skills (Gemini CLI)
111
+ --codex Install to ~/.codex/skills (Codex CLI)
112
+ --kiro Install to ~/.kiro/skills (Kiro CLI)
113
+ --antigravity Install to ~/.gemini/antigravity/skills (Antigravity)
114
+ --path <dir> Install to <dir> (default: ~/.gemini/antigravity/skills)
115
+ --version <ver> After clone, checkout tag v<ver> (e.g. 4.6.0 -> v4.6.0)
116
+ --tag <tag> After clone, checkout this tag (e.g. v4.6.0)
117
+
118
+ Examples:
119
+ npx battle-skills
120
+ npx battle-skills --cursor
121
+ npx battle-skills --kiro
122
+ npx battle-skills --antigravity
123
+ npx battle-skills --version 4.6.0
124
+ npx battle-skills --path ./my-skills
125
+ `);
126
+ }
127
+
128
+ function copyRecursiveSync(src, dest, skipGit = true) {
129
+ const stats = fs.statSync(src);
130
+ if (stats.isDirectory()) {
131
+ if (!fs.existsSync(dest)) {
132
+ fs.mkdirSync(dest, { recursive: true });
133
+ }
134
+ fs.readdirSync(src).forEach((child) => {
135
+ if (skipGit && child === ".git") return;
136
+ copyRecursiveSync(path.join(src, child), path.join(dest, child), skipGit);
137
+ });
138
+ } else {
139
+ fs.copyFileSync(src, dest);
140
+ }
141
+ }
142
+
143
+ /** Copy contents of repo's skills/ into target so each skill is target/skill-name/ (for Claude Code etc.). */
144
+ function installSkillsIntoTarget(tempDir, target) {
145
+ const repoSkills = path.join(tempDir, "skills");
146
+ if (!fs.existsSync(repoSkills)) {
147
+ console.error("Cloned repo has no skills/ directory.");
148
+ process.exit(1);
149
+ }
150
+ fs.readdirSync(repoSkills).forEach((name) => {
151
+ const src = path.join(repoSkills, name);
152
+ const dest = path.join(target, name);
153
+ copyRecursiveSync(src, dest);
154
+ });
155
+ const repoDocs = path.join(tempDir, "docs");
156
+ if (fs.existsSync(repoDocs)) {
157
+ const docsDest = path.join(target, "docs");
158
+ if (!fs.existsSync(docsDest)) fs.mkdirSync(docsDest, { recursive: true });
159
+ copyRecursiveSync(repoDocs, docsDest);
160
+ }
161
+ }
162
+
163
+ function run(cmd, args, opts = {}) {
164
+ const r = spawnSync(cmd, args, { stdio: "inherit", ...opts });
165
+ if (r.status !== 0) process.exit(r.status == null ? 1 : r.status);
166
+ }
167
+
168
+ function main() {
169
+ const opts = parseArgs();
170
+ const { tagArg, versionArg } = opts;
171
+
172
+ if (opts.help) {
173
+ printHelp();
174
+ return;
175
+ }
176
+
177
+ const target = defaultDir(opts);
178
+ if (!target || !HOME) {
179
+ console.error(
180
+ "Could not resolve home directory. Use --path <absolute-path>.",
181
+ );
182
+ process.exit(1);
183
+ }
184
+
185
+ const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "ag-skills-"));
186
+ const originalCwd = process.cwd();
187
+
188
+ try {
189
+ if (process.platform === "win32") {
190
+ run("git", ["-c", "core.symlinks=true", "clone", REPO, tempDir]);
191
+ } else {
192
+ run("git", ["clone", REPO, tempDir]);
193
+ }
194
+
195
+ const ref =
196
+ tagArg ||
197
+ (versionArg
198
+ ? versionArg.startsWith("v")
199
+ ? versionArg
200
+ : `v${versionArg}`
201
+ : null);
202
+ if (ref) {
203
+ console.log(`Checking out ${ref}…`);
204
+ process.chdir(tempDir);
205
+ run("git", ["checkout", ref]);
206
+ process.chdir(originalCwd);
207
+ }
208
+
209
+ if (fs.existsSync(target)) {
210
+ const gitDir = path.join(target, ".git");
211
+ if (fs.existsSync(gitDir)) {
212
+ console.log("Migrating from full-repo install to skills-only layout…");
213
+ const entries = fs.readdirSync(target);
214
+ for (const name of entries) {
215
+ const full = path.join(target, name);
216
+ const stat = fs.statSync(full);
217
+ if (stat.isDirectory()) {
218
+ if (fs.rmSync) {
219
+ fs.rmSync(full, { recursive: true, force: true });
220
+ } else {
221
+ fs.rmdirSync(full, { recursive: true });
222
+ }
223
+ } else {
224
+ fs.unlinkSync(full);
225
+ }
226
+ }
227
+ } else {
228
+ console.log(`Updating existing install at ${target}…`);
229
+ }
230
+ } else {
231
+ const parent = path.dirname(target);
232
+ if (!fs.existsSync(parent)) {
233
+ try {
234
+ fs.mkdirSync(parent, { recursive: true });
235
+ } catch (e) {
236
+ console.error(`Cannot create parent directory: ${parent}`, e.message);
237
+ process.exit(1);
238
+ }
239
+ }
240
+ fs.mkdirSync(target, { recursive: true });
241
+ }
242
+
243
+ installSkillsIntoTarget(tempDir, target);
244
+
245
+ console.log(`\nInstalled to ${target}`);
246
+ console.log(
247
+ "Pick a bundle in docs/BUNDLES.md and use @skill-name in your AI assistant.",
248
+ );
249
+ } finally {
250
+ try {
251
+ if (fs.existsSync(tempDir)) {
252
+ if (fs.rmSync) {
253
+ fs.rmSync(tempDir, { recursive: true, force: true });
254
+ } else {
255
+ fs.rmdirSync(tempDir, { recursive: true });
256
+ }
257
+ }
258
+ } catch (e) {
259
+ // ignore cleanup errors
260
+ }
261
+ }
262
+ }
263
+
264
+ main();
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "battle-skills",
3
+ "version": "1.0.0",
4
+ "description": "Personal collection of battle-tested agentic skills for Claude Code, Cursor, Gemini CLI, Codex CLI, Antigravity and more.",
5
+ "license": "MIT",
6
+ "scripts": {
7
+ "validate": "python3 scripts/validate_skills.py",
8
+ "catalog": "python3 scripts/gen_catalog.py",
9
+ "build": "npm run validate && npm run catalog"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/QuocTang/battle-skills.git"
14
+ },
15
+ "bin": {
16
+ "battle-skills": "bin/install.js"
17
+ },
18
+ "files": [
19
+ "bin"
20
+ ],
21
+ "keywords": [
22
+ "claude-code",
23
+ "cursor",
24
+ "gemini-cli",
25
+ "antigravity",
26
+ "agentic-skills",
27
+ "ai-coding"
28
+ ]
29
+ }