diff --git a/.github/actions/skillkit/README.md b/.github/actions/skillkit/README.md new file mode 100644 index 00000000..6be9988f --- /dev/null +++ b/.github/actions/skillkit/README.md @@ -0,0 +1,87 @@ +# SkillKit GitHub Action + +A reusable composite action to install, scan, and manage AI agent skills in CI/CD pipelines. + +## Usage + +```yaml +# Install skills +- uses: rohitg00/skillkit/.github/actions/skillkit@main + with: + command: install + source: anthropics/skills + +# Security scan +- uses: rohitg00/skillkit/.github/actions/skillkit@main + with: + command: scan + source: ./skills + +# Check for updates +- uses: rohitg00/skillkit/.github/actions/skillkit@main + with: + command: check +``` + +## Inputs + +| Input | Description | Required | Default | +|-------|-------------|----------|---------| +| `command` | SkillKit command to run (`install`, `scan`, `check`, `sync`) | Yes | | +| `source` | Skill source for install (e.g. `owner/repo`) | No | | +| `args` | Additional arguments | No | `''` | +| `node-version` | Node.js version | No | `20` | +| `agent` | Target agent (e.g. `claude-code`, `cursor`) | No | `claude-code` | + +## Examples + +### Install and sync skills + +```yaml +jobs: + setup-skills: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: rohitg00/skillkit/.github/actions/skillkit@main + with: + command: install + source: anthropics/skills + agent: cursor + + - uses: rohitg00/skillkit/.github/actions/skillkit@main + with: + command: sync +``` + +### Security scan on PR + +```yaml +jobs: + scan-skills: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: rohitg00/skillkit/.github/actions/skillkit@main + with: + command: scan + source: ./skills + args: '--fail-on high' +``` + +### Check for updates + +```yaml +jobs: + check-updates: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: rohitg00/skillkit/.github/actions/skillkit@main + with: + command: check + args: '--json' +``` diff --git a/.github/actions/skillkit/action.yml b/.github/actions/skillkit/action.yml new file mode 100644 index 00000000..8b8fc95f --- /dev/null +++ b/.github/actions/skillkit/action.yml @@ -0,0 +1,44 @@ +name: 'SkillKit' +description: 'Install, scan, and manage AI agent skills in CI/CD' +inputs: + command: + description: 'SkillKit command to run (install, scan, check, sync)' + required: true + source: + description: 'Skill source for install (e.g. owner/repo)' + required: false + args: + description: 'Additional arguments' + required: false + default: '' + node-version: + description: 'Node.js version' + required: false + default: '20' + agent: + description: 'Target agent (e.g. claude-code, cursor)' + required: false + default: 'claude-code' + +runs: + using: 'composite' + steps: + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + + - name: Install SkillKit + shell: bash + run: npm install -g skillkit@latest + + - name: Run SkillKit + shell: bash + run: | + if [ "${{ inputs.command }}" = "install" ] && [ -n "${{ inputs.source }}" ]; then + skillkit install "${{ inputs.source }}" --agent "${{ inputs.agent }}" --yes --json ${{ inputs.args }} + elif [ "${{ inputs.command }}" = "scan" ] && [ -n "${{ inputs.source }}" ]; then + skillkit scan "${{ inputs.source }}" --json ${{ inputs.args }} + else + skillkit ${{ inputs.command }} ${{ inputs.args }} + fi