OpenWriterControle/.opencode/plugin
Darren Hinde d7a4cb8031
feat: Context path configuration and documentation reorganization (#143)
* feat: add npm package support for @openagents/control

- Convert package to publishable npm package with scoped name @openagents/control
- Add CLI entry point bin/oac.js for global installation
- Create .npmignore to exclude dev files and node_modules
- Configure package.json with proper files, bin, and metadata
- Add comprehensive NPM_PUBLISHING_GUIDE.md with publishing instructions
- Package size: 610KB (2.4MB unpacked) with 353 files
- Includes .opencode/tool/ directory without node_modules
- CLI command: oac (e.g., 'oac developer' or 'oac --help')

Users can install with: npm install -g @openagents/control

* chore: remove telegram bot files from package

- Delete .opencode/_lib/telegram-bot.ts (unused)
- Delete .opencode/plugin/telegram-notify.ts (depends on deleted file)
- Remove _lib directory reference from package.json files field
- Reduces package size from 610KB to 607KB
- Total files: 351 (down from 353)

* chore: remove all telegram references from registry and docs

- Remove telegram-bot and telegram-notify plugin entries from registry.json
- Remove telegram plugin references from all profiles (developer, business, full, advanced)
- Update profile-validation.md to remove telegram from business profile documentation
- Clean package with no telegram dependencies

* docs: enhance README clarity and add configuration examples

- Add Core Philosophy section with 4 key principles
- Add Quick Concepts for First-Time Users (scannable format)
- Add prominent Oh My OpenCode comparison link
- Add comprehensive Model Configuration section
- Add Customizing Agents section with practical examples
- Streamline model selection recommendations
- Add emoji headers for visual consistency
- Remove redundant FAQ entry

Addresses user feedback about documentation clarity and first-time user experience.

* refactor: remove OpenImplementer agent

- Delete OpenImplementer agent file (redundant with OpenAgent)
- Remove from registry.json and all profiles
- Update OpenCoder delegation rules (now handles 1-4 files directly)
- Clean up all context file references
- Remove from commands and documentation

Rationale: OpenImplementer only added 1 file to OpenAgent's capability (3→4 files), creating unnecessary complexity. OpenAgent and OpenCoder provide clearer separation: OpenAgent for general + focused tasks (1-4 files), OpenCoder for complex architecture (4+ files).

* fix: remove stale OpenImplementer reference from OpenCoder

- Remove OpenImplementer from Available Subagents list
- Clarify CoderAgent is used via TaskManager for complex tasks
- Keep delegation rules as-is (execute 1-4 files directly, delegate complex to CoderAgent)

* docs: remove remaining OpenImplementer references

- Update developer profile description (OpenAgent vs OpenCoder)
- Update registry.json profile description
- Update docs/README.md to remove OpenImplementer
- Update CHANGELOG.md to reflect simplified architecture

All OpenImplementer references now removed. Registry validation passes.

* docs: enhance README with first-time user improvements

- Add 'your secret weapon!' to Context System in Quick Concepts
- Add First-Time User Checklist after Get Started section
- Add visual comparison table for AOC vs Oh My OpenCode in FAQ
- Improve scannability and clarity for new users

Based on DocWriter review recommendations.

* docs: clarify project-context.md is created during installation

Minor enhancement to First-Time User Checklist step 2 for extra clarity.

* docs: change 'I' to 'we' for collaborative tone

- Update 'Why I Built This' to 'Why We Built This'
- Change 'I've spent' to 'We've spent'
- Change 'I use this' to 'We use this'
- Makes the project feel more collaborative and team-oriented

* docs: make intro more neutral and objective

- Change 'Why We Built This' to 'Why This Exists'
- Remove personal perspective ('We've spent 14+ years')
- Change 'We use this' to 'It's built for shipping'
- More professional and objective tone

* docs: major README rewrite based on user feedback

Key improvements based on real user confusion:

1. **Clear 'What Is AOC?' section** - Explains scaffold vs plugin approach upfront
2. **Model configuration prominently featured** - Addresses #1 user question
3. **Hook with quantified paradox** - Grabs attention in 15 seconds
4. **Context System promoted** - Moved to top, explains the differentiator
5. **Comparison table** - AOC vs Oh My OpenCode side-by-side
6. **Eliminated 60% redundancy** - Merged overlapping sections
7. **Simplified deep dives** - Model config and customization tightened

Based on user feedback: 'I just expected that behaviour because it was not
documented properly... the only thing really lacking was a clear explanation
of its purpose and how to configure models and adjust agents.'

Addresses: Confusion about scaffold vs plugin, model configuration, and
first-time user expectations.

* chore: publish package as @nextsystems/oac v0.7.0

- Changed package name from @openagents/control to @nextsystems/oac
- Successfully published to npm registry
- Users can install with: npm install -g @nextsystems/oac
- CLI command: oac

* feat: add context path configuration and reorganize documentation

- Add configurable context root via paths.json (@reference support)
- Add /add-context command for interactive context setup
- Move NPM_PUBLISHING_GUIDE.md to context system (guides/npm-publishing.md)
- Add GitHub issues workflow guide
- Update agents to support custom context directories
- Update navigation with new guides and file counts

This enables projects to use custom context directories (e.g., .context, .ai/context)
while maintaining backward compatibility with default .opencode/context/ structure.
2026-01-30 17:18:05 +00:00
..
docs chore: update agent workflows and task management (#86) 2026-01-11 20:22:51 +00:00
tests/validator chore: consolidate development changes and refactor agent system 2025-11-21 13:30:18 +00:00
.gitignore Update README.md to enhance project description, add features, quick start guide, agent and plugin details, configuration instructions, and safety/security practices. 2025-08-15 01:43:56 +01:00
agent-validator.ts chore: consolidate development changes and refactor agent system 2025-11-21 13:30:18 +00:00
agent-validator.ts.disabled chore: update agent workflows and task management (#86) 2026-01-11 20:22:51 +00:00
bun.lock chore: consolidate development changes and refactor agent system 2025-11-21 13:30:18 +00:00
notify.ts chore: consolidate development changes and refactor agent system 2025-11-21 13:30:18 +00:00
package.json chore: consolidate development changes and refactor agent system 2025-11-21 13:30:18 +00:00
README.md chore: consolidate development changes and refactor agent system 2025-11-21 13:30:18 +00:00
tsconfig.json chore: consolidate development changes and refactor agent system 2025-11-21 13:30:18 +00:00

Agent Validator Plugin

Validates that OpenAgent follows its defined prompt rules and execution patterns.

Features

  • ✅ Tracks tool usage in real-time
  • ✅ Validates approval gate enforcement
  • ✅ Checks lazy context loading
  • ✅ Analyzes delegation decisions (4+ file rule)
  • ✅ Detects critical rule violations (auto-fix attempts)

Available Tools

validate_session

Validate the current agent session against defined rules.

validate_session

Options:

  • include_details (boolean, optional) - Include detailed evidence for each check

Returns: Validation report with compliance score


check_approval_gates

Check if approval gates were properly enforced before execution operations.

check_approval_gates

Returns: Approval gate compliance status


export_validation_report

Export a comprehensive validation report to a markdown file.

export_validation_report

Options:

  • output_path (string, optional) - Path to save the report (defaults to .tmp/validation-{sessionID}.md)

Returns: Path to exported report + summary


analyze_delegation

Analyze whether delegation decisions followed the 4+ file rule.

analyze_delegation

Returns: Delegation analysis with file count statistics


Validation Rules

The plugin checks for:

  1. approval_gate_enforcement - Did agent request approval before bash/write/edit/task?
  2. stop_on_failure - Did agent stop on errors or try to auto-fix?
  3. lazy_context_loading - Did agent only load context files when needed?
  4. delegation_appropriateness - Did agent delegate when 4+ files involved?
  5. tool_usage - Track all tool calls for analysis

Usage Examples

Basic Validation

You: "Create a new API endpoint"
[Agent works on task]
You: "validate_session"

Check Approval Compliance

You: "Run the tests"
Agent: "Approval needed before proceeding."
You: "Approved. Also check_approval_gates"

Export Report

You: "We just finished refactoring. Export validation report"
Agent: [Exports to .tmp/validation-{id}.md]

Installation

The plugin auto-loads from .opencode/plugins/ when OpenCode starts.

Install dependencies:

cd .opencode/plugins
npm install
# or
bun install

How It Works

  1. Event Tracking - Hooks into OpenCode SDK events:

    • session.message.created
    • tool.execute.before
    • tool.execute.after
  2. Behavior Analysis - Analyzes messages for:

    • Tool invocations
    • Approval language
    • Context file reads
    • Delegation patterns
  3. Validation - Compares actual behavior against OpenAgent rules

  4. Reporting - Generates compliance reports with scores and evidence

Compliance Scoring

  • 100% - Perfect compliance
  • 90-99% - Excellent (minor warnings)
  • 80-89% - Good (some warnings)
  • 70-79% - Fair (multiple warnings)
  • <70% - Needs improvement (errors or many warnings)

Troubleshooting

"No execution operations tracked"

  • Plugin just loaded, no prior tracking
  • Run a task first, then validate

"Error fetching session"

  • Check OpenCode SDK connection
  • Verify session ID is valid

False positives on approval gates

  • Agent may use different approval phrasing
  • Check approvalKeywords in plugin code
  • Add custom patterns if needed

Customization

Edit agent-validator.ts to:

  • Add custom validation rules
  • Modify approval detection patterns
  • Adjust delegation thresholds
  • Change severity levels

Next Steps

  1. Test with simple sessions
  2. Identify false positives/negatives
  3. Refine validation logic
  4. Add project-specific rules
  5. Integrate into OpenAgent workflow