Skip to content

feat: finalize opencode integration unit#164

Merged
jayfalls merged 32 commits intomainfrom
refact/switch-to-opencode
Mar 16, 2026
Merged

feat: finalize opencode integration unit#164
jayfalls merged 32 commits intomainfrom
refact/switch-to-opencode

Conversation

@jayfalls
Copy link
Copy Markdown
Owner

@jayfalls jayfalls commented Mar 16, 2026

Summary

This PR finalizes the OpenCode integration - a complete overhaul of how development agents work in the ACE Framework.

New Agent System

  • Created .opencode/agents/ directory with 13 agent files:
    • orchestrator.md (primary agent)
    • planning-discovery.md, planning-document.md, planning-requirements.md
    • research.md, architecture.md, implementation.md, testing.md
    • design.md, backend.md, frontend.md
    • review.md, tester.md, qa.md

Reference Agent Updates

  • backend.md: Backend Architect
  • frontend.md: Frontend Developer
  • architecture.md: Software Architect + Database Optimizer
  • implementation.md: Senior Developer + SRE + Security Engineer

Orchestrator Features

  • Clear discovery flow (show FULL verbatim responses)
  • Always reuse task_id for same agent
  • QA after EVERY subagent (except discovery)
  • Files affected reporting required
  • Template-to-agent mapping
  • Never proceed without user approval

Skill System

  • Replaced agency-specialisation, unit-workflow, verify skills with unified unit-planning skill
  • Added unit-templates directory with all 15 template files
  • Document sequence now in skill

Memory System

  • Added .agents/memory/short-term/ for unit-specific state
  • Added .agents/memory/long-term.json for persistent learnings

Dev Infrastructure

  • Added .dev/distrobox-setup.sh - development environment setup
  • Added .dev/pre-commit.sh - pre-commit quality gates
  • Added .github/workflows/opencode.yml - GitHub workflow

Backend Fixes

  • Messaging: Fixed stream handling, subjects, errors
  • Telemetry: Fixed logger, metrics, middleware

Removed

  • Removed .openhands/ directory (replaced by opencode)

Files Changed: 74 files

See git diff for full details

Changelog

  • Added 2026-03-16.md with change details

jayfalls added 29 commits March 15, 2026 18:43
[unit: opencode-integration]

- Add per-unit short-term memory in .agents/memory/short-term/
- Split planning into bespoke agents (discovery, requirements)
- Add all sub-agents with agency-agents references
- Add QA agent for quality checks after each subagent
- Update memory encoding (episodic/semantic)
- Add unit reference guidance for GitHub PRs/issues
- Pre-commit now stages changes after go fmt and eslint --fix
- All integration tests pass with Go 1.26
- Updated distrobox-setup.sh for proper Go 1.26, docker-compose
- go fmt applied to backend files

[unit: opencode-integration]
- Added get_go() helper to find Go 1.26
- All go commands now use
- Removed -v from go test to reduce noise

[unit: opencode-integration]
- Added 100ms sleep after subscriptions are created
- Tests were failing due to race condition (subscriber not ready)
- Added -p 1 -count=1 to run tests sequentially without caching

[unit: opencode-integration]
- Discovery now runs before any new document (not just once)
- No QA required for discovery agent
- Dynamic questions loop until fully understood
- Prior documents used as context to avoid repeat questions
- Orchestrator updated to reflect special discovery handling

[unit: opencode-integration]
- planning-discovery: Only asks questions in a loop, NO documents
- planning-document: NEW agent that creates problem_space.md and bsd.md
- Orchestrator updated: discovery -> document -> QA flow

[unit: opencode-integration]
- Discovery: manual conversation until user says done
- Other agents: task tool blocks until complete, full output returned
- QA runs immediately after task tool completes
- Use task_id to resume for fixes

[unit: opencode-integration]
- Created .opencode/agents/planning-document.md (proper subagent)
- Orchestrator: handle early subagent returns via task_id
- Orchestrator: always resume rather than ask user
- Orchestrator: NEVER use general agent type

[unit: opencode-integration]
…test unit

- Updated all document agents: planning-document, planning-requirements, research, architecture, implementation, testing
- Each now has: ONE DOCUMENT PER PR guidance
- Deleted fun unit test files
- Updated memory to reflect fun unit removal

[unit: opencode-integration]
- Rule now in AGENTS.md (applies to all agents)
- Orchestrator updated to enforce one document per PR
- Removed duplicates from individual agent files
- Rule: spawn agent multiple times for multiple docs

[unit: opencode-integration]
- Added: read existing documents in unit directory for context
- Added: clarify one document per session (orchestrator spawns twice)
- Added: guidance on handling existing documents

[unit: opencode-integration]
- All agents: read existing documents in unit for context
- All agents: clarify one document per session
- All agents: guidance on handling existing documents
- Applies to: research, architecture, implementation, testing

[unit: opencode-integration]
- Discovery questions go to user verbatim
- User answers go to discovery verbatim
- Orchestrator never skips any discovery responses
- Re-use same task_id for same discovery session

[unit: opencode-integration]
- SKILL.md now defines explicit document sequence
- Removed redundant sequence info from planning-document agent
- Templates define structure and order

[unit: opencode-integration]
…s from all sub agents

- These are handled by orchestrator or skill
- Source of truth is unit-planning skill

[unit: opencode-integration]
- Added design.md agent for visual design and mockups
- Updated reference agents:
  - backend.md: Backend Architect
  - frontend.md: Frontend Developer
  - architecture.md: Added Database Optimizer
  - implementation.md: Added SRE and Security Engineer
- Updated tester.md to run ALL tests (backend, frontend, make)
- Updated qa.md to remove subjective language
- Updated orchestrator.md with:
  - Clear discovery flow (show FULL verbatim responses)
  - Always reuse task_id
  - QA after EVERY subagent (except discovery)
  - Files affected reporting
  - Template-to-agent mapping
  - general agent for small tasks
- Updated AGENTS.md with General Principles
- Added gh to distrobox-setup.sh
@jayfalls
Copy link
Copy Markdown
Owner Author

/oc review this

@jayfalls
Copy link
Copy Markdown
Owner Author

@oc review this

@jayfalls
Copy link
Copy Markdown
Owner Author

/opencode review this

@jayfalls
Copy link
Copy Markdown
Owner Author

@OpenCode review this

- Removed documentation section from AGENTS.md
- Added to orchestrator with unit completion guidance
- Added reminder to update design/README.md when unit is complete
@jayfalls jayfalls merged commit 2d4430a into main Mar 16, 2026
@jayfalls jayfalls deleted the refact/switch-to-opencode branch March 16, 2026 18:18
@oc
Copy link
Copy Markdown

oc commented Mar 18, 2026

I don't think oc nor OpenCode wants to review this - way too big a delta. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants