Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/skillspector/build-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SkillSpector's build backend, installed first so scan-skills can build it with
# --no-build-isolation instead of letting pip fetch hatchling unpinned. Regenerate with:
# echo hatchling | uv pip compile - --universal --python-version 3.12 --generate-hashes \
# --no-header --no-annotate -o .github/skillspector/build-requirements.txt
hatchling==1.32.4 \
--hash=sha256:08ecf7548fb48205e7f213d70c71e67b8271b7242093dc3f1da578b42c734a2c \
--hash=sha256:c4468f73144c054d2aab4ef0f0378c43b9878bf07f8ffd6b79690e970d375f07
packaging==26.3 \
--hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \
--hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c
pathspec==1.1.1 \
--hash=sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a \
--hash=sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189
pluggy==1.6.0 \
--hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \
--hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746
tomlkit==0.15.1 \
--hash=sha256:177a05aece5a8ca5266fd3c448abb47b8d352f09d477d3ca8332db4d89b24304 \
--hash=sha256:e25bbf38843005246210a12982776f27f99cb9be67160e14434d0c0d21ee1e97
trove-classifiers==2026.9.21.13 \
--hash=sha256:0a9ebc8d4e2f3e8a22848c5258033035bec17a3012ac3fea16dbaa764489eb71 \
--hash=sha256:8b1ff4f9c191b1040b71c37f1e445ab99732911e3cd91de52838453a854d7a17
19 changes: 19 additions & 0 deletions .github/skillspector/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SkillSpector's runtime dependencies, copied from its pyproject.toml at the pinned commit,
# minus langgraph-cli[inmem]. That one only serves SkillSpector's own `make langgraph-dev`
# (LangGraph Studio): the scanner never imports it, and it brings in ~40 packages, among
# them a web server, grpcio and jsonschema-rs, that the scan never loads. With it removed,
# a full scan of this repository gives the same findings.
#
# To bump SkillSpector: update this list from its pyproject.toml (still leaving out
# langgraph-cli), then regenerate requirements.txt as its header says.
typer>=0.23.0,<0.24
rich>=14.3.0
httpx>=0.28.0
pyyaml>=6.0.1
pydantic>=2.12.0
openai>=2.25.0
langgraph>=1.2.14
langchain-core>=1.2.17
langchain-openai>=1.1.10
langsmith>=0.7.30
yara-python>=4.5.0
1,536 changes: 1,536 additions & 0 deletions .github/skillspector/requirements.txt
Comment thread
glebedel marked this conversation as resolved.
Resolved

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions .github/workflows/scan-skills.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Scan Skills (SkillSpector)

# Security-scan Claude skills with NVIDIA SkillSpector.
# - pull request: scan skills changed vs main; FAIL on high risk
# - push to main (merge): scan every skill; report-only (uploads SARIF)
on:
push:
branches: [main]
pull_request:
branches: [main]

permissions: {}

concurrency:
group: scan-skills-${{ github.ref }}
cancel-in-progress: true

jobs:
scan-skills:
runs-on: ubuntu-latest
permissions:
actions: read # required by upload-sarif in private repositories
contents: read
security-events: write # required to upload SARIF to code scanning

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # full history so we can diff against main
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'

- name: Install SkillSpector
# SkillSpector and everything it needs to scan are pinned with hashes in
# .github/skillspector/, which says how to bump them. --no-deps because that file is a
# closed set that leaves out SkillSpector's dev-server dependency (requirements.in says
# why). Its build backend goes in first, so the build fetches nothing unpinned.
run: |
python -m pip install --require-hashes -r .github/skillspector/build-requirements.txt
python -m pip install --require-hashes --no-deps --no-build-isolation \
-r .github/skillspector/requirements.txt

- name: Determine scan mode
id: mode
run: |
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
echo "mode=all" >> "$GITHUB_OUTPUT"
else
echo "mode=changed" >> "$GITHUB_OUTPUT"
fi

- name: Fetch base branch
if: steps.mode.outputs.mode == 'changed'
run: git fetch origin main:refs/remotes/origin/main

- name: Scan skills
env:
SKILL_ROOTS: plugins
run: |
if [ "${{ steps.mode.outputs.mode }}" = "all" ]; then
# Full scan on merge to main: report findings, but don't block.
REPORT_ONLY=1 scripts/scan-skills.sh all
else
# Branch / PR: enforce that changed skills are not high-risk.
scripts/scan-skills.sh changed origin/main
fi

- name: Upload SARIF reports (artifact)
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: skillspector-sarif
path: skillspector-reports/
if-no-files-found: ignore

