ai-workflow-init 6.2.3 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,227 @@
1
+ # OpenCode Sync Guide
2
+
3
+ Sync Claude Code workflows to OpenCode format.
4
+
5
+ ---
6
+
7
+ ## Prerequisites
8
+
9
+ - Source: `.claude/commands/*.md`, `.claude/skills/**/SKILL.md`, `.claude/CLAUDE.md`
10
+ - Target: `.opencode/command/*.md`, `.opencode/skill/*/SKILL.md`, `.opencode/agent/*.md`, `AGENTS.md`
11
+
12
+ ---
13
+
14
+ ## Step 1: Fetch OpenCode Documentation
15
+
16
+ **Search queries (try in order until successful):**
17
+ 1. `site:opencode.ai docs agents commands skills`
18
+ 2. `opencode.ai documentation configuration`
19
+ 3. `opencode ai terminal commands skills agents`
20
+
21
+ **Key documentation URLs:**
22
+ - `https://opencode.ai/docs/agents/` - Agents configuration
23
+ - `https://opencode.ai/docs/commands/` - Custom commands
24
+ - `https://opencode.ai/docs/skills/` - Agent skills
25
+ - `https://opencode.ai/docs/rules/` - Rules (AGENTS.md)
26
+ - `https://opencode.ai/docs/config/` - Configuration
27
+
28
+ ---
29
+
30
+ ## Step 2: Conversion Rules
31
+
32
+ ### Commands (`.opencode/command/*.md`)
33
+
34
+ **Location**: `.opencode/command/{name}.md`
35
+
36
+ **Frontmatter:**
37
+ - `description` (required)
38
+ - `agent: build` for commands that modify code
39
+ - `agent: plan` for read-only commands
40
+ - `model`: optional model override
41
+ - `subtask`: optional subtask flag
42
+
43
+ **Arguments:**
44
+ - `$ARGUMENTS` for all text after command
45
+ - `$1`, `$2`, etc. for positional args
46
+
47
+ **Tool references conversion:**
48
+ | Claude Code | OpenCode |
49
+ |-------------|----------|
50
+ | `AskUserQuestion(...)` | (handled by TUI) |
51
+ | `Task(subagent_type='Explore')` | `@explore` mention |
52
+ | `Task(subagent_type='General')` | `@general` mention |
53
+ | `Read(file_path=...)` | `@filename` reference |
54
+ | `Write(file_path=...)` | Write instruction |
55
+ | `Edit(file_path=...)` | Edit instruction |
56
+ | `Bash(command=...)` | `` !`command` `` syntax |
57
+
58
+ ### Skills (`.opencode/skill/<name>/SKILL.md`)
59
+
60
+ **Location**: `.opencode/skill/{skill-name}/SKILL.md`
61
+
62
+ **Name validation:**
63
+ - Lowercase alphanumeric with hyphens
64
+ - 1-64 characters
65
+ - Directory name must match `name` in frontmatter
66
+
67
+ **Frontmatter (required):**
68
+ - `name`: skill name
69
+ - `description`: 1-1024 chars
70
+ - `license`: optional (e.g., MIT)
71
+ - `compatibility`: optional (e.g., opencode)
72
+ - `metadata`: optional key-value pairs
73
+
74
+ ### Agents (`.opencode/agent/*.md`)
75
+
76
+ **Built-in agents (don't need to create):**
77
+ - `build` - Primary agent with all tools (default)
78
+ - `plan` - Read-only analysis agent
79
+ - `general` - Subagent for complex tasks
80
+ - `explore` - Subagent for codebase exploration
81
+
82
+ **Create custom agents only if needed.**
83
+
84
+ **Frontmatter:**
85
+ - `description`: agent description
86
+ - `mode`: `primary` or `subagent`
87
+ - `model`: model identifier
88
+ - `temperature`: optional
89
+ - `tools`: tool permissions object
90
+ - `permission`: skill permissions
91
+
92
+ ---
93
+
94
+ ## Step 3: Templates
95
+
96
+ ### Command Template
97
+
98
+ ```markdown
99
+ ---
100
+ description: {description}
101
+ agent: build
102
+ ---
103
+
104
+ {goal and instructions from Claude command}
105
+
106
+ ## Instructions
107
+
108
+ {step-by-step instructions}
109
+
110
+ ### Step 1: {step name}
111
+
112
+ {converted step content}
113
+ - Use @explore to search codebase
114
+ - Use @filename to reference files
115
+ - Use !`command` for shell output
116
+
117
+ ...
118
+
119
+ ## Notes
120
+
121
+ {notes section}
122
+ ```
123
+
124
+ ### Skill Template
125
+
126
+ ```markdown
127
+ ---
128
+ name: {skill-name}
129
+ description: {description from Claude skill, 1-1024 chars}
130
+ license: MIT
131
+ compatibility: opencode
132
+ metadata:
133
+ category: {category}
134
+ source: claude-code
135
+ ---
136
+
137
+ ## What I do
138
+
139
+ {capabilities from Claude skill}
140
+
141
+ ## When to use me
142
+
143
+ {triggers and conditions from Claude skill}
144
+
145
+ ## Instructions
146
+
147
+ {step-by-step instructions from Claude skill}
148
+ ```
149
+
150
+ ### Agent Template (if custom needed)
151
+
152
+ ```markdown
153
+ ---
154
+ description: {agent description}
155
+ mode: subagent
156
+ model: anthropic/claude-sonnet-4-20250514
157
+ temperature: 0.1
158
+ tools:
159
+ write: false
160
+ edit: false
161
+ bash: false
162
+ permission:
163
+ skill:
164
+ "*": allow
165
+ ---
166
+
167
+ {system prompt for agent behavior}
168
+
169
+ Focus on:
170
+ - {behavior 1}
171
+ - {behavior 2}
172
+ - {behavior 3}
173
+ ```
174
+
175
+ ---
176
+
177
+ ## Step 4: Write Files
178
+
179
+ **Tools:**
180
+ - `mkdir -p .opencode/command`
181
+ - `mkdir -p .opencode/skill/{name}`
182
+ - `mkdir -p .opencode/agent`
183
+ - Write(file_path=".opencode/command/{name}.md")
184
+ - Write(file_path=".opencode/skill/{name}/SKILL.md")
185
+ - Write(file_path=".opencode/agent/{name}.md") - only if custom agent needed
186
+
187
+ **Skill name mapping:**
188
+ - `.claude/skills/design/figma-extraction/` → `.opencode/skill/figma-extraction/`
189
+ - `.claude/skills/architecture/quality-code-check/` → `.opencode/skill/quality-code-check/`
190
+ - `.claude/skills/ux/accessibility/` → `.opencode/skill/ux-accessibility/`
191
+
192
+ ---
193
+
194
+ ## Step 5: Output Classification
195
+
196
+ ```
197
+ OpenCode Commands (.opencode/command/):
198
+ - create-plan.md: [STATUS]
199
+ - execute-plan.md: [STATUS]
200
+ - sync-workflow.md: [STATUS]
201
+
202
+ OpenCode Skills (.opencode/skill/):
203
+ - figma-extraction/SKILL.md: [STATUS]
204
+ - quality-code-check/SKILL.md: [STATUS]
205
+ - frontend-design-fundamentals/SKILL.md: [STATUS]
206
+
207
+ OpenCode Agents (.opencode/agent/):
208
+ - Using built-in agents (build, plan, explore, general)
209
+ - [custom agent name]: [STATUS] (if any)
210
+ ```
211
+
212
+ ---
213
+
214
+ ## OpenCode-Specific Notes
215
+
216
+ 1. **Skills are native**: OpenCode reads `.claude/skills/*/SKILL.md` directly! But for clarity, also create `.opencode/skill/*/SKILL.md`
217
+
218
+ 2. **AGENTS.md is native**: OpenCode reads `AGENTS.md` and `CLAUDE.md` from root - no conversion needed
219
+
220
+ 3. **Command syntax special features:**
221
+ - Arguments: `$ARGUMENTS` for all, `$1`, `$2` for positional
222
+ - Shell output: `` !`git status` `` injects command output
223
+ - File references: `@src/file.ts` includes file content
224
+
225
+ 4. **Agent modes:**
226
+ - `primary`: Main agents (Tab to switch)
227
+ - `subagent`: Invoked by `@mention` or by primary agents
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-init",
3
- "version": "6.2.3",
3
+ "version": "6.3.1",
4
4
  "description": "Initialize AI workflow docs & commands into any repo with one command",
5
5
  "bin": {
6
6
  "ai-workflow-init": "./cli.js"