@devxiyang/agent-skill 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/builtin.d.ts CHANGED
@@ -6,8 +6,6 @@
6
6
  * as a system-scoped root:
7
7
  *
8
8
  * ```ts
9
- * import { SkillDiscovery, builtinSkillsRoot } from '@devxiyang/agent-skill-core';
10
- *
11
9
  * new SkillDiscovery([
12
10
  * { path: userSkillsDir, scope: 'user' },
13
11
  * { path: builtinSkillsRoot(), scope: 'system' },
@@ -15,7 +13,7 @@
15
13
  * ```
16
14
  *
17
15
  * Note for Electron apps: if the app is packaged with asar, add
18
- * `node_modules/@devxiyang/agent-skill-core/skills` to `asarUnpack` in
16
+ * `node_modules/@devxiyang/agent-skill/skills` to `asarUnpack` in
19
17
  * electron-builder config so the directory is accessible via the filesystem.
20
18
  */
21
19
  export declare function builtinSkillsRoot(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"builtin.d.ts","sourceRoot":"","sources":["../src/builtin.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAG1C"}
1
+ {"version":3,"file":"builtin.d.ts","sourceRoot":"","sources":["../src/builtin.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAG1C"}
package/dist/builtin.js CHANGED
@@ -8,8 +8,6 @@ import { fileURLToPath } from 'node:url';
8
8
  * as a system-scoped root:
9
9
  *
10
10
  * ```ts
11
- * import { SkillDiscovery, builtinSkillsRoot } from '@devxiyang/agent-skill-core';
12
- *
13
11
  * new SkillDiscovery([
14
12
  * { path: userSkillsDir, scope: 'user' },
15
13
  * { path: builtinSkillsRoot(), scope: 'system' },
@@ -17,7 +15,7 @@ import { fileURLToPath } from 'node:url';
17
15
  * ```
18
16
  *
19
17
  * Note for Electron apps: if the app is packaged with asar, add
20
- * `node_modules/@devxiyang/agent-skill-core/skills` to `asarUnpack` in
18
+ * `node_modules/@devxiyang/agent-skill/skills` to `asarUnpack` in
21
19
  * electron-builder config so the directory is accessible via the filesystem.
22
20
  */
23
21
  export function builtinSkillsRoot() {
@@ -1 +1 @@
1
- {"version":3,"file":"builtin.js","sourceRoot":"","sources":["../src/builtin.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC"}
1
+ {"version":3,"file":"builtin.js","sourceRoot":"","sources":["../src/builtin.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devxiyang/agent-skill",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "SDK for skill discovery and registration — integrates into any agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: node
3
+ description: Run Node.js scripts, manage packages with npm/npx, and use common built-in module patterns. Use for scripting, web tooling, automation, and general JavaScript/TypeScript development.
4
+ requires: bin:node
5
+ tags: node,javascript,typescript,scripting
6
+ ---
7
+
8
+ # Node Skill
9
+
10
+ ## Preflight
11
+
12
+ Verify Node.js is available before proceeding:
13
+
14
+ ```bash
15
+ node --version
16
+ npm --version
17
+ ```
18
+
19
+ If missing, load `references/install.md` for installation instructions.
20
+
21
+ ## Running scripts
22
+
23
+ ```bash
24
+ node script.js
25
+ node script.js arg1 arg2
26
+ node -e "console.log('hello')"
27
+
28
+ # TypeScript (via tsx, no compile step)
29
+ npx tsx script.ts
30
+ ```
31
+
32
+ ## Package management
33
+
34
+ ### npm
35
+
36
+ ```bash
37
+ npm install
38
+ npm install express
39
+ npm install -D typescript
40
+ npm uninstall lodash
41
+ npm list --depth=0
42
+ npm outdated
43
+ npm update
44
+ ```
45
+
46
+ ### npx (run without installing)
47
+
48
+ ```bash
49
+ npx tsx script.ts
50
+ npx prettier --write .
51
+ npx eslint src/
52
+ ```
53
+
54
+ ## Common built-in patterns
55
+
56
+ ### File I/O (fs/promises)
57
+
58
+ ```js
59
+ import { readFile, writeFile, readdir } from 'node:fs/promises';
60
+ import { join } from 'node:path';
61
+
62
+ const text = await readFile('data.txt', 'utf8');
63
+ await writeFile('out.txt', 'content');
64
+
65
+ // Iterate files
66
+ const files = await readdir('src');
67
+ ```
68
+
69
+ ### JSON
70
+
71
+ ```js
72
+ // Parse
73
+ const data = JSON.parse(text);
74
+
75
+ // Serialize
76
+ const json = JSON.stringify(data, null, 2);
77
+ await writeFile('out.json', json);
78
+ ```
79
+
80
+ ### HTTP requests (built-in fetch)
81
+
82
+ ```js
83
+ // Node 18+ has fetch built-in
84
+ const res = await fetch('https://api.example.com/data');
85
+ const data = await res.json();
86
+
87
+ // POST JSON
88
+ const res = await fetch('https://api.example.com/items', {
89
+ method: 'POST',
90
+ headers: { 'Content-Type': 'application/json' },
91
+ body: JSON.stringify({ name: 'foo' }),
92
+ });
93
+ ```
94
+
95
+ ### Child process
96
+
97
+ ```js
98
+ import { execSync, exec } from 'node:child_process';
99
+ import { promisify } from 'node:util';
100
+
101
+ // Sync
102
+ const output = execSync('git status', { encoding: 'utf8' });
103
+
104
+ // Async
105
+ const execAsync = promisify(exec);
106
+ const { stdout, stderr } = await execAsync('npm test');
107
+ ```
108
+
109
+ ### Argument parsing
110
+
111
+ ```js
112
+ // Built-in (Node 18.3+)
113
+ import { parseArgs } from 'node:util';
114
+
115
+ const { values, positionals } = parseArgs({
116
+ args: process.argv.slice(2),
117
+ options: {
118
+ output: { type: 'string', short: 'o', default: 'out.txt' },
119
+ verbose: { type: 'boolean', short: 'v' },
120
+ },
121
+ allowPositionals: true,
122
+ });
123
+ ```
124
+
125
+ ### Environment variables
126
+
127
+ ```js
128
+ const token = process.env.API_TOKEN;
129
+ if (!token) throw new Error('API_TOKEN is required');
130
+ ```
131
+
132
+ ## TypeScript
133
+
134
+ Prefer `tsx` for running `.ts` files directly without a build step:
135
+
136
+ ```bash
137
+ npx tsx script.ts
138
+
139
+ # Or install globally
140
+ npm install -g tsx
141
+ tsx script.ts
142
+ ```
143
+
144
+ For projects with `tsconfig.json`, check `compilerOptions.target` and `module` before running.
145
+
146
+ ## ESM vs CJS
147
+
148
+ ```js
149
+ // ESM (package.json has "type": "module", or file is .mjs)
150
+ import { readFile } from 'node:fs/promises';
151
+ export function helper() {}
152
+
153
+ // CJS (default, or file is .cjs)
154
+ const { readFile } = require('fs').promises;
155
+ module.exports = { helper };
156
+ ```
157
+
158
+ Check `"type"` in `package.json` to know which mode applies.
159
+
160
+ ## Destructive Operations
161
+
162
+ Always confirm with the user before running any of the following:
163
+
164
+ | Command / Pattern | Risk |
165
+ |-------------------|------|
166
+ | `npm publish` | Publishes package to the public registry; cannot be fully unpublished |
167
+ | `npm unpublish` | Removes a published package version (restricted after 72h) |
168
+ | `fs.rm(path, { recursive: true })` / `fs.rmdir` recursive | Deletes directory tree permanently |
169
+ | `fs.writeFile` / `fs.truncate` on existing files | Silently overwrites file content |
170
+ | `execSync('rm -rf ...')` inside scripts | Shell deletion triggered from Node code |
171
+ | `npx <unknown-package>` | Executes remote code; verify package name and source first |
172
+
173
+ Before executing, state what files or registry resources will be affected, and ask for explicit confirmation.
@@ -0,0 +1,63 @@
1
+ # Installing Node.js
2
+
3
+ ## macOS
4
+
5
+ Using nvm (recommended — manages multiple versions):
6
+
7
+ ```bash
8
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
9
+ nvm install --lts
10
+ nvm use --lts
11
+ ```
12
+
13
+ If you have Homebrew:
14
+
15
+ ```bash
16
+ brew install node
17
+ ```
18
+
19
+ ## Windows
20
+
21
+ Download the installer from https://nodejs.org/en/download — pick the LTS release and run the `.msi` installer. Check "Add to PATH" during installation.
22
+
23
+ If winget is available:
24
+
25
+ ```powershell
26
+ winget install OpenJS.NodeJS.LTS
27
+ ```
28
+
29
+ Or use nvm-windows:
30
+
31
+ ```powershell
32
+ winget install CoreyButler.NVMforWindows
33
+ nvm install lts
34
+ nvm use lts
35
+ ```
36
+
37
+ ## Linux
38
+
39
+ ```bash
40
+ # Debian/Ubuntu — via NodeSource
41
+ curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
42
+ sudo apt install nodejs
43
+
44
+ # Fedora
45
+ sudo dnf install nodejs
46
+
47
+ # Arch
48
+ sudo pacman -S nodejs npm
49
+ ```
50
+
51
+ Using nvm (all platforms):
52
+
53
+ ```bash
54
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
55
+ nvm install --lts
56
+ ```
57
+
58
+ ## Verify
59
+
60
+ ```bash
61
+ node --version
62
+ npm --version
63
+ ```
@@ -149,3 +149,17 @@ parser.add_argument("--output", "-o", default="out.txt")
149
149
  parser.add_argument("--verbose", "-v", action="store_true")
150
150
  args = parser.parse_args()
151
151
  ```
152
+
153
+ ## Destructive Operations
154
+
155
+ Always confirm with the user before running any of the following:
156
+
157
+ | Pattern | Risk |
158
+ |---------|------|
159
+ | `shutil.rmtree(path)` | Recursively deletes entire directory tree permanently |
160
+ | `os.remove(path)` in a loop or with glob | Bulk file deletion, easy to match unintended files |
161
+ | `open(path, 'w')` on an existing file | Silently overwrites and truncates file content |
162
+ | `Path.write_text` / `Path.write_bytes` on existing file | Same as above |
163
+ | `subprocess.run(['rm', '-rf', ...])` | Shell deletion triggered from Python code |
164
+
165
+ Before executing, show the user the exact path or pattern that will be affected, and ask for explicit confirmation.
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: shell
3
- description: Write and run shell scripts. Use for automation, file operations, pipelines, and system tasks. Covers bash/zsh (macOS/Linux) and PowerShell (Windows).
4
- tags: shell,cli
3
+ description: Write and run shell scripts, and make HTTP requests with curl. Use for automation, file operations, pipelines, system tasks, fetching web pages, and calling REST APIs. Covers bash/zsh (macOS/Linux) and PowerShell (Windows).
4
+ requires: bin:curl
5
+ tags: shell,cli,web,http
5
6
  ---
6
7
 
7
8
  # Shell Skill
@@ -216,3 +217,93 @@ Get-ChildItem -Recurse -Filter "*.tmp" | Remove-Item
216
217
  # Search in files
217
218
  Select-String -Path "src\*.ts" -Pattern "TODO"
218
219
  ```
220
+
221
+ ---
222
+
223
+ ## HTTP / curl
224
+
225
+ Verify curl is available:
226
+
227
+ ```bash
228
+ curl --version
229
+ ```
230
+
231
+ If missing, load `references/install-curl.md`.
232
+
233
+ ### Fetch a web page
234
+
235
+ ```bash
236
+ curl -sL "https://example.com"
237
+ ```
238
+
239
+ ### REST API calls
240
+
241
+ ```bash
242
+ # GET
243
+ curl -s "https://api.example.com/users" | jq .
244
+
245
+ # POST JSON
246
+ curl -s -X POST "https://api.example.com/items" \
247
+ -H "Content-Type: application/json" \
248
+ -d '{"name": "foo"}'
249
+
250
+ # PUT / DELETE
251
+ curl -s -X PUT "https://api.example.com/items/1" \
252
+ -H "Content-Type: application/json" \
253
+ -d '{"name": "bar"}'
254
+ curl -s -X DELETE "https://api.example.com/items/1"
255
+
256
+ # Auth header
257
+ curl -s "https://api.example.com/data" \
258
+ -H "Authorization: Bearer $TOKEN"
259
+ ```
260
+
261
+ ### Form data & file upload
262
+
263
+ ```bash
264
+ curl -s -X POST "https://example.com/login" \
265
+ -d "username=alice&password=secret"
266
+
267
+ curl -s -X POST "https://example.com/upload" \
268
+ -F "file=@/path/to/file.pdf" \
269
+ -F "description=My file"
270
+ ```
271
+
272
+ ### Download a file
273
+
274
+ ```bash
275
+ curl -sL "https://example.com/file.zip" -o /tmp/file.zip
276
+ curl -C - -L "https://example.com/large.zip" -o /tmp/large.zip # resume
277
+ ```
278
+
279
+ ### Inspect response
280
+
281
+ ```bash
282
+ curl -sI "https://example.com" # headers only
283
+ curl -sD - "https://example.com" # headers + body
284
+ curl -s -o /dev/null -w "%{http_code}" "https://example.com" # status code
285
+ ```
286
+
287
+ ### Tips
288
+
289
+ - `-s` silences progress, `-L` follows redirects, `-v` debugs
290
+ - `--max-time 10` sets timeout, `--compressed` enables gzip
291
+ - `-sk` skips certificate check (testing only)
292
+
293
+ ---
294
+
295
+ ## Destructive Operations
296
+
297
+ Always confirm with the user before running any of the following:
298
+
299
+ | Command | Risk |
300
+ |---------|------|
301
+ | `rm -rf <path>` | Recursively deletes files/directories with no recovery |
302
+ | `find ... -delete` / `find ... -exec rm` | Bulk file deletion, easy to match unintended paths |
303
+ | `> file` (output redirect, not `>>`) | Silently overwrites and truncates existing file |
304
+ | `truncate -s 0 file` | Empties file contents permanently |
305
+ | `dd if=... of=...` | Overwrites device or file at block level |
306
+ | `mkfs` / `fdisk` / `diskutil eraseDisk` | Formats and wipes entire disk partition |
307
+ | `Get-ChildItem ... \| Remove-Item -Recurse` (PowerShell) | Recursive deletion |
308
+
309
+ Before executing, show the user the exact path or glob that will be affected, and ask for explicit confirmation.
@@ -0,0 +1,207 @@
1
+ ---
2
+ name: vcs
3
+ description: Version control and GitHub collaboration — local git operations (branching, committing, merging, rebasing, history) and GitHub interactions via gh CLI (PRs, issues, releases, CI, code review).
4
+ requires: bin:git
5
+ tags: vcs,git,github
6
+ ---
7
+
8
+ # VCS Skill
9
+
10
+ ## Preflight
11
+
12
+ ```bash
13
+ git --version
14
+ gh --version # optional, needed for GitHub operations
15
+ ```
16
+
17
+ If git is missing, load `references/install-git.md`.
18
+ If gh is missing, load `references/install-gh.md`.
19
+
20
+ ---
21
+
22
+ ## Git — Common workflow
23
+
24
+ ```bash
25
+ git status
26
+ git diff
27
+ git add <files>
28
+ git commit -m "message"
29
+ ```
30
+
31
+ ## Branching
32
+
33
+ ```bash
34
+ git checkout -b feature/name
35
+ git switch main
36
+ git branch -d feature/name
37
+ ```
38
+
39
+ ## Inspecting history
40
+
41
+ ```bash
42
+ git log --oneline -20
43
+ git log --oneline --graph --all
44
+ git show <commit>
45
+ git diff main...HEAD
46
+ git blame <file>
47
+ git blame -L 10,20 <file>
48
+ ```
49
+
50
+ ## Cherry-pick
51
+
52
+ ```bash
53
+ git cherry-pick <commit>
54
+ git cherry-pick <from>..<to>
55
+ git cherry-pick -n <commit> # stage only, no commit
56
+ ```
57
+
58
+ ## Tags
59
+
60
+ ```bash
61
+ git tag -a v1.0.0 -m "Release 1.0.0"
62
+ git tag
63
+ git push origin --tags
64
+ git tag -d v1.0.0
65
+ git push origin :refs/tags/v1.0.0
66
+ ```
67
+
68
+ ## Undoing changes
69
+
70
+ ```bash
71
+ git restore --staged <file> # unstage
72
+ git reset --soft HEAD~1 # undo last commit, keep changes staged
73
+ git rebase -i HEAD~3 # edit recent commits interactively
74
+ ```
75
+
76
+ ## Stashing
77
+
78
+ ```bash
79
+ git stash push -m "description"
80
+ git stash list
81
+ git stash pop
82
+ ```
83
+
84
+ ## Merging & rebasing
85
+
86
+ ```bash
87
+ git merge feature/name
88
+ git rebase main
89
+ git rebase --abort
90
+ git merge --abort
91
+ ```
92
+
93
+ ## Conflict resolution
94
+
95
+ 1. Open conflicting files, look for `<<<<<<<` markers
96
+ 2. Edit to desired state
97
+ 3. `git add <resolved-file>`
98
+ 4. `git rebase --continue` or `git merge --continue`
99
+
100
+ ## Worktrees
101
+
102
+ ```bash
103
+ git worktree add ../project-fix fix/some-bug
104
+ git worktree add -b feature/new ../project-feature main
105
+ git worktree list
106
+ git worktree remove ../project-fix
107
+ ```
108
+
109
+ ## Bisect
110
+
111
+ ```bash
112
+ git bisect start
113
+ git bisect bad
114
+ git bisect good <commit>
115
+ # mark each checkout as good/bad until found
116
+ git bisect reset
117
+ ```
118
+
119
+ ## Remotes
120
+
121
+ ```bash
122
+ git remote -v
123
+ git fetch origin
124
+ git pull --rebase
125
+ git push -u origin HEAD
126
+ ```
127
+
128
+ ---
129
+
130
+ ## GitHub (gh CLI)
131
+
132
+ Always specify `--repo owner/repo` when not inside a git directory.
133
+
134
+ ## Pull Requests
135
+
136
+ ```bash
137
+ gh pr list --repo owner/repo
138
+ gh pr view <number> --repo owner/repo
139
+ gh pr checks <number> --repo owner/repo
140
+ gh run view <run-id> --repo owner/repo --log-failed
141
+ gh pr merge <number> --repo owner/repo --squash
142
+ ```
143
+
144
+ ## Code review
145
+
146
+ ```bash
147
+ gh pr review <number> --approve --repo owner/repo
148
+ gh pr review <number> --request-changes --body "Please fix X" --repo owner/repo
149
+ gh pr review <number> --comment --body "Looks good overall" --repo owner/repo
150
+
151
+ # Inline comment via API
152
+ gh api repos/owner/repo/pulls/<number>/comments \
153
+ --method POST \
154
+ --field body="Comment text" \
155
+ --field commit_id="<sha>" \
156
+ --field path="src/file.ts" \
157
+ --field line=42
158
+ ```
159
+
160
+ ## Issues
161
+
162
+ ```bash
163
+ gh issue list --repo owner/repo --state open
164
+ gh issue view <number> --repo owner/repo
165
+ gh issue create --title "Title" --body "Body" --repo owner/repo
166
+ gh issue comment <number> --body "Comment" --repo owner/repo
167
+ gh issue close <number> --repo owner/repo
168
+ gh issue reopen <number> --repo owner/repo
169
+ ```
170
+
171
+ ## Releases
172
+
173
+ ```bash
174
+ gh release list --repo owner/repo
175
+ gh release create v1.0.0 --repo owner/repo --title "v1.0.0" --notes "Release notes"
176
+ gh release upload v1.0.0 dist/app.zip --repo owner/repo
177
+ ```
178
+
179
+ ## API & JSON output
180
+
181
+ ```bash
182
+ gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
183
+ gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"'
184
+ gh pr list --repo owner/repo --json number,title,author --jq '.[] | "\(.number): \(.title) by \(.author.login)"'
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Destructive Operations
190
+
191
+ Always confirm with the user before running any of the following:
192
+
193
+ | Command | Risk |
194
+ |---------|------|
195
+ | `git reset --hard` | Discards all uncommitted changes permanently |
196
+ | `git push --force` / `git push -f` | Overwrites remote history, affects all collaborators |
197
+ | `git branch -D <branch>` | Force-deletes branch regardless of merge status |
198
+ | `git clean -f` / `git clean -fd` | Deletes untracked files/directories permanently |
199
+ | `git rebase -i` on pushed commits | Rewrites shared history |
200
+ | `git restore <file>` | Discards working tree changes for that file |
201
+ | `gh pr merge` | Merges and closes PR; hard to revert cleanly |
202
+ | `gh release delete` | Permanently deletes a release and its assets |
203
+ | `gh issue delete` | Permanently deletes an issue |
204
+ | `gh repo delete` | Permanently deletes the entire repository |
205
+ | `gh api --method DELETE ...` | Any DELETE API call is irreversible |
206
+
207
+ Before executing, tell the user exactly what will be lost and ask for explicit confirmation.
@@ -1,166 +0,0 @@
1
- ---
2
- name: git
3
- description: Local git operations — branching, committing, merging, rebasing, history inspection, and conflict resolution.
4
- requires: bin:git
5
- tags: vcs,git
6
- ---
7
-
8
- # Git Skill
9
-
10
- ## Preflight
11
-
12
- Verify git is available before proceeding:
13
-
14
- ```bash
15
- git --version
16
- ```
17
-
18
- If missing, load `references/install.md` for installation instructions.
19
-
20
- ## Common workflow
21
-
22
- ```bash
23
- git status
24
- git diff
25
- git add <files>
26
- git commit -m "message"
27
- ```
28
-
29
- ## Branching
30
-
31
- ```bash
32
- git checkout -b feature/name
33
- git switch main
34
- git branch -d feature/name
35
- ```
36
-
37
- ## Inspecting history
38
-
39
- ```bash
40
- git log --oneline -20
41
- git log --oneline --graph --all
42
- git show <commit>
43
- git diff main...HEAD
44
- git blame <file>
45
- ```
46
-
47
- ## Cherry-pick
48
-
49
- ```bash
50
- # Apply a specific commit onto the current branch
51
- git cherry-pick <commit>
52
-
53
- # Cherry-pick a range
54
- git cherry-pick <from>..<to>
55
-
56
- # Cherry-pick without committing (stage only)
57
- git cherry-pick -n <commit>
58
- ```
59
-
60
- ## Tags
61
-
62
- ```bash
63
- # Create annotated tag
64
- git tag -a v1.0.0 -m "Release 1.0.0"
65
-
66
- # List tags
67
- git tag
68
-
69
- # Push tags to remote
70
- git push origin --tags
71
-
72
- # Delete a tag
73
- git tag -d v1.0.0
74
- git push origin :refs/tags/v1.0.0
75
- ```
76
-
77
- ## Undoing changes
78
-
79
- ```bash
80
- # Unstage
81
- git restore --staged <file>
82
-
83
- # Discard working tree changes
84
- git restore <file>
85
-
86
- # Undo last commit (keep changes staged)
87
- git reset --soft HEAD~1
88
-
89
- # Interactive rebase to edit recent commits
90
- git rebase -i HEAD~3
91
- ```
92
-
93
- ## Stashing
94
-
95
- ```bash
96
- git stash push -m "description"
97
- git stash list
98
- git stash pop
99
- ```
100
-
101
- ## Merging & rebasing
102
-
103
- ```bash
104
- # Merge
105
- git merge feature/name
106
-
107
- # Rebase onto main
108
- git rebase main
109
-
110
- # Abort on conflict
111
- git rebase --abort
112
- git merge --abort
113
- ```
114
-
115
- ## Conflict resolution
116
-
117
- 1. Open conflicting files, look for `<<<<<<<` markers
118
- 2. Edit to desired state
119
- 3. `git add <resolved-file>`
120
- 4. `git rebase --continue` or `git merge --continue`
121
-
122
- ## Worktrees
123
-
124
- Check out multiple branches simultaneously in separate directories — useful for working on or reviewing a branch without touching the current working tree:
125
-
126
- ```bash
127
- # Add a worktree for an existing branch
128
- git worktree add ../project-fix fix/some-bug
129
-
130
- # Add a worktree and create a new branch
131
- git worktree add -b feature/new ../project-feature main
132
-
133
- # List worktrees
134
- git worktree list
135
-
136
- # Remove a worktree when done
137
- git worktree remove ../project-fix
138
- ```
139
-
140
- Each worktree shares the same repository history but has its own working directory and HEAD.
141
-
142
- ## Debugging
143
-
144
- ```bash
145
- # Find which commit introduced a bug (binary search)
146
- git bisect start
147
- git bisect bad # current commit is broken
148
- git bisect good <commit> # last known good commit
149
- # git will check out commits for you to test; mark each:
150
- git bisect good
151
- git bisect bad
152
- git bisect reset # done
153
-
154
- # Show who last changed each line
155
- git blame <file>
156
- git blame -L 10,20 <file> # specific line range
157
- ```
158
-
159
- ## Remotes
160
-
161
- ```bash
162
- git remote -v
163
- git fetch origin
164
- git pull --rebase
165
- git push -u origin HEAD
166
- ```
@@ -1,112 +0,0 @@
1
- ---
2
- name: github
3
- description: Interact with GitHub using the `gh` CLI. Use for issues, pull requests, CI runs, code review, and GitHub API queries.
4
- requires: bin:gh
5
- tags: vcs,github
6
- ---
7
-
8
- # GitHub Skill
9
-
10
- ## Preflight
11
-
12
- Verify gh is available before proceeding:
13
-
14
- ```bash
15
- gh --version
16
- ```
17
-
18
- If missing, load `references/install.md` for installation and authentication instructions.
19
-
20
- Use the `gh` CLI to interact with GitHub. Always specify `--repo owner/repo` when not inside a git directory.
21
-
22
- ## Pull Requests
23
-
24
- ```bash
25
- # List open PRs
26
- gh pr list --repo owner/repo
27
-
28
- # View a PR
29
- gh pr view <number> --repo owner/repo
30
-
31
- # Check CI status
32
- gh pr checks <number> --repo owner/repo
33
-
34
- # View failed CI logs
35
- gh run view <run-id> --repo owner/repo --log-failed
36
-
37
- # Merge a PR
38
- gh pr merge <number> --repo owner/repo --squash
39
- gh pr merge <number> --repo owner/repo --merge
40
- gh pr merge <number> --repo owner/repo --rebase
41
- ```
42
-
43
- ## Code review
44
-
45
- ```bash
46
- # Approve
47
- gh pr review <number> --approve --repo owner/repo
48
-
49
- # Request changes
50
- gh pr review <number> --request-changes --body "Please fix X" --repo owner/repo
51
-
52
- # Leave a comment
53
- gh pr review <number> --comment --body "Looks good overall" --repo owner/repo
54
-
55
- # Add inline comment via API
56
- gh api repos/owner/repo/pulls/<number>/comments \
57
- --method POST \
58
- --field body="Comment text" \
59
- --field commit_id="<sha>" \
60
- --field path="src/file.ts" \
61
- --field line=42
62
- ```
63
-
64
- ## Issues
65
-
66
- ```bash
67
- # List issues
68
- gh issue list --repo owner/repo --state open
69
-
70
- # View an issue
71
- gh issue view <number> --repo owner/repo
72
-
73
- # Create issue
74
- gh issue create --title "Title" --body "Body" --repo owner/repo
75
-
76
- # Comment on an issue
77
- gh issue comment <number> --body "Comment" --repo owner/repo
78
-
79
- # Close / reopen
80
- gh issue close <number> --repo owner/repo
81
- gh issue reopen <number> --repo owner/repo
82
- ```
83
-
84
- ## Releases
85
-
86
- ```bash
87
- # List releases
88
- gh release list --repo owner/repo
89
-
90
- # Create a release
91
- gh release create v1.0.0 --repo owner/repo --title "v1.0.0" --notes "Release notes"
92
-
93
- # Upload assets to a release
94
- gh release upload v1.0.0 dist/app.zip --repo owner/repo
95
- ```
96
-
97
- ## API
98
-
99
- Use `gh api` for data not available via subcommands:
100
-
101
- ```bash
102
- gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
103
- ```
104
-
105
- ## JSON Output
106
-
107
- Most commands support `--json` + `--jq`:
108
-
109
- ```bash
110
- gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"'
111
- gh pr list --repo owner/repo --json number,title,author --jq '.[] | "\(.number): \(.title) by \(.author.login)"'
112
- ```
@@ -1,139 +0,0 @@
1
- ---
2
- name: web
3
- description: Fetch web pages, call REST APIs, download files, and extract content from URLs using curl.
4
- requires: bin:curl
5
- tags: web,http
6
- ---
7
-
8
- # Web Skill
9
-
10
- ## Preflight
11
-
12
- Verify curl is available before proceeding:
13
-
14
- ```bash
15
- curl --version
16
- ```
17
-
18
- If missing, load `references/install.md` for installation instructions.
19
-
20
- ## Fetch a web page
21
-
22
- ```bash
23
- curl -sL "https://example.com"
24
- ```
25
-
26
- ## REST API calls
27
-
28
- ```bash
29
- # GET with JSON response
30
- curl -s "https://api.example.com/users" | jq .
31
-
32
- # POST JSON
33
- curl -s -X POST "https://api.example.com/items" \
34
- -H "Content-Type: application/json" \
35
- -d '{"name": "foo"}'
36
-
37
- # PUT
38
- curl -s -X PUT "https://api.example.com/items/1" \
39
- -H "Content-Type: application/json" \
40
- -d '{"name": "bar"}'
41
-
42
- # DELETE
43
- curl -s -X DELETE "https://api.example.com/items/1"
44
-
45
- # With auth header
46
- curl -s "https://api.example.com/data" \
47
- -H "Authorization: Bearer $TOKEN"
48
- ```
49
-
50
- ## Form data & file upload
51
-
52
- ```bash
53
- # Submit a form (application/x-www-form-urlencoded)
54
- curl -s -X POST "https://example.com/login" \
55
- -d "username=alice&password=secret"
56
-
57
- # Multipart file upload
58
- curl -s -X POST "https://example.com/upload" \
59
- -F "file=@/path/to/file.pdf" \
60
- -F "description=My file"
61
- ```
62
-
63
- ## Cookies & sessions
64
-
65
- ```bash
66
- # Save cookies to a file
67
- curl -s -c cookies.txt "https://example.com/login" \
68
- -d "user=alice&pass=secret"
69
-
70
- # Reuse saved cookies
71
- curl -s -b cookies.txt "https://example.com/dashboard"
72
- ```
73
-
74
- ## Download a file
75
-
76
- ```bash
77
- curl -sL "https://example.com/file.zip" -o /tmp/file.zip
78
-
79
- # Resume interrupted download
80
- curl -C - -L "https://example.com/large.zip" -o /tmp/large.zip
81
- ```
82
-
83
- ## Extract content from a page
84
-
85
- Prefer Python for reliable HTML parsing over fragile sed/grep:
86
-
87
- ```bash
88
- curl -sL "https://example.com" | python3 -c "
89
- import sys, html.parser
90
-
91
- class TextExtractor(html.parser.HTMLParser):
92
- skip = {'script', 'style'}
93
- def __init__(self):
94
- super().__init__()
95
- self._tag = None
96
- self.parts = []
97
- def handle_starttag(self, tag, attrs):
98
- self._tag = tag
99
- def handle_data(self, data):
100
- if self._tag not in self.skip and data.strip():
101
- self.parts.append(data.strip())
102
-
103
- p = TextExtractor()
104
- p.feed(sys.stdin.read())
105
- print('\n'.join(p.parts))
106
- "
107
- ```
108
-
109
- ## Inspect response
110
-
111
- ```bash
112
- # Headers only
113
- curl -sI "https://example.com"
114
-
115
- # Show both headers and body
116
- curl -sD - "https://example.com"
117
-
118
- # Show HTTP status code only
119
- curl -s -o /dev/null -w "%{http_code}" "https://example.com"
120
- ```
121
-
122
- ## HTTPS & certificates
123
-
124
- ```bash
125
- # Skip certificate verification (use only for testing)
126
- curl -sk "https://self-signed.example.com"
127
-
128
- # Use a specific CA certificate
129
- curl -s --cacert /path/to/ca.crt "https://example.com"
130
- ```
131
-
132
- ## Tips
133
-
134
- - `-s` silences progress output
135
- - `-L` follows redirects
136
- - `-I` fetches headers only
137
- - `--max-time 10` sets a timeout in seconds
138
- - `--compressed` requests gzip encoding automatically
139
- - `-v` shows full request/response for debugging