@hagicode/skillsbase 0.1.0-dev.1.1.426f4b0
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/LICENSE +21 -0
- package/README.md +132 -0
- package/README.zh-CN.md +127 -0
- package/bin/skillsbase.mjs +44 -0
- package/dist/cli.mjs +1109 -0
- package/package.json +53 -0
- package/templates/actions/skillsbase-manage/action.yml +96 -0
- package/templates/actions/skillsbase-sync/action.yml +44 -0
- package/templates/docs/maintainer-workflow.md +32 -0
- package/templates/skills/README.md +9 -0
- package/templates/sources.yaml +25 -0
- package/templates/workflows/skills-manage.yml +54 -0
- package/templates/workflows/skills-sync.yml +30 -0
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hagicode/skillsbase",
|
|
3
|
+
"version": "0.1.0-dev.1.1.426f4b0",
|
|
4
|
+
"description": "Managed skills repository CLI",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/HagiCode-org/skillsbase#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/HagiCode-org/skillsbase/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/HagiCode-org/skillsbase.git"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"packageManager": "npm@10.9.2",
|
|
16
|
+
"bin": {
|
|
17
|
+
"skillsbase": "./bin/skillsbase.mjs"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"bin",
|
|
21
|
+
"dist",
|
|
22
|
+
"templates",
|
|
23
|
+
"README.md",
|
|
24
|
+
"README.zh-CN.md"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "vite build",
|
|
28
|
+
"clean": "rm -rf dist",
|
|
29
|
+
"cli": "node --import tsx ./src/cli-entry.ts",
|
|
30
|
+
"pack:check": "node ./scripts/verify-package.mjs",
|
|
31
|
+
"publish:resolve-dev-version": "node ./scripts/resolve-dev-version.mjs",
|
|
32
|
+
"publish:verify-readiness": "node ./scripts/verify-publish-readiness.mjs",
|
|
33
|
+
"publish:verify-release": "node ./scripts/verify-release-version.mjs",
|
|
34
|
+
"test": "node --import tsx --test ./tests/*.test.ts",
|
|
35
|
+
"smoke": "node --import tsx ./scripts/smoke.mjs",
|
|
36
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=22.12.0",
|
|
40
|
+
"npm": ">=10.9.2"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public",
|
|
44
|
+
"provenance": true,
|
|
45
|
+
"registry": "https://registry.npmjs.org/"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^24.0.0",
|
|
49
|
+
"tsx": "^4.20.6",
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"vite": "^8.0.0"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Managed by skillsbase CLI.
|
|
2
|
+
|
|
3
|
+
name: skillsbase-manage
|
|
4
|
+
description: Run a managed add, remove, or sync operation for a skillsbase repository
|
|
5
|
+
|
|
6
|
+
inputs:
|
|
7
|
+
node-version:
|
|
8
|
+
description: Node.js version used for maintenance
|
|
9
|
+
required: false
|
|
10
|
+
default: "{{NODE_VERSION}}"
|
|
11
|
+
operation:
|
|
12
|
+
description: Maintenance operation to run (`add`, `remove`, or `sync`)
|
|
13
|
+
required: true
|
|
14
|
+
skill-name:
|
|
15
|
+
description: Skill name for `add` or `remove`
|
|
16
|
+
required: false
|
|
17
|
+
default: ""
|
|
18
|
+
source:
|
|
19
|
+
description: Optional source key for `add` or `remove`
|
|
20
|
+
required: false
|
|
21
|
+
default: ""
|
|
22
|
+
allow-missing-sources:
|
|
23
|
+
description: Skip missing local roots during the operation
|
|
24
|
+
required: false
|
|
25
|
+
default: "false"
|
|
26
|
+
run-tests:
|
|
27
|
+
description: Whether to run npm test after the maintenance command
|
|
28
|
+
required: false
|
|
29
|
+
default: "true"
|
|
30
|
+
|
|
31
|
+
runs:
|
|
32
|
+
using: composite
|
|
33
|
+
steps:
|
|
34
|
+
- name: Setup Node.js
|
|
35
|
+
uses: actions/setup-node@v4
|
|
36
|
+
with:
|
|
37
|
+
node-version: ${{ inputs.node-version }}
|
|
38
|
+
cache: npm
|
|
39
|
+
|
|
40
|
+
- name: Install dependencies
|
|
41
|
+
shell: bash
|
|
42
|
+
run: npm ci
|
|
43
|
+
|
|
44
|
+
- name: Upgrade npm
|
|
45
|
+
shell: bash
|
|
46
|
+
run: npm install --global npm@10.9.2
|
|
47
|
+
|
|
48
|
+
- name: Install skillsbase
|
|
49
|
+
shell: bash
|
|
50
|
+
run: npm install --global @hagicode/skillsbase
|
|
51
|
+
|
|
52
|
+
- name: Run maintenance command
|
|
53
|
+
shell: bash
|
|
54
|
+
env:
|
|
55
|
+
OPERATION: ${{ inputs.operation }}
|
|
56
|
+
SKILL_NAME: ${{ inputs.skill-name }}
|
|
57
|
+
SOURCE: ${{ inputs.source }}
|
|
58
|
+
ALLOW_MISSING_SOURCES: ${{ inputs.allow-missing-sources }}
|
|
59
|
+
run: |
|
|
60
|
+
set -euo pipefail
|
|
61
|
+
|
|
62
|
+
base_args=(--repo .)
|
|
63
|
+
if [[ "${ALLOW_MISSING_SOURCES}" == "true" ]]; then
|
|
64
|
+
base_args+=(--allow-missing-sources)
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
case "${OPERATION}" in
|
|
68
|
+
add|remove)
|
|
69
|
+
if [[ -z "${SKILL_NAME}" ]]; then
|
|
70
|
+
echo "::error::skill-name is required when operation=${OPERATION}."
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
command=(skillsbase "${OPERATION}" "${SKILL_NAME}" "${base_args[@]}")
|
|
75
|
+
if [[ -n "${SOURCE}" ]]; then
|
|
76
|
+
command+=(--source "${SOURCE}")
|
|
77
|
+
fi
|
|
78
|
+
;;
|
|
79
|
+
sync)
|
|
80
|
+
command=(skillsbase sync "${base_args[@]}")
|
|
81
|
+
;;
|
|
82
|
+
*)
|
|
83
|
+
echo "::error::Unsupported operation: ${OPERATION}."
|
|
84
|
+
exit 1
|
|
85
|
+
;;
|
|
86
|
+
esac
|
|
87
|
+
|
|
88
|
+
printf 'Running:'
|
|
89
|
+
printf ' %q' "${command[@]}"
|
|
90
|
+
printf '\n'
|
|
91
|
+
"${command[@]}"
|
|
92
|
+
|
|
93
|
+
- name: Run tests
|
|
94
|
+
if: ${{ inputs.run-tests == 'true' }}
|
|
95
|
+
shell: bash
|
|
96
|
+
run: npm test
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Managed by skillsbase CLI.
|
|
2
|
+
|
|
3
|
+
name: skillsbase-sync
|
|
4
|
+
description: Validate a managed skillsbase repository and run sync in check mode
|
|
5
|
+
|
|
6
|
+
inputs:
|
|
7
|
+
node-version:
|
|
8
|
+
description: Node.js version used for validation
|
|
9
|
+
required: false
|
|
10
|
+
default: "{{NODE_VERSION}}"
|
|
11
|
+
run-tests:
|
|
12
|
+
description: Whether to run npm test before sync --check
|
|
13
|
+
required: false
|
|
14
|
+
default: "true"
|
|
15
|
+
|
|
16
|
+
runs:
|
|
17
|
+
using: composite
|
|
18
|
+
steps:
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: ${{ inputs.node-version }}
|
|
23
|
+
cache: npm
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
shell: bash
|
|
27
|
+
run: npm ci
|
|
28
|
+
|
|
29
|
+
- name: Upgrade npm
|
|
30
|
+
shell: bash
|
|
31
|
+
run: npm install --global npm@10.9.2
|
|
32
|
+
|
|
33
|
+
- name: Install skillsbase
|
|
34
|
+
shell: bash
|
|
35
|
+
run: npm install --global @hagicode/skillsbase
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
if: ${{ inputs.run-tests == 'true' }}
|
|
39
|
+
shell: bash
|
|
40
|
+
run: npm test
|
|
41
|
+
|
|
42
|
+
- name: Run sync check
|
|
43
|
+
shell: bash
|
|
44
|
+
run: skillsbase sync --check --repo .
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!-- Managed by skillsbase CLI. -->
|
|
2
|
+
|
|
3
|
+
# Maintainer Workflow
|
|
4
|
+
|
|
5
|
+
The maintainer flow is `init -> add/remove -> sync -> github_action`.
|
|
6
|
+
|
|
7
|
+
## Lifecycle
|
|
8
|
+
|
|
9
|
+
1. `skillsbase init`
|
|
10
|
+
2. `skillsbase add <skill-name>` or `skillsbase remove <skill-name>`
|
|
11
|
+
3. `skillsbase sync`
|
|
12
|
+
4. `skillsbase github_action --kind all`
|
|
13
|
+
|
|
14
|
+
## GitHub Maintenance Path
|
|
15
|
+
|
|
16
|
+
Use `.github/workflows/skills-manage.yml` only for explicit non-interactive maintenance from GitHub UI.
|
|
17
|
+
|
|
18
|
+
- `operation` chooses `add`, `remove`, or `sync`
|
|
19
|
+
- `skill-name` is required for `add` and `remove`
|
|
20
|
+
- `source` is optional and maps to `--source`
|
|
21
|
+
- `allow-missing-sources` maps to `--allow-missing-sources`
|
|
22
|
+
- `run-tests` controls the post-operation `npm test`
|
|
23
|
+
- The workflow does not commit, push, or open pull requests
|
|
24
|
+
|
|
25
|
+
## Notes
|
|
26
|
+
|
|
27
|
+
- `sources.yaml` is the single source of truth.
|
|
28
|
+
- `skills/` stores managed output only.
|
|
29
|
+
- `.skill-source.json` records source and conversion metadata.
|
|
30
|
+
- `skillsbase sync --check` validates drift without writing files.
|
|
31
|
+
- If a source root is unavailable, use `skillsbase sync --allow-missing-sources` to skip it.
|
|
32
|
+
- Local CLI commands remain the primary maintainer path.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!-- Managed by skillsbase CLI. -->
|
|
2
|
+
|
|
3
|
+
# Managed Skills
|
|
4
|
+
|
|
5
|
+
This directory contains managed skill output only.
|
|
6
|
+
|
|
7
|
+
- Every skill directory must include `SKILL.md`
|
|
8
|
+
- Every managed directory must include `.skill-source.json`
|
|
9
|
+
- Do not edit managed files by hand; make changes in `sources.yaml` and the upstream source instead
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Managed by skillsbase CLI.
|
|
2
|
+
# This template documents the expected manifest shape. The CLI serializes the real file.
|
|
3
|
+
version: 1
|
|
4
|
+
skillsRoot: skills
|
|
5
|
+
metadataFile: .skill-source.json
|
|
6
|
+
managedBy: skillsbase
|
|
7
|
+
remoteRepository: "{{REMOTE_REPOSITORY}}"
|
|
8
|
+
staleCleanup: true
|
|
9
|
+
skillsCliVersion: 1.4.8
|
|
10
|
+
installAgent: codex
|
|
11
|
+
sources:
|
|
12
|
+
- key: first-party
|
|
13
|
+
label: "First-party local skills"
|
|
14
|
+
kind: first-party
|
|
15
|
+
root: "{{FIRST_PARTY_ROOT}}"
|
|
16
|
+
targetPrefix: ""
|
|
17
|
+
include:
|
|
18
|
+
- "{{FIRST_PARTY_EXAMPLE}}"
|
|
19
|
+
- key: system
|
|
20
|
+
label: "Mirrored system skills"
|
|
21
|
+
kind: mirrored-system
|
|
22
|
+
root: "{{SYSTEM_ROOT}}"
|
|
23
|
+
targetPrefix: system-
|
|
24
|
+
include:
|
|
25
|
+
- "{{SYSTEM_EXAMPLE}}"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Managed by skillsbase CLI.
|
|
2
|
+
|
|
3
|
+
name: Skills Manage
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
operation:
|
|
9
|
+
description: Operation to run (`add`, `remove`, or `sync`)
|
|
10
|
+
required: true
|
|
11
|
+
type: choice
|
|
12
|
+
default: sync
|
|
13
|
+
options:
|
|
14
|
+
- add
|
|
15
|
+
- remove
|
|
16
|
+
- sync
|
|
17
|
+
skill-name:
|
|
18
|
+
description: Skill name for `add` or `remove`
|
|
19
|
+
required: false
|
|
20
|
+
type: string
|
|
21
|
+
source:
|
|
22
|
+
description: Optional source key for `add` or `remove`
|
|
23
|
+
required: false
|
|
24
|
+
type: string
|
|
25
|
+
allow-missing-sources:
|
|
26
|
+
description: Skip missing local roots during the operation
|
|
27
|
+
required: false
|
|
28
|
+
type: boolean
|
|
29
|
+
default: false
|
|
30
|
+
run-tests:
|
|
31
|
+
description: Run `npm test` after the maintenance command
|
|
32
|
+
required: false
|
|
33
|
+
type: boolean
|
|
34
|
+
default: true
|
|
35
|
+
|
|
36
|
+
permissions:
|
|
37
|
+
contents: read
|
|
38
|
+
|
|
39
|
+
jobs:
|
|
40
|
+
manage:
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
steps:
|
|
43
|
+
- name: Checkout repository
|
|
44
|
+
uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- name: Run skillsbase maintenance
|
|
47
|
+
uses: ./.github/actions/skillsbase-manage
|
|
48
|
+
with:
|
|
49
|
+
node-version: {{NODE_VERSION}}
|
|
50
|
+
operation: ${{ inputs.operation }}
|
|
51
|
+
skill-name: ${{ inputs.skill-name }}
|
|
52
|
+
source: ${{ inputs.source }}
|
|
53
|
+
allow-missing-sources: ${{ inputs.allow-missing-sources }}
|
|
54
|
+
run-tests: ${{ inputs.run-tests }}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Managed by skillsbase CLI.
|
|
2
|
+
|
|
3
|
+
name: Skills Sync
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
pull_request:
|
|
8
|
+
push:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: skills-sync-${{ github.ref }}
|
|
17
|
+
cancel-in-progress: false
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
validate:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout repository
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Run skillsbase validation
|
|
27
|
+
uses: ./.github/actions/skillsbase-sync
|
|
28
|
+
with:
|
|
29
|
+
node-version: {{NODE_VERSION}}
|
|
30
|
+
run-tests: "true"
|