Skip to content

Commit e5a4fb5

Browse files
committed
chore(sync): cascade schema split (kind → layout + native)
socket-repo-template's per-repo config schema was split: kind: 'X' → layout: 'Y' + native: 'Z' The single `kind` enum collapsed two unrelated dimensions; splitting makes both queryable. ultrathink is reclassified as native:none (its per-language ports live in lockstep.json lang-parity rows, not via release-checksums infra). Synced from socket-repo-template via: node scripts/sync-scaffolding.mts --target . --fix Files refreshed: - .config/socket-repo-template.json (kind → layout + native) - .config/socket-repo-template-schema.json (regenerated) - scripts/socket-repo-template-schema.mts (TypeBox source) - lockstep.schema.json (perfectionist pass: more descriptions, tighter regexes, FULL_SHA_PATTERN constant) - scripts/lockstep-schema.mts (TypeBox source for above) - .claude/skills/_shared/skill-authoring.md (updated reference table) DISABLE_PRECOMMIT_TEST=1 — sync operation, not feature work. Format auto-applied via `pnpm run fix` to satisfy per-repo oxfmt profile.
1 parent 7e561e7 commit e5a4fb5

6 files changed

Lines changed: 306 additions & 150 deletions

File tree

.claude/skills/_shared/skill-authoring.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,22 @@ The Anthropic docs codify several rules; honor them:
8787
- Prefer **gerund form** for the name (`processing-pdfs`, `scanning-quality`); noun-phrase (`pdf-processing`) and verb-imperative (`process-pdfs`) are acceptable alternatives, but pick one and be consistent across the fleet.
8888
- Use forward slashes in any path the skill references — never backslashes, even in docs that target Windows users.
8989

90+
## Fleet repo references
91+
92+
When scaffolding a new fleet repo, or when a sync question arises ("how does the fleet do X?"), mimic the reference that matches both axes (`layout` + `native`) in `.config/socket-repo-template.json`:
93+
94+
| layout × native | Best reference | Notes |
95+
|---|---|---|
96+
| `single-package` × `none` | **`socket-packageurl-js`** or **`socket-sdk-js`** | Clean `pnpm-workspace.yaml`, canonical `scripts/{check,fix,clean,cover,security,update,lockstep,build}.mts`, simple `lockstep.json` with empty `rows`. |
97+
| `monorepo` × `producer` | **`socket-btm`** | 10+ packages (`build-infra`, per-tool-builder workspaces), deep `pnpm --filter` patterns, full `packages: [packages/*, .claude/hooks/*]`, richer catalog, lockstep + submodules + native release matrix. The canonical "monorepo done right" reference. |
98+
| `monorepo` × `consumer` | **`socket-cli`** | 3-package layout (`build-infra`, `cli`, `package-builder`); consumes prebuilts from socket-btm. |
99+
| `monorepo` × `none` | `socket-registry` | Mono npm publish path, no native artifacts via the fleet's release-checksums infra. |
100+
| `monorepo` × `none` + lang-parity | `ultrathink` | Per-language ports tracked entirely in `lockstep.json` `lang-parity` rows, not via release-checksums. Each port has its own build matrix. |
101+
| Library with vendored upstreams | `socket-lib` | Shows `packages: [.claude/hooks/*, tools/*, vendor/*]`, vendored-as-workspace pattern. |
102+
| Skill marketplace / no real build graph | `skills` | Dep-free shims for `clean.mts` / `cover.mts` are acceptable; document the deviation in the script's header. |
103+
104+
**Don't cross axes when picking a reference.** A `single-package` × `none` repo (`socket-lib`) and a `monorepo` × `consumer` repo (`socket-cli`) ship very different `scripts/*.mts` shapes — `socket-cli`'s scripts assume `packages/` and `pnpm --filter`, which break in a single-package repo. Match both axes.
105+
90106
## References
91107

92108
Authoritative upstream docs — keep these as the source of truth, mirror their guidance here only when fleet specifics demand it:

.config/socket-repo-template-schema.json

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "https://github.com/SocketDev/socket-repo-template-schema.json",
44
"title": "socket-repo-template per-repo config",
5-
"description": "Per-repo socket-repo-template config. Canonical path: `.config/socket-repo-template.json` (legacy: `.socket-repo-template.json` at the repo root).",
5+
"description": "Per-repo socket-repo-template config. Two valid locations: `.config/socket-repo-template.json` (primary) or `.socket-repo-template.json` at the repo root (alternative). Both are first-class — pick the location that fits your repo's convention.",
66
"type": "object",
7-
"required": ["schemaVersion", "repoName", "kind"],
7+
"required": ["schemaVersion", "repoName", "layout", "native"],
88
"properties": {
99
"$schema": {
1010
"description": "JSON Schema reference for editor autocompletion. Conventionally `./socket-repo-template-schema.json` — both the config and its schema live side-by-side in `.config/`.",
@@ -17,18 +17,27 @@
1717
},
1818
"repoName": {
1919
"pattern": "^[a-z0-9][a-z0-9-]*$",
20-
"description": "Canonical repo basename (e.g. `socket-lib`, `ultrathink`). Used for kind-independent exemptions like the oxlint `socket-lib` carve-out.",
20+
"description": "Canonical repo basename (e.g. `socket-lib`, `ultrathink`). Used for layout / native-independent exemptions like the oxlint `socket-lib` carve-out.",
2121
"type": "string"
2222
},
23-
"kind": {
24-
"description": "Fleet repo category. Determines which opt-in files the repo must ship and which it must not. See README.md \"Fleet kinds\" for the table.",
23+
"layout": {
24+
"description": "Package layout. `single-package` = one `package.json` at root, no `packages/`. `monorepo` = pnpm workspaces under `packages/`.",
2525
"anyOf": [
2626
{
2727
"const": "single-package",
2828
"type": "string"
2929
},
3030
{
31-
"const": "mono-no-native",
31+
"const": "monorepo",
32+
"type": "string"
33+
}
34+
]
35+
},
36+
"native": {
37+
"description": "Native-binary supply-chain role. `none` = pure-npm publish path. `consumer` = pulls prebuilt binaries from a sibling producer. `producer` = ships native artifacts via GH releases. `both` = consumes one set, produces another. (Per-language ports live in `lockstep.json` `lang-parity` rows, not here.)",
38+
"anyOf": [
39+
{
40+
"const": "none",
3241
"type": "string"
3342
},
3443
{
@@ -42,10 +51,6 @@
4251
{
4352
"const": "both",
4453
"type": "string"
45-
},
46-
{
47-
"const": "lang-ports",
48-
"type": "string"
4954
}
5055
]
5156
},

.config/socket-repo-template.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"$schema": "./socket-repo-template-schema.json",
33
"schemaVersion": 1,
44
"repoName": "vscode-socket-security",
5-
"kind": "single-package",
5+
"layout": "single-package",
6+
"native": "none",
67
"hooks": {
78
"enablePrePush": true,
89
"enableCommitMsg": true,

0 commit comments

Comments
 (0)