- name: Check code scanning availability
id: code-scanning
if: >-
always() &&
hashFiles('skillspector-reports/skillspector.sarif') != '' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
env:
GH_TOKEN: ${{ github.token }}
run: |
# Code scanning is always available on public repositories; private ones need Code Security.
if status="$(gh api "repos/$GITHUB_REPOSITORY" --jq 'if .visibility == "public" then "enabled" else (.security_and_analysis.code_security.status // .security_and_analysis.advanced_security.status // "disabled") end')"; then
echo "Code Security status: $status"
else
echo "::warning::Could not determine Code Security status; preserving SARIF as an artifact only."
status="disabled"
fi

if [ "$status" = "enabled" ]; then
echo "enabled=true" >> "$GITHUB_OUTPUT"
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
echo "Code scanning upload skipped; enable Code Security to publish SARIF findings in GitHub."
fi

- name: Upload SARIF to code scanning
# When Code Security is enabled, a real upload failure fails the check.
# Fork PRs and private repositories without Code Security retain the artifact.
if: always() && steps.code-scanning.outputs.enabled == 'true'
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
sarif_file: skillspector-reports/skillspector.sarif
category: skillspector
32 changes: 32 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,42 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Validate plugin manifests
run: npx --yes @anthropic-ai/[email protected] plugin validate .

skill-text-audit:
name: Audit skill instructions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# The audit diffs a pull request against the merge base, which a shallow clone lacks.
fetch-depth: 0
persist-credentials: false

- name: Check the vendored skill text audit
# scripts/audit_skill_text.py is StackOneHQ/powerful-plugins' file at the commit in
# scripts/audit_skill_text.pin, so a local edit fails here; change it there, then bump both.
run: |
pin="$(cat scripts/audit_skill_text.pin)"
if ! [[ "$pin" =~ ^[0-9a-f]{40}$ ]]; then
echo "::error::scripts/audit_skill_text.pin must hold one full commit SHA"
exit 1
fi
curl -fsSL --retry 3 --max-time 30 -o "$RUNNER_TEMP/audit_skill_text.py" \
"https://raw.githubusercontent.com/StackOneHQ/powerful-plugins/$pin/scripts/audit_skill_text.py"
cmp "$RUNNER_TEMP/audit_skill_text.py" scripts/audit_skill_text.py

- name: Audit the instructions these plugins give the agent
# Guardrail evasion, pipe-to-shell and unreadable files fail; the other rules annotate the
# pull request. A pull request audits the plugins it changes; other runs audit them all.
run: >-
python3 scripts/audit_skill_text.py --catalog . --trusted-domain stackone.com
${GITHUB_BASE_REF:+--base "origin/$GITHUB_BASE_REF"}

defender:
name: Test ${{ matrix.plugin }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
.stackone-deps-install.lock
skillspector-reports/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ These skills **teach workflows** while pointing to **live documentation** for de
- Agents fetch the latest docs, SDK READMEs, and API specs at runtime
- The canonical source of truth remains [docs.stackone.com](https://docs.stackone.com)

## Security checks

Every pull request runs two scans over the skills it changes, and a push to `main` runs them over all of them:

- **SkillSpector** (NVIDIA, pinned in `.github/skillspector/`): on a pull request it fails a changed skill that scores as high risk; on `main` it scans every skill and only reports. Run it locally with `SKILL_ROOTS=plugins scripts/scan-skills.sh changed origin/main`.
- **Skill text audit** (`scripts/audit_skill_text.py`) reads the instructions each skill gives the agent. Text that tells the agent to get a command past a safety classifier or permission prompt, a download run by a shell (piped, or through `bash -c "$(curl ...)"`), and a file it cannot read fail the check. A package run that downloads whatever version is newest (`npx x@latest`) and a `curl` that sends data to a host other than StackOne are warnings. Run it locally with `python3 scripts/audit_skill_text.py --catalog . --trusted-domain stackone.com --base origin/main`.

`scripts/audit_skill_text.py` is a copy of the one in [StackOneHQ/powerful-plugins](https://github.com/StackOneHQ/powerful-plugins) at the commit in `scripts/audit_skill_text.pin`, and CI fails if the two differ. Change it there, then copy it here and update the pin.

## Documentation Index

StackOne publishes a machine-readable documentation index at [`docs.stackone.com/llms.txt`](https://docs.stackone.com/llms.txt) — agents can fetch this to discover all available documentation pages.
Expand Down
1 change: 1 addition & 0 deletions scripts/audit_skill_text.pin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e879ed5e9c9aee60d0cb35c0d86ca9108e7af6d0
Loading
Loading