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
4 changes: 3 additions & 1 deletion scaffold/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def _render_repo(output_dir: Path, ctx: dict, *, verbose: bool) -> None:
# repos do NOT get cursor-plugin-specific validate.yml / release.yml.
if repo_type == "mcp-server":
write_file(output_dir, ".github/workflows/publish.yml", render_template(env, "publish.yml.j2", ctx), verbose=verbose)
write_file(output_dir, ".github/workflows/ci.yml", render_template(env, "ci.yml.j2", ctx), verbose=verbose)
write_file(output_dir, ".github/workflows/release.yml", render_template(env, "release.mcp.yml.j2", ctx), verbose=verbose)
write_file(output_dir, ".github/workflows/pages.yml", render_template(env, "pages.mcp.yml.j2", ctx), verbose=verbose)
else:
write_file(output_dir, ".github/workflows/validate.yml", render_template(env, "validate.yml.j2", ctx), verbose=verbose)
Expand Down Expand Up @@ -297,7 +299,7 @@ def build_registry_entry(
"extras": {},
"topics": [repo_type, "developer-tools"],
"status": "active",
"language": "Python",
"language": "TypeScript" if repo_type == "mcp-server" else "Python",
"license": SPDX[license_key],
"pagesType": "static",
"hasCI": True,
Expand Down
66 changes: 56 additions & 10 deletions scaffold/templates/AGENTS.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ This is a Cursor IDE plugin for {{ name | replace(' Developer Tools', '') | repl
This is an MCP server. It contains:

- **`src/`** -- TypeScript source code
- **`src/providers/`** -- provider adapters implementing the `Provider` interface, wired into `ProviderManager`
- **`src/tools/`** -- the registered MCP tools (stdio transport only)
- **`package.json`** -- npm package manifest (version source of truth)
- **`mcp-tools.json`** -- enumerates the MCP tools this server exposes
- **`docs/`** -- documentation and GitHub Pages site
- **`CHANGELOG.md`** -- release history
{% endif %}

## Branching and commit model
Expand All @@ -35,10 +40,10 @@ This is an MCP server. It contains:

## CI/CD workflows

{% if type == 'cursor-plugin' %}
### `validate.yml` (runs on PR and push to main)

Checks:
{% if type == 'cursor-plugin' %}
- JSON validity for plugin.json{% if has_mcp %}, mcp.json{% endif %}

- Plugin manifest required fields, kebab-case name, skill/rule file existence
Expand All @@ -47,20 +52,11 @@ Checks:
{% if has_mcp %}
- Python syntax for MCP server modules
{% endif %}
{% else %}
- TypeScript compilation
- Lint checks
- Test suite
{% endif %}

### `release.yml` (runs on push to main, ignores docs/md changes)

Automatic flow:
{% if type == 'cursor-plugin' %}
1. Reads current version from `plugin.json`
{% else %}
1. Reads current version from `package.json`
{% endif %}
2. Determines bump type from conventional commit messages since last tag
3. Computes new semver version
4. Updates version files and README badge
Expand All @@ -73,6 +69,37 @@ Builds and deploys the documentation site on push to main.
### `stale.yml`

Marks issues/PRs as stale after 30 days of inactivity.
{% else %}
### `ci.yml` (runs on PR and push to main)

Builds and runs the test suite on Node 20 and 22:
- TypeScript build (`npm run build`)
- Test suite (`npm test`, vitest, offline)

### `release.yml` (runs on push to main)

Conventional-commit auto-bump: determines the bump type from commit messages since the last tag, updates `package.json`, creates a git tag and GitHub Release.

### `publish.yml` (runs on release published or workflow_dispatch)

Publishes the package to npm.

### `drift-check.yml`

Checks this repo against the ecosystem standards for drift.

### `pages.yml` (deploys docs/ to GitHub Pages)

Builds and deploys the documentation site on push to main.

### `stale.yml`

Marks issues/PRs as stale after 30 days of inactivity.

### `label-sync.yml`

Keeps repository labels in sync.
{% endif %}

## Version management

Expand All @@ -86,9 +113,15 @@ Marks issues/PRs as stale after 30 days of inactivity.

## Code conventions

{% if type == 'cursor-plugin' %}
- No hardcoded credentials -- CI scans for password/token/api_key patterns.
- Skills must have YAML frontmatter starting with `---`.
- Rules use `.mdc` extension with frontmatter.
{% else %}
- No hardcoded credentials -- CI scans for password/token/api_key patterns.
- Conventional commits; never hand-edit the version.
- Keep `mcp-tools.json` in sync with the tools registered in `src/tools/`.
{% endif %}

## Adding content

Expand All @@ -105,6 +138,19 @@ Marks issues/PRs as stale after 30 days of inactivity.
1. Create `rules/<name>.mdc` with frontmatter (`description`, `globs`, `alwaysApply`)
2. Add the path to `plugin.json` under `"rules"`
3. Use `feat:` commit prefix
{% else %}
### New provider adapter

1. Implement the `Provider` interface in `src/providers/`
2. Register the adapter in `ProviderManager`
3. Use `feat:` commit prefix

### New tool

1. Register the tool in `src/tools/`
2. Add it to `mcp-tools.json`
3. Add vitest tests
4. Use `feat:` commit prefix
{% endif %}

## License
Expand Down
4 changes: 4 additions & 0 deletions scaffold/templates/CHANGELOG.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- MCP server scaffold
{% endif %}
{% endif %}
{% if type == 'cursor-plugin' %}
- CI/CD workflows (validate, release, pages, stale)
{% else %}
- CI/CD workflows (ci, release, publish, drift-check, pages, stale, label-sync)
{% endif %}
- GitHub Pages documentation site
24 changes: 21 additions & 3 deletions scaffold/templates/CLAUDE.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,32 @@ This file provides guidance for Claude Code when working in this repository.
- MCP tools: `mcp-server/tools/`
{% endif %}
{% else %}
- Source: `src/`
- Package manifest: `package.json`
- Source: `src/` (TypeScript)
- Provider adapters: `src/providers/` (implement the `Provider` interface, wired into `ProviderManager`)
- Tools: `src/tools/`
- Package manifest: `package.json` (version source of truth)
- Tool list: `mcp-tools.json` (enumerates the MCP tools)
{% endif %}
- Docs site: `docs/`
- CI workflows: `.github/workflows/`

## Conventions

{% if type == 'cursor-plugin' %}
- Use conventional commits (`feat:`, `fix:`, `chore:`, `docs:`)
- Never manually edit the version in {% if type == 'cursor-plugin' %}plugin.json{% else %}package.json{% endif %} -- CI handles it
- Never manually edit the version in plugin.json -- CI handles it
- All skills need YAML frontmatter with title, description, globs
- All rules need frontmatter with description, globs, alwaysApply
{% else %}
- Use conventional commits (`feat:`, `fix:`, `chore:`, `docs:`)
- Never manually edit the version in `package.json` -- CI auto-bumps it
- Provider adapters live in `src/providers/` and implement the `Provider` interface, wired into `ProviderManager`; tools live in `src/tools/`
- Keep `mcp-tools.json` in sync with the registered tools
{% endif %}

## Testing

{% if type == 'cursor-plugin' %}
{% if has_mcp %}
```bash
cd mcp-server && pip install -r requirements.txt
Expand All @@ -49,3 +60,10 @@ python3 -m py_compile server.py
python3 -c "import json; json.load(open('.cursor-plugin/plugin.json'))"
```
{% endif %}
{% else %}
```bash
npm run build
npm test
npm run typecheck
```
{% endif %}
29 changes: 28 additions & 1 deletion scaffold/templates/CONTRIBUTING.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Thank you for your interest in contributing.

Use [Conventional Commits](https://www.conventionalcommits.org/):

{% if type == 'cursor-plugin' %}
- `feat:` -- new feature, skill, rule, or MCP tool
- `fix:` -- bug fix
- `docs:` -- documentation changes
Expand All @@ -38,6 +39,32 @@ Use [Conventional Commits](https://www.conventionalcommits.org/):
1. Ensure CI passes (the `validate.yml` workflow checks structure and quality)
2. Update `CHANGELOG.md` if the change is user-facing
3. Use a descriptive PR title following conventional commit format
{% else %}
- `feat:` -- new feature, provider adapter, or tool
- `fix:` -- bug fix
- `docs:` -- documentation changes
- `chore:` -- maintenance, dependency updates
- `refactor:` -- code restructuring

### Provider adapters

- Implement the `Provider` interface in `src/providers/`
- Register the adapter in `ProviderManager`

### Tools

- Register the tool in `src/tools/`
- Add it to `mcp-tools.json`
- Add vitest tests

Never hand-edit the version; CI auto-bumps `package.json`.

## Pull Request Process

1. Ensure CI passes (`npm run build`, `npm test`, `npm run typecheck`)
2. Update `CHANGELOG.md` if the change is user-facing
3. Use a descriptive PR title following conventional commit format
{% endif %}

## Inbound license grant and DCO

Expand All @@ -52,7 +79,7 @@ By submitting a contribution to this repository, you certify that you have the r
Every commit in a pull request must carry a `Signed-off-by:` trailer matching the commit author. Sign at commit time with the `-s` flag:

```bash
git commit -s -m "feat: add new skill"
{% if type == 'cursor-plugin' %}git commit -s -m "feat: add new skill"{% else %}git commit -s -m "feat: add new tool"{% endif %}
```

This appends a line like `Signed-off-by: Jane Developer <jane@example.com>` to the commit message. The GitHub DCO App enforces this on every PR.
Expand Down
22 changes: 22 additions & 0 deletions scaffold/templates/ROADMAP.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## {{ name }}

{% if type == 'cursor-plugin' %}
### v0.1.x -- Foundation

- [ ] Initial skills and rules
Expand All @@ -30,3 +31,24 @@
- [ ] Full test coverage
- [ ] Marketplace listing
- [ ] Complete documentation
{% else %}
### v0.1.x -- Foundation

- [x] Core provider adapters
- [x] Initial tool surface
- [x] stdio transport
- [ ] CI/CD workflows
- [ ] GitHub Pages documentation site

### v0.2.0 -- Expansion

- [ ] Additional provider adapters
- [ ] Richer tooling
- [ ] Streaming support

### v1.0.0 -- Stable Release

- [ ] Broader provider coverage
- [ ] Full test coverage
- [ ] Complete documentation
{% endif %}
28 changes: 28 additions & 0 deletions scaffold/templates/ci.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% raw %}name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run build
- run: npm test
{% endraw %}
7 changes: 7 additions & 0 deletions scaffold/templates/cursorrules.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ This is a {{ type }} repository for {{ name | replace(' Developer Tools', '') |

## Conventions

{% if type == 'cursor-plugin' %}
- Use conventional commits (feat:, fix:, chore:, docs:)
- Never manually edit the version -- CI handles it
- Skills need YAML frontmatter: title, description, globs
- Rules need frontmatter: description, globs, alwaysApply
{% else %}
- Use conventional commits (feat:, fix:, chore:, docs:)
- Never manually edit the version -- CI auto-bumps package.json
- Keep mcp-tools.json in sync with the registered tools
- Provider adapters live in src/providers/; tools live in src/tools/
{% endif %}
10 changes: 10 additions & 0 deletions scaffold/templates/gitignore.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if type == 'cursor-plugin' %}
__pycache__/
*.pyc
*.pyo
Expand All @@ -11,3 +12,12 @@ build/
Thumbs.db
node_modules/
*.log
{% else %}
node_modules/
dist/
build/
.env
.DS_Store
Thumbs.db
*.log
{% endif %}
24 changes: 20 additions & 4 deletions scaffold/templates/publish.yml.j2
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Publish to npm
{% raw %}name: Publish to npm

on:
release:
types: [published]
workflow_dispatch: {}

permissions:
contents: read
Expand All @@ -22,8 +23,23 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm test
{% raw %}
- run: npm publish --provenance --access public

- name: Check if this version is already published
id: pub
run: |
set -euo pipefail
name=$(node -p "require('./package.json').name")
ver=$(node -p "require('./package.json').version")
if npm view "$name@$ver" version >/dev/null 2>&1; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "$name@$ver is already on npm; skipping publish (idempotent re-dispatch)."
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi

- name: Publish to npm
if: steps.pub.outputs.skip == 'false'
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
{% endraw %}
{% endraw %}
Loading