aidevops 2.52.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.
- package/.agent/AGENTS.md +614 -0
- package/.agent/accounts.md +65 -0
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +456 -0
- package/.agent/aidevops/api-integrations.md +335 -0
- package/.agent/aidevops/architecture.md +510 -0
- package/.agent/aidevops/configs.md +274 -0
- package/.agent/aidevops/docs.md +244 -0
- package/.agent/aidevops/extension.md +311 -0
- package/.agent/aidevops/mcp-integrations.md +340 -0
- package/.agent/aidevops/mcp-troubleshooting.md +162 -0
- package/.agent/aidevops/memory-patterns.md +172 -0
- package/.agent/aidevops/providers.md +217 -0
- package/.agent/aidevops/recommendations.md +321 -0
- package/.agent/aidevops/requirements.md +301 -0
- package/.agent/aidevops/resources.md +214 -0
- package/.agent/aidevops/security-requirements.md +174 -0
- package/.agent/aidevops/security.md +350 -0
- package/.agent/aidevops/service-links.md +400 -0
- package/.agent/aidevops/services.md +357 -0
- package/.agent/aidevops/setup.md +153 -0
- package/.agent/aidevops/troubleshooting.md +389 -0
- package/.agent/aidevops.md +124 -0
- package/.agent/build-plus.md +244 -0
- package/.agent/content/guidelines.md +109 -0
- package/.agent/content.md +87 -0
- package/.agent/health.md +59 -0
- package/.agent/legal.md +59 -0
- package/.agent/loop-state/full-loop.local.md +16 -0
- package/.agent/loop-state/ralph-loop.local.md +10 -0
- package/.agent/marketing.md +440 -0
- package/.agent/memory/README.md +260 -0
- package/.agent/onboarding.md +796 -0
- package/.agent/plan-plus.md +245 -0
- package/.agent/research.md +100 -0
- package/.agent/sales.md +333 -0
- package/.agent/scripts/101domains-helper.sh +701 -0
- package/.agent/scripts/add-missing-returns.sh +140 -0
- package/.agent/scripts/agent-browser-helper.sh +311 -0
- package/.agent/scripts/agno-setup.sh +712 -0
- package/.agent/scripts/ahrefs-mcp-wrapper.js +168 -0
- package/.agent/scripts/aidevops-update-check.sh +71 -0
- package/.agent/scripts/ampcode-cli.sh +522 -0
- package/.agent/scripts/auto-version-bump.sh +156 -0
- package/.agent/scripts/autogen-helper.sh +512 -0
- package/.agent/scripts/beads-sync-helper.sh +596 -0
- package/.agent/scripts/closte-helper.sh +5 -0
- package/.agent/scripts/cloudron-helper.sh +321 -0
- package/.agent/scripts/codacy-cli-chunked.sh +581 -0
- package/.agent/scripts/codacy-cli.sh +442 -0
- package/.agent/scripts/code-audit-helper.sh +5 -0
- package/.agent/scripts/coderabbit-cli.sh +417 -0
- package/.agent/scripts/coderabbit-pro-analysis.sh +238 -0
- package/.agent/scripts/commands/code-simplifier.md +86 -0
- package/.agent/scripts/commands/full-loop.md +246 -0
- package/.agent/scripts/commands/postflight-loop.md +103 -0
- package/.agent/scripts/commands/recall.md +182 -0
- package/.agent/scripts/commands/remember.md +132 -0
- package/.agent/scripts/commands/save-todo.md +175 -0
- package/.agent/scripts/commands/session-review.md +154 -0
- package/.agent/scripts/comprehensive-quality-fix.sh +106 -0
- package/.agent/scripts/context-builder-helper.sh +522 -0
- package/.agent/scripts/coolify-cli-helper.sh +674 -0
- package/.agent/scripts/coolify-helper.sh +380 -0
- package/.agent/scripts/crawl4ai-examples.sh +401 -0
- package/.agent/scripts/crawl4ai-helper.sh +1078 -0
- package/.agent/scripts/crewai-helper.sh +681 -0
- package/.agent/scripts/dev-browser-helper.sh +513 -0
- package/.agent/scripts/dns-helper.sh +396 -0
- package/.agent/scripts/domain-research-helper.sh +917 -0
- package/.agent/scripts/dspy-helper.sh +285 -0
- package/.agent/scripts/dspyground-helper.sh +291 -0
- package/.agent/scripts/eeat-score-helper.sh +1242 -0
- package/.agent/scripts/efficient-return-fix.sh +92 -0
- package/.agent/scripts/extract-opencode-prompts.sh +128 -0
- package/.agent/scripts/find-missing-returns.sh +113 -0
- package/.agent/scripts/fix-auth-headers.sh +104 -0
- package/.agent/scripts/fix-common-strings.sh +254 -0
- package/.agent/scripts/fix-content-type.sh +100 -0
- package/.agent/scripts/fix-error-messages.sh +130 -0
- package/.agent/scripts/fix-misplaced-returns.sh +74 -0
- package/.agent/scripts/fix-remaining-literals.sh +152 -0
- package/.agent/scripts/fix-return-statements.sh +41 -0
- package/.agent/scripts/fix-s131-default-cases.sh +249 -0
- package/.agent/scripts/fix-sc2155-simple.sh +102 -0
- package/.agent/scripts/fix-shellcheck-critical.sh +187 -0
- package/.agent/scripts/fix-string-literals.sh +273 -0
- package/.agent/scripts/full-loop-helper.sh +773 -0
- package/.agent/scripts/generate-opencode-agents.sh +497 -0
- package/.agent/scripts/generate-opencode-commands.sh +1629 -0
- package/.agent/scripts/generate-skills.sh +366 -0
- package/.agent/scripts/git-platforms-helper.sh +640 -0
- package/.agent/scripts/gitea-cli-helper.sh +743 -0
- package/.agent/scripts/github-cli-helper.sh +702 -0
- package/.agent/scripts/gitlab-cli-helper.sh +682 -0
- package/.agent/scripts/gsc-add-user-helper.sh +325 -0
- package/.agent/scripts/gsc-sitemap-helper.sh +678 -0
- package/.agent/scripts/hetzner-helper.sh +485 -0
- package/.agent/scripts/hostinger-helper.sh +229 -0
- package/.agent/scripts/keyword-research-helper.sh +1815 -0
- package/.agent/scripts/langflow-helper.sh +544 -0
- package/.agent/scripts/linkedin-automation.py +241 -0
- package/.agent/scripts/linter-manager.sh +599 -0
- package/.agent/scripts/linters-local.sh +434 -0
- package/.agent/scripts/list-keys-helper.sh +488 -0
- package/.agent/scripts/local-browser-automation.py +339 -0
- package/.agent/scripts/localhost-helper.sh +744 -0
- package/.agent/scripts/loop-common.sh +806 -0
- package/.agent/scripts/mainwp-helper.sh +728 -0
- package/.agent/scripts/markdown-formatter.sh +338 -0
- package/.agent/scripts/markdown-lint-fix.sh +311 -0
- package/.agent/scripts/mass-fix-returns.sh +58 -0
- package/.agent/scripts/mcp-diagnose.sh +167 -0
- package/.agent/scripts/mcp-inspector-helper.sh +449 -0
- package/.agent/scripts/memory-helper.sh +650 -0
- package/.agent/scripts/monitor-code-review.sh +255 -0
- package/.agent/scripts/onboarding-helper.sh +706 -0
- package/.agent/scripts/opencode-github-setup-helper.sh +797 -0
- package/.agent/scripts/opencode-test-helper.sh +213 -0
- package/.agent/scripts/pagespeed-helper.sh +464 -0
- package/.agent/scripts/pandoc-helper.sh +362 -0
- package/.agent/scripts/postflight-check.sh +555 -0
- package/.agent/scripts/pre-commit-hook.sh +259 -0
- package/.agent/scripts/pre-edit-check.sh +169 -0
- package/.agent/scripts/qlty-cli.sh +356 -0
- package/.agent/scripts/quality-cli-manager.sh +525 -0
- package/.agent/scripts/quality-feedback-helper.sh +462 -0
- package/.agent/scripts/quality-fix.sh +263 -0
- package/.agent/scripts/quality-loop-helper.sh +1108 -0
- package/.agent/scripts/ralph-loop-helper.sh +836 -0
- package/.agent/scripts/ralph-upstream-check.sh +341 -0
- package/.agent/scripts/secretlint-helper.sh +847 -0
- package/.agent/scripts/servers-helper.sh +241 -0
- package/.agent/scripts/ses-helper.sh +619 -0
- package/.agent/scripts/session-review-helper.sh +404 -0
- package/.agent/scripts/setup-linters-wizard.sh +379 -0
- package/.agent/scripts/setup-local-api-keys.sh +330 -0
- package/.agent/scripts/setup-mcp-integrations.sh +472 -0
- package/.agent/scripts/shared-constants.sh +246 -0
- package/.agent/scripts/site-crawler-helper.sh +1487 -0
- package/.agent/scripts/snyk-helper.sh +940 -0
- package/.agent/scripts/sonarcloud-autofix.sh +193 -0
- package/.agent/scripts/sonarcloud-cli.sh +191 -0
- package/.agent/scripts/sonarscanner-cli.sh +455 -0
- package/.agent/scripts/spaceship-helper.sh +747 -0
- package/.agent/scripts/stagehand-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-setup.sh +441 -0
- package/.agent/scripts/stagehand-setup.sh +439 -0
- package/.agent/scripts/system-cleanup.sh +340 -0
- package/.agent/scripts/terminal-title-helper.sh +388 -0
- package/.agent/scripts/terminal-title-setup.sh +549 -0
- package/.agent/scripts/test-stagehand-both-integration.sh +317 -0
- package/.agent/scripts/test-stagehand-integration.sh +309 -0
- package/.agent/scripts/test-stagehand-python-integration.sh +341 -0
- package/.agent/scripts/todo-ready.sh +263 -0
- package/.agent/scripts/tool-version-check.sh +362 -0
- package/.agent/scripts/toon-helper.sh +469 -0
- package/.agent/scripts/twilio-helper.sh +917 -0
- package/.agent/scripts/updown-helper.sh +279 -0
- package/.agent/scripts/validate-mcp-integrations.sh +250 -0
- package/.agent/scripts/validate-version-consistency.sh +131 -0
- package/.agent/scripts/vaultwarden-helper.sh +597 -0
- package/.agent/scripts/vercel-cli-helper.sh +816 -0
- package/.agent/scripts/verify-mirrors.sh +169 -0
- package/.agent/scripts/version-manager.sh +831 -0
- package/.agent/scripts/webhosting-helper.sh +471 -0
- package/.agent/scripts/webhosting-verify.sh +238 -0
- package/.agent/scripts/wordpress-mcp-helper.sh +508 -0
- package/.agent/scripts/worktree-helper.sh +595 -0
- package/.agent/scripts/worktree-sessions.sh +577 -0
- package/.agent/seo/dataforseo.md +215 -0
- package/.agent/seo/domain-research.md +532 -0
- package/.agent/seo/eeat-score.md +659 -0
- package/.agent/seo/google-search-console.md +366 -0
- package/.agent/seo/gsc-sitemaps.md +282 -0
- package/.agent/seo/keyword-research.md +521 -0
- package/.agent/seo/serper.md +278 -0
- package/.agent/seo/site-crawler.md +387 -0
- package/.agent/seo.md +236 -0
- package/.agent/services/accounting/quickfile.md +159 -0
- package/.agent/services/communications/telfon.md +470 -0
- package/.agent/services/communications/twilio.md +569 -0
- package/.agent/services/crm/fluentcrm.md +449 -0
- package/.agent/services/email/ses.md +399 -0
- package/.agent/services/hosting/101domains.md +378 -0
- package/.agent/services/hosting/closte.md +177 -0
- package/.agent/services/hosting/cloudflare.md +251 -0
- package/.agent/services/hosting/cloudron.md +478 -0
- package/.agent/services/hosting/dns-providers.md +335 -0
- package/.agent/services/hosting/domain-purchasing.md +344 -0
- package/.agent/services/hosting/hetzner.md +327 -0
- package/.agent/services/hosting/hostinger.md +287 -0
- package/.agent/services/hosting/localhost.md +419 -0
- package/.agent/services/hosting/spaceship.md +353 -0
- package/.agent/services/hosting/webhosting.md +330 -0
- package/.agent/social-media.md +69 -0
- package/.agent/templates/plans-template.md +114 -0
- package/.agent/templates/prd-template.md +129 -0
- package/.agent/templates/tasks-template.md +108 -0
- package/.agent/templates/todo-template.md +89 -0
- package/.agent/tools/ai-assistants/agno.md +471 -0
- package/.agent/tools/ai-assistants/capsolver.md +326 -0
- package/.agent/tools/ai-assistants/configuration.md +221 -0
- package/.agent/tools/ai-assistants/overview.md +209 -0
- package/.agent/tools/ai-assistants/status.md +171 -0
- package/.agent/tools/ai-assistants/windsurf.md +193 -0
- package/.agent/tools/ai-orchestration/autogen.md +406 -0
- package/.agent/tools/ai-orchestration/crewai.md +445 -0
- package/.agent/tools/ai-orchestration/langflow.md +405 -0
- package/.agent/tools/ai-orchestration/openprose.md +487 -0
- package/.agent/tools/ai-orchestration/overview.md +362 -0
- package/.agent/tools/ai-orchestration/packaging.md +647 -0
- package/.agent/tools/browser/agent-browser.md +464 -0
- package/.agent/tools/browser/browser-automation.md +400 -0
- package/.agent/tools/browser/chrome-devtools.md +282 -0
- package/.agent/tools/browser/crawl4ai-integration.md +422 -0
- package/.agent/tools/browser/crawl4ai-resources.md +277 -0
- package/.agent/tools/browser/crawl4ai-usage.md +416 -0
- package/.agent/tools/browser/crawl4ai.md +585 -0
- package/.agent/tools/browser/dev-browser.md +341 -0
- package/.agent/tools/browser/pagespeed.md +260 -0
- package/.agent/tools/browser/playwright.md +266 -0
- package/.agent/tools/browser/playwriter.md +310 -0
- package/.agent/tools/browser/stagehand-examples.md +456 -0
- package/.agent/tools/browser/stagehand-python.md +483 -0
- package/.agent/tools/browser/stagehand.md +421 -0
- package/.agent/tools/build-agent/agent-review.md +224 -0
- package/.agent/tools/build-agent/build-agent.md +784 -0
- package/.agent/tools/build-mcp/aidevops-plugin.md +476 -0
- package/.agent/tools/build-mcp/api-wrapper.md +445 -0
- package/.agent/tools/build-mcp/build-mcp.md +240 -0
- package/.agent/tools/build-mcp/deployment.md +401 -0
- package/.agent/tools/build-mcp/server-patterns.md +632 -0
- package/.agent/tools/build-mcp/transports.md +366 -0
- package/.agent/tools/code-review/auditing.md +383 -0
- package/.agent/tools/code-review/automation.md +219 -0
- package/.agent/tools/code-review/best-practices.md +203 -0
- package/.agent/tools/code-review/codacy.md +151 -0
- package/.agent/tools/code-review/code-simplifier.md +174 -0
- package/.agent/tools/code-review/code-standards.md +309 -0
- package/.agent/tools/code-review/coderabbit.md +101 -0
- package/.agent/tools/code-review/management.md +155 -0
- package/.agent/tools/code-review/qlty.md +248 -0
- package/.agent/tools/code-review/secretlint.md +565 -0
- package/.agent/tools/code-review/setup.md +250 -0
- package/.agent/tools/code-review/snyk.md +563 -0
- package/.agent/tools/code-review/tools.md +230 -0
- package/.agent/tools/content/summarize.md +353 -0
- package/.agent/tools/context/augment-context-engine.md +468 -0
- package/.agent/tools/context/context-builder-agent.md +76 -0
- package/.agent/tools/context/context-builder.md +375 -0
- package/.agent/tools/context/context7.md +371 -0
- package/.agent/tools/context/dspy.md +302 -0
- package/.agent/tools/context/dspyground.md +374 -0
- package/.agent/tools/context/llm-tldr.md +219 -0
- package/.agent/tools/context/osgrep.md +488 -0
- package/.agent/tools/context/prompt-optimization.md +338 -0
- package/.agent/tools/context/toon.md +292 -0
- package/.agent/tools/conversion/pandoc.md +304 -0
- package/.agent/tools/credentials/api-key-management.md +154 -0
- package/.agent/tools/credentials/api-key-setup.md +224 -0
- package/.agent/tools/credentials/environment-variables.md +180 -0
- package/.agent/tools/credentials/vaultwarden.md +382 -0
- package/.agent/tools/data-extraction/outscraper.md +974 -0
- package/.agent/tools/deployment/coolify-cli.md +388 -0
- package/.agent/tools/deployment/coolify-setup.md +353 -0
- package/.agent/tools/deployment/coolify.md +345 -0
- package/.agent/tools/deployment/vercel.md +390 -0
- package/.agent/tools/git/authentication.md +132 -0
- package/.agent/tools/git/gitea-cli.md +193 -0
- package/.agent/tools/git/github-actions.md +207 -0
- package/.agent/tools/git/github-cli.md +223 -0
- package/.agent/tools/git/gitlab-cli.md +190 -0
- package/.agent/tools/git/opencode-github-security.md +350 -0
- package/.agent/tools/git/opencode-github.md +328 -0
- package/.agent/tools/git/opencode-gitlab.md +252 -0
- package/.agent/tools/git/security.md +196 -0
- package/.agent/tools/git.md +207 -0
- package/.agent/tools/opencode/oh-my-opencode.md +375 -0
- package/.agent/tools/opencode/opencode-anthropic-auth.md +446 -0
- package/.agent/tools/opencode/opencode.md +651 -0
- package/.agent/tools/social-media/bird.md +437 -0
- package/.agent/tools/task-management/beads.md +336 -0
- package/.agent/tools/terminal/terminal-title.md +251 -0
- package/.agent/tools/ui/shadcn.md +196 -0
- package/.agent/tools/ui/ui-skills.md +115 -0
- package/.agent/tools/wordpress/localwp.md +311 -0
- package/.agent/tools/wordpress/mainwp.md +391 -0
- package/.agent/tools/wordpress/scf.md +527 -0
- package/.agent/tools/wordpress/wp-admin.md +729 -0
- package/.agent/tools/wordpress/wp-dev.md +940 -0
- package/.agent/tools/wordpress/wp-preferred.md +398 -0
- package/.agent/tools/wordpress.md +95 -0
- package/.agent/workflows/branch/bugfix.md +63 -0
- package/.agent/workflows/branch/chore.md +95 -0
- package/.agent/workflows/branch/experiment.md +115 -0
- package/.agent/workflows/branch/feature.md +59 -0
- package/.agent/workflows/branch/hotfix.md +98 -0
- package/.agent/workflows/branch/refactor.md +92 -0
- package/.agent/workflows/branch/release.md +96 -0
- package/.agent/workflows/branch.md +347 -0
- package/.agent/workflows/bug-fixing.md +267 -0
- package/.agent/workflows/changelog.md +129 -0
- package/.agent/workflows/code-audit-remote.md +279 -0
- package/.agent/workflows/conversation-starter.md +69 -0
- package/.agent/workflows/error-feedback.md +578 -0
- package/.agent/workflows/feature-development.md +355 -0
- package/.agent/workflows/git-workflow.md +702 -0
- package/.agent/workflows/multi-repo-workspace.md +268 -0
- package/.agent/workflows/plans.md +709 -0
- package/.agent/workflows/postflight.md +604 -0
- package/.agent/workflows/pr.md +571 -0
- package/.agent/workflows/preflight.md +278 -0
- package/.agent/workflows/ralph-loop.md +773 -0
- package/.agent/workflows/release.md +498 -0
- package/.agent/workflows/session-manager.md +254 -0
- package/.agent/workflows/session-review.md +311 -0
- package/.agent/workflows/sql-migrations.md +631 -0
- package/.agent/workflows/version-bump.md +283 -0
- package/.agent/workflows/wiki-update.md +333 -0
- package/.agent/workflows/worktree.md +477 -0
- package/LICENSE +21 -0
- package/README.md +1446 -0
- package/VERSION +1 -0
- package/aidevops.sh +1746 -0
- package/bin/aidevops +21 -0
- package/package.json +75 -0
- package/scripts/npm-postinstall.js +60 -0
- package/setup.sh +2366 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architecture design for aidevops-opencode plugin
|
|
3
|
+
mode: subagent
|
|
4
|
+
tools:
|
|
5
|
+
read: true
|
|
6
|
+
write: true
|
|
7
|
+
edit: true
|
|
8
|
+
bash: true
|
|
9
|
+
glob: true
|
|
10
|
+
grep: true
|
|
11
|
+
webfetch: true
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# aidevops-opencode Plugin Architecture
|
|
15
|
+
|
|
16
|
+
<!-- AI-CONTEXT-START -->
|
|
17
|
+
|
|
18
|
+
## Quick Reference
|
|
19
|
+
|
|
20
|
+
- **Status**: Design phase (not yet implemented)
|
|
21
|
+
- **Purpose**: Native OpenCode plugin wrapper for aidevops
|
|
22
|
+
- **Approach**: Thin wrapper that loads existing aidevops agents/MCPs
|
|
23
|
+
- **Compatibility**: Works alongside oh-my-opencode
|
|
24
|
+
|
|
25
|
+
**Key Decision**: aidevops remains a multi-tool framework (Claude, Cursor, etc.)
|
|
26
|
+
The plugin is an optional enhancement for OpenCode users.
|
|
27
|
+
|
|
28
|
+
<!-- AI-CONTEXT-END -->
|
|
29
|
+
|
|
30
|
+
## Overview
|
|
31
|
+
|
|
32
|
+
This document outlines the architecture for an optional `aidevops-opencode` plugin that would provide native OpenCode integration for the aidevops framework.
|
|
33
|
+
|
|
34
|
+
### Current State
|
|
35
|
+
|
|
36
|
+
aidevops currently integrates with OpenCode via:
|
|
37
|
+
|
|
38
|
+
1. **Markdown agents** deployed to `~/.config/opencode/agent/`
|
|
39
|
+
2. **JSON MCP configs** in `~/.config/opencode/opencode.json`
|
|
40
|
+
3. **Slash commands** in `~/.config/opencode/commands/`
|
|
41
|
+
4. **Shell scripts** for helper operations
|
|
42
|
+
|
|
43
|
+
### Proposed Plugin Benefits
|
|
44
|
+
|
|
45
|
+
| Benefit | Description |
|
|
46
|
+
|---------|-------------|
|
|
47
|
+
| **Cleaner Installation** | `npm install aidevops-opencode` vs running setup.sh |
|
|
48
|
+
| **Lifecycle Hooks** | Pre-commit quality checks, auto-formatting |
|
|
49
|
+
| **Dynamic Agent Loading** | Load agents from `~/.aidevops/agents/` at runtime |
|
|
50
|
+
| **MCP Registration** | Register aidevops MCPs programmatically |
|
|
51
|
+
| **Version Management** | Automatic updates via npm |
|
|
52
|
+
|
|
53
|
+
## Architecture Design
|
|
54
|
+
|
|
55
|
+
### Plugin Structure
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
aidevops-opencode/
|
|
59
|
+
├── src/
|
|
60
|
+
│ ├── index.ts # Main plugin entry
|
|
61
|
+
│ ├── agents/
|
|
62
|
+
│ │ ├── loader.ts # Load agents from ~/.aidevops/agents/
|
|
63
|
+
│ │ └── registry.ts # Register agents with OpenCode
|
|
64
|
+
│ ├── mcps/
|
|
65
|
+
│ │ ├── loader.ts # Load MCP configs
|
|
66
|
+
│ │ └── registry.ts # Register MCPs with OpenCode
|
|
67
|
+
│ ├── hooks/
|
|
68
|
+
│ │ ├── pre-commit.ts # Quality checks before commit
|
|
69
|
+
│ │ ├── post-tool-use.ts # After tool execution
|
|
70
|
+
│ │ └── user-prompt.ts # Prompt preprocessing
|
|
71
|
+
│ ├── tools/
|
|
72
|
+
│ │ └── aidevops-cli.ts # Expose aidevops CLI as tool
|
|
73
|
+
│ └── config/
|
|
74
|
+
│ ├── schema.ts # Zod config schema
|
|
75
|
+
│ └── types.ts # TypeScript types
|
|
76
|
+
├── package.json
|
|
77
|
+
├── tsconfig.json
|
|
78
|
+
└── README.md
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Core Components
|
|
82
|
+
|
|
83
|
+
#### 1. Agent Loader
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
// src/agents/loader.ts
|
|
87
|
+
import { readdir, readFile } from 'fs/promises';
|
|
88
|
+
import { join } from 'path';
|
|
89
|
+
import { homedir } from 'os';
|
|
90
|
+
import matter from 'gray-matter';
|
|
91
|
+
|
|
92
|
+
interface AgentDefinition {
|
|
93
|
+
name: string;
|
|
94
|
+
description: string;
|
|
95
|
+
mode: 'primary' | 'subagent';
|
|
96
|
+
tools: Record<string, boolean>;
|
|
97
|
+
content: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export async function loadAgents(): Promise<AgentDefinition[]> {
|
|
101
|
+
const agentsDir = join(homedir(), '.aidevops', 'agents');
|
|
102
|
+
const agents: AgentDefinition[] = [];
|
|
103
|
+
|
|
104
|
+
// Load main agents (*.md in root)
|
|
105
|
+
const mainAgents = await loadAgentsFromDir(agentsDir, 'primary');
|
|
106
|
+
agents.push(...mainAgents);
|
|
107
|
+
|
|
108
|
+
// Load subagents from subdirectories
|
|
109
|
+
const subdirs = ['aidevops', 'wordpress', 'seo', 'tools', 'services', 'workflows'];
|
|
110
|
+
for (const subdir of subdirs) {
|
|
111
|
+
const subAgents = await loadAgentsFromDir(join(agentsDir, subdir), 'subagent');
|
|
112
|
+
agents.push(...subAgents);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return agents;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function loadAgentsFromDir(dir: string, mode: 'primary' | 'subagent'): Promise<AgentDefinition[]> {
|
|
119
|
+
const files = await readdir(dir).catch(() => []);
|
|
120
|
+
const agents: AgentDefinition[] = [];
|
|
121
|
+
|
|
122
|
+
for (const file of files) {
|
|
123
|
+
if (!file.endsWith('.md')) continue;
|
|
124
|
+
|
|
125
|
+
const content = await readFile(join(dir, file), 'utf-8');
|
|
126
|
+
const { data, content: body } = matter(content);
|
|
127
|
+
|
|
128
|
+
agents.push({
|
|
129
|
+
name: file.replace('.md', ''),
|
|
130
|
+
description: data.description || '',
|
|
131
|
+
mode: data.mode || mode,
|
|
132
|
+
tools: data.tools || {},
|
|
133
|
+
content: body,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return agents;
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### 2. MCP Registry
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
// src/mcps/registry.ts
|
|
145
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
146
|
+
|
|
147
|
+
interface MCPConfig {
|
|
148
|
+
name: string;
|
|
149
|
+
type: 'local' | 'remote';
|
|
150
|
+
command: string[];
|
|
151
|
+
env?: Record<string, string>;
|
|
152
|
+
enabled: boolean;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function registerMCPs(input: PluginInput, mcps: MCPConfig[]) {
|
|
156
|
+
for (const mcp of mcps) {
|
|
157
|
+
input.mcp.register({
|
|
158
|
+
name: mcp.name,
|
|
159
|
+
type: mcp.type,
|
|
160
|
+
command: mcp.command,
|
|
161
|
+
environment: mcp.env,
|
|
162
|
+
enabled: mcp.enabled,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Default aidevops MCPs
|
|
168
|
+
export const defaultMCPs: MCPConfig[] = [
|
|
169
|
+
{
|
|
170
|
+
name: 'context7',
|
|
171
|
+
type: 'local',
|
|
172
|
+
command: ['npx', '-y', '@context7/mcp@latest'],
|
|
173
|
+
enabled: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'augment-context-engine',
|
|
177
|
+
type: 'local',
|
|
178
|
+
command: ['auggie', '--mcp'],
|
|
179
|
+
enabled: true,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'repomix',
|
|
183
|
+
type: 'local',
|
|
184
|
+
command: ['npx', '-y', 'repomix@latest', '--mcp'],
|
|
185
|
+
enabled: true,
|
|
186
|
+
},
|
|
187
|
+
// ... more MCPs
|
|
188
|
+
];
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
#### 3. Quality Hooks
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
// src/hooks/pre-commit.ts
|
|
195
|
+
import type { PluginInput, HookResult } from '@opencode-ai/plugin';
|
|
196
|
+
import { exec } from 'child_process';
|
|
197
|
+
import { promisify } from 'util';
|
|
198
|
+
|
|
199
|
+
const execAsync = promisify(exec);
|
|
200
|
+
|
|
201
|
+
export function createPreCommitHook(input: PluginInput) {
|
|
202
|
+
return {
|
|
203
|
+
event: 'PreToolUse',
|
|
204
|
+
matcher: /^(Write|Edit)$/,
|
|
205
|
+
async handler(context: any): Promise<HookResult> {
|
|
206
|
+
const { tool, args } = context;
|
|
207
|
+
|
|
208
|
+
// Skip if not a shell script
|
|
209
|
+
if (!args.filePath?.endsWith('.sh')) {
|
|
210
|
+
return { continue: true };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Run ShellCheck
|
|
214
|
+
try {
|
|
215
|
+
await execAsync(`shellcheck "${args.filePath}"`);
|
|
216
|
+
} catch (error: any) {
|
|
217
|
+
return {
|
|
218
|
+
continue: true,
|
|
219
|
+
message: `ShellCheck warnings:\n${error.stdout}`,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return { continue: true };
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### 4. Main Plugin Entry
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
// src/index.ts
|
|
233
|
+
import type { Plugin, PluginInput } from '@opencode-ai/plugin';
|
|
234
|
+
import { loadAgents } from './agents/loader';
|
|
235
|
+
import { registerMCPs, defaultMCPs } from './mcps/registry';
|
|
236
|
+
import { createPreCommitHook } from './hooks/pre-commit';
|
|
237
|
+
import { loadConfig } from './config/schema';
|
|
238
|
+
|
|
239
|
+
export default function aidevopsPlugin(): Plugin {
|
|
240
|
+
return {
|
|
241
|
+
name: 'aidevops-opencode',
|
|
242
|
+
version: '1.0.0',
|
|
243
|
+
|
|
244
|
+
async setup(input: PluginInput) {
|
|
245
|
+
const config = await loadConfig();
|
|
246
|
+
|
|
247
|
+
// Load and register agents from ~/.aidevops/agents/
|
|
248
|
+
const agents = await loadAgents();
|
|
249
|
+
for (const agent of agents) {
|
|
250
|
+
input.agent.register({
|
|
251
|
+
name: agent.name,
|
|
252
|
+
description: agent.description,
|
|
253
|
+
mode: agent.mode,
|
|
254
|
+
tools: agent.tools,
|
|
255
|
+
prompt: agent.content,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Register MCPs
|
|
260
|
+
const mcps = config.mcps ?? defaultMCPs;
|
|
261
|
+
registerMCPs(input, mcps);
|
|
262
|
+
|
|
263
|
+
// Register hooks
|
|
264
|
+
if (config.hooks?.preCommit !== false) {
|
|
265
|
+
input.hook.register(createPreCommitHook(input));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Register aidevops CLI as a tool
|
|
269
|
+
input.tool.register({
|
|
270
|
+
name: 'aidevops',
|
|
271
|
+
description: 'Run aidevops CLI commands',
|
|
272
|
+
parameters: {
|
|
273
|
+
command: { type: 'string', description: 'Command to run' },
|
|
274
|
+
args: { type: 'array', items: { type: 'string' } },
|
|
275
|
+
},
|
|
276
|
+
async handler({ command, args }) {
|
|
277
|
+
const { exec } = await import('child_process');
|
|
278
|
+
const { promisify } = await import('util');
|
|
279
|
+
const execAsync = promisify(exec);
|
|
280
|
+
|
|
281
|
+
const result = await execAsync(`aidevops ${command} ${args.join(' ')}`);
|
|
282
|
+
return result.stdout;
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Configuration Schema
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
// src/config/schema.ts
|
|
294
|
+
import { z } from 'zod';
|
|
295
|
+
import { readFile } from 'fs/promises';
|
|
296
|
+
import { join } from 'path';
|
|
297
|
+
import { homedir } from 'os';
|
|
298
|
+
|
|
299
|
+
const configSchema = z.object({
|
|
300
|
+
// Agent loading
|
|
301
|
+
agentsDir: z.string().default('~/.aidevops/agents'),
|
|
302
|
+
loadSubagents: z.boolean().default(true),
|
|
303
|
+
disabledAgents: z.array(z.string()).default([]),
|
|
304
|
+
|
|
305
|
+
// MCP configuration
|
|
306
|
+
mcps: z.array(z.object({
|
|
307
|
+
name: z.string(),
|
|
308
|
+
type: z.enum(['local', 'remote']),
|
|
309
|
+
command: z.array(z.string()),
|
|
310
|
+
env: z.record(z.string()).optional(),
|
|
311
|
+
enabled: z.boolean().default(true),
|
|
312
|
+
})).optional(),
|
|
313
|
+
disabledMcps: z.array(z.string()).default([]),
|
|
314
|
+
|
|
315
|
+
// Hooks
|
|
316
|
+
hooks: z.object({
|
|
317
|
+
preCommit: z.boolean().default(true),
|
|
318
|
+
postToolUse: z.boolean().default(true),
|
|
319
|
+
qualityCheck: z.boolean().default(true),
|
|
320
|
+
}).default({}),
|
|
321
|
+
|
|
322
|
+
// Integration with oh-my-opencode
|
|
323
|
+
omoCompatibility: z.boolean().default(true),
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
export type Config = z.infer<typeof configSchema>;
|
|
327
|
+
|
|
328
|
+
export async function loadConfig(): Promise<Config> {
|
|
329
|
+
const configPath = join(homedir(), '.config', 'opencode', 'aidevops-opencode.json');
|
|
330
|
+
|
|
331
|
+
try {
|
|
332
|
+
const content = await readFile(configPath, 'utf-8');
|
|
333
|
+
return configSchema.parse(JSON.parse(content));
|
|
334
|
+
} catch {
|
|
335
|
+
return configSchema.parse({});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Package Configuration
|
|
341
|
+
|
|
342
|
+
```json
|
|
343
|
+
{
|
|
344
|
+
"name": "aidevops-opencode",
|
|
345
|
+
"version": "1.0.0",
|
|
346
|
+
"description": "OpenCode plugin for aidevops framework",
|
|
347
|
+
"main": "dist/index.js",
|
|
348
|
+
"types": "dist/index.d.ts",
|
|
349
|
+
"type": "module",
|
|
350
|
+
"exports": {
|
|
351
|
+
".": {
|
|
352
|
+
"types": "./dist/index.d.ts",
|
|
353
|
+
"import": "./dist/index.js"
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"scripts": {
|
|
357
|
+
"build": "bun build src/index.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly",
|
|
358
|
+
"typecheck": "tsc --noEmit"
|
|
359
|
+
},
|
|
360
|
+
"keywords": ["opencode", "plugin", "aidevops", "devops", "agents"],
|
|
361
|
+
"author": "Marcus Quinn",
|
|
362
|
+
"license": "MIT",
|
|
363
|
+
"dependencies": {
|
|
364
|
+
"@opencode-ai/plugin": "^1.0.162",
|
|
365
|
+
"gray-matter": "^4.0.3",
|
|
366
|
+
"zod": "^4.1.8"
|
|
367
|
+
},
|
|
368
|
+
"devDependencies": {
|
|
369
|
+
"bun-types": "latest",
|
|
370
|
+
"typescript": "^5.7.3"
|
|
371
|
+
},
|
|
372
|
+
"peerDependencies": {
|
|
373
|
+
"opencode": ">=1.0.150"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## Integration with oh-my-opencode
|
|
379
|
+
|
|
380
|
+
### Compatibility Mode
|
|
381
|
+
|
|
382
|
+
When both plugins are installed:
|
|
383
|
+
|
|
384
|
+
```json
|
|
385
|
+
// ~/.config/opencode/opencode.json
|
|
386
|
+
{
|
|
387
|
+
"plugin": [
|
|
388
|
+
"oh-my-opencode",
|
|
389
|
+
"aidevops-opencode",
|
|
390
|
+
"opencode-antigravity-auth@latest"
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
The aidevops plugin should:
|
|
396
|
+
|
|
397
|
+
1. **Detect OmO presence** and adjust behavior
|
|
398
|
+
2. **Disable duplicate MCPs** (Context7 if OmO provides it)
|
|
399
|
+
3. **Namespace agents** to avoid conflicts
|
|
400
|
+
4. **Complement hooks** rather than duplicate
|
|
401
|
+
|
|
402
|
+
```typescript
|
|
403
|
+
// src/index.ts - OmO compatibility
|
|
404
|
+
async setup(input: PluginInput) {
|
|
405
|
+
const config = await loadConfig();
|
|
406
|
+
|
|
407
|
+
// Check if oh-my-opencode is loaded
|
|
408
|
+
const omoLoaded = input.plugins?.includes('oh-my-opencode');
|
|
409
|
+
|
|
410
|
+
if (omoLoaded && config.omoCompatibility) {
|
|
411
|
+
// Disable MCPs that OmO provides
|
|
412
|
+
config.disabledMcps.push('context7', 'websearch_exa', 'grep_app');
|
|
413
|
+
|
|
414
|
+
// Prefix agent names to avoid conflicts
|
|
415
|
+
// (though current agents don't conflict)
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// Continue with setup...
|
|
419
|
+
}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
## Implementation Roadmap
|
|
423
|
+
|
|
424
|
+
### Phase 1: Core Plugin (MVP)
|
|
425
|
+
|
|
426
|
+
- [ ] Basic plugin structure
|
|
427
|
+
- [ ] Agent loader from `~/.aidevops/agents/`
|
|
428
|
+
- [ ] MCP registration
|
|
429
|
+
- [ ] aidevops CLI tool
|
|
430
|
+
|
|
431
|
+
### Phase 2: Hooks
|
|
432
|
+
|
|
433
|
+
- [ ] Pre-commit quality checks (ShellCheck)
|
|
434
|
+
- [ ] Post-tool-use logging
|
|
435
|
+
- [ ] Quality check reminders
|
|
436
|
+
|
|
437
|
+
### Phase 3: Enhanced Features
|
|
438
|
+
|
|
439
|
+
- [ ] Dynamic agent reloading
|
|
440
|
+
- [ ] MCP health monitoring
|
|
441
|
+
- [ ] Integration with aidevops update system
|
|
442
|
+
|
|
443
|
+
### Phase 4: OmO Integration
|
|
444
|
+
|
|
445
|
+
- [ ] Compatibility detection
|
|
446
|
+
- [ ] Shared configuration
|
|
447
|
+
- [ ] Combined workflows
|
|
448
|
+
|
|
449
|
+
## Decision: Plugin vs Current Approach
|
|
450
|
+
|
|
451
|
+
### Keep Current Approach (Recommended for Now)
|
|
452
|
+
|
|
453
|
+
| Aspect | Current | Plugin |
|
|
454
|
+
|--------|---------|--------|
|
|
455
|
+
| **Multi-tool support** | Yes (Claude, Cursor, etc.) | OpenCode only |
|
|
456
|
+
| **Flexibility** | High (markdown agents) | Medium (TypeScript) |
|
|
457
|
+
| **Maintenance** | Shell scripts | TypeScript + npm |
|
|
458
|
+
| **Installation** | setup.sh | npm install |
|
|
459
|
+
| **Updates** | git pull + setup.sh | npm update |
|
|
460
|
+
|
|
461
|
+
**Recommendation**: Continue with current approach, but design plugin for future.
|
|
462
|
+
|
|
463
|
+
### When to Build Plugin
|
|
464
|
+
|
|
465
|
+
Build the plugin when:
|
|
466
|
+
|
|
467
|
+
1. OpenCode becomes dominant AI CLI tool
|
|
468
|
+
2. Users request native plugin experience
|
|
469
|
+
3. Hooks become essential (quality gates, etc.)
|
|
470
|
+
4. oh-my-opencode integration needs tighter coupling
|
|
471
|
+
|
|
472
|
+
## References
|
|
473
|
+
|
|
474
|
+
- [OpenCode Plugin SDK](https://opencode.ai/docs/plugins)
|
|
475
|
+
- [oh-my-opencode Source](https://github.com/code-yeongyu/oh-my-opencode)
|
|
476
|
+
- [aidevops Framework](https://github.com/marcusquinn/aidevops)
|