Skip to content

Commit ac8c336

Browse files
authored
chore(repo): restore registry drift check and refresh AGENTS docs (#328)
* chore(repo): restore registry drift checks and refresh AGENTS docs Split registry validation from generated-output drift detection so CI still catches stale registry artifacts. Refresh the root and docs AGENTS snapshots to match the released v2.7.0 repo state and pin the workflow contract in unit tests. * test(ci): rename workflow contract assertion
1 parent 2e9453a commit ac8c336

5 files changed

Lines changed: 38 additions & 19 deletions

File tree

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
run: bun scripts/content-integrity.ts
6565

6666
- name: Registry drift check
67-
run: bun scripts/generate-registry.ts --check
67+
run: bun run registry:drift
6868

6969
typecheck:
7070
name: Typecheck

AGENTS.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AGENTS.md - Coding Agent Guidelines for Systematic
22

3-
**Generated:** 2026-04-25 | **Commit:** 7a64113 | **Branch:** main
3+
**Generated:** 2026-05-01 | **Commit:** 2e9453a | **Branch:** main
44

55
## Overview
66

@@ -17,14 +17,15 @@ bun install # Install deps
1717
bun run build # Build to dist/
1818
bun run typecheck # Type check (strict)
1919
bun run lint # Biome linter
20-
bun test tests/unit # Unit tests (14 files)
20+
bun test tests/unit # Unit tests (15 files)
2121
bun test tests/integration # Integration tests (2 files)
2222
bun test # All tests
2323
bun test --filter "pattern" # Filter tests
2424
bun run docs:dev # Local docs site
2525
bun run docs:build # Build docs (generates reference + builds Starlight)
2626
bun run docs:generate # Sync reference content from bundled assets
2727
bun run registry:build # Build OCX registry
28+
bun run registry:drift # Check registry source drift vs generated assets
2829
bun run registry:validate # Validate registry without building
2930
```
3031

@@ -43,20 +44,19 @@ bun run registry:validate # Validate registry without building
4344
```
4445
systematic/
4546
├── src/
46-
│ ├── index.ts # Plugin entry (SystematicPlugin)
47+
│ ├── index.ts # Plugin entry (default export)
4748
│ ├── cli.ts # CLI entry (list/convert/config commands)
4849
│ └── lib/ # 12 core modules (see src/lib/AGENTS.md)
4950
├── skills/ # 46 bundled skills (SKILL.md format)
5051
├── agents/ # 50 bundled agents (6 categories: design/docs/document-review/research/review/workflow)
51-
├── commands/ # Empty (.gitkeep) — commands converted to skills; dir kept for backward compat
5252
├── docs/ # Starlight docs workspace (see docs/AGENTS.md)
5353
│ ├── scripts/ # Content generation from bundled assets
5454
│ └── src/content/ # Manual guides + generated reference
5555
├── registry/ # OCX registry config + profiles (omo, standalone)
5656
├── scripts/ # Build + integrity scripts
5757
├── assets/ # Static assets (banner SVG)
5858
├── tests/
59-
│ ├── unit/ # 14 test files
59+
│ ├── unit/ # 15 test files
6060
│ └── integration/ # 2 test files
6161
├── .opencode/ # Project-specific OC config + commands
6262
│ └── commands/ # Project-only commands (generate-readme)
@@ -67,7 +67,7 @@ systematic/
6767

6868
| Task | Location |
6969
|------|----------|
70-
| Plugin hooks (config, tool, system.transform) | `src/index.ts` |
70+
| Plugin hooks (config, tool, experimental.chat.system.transform) | `src/index.ts` |
7171
| Config merging logic | `src/lib/config-handler.ts` |
7272
| Skill tool implementation | `src/lib/skill-tool.ts` |
7373
| Skill loading + formatting | `src/lib/skill-loader.ts` |
@@ -90,7 +90,7 @@ systematic/
9090

9191
| Symbol | Type | Location | Refs | Role |
9292
|--------|------|----------|------|------|
93-
| `SystematicPlugin` | export | src/index.ts:44 | 2 | Main plugin factory |
93+
| `SystematicPlugin` | const | src/index.ts:44 | 1 | Main plugin factory (default export) |
9494
| `createConfigHandler` | fn | src/lib/config-handler.ts:221 | 3 | Config hook — merges bundled assets |
9595
| `createSkillTool` | fn | src/lib/skill-tool.ts:88 | 3 | systematic_skill tool factory |
9696
| `getBootstrapContent` | fn | src/lib/bootstrap.ts:43 | 3 | System prompt injection |
@@ -100,9 +100,10 @@ systematic/
100100
| `TOOL_NAME_MAP` | const | src/lib/converter.ts:85 | 2 | CC→OC tool name lookup |
101101
| `findSkillsInDir` | fn | src/lib/skills.ts:90 | 6 | Skill discovery (highest centrality) |
102102
| `findAgentsInDir` | fn | src/lib/agents.ts:49 | 4 | Agent discovery (category from subdir) |
103-
| `findCommandsInDir` | fn | src/lib/commands.ts:27 | 4 | Command discovery |
103+
| `findCommandsInDir` | fn | src/lib/commands.ts:27 | 4 | Backward-compat command discovery |
104104
| `loadConfig` | fn | src/lib/config.ts:47 | 5 | JSONC config loading + 3-source merge |
105105
| `parseFrontmatter` | fn | src/lib/frontmatter.ts:19 | 16 | YAML frontmatter extraction — most-imported function |
106+
| `SKILL_FRONTMATTER_FIELDS` | const | src/lib/skills.ts:48 | 1 | Runtime skill frontmatter allow-list |
106107
| `walkDir` | fn | src/lib/walk-dir.ts:17 | 7 | Recursive dir walker (foundation layer) |
107108
| `loadSkill` | fn | src/lib/skill-loader.ts:63 | 2 | Skill content loading + XML wrapping |
108109

@@ -127,7 +128,7 @@ systematic/
127128

128129
## Plugin Architecture
129130

130-
Three hooks: `config` (merges bundled assets, existing config wins), `tool` (registers `systematic_skill`), `system.transform` (injects bootstrap prompt, skips title generation).
131+
Three hooks: `config` (merges bundled assets, existing config wins), `tool` (registers `systematic_skill`), `experimental.chat.system.transform` (injects bootstrap prompt, skips title generation).
131132

132133
## Skill Format
133134

@@ -150,17 +151,17 @@ All disabled lists merge (union), bootstrap config shallow-merges.
150151

151152
Systematic evolves fully independently. No upstream sync path exists — the automated sync workflow, `/sync-cep` command, `convert-cc-defs` skill, and `sync-manifest.json` have all been removed. The CLI `convert` command remains available for ad-hoc CC → OpenCode format conversions.
152153

153-
The `commands/` directory contains only `.gitkeep` (all commands converted to skills in a past cycle). Command code paths (`findCommandsInDir`, `loadCommandAsConfig`) remain for backward compatibility and project-specific commands under `.opencode/commands/`.
154+
The top-level `commands/` directory has been removed (all bundled commands were converted to skills). Command code paths (`findCommandsInDir`, `loadCommandAsConfig`) remain for backward compatibility and for project-specific commands under `.opencode/commands/`.
154155

155156
## Notes
156157

157-
- Content-integrity gate runs in CI (build job) — catches phantom `systematic:*` refs and banned CC/CEP patterns
158+
- Content-integrity gate runs in CI (build job) — catches phantom `systematic:*` refs, frontmatter/model contract violations, and banned CC/CEP patterns
158159
- Bootstrap injection is opt-out via `bootstrap.enabled: false`
159160
- Converter caches results using file mtime
160161
- CLI commands: `list` (skills/agents/commands), `convert` (file conversion), `config show/path`
161162
- Experimental hook: `experimental.chat.system.transform`
162163
- `docs/` is a separate workspace — run `bun run docs:generate` to sync reference content from bundled assets
163164
- Use `bun src/cli.ts` for local dev instead of `bunx systematic` to avoid slow resolution
164-
- `commands/` dir retained (with `.gitkeep`) for backward compatibility — code paths still support commands
165+
- No bundled `commands/` dir ships anymore — backward-compatible command code paths remain for `.opencode/commands/`
165166
- `registry/` provides OCX component-level installation with omo and standalone profiles
166167
- `.opencode/commands/` has project-only commands: `generate-readme` (README generation)

docs/AGENTS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bun run docs:preview # Preview production build
1515

1616
## Stack
1717

18-
- **Framework:** Starlight (`@astrojs/starlight`) on Astro 5
18+
- **Framework:** Starlight (`@astrojs/starlight`) on Astro 6
1919
- **Deploy:** GitHub Actions → GitHub Pages (`docs.yaml` workflow)
2020
- **Site:** `https://fro.bot/systematic` (trailing slashes enabled)
2121

@@ -47,11 +47,11 @@ docs/
4747
| `skills/*/SKILL.md` | `SKILL.md` files | `reference/skills/<slug>.md` + `index.mdx` |
4848
| `agents/**/*.md` | All `.md` files | `reference/agents/<slug>.md` + `index.mdx` |
4949

50-
Pipeline: `read file → parseFrontmatter → transformFrontmatter (name→title, agent category→badge) → generatePage → write`
50+
Pipeline: `read file → parseFrontmatter (shared from src/lib/frontmatter.ts) → transformFrontmatter (name→title, agent category→badge) → generatePage → write`
5151

5252
Each run cleans output dirs before regenerating. Index pages (`index.mdx`) are dynamically generated from the same enumerated entries using Starlight `CardGrid`/`LinkCard` components. Agents are grouped by category (design/docs/document-review/research/review/workflow). Slug collisions abort with error.
5353

54-
NOTE: `commands/` is empty (all commands converted to skills). The generation script may still have command handling code but produces no command pages from current source.
54+
NOTE: The top-level `commands/` directory has been removed (all commands converted to skills). The generation script may still have backward-compat command handling code but produces no command pages from current source.
5555

5656
## Where to Look
5757

@@ -67,7 +67,7 @@ NOTE: `commands/` is empty (all commands converted to skills). The generation sc
6767
## Notes
6868

6969
- Reference pages under `reference/` are gitignored — always regenerated from source (including `index.mdx`)
70-
- Agents get sidebar badges by category: Design, Docs, Research, Review, Workflow
71-
- Script has its own `parseFrontmatter` (duplicates `src/lib/frontmatter.ts` logic)
70+
- Agents get sidebar badges by category: Design, Docs, Document-review, Research, Review, Workflow
71+
- Script reuses `src/lib/frontmatter.ts` for frontmatter parsing
7272
- Frontmatter `name` → Starlight `title`, `description` gets HTML tags stripped
7373
- Sidebar: Getting Started, Guides, Reference (Skills/Agents) — all autogenerated from dirs

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"docs:preview": "bun run --cwd docs preview",
3838
"docs:generate": "bun docs/scripts/transform-content.ts",
3939
"registry:build": "bun scripts/build-registry.ts",
40+
"registry:drift": "bun scripts/generate-registry.ts --check",
4041
"registry:validate": "bun scripts/build-registry.ts --validate-only",
4142
"prepublishOnly": "bun run build"
4243
},

