Skip to main content

Publishing Rules to the Hub

The SigmaShake Rules Hub is a public registry where anyone can publish .rules governance files. Once published, rules are discoverable by all users and installable with one command.

There are three ways to publish:

MethodBest forTime
ssg publishDevelopers with ssg installed<1 minute
MCP toolAI agents (Claude Code, Codex, etc.)Programmatic
Manual formOne-off submissions2–3 minutes

ssg publish

The fastest path. One command creates a GitHub repo, pushes your rules, and submits to the hub.

Prerequisites

  • ssg installed (npm install -g ssg or bun install -g ssg)
  • GitHub CLI authenticated (gh auth login)

Steps

# 1. Navigate to your project with .rules files
cd your-project

# 2. Publish — creates GitHub repo + pushes rules + opens hub
ssg publish

That's it. ssg publish will:

  1. Check gh auth and find your GitHub username
  2. Create github.com/<you>/rules-<project> (public repo)
  3. Push your .sigmashake/rules/*.rules files
  4. Open hub.sigmashake.com/submit pre-filled — click Submit

Flags

ssg publish --repo=my-typescript-rules   # custom repo name
ssg publish --desc="TypeScript safety rules" # custom description
ssg publish --no-browser # print URL, don't open browser
ssg publish --path=custom/rules/dir # non-default rules directory

Example output

Creating GitHub repo: https://github.com/alice/rules-typescript ...
✓ Created https://github.com/alice/rules-typescript
Pushing 3 .rules file(s) from '.sigmashake/rules' ...
✓ Pushed 3 rule file(s)

────────────────────────────────────────────────────────────
✓ Ready to publish to hub.sigmashake.com

Repo: https://github.com/alice/rules-typescript
Rules: 3 file(s) in .sigmashake/rules/
Hub: https://hub.sigmashake.com/submit?repo=...

Opening hub.sigmashake.com in your browser...
Sign in with GitHub and click Submit to publish.

Once submitted, your ruleset will be available to install:
ssg hub pull rules-typescript
────────────────────────────────────────────────────────────

MCP Tool

AI agents (Claude Code, GitHub Copilot, Codex, Gemini CLI) can publish rules directly using the sigmashake_hub_submit MCP tool — no browser required.

Setup

Add the MCP server to your AI client config:

{
"mcpServers": {
"sigmashake": {
"url": "https://mcp.sigmashake.com/sse"
}
}
}

Generate a GitHub token

Go to github.com/settings/tokens and create a fine-grained or classic token with public_repo scope (read access to public repos is sufficient).

Tool call

{
"name": "sigmashake_hub_submit",
"arguments": {
"repo_url": "https://github.com/alice/rules-typescript",
"path": ".sigmashake/rules",
"github_token": "ghp_xxxxxxxxxxxxxxxxxxxx"
}
}

Response:

{
"ok": true,
"ruleset_id": "a1b2c3d4-...",
"hub_url": "https://hub.sigmashake.com/ruleset/a1b2c3d4-...",
"rule_count": 13,
"technologies": ["ts"]
}

REST API (direct)

You can also call the hub API directly without MCP:

curl -X POST https://hub.sigmashake.com/api/submit \
-H "Authorization: Bearer ghp_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"repo": "https://github.com/alice/rules-typescript",
"path": ".sigmashake/rules"
}'

Error responses:

StatusMeaning
401Missing or invalid GitHub token
400Invalid repo URL or path
422No .rules files found at the specified path
200Success — ruleset_id in response

Manual Form

  1. Visit hub.sigmashake.com/submit
  2. Click Manual submit tab
  3. Sign in with GitHub
  4. Enter your repository URL and rules path
  5. Click Submit Ruleset

Creating rules for publication

If you haven't written rules yet:

ssg init                  # scaffold .sigmashake/rules/ for your AI client
ssg lint # validate syntax
ssg check . # scan your project for violations

Rules must follow the .rules DSL format. See Rule Syntax for the full reference.

File naming convention: {technology}_{capability}_{description}.rules

ts_write_safety.rules       # TypeScript write-safety rules
bash_exec_hygiene.rules # Bash execution hygiene
git_exec_destructive.rules # Git destructive-op guards

Minimum requirements for hub submission

  • At least one .rules file with valid syntax (ssg lint passes)
  • Rules in a public GitHub repository
  • Each rule has a descriptive MESSAGE field

After publishing

Once submitted, your ruleset is immediately live. Users can install it with:

ssg hub pull rules-typescript           # by repo name
ssg hub pull github.com/alice/rules-typescript # by full URL

The hub re-syncs rulesets from GitHub weekly. To force a re-sync, visit your ruleset page and click Re-sync.