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
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"name": "serverless",
"source": "./",
"description": "The Serverless Framework skill for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI.",
"description": "Serverless Framework skills for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI, with Dev Mode, MCP servers, sandboxes and upgrades to v4.",
"category": "development"
}
]
Expand Down
4 changes: 2 additions & 2 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "serverless",
"displayName": "Serverless Framework",
"version": "0.0.1",
"description": "The Serverless Framework skill for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI.",
"version": "1.0.0",
"description": "Serverless Framework skills for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI, with Dev Mode, MCP servers, sandboxes and upgrades to v4.",
"author": {
"name": "Serverless, Inc.",
"url": "https://www.serverless.com"
Expand Down
6 changes: 3 additions & 3 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "serverless",
"version": "0.0.1",
"description": "The Serverless Framework skill for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI.",
"version": "1.0.0",
"description": "Serverless Framework skills for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI, with Dev Mode, MCP servers, sandboxes and upgrades to v4.",
"author": {
"name": "Serverless, Inc.",
"url": "https://www.serverless.com"
Expand All @@ -22,7 +22,7 @@
"interface": {
"displayName": "Serverless Framework",
"shortDescription": "Deploy serverless apps on AWS",
"longDescription": "Gives your agent the Serverless Framework skill: how to write serverless.yml, deploy and operate services on AWS with the serverless CLI, develop against live AWS events, and read the documentation that ships with the CLI. In a project, the skill has the agent run \"serverless agent setup\", which adds the feature skills for Dev Mode, MCP servers on AWS Lambda, sandboxes and upgrades to v4.",
"longDescription": "Gives your agent the Serverless Framework skills: how to write serverless.yml, deploy and operate services on AWS with the serverless CLI, and read the documentation that ships with the CLI, plus one skill per feature: Dev Mode for running a deployed stage's functions locally against live AWS events, MCP servers on AWS Lambda, sandboxes for untrusted or AI-generated code, and upgrades from v1-v3 to v4.",
"developerName": "Serverless, Inc.",
"category": "Developer Tools",
"capabilities": [],
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Sync and release

# Copies the skill from the latest Serverless Framework release and, when the
# Copies the skills from the latest Serverless Framework release and, when a
# skill changed, commits a new plugin version to main. Then makes sure the
# version on main is tagged and has a GitHub Release with the plugin as a ZIP
# file. Every step creates only what is missing, so a run that stopped halfway
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
with:
node-version: 24

- name: Sync the skill
- name: Sync the skills
id: sync
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add skills skills.source.json CHANGELOG.md plugin.json .claude-plugin/plugin.json .codex-plugin/plugin.json gemini-extension.json
git commit --message "feat: skill from Serverless Framework ${SOURCE_TAG#sf-core@}"
git commit --message "feat: skills from Serverless Framework ${SOURCE_TAG#sf-core@}"
git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:main

- name: Tag and release the version on main
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Validate the repository
run: |
# A change to the skill or a manifest since the last released
# A change to the skills or a manifest since the last released
# version needs a higher version.
base="$(git describe --tags --abbrev=0 --match 'v*' 2>/dev/null || true)"
if [ -n "$base" ]; then
Expand All @@ -37,7 +37,7 @@ jobs:
node scripts/validate.mjs
fi

- name: Check that the skill equals its Framework release
- name: Check that the skills equal their Framework release
run: node scripts/sync-skills.mjs --check

- name: Validate with Claude Code
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.0

Skills from Serverless Framework 4.47.0 (`sf-core@4.47.0`).

## 0.0.1

Skill from Serverless Framework 4.46.0 (`sf-core@4.46.0`).
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Contributing

## The skill is generated
## The skills are generated

`skills/` is a copy of the skill in a release of the [Serverless Framework](https://github.com/serverless/serverless), made by `scripts/sync-skills.mjs`. A change made here is overwritten by the next sync, and the checks reject it before that. To change what the skill says, open a pull request against [`skills/serverless-framework`](https://github.com/serverless/serverless/tree/main/skills/serverless-framework) in the Framework repository; the change reaches this plugin with the next Framework release.
`skills/` is a copy of the skills in a release of the [Serverless Framework](https://github.com/serverless/serverless), made by `scripts/sync-skills.mjs`. A change made here is overwritten by the next sync, and the checks reject it before that. To change what a skill says, open a pull request against [`skills/`](https://github.com/serverless/serverless/tree/main/skills) in the Framework repository; the change reaches this plugin with the next Framework release.

## What lives here

- The manifests that make the skill installable: `plugin.json`, `.claude-plugin/`, `.codex-plugin/`, `.agents/plugins/` and `gemini-extension.json`.
- The manifests that make the skills installable: `plugin.json`, `.claude-plugin/`, `.codex-plugin/`, `.agents/plugins/` and `gemini-extension.json`.
- The scripts in `scripts/` and the workflows in `.github/workflows/`.
- This documentation.

Expand All @@ -28,7 +28,7 @@ node scripts/sync-skills.mjs --check

## Versions

Every manifest carries the same version. A change to a manifest or to a marketplace file needs a higher patch version in all of them, and an entry in `CHANGELOG.md`. A sync that changes the skill raises the minor version by itself. Once a version reaches `main`, the "Sync and release" workflow tags it and creates its GitHub Release.
Every manifest carries the same version. A change to a manifest or to a marketplace file needs a higher patch version in all of them, and an entry in `CHANGELOG.md`. A sync that changes a skill raises the minor version by itself. Once a version reaches `main`, the "Sync and release" workflow tags it and creates its GitHub Release.

## Not accepted

Expand Down
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Serverless Framework agent plugin

This plugin gives AI coding agents the [Serverless Framework](https://www.serverless.com/framework/docs) skill: how to build, deploy and operate applications on AWS Lambda with `serverless.yml` and the `serverless` CLI. Install it once, and your agent loads the skill whenever a task involves the Framework.
This plugin gives AI coding agents the [Serverless Framework](https://www.serverless.com/framework/docs) skills: how to build, deploy and operate applications on AWS Lambda with `serverless.yml` and the `serverless` CLI, and how to use the Framework's features. Install it once, and your agent loads the matching skill whenever a task involves the Framework.

Looking for plugins that extend the Framework itself, such as `serverless-offline`? Those are [Framework plugins](https://www.serverless.com/plugins), a different thing.

## Install

The skill works with the [Serverless Framework CLI](https://www.serverless.com/framework/docs/getting-started), version 4.
The skills work with the [Serverless Framework CLI](https://www.serverless.com/framework/docs/getting-started), version 4.

### Claude Code

Expand All @@ -22,7 +22,7 @@ Then install the plugin from it:
claude plugin install serverless@serverless
```

Claude Code doesn't update plugins from this marketplace on its own. To get each new version of the skill when it's released, turn on auto-update: run `/plugin` in Claude Code, open the **Marketplaces** tab, select **serverless**, and turn auto-update on. To update by hand:
Claude Code doesn't update plugins from this marketplace on its own. To get each new version of the skills when it's released, turn on auto-update: run `/plugin` in Claude Code, open the **Marketplaces** tab, select **serverless**, and turn auto-update on. To update by hand:

```bash
claude plugin update serverless@serverless
Expand Down Expand Up @@ -64,13 +64,13 @@ gemini extensions install https://github.com/serverless/agent-plugins

### Other agents

For any agent that reads [Agent Skills](https://agentskills.io), this command copies the skill into the user-level skill folders of the agents you choose:
For any agent that reads [Agent Skills](https://agentskills.io), this command copies the skills into the skill folders of the agents you choose, for the current project or for your user (`--global`):

```bash
npx skills add serverless/agent-plugins --global
npx skills add serverless/agent-plugins
```

## What the skill covers
## What the skills cover

The `serverless-framework` skill teaches an agent to:

Expand All @@ -81,23 +81,30 @@ The `serverless-framework` skill teaches an agent to:
- Split an application into services that share outputs, and build web apps and Python services.
- Read the documentation that ships with your CLI version (`serverless agent docs`) instead of answering from memory.

## Feature skills come from the CLI
Four more skills cover one feature each, and load when a task involves that feature:

The Framework has four more skills, one per feature: Dev Mode, MCP servers on AWS Lambda, sandboxes, and upgrading to version 4. They belong to a project, not to your user account, so the CLI installs them:
- `serverless-dev-mode`: run a deployed stage's functions and web apps locally against live AWS events with `serverless dev`.
- `serverless-mcp`: host MCP servers on AWS Lambda.
- `serverless-sandboxes`: run untrusted or AI-generated code in isolated compute on AWS.
- `serverless-upgrade`: upgrade services from Serverless Framework v1, v2 or v3 to v4.

## The skills in your projects

The Serverless Framework CLI also installs the skills, with the versions that match your CLI:

```bash
serverless agent setup
```

Run it in a service directory, or let your agent do it: the `serverless-framework` skill tells the agent to. It adds the feature skills to the project for you to commit, so teammates' agents get them too, and reports whether sign-in and AWS credentials are ready. The [Agent Skills guide](https://www.serverless.com/framework/docs/guides/agent-skills) has the details.
Run it in a service directory, or let your agent do it: the `serverless-framework` skill tells the agent to. It adds the feature skills to the project for you to commit, so teammates' agents get them too, and reports whether sign-in and AWS credentials are ready. Where a Claude Code plugin already provides a skill, it leaves that skill out of Claude Code's skills folders, so Claude Code lists it once. The [Agent Skills guide](https://www.serverless.com/framework/docs/guides/agent-skills#install-the-agent-plugin) has the details, including how other agents treat the two copies.

## Versions

The skill in this repository is copied, unchanged, from releases of the Serverless Framework. [`skills.source.json`](./skills.source.json) names the release it comes from, and [`CHANGELOG.md`](./CHANGELOG.md) lists each plugin version with the Framework release it matches. A new plugin version is published when a Framework release changes the skill.
The skills in this repository are copied, unchanged, from releases of the Serverless Framework. [`skills.source.json`](./skills.source.json) names the release it comes from, and [`CHANGELOG.md`](./CHANGELOG.md) lists each plugin version with the Framework release it matches. A new plugin version is published when a Framework release changes a skill.

## Contributing

The files under `skills/` are generated, so changes to the skill itself go to [`skills/serverless-framework`](https://github.com/serverless/serverless/tree/main/skills/serverless-framework) in the Serverless Framework repository. Changes to the manifests, scripts and docs of this repository are welcome here: see [CONTRIBUTING.md](./CONTRIBUTING.md).
The files under `skills/` are generated, so changes to the skills themselves go to [`skills/`](https://github.com/serverless/serverless/tree/main/skills) in the Serverless Framework repository. Changes to the manifests, scripts and docs of this repository are welcome here: see [CONTRIBUTING.md](./CONTRIBUTING.md).

To report a security issue, see [SECURITY.md](./SECURITY.md).

Expand Down
4 changes: 2 additions & 2 deletions gemini-extension.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "serverless",
"version": "0.0.1",
"description": "The Serverless Framework skill for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI."
"version": "1.0.0",
"description": "Serverless Framework skills for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI, with Dev Mode, MCP servers, sandboxes and upgrades to v4."
}
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "serverless",
"version": "0.0.1",
"description": "The Serverless Framework skill for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI.",
"version": "1.0.0",
"description": "Serverless Framework skills for AI coding agents: build, deploy and operate applications on AWS Lambda with serverless.yml and the serverless CLI, with Dev Mode, MCP servers, sandboxes and upgrades to v4.",
"author": {
"name": "Serverless, Inc.",
"url": "https://www.serverless.com"
Expand Down
13 changes: 10 additions & 3 deletions scripts/sync-skills.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node
// Copies the plugin's skills from a release of serverless/serverless.
// Copies the plugin's skills from a release of serverless/serverless: every
// skill the Framework CLI bundles.
//
// node scripts/sync-skills.mjs sync from the latest release
// node scripts/sync-skills.mjs --tag <tag> sync from that release tag
Expand All @@ -19,7 +20,13 @@ import { bump, readVersions, setVersion } from './lib/manifests.mjs'
import { diffFolders } from './lib/tree.mjs'

export const SOURCE_REPO = 'serverless/serverless'
export const SKILLS = ['serverless-framework']
export const SKILLS = [
'serverless-framework',
'serverless-dev-mode',
'serverless-mcp',
'serverless-sandboxes',
'serverless-upgrade',
]
const SOURCE_FILE = 'skills.source.json'
const TAG_PREFIX = 'sf-core@'

Expand Down Expand Up @@ -137,7 +144,7 @@ const addChangelogEntry = async (root, version, tag) => {
/* first entry */
}
const release = tag.startsWith(TAG_PREFIX) ? tag.slice(TAG_PREFIX.length) : tag
const entry = `## ${version}\n\nSkill from Serverless Framework ${release} (\`${tag}\`).\n`
const entry = `## ${version}\n\nSkills from Serverless Framework ${release} (\`${tag}\`).\n`
await writeFile(
changelogPath,
`${title}\n\n${entry}${rest ? `\n${rest}` : ''}`,
Expand Down
30 changes: 28 additions & 2 deletions scripts/test/helpers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,33 @@ metadata:
# Serverless Framework
`

/** A minimal SKILL.md for one of the feature skills the plugin carries. */
export const featureSkillMd = (name) => `---
name: ${name}
description: The ${name} skill, for tests.
metadata:
managed-by: serverless-framework
version: '1'
---

# ${name}
`

export const FEATURE_SKILLS = [
'serverless-dev-mode',
'serverless-mcp',
'serverless-sandboxes',
'serverless-upgrade',
]

/** Write every skill the plugin carries into `root`, as a release has them. */
export const writeSkills = async (root) => {
await write(root, 'skills/serverless-framework/SKILL.md', SKILL_MD)
await write(root, 'skills/serverless-framework/references/a.md', '# A\n')
for (const name of FEATURE_SKILLS)
await write(root, `skills/${name}/SKILL.md`, featureSkillMd(name))
}

const common = {
name: 'serverless',
version: '1.0.0',
Expand Down Expand Up @@ -102,8 +129,7 @@ export const makeRepo = async () => {
tag: 'sf-core@4.46.0',
commit: '0'.repeat(40),
})
await write(root, 'skills/serverless-framework/SKILL.md', SKILL_MD)
await write(root, 'skills/serverless-framework/references/a.md', '# A\n')
await writeSkills(root)
await write(root, 'assets/icon.png', 'png')
await write(root, 'README.md', README)
await write(root, 'LICENSE', 'MIT License\n')
Expand Down
26 changes: 18 additions & 8 deletions scripts/test/sync-skills.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ import {
pickLatestReleaseTag,
sync,
} from '../sync-skills.mjs'
import { SKILL_MD, git, makeRepo, readJson, write } from './helpers.mjs'
import {
FEATURE_SKILLS,
SKILL_MD,
git,
makeRepo,
readJson,
write,
writeSkills,
} from './helpers.mjs'

const TAG = 'sf-core@4.47.0'
const COMMIT = 'a'.repeat(40)
Expand All @@ -24,9 +32,8 @@ let root, sourceDir, source
beforeEach(async () => {
root = await makeRepo()
sourceDir = await mkdtemp(path.join(tmpdir(), 'source-'))
// The same skill the fixture repo holds.
await write(sourceDir, 'skills/serverless-framework/SKILL.md', SKILL_MD)
await write(sourceDir, 'skills/serverless-framework/references/a.md', '# A\n')
// The same skills the fixture repo holds.
await writeSkills(sourceDir)
source = { dir: sourceDir, tag: TAG, commit: COMMIT }
})
afterEach(async () => {
Expand All @@ -37,8 +44,8 @@ afterEach(async () => {
const repoState = async () =>
(await listFiles(root)).filter((file) => !file.path.startsWith('.git/'))

test('the plugin carries the serverless-framework skill from serverless/serverless', () => {
assert.deepEqual(SKILLS, ['serverless-framework'])
test('the plugin carries every skill the Framework CLI bundles, from serverless/serverless', () => {
assert.deepEqual(SKILLS, ['serverless-framework', ...FEATURE_SKILLS])
assert.equal(SOURCE_REPO, 'serverless/serverless')
})

Expand Down Expand Up @@ -79,7 +86,7 @@ test('a changed skill is copied, versioned and recorded', async () => {
const changelog = await readFile(path.join(root, 'CHANGELOG.md'), 'utf8')
assert.ok(
changelog.startsWith(
'# Changelog\n\n## 1.1.0\n\nSkill from Serverless Framework 4.47.0 (`sf-core@4.47.0`).\n\n## 1.0.0\n',
'# Changelog\n\n## 1.1.0\n\nSkills from Serverless Framework 4.47.0 (`sf-core@4.47.0`).\n\n## 1.0.0\n',
),
changelog,
)
Expand All @@ -91,7 +98,10 @@ test('a file removed upstream is removed here', async () => {
assert.deepEqual(result.files, ['skills/serverless-framework/references/a.md'])
assert.deepEqual(
(await listFiles(path.join(root, 'skills'))).map((file) => file.path),
['serverless-framework/SKILL.md'],
[
'serverless-framework/SKILL.md',
...FEATURE_SKILLS.map((name) => `${name}/SKILL.md`),
].sort(),
)
})

Expand Down
4 changes: 2 additions & 2 deletions skills.source.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"repository": "serverless/serverless",
"tag": "sf-core@4.46.0",
"commit": "128e6b4d4455243dc026d3567085323d8bb5dd80"
"tag": "sf-core@4.47.0",
"commit": "4800860fb33898ff6d2503865602270c6d5f7e18"
}
Loading