Skip to content

Commit 6bb6352

Browse files
committed
feat: seed community mods registry (mods.json + schema + guide)
1 parent 5c8f1b4 commit 6bb6352

3 files changed

Lines changed: 161 additions & 0 deletions

File tree

‎MODS.md‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Command Code mods registry
2+
3+
This repo's [`mods.json`](./mods.json) is the community registry behind the
4+
[mods hub](https://commandcode.ai/mods). The hub reads this file live, so a merged
5+
PR here lists your mod within minutes — no website deploy.
6+
7+
Two ways a mod gets listed:
8+
9+
1. **Publish to npm with the `cmd-mod` keyword** — it is discovered automatically, no PR needed.
10+
2. **Open a PR against `mods.json`** — for git-only mods, or to add richer metadata. This is that path.
11+
12+
## Add your mod
13+
14+
Append one entry to the `mods` array in [`mods.json`](./mods.json). Editors validate it
15+
against [`mods.schema.json`](./mods.schema.json).
16+
17+
```json
18+
{
19+
"name": "cmd-mod-standup",
20+
"source": "owner/cmd-mod-standup",
21+
"description": "Adds a /standup command that summarizes what changed in git today.",
22+
"author": { "name": "Jane Dev", "github": "janedev" },
23+
"repo": "https://github.com/owner/cmd-mod-standup",
24+
"npm": "cmd-mod-standup",
25+
"kinds": ["command"],
26+
"tags": ["git", "productivity"]
27+
}
28+
```
29+
30+
### Fields
31+
32+
| Field | Required | Notes |
33+
|-------|:---:|-------|
34+
| `name` | yes | unique, lowercase `[a-z0-9._-]` — the hub's identity for the row |
35+
| `source` | yes | what `cmd mods add <source> -g` installs: an npm name, `owner/repo`, or a `git:` URL |
36+
| `description` | yes | 1–240 chars; the card summary |
37+
| `author` | yes | `{ "name": "…" }` required; optional `github` / `url` link the name |
38+
| `kinds` | yes | one or more of `tool` `command` `hook` `provider` `renderer` `flag` |
39+
| `repo` | no | a GitHub URL also enables the star count |
40+
| `npm` | no | links the entry to its npm package for live download counts |
41+
| `tags` | no | lowercase slugs, searchable |
42+
| `addedAt` | no | `YYYY-MM-DD`, used for the "Newest" sort |
43+
44+
`official` and the top-level `hidden` list are maintainer-only — leave them out of your PR.
45+
46+
Keep the array valid JSON (no trailing commas) and one mod per PR where you can, so review stays quick.

‎mods.json‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "./mods.schema.json",
3+
"version": 1,
4+
"hidden": [],
5+
"mods": [
6+
{
7+
"name": "cmd-mod-hi",
8+
"source": "cmd-mod-hi",
9+
"description": "Roasts you every time you greet your agent with \"hi\". One transformInput hook plus a renderer, and a /hi-stats command that tallies the damage.",
10+
"author": { "name": "Ahmad Awais", "github": "ahmadawais" },
11+
"repo": "https://github.com/ahmadawais/cmd-mod-hi",
12+
"npm": "cmd-mod-hi",
13+
"kinds": ["hook", "command", "renderer"],
14+
"tags": ["fun", "example"],
15+
"official": true,
16+
"addedAt": "2026-07-22"
17+
}
18+
]
19+
}

‎mods.schema.json‎

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Command Code mods registry",
4+
"description": "The curated layer behind commandcode.ai/mods. Packages published to npm with the `cmd-mod` keyword are listed automatically; this file adds git-only mods, richer metadata over npm entries (matched by `npm`), and the `hidden` list for moderation. The resolved list is served at https://commandcode.ai/mods.json.",
5+
"type": "object",
6+
"required": ["version", "mods"],
7+
"properties": {
8+
"$schema": { "type": "string" },
9+
"version": { "type": "integer", "const": 1 },
10+
"hidden": {
11+
"type": "array",
12+
"uniqueItems": true,
13+
"items": { "type": "string" },
14+
"description": "Mod names (or npm package names) to keep off the hub — spam, malware, impersonation."
15+
},
16+
"mods": {
17+
"type": "array",
18+
"items": {
19+
"type": "object",
20+
"required": [
21+
"name",
22+
"source",
23+
"description",
24+
"author",
25+
"kinds"
26+
],
27+
"additionalProperties": false,
28+
"properties": {
29+
"name": {
30+
"type": "string",
31+
"description": "Display name, and the name `cmd mods list` prints.",
32+
"pattern": "^[a-z0-9][a-z0-9._-]*$"
33+
},
34+
"source": {
35+
"type": "string",
36+
"description": "What `cmd mods add <source>` takes: an npm name (`cmd-mod-hi`, `@team/mod`), or GitHub shorthand (`owner/repo`)."
37+
},
38+
"description": { "type": "string", "maxLength": 240 },
39+
"author": {
40+
"type": "object",
41+
"required": ["name"],
42+
"additionalProperties": false,
43+
"properties": {
44+
"name": { "type": "string" },
45+
"github": {
46+
"type": "string",
47+
"description": "GitHub login."
48+
},
49+
"url": { "type": "string", "format": "uri" }
50+
}
51+
},
52+
"repo": {
53+
"type": "string",
54+
"format": "uri",
55+
"description": "Public git repository URL. GitHub repos get a live star count."
56+
},
57+
"npm": {
58+
"type": "string",
59+
"description": "npm package name when published to npm. Drives the monthly download count."
60+
},
61+
"kinds": {
62+
"type": "array",
63+
"minItems": 1,
64+
"uniqueItems": true,
65+
"items": {
66+
"type": "string",
67+
"enum": [
68+
"tool",
69+
"command",
70+
"hook",
71+
"provider",
72+
"renderer",
73+
"flag"
74+
]
75+
},
76+
"description": "What the mod registers on the ModApi."
77+
},
78+
"tags": {
79+
"type": "array",
80+
"uniqueItems": true,
81+
"items": { "type": "string", "pattern": "^[a-z0-9-]+$" }
82+
},
83+
"official": {
84+
"type": "boolean",
85+
"description": "Maintained by the Command Code team."
86+
},
87+
"addedAt": {
88+
"type": "string",
89+
"format": "date",
90+
"description": "ISO date the mod was listed."
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}

0 commit comments

Comments
 (0)