Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@
# Maister task tracking (generated per-project, not part of plugin source)
.maister/
/.worktrees/

# OpenCode build output (generated by build.sh)
platforms/opencode/output/

# Node modules (for OpenCode plugin)
platforms/opencode/plugin/node_modules/
platforms/opencode/plugin/package-lock.json
1 change: 1 addition & 0 deletions .sisyphus/evidence/task-5-no-claude-refs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
120 changes: 120 additions & 0 deletions .sisyphus/evidence/task-5-path-check.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
platforms/opencode/output/:
agent-fragment.json
agents
commands
instructions
mcp-fragment.json
plugins

platforms/opencode/output/agents:
bottleneck-analyzer.md
codebase-analysis-reporter.md
code-quality-pragmatist.md
code-reviewer.md
docs-operator.md
e2e-test-verifier.md
gap-analyzer.md
implementation-completeness-checker.md
implementation-planner.md
information-gatherer.md
production-readiness-checker.md
project-analyzer.md
reality-assessor.md
research-planner.md
research-synthesizer.md
solution-brainstormer.md
solution-designer.md
spec-auditor.md
specification-creator.md
task-classifier.md
task-group-implementer.md
test-suite-runner.md
ui-mockup-generator.md
user-docs-generator.md

platforms/opencode/output/commands:
quick-dev.md
quick-plan.md
reviews-code.md
reviews-pragmatic.md
reviews-production-readiness.md
reviews-reality-check.md
reviews-spec-audit.md
work.md

platforms/opencode/output/instructions:
maister-codebase-analyzer.md
maister-development.md
maister-docs-manager.md
maister-implementation-plan-executor.md
maister-implementation-verifier.md
maister-init.md
maister-migration.md
maister-performance.md
maister-product-design.md
maister-quick-bugfix.md
maister-research.md
maister-rules.md
maister-standards-discover.md
maister-standards-update.md
references

platforms/opencode/output/instructions/references:
codebase-analyzer
docs-manager
init
migration
performance
product-design
research
shared
standards-discover

platforms/opencode/output/instructions/references/codebase-analyzer:
code-analysis.md
combined.md
context-discovery.md
file-discovery.md
migration-target.md
pattern-mining.md

platforms/opencode/output/instructions/references/docs-manager:
claude-md-template.md
index-md-template.md

platforms/opencode/output/instructions/references/init:
architecture-template.md
roadmap-templates.md
tech-stack-template.md
vision-templates.md

platforms/opencode/output/instructions/references/migration:
migration-strategies.md
migration-types.md

platforms/opencode/output/instructions/references/performance:
performance-optimization-guide.md

platforms/opencode/output/instructions/references/product-design:
characteristic-detection.md
interaction-patterns.md
visual-companion.md

platforms/opencode/output/instructions/references/research:
brainstorming-techniques.md
design-techniques.md
research-methodologies.md

platforms/opencode/output/instructions/references/shared:
orchestrator-creation-checklist.md
orchestrator-patterns.md

platforms/opencode/output/instructions/references/standards-discover:
aggregation-strategy.md
code-pattern-prompt.md
config-analyzer-prompt.md
docs-extractor-prompt.md
external-analyzer-prompt.md

platforms/opencode/output/plugins:
README.md
34 changes: 33 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build validate clean watch
.PHONY: build validate clean watch opencode opencode-build opencode-validate opencode-clean

build:
bash platforms/copilot-cli/build.sh
Expand All @@ -23,3 +23,35 @@ clean:

watch:
fswatch -o plugins/maister/ | xargs -n1 -I{} make build

opencode-build:
bash platforms/opencode/build.sh

opencode-validate:
@test -d platforms/opencode/output || (echo "FAIL: Run make opencode-build first" && exit 1)
@echo "Checking no AskUserQuestion in output..."
@! grep -r 'AskUserQuestion' platforms/opencode/output/ 2>/dev/null || (echo "FAIL: AskUserQuestion found in output" && exit 1)
@echo "Checking no TaskCreate or TaskUpdate in output..."
@! grep -r 'TaskCreate\|TaskUpdate' platforms/opencode/output/ 2>/dev/null || (echo "FAIL: TaskCreate or TaskUpdate found in output" && exit 1)
@echo "Checking no Skill(name= in output..."
@! grep -r 'Skill(name=' platforms/opencode/output/ 2>/dev/null || (echo "FAIL: Skill(name= found in output" && exit 1)
@echo "Checking no maister: prefix in output..."
@! (grep -r 'maister:' platforms/opencode/output/ --include="*.md" --include="*.json" 2>/dev/null | grep -v '\[orchestrator-name\]' | grep -v 'skill: "maister-') || (echo "FAIL: maister: prefix found in output" && exit 1)
@echo "Checking no CLAUDE.md references in output..."
@! grep -ri 'CLAUDE\.md' platforms/opencode/output/ 2>/dev/null || (echo "FAIL: CLAUDE.md reference found in output" && exit 1)
@echo "Checking agent-fragment.json is valid JSON..."
@jq . platforms/opencode/output/agent-fragment.json > /dev/null || (echo "FAIL: agent-fragment.json is not valid JSON" && exit 1)
@echo "Checking mcp-fragment.json is valid JSON..."
@jq . platforms/opencode/output/mcp-fragment.json > /dev/null || (echo "FAIL: mcp-fragment.json is not valid JSON" && exit 1)
@echo "Checking minimum 8 commands present..."
@test $$(ls platforms/opencode/output/commands/ 2>/dev/null | wc -l) -ge 8 || (echo "FAIL: Minimum 8 commands not found" && exit 1)
@echo "Checking minimum 20 agents present..."
@test $$(ls platforms/opencode/output/agents/ 2>/dev/null | wc -l) -ge 20 || (echo "FAIL: Minimum 20 agents not found" && exit 1)
@echo "Checking minimum 14 instruction files present..."
@test $$(ls platforms/opencode/output/instructions/maister-*.md 2>/dev/null | wc -l) -ge 14 || (echo "FAIL: Minimum 14 instruction files not found" && exit 1)
@echo "All checks passed"

