Skip to content

Commit 17335d3

Browse files
authored
feat: sync all CEP skills from upstream e8f3bbc (#63)
* feat: sync all CEP skills from upstream e8f3bbc Re-sync 7 existing skills and import 3 new skills from EveryInc/compound-engineering-plugin@e8f3bbcb35 with full folder contents (references, assets, scripts, workflows, templates). Existing skills re-synced (28 files): - agent-browser, agent-native-architecture, brainstorming, compound-docs, create-agent-skills, file-todos, git-worktree New skills imported (3 files): - document-review (referenced by brainstorm/plan commands) - frontend-design (referenced by design agents) - orchestrating-swarms (referenced by work command) Conversion applied across all files: - CC→OC branding in prose (Claude Code → OpenCode) - CLAUDE.md → AGENTS.md, .claude/ → .opencode/ - Tool name mappings (Read/Write/Edit/Bash/etc.) - CLAUDE_PLUGIN_ROOT paths simplified to relative paths - CC frontmatter fields preserved (document upstream intent) - Version attribution footers removed (nonsensical after rewrite) Also updates convert-cc-defs skill with 5 learnings from this batch and updates sync-manifest.json with provenance for all 10 skills. * fix: correct tool name capitalization in orchestrating-swarms code examples Fix 47 instances of Task({ → task({ in code block examples that were missed during the initial code block audit (converter skips fenced blocks by design). Also adds a high-risk pattern note to the convert-cc-defs skill reinforcing that long files with many code examples need targeted post-conversion search for capitalized tool names. * docs: document converter code-block tool name capitalization issue Compound documentation for the orchestrating-swarms fix: converter intentionally skips code blocks, creating a manual audit gap that missed 47 Task({ → task({ conversions. Includes root cause analysis, prevention strategies, and a post-conversion validation script.
1 parent 26baac7 commit 17335d3

33 files changed

Lines changed: 2789 additions & 775 deletions

File tree

.opencode/skills/convert-cc-defs/SKILL.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ for agent_path in "${AGENTS[@]}"; do
9696
done
9797
```
9898

99+
**Recursive file listing** — the contents API fails on subdirectories. Use the git tree API for a complete one-shot listing:
100+
101+
```bash
102+
# List ALL files under skills/ recursively (one API call)
103+
gh api "repos/EveryInc/compound-engineering-plugin/git/trees/<COMMIT_SHA>?recursive=1" \
104+
--jq '.tree[] | select(.path | startswith("plugins/compound-engineering/skills/")) | select(.type == "blob") | .path' \
105+
| sed 's|plugins/compound-engineering/skills/||'
106+
```
107+
108+
**Skill folders** — Skills are directories, not just SKILL.md files. A skill folder may contain references/, templates/, workflows/, scripts/, assets/, and schema files. The CLI converter (`bun src/cli.ts convert skill`) ONLY processes SKILL.md files. All other files in the skill folder must be:
109+
1. Fetched from upstream individually via the contents API
110+
2. Copied to the local skill directory, preserving the folder structure
111+
3. Manually rewritten with CC→OC text replacements (`.claude/``.opencode/`, `CLAUDE.md``AGENTS.md`, `Claude Code``OpenCode`, `compound-engineering:``systematic:`, etc.)
112+
4. `${CLAUDE_PLUGIN_ROOT}/skills/<name>/...` paths simplified to relative paths (skills are bundled in the plugin — no env var prefix needed)
113+
99114
### 1b. Check Existing Manifest
100115

101116
Read `sync-manifest.json` to determine if this is a new import or an update:
@@ -120,10 +135,15 @@ If updating an existing definition:
120135
2. **Philosophy fit:** Is it consistent with Systematic's opinionated workflow approach? (Structured phases, explicit deliverables, skill-driven discipline)
121136
3. **Overlap check:** Does it duplicate an existing bundled definition? If partial overlap, propose enhancing the existing definition instead.
122137
4. **Dependency check:** Does the definition reference agents, skills, or commands that don't exist in Systematic? List any missing dependencies — note as WARN (they can be imported later using this skill, and references should be kept).
123-
5. **Phantom check:** If importing agents referenced by commands, verify the agents actually exist upstream. Commands may reference agents that were never created upstream ("phantom agents"). Fetch the upstream directory listing to confirm:
138+
5. **Phantom check:** If importing agents or skills referenced by commands, verify they actually exist upstream. Commands may reference definitions that were never created upstream ("phantoms"). Fetch the upstream directory listing to confirm:
124139
```bash
140+
# Check agents
125141
gh api repos/EveryInc/compound-engineering-plugin/contents/plugins/compound-engineering/agents/review \
126142
--jq '.[].name'
143+
# Check skills
144+
gh api "repos/EveryInc/compound-engineering-plugin/git/trees/<COMMIT_SHA>?recursive=1" \
145+
--jq '.tree[] | select(.path | startswith("plugins/compound-engineering/skills/")) | select(.type == "tree") | .path' \
146+
| sed 's|plugins/compound-engineering/skills/||' | grep -v '/'
127147
```
128148
6. **User value:** Would a Systematic plugin user actually invoke this? Niche CC-specific tools (e.g., `feature-video`, `test-browser`) may not translate.
129149

@@ -222,6 +242,8 @@ The mechanical converter catches regex-matchable patterns. You must catch contex
222242
| `TodoWrite` in prose (not just tool calls) | `todowrite` or "update your task list" |
223243
| "the built-in grep tool" (lowercase tool name) | "the built-in Grep tool" (OC capitalizes tool names) |
224244
| `compound-engineering pipeline artifacts` | Remove or replace with "systematic pipeline artifacts" |
245+
| Version attribution footers (e.g., `*Based on Claude Code v2.1.19*`) | **Remove entirely** — CC version numbers are not applicable to Systematic. Blind `Claude Code` → `OpenCode` rewrite turns these into nonsensical `Based on OpenCode v2.1.19`. |
246+
| Source attribution URLs (e.g., `claude.com`, `docs.anthropic.com`) | **Keep as-is** — these are upstream source references, not branding |
225247

226248
### 3c. Content Adaptation
227249

@@ -259,6 +281,8 @@ The mechanical converter intentionally skips content inside fenced code blocks t
259281
| Attribution badges/footers (`Compound Engineered`, `Claude Code` links) | → Systematic branding |
260282
| `AskUserQuestion` | → `question tool` |
261283

284+
> **High-risk pattern:** Long skills with many code examples (e.g., orchestrating-swarms has 47 `Task({` calls across 1700+ lines). After mechanical conversion, run a targeted search for capitalized tool names inside code blocks: `grep -n "Task(\|TodoWrite\|AskUserQuestion" <file>`. Fix all occurrences — users copying broken examples will get runtime errors.
285+
262286
### 3e. CC-Specific Features
263287

264288
Some CC features have no direct OC equivalent. For each, make a case-by-case decision:
@@ -267,7 +291,8 @@ Some CC features have no direct OC equivalent. For each, make a case-by-case dec
267291
|------------|---------------|----------------|
268292
| `Teammate` API (spawnTeam, requestShutdown, cleanup) | None — `task` with `run_in_background` is partial | Keep as aspirational reference with explanatory note |
269293
| "Remote" execution (Claude Code web background) | None | Remove — no OC equivalent exists |
270-
| `${CLAUDE_SESSION_ID}` | None | Remove |
294+
| `${CLAUDE_SESSION_ID}` | None | Remove (keep in upstream API spec docs as-is) |
295+
| `${CLAUDE_PLUGIN_ROOT}` | None — bundled skills use relative paths | Simplify to relative paths (e.g., `scripts/worktree-manager.sh` not `${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh`) |
271296
| `AskUserQuestion` with complex schemas | `question` tool (simpler) | Adapt to OC's question tool format |
272297

273298
Present CC-specific feature decisions to the user before proceeding.
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
title: "Converter Skips Code Blocks: 47 Broken Tool Name Examples in orchestrating-swarms"
3+
date: 2026-02-10
4+
severity: high
5+
category: integration-issues
6+
component: converter
7+
tags:
8+
- converter
9+
- code-blocks
10+
- tool-names
11+
- cep-migration
12+
- orchestrating-swarms
13+
- convert-cc-defs
14+
environment: "Bun 1.x / TypeScript 5.7+ / OpenCode"
15+
symptoms:
16+
- "Code examples show Task({ instead of task({ after CC→OC conversion"
17+
- "Users copying code examples from skill documentation get runtime errors"
18+
- "47 instances of capitalized Task({ in orchestrating-swarms SKILL.md"
19+
root_cause: "Converter intentionally skips fenced code blocks to avoid false positives (e.g., 'Task' as a noun). Manual code block audit step in convert-cc-defs skill was missed during batch import of a 1718-line file."
20+
resolution_type: process
21+
confidence: verified
22+
related:
23+
- docs/solutions/integration-issues/batch-import-cep-agents-to-systematic-20260210.md
24+
- docs/CONVERSION-GUIDE.md
25+
- .opencode/skills/convert-cc-defs/SKILL.md
26+
---
27+
28+
# Converter Skips Code Blocks: 47 Broken Tool Name Examples in orchestrating-swarms
29+
30+
## Problem
31+
32+
After batch-importing 10 CEP skills from upstream (`EveryInc/compound-engineering-plugin@e8f3bbcb35`), the `orchestrating-swarms` skill contained 47 instances of `Task({` (Claude Code capitalization) in its code examples instead of `task({` (OpenCode lowercase). Every code example in this 1718-line file was broken — users copying examples would get runtime errors.
33+
34+
### Symptoms
35+
36+
- All code examples in `skills/orchestrating-swarms/SKILL.md` used `Task({...})` instead of `task({...})`
37+
- `const research = await Task({...})` instead of `const research = await task({...})`
38+
- One-liner spawns like `Task({ team_name: "codebase-review", ... })` also affected
39+
- 47 total occurrences, all inside fenced JavaScript code blocks
40+
41+
## Investigation
42+
43+
### Step 1: Understand the converter's design
44+
45+
The converter (`src/lib/converter.ts`) uses `CODE_BLOCK_PATTERN` to identify fenced code blocks (` ```...``` `) and inline code (`` `...` ``). In `transformBody()`, these regions are replaced with placeholders before applying tool name mappings, then restored after. This is **intentional** — it prevents false positives like:
46+
47+
- "Complete the Task today" → would incorrectly become "Complete the task today"
48+
- "Task list management" → would incorrectly become "task list management"
49+
- CSS class names, variable names in non-JS contexts
50+
51+
The converter's behavior is tested and correct. The problem is downstream.
52+
53+
### Step 2: Check the convert-cc-defs workflow
54+
55+
The `convert-cc-defs` skill (`.opencode/skills/convert-cc-defs/SKILL.md`) documents a "Phase 3d: Code Block Audit" step with a table of patterns to manually fix after mechanical conversion:
56+
57+
| Pattern in code blocks | Action |
58+
|------------------------|--------|
59+
| `Task(agent-name)` or `Task({ ... })` |`task(agent-name)` / `task({ ... })` |
60+
| `TodoWrite` |`todowrite` |
61+
| `CLAUDE.md` |`AGENTS.md` |
62+
| `.claude/skills/` paths |`.opencode/skills/` |
63+
| `Teammate({ operation: ... })` | Aspirational note or adapt to `task` |
64+
| `AskUserQuestion` |`question tool` |
65+
66+
The documentation was correct. The audit step was simply skipped during execution — easy to miss in a batch import of 10 skills, especially when the problematic file is 1718 lines with 47 occurrences spread across dozens of code blocks.
67+
68+
### Step 3: Verify scope
69+
70+
Searched all skills for capitalized tool names in code blocks:
71+
72+
```bash
73+
grep -rn "Task(" skills/ --include="*.md" | grep -v "Task Analysis\|Task List\|task("
74+
```
75+
76+
Only `orchestrating-swarms` was affected. Other skills either had no code examples or had already been correctly audited. The `agent-native-architecture` references contained Swift iOS API calls (`endBackgroundTask`) — correct and unrelated.
77+
78+
## Root Cause
79+
80+
**Two-factor failure:**
81+
82+
1. **Converter design (correct):** Skips code blocks to avoid false positives in prose text. This is the right tradeoff — false positives in prose are worse than requiring manual code block review.
83+
84+
2. **Process gap (the bug):** The manual "Code Block Audit" step (Phase 3d) in the convert-cc-defs workflow was missed during batch execution. The orchestrating-swarms file is unusually large (1718 lines, 47 tool calls in code blocks) making the omission high-impact.
85+
86+
The convert-cc-defs skill documented the audit requirement, but under batch pressure (10 skills, 52 files), the step was skipped for this file. The workflow lacked enforcement — it was advisory, not gated.
87+
88+
## Solution
89+
90+
### Immediate fix (applied)
91+
92+
```bash
93+
sed -i '' 's/Task({/task({/g' skills/orchestrating-swarms/SKILL.md
94+
sed -i '' 's/await Task(/await task(/g' skills/orchestrating-swarms/SKILL.md
95+
```
96+
97+
Verified: 0 `Task({` remaining, 47 `task({` present.
98+
99+
### Manifest tracking (applied)
100+
101+
Added rewrite entry to `sync-manifest.json`:
102+
103+
```json
104+
{
105+
"field": "body:code-block-tool-names",
106+
"reason": "Fixed 47 instances of Task({ → task({ in code examples. Converter skips code blocks by design; these were missed during initial manual code block audit."
107+
}
108+
```
109+
110+
### Skill improvement (applied)
111+
112+
Added a high-risk pattern note to the convert-cc-defs skill's Code Block Audit section:
113+
114+
> **High-risk pattern:** Long skills with many code examples (e.g., orchestrating-swarms has 47 `Task({` calls across 1700+ lines). After mechanical conversion, run a targeted search for capitalized tool names inside code blocks: `grep -n "Task(\|TodoWrite\|AskUserQuestion" <file>`. Fix all occurrences — users copying broken examples will get runtime errors.
115+
116+
## Prevention
117+
118+
### 1. Post-conversion validation command
119+
120+
Run after any conversion to detect CC tool markers inside code blocks:
121+
122+
```bash
123+
python3 -c "
124+
import re, sys, pathlib
125+
CODE_BLOCKS = re.compile(r'\x60\x60\x60[\s\S]*?\x60\x60\x60|\x60[^\x60\n]+\x60')
126+
FORBIDDEN = [
127+
(re.compile(r'\bTask\s*\('), 'Task('),
128+
(re.compile(r'\b(TodoWrite|AskUserQuestion|WebSearch|WebFetch)\b'), 'CC tool'),
129+
(re.compile(r'CLAUDE\.md'), 'CLAUDE.md'),
130+
(re.compile(r'\.claude/'), '.claude/ path'),
131+
]
132+
total = 0
133+
for f in pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else 'skills').rglob('*.md'):
134+
text = f.read_text()
135+
for m in CODE_BLOCKS.finditer(text):
136+
block = m.group(0)
137+
for rx, label in FORBIDDEN:
138+
for mm in rx.finditer(block):
139+
line = text.count('\n', 0, m.start()) + 1
140+
print(f' {f}:{line}: {label}: {mm.group(0)}')
141+
total += 1
142+
print(f'\n{\"FAIL: \" + str(total) + \" issues\" if total else \"OK: no CC markers in code blocks\"}')
143+
sys.exit(1 if total else 0)
144+
"
145+
```
146+
147+
### 2. Workflow guardrails
148+
149+
Make Phase 3d a hard gate in `convert-cc-defs`:
150+
- Run the validation command; if exit code != 0, do not proceed to Phase 4
151+
- Record audit counts in manifest notes: `CODE_BLOCK_AUDIT: PASS (Task(:0, TodoWrite:0)`
152+
153+
### 3. Bundled-assets integration test
154+
155+
Add a test in `tests/integration/` that scans all shipped `skills/`, `agents/`, `commands/` for CC markers inside code blocks. This catches misses at CI time, not review time.
156+
157+
### 4. Batch import backstop
158+
159+
For multi-file imports, run the validator on `git diff --name-only --diff-filter=AM` after the batch completes.
160+
161+
## Verification
162+
163+
```bash
164+
# Confirm fix
165+
grep -c "Task({" skills/orchestrating-swarms/SKILL.md # 0
166+
grep -c "task({" skills/orchestrating-swarms/SKILL.md # 47
167+
168+
# Full build
169+
bun run build && bun run typecheck && bun run lint && bun test
170+
# 328/328 tests pass, 617 expect() calls
171+
```
172+
173+
## Cross-References
174+
175+
- **Related solution:** [Batch Importing CEP Agents](./batch-import-cep-agents-to-systematic-20260210.md) — same batch import session, different issue (phantom agents)
176+
- **Conversion guide:** [docs/CONVERSION-GUIDE.md](../../CONVERSION-GUIDE.md) — tool name mappings reference
177+
- **Workflow skill:** [convert-cc-defs](../../../.opencode/skills/convert-cc-defs/SKILL.md) — Phase 3d Code Block Audit
178+
- **PR:** [#63](https://github.com/marcusrbrown/systematic/pull/63) — feat: sync all CEP skills from upstream
179+
- **Converter source:** `src/lib/converter.ts``CODE_BLOCK_PATTERN` and `transformBody()`
180+
181+
## Key Takeaway
182+
183+
The converter's code-block-skipping is a correct safety measure. The failure was a process gap: a manual audit step documented in the workflow but not enforced. The fix is twofold: (1) targeted grep after every conversion, and (2) automated validation that fails CI if CC markers remain in code blocks. **Don't trust humans to manually audit 1700-line files under batch pressure — automate the check.**

skills/agent-browser/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,4 @@ Use Playwright MCP when:
221221
- You need deep MCP tool integration
222222
- You want tool-based responses
223223
- You're building complex automation
224+

skills/agent-native-architecture/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ description: Build applications where agents are first-class citizens. Use this
66
<why_now>
77
## Why Now
88

9-
Software agents work reliably now. Claude Code demonstrated that an LLM with access to bash and file tools, operating in a loop until an objective is achieved, can accomplish complex multi-step tasks autonomously.
9+
Software agents work reliably now. Modern coding agents like OpenCode have demonstrated that an LLM with access to bash and file tools, operating in a loop until an objective is achieved, can accomplish complex multi-step tasks autonomously.
1010

11-
The surprising discovery: **a really good coding agent is actually a really good general-purpose agent.** The same architecture that lets Claude Code refactor a codebase can let an agent organize your files, manage your reading list, or automate your workflows.
11+
The surprising discovery: **a really good coding agent is actually a really good general-purpose agent.** The same architecture that lets an agent refactor a codebase can let it organize your files, manage your reading list, or automate your workflows.
1212

13-
The Claude Code SDK makes this accessible. You can build applications where features aren't code you write—they're outcomes you describe, achieved by an agent with tools, operating in a loop until the outcome is reached.
13+
Agent SDKs make this accessible. You can build applications where features aren't code you write—they're outcomes you describe, achieved by an agent with tools, operating in a loop until the outcome is reached.
1414

15-
This opens up a new field: software that works the way Claude Code works, applied to categories far beyond coding.
15+
This opens up a new field: software that works the way modern coding agents work, applied to categories far beyond coding.
1616
</why_now>
1717

1818
<core_principles>

skills/agent-native-architecture/references/files-universal-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Files are the universal interface for agent-native applications. Agents are natu
55
<why_files>
66
## Why Files
77

8-
Agents are naturally good at files. Claude Code works because bash + filesystem is the most battle-tested agent interface. When building agent-native apps, lean into this.
8+
Agents are naturally good at files. OpenCode works because bash + filesystem is the most battle-tested agent interface. When building agent-native apps, lean into this.
99

1010
### Agents Already Know How
1111

skills/agent-native-architecture/references/product-implications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The best agent-native applications are simple to start but endlessly powerful.
1111

1212
Excel is the canonical example: you can use it for a grocery list, or you can build complex financial models. The same tool, radically different depths of use.
1313

14-
Claude Code has this quality: fix a typo, or refactor an entire codebase. The interface is the same—natural language—but the capability scales with the ask.
14+
OpenCode has this quality: fix a typo, or refactor an entire codebase. The interface is the same—natural language—but the capability scales with the ask.
1515

1616
### The Pattern
1717

skills/brainstorming/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,4 @@ Planning answers **HOW** to build it:
188188
- Testing strategy and verification
189189

190190
When brainstorm output exists, `/workflows:plan` should detect it and use it as input, skipping its own idea refinement phase.
191+

0 commit comments

Comments
 (0)