@hagicode/skillsbase 0.1.0-dev.11.1.4f10d19 → 0.1.0-dev.12.1.22b307e

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/cli.mjs CHANGED
@@ -822,10 +822,16 @@ async function writeGithubActions(repoPath, options = {}) {
822
822
  if (kind === "workflow" || kind === "all") targets.push({
823
823
  relativePath: path.join(".github", "workflows", "skills-sync.yml"),
824
824
  template: path.join("workflows", "skills-sync.yml")
825
+ }, {
826
+ relativePath: path.join(".github", "workflows", "skills-manage.yml"),
827
+ template: path.join("workflows", "skills-manage.yml")
825
828
  });
826
- if (kind === "action" || kind === "all") targets.push({
829
+ if (kind === "workflow" || kind === "action" || kind === "all") targets.push({
827
830
  relativePath: path.join(".github", "actions", "skillsbase-sync", "action.yml"),
828
831
  template: path.join("actions", "skillsbase-sync", "action.yml")
832
+ }, {
833
+ relativePath: path.join(".github", "actions", "skillsbase-manage", "action.yml"),
834
+ template: path.join("actions", "skillsbase-manage", "action.yml")
829
835
  });
830
836
  if (targets.length === 0) throw new CliError(`Unsupported github_action kind: ${kind}`, { details: ["Supported values: workflow, action, all."] });
831
837
  const items = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hagicode/skillsbase",
3
- "version": "0.1.0-dev.11.1.4f10d19",
3
+ "version": "0.1.0-dev.12.1.22b307e",
4
4
  "description": "Managed skills repository CLI",
5
5
  "homepage": "https://github.com/HagiCode-org/skillsbase#readme",
6
6
  "bugs": {
@@ -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
@@ -2,15 +2,26 @@
2
2
 
3
3
  # Maintainer Workflow
4
4
 
5
- The maintainer flow is `init -> add -> sync -> github_action`.
5
+ The maintainer flow is `init -> add/remove -> sync -> github_action`.
6
6
 
7
7
  ## Lifecycle
8
8
 
9
9
  1. `skillsbase init`
10
- 2. `skillsbase add <skill-name>`
10
+ 2. `skillsbase add <skill-name>` or `skillsbase remove <skill-name>`
11
11
  3. `skillsbase sync`
12
12
  4. `skillsbase github_action --kind all`
13
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
+
14
25
  ## Notes
15
26
 
16
27
  - `sources.yaml` is the single source of truth.
@@ -18,3 +29,4 @@ The maintainer flow is `init -> add -> sync -> github_action`.
18
29
  - `.skill-source.json` records source and conversion metadata.
19
30
  - `skillsbase sync --check` validates drift without writing files.
20
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,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 }}
@@ -23,23 +23,8 @@ jobs:
23
23
  - name: Checkout repository
24
24
  uses: actions/checkout@v4
25
25
 
26
- - name: Setup Node.js
27
- uses: actions/setup-node@v4
26
+ - name: Run skillsbase validation
27
+ uses: ./.github/actions/skillsbase-sync
28
28
  with:
29
29
  node-version: {{NODE_VERSION}}
30
- cache: npm
31
-
32
- - name: Install dependencies
33
- run: npm ci
34
-
35
- - name: Upgrade npm
36
- run: npm install --global npm@10.9.2
37
-
38
- - name: Install skillsbase
39
- run: npm install --global @hagicode/skillsbase
40
-
41
- - name: Run tests
42
- run: npm test
43
-
44
- - name: Validate managed repository state
45
- run: skillsbase sync --check --repo .
30
+ run-tests: "true"