opencode-clean:
rm -rf platforms/opencode/output/

opencode: opencode-build opencode-validate
140 changes: 140 additions & 0 deletions docs/opencode-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# OpenCode Setup Guide

This guide explains how to install and configure the Maister plugin for use with [OpenCode](https://github.com/anomalyco/opencode).

## Prerequisites

- **OpenCode installed**: See the [OpenCode repository](https://github.com/anomalyco/opencode) for installation instructions.
- **Node.js ≥ 18**: Required for running the plugin.
- **jq**: Installed for merging configuration fragments.
- **git, make, bash**: Standard development tools.

## Quick Start

```bash
git clone https://github.com/SkillPanel/Maister.git maister-src
cd maister-src
make opencode-build
# copy output to your project
cp -r platforms/opencode/output/commands/ /path/to/your-project/.opencode/commands/
cp -r platforms/opencode/output/agents/ /path/to/your-project/.opencode/agents/
cp -r platforms/opencode/output/instructions/ /path/to/your-project/.opencode/instructions/
cp platforms/opencode/output/plugins/maister-plugin.ts /path/to/your-project/.opencode/plugins/maister-plugin.ts
```

## Build from Source

The `make opencode-build` command runs the `platforms/opencode/build.sh` script, which transforms the core Maister plugin into OpenCode-compatible artifacts. It produces:

- `platforms/opencode/output/commands/`: 8 command files (e.g., `work.md`, `quick-dev.md`).
- `platforms/opencode/output/agents/`: 24 agent definitions.
- `platforms/opencode/output/instructions/`: 14 instruction files (workflows).
- `platforms/opencode/output/agent-fragment.json`: Configuration fragment for agents.
- `platforms/opencode/output/mcp-fragment.json`: Configuration fragment for MCP servers.

## Installation (Per-Project)

To install Maister in your project, copy the built artifacts into your project's `.opencode/` directory:

```bash
mkdir -p .opencode/commands .opencode/agents .opencode/instructions .opencode/plugins

cp -r platforms/opencode/output/commands/* .opencode/commands/
cp -r platforms/opencode/output/agents/* .opencode/agents/
cp -r platforms/opencode/output/instructions/* .opencode/instructions/
```

Note: References in `agent-fragment.json` resolve relative to the project root, so paths like `.opencode/agents/...` are used.

## Configuration — Merging Fragments

You need to merge the generated fragments into your `opencode.json` configuration file.

### Merging Agent Fragment

If `opencode.json` already exists:

```bash
jq -s '.[0] * {"agent": (.[0].agent // {} + .[1])}' opencode.json platforms/opencode/output/agent-fragment.json > opencode.json.tmp && mv opencode.json.tmp opencode.json
```

If starting fresh:

```bash
cp platforms/opencode/output/agent-fragment.json opencode.json
```

### Merging MCP Fragment

Merge the MCP server configuration:

```bash
jq -s '.[0] * {"mcpServers": (.[0].mcpServers // {} + .[1])}' opencode.json platforms/opencode/output/mcp-fragment.json > opencode.json.tmp && mv opencode.json.tmp opencode.json
```

### Adding Instructions

Add the Maister instructions to the `"instructions"` array in `opencode.json`:

```json
{
"instructions": [
".opencode/instructions/maister-rules.md"
]
}
```

## Plugin Setup

OpenCode loads plugins as top-level `.opencode/plugins/*.ts` or `*.js` files.

```bash
# In your project root:
mkdir -p .opencode/plugins
cp platforms/opencode/output/plugins/maister-plugin.ts .opencode/plugins/maister-plugin.ts

# Install plugin dependency
cd .opencode
npm init -y 2>/dev/null || true
npm install @opencode-ai/plugin
cd ..
```

## Verify Installation

Confirm the setup by checking the file structure and running the validation command:

```bash
# From the Maister source directory:
make opencode-validate

# In your target project:
ls .opencode/commands/ # Should show 8 .md files
ls .opencode/agents/ # Should show 24 .md files
```

## Available Commands

Maister provides several entry points for different development tasks:

| Command | Description |
|---------|-------------|
| `work` | Unified entry point — auto-classifies tasks and routes to appropriate workflow. |
| `quick-dev` | Implement task directly with standards awareness (no planning mode). |
| `quick-plan` | Enter planning mode with standards awareness. |
| `quick-bugfix` | Quick TDD-driven bug fix — write failing test, fix, verify. |
| `reviews-code` | Run automated code quality, security, and performance analysis. |
| `reviews-pragmatic` | Run pragmatic code review to detect over-engineering. |
| `reviews-production-readiness` | Verify production deployment readiness with comprehensive checks. |
| `reviews-reality-check` | Comprehensive reality assessment of completed work. |
| `reviews-spec-audit` | Independent specification audit to verify completeness and clarity. |

## Differences from Claude Code Version

The OpenCode version of Maister has some differences due to platform variations:

- **Conversational Interaction**: There is no structured option selection (like `AskUserQuestion`). Instead, the AI asks questions conversationally.
- **Todo Management**: State tracking uses the `todo` tool rather than internal `TaskCreate`/`TaskUpdate` primitives.
- **Static Skills**: Skills are implemented as instruction files rather than dynamically invocable tools.
- **Step Limits**: The `steps` limit in agents may require more frequent manual intervention for very long orchestration workflows.
- **Command Syntax**: Use command names directly as slash commands (e.g., `/work` instead of `/maister:work`).
Loading