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:
| Method | Best for | Time |
|---|---|---|
| ssg publish | Developers with ssg installed | <1 minute |
| MCP tool | AI agents (Claude Code, Codex, etc.) | Programmatic |
| Manual form | One-off submissions | 2–3 minutes |
ssg publish
The fastest path. One command creates a GitHub repo, pushes your rules, and submits to the hub.
Prerequisites
ssginstalled (npm install -g ssgorbun 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:
- Check
ghauth and find your GitHub username - Create
github.com/<you>/rules-<project>(public repo) - Push your
.sigmashake/rules/*.rulesfiles - Open
hub.sigmashake.com/submitpre-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:
| Status | Meaning |
|---|---|
| 401 | Missing or invalid GitHub token |
| 400 | Invalid repo URL or path |
| 422 | No .rules files found at the specified path |
| 200 | Success — ruleset_id in response |
Manual Form
- Visit hub.sigmashake.com/submit
- Click Manual submit tab
- Sign in with GitHub
- Enter your repository URL and rules path
- 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
.rulesfile with valid syntax (ssg lintpasses) - Rules in a public GitHub repository
- Each rule has a descriptive
MESSAGEfield
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.