tests/unit/plugin.test.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,30 @@ describe('plugin loading', () => {
2424
expect(pluginModule.SystematicPlugin).toBeUndefined()
2525
})
2626

27-
test('CI smoke test loads the default plugin export', () => {
27+
test('CI smoke test validates the workflow plugin export and registry drift contract', () => {
2828
const workflowPath = path.join(ROOT_DIR, '.github/workflows/main.yaml')
2929
const workflow = fs.readFileSync(workflowPath, 'utf8')
3030

3131
expect(workflow).toContain('const pluginFactory = m.default;')
3232
expect(workflow).toContain('await pluginFactory({')
3333
expect(workflow).not.toContain('m.SystematicPlugin')
34+
expect(workflow).toContain('bun run registry:drift')
35+
})
36+
37+
test('package exposes distinct registry validation and drift commands', () => {
38+
const packageJsonPath = path.join(ROOT_DIR, 'package.json')
39+
const packageJson = JSON.parse(
40+
fs.readFileSync(packageJsonPath, 'utf8'),
41+
) as {
42+
scripts?: Record<string, string>
43+
}
44+
45+
expect(packageJson.scripts?.['registry:validate']).toBe(
46+
'bun scripts/build-registry.ts --validate-only',
47+
)
48+
expect(packageJson.scripts?.['registry:drift']).toBe(
49+
'bun scripts/generate-registry.ts --check',
50+
)
3451
})
3552

3653
test('cli runs under Bun', async () => {

0 commit comments

Comments
 (0)