Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .github/workflows/agent-skills.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update agent skills

on:
schedule:
- cron: "0 9 * * *"
workflow_dispatch:

jobs:
skills:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 praise: persist-credentials: false with GH_TOKEN only on the push step keeps the token away from the update step.

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.x
- name: Update the skills in each skills-lock.json
run: |
while IFS= read -r lock; do
(cd "$(dirname "$lock")" && npx --yes skills@1 update --project --yes)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📦 issue (blocking): skills@1 floats to every new 1.x and runs in a job that can write. A bad release could drop a .git/hooks file or a $GITHUB_PATH shim that the next step runs with GH_TOKEN. Could we pin an exact version?

Suggested change
(cd "$(dirname "$lock")" && npx --yes skills@1 update --project --yes)
(cd "$(dirname "$lock")" && npx --yes skills@1.9.0 update --project --yes)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Keeping skills@1 for now, per our DM. The token stays off the npx step, and a pin would mostly add version bumps to chase across 49 samples.

done < <(find . -name skills-lock.json -not -path "*/node_modules/*")
Comment on lines +23 to +26

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪓 suggestion (non-blocking): this repo has one skills-lock.json at the root, so the find loop and glob pathspecs could be a single npx command and git add -- skills-lock.json .agents/skills .claude/skills.

Suggested change
run: |
while IFS= read -r lock; do
(cd "$(dirname "$lock")" && npx --yes skills@1 update --project --yes)
done < <(find . -name skills-lock.json -not -path "*/node_modules/*")
npx --yes skills@1.9.0 update --project --yes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I'd like to keep one workflow shape across all 49 samples, so a fix lands the same way everywhere. Here the loop just runs once.

- name: Open a pull request with the updates
env:
GH_TOKEN: ${{ github.token }}
run: |
git add -- '*skills-lock.json' '*.agents/skills/*' '*.claude/skills/*'
if git diff --cached --quiet; then exit 0; fi
gh auth setup-git
state="$(gh pr view agent-skills --json state --jq .state 2>/dev/null || true)"
if [ "$state" = "OPEN" ] && git fetch --quiet --depth 2 origin agent-skills && [ "$(git rev-parse FETCH_HEAD^)" = "$(git rev-parse HEAD)" ] && git diff --cached --quiet FETCH_HEAD; then exit 0; fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -C agent-skills
git commit -m "chore: update agent skills"
git push --force origin agent-skills
if [ "$(gh pr view agent-skills --json state --jq .state 2>/dev/null)" != "OPEN" ]; then
gh pr create --head agent-skills --title "chore: update agent skills" --body "Updates the agent skills in \`skills-lock.json\` to the latest versions."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ issue (blocking): main here requires the test and lint checks from ci.yml, but a PR pushed and opened with the default GITHUB_TOKEN never triggers ci.yml. Each update PR would wait on them until someone re-triggers it. Could we use an app token from actions/create-github-app-token for the push and gh pr create?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: The update PRs do start CI here. GitHub holds the runs as action_required, since github-actions[bot] isn't a collaborator, and MIC approves them before merging. We'll follow up on a way to run them without a manual approval. The pilot's first update PR ran and passed this way: slack-samples/bolt-js-starter-template#190

fi
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ It's recommended to use a [developer sandbox](https://docs.slack.dev/tools/devel

Install the [Slack MCP and Skills Plugin](https://docs.slack.dev/ai/slack-skills-plugin/) so your coding agent can create, run, and deploy Slack apps, look up Web API methods and scopes, and build Block Kit without guessing.

`.github/workflows/agent-skills.yml` checks daily for updates to the agent skills in `skills-lock.json` and opens a pull request when they change. To let it open pull requests in your own repository, turn on **Allow GitHub Actions to create and approve pull requests** in **Settings > Actions > General**.

### Claude Code

Run this in a Claude Code session:
Expand Down
Loading