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
27 changes: 27 additions & 0 deletions .cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "github-ninja",
"version": "0.5.0",
"description": "GitHub know-how for coding agents: the gh CLI and API, issues, commits, branches and rebases, CI failure diagnosis, GitHub Actions hardening, efficiency and runtime upgrades, repo security settings audits, npm trusted publishing, Dependabot, secret scanning, CodeQL and file attachments.",
"author": {
"name": "rjstone"
},
"homepage": "https://github.com/rjstone/github-ninja-plugin",
"repository": "https://github.com/rjstone/github-ninja-plugin",
"license": "MIT",
"keywords": [
"ci",
"codeql",
"commits",
"dependabot",
"gh",
"git",
"github",
"github-actions",
"issues",
"npm",
"secret-scanning",
"security"
],
"displayName": "GitHub Ninja",
"logo": "assets/icon.png"
}
5 changes: 3 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Runs this repo's checks (scripts/ci.sh: icon copy, skills/index.json up to date, skill version
# bumps, script tests, tool and action pins), Claude Code validation and, on main, the badges.
# Runs this repo's checks (scripts/ci.sh: generator tests, generated files up to date, types,
# skill version bumps, script tests, tool and action pins), Claude Code validation and, on main,
# the badges.
# The steps live in rjstone/plugin-ci (reusable workflow, called at @main).
name: check
on: [push, pull_request, workflow_dispatch] # workflow_dispatch: release.yml starts it after a manual release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
esac
- name: Regenerate skills/index.json
if: steps.sync.outputs.changed == 'true'
run: python3 scripts/build_skills_index.py
run: node scripts/build.ts
- name: Repo checks
if: steps.sync.outputs.changed == 'true'
env:
Expand Down
54 changes: 35 additions & 19 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,35 @@ only skills; commands, agents or hooks may follow.
`skills/<name>/SKILL.md` (no per-harness copies, no symlinks: Windows needs admin rights for
them). A format that needs files elsewhere points its manifest at `skills/` or has a script
generate the copy.
- **Every manifest is generated** from `plugin.config.json` by `node scripts/build.ts` (Node
22.18 or later; `--check` reports a stale or missing file). Never hand-edit a generated file:
change the config and rebuild. The generator comes from
[rjstone/harness-plugin-template](https://github.com/rjstone/harness-plugin-template):
`scripts/build.ts`, `generate.ts`, `types.ts`, `frontmatter.ts`, `tests/build.test.ts`,
`tsconfig.json` and `scripts/release.sh` are the template's files, so fix them there first,
then copy them here. Its `DESIGN.md` lists the files each harness looks for. Turn a harness on
in `harnesses` to add its manifest.
- Per-format files:
- Claude Code: `.claude-plugin/plugin.json` (the plugin) and `.claude-plugin/marketplace.json`
(a one-plugin local marketplace, source `./`). Skills are found in `skills/` by default.
(a one-plugin local marketplace, source `./`), both generated. Skills are found in `skills/`
by default.
- Cursor: `.cursor-plugin/plugin.json`, generated, with `displayName` (as Cursor's official
plugin-template sets it), `"logo": "assets/icon.png"` and no
component path fields (a path field would replace Cursor's default `skills/` discovery).
There is no `.cursor-plugin/marketplace.json`: this is a single-plugin repo.
- skills.sh (`npx skills add rjstone/github-ninja-plugin`): no manifest; it finds `skills/`.
`skills.sh.json` (hand-written) only groups the skills on the repo's skills.sh page. Add a
new skill to a group there; skills.sh re-reads the file when someone installs from the repo
with the `skills` CLI, telemetry on.
- opencode HTTP catalog: `skills/index.json`, **generated** by
`python3 scripts/build_skills_index.py` (never hand-edit; `--check` reports it stale).
- opencode HTTP catalog: `skills/index.json`, generated (it lists each skill's files and
`metadata.version`).
- Code that only one harness can run (an opencode plugin package, a Codex manifest if Codex
stops reading the Claude one) goes in a top-level folder named after that harness
(`opencode/`, `codex/`).
- The plugin icon is `assets/icon.png` (square PNG, 512-2048 px, under 2 MB; no SVG or WebP),
the one to edit. An identical copy sits at `.claude-plugin/icon.png`, where Claude Code finds
it; CI fails if the copy differs. `.claude-plugin/plugin.json` has no `"icon"` key: the
claude.ai marketplace sync (Agent SDK) warns about it as an unknown key (2026-11-28).
the one to edit. The generator copies it to `.claude-plugin/icon.png` and points Cursor's
`logo` at it. `.claude-plugin/plugin.json` has no `"icon"` key: the claude.ai marketplace sync
(Agent SDK) warns about it as an unknown key (2026-11-28).
- Keep `README.md`'s skill table and install section in sync with `skills/` and the formats.

## Skills
Expand Down Expand Up @@ -77,7 +90,7 @@ only skills; commands, agents or hooks may follow.
branch unless you mean to take it over.
- **Every change to a skill bumps its `metadata.version`** (CI fails otherwise:
`scripts/check_skill_versions.py`): major for breaking or rewritten guidance, minor for new
material, patch for fixes and upstream wording updates. Then regenerate `skills/index.json`.
material, patch for fixes and upstream wording updates. Then rebuild (`node scripts/build.ts`) to refresh `skills/index.json`.
- Prefer stdlib-only Python for any script a skill ships, so it runs without an install step.

## Privacy and safety
Expand All @@ -90,24 +103,25 @@ private repositories or machines.
- **Conventional commits**: `feat:`, `fix:`, `docs:`, `refactor:`, `perf:`, `test:`,
`chore:`/`ci:`/`build:`, optional scope (`feat(skills): ...`), `!` or a `BREAKING CHANGE:`
footer for breaking changes. git-cliff groups the changelog by these (`cliff.toml`).
- The plugin version (`.claude-plugin/plugin.json` `version`) is the bundle's release version;
- The plugin version (`version` in `plugin.config.json`, written into every manifest) is the
bundle's release version;
each skill also has its own `metadata.version`. Adding or removing a skill is at least a minor
plugin bump.
- **`CHANGELOG.md` is generated**: never edit it by hand
(`npx git-cliff@2.14.2 -o CHANGELOG.md`).
`cliff.toml` skips merge commits. A pull request that was squash-merged under GitHub's default
"Merge pull request #N" title is then skipped too: give it its real conventional title with a
`commit_preprocessors` line in `cliff.toml` (see the one for #10), or squash with a
conventional title in the first place.
"Merge pull request #N" title is then skipped too: give it its real conventional title in
`changelog.commitPreprocessors` in `plugin.config.json` (see the one for #10; the generator
writes it into `cliff.toml`), or squash with a conventional title in the first place.
- Commit straight to `main` unless a change is large enough to want review on a branch.

Releasing `vX.Y.Z`, either way:

- **From a clone** (people and agents; no tag to push):
1. `bash scripts/release.sh X.Y.Z`: sets `version` in `.claude-plugin/plugin.json` and
regenerates `CHANGELOG.md`.
2. Commit both as `chore(release): vX.Y.Z` and push `main`, with that commit as the newest one
of the push.
1. `bash scripts/release.sh X.Y.Z`: sets `version` in `plugin.config.json`, rebuilds the
generated files and regenerates `CHANGELOG.md`.
2. Commit everything as `chore(release): vX.Y.Z` and push `main`, with that commit as the
newest one of the push.
- **From GitHub**: Actions > release > Run workflow, with `bump` (patch, minor or major) or an
exact `version`. The workflow runs `scripts/release.sh` and pushes the release commit itself.

Expand All @@ -133,14 +147,16 @@ contract). On every push and pull request it runs `bash scripts/ci.sh`, then
`fetch-depth: 0` because the skill version check needs history. `release.yml` and
`notify-marketplace.yml` are thin callers too.

`scripts/ci.sh` holds this repo's own checks, in this order: the icon copy matches,
`skills/index.json` is up to date, changed skills bumped `metadata.version` (against
`CI_BASE_SHA`; no base means nothing to compare), the `tests/` unit tests, and `pins.py --check`.
`scripts/ci.sh` holds this repo's own checks, in this order: the generator's tests
(`npm test`), every generated file up to date (`node scripts/build.ts --check`: manifests, the
icon copy, `skills/index.json`, `cliff.toml`, `package.json`), `npm run typecheck`, changed
skills bumped `metadata.version` (against `CI_BASE_SHA`; no base means nothing to compare), the
`tests/` Python unit tests, and `pins.py --check`.
When `CI_BADGES` is set it appends the `skills` badge line. It works with no environment set and
never runs `claude plugin validate`.

`upstream-sync.yml` runs the same checks before it pushes its branch: it regenerates
`skills/index.json`, runs `bash scripts/ci.sh` and then the shared `validate` action
`skills/index.json` (`node scripts/build.ts`), runs `bash scripts/ci.sh` and then the shared `validate` action
(PRs pushed with `GITHUB_TOKEN` don't start `check.yml`; an optional GitHub App token does:
variable `SYNC_APP_CLIENT_ID`, secret `SYNC_APP_PRIVATE_KEY`). With `GITHUB_TOKEN`, the repo
setting "Allow GitHub Actions to create and approve pull requests" must be on.
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ uninstall the extension, if you don't want that.
Or straight from this repository: `/plugin marketplace add rjstone/github-ninja-plugin`, then
`/plugin install github-ninja@github-ninja`.

**Cursor**

For a local install, clone this repository into `~/.cursor/plugins/local/github-ninja` and
reload the window. Cursor loads `.cursor-plugin/plugin.json` and finds the skills in `skills/`
by default. To submit the plugin for review, use the
[Cursor Marketplace publish form](https://cursor.com/marketplace/publish); it is not listed on
the marketplace yet.

**skills.sh** (Claude Code, Codex, Cursor, opencode and other agents)

```
Expand Down
3 changes: 1 addition & 2 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated from plugin.config.json by scripts/build.ts; don't edit by hand. Change the config and rebuild.
# git-cliff config: https://git-cliff.org/docs/configuration
# Generate: npx git-cliff@2.14.2 -o CHANGELOG.md (all releases + unreleased)
# Release: npx git-cliff@2.14.2 --tag vX.Y.Z -o CHANGELOG.md (before tagging vX.Y.Z)
Expand Down Expand Up @@ -35,8 +36,6 @@ conventional_commits = true
filter_unconventional = false
split_commits = false
protect_breaking_commits = true
# A squash merge that kept GitHub's "Merge pull request" title has no conventional type. Give
# such a commit its real title here, above the rule that skips merge commits.
commit_preprocessors = [
{ pattern = "^Merge pull request #10 from rjstone/feature/workflows-actions-reuse", replace = "feat(skills): add workflows-actions-reuse (#10)" },
]
Expand Down
36 changes: 36 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "github-ninja",
"version": "0.5.0",
"description": "GitHub know-how for coding agents: the gh CLI and API, issues, commits, branches and rebases, CI failure diagnosis, GitHub Actions hardening, efficiency and runtime upgrades, repo security settings audits, npm trusted publishing, Dependabot, secret scanning, CodeQL and file attachments.",
"license": "MIT",
"author": "rjstone",
"homepage": "https://github.com/rjstone/github-ninja-plugin",
"repository": {
"type": "git",
"url": "git+https://github.com/rjstone/github-ninja-plugin.git"
},
"type": "module",
"keywords": [
"ci",
"codeql",
"commits",
"dependabot",
"gh",
"git",
"github",
"github-actions",
"issues",
"npm",
"secret-scanning",
"security"
],
"engines": {
"node": ">=22.18"
},
"scripts": {
"build": "node scripts/build.ts",
"check": "node scripts/build.ts --check",
"test": "node --test tests/*.test.ts",
"typecheck": "npm install --no-save --no-package-lock --silent typescript@5.9 @types/node@22 && tsc -p ."
}
}
53 changes: 53 additions & 0 deletions plugin.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "github-ninja",
"displayName": "GitHub Ninja",
"version": "0.5.0",
"description": "GitHub know-how for coding agents: the gh CLI and API, issues, commits, branches and rebases, CI failure diagnosis, GitHub Actions hardening, efficiency and runtime upgrades, repo security settings audits, npm trusted publishing, Dependabot, secret scanning, CodeQL and file attachments.",
"shortDescription": "GitHub know-how for agents",
"author": {
"name": "rjstone"
},
"homepage": "https://github.com/rjstone/github-ninja-plugin",
"repository": "https://github.com/rjstone/github-ninja-plugin",
"license": "MIT",
"keywords": [
"ci",
"codeql",
"commits",
"dependabot",
"gh",
"git",
"github",
"github-actions",
"issues",
"npm",
"secret-scanning",
"security"
],
"icon": "assets/icon.png",
"category": "Developer Tools",
"harnesses": {
"agentPlugins": false,
"claude": true,
"cursor": true,
"antigravity": false,
"gemini": false,
"copilotExtras": false,
"opencodeCatalog": true,
"opencode": false,
"pi": false,
"kimi": false,
"muse": false
},
"claudeMarketplace": {
"description": "Single-plugin marketplace for github-ninja. The plugin is the repository root; its skills live in skills/."
},
"changelog": {
"commitPreprocessors": [
{
"pattern": "^Merge pull request #10 from rjstone/feature/workflows-actions-reuse",
"replace": "feat(skills): add workflows-actions-reuse (#10)"
}
]
}
}
43 changes: 43 additions & 0 deletions scripts/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Writes (or, with --check, verifies) every generated file. See AGENTS.md, "Generator".
// node scripts/build.ts [--check] [--root <dir>]
// Exit codes: 0 ok, 1 stale files (--check) or content errors, 2 bad arguments.

import { resolve } from 'node:path';
import { diff, plan, write } from './generate.ts';

const args = process.argv.slice(2);
let check = false;
let root = resolve(import.meta.dirname, '..');
for (let i = 0; i < args.length; i++) {
if (args[i] === '--check') check = true;
else if (args[i] === '--root' && args[i + 1]) root = resolve(args[++i]);
else {
console.error(`unknown argument: ${args[i]}\nusage: node scripts/build.ts [--check] [--root <dir>]`);
process.exit(2);
}
}

const p = plan(root);
for (const w of p.warnings) console.warn(`warning: ${w}`);
if (p.errors.length) {
for (const e of p.errors) console.error(`error: ${e}`);
process.exit(1);
}

if (check) {
const d = diff(root, p);
const lines = [
...d.missing.map((x) => `missing: ${x}`),
...d.stale.map((x) => `stale: ${x}`),
...d.leftover.map((x) => `leftover: ${x} (its harness is off or its input is gone)`),
];
if (lines.length) {
console.error(`${lines.join('\n')}\nRun: node scripts/build.ts`);
process.exit(1);
}
console.log(`ok: ${p.files.size} generated files are up to date`);
} else {
const d = write(root, p);
const n = d.missing.length + d.stale.length;
console.log(`wrote ${n} file(s), removed ${d.leftover.length}; ${p.files.size} generated files in total`);
}
Loading