aiwg-regenerate-opencode
Regenerate OpenCode context file (.opencode/context.md) with AIWG framework content
Best use case
aiwg-regenerate-opencode is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
It is a strong fit for teams already working in Codex.
Regenerate OpenCode context file (.opencode/context.md) with AIWG framework content
Teams using aiwg-regenerate-opencode should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/aiwg-regenerate-opencode/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How aiwg-regenerate-opencode Compares
| Feature / Agent | aiwg-regenerate-opencode | Standard Approach |
|---|---|---|
| Platform Support | Codex | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Regenerate OpenCode context file (.opencode/context.md) with AIWG framework content
Which AI agents support this skill?
This skill is designed for Codex.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# Regenerate OpenCode Context
Regenerate the `.opencode/context.md` file for OpenCode integration. Performs an **intelligent merge** — preserving team-written content while updating AIWG context.
## Core Principle
**Team content is preserved. AIWG content is updated. Hook file approach used when supported.**
## Parameters
| Flag | Description |
|------|-------------|
| `--no-backup` | Skip creating backup file |
| `--dry-run` | Preview changes without writing |
| `--full-inject` | Inject full content directly into context.md (legacy/compatibility mode) |
| `--migrate` | Migrate existing full-injection to hook file approach |
## Hook File Approach (Default)
By default, this command uses the hook file architecture:
1. Generate `AIWG-opencode.md` with AIWG framework content
2. Add `@AIWG-opencode.md` directive to `.opencode/context.md`
**Note**: OpenCode's support for `@file` directives is not yet confirmed. If the `@` directive is not supported, use `--full-inject` as a fallback. See #444 for status.
## Execution Steps
### Step 1: Create Backup
Unless `--no-backup` specified, create `.opencode/context.md.backup-{YYYYMMDD-HHMMSS}`.
### Step 2: Analyze Existing Content
Read `.opencode/context.md` if it exists and categorize:
- **Team content** (PRESERVE): Project rules, conventions, business logic
- **AIWG content** (UPDATE): Framework integration sections
### Step 3: Detect Hook File Support
Check whether existing `.opencode/context.md` uses a hook file directive:
```bash
grep -q "@AIWG-opencode.md" .opencode/context.md && echo "hook approach" || echo "full inject or fresh"
```
### Step 4: Generate AIWG-opencode.md
Generate the hook file content from installed framework manifests (same as `aiwg hook-regenerate --provider opencode`).
**If `--full-inject`**: Skip hook file generation, embed content directly.
### Step 5: Write Output
**Hook approach** (default):
1. Write `AIWG-opencode.md` with generated content
2. Update `.opencode/context.md`: preserve team content + add `@AIWG-opencode.md` directive
**Full inject** (`--full-inject`):
1. Embed full AIWG content in `.opencode/context.md` between markers:
```
<!-- BEGIN AIWG -->
[content]
<!-- END AIWG -->
```
### Step 6: Report
```
OpenCode Context Regenerated
=============================
Backup: .opencode/context.md.backup-20260322-190000
Hook file: AIWG-opencode.md (312 lines, written)
Context file: .opencode/context.md updated
@AIWG-opencode.md directive added
Team content preserved: 14 lines
```
## Note on OpenCode @-Link Support
OpenCode's support for `@file` includes within `.opencode/context.md` is currently unverified (see #444). If you encounter issues with AIWG context not loading:
```bash
# Fall back to full injection
/aiwg-regenerate-opencode --full-inject
```
## Examples
```bash
# Default (hook file approach)
/aiwg-regenerate-opencode
# Full injection (compatibility mode)
/aiwg-regenerate-opencode --full-inject
# Preview without writing
/aiwg-regenerate-opencode --dry-run
# Migrate from full inject to hook file
/aiwg-regenerate-opencode --migrate
```
## Related Commands
| Command | Regenerates |
|---------|-------------|
| `/aiwg-regenerate` | Auto-detect and delegate |
| `/hook-status` | Check hook state |
| `/hook-regenerate --provider opencode` | Rebuild hook file only |
| `/migrate-hook --provider opencode` | Migrate full inject to hook |
## References
- #439 — AIWG.md hook file architecture
- #444 — Multi-provider @-link support research
- #446 — Regenerate command suite updateRelated Skills
aiwg-orchestrate
Route structured artifact work to AIWG workflows via MCP with zero parent context cost
hook-regenerate
Rebuild AIWG hook files from currently installed framework manifests
aiwg-update-warp
Update existing project WARP.md with latest AIWG orchestration guidance
aiwg-update-claude
Update existing project CLAUDE.md with latest AIWG orchestration guidance
aiwg-status
Display workspace status dashboard showing installed frameworks, deployments, artifact counts, and health indicators
aiwg-setup-warp
Setup Warp Terminal with AIWG framework context (preserves existing content)
aiwg-setup-project
Update project CLAUDE.md with AIWG framework context and configuration
aiwg-regenerate
Regenerate platform context file with preserved team directives
aiwg-regenerate-windsurfrules
Regenerate .windsurfrules for Windsurf with preserved team directives
aiwg-regenerate-warp
Regenerate WARP.md for Warp Terminal with preserved team directives
aiwg-regenerate-factory
Regenerate AGENTS.md for Factory AI with hook file architecture
aiwg-regenerate-cursorrules
Regenerate .cursorrules for Cursor with preserved team directives