opencode-skills-antigravity 0.0.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/.github/workflows/publish.yml +40 -0
- package/.github/workflows/release.yml +60 -0
- package/LICENSE +21 -0
- package/README.md +80 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +29 -0
- package/package.json +38 -0
- package/src/index.ts +37 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["Create Release"]
|
|
6
|
+
types: [completed]
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
# Skip if triggered by workflow_run that did not succeed
|
|
13
|
+
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
id-token: write
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout repository
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
|
|
23
|
+
|
|
24
|
+
- name: Setup Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: '20'
|
|
28
|
+
registry-url: 'https://registry.npmjs.org'
|
|
29
|
+
cache: 'npm'
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: npm ci
|
|
33
|
+
|
|
34
|
+
- name: Build TypeScript
|
|
35
|
+
run: npm run build
|
|
36
|
+
|
|
37
|
+
- name: Publish to npm
|
|
38
|
+
run: npm publish --provenance --access public
|
|
39
|
+
env:
|
|
40
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Create Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: 'Version bump type'
|
|
8
|
+
required: true
|
|
9
|
+
type: choice
|
|
10
|
+
options:
|
|
11
|
+
- patch
|
|
12
|
+
- minor
|
|
13
|
+
- major
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
release:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
contents: write
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout repository
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
with:
|
|
25
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
26
|
+
|
|
27
|
+
- name: Setup Node.js
|
|
28
|
+
uses: actions/setup-node@v4
|
|
29
|
+
with:
|
|
30
|
+
node-version: '20'
|
|
31
|
+
cache: 'npm'
|
|
32
|
+
|
|
33
|
+
- name: Configure git
|
|
34
|
+
run: |
|
|
35
|
+
git config user.name "github-actions[bot]"
|
|
36
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
37
|
+
|
|
38
|
+
- name: Install dependencies
|
|
39
|
+
run: npm ci
|
|
40
|
+
|
|
41
|
+
- name: Bump version
|
|
42
|
+
id: bump
|
|
43
|
+
run: |
|
|
44
|
+
NEW_VERSION=$(npm version ${{ github.event.inputs.version }} --no-git-tag-version)
|
|
45
|
+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
46
|
+
|
|
47
|
+
- name: Commit and push
|
|
48
|
+
run: |
|
|
49
|
+
git add package.json package-lock.json
|
|
50
|
+
git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }}"
|
|
51
|
+
git tag ${{ steps.bump.outputs.new_version }}
|
|
52
|
+
git push origin main --tags
|
|
53
|
+
|
|
54
|
+
- name: Create GitHub Release
|
|
55
|
+
uses: softprops/action-gh-release@v2
|
|
56
|
+
with:
|
|
57
|
+
tag_name: ${{ steps.bump.outputs.new_version }}
|
|
58
|
+
name: ${{ steps.bump.outputs.new_version }}
|
|
59
|
+
generate_release_notes: true
|
|
60
|
+
make_latest: true
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Davide Ladisa
|
|
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,80 @@
|
|
|
1
|
+
# opencode-skills-antigravity
|
|
2
|
+
|
|
3
|
+
An [OpenCode CLI](https://opencode.ai/) plugin that automatically downloads and keeps the [Antigravity Awesome Skills](https://github.com/sickn33/antigravity-awesome-skills) repository up to date every time you start OpenCode.
|
|
4
|
+
|
|
5
|
+
## ✨ How it works
|
|
6
|
+
|
|
7
|
+
Every time OpenCode starts, this plugin runs silently in the background:
|
|
8
|
+
|
|
9
|
+
- **First run:** clones the full `antigravity-awesome-skills` repo into `~/.config/opencode/skills/antigravity-awesome-skills`
|
|
10
|
+
- **Subsequent runs:** runs `git pull origin main` to silently fetch any new skills
|
|
11
|
+
- **Offline:** if no network is available, a warning is shown and OpenCode continues normally
|
|
12
|
+
|
|
13
|
+
OpenCode will then automatically detect all skills inside that folder and make them available to the AI agent.
|
|
14
|
+
|
|
15
|
+
You can then invoke any skill explicitly in your prompt:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
opencode run @brainstorming help me plan a feature
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or simply describe what you want and OpenCode will pick the right skill automatically.
|
|
22
|
+
|
|
23
|
+
## 🚀 Installation
|
|
24
|
+
|
|
25
|
+
### 1. Add the plugin to your global OpenCode config
|
|
26
|
+
|
|
27
|
+
Edit (or create) `~/.config/opencode/opencode.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"plugin": [
|
|
32
|
+
"opencode-skills-antigravity"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
OpenCode will automatically download the npm package on next startup via Bun. No manual `npm install` required.
|
|
38
|
+
|
|
39
|
+
### 2. Make sure `git` is installed
|
|
40
|
+
|
|
41
|
+
The plugin uses `git clone` and `git pull` under the hood. Verify with:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
git --version
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 📁 Skills location
|
|
48
|
+
|
|
49
|
+
Skills are stored at:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
~/.config/opencode/skills/antigravity-awesome-skills/
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
OpenCode scans this directory automatically at startup.
|
|
56
|
+
|
|
57
|
+
## 🛠️ Development
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
git clone https://github.com/FrancoStino/opencode-skills-antigravity.git
|
|
61
|
+
cd opencode-skills-antigravity
|
|
62
|
+
npm install
|
|
63
|
+
npm run build
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Test locally before publishing
|
|
67
|
+
|
|
68
|
+
Add the local path directly to your `opencode.json` to test without publishing:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"plugin": [
|
|
73
|
+
"/absolute/path/to/opencode-skills-antigravity/src/index.ts"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 📄 License
|
|
79
|
+
|
|
80
|
+
MIT © [Davide Ladisa](https://www.davideladisa.it/)
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { exec } from "child_process";
|
|
2
|
+
import { promisify } from "util";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import os from "os";
|
|
5
|
+
const execAsync = promisify(exec);
|
|
6
|
+
const AntigravityAutoUpdater = async (_ctx) => {
|
|
7
|
+
// Run asynchronously in background to not block OpenCode startup
|
|
8
|
+
setTimeout(async () => {
|
|
9
|
+
try {
|
|
10
|
+
console.log("🔄 [Antigravity Plugin] Syncing Awesome Skills...");
|
|
11
|
+
// Resolve absolute path to OpenCode's config directory
|
|
12
|
+
// so it works regardless of the cwd when OpenCode is launched
|
|
13
|
+
const opencodeCfgDir = path.join(os.homedir(), ".config", "opencode");
|
|
14
|
+
const skillsPath = path.join(opencodeCfgDir, ".agents", "skills");
|
|
15
|
+
// --yes skips the interactive "Ok to proceed?" prompt from npx
|
|
16
|
+
const { stdout, stderr } = await execAsync(`npx --yes antigravity-awesome-skills --path "${skillsPath}"`);
|
|
17
|
+
if (stdout)
|
|
18
|
+
console.log("✅ [Antigravity Plugin]", stdout.trim());
|
|
19
|
+
if (stderr)
|
|
20
|
+
console.error("⚠️ [Antigravity Plugin]", stderr.trim());
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
24
|
+
console.error("⚠️ [Antigravity Plugin] Could not sync skills (offline?):", message);
|
|
25
|
+
}
|
|
26
|
+
}, 0);
|
|
27
|
+
return {};
|
|
28
|
+
};
|
|
29
|
+
export default AntigravityAutoUpdater;
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opencode-skills-antigravity",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "OpenCode CLI plugin that automatically downloads and keeps Antigravity Awesome Skills up to date.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/FrancoStino/opencode-skills-antigravity"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/FrancoStino/opencode-skills-antigravity",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/FrancoStino/opencode-skills-antigravity/issues"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"opencode",
|
|
21
|
+
"opencode-plugin",
|
|
22
|
+
"antigravity",
|
|
23
|
+
"skills",
|
|
24
|
+
"ai",
|
|
25
|
+
"agent"
|
|
26
|
+
],
|
|
27
|
+
"author": "Davide Ladisa <rawsar@gmail.com>",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@opencode-ai/plugin": "^1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@opencode-ai/sdk": "^1.0.0",
|
|
34
|
+
"@types/bun": "latest",
|
|
35
|
+
"@types/node": "^20.0.0",
|
|
36
|
+
"typescript": "^5.0.0"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Plugin } from "@opencode-ai/plugin";
|
|
2
|
+
import { exec } from "child_process";
|
|
3
|
+
import { promisify } from "util";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import os from "os";
|
|
6
|
+
|
|
7
|
+
const execAsync = promisify(exec);
|
|
8
|
+
|
|
9
|
+
const AntigravityAutoUpdater: Plugin = async (_ctx) => {
|
|
10
|
+
// Run asynchronously in background to not block OpenCode startup
|
|
11
|
+
setTimeout(async () => {
|
|
12
|
+
try {
|
|
13
|
+
console.log("🔄 [Antigravity Plugin] Syncing Awesome Skills...");
|
|
14
|
+
|
|
15
|
+
// Resolve absolute path to OpenCode's config directory
|
|
16
|
+
// so it works regardless of the cwd when OpenCode is launched
|
|
17
|
+
const opencodeCfgDir = path.join(os.homedir(), ".config", "opencode");
|
|
18
|
+
const skillsPath = path.join(opencodeCfgDir, ".agents", "skills");
|
|
19
|
+
|
|
20
|
+
// --yes skips the interactive "Ok to proceed?" prompt from npx
|
|
21
|
+
const { stdout, stderr } = await execAsync(
|
|
22
|
+
`npx --yes antigravity-awesome-skills --path "${skillsPath}"`
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
if (stdout) console.log("✅ [Antigravity Plugin]", stdout.trim());
|
|
26
|
+
if (stderr) console.error("⚠️ [Antigravity Plugin]", stderr.trim());
|
|
27
|
+
|
|
28
|
+
} catch (error: unknown) {
|
|
29
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
30
|
+
console.error("⚠️ [Antigravity Plugin] Could not sync skills (offline?):", message);
|
|
31
|
+
}
|
|
32
|
+
}, 0);
|
|
33
|
+
|
|
34
|
+
return {};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default AntigravityAutoUpdater;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["src/**/*"]
|
|
15
|
+
}
|