aidevops 2.52.1 → 2.53.2
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/README.md +1 -1
- package/VERSION +1 -1
- package/aidevops.sh +15 -9
- package/package.json +4 -4
- package/scripts/npm-postinstall.js +6 -7
- package/setup.sh +1 -1
- package/templates/deploy-templates.sh +144 -0
- package/templates/home/.agent/README.md +33 -0
- package/templates/home/AGENTS.md +96 -0
- package/templates/home/git/.agent/README.md +48 -0
- package/templates/home/git/AGENTS.md +97 -0
- package/templates/standard-functions.sh +179 -0
- package/templates/wordpress-performance-workflow.md +217 -0
- package/.agent/AGENTS.md +0 -614
- package/.agent/accounts.md +0 -65
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +0 -456
- package/.agent/aidevops/api-integrations.md +0 -335
- package/.agent/aidevops/architecture.md +0 -510
- package/.agent/aidevops/configs.md +0 -274
- package/.agent/aidevops/docs.md +0 -244
- package/.agent/aidevops/extension.md +0 -311
- package/.agent/aidevops/mcp-integrations.md +0 -340
- package/.agent/aidevops/mcp-troubleshooting.md +0 -162
- package/.agent/aidevops/memory-patterns.md +0 -172
- package/.agent/aidevops/providers.md +0 -217
- package/.agent/aidevops/recommendations.md +0 -321
- package/.agent/aidevops/requirements.md +0 -301
- package/.agent/aidevops/resources.md +0 -214
- package/.agent/aidevops/security-requirements.md +0 -174
- package/.agent/aidevops/security.md +0 -350
- package/.agent/aidevops/service-links.md +0 -400
- package/.agent/aidevops/services.md +0 -357
- package/.agent/aidevops/setup.md +0 -153
- package/.agent/aidevops/troubleshooting.md +0 -389
- package/.agent/aidevops.md +0 -124
- package/.agent/build-plus.md +0 -244
- package/.agent/content/guidelines.md +0 -109
- package/.agent/content.md +0 -87
- package/.agent/health.md +0 -59
- package/.agent/legal.md +0 -59
- package/.agent/loop-state/full-loop.local.md +0 -16
- package/.agent/loop-state/ralph-loop.local.md +0 -10
- package/.agent/marketing.md +0 -440
- package/.agent/memory/README.md +0 -260
- package/.agent/onboarding.md +0 -796
- package/.agent/plan-plus.md +0 -245
- package/.agent/research.md +0 -100
- package/.agent/sales.md +0 -333
- package/.agent/scripts/101domains-helper.sh +0 -701
- package/.agent/scripts/add-missing-returns.sh +0 -140
- package/.agent/scripts/agent-browser-helper.sh +0 -311
- package/.agent/scripts/agno-setup.sh +0 -712
- package/.agent/scripts/ahrefs-mcp-wrapper.js +0 -168
- package/.agent/scripts/aidevops-update-check.sh +0 -71
- package/.agent/scripts/ampcode-cli.sh +0 -522
- package/.agent/scripts/auto-version-bump.sh +0 -156
- package/.agent/scripts/autogen-helper.sh +0 -512
- package/.agent/scripts/beads-sync-helper.sh +0 -596
- package/.agent/scripts/closte-helper.sh +0 -5
- package/.agent/scripts/cloudron-helper.sh +0 -321
- package/.agent/scripts/codacy-cli-chunked.sh +0 -581
- package/.agent/scripts/codacy-cli.sh +0 -442
- package/.agent/scripts/code-audit-helper.sh +0 -5
- package/.agent/scripts/coderabbit-cli.sh +0 -417
- package/.agent/scripts/coderabbit-pro-analysis.sh +0 -238
- package/.agent/scripts/commands/code-simplifier.md +0 -86
- package/.agent/scripts/commands/full-loop.md +0 -246
- package/.agent/scripts/commands/postflight-loop.md +0 -103
- package/.agent/scripts/commands/recall.md +0 -182
- package/.agent/scripts/commands/remember.md +0 -132
- package/.agent/scripts/commands/save-todo.md +0 -175
- package/.agent/scripts/commands/session-review.md +0 -154
- package/.agent/scripts/comprehensive-quality-fix.sh +0 -106
- package/.agent/scripts/context-builder-helper.sh +0 -522
- package/.agent/scripts/coolify-cli-helper.sh +0 -674
- package/.agent/scripts/coolify-helper.sh +0 -380
- package/.agent/scripts/crawl4ai-examples.sh +0 -401
- package/.agent/scripts/crawl4ai-helper.sh +0 -1078
- package/.agent/scripts/crewai-helper.sh +0 -681
- package/.agent/scripts/dev-browser-helper.sh +0 -513
- package/.agent/scripts/dns-helper.sh +0 -396
- package/.agent/scripts/domain-research-helper.sh +0 -917
- package/.agent/scripts/dspy-helper.sh +0 -285
- package/.agent/scripts/dspyground-helper.sh +0 -291
- package/.agent/scripts/eeat-score-helper.sh +0 -1242
- package/.agent/scripts/efficient-return-fix.sh +0 -92
- package/.agent/scripts/extract-opencode-prompts.sh +0 -128
- package/.agent/scripts/find-missing-returns.sh +0 -113
- package/.agent/scripts/fix-auth-headers.sh +0 -104
- package/.agent/scripts/fix-common-strings.sh +0 -254
- package/.agent/scripts/fix-content-type.sh +0 -100
- package/.agent/scripts/fix-error-messages.sh +0 -130
- package/.agent/scripts/fix-misplaced-returns.sh +0 -74
- package/.agent/scripts/fix-remaining-literals.sh +0 -152
- package/.agent/scripts/fix-return-statements.sh +0 -41
- package/.agent/scripts/fix-s131-default-cases.sh +0 -249
- package/.agent/scripts/fix-sc2155-simple.sh +0 -102
- package/.agent/scripts/fix-shellcheck-critical.sh +0 -187
- package/.agent/scripts/fix-string-literals.sh +0 -273
- package/.agent/scripts/full-loop-helper.sh +0 -773
- package/.agent/scripts/generate-opencode-agents.sh +0 -497
- package/.agent/scripts/generate-opencode-commands.sh +0 -1629
- package/.agent/scripts/generate-skills.sh +0 -366
- package/.agent/scripts/git-platforms-helper.sh +0 -640
- package/.agent/scripts/gitea-cli-helper.sh +0 -743
- package/.agent/scripts/github-cli-helper.sh +0 -702
- package/.agent/scripts/gitlab-cli-helper.sh +0 -682
- package/.agent/scripts/gsc-add-user-helper.sh +0 -325
- package/.agent/scripts/gsc-sitemap-helper.sh +0 -678
- package/.agent/scripts/hetzner-helper.sh +0 -485
- package/.agent/scripts/hostinger-helper.sh +0 -229
- package/.agent/scripts/keyword-research-helper.sh +0 -1815
- package/.agent/scripts/langflow-helper.sh +0 -544
- package/.agent/scripts/linkedin-automation.py +0 -241
- package/.agent/scripts/linter-manager.sh +0 -599
- package/.agent/scripts/linters-local.sh +0 -434
- package/.agent/scripts/list-keys-helper.sh +0 -488
- package/.agent/scripts/local-browser-automation.py +0 -339
- package/.agent/scripts/localhost-helper.sh +0 -744
- package/.agent/scripts/loop-common.sh +0 -806
- package/.agent/scripts/mainwp-helper.sh +0 -728
- package/.agent/scripts/markdown-formatter.sh +0 -338
- package/.agent/scripts/markdown-lint-fix.sh +0 -311
- package/.agent/scripts/mass-fix-returns.sh +0 -58
- package/.agent/scripts/mcp-diagnose.sh +0 -167
- package/.agent/scripts/mcp-inspector-helper.sh +0 -449
- package/.agent/scripts/memory-helper.sh +0 -650
- package/.agent/scripts/monitor-code-review.sh +0 -255
- package/.agent/scripts/onboarding-helper.sh +0 -706
- package/.agent/scripts/opencode-github-setup-helper.sh +0 -797
- package/.agent/scripts/opencode-test-helper.sh +0 -213
- package/.agent/scripts/pagespeed-helper.sh +0 -464
- package/.agent/scripts/pandoc-helper.sh +0 -362
- package/.agent/scripts/postflight-check.sh +0 -555
- package/.agent/scripts/pre-commit-hook.sh +0 -259
- package/.agent/scripts/pre-edit-check.sh +0 -169
- package/.agent/scripts/qlty-cli.sh +0 -356
- package/.agent/scripts/quality-cli-manager.sh +0 -525
- package/.agent/scripts/quality-feedback-helper.sh +0 -462
- package/.agent/scripts/quality-fix.sh +0 -263
- package/.agent/scripts/quality-loop-helper.sh +0 -1108
- package/.agent/scripts/ralph-loop-helper.sh +0 -836
- package/.agent/scripts/ralph-upstream-check.sh +0 -341
- package/.agent/scripts/secretlint-helper.sh +0 -847
- package/.agent/scripts/servers-helper.sh +0 -241
- package/.agent/scripts/ses-helper.sh +0 -619
- package/.agent/scripts/session-review-helper.sh +0 -404
- package/.agent/scripts/setup-linters-wizard.sh +0 -379
- package/.agent/scripts/setup-local-api-keys.sh +0 -330
- package/.agent/scripts/setup-mcp-integrations.sh +0 -472
- package/.agent/scripts/shared-constants.sh +0 -246
- package/.agent/scripts/site-crawler-helper.sh +0 -1487
- package/.agent/scripts/snyk-helper.sh +0 -940
- package/.agent/scripts/sonarcloud-autofix.sh +0 -193
- package/.agent/scripts/sonarcloud-cli.sh +0 -191
- package/.agent/scripts/sonarscanner-cli.sh +0 -455
- package/.agent/scripts/spaceship-helper.sh +0 -747
- package/.agent/scripts/stagehand-helper.sh +0 -321
- package/.agent/scripts/stagehand-python-helper.sh +0 -321
- package/.agent/scripts/stagehand-python-setup.sh +0 -441
- package/.agent/scripts/stagehand-setup.sh +0 -439
- package/.agent/scripts/system-cleanup.sh +0 -340
- package/.agent/scripts/terminal-title-helper.sh +0 -388
- package/.agent/scripts/terminal-title-setup.sh +0 -549
- package/.agent/scripts/test-stagehand-both-integration.sh +0 -317
- package/.agent/scripts/test-stagehand-integration.sh +0 -309
- package/.agent/scripts/test-stagehand-python-integration.sh +0 -341
- package/.agent/scripts/todo-ready.sh +0 -263
- package/.agent/scripts/tool-version-check.sh +0 -362
- package/.agent/scripts/toon-helper.sh +0 -469
- package/.agent/scripts/twilio-helper.sh +0 -917
- package/.agent/scripts/updown-helper.sh +0 -279
- package/.agent/scripts/validate-mcp-integrations.sh +0 -250
- package/.agent/scripts/validate-version-consistency.sh +0 -131
- package/.agent/scripts/vaultwarden-helper.sh +0 -597
- package/.agent/scripts/vercel-cli-helper.sh +0 -816
- package/.agent/scripts/verify-mirrors.sh +0 -169
- package/.agent/scripts/version-manager.sh +0 -831
- package/.agent/scripts/webhosting-helper.sh +0 -471
- package/.agent/scripts/webhosting-verify.sh +0 -238
- package/.agent/scripts/wordpress-mcp-helper.sh +0 -508
- package/.agent/scripts/worktree-helper.sh +0 -595
- package/.agent/scripts/worktree-sessions.sh +0 -577
- package/.agent/seo/dataforseo.md +0 -215
- package/.agent/seo/domain-research.md +0 -532
- package/.agent/seo/eeat-score.md +0 -659
- package/.agent/seo/google-search-console.md +0 -366
- package/.agent/seo/gsc-sitemaps.md +0 -282
- package/.agent/seo/keyword-research.md +0 -521
- package/.agent/seo/serper.md +0 -278
- package/.agent/seo/site-crawler.md +0 -387
- package/.agent/seo.md +0 -236
- package/.agent/services/accounting/quickfile.md +0 -159
- package/.agent/services/communications/telfon.md +0 -470
- package/.agent/services/communications/twilio.md +0 -569
- package/.agent/services/crm/fluentcrm.md +0 -449
- package/.agent/services/email/ses.md +0 -399
- package/.agent/services/hosting/101domains.md +0 -378
- package/.agent/services/hosting/closte.md +0 -177
- package/.agent/services/hosting/cloudflare.md +0 -251
- package/.agent/services/hosting/cloudron.md +0 -478
- package/.agent/services/hosting/dns-providers.md +0 -335
- package/.agent/services/hosting/domain-purchasing.md +0 -344
- package/.agent/services/hosting/hetzner.md +0 -327
- package/.agent/services/hosting/hostinger.md +0 -287
- package/.agent/services/hosting/localhost.md +0 -419
- package/.agent/services/hosting/spaceship.md +0 -353
- package/.agent/services/hosting/webhosting.md +0 -330
- package/.agent/social-media.md +0 -69
- package/.agent/templates/plans-template.md +0 -114
- package/.agent/templates/prd-template.md +0 -129
- package/.agent/templates/tasks-template.md +0 -108
- package/.agent/templates/todo-template.md +0 -89
- package/.agent/tools/ai-assistants/agno.md +0 -471
- package/.agent/tools/ai-assistants/capsolver.md +0 -326
- package/.agent/tools/ai-assistants/configuration.md +0 -221
- package/.agent/tools/ai-assistants/overview.md +0 -209
- package/.agent/tools/ai-assistants/status.md +0 -171
- package/.agent/tools/ai-assistants/windsurf.md +0 -193
- package/.agent/tools/ai-orchestration/autogen.md +0 -406
- package/.agent/tools/ai-orchestration/crewai.md +0 -445
- package/.agent/tools/ai-orchestration/langflow.md +0 -405
- package/.agent/tools/ai-orchestration/openprose.md +0 -487
- package/.agent/tools/ai-orchestration/overview.md +0 -362
- package/.agent/tools/ai-orchestration/packaging.md +0 -647
- package/.agent/tools/browser/agent-browser.md +0 -464
- package/.agent/tools/browser/browser-automation.md +0 -400
- package/.agent/tools/browser/chrome-devtools.md +0 -282
- package/.agent/tools/browser/crawl4ai-integration.md +0 -422
- package/.agent/tools/browser/crawl4ai-resources.md +0 -277
- package/.agent/tools/browser/crawl4ai-usage.md +0 -416
- package/.agent/tools/browser/crawl4ai.md +0 -585
- package/.agent/tools/browser/dev-browser.md +0 -341
- package/.agent/tools/browser/pagespeed.md +0 -260
- package/.agent/tools/browser/playwright.md +0 -266
- package/.agent/tools/browser/playwriter.md +0 -310
- package/.agent/tools/browser/stagehand-examples.md +0 -456
- package/.agent/tools/browser/stagehand-python.md +0 -483
- package/.agent/tools/browser/stagehand.md +0 -421
- package/.agent/tools/build-agent/agent-review.md +0 -224
- package/.agent/tools/build-agent/build-agent.md +0 -784
- package/.agent/tools/build-mcp/aidevops-plugin.md +0 -476
- package/.agent/tools/build-mcp/api-wrapper.md +0 -445
- package/.agent/tools/build-mcp/build-mcp.md +0 -240
- package/.agent/tools/build-mcp/deployment.md +0 -401
- package/.agent/tools/build-mcp/server-patterns.md +0 -632
- package/.agent/tools/build-mcp/transports.md +0 -366
- package/.agent/tools/code-review/auditing.md +0 -383
- package/.agent/tools/code-review/automation.md +0 -219
- package/.agent/tools/code-review/best-practices.md +0 -203
- package/.agent/tools/code-review/codacy.md +0 -151
- package/.agent/tools/code-review/code-simplifier.md +0 -174
- package/.agent/tools/code-review/code-standards.md +0 -309
- package/.agent/tools/code-review/coderabbit.md +0 -101
- package/.agent/tools/code-review/management.md +0 -155
- package/.agent/tools/code-review/qlty.md +0 -248
- package/.agent/tools/code-review/secretlint.md +0 -565
- package/.agent/tools/code-review/setup.md +0 -250
- package/.agent/tools/code-review/snyk.md +0 -563
- package/.agent/tools/code-review/tools.md +0 -230
- package/.agent/tools/content/summarize.md +0 -353
- package/.agent/tools/context/augment-context-engine.md +0 -468
- package/.agent/tools/context/context-builder-agent.md +0 -76
- package/.agent/tools/context/context-builder.md +0 -375
- package/.agent/tools/context/context7.md +0 -371
- package/.agent/tools/context/dspy.md +0 -302
- package/.agent/tools/context/dspyground.md +0 -374
- package/.agent/tools/context/llm-tldr.md +0 -219
- package/.agent/tools/context/osgrep.md +0 -488
- package/.agent/tools/context/prompt-optimization.md +0 -338
- package/.agent/tools/context/toon.md +0 -292
- package/.agent/tools/conversion/pandoc.md +0 -304
- package/.agent/tools/credentials/api-key-management.md +0 -154
- package/.agent/tools/credentials/api-key-setup.md +0 -224
- package/.agent/tools/credentials/environment-variables.md +0 -180
- package/.agent/tools/credentials/vaultwarden.md +0 -382
- package/.agent/tools/data-extraction/outscraper.md +0 -974
- package/.agent/tools/deployment/coolify-cli.md +0 -388
- package/.agent/tools/deployment/coolify-setup.md +0 -353
- package/.agent/tools/deployment/coolify.md +0 -345
- package/.agent/tools/deployment/vercel.md +0 -390
- package/.agent/tools/git/authentication.md +0 -132
- package/.agent/tools/git/gitea-cli.md +0 -193
- package/.agent/tools/git/github-actions.md +0 -207
- package/.agent/tools/git/github-cli.md +0 -223
- package/.agent/tools/git/gitlab-cli.md +0 -190
- package/.agent/tools/git/opencode-github-security.md +0 -350
- package/.agent/tools/git/opencode-github.md +0 -328
- package/.agent/tools/git/opencode-gitlab.md +0 -252
- package/.agent/tools/git/security.md +0 -196
- package/.agent/tools/git.md +0 -207
- package/.agent/tools/opencode/oh-my-opencode.md +0 -375
- package/.agent/tools/opencode/opencode-anthropic-auth.md +0 -446
- package/.agent/tools/opencode/opencode.md +0 -651
- package/.agent/tools/social-media/bird.md +0 -437
- package/.agent/tools/task-management/beads.md +0 -336
- package/.agent/tools/terminal/terminal-title.md +0 -251
- package/.agent/tools/ui/shadcn.md +0 -196
- package/.agent/tools/ui/ui-skills.md +0 -115
- package/.agent/tools/wordpress/localwp.md +0 -311
- package/.agent/tools/wordpress/mainwp.md +0 -391
- package/.agent/tools/wordpress/scf.md +0 -527
- package/.agent/tools/wordpress/wp-admin.md +0 -729
- package/.agent/tools/wordpress/wp-dev.md +0 -940
- package/.agent/tools/wordpress/wp-preferred.md +0 -398
- package/.agent/tools/wordpress.md +0 -95
- package/.agent/workflows/branch/bugfix.md +0 -63
- package/.agent/workflows/branch/chore.md +0 -95
- package/.agent/workflows/branch/experiment.md +0 -115
- package/.agent/workflows/branch/feature.md +0 -59
- package/.agent/workflows/branch/hotfix.md +0 -98
- package/.agent/workflows/branch/refactor.md +0 -92
- package/.agent/workflows/branch/release.md +0 -96
- package/.agent/workflows/branch.md +0 -347
- package/.agent/workflows/bug-fixing.md +0 -267
- package/.agent/workflows/changelog.md +0 -129
- package/.agent/workflows/code-audit-remote.md +0 -279
- package/.agent/workflows/conversation-starter.md +0 -69
- package/.agent/workflows/error-feedback.md +0 -578
- package/.agent/workflows/feature-development.md +0 -355
- package/.agent/workflows/git-workflow.md +0 -702
- package/.agent/workflows/multi-repo-workspace.md +0 -268
- package/.agent/workflows/plans.md +0 -709
- package/.agent/workflows/postflight.md +0 -604
- package/.agent/workflows/pr.md +0 -571
- package/.agent/workflows/preflight.md +0 -278
- package/.agent/workflows/ralph-loop.md +0 -773
- package/.agent/workflows/release.md +0 -498
- package/.agent/workflows/session-manager.md +0 -254
- package/.agent/workflows/session-review.md +0 -311
- package/.agent/workflows/sql-migrations.md +0 -631
- package/.agent/workflows/version-bump.md +0 -283
- package/.agent/workflows/wiki-update.md +0 -333
- package/.agent/workflows/worktree.md +0 -477
|
@@ -1,784 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: build-agent
|
|
3
|
-
description: Agent design and composition - creating efficient, token-optimized AI agents
|
|
4
|
-
mode: subagent
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Build-Agent - Composing Efficient AI Agents
|
|
8
|
-
|
|
9
|
-
<!-- AI-CONTEXT-START -->
|
|
10
|
-
|
|
11
|
-
## Quick Reference
|
|
12
|
-
|
|
13
|
-
- **Purpose**: Design, create, and improve AI agents for the aidevops framework
|
|
14
|
-
- **Pattern**: Main agents at root, subagents in folders
|
|
15
|
-
- **Budget**: ~50-100 instructions per agent (research-backed limit)
|
|
16
|
-
|
|
17
|
-
**Instruction Limits**:
|
|
18
|
-
- ~150-200: frontier models can follow
|
|
19
|
-
- ~50: consumed by AI assistant system prompt
|
|
20
|
-
- **Your budget**: ~50-100 instructions max
|
|
21
|
-
|
|
22
|
-
**Token Efficiency**:
|
|
23
|
-
- Root AGENTS.md: <150 lines, universally applicable only
|
|
24
|
-
- Subagents: Progressive disclosure (read when needed)
|
|
25
|
-
- MCP servers: Disabled globally, enabled per-agent
|
|
26
|
-
- Code refs: Use search patterns (`rg "pattern"`) not `file:line`
|
|
27
|
-
|
|
28
|
-
**Agent Hierarchy**:
|
|
29
|
-
- **Main Agents**: Orchestration, call subagents when needed
|
|
30
|
-
- **Subagents**: Focused execution, minimal context, specific tools
|
|
31
|
-
|
|
32
|
-
**Subagents** (in this folder):
|
|
33
|
-
|
|
34
|
-
| Subagent | When to Read |
|
|
35
|
-
|----------|--------------|
|
|
36
|
-
| `agent-review.md` | Reviewing and improving existing agents |
|
|
37
|
-
|
|
38
|
-
**Related Agents**:
|
|
39
|
-
- `@code-standards` for linting agent markdown
|
|
40
|
-
- `aidevops/architecture.md` for framework structure
|
|
41
|
-
- `tools/browser/browser-automation.md` for agents needing browser capabilities (tool hierarchy: Playwright → Playwriter → Stagehand → DevTools)
|
|
42
|
-
|
|
43
|
-
**Git Workflow**:
|
|
44
|
-
- Branch strategy: `workflows/branch.md`
|
|
45
|
-
- Git operations: `tools/git.md`
|
|
46
|
-
|
|
47
|
-
**Testing**: Use OpenCode CLI to test config changes without restarting TUI:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
opencode run "Test query" --agent Build+
|
|
51
|
-
```text
|
|
52
|
-
|
|
53
|
-
See `tools/opencode/opencode.md` for CLI testing patterns.
|
|
54
|
-
|
|
55
|
-
<!-- AI-CONTEXT-END -->
|
|
56
|
-
|
|
57
|
-
## Detailed Guidance
|
|
58
|
-
|
|
59
|
-
### Why This Matters
|
|
60
|
-
|
|
61
|
-
LLMs are stateless functions. AGENTS.md is the only file that goes into every conversation. This makes it the highest leverage point - for better or worse.
|
|
62
|
-
|
|
63
|
-
Research indicates:
|
|
64
|
-
- Frontier thinking models can follow ~150-200 instructions consistently
|
|
65
|
-
- Instruction-following quality degrades **uniformly** as count increases
|
|
66
|
-
- AI assistant system prompts already consume ~50 instructions
|
|
67
|
-
- The system may tell models to ignore AGENTS.md content deemed irrelevant
|
|
68
|
-
|
|
69
|
-
**Implication**: Every instruction in AGENTS.md must be universally applicable to ALL tasks.
|
|
70
|
-
|
|
71
|
-
### Main Agent vs Subagent Design
|
|
72
|
-
|
|
73
|
-
#### When to Design a Main Agent
|
|
74
|
-
|
|
75
|
-
Main agents are for high-level project orchestration:
|
|
76
|
-
|
|
77
|
-
- **Scope**: Broad domain (wordpress, seo, content, aidevops)
|
|
78
|
-
- **Role**: Coordinates subagents, makes strategic decisions
|
|
79
|
-
- **Context**: Needs awareness of multiple related concerns
|
|
80
|
-
- **Location**: Root of `.agent/` folder
|
|
81
|
-
- **Examples**: `seo.md`, `aidevops.md`, `build-plus.md`
|
|
82
|
-
|
|
83
|
-
**Main agent characteristics:**
|
|
84
|
-
- Calls subagents when specialized work needed
|
|
85
|
-
- Maintains project-level context
|
|
86
|
-
- Makes decisions about which tools/subagents to invoke
|
|
87
|
-
- Can run in parallel with other main agents (different projects)
|
|
88
|
-
|
|
89
|
-
#### When to Design a Subagent
|
|
90
|
-
|
|
91
|
-
Subagents are for focused, parallel execution:
|
|
92
|
-
|
|
93
|
-
- **Scope**: Specific tool, service, or task type
|
|
94
|
-
- **Role**: Execute focused operations independently
|
|
95
|
-
- **Context**: Minimal, task-specific only
|
|
96
|
-
- **Location**: Inside domain folders or `tools/`, `services/`, `workflows/`
|
|
97
|
-
- **Examples**: `tools/git/github-cli.md`, `services/hosting/hostinger.md`
|
|
98
|
-
|
|
99
|
-
**Subagent characteristics:**
|
|
100
|
-
- Can run in parallel without context conflicts
|
|
101
|
-
- Has specific MCP tools enabled (others disabled)
|
|
102
|
-
- Completes discrete tasks, returns results
|
|
103
|
-
- Doesn't need knowledge of other domains
|
|
104
|
-
|
|
105
|
-
#### Subagent YAML Frontmatter (Required)
|
|
106
|
-
|
|
107
|
-
Every subagent **must** include YAML frontmatter defining its tool permissions. Without explicit permissions, subagents default to read-only analysis mode, which causes confusion when agents recommend actions they cannot perform.
|
|
108
|
-
|
|
109
|
-
**Required frontmatter structure:**
|
|
110
|
-
|
|
111
|
-
```yaml
|
|
112
|
-
---
|
|
113
|
-
description: Brief description of agent purpose
|
|
114
|
-
mode: subagent
|
|
115
|
-
tools:
|
|
116
|
-
read: true # Read file contents
|
|
117
|
-
write: false # Create new files
|
|
118
|
-
edit: false # Modify existing files
|
|
119
|
-
bash: false # Execute shell commands
|
|
120
|
-
glob: true # Find files by pattern
|
|
121
|
-
grep: true # Search file contents
|
|
122
|
-
webfetch: false # Fetch web content
|
|
123
|
-
task: true # Spawn subagents
|
|
124
|
-
---
|
|
125
|
-
```text
|
|
126
|
-
|
|
127
|
-
**Tool permission options:**
|
|
128
|
-
|
|
129
|
-
| Tool | Purpose | Risk Level |
|
|
130
|
-
|------|---------|------------|
|
|
131
|
-
| `read` | Read file contents | Low - passive observation |
|
|
132
|
-
| `glob` | Find files by pattern | Low - discovery only |
|
|
133
|
-
| `grep` | Search file contents | Low - discovery only |
|
|
134
|
-
| `webfetch` | Fetch URLs | Low - read-only external |
|
|
135
|
-
| `task` | Spawn subagents | Medium - delegates work |
|
|
136
|
-
| `edit` | Modify existing files | Medium - changes files |
|
|
137
|
-
| `write` | Create new files | Medium - adds files |
|
|
138
|
-
| `bash` | Execute commands | High - arbitrary execution |
|
|
139
|
-
|
|
140
|
-
**MCP tool patterns** (for agents needing specific MCP access):
|
|
141
|
-
|
|
142
|
-
```yaml
|
|
143
|
-
tools:
|
|
144
|
-
context7_*: true # Context7 documentation tools
|
|
145
|
-
augment-context-engine_*: true # Augment codebase search
|
|
146
|
-
wordpress-mcp_*: true # WordPress MCP tools
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
**CRITICAL: MCP Placement Rule**
|
|
150
|
-
|
|
151
|
-
- **Enable MCPs in SUBAGENTS only** (files in subdirectories like `services/crm/`, `tools/wordpress/`)
|
|
152
|
-
- **NEVER enable MCPs in main agents** (`sales.md`, `marketing.md`, `seo.md`, etc.)
|
|
153
|
-
- Main agents reference subagents for MCP functionality
|
|
154
|
-
- This ensures MCPs only load when the specific subagent is invoked
|
|
155
|
-
|
|
156
|
-
```yaml
|
|
157
|
-
# CORRECT: MCP in subagent (services/crm/fluentcrm.md)
|
|
158
|
-
tools:
|
|
159
|
-
fluentcrm_*: true
|
|
160
|
-
|
|
161
|
-
# WRONG: MCP in main agent (sales.md)
|
|
162
|
-
tools:
|
|
163
|
-
fluentcrm_*: true # DON'T DO THIS - use subagent reference instead
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
**MCP requirements with tool filtering** (documents intent for future `includeTools` support):
|
|
167
|
-
|
|
168
|
-
```yaml
|
|
169
|
-
---
|
|
170
|
-
description: Preview and screenshot local dev servers
|
|
171
|
-
mcp_requirements:
|
|
172
|
-
chrome-devtools:
|
|
173
|
-
tools: [navigate_page, take_screenshot, new_page, list_pages]
|
|
174
|
-
---
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
This convention documents which specific tools an agent needs from an MCP server. Currently informational only - OpenCode doesn't yet support `includeTools` filtering (see [OpenCode #7399](https://github.com/anomalyco/opencode/issues/7399)). When supported, our agent generator can use this to configure filtered MCP access.
|
|
178
|
-
|
|
179
|
-
**Why document MCP requirements?**
|
|
180
|
-
- Prepares agents for future `includeTools` support
|
|
181
|
-
- Documents intent for humans reviewing agent design
|
|
182
|
-
- Enables token savings when OpenCode implements filtering (e.g., 17k → 1.5k tokens for chrome-devtools)
|
|
183
|
-
- Prior art: [Amp's lazy-load MCP with skills](https://ampcode.com/news/lazy-load-mcp-with-skills)
|
|
184
|
-
|
|
185
|
-
**Example: Read-only analysis agent**
|
|
186
|
-
|
|
187
|
-
```yaml
|
|
188
|
-
---
|
|
189
|
-
description: Analyzes agent files for quality issues
|
|
190
|
-
mode: subagent
|
|
191
|
-
tools:
|
|
192
|
-
read: true
|
|
193
|
-
write: false
|
|
194
|
-
edit: false
|
|
195
|
-
bash: false
|
|
196
|
-
glob: true
|
|
197
|
-
grep: true
|
|
198
|
-
webfetch: false
|
|
199
|
-
task: true
|
|
200
|
-
---
|
|
201
|
-
```text
|
|
202
|
-
|
|
203
|
-
**Example: Write-capable task agent**
|
|
204
|
-
|
|
205
|
-
```yaml
|
|
206
|
-
---
|
|
207
|
-
description: Updates wiki documentation from agent changes
|
|
208
|
-
mode: subagent
|
|
209
|
-
tools:
|
|
210
|
-
read: true
|
|
211
|
-
write: true
|
|
212
|
-
edit: true
|
|
213
|
-
bash: true
|
|
214
|
-
glob: true
|
|
215
|
-
grep: true
|
|
216
|
-
webfetch: false
|
|
217
|
-
task: true
|
|
218
|
-
---
|
|
219
|
-
```text
|
|
220
|
-
|
|
221
|
-
**Example: Agent with MCP access**
|
|
222
|
-
|
|
223
|
-
```yaml
|
|
224
|
-
---
|
|
225
|
-
description: WordPress development with MCP tools
|
|
226
|
-
mode: subagent
|
|
227
|
-
temperature: 0.2
|
|
228
|
-
tools:
|
|
229
|
-
read: true
|
|
230
|
-
write: true
|
|
231
|
-
edit: true
|
|
232
|
-
bash: true
|
|
233
|
-
glob: true
|
|
234
|
-
grep: true
|
|
235
|
-
webfetch: true
|
|
236
|
-
task: true
|
|
237
|
-
wordpress-mcp_*: true
|
|
238
|
-
context7_*: true
|
|
239
|
-
---
|
|
240
|
-
```text
|
|
241
|
-
|
|
242
|
-
**Note on permissions**: Path-based permissions (e.g., restricting which files can be edited) are configured in `opencode.json` for OpenCode, not in markdown frontmatter. The frontmatter defines which tools are available; the JSON config defines granular restrictions.
|
|
243
|
-
|
|
244
|
-
**Why this matters:**
|
|
245
|
-
- Prevents confusion when agents recommend actions they cannot perform
|
|
246
|
-
- Makes agent capabilities explicit and predictable
|
|
247
|
-
- Enables safer parallel execution (read-only agents can't conflict)
|
|
248
|
-
- Documents intent for both humans and AI systems
|
|
249
|
-
|
|
250
|
-
#### Agent Directory Architecture
|
|
251
|
-
|
|
252
|
-
This repository has two agent directories with different purposes:
|
|
253
|
-
|
|
254
|
-
| Directory | Purpose | Used By |
|
|
255
|
-
|-----------|---------|---------|
|
|
256
|
-
| `.agent/` | Source of truth with full documentation | Deployed to `~/.aidevops/agents/` by `setup.sh` |
|
|
257
|
-
| `.opencode/agent/` | Generated stubs for OpenCode | OpenCode CLI (reads these directly) |
|
|
258
|
-
|
|
259
|
-
**How it works:**
|
|
260
|
-
1. `.agent/` contains the authoritative agent files with rich documentation
|
|
261
|
-
2. `setup.sh` deploys `.agent/` to `~/.aidevops/agents/`
|
|
262
|
-
3. `generate-opencode-agents.sh` creates minimal stubs in `~/.config/opencode/agent/` that reference the deployed files
|
|
263
|
-
4. OpenCode reads the stubs, which point to the full agent content
|
|
264
|
-
|
|
265
|
-
**Frontmatter in `.agent/` files** serves as:
|
|
266
|
-
- Documentation of intended permissions
|
|
267
|
-
- Reference for non-OpenCode AI assistants (Claude, Cursor, etc.)
|
|
268
|
-
- Template for what the generated stubs should enable
|
|
269
|
-
|
|
270
|
-
#### Decision Framework
|
|
271
|
-
|
|
272
|
-
```text
|
|
273
|
-
Is this a broad domain or strategic concern?
|
|
274
|
-
YES → Main Agent at root
|
|
275
|
-
NO ↓
|
|
276
|
-
|
|
277
|
-
Can this run independently without needing other domain knowledge?
|
|
278
|
-
YES → Subagent in appropriate folder
|
|
279
|
-
NO ↓
|
|
280
|
-
|
|
281
|
-
Does this coordinate multiple tools/services?
|
|
282
|
-
YES → Consider if it should be main agent or call existing subagents
|
|
283
|
-
NO → Subagent, or add to existing agent
|
|
284
|
-
```text
|
|
285
|
-
|
|
286
|
-
#### Calling Other Agents
|
|
287
|
-
|
|
288
|
-
When designing an agent, prefer calling existing agents over duplicating:
|
|
289
|
-
|
|
290
|
-
```markdown
|
|
291
|
-
# Good: Reference existing capability
|
|
292
|
-
For Git operations, invoke `@git-platforms` subagent.
|
|
293
|
-
For code quality, invoke `@code-standards` subagent.
|
|
294
|
-
|
|
295
|
-
# Bad: Duplicate instructions
|
|
296
|
-
## Git Operations
|
|
297
|
-
[50 lines duplicating git-platforms.md content]
|
|
298
|
-
```text
|
|
299
|
-
|
|
300
|
-
### MCP Configuration Pattern
|
|
301
|
-
|
|
302
|
-
**Global disabled, per-agent enabled:**
|
|
303
|
-
|
|
304
|
-
```json
|
|
305
|
-
// In opencode.json
|
|
306
|
-
{
|
|
307
|
-
"mcp": {
|
|
308
|
-
"hostinger-api": { "enabled": false },
|
|
309
|
-
"hetzner-*": { "enabled": false }
|
|
310
|
-
},
|
|
311
|
-
"tools": {
|
|
312
|
-
"hostinger-api_*": false,
|
|
313
|
-
"hetzner-*": false
|
|
314
|
-
},
|
|
315
|
-
"agent": {
|
|
316
|
-
"hostinger": {
|
|
317
|
-
"tools": { "hostinger-api_*": true }
|
|
318
|
-
},
|
|
319
|
-
"hetzner": {
|
|
320
|
-
"tools": { "hetzner-*": true }
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
```text
|
|
325
|
-
|
|
326
|
-
**Why this matters:**
|
|
327
|
-
- Reduces context window usage (MCP tools add tokens)
|
|
328
|
-
- Prevents tool confusion (wrong MCP for task)
|
|
329
|
-
- Enables focused subagent execution
|
|
330
|
-
- Allows parallel subagents without conflicts
|
|
331
|
-
|
|
332
|
-
**When designing agents, specify:**
|
|
333
|
-
- Which MCPs should be enabled for this agent
|
|
334
|
-
- Which should remain disabled
|
|
335
|
-
- Any tools that need special permissions
|
|
336
|
-
|
|
337
|
-
### Code References: Search Patterns over Line Numbers
|
|
338
|
-
|
|
339
|
-
Line numbers drift as code changes. Use search patterns instead:
|
|
340
|
-
|
|
341
|
-
```markdown
|
|
342
|
-
# Bad (will drift)
|
|
343
|
-
See error handling at `.agent/scripts/hostinger-helper.sh:145`
|
|
344
|
-
|
|
345
|
-
# Good (stable)
|
|
346
|
-
Search for `handle_api_error` in `.agent/scripts/hostinger-helper.sh`
|
|
347
|
-
|
|
348
|
-
# Better (with fallback)
|
|
349
|
-
Search for `handle_api_error` in hostinger-helper.sh.
|
|
350
|
-
If not found, search for `api_error` or `error handling` patterns.
|
|
351
|
-
```text
|
|
352
|
-
|
|
353
|
-
**Search pattern hierarchy:**
|
|
354
|
-
1. Function/variable name (most specific)
|
|
355
|
-
2. Unique string literals in the code
|
|
356
|
-
3. Comment markers (e.g., `# ERROR HANDLING SECTION`)
|
|
357
|
-
4. Broader pattern search if specific not found
|
|
358
|
-
|
|
359
|
-
### Quality Checking: Linters First
|
|
360
|
-
|
|
361
|
-
**Never send an LLM to do a linter's job.**
|
|
362
|
-
|
|
363
|
-
Preference order for code quality:
|
|
364
|
-
|
|
365
|
-
1. **Deterministic linters** (fast, cheap, consistent)
|
|
366
|
-
- ShellCheck for bash
|
|
367
|
-
- ESLint for JavaScript
|
|
368
|
-
- Ruff/Pylint for Python
|
|
369
|
-
- Run these FIRST, automatically
|
|
370
|
-
|
|
371
|
-
2. **Static analysis tools** (comprehensive, still fast)
|
|
372
|
-
- SonarCloud, Codacy, CodeFactor
|
|
373
|
-
- Security scanners (Snyk, Secretlint)
|
|
374
|
-
- Run after linters pass
|
|
375
|
-
|
|
376
|
-
3. **LLM review** (expensive, slow, variable)
|
|
377
|
-
- CodeRabbit, AI-assisted review
|
|
378
|
-
- Use for architectural concerns
|
|
379
|
-
- Use when deterministic tools insufficient
|
|
380
|
-
|
|
381
|
-
**In agent instructions:**
|
|
382
|
-
|
|
383
|
-
```markdown
|
|
384
|
-
# Good
|
|
385
|
-
Run ShellCheck before committing. Use `@code-standards` for comprehensive analysis.
|
|
386
|
-
|
|
387
|
-
# Bad
|
|
388
|
-
Ask the AI to check your code formatting and style.
|
|
389
|
-
```text
|
|
390
|
-
|
|
391
|
-
**Consider bun for performance:**
|
|
392
|
-
Where agents reference `npm` or `npx`, consider if `bun` would be faster:
|
|
393
|
-
- `bun` is significantly faster for package operations
|
|
394
|
-
- Compatible with most npm packages
|
|
395
|
-
- Prefer `bunx` over `npx` for one-off executions
|
|
396
|
-
|
|
397
|
-
### Information Quality (All Domains)
|
|
398
|
-
|
|
399
|
-
Agent instructions must be accurate. Apply these standards:
|
|
400
|
-
|
|
401
|
-
#### Source Evaluation
|
|
402
|
-
|
|
403
|
-
1. **Primary sources preferred**
|
|
404
|
-
- Official documentation over blog posts
|
|
405
|
-
- API specs over tutorials
|
|
406
|
-
- First-hand data over summaries
|
|
407
|
-
|
|
408
|
-
2. **Cross-reference claims**
|
|
409
|
-
- Verify facts across multiple sources
|
|
410
|
-
- Note when sources disagree
|
|
411
|
-
- Prefer recent over dated sources
|
|
412
|
-
|
|
413
|
-
3. **Bias awareness**
|
|
414
|
-
- Consider source's agenda (vendor docs promote their product)
|
|
415
|
-
- Note commercial vs independent sources
|
|
416
|
-
- Acknowledge limitations of any source
|
|
417
|
-
|
|
418
|
-
4. **Fact-checking**
|
|
419
|
-
- Commands should be tested before documenting
|
|
420
|
-
- URLs should be verified accessible
|
|
421
|
-
- Version numbers should be current
|
|
422
|
-
|
|
423
|
-
#### Domain-Specific Considerations
|
|
424
|
-
|
|
425
|
-
| Domain | Primary Sources | Watch For |
|
|
426
|
-
|--------|-----------------|-----------|
|
|
427
|
-
| **Code/DevOps** | Official docs, RFCs, source code | Outdated tutorials, version drift |
|
|
428
|
-
| **SEO** | SERPsWebmaster tools, Search Console data, Domain Rank, Search Volume, Link Juice, Topical Relevance, Entity Authority | SEO vendor claims, outdated tactics, Google FUD |
|
|
429
|
-
| **Legal** | Legislation, case law, official guidance | Jurisdiction differences, dated info |
|
|
430
|
-
| **Health** | Peer-reviewed research, official health bodies, practicing researchers | Commercial health claims, fads, conflicted interests |
|
|
431
|
-
| **Marketing** | Platform official docs, first-party data, clickbait effectiveness, integrity | Vendor case studies, inflated metrics, conflicted interests |
|
|
432
|
-
| **Accounting** | Tax authority guidance, accounting standards, meaningful chart of accounts, clear audit trails for events, reasons, and changes | Jurisdiction-specific rules |
|
|
433
|
-
| **Content** | Style guides, brand guidelines, readability, tone of voice, shorter sentences, one sentence per paragraph for online content, Plain English, personal experience, first-person voice unless otherwise appropriate, references, quotes, citations, facts, supporting data, observations | Subjective preferences as rules, bias, lack of references and citations, opinions |
|
|
434
|
-
|
|
435
|
-
### Agent Design Checklist
|
|
436
|
-
|
|
437
|
-
Before adding content to any agent file:
|
|
438
|
-
|
|
439
|
-
1. **Does this subagent have YAML frontmatter?**
|
|
440
|
-
- All subagents require tool permission declarations
|
|
441
|
-
- Without frontmatter, agents default to read-only
|
|
442
|
-
- See "Subagent YAML Frontmatter" section for template
|
|
443
|
-
|
|
444
|
-
2. **Is this universally applicable?**
|
|
445
|
-
- Will this instruction be relevant to >80% of tasks for this agent?
|
|
446
|
-
- If not, move to a more specific subagent
|
|
447
|
-
|
|
448
|
-
3. **Could this be a pointer instead?**
|
|
449
|
-
- Does the content exist elsewhere?
|
|
450
|
-
- Use search patterns to reference codebase
|
|
451
|
-
- Use Context7 MCP for external library documentation
|
|
452
|
-
|
|
453
|
-
4. **Is this a code example?**
|
|
454
|
-
- Is it authoritative (the reference implementation)?
|
|
455
|
-
- Will it drift from actual implementation?
|
|
456
|
-
- For security patterns: include placeholders, note secure storage
|
|
457
|
-
|
|
458
|
-
5. **What's the instruction count impact?**
|
|
459
|
-
- Each bullet point, rule, or directive counts
|
|
460
|
-
- Combine related instructions where possible
|
|
461
|
-
- Remove redundant or obvious instructions
|
|
462
|
-
|
|
463
|
-
6. **Does this duplicate other agents?**
|
|
464
|
-
- Search: `rg "pattern" .agent/` before adding
|
|
465
|
-
- Check for conflicting guidance across files
|
|
466
|
-
- Single source of truth for each concept
|
|
467
|
-
|
|
468
|
-
7. **Should another agent be called instead?**
|
|
469
|
-
- Does an existing agent handle this?
|
|
470
|
-
- Would calling it and improving its instructions be more efficient than duplicating?
|
|
471
|
-
|
|
472
|
-
8. **Are sources verified?**
|
|
473
|
-
- Primary sources used?
|
|
474
|
-
- Facts cross-referenced?
|
|
475
|
-
- Biases acknowledged?
|
|
476
|
-
|
|
477
|
-
### Progressive Disclosure Pattern
|
|
478
|
-
|
|
479
|
-
Instead of putting everything in AGENTS.md:
|
|
480
|
-
|
|
481
|
-
```markdown
|
|
482
|
-
# Bad: Everything in AGENTS.md
|
|
483
|
-
## Database Schema Guidelines
|
|
484
|
-
[50 lines of schema rules...]
|
|
485
|
-
|
|
486
|
-
## API Design Patterns
|
|
487
|
-
[40 lines of API rules...]
|
|
488
|
-
|
|
489
|
-
## Testing Requirements
|
|
490
|
-
[30 lines of testing rules...]
|
|
491
|
-
```text
|
|
492
|
-
|
|
493
|
-
```markdown
|
|
494
|
-
# Good: Pointers in AGENTS.md, details in subagents
|
|
495
|
-
## Subagent Index
|
|
496
|
-
- `tools/code-review/` - Quality standards, testing, linting
|
|
497
|
-
- `aidevops/architecture.md` - Schema and API patterns
|
|
498
|
-
|
|
499
|
-
Read subagents only when task requires them.
|
|
500
|
-
```text
|
|
501
|
-
|
|
502
|
-
### Code Examples: When to Use
|
|
503
|
-
|
|
504
|
-
**Include code examples when:**
|
|
505
|
-
|
|
506
|
-
1. **It's the authoritative reference** - No implementation exists elsewhere
|
|
507
|
-
|
|
508
|
-
```bash
|
|
509
|
-
# Pattern for credential storage (authoritative)
|
|
510
|
-
# Store actual values in ~/.config/aidevops/mcp-env.sh
|
|
511
|
-
export SERVICE_API_KEY="${SERVICE_API_KEY:-}"
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
2. **Security-critical template** - Must be followed exactly
|
|
515
|
-
|
|
516
|
-
```bash
|
|
517
|
-
# Correct: Placeholder for secret
|
|
518
|
-
curl -H "Authorization: Bearer ${API_TOKEN}" ...
|
|
519
|
-
|
|
520
|
-
# Wrong: Actual secret in example
|
|
521
|
-
curl -H "Authorization: Bearer sk-abc123..." ...
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
3. **Command syntax reference** - The example IS the documentation
|
|
525
|
-
|
|
526
|
-
```bash
|
|
527
|
-
.agent/scripts/[service]-helper.sh [command] [account] [target]
|
|
528
|
-
```
|
|
529
|
-
|
|
530
|
-
**Avoid code examples when:**
|
|
531
|
-
|
|
532
|
-
1. **Code exists in codebase** - Use search pattern reference
|
|
533
|
-
|
|
534
|
-
```markdown
|
|
535
|
-
# Bad
|
|
536
|
-
Here's how to handle errors:
|
|
537
|
-
[20 lines of error handling code]
|
|
538
|
-
|
|
539
|
-
# Good
|
|
540
|
-
Search for `handle_api_error` in service-helper.sh for error handling pattern.
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
2. **External library patterns** - Use Context7 MCP
|
|
544
|
-
|
|
545
|
-
```markdown
|
|
546
|
-
# Bad
|
|
547
|
-
Here's the React Query pattern:
|
|
548
|
-
[code that may be outdated]
|
|
549
|
-
|
|
550
|
-
# Good
|
|
551
|
-
Use Context7 MCP to fetch current React Query documentation
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
3. **Will become outdated** - Point to maintained source
|
|
555
|
-
|
|
556
|
-
```markdown
|
|
557
|
-
# Bad
|
|
558
|
-
Current API endpoint: https://api.service.com/v2/...
|
|
559
|
-
|
|
560
|
-
# Good
|
|
561
|
-
See `configs/service-config.json.txt` for current endpoints
|
|
562
|
-
```
|
|
563
|
-
|
|
564
|
-
### Testing Code Examples
|
|
565
|
-
|
|
566
|
-
When code examples are used during a task:
|
|
567
|
-
|
|
568
|
-
1. **Test the example** - Does it produce expected results?
|
|
569
|
-
2. **If failure** - Trigger self-assessment
|
|
570
|
-
3. **Evaluate cause**:
|
|
571
|
-
- Example outdated? Update or add version note
|
|
572
|
-
- Context different? Add clarifying conditions
|
|
573
|
-
- Example wrong? Fix and check for duplicates
|
|
574
|
-
|
|
575
|
-
### Self-Assessment Protocol
|
|
576
|
-
|
|
577
|
-
#### Triggers
|
|
578
|
-
|
|
579
|
-
1. **Observable Failure**
|
|
580
|
-
- Command syntax fails (API changed)
|
|
581
|
-
- Paths/URLs don't exist (infrastructure changed)
|
|
582
|
-
- Auth patterns don't work (security model changed)
|
|
583
|
-
|
|
584
|
-
2. **User Correction**
|
|
585
|
-
- Immediate trigger for self-assessment
|
|
586
|
-
- Analyze which instruction led to incorrect response
|
|
587
|
-
- Consider if correction applies to other contexts
|
|
588
|
-
|
|
589
|
-
3. **Contradiction Detection**
|
|
590
|
-
- Context7 MCP documentation differs from agent
|
|
591
|
-
- Codebase patterns differ from instructions
|
|
592
|
-
- User requirements conflict with instructions
|
|
593
|
-
|
|
594
|
-
4. **Staleness Indicators**
|
|
595
|
-
- Version numbers don't match installed versions
|
|
596
|
-
- Deprecated APIs/tools referenced
|
|
597
|
-
- "Last updated" significantly old
|
|
598
|
-
|
|
599
|
-
#### Process
|
|
600
|
-
|
|
601
|
-
1. **Complete current task first** - Never abandon user's goal
|
|
602
|
-
|
|
603
|
-
2. **Identify root cause**:
|
|
604
|
-
- Which specific instruction led to the issue?
|
|
605
|
-
- Is this a single-point fix or systemic pattern?
|
|
606
|
-
|
|
607
|
-
3. **Duplicate/Conflict Check** (CRITICAL):
|
|
608
|
-
|
|
609
|
-
```bash
|
|
610
|
-
# Search for similar instructions
|
|
611
|
-
rg "pattern" .agent/
|
|
612
|
-
|
|
613
|
-
# Check files that might have parallel instructions
|
|
614
|
-
# Note potential conflicts if change is made
|
|
615
|
-
```
|
|
616
|
-
|
|
617
|
-
4. **Propose improvement**:
|
|
618
|
-
- Specific change with rationale
|
|
619
|
-
- List ALL files that may need coordinated updates
|
|
620
|
-
- Flag if change might conflict with other agents
|
|
621
|
-
|
|
622
|
-
5. **Request permission**:
|
|
623
|
-
|
|
624
|
-
```text
|
|
625
|
-
> Agent Feedback: While [task], I noticed [issue] in
|
|
626
|
-
> `.agent/[file].md`. Related instructions also exist in
|
|
627
|
-
> `[other-files]`. Suggested improvement: [change].
|
|
628
|
-
> Should I update these after completing your request?
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
#### Self-Assessment of Self-Assessment
|
|
632
|
-
|
|
633
|
-
This protocol should also be reviewed when:
|
|
634
|
-
- False positives occur (unnecessary suggestions)
|
|
635
|
-
- False negatives occur (missed opportunities)
|
|
636
|
-
- User feedback indicates protocol is too aggressive/passive
|
|
637
|
-
- Duplicate detection fails to catch conflicts
|
|
638
|
-
|
|
639
|
-
### Agent File Structure Convention
|
|
640
|
-
|
|
641
|
-
All agent files should follow this structure:
|
|
642
|
-
|
|
643
|
-
**Main agents** (no frontmatter required):
|
|
644
|
-
|
|
645
|
-
```markdown
|
|
646
|
-
# Agent Name - Brief Purpose
|
|
647
|
-
|
|
648
|
-
<!-- AI-CONTEXT-START -->
|
|
649
|
-
|
|
650
|
-
## Quick Reference
|
|
651
|
-
|
|
652
|
-
- **Purpose**: One-line description
|
|
653
|
-
- **Key Info**: Essential facts only (avoid numbers that change)
|
|
654
|
-
- **Commands**: Primary commands if applicable
|
|
655
|
-
|
|
656
|
-
[Condensed, universally-applicable content]
|
|
657
|
-
|
|
658
|
-
<!-- AI-CONTEXT-END -->
|
|
659
|
-
|
|
660
|
-
## Detailed Documentation
|
|
661
|
-
|
|
662
|
-
[Verbose human-readable content, examples, edge cases]
|
|
663
|
-
[Read only when specific details needed]
|
|
664
|
-
```text
|
|
665
|
-
|
|
666
|
-
**Subagents** (YAML frontmatter required):
|
|
667
|
-
|
|
668
|
-
```markdown
|
|
669
|
-
---
|
|
670
|
-
description: Brief description of agent purpose
|
|
671
|
-
mode: subagent
|
|
672
|
-
tools:
|
|
673
|
-
read: true
|
|
674
|
-
write: false
|
|
675
|
-
edit: false
|
|
676
|
-
bash: false
|
|
677
|
-
glob: true
|
|
678
|
-
grep: true
|
|
679
|
-
webfetch: false
|
|
680
|
-
task: true
|
|
681
|
-
---
|
|
682
|
-
|
|
683
|
-
# Subagent Name - Brief Purpose
|
|
684
|
-
|
|
685
|
-
[Subagent content...]
|
|
686
|
-
```text
|
|
687
|
-
|
|
688
|
-
See "Subagent YAML Frontmatter" section for full permission options.
|
|
689
|
-
|
|
690
|
-
**Avoid in agents:**
|
|
691
|
-
- Hardcoded counts that change (e.g., "29+ services")
|
|
692
|
-
- Specific version numbers unless critical
|
|
693
|
-
- Dates that will become stale
|
|
694
|
-
|
|
695
|
-
### Folder Organization
|
|
696
|
-
|
|
697
|
-
```text
|
|
698
|
-
.agent/
|
|
699
|
-
├── AGENTS.md # Entry point (ALLCAPS - special root file)
|
|
700
|
-
├── {domain}.md # Main agents at root (lowercase)
|
|
701
|
-
├── {domain}/ # Subagents for that domain
|
|
702
|
-
│ ├── {subagent}.md # Specialized guidance (lowercase)
|
|
703
|
-
├── tools/ # Cross-domain utilities
|
|
704
|
-
│ ├── {category}/ # Grouped by function
|
|
705
|
-
├── services/ # External integrations
|
|
706
|
-
│ ├── {category}/ # Grouped by type
|
|
707
|
-
└── workflows/ # Process guides
|
|
708
|
-
```text
|
|
709
|
-
|
|
710
|
-
**Naming conventions:**
|
|
711
|
-
|
|
712
|
-
- **Main agents**: Lowercase with hyphens at root (`build-mcp.md`, `seo.md`)
|
|
713
|
-
- **Subagents**: Lowercase with hyphens in folders (`build-mcp/deployment.md`)
|
|
714
|
-
- **Special files**: ALLCAPS for entry points only (`AGENTS.md`, `README.md`)
|
|
715
|
-
- **Pattern**: Main agent matches folder name: `{domain}.md` + `{domain}/`
|
|
716
|
-
|
|
717
|
-
**Why lowercase for main agents (not ALLCAPS)?**
|
|
718
|
-
|
|
719
|
-
- Location (root vs folder) already distinguishes main from subagents
|
|
720
|
-
- ALLCAPS causes cross-platform issues (Linux is case-sensitive)
|
|
721
|
-
- Matches common framework conventions (OpenCode, Cursor, Continue)
|
|
722
|
-
- `ls .agent/*.md` instantly shows all main agents
|
|
723
|
-
|
|
724
|
-
**Why main agents stay at root (not inside folders)?**
|
|
725
|
-
|
|
726
|
-
- Tooling uses `find -mindepth 2` to discover subagents
|
|
727
|
-
- Quick visibility: main agents visible without opening folders
|
|
728
|
-
- Clear mental model: "main file + supporting folder"
|
|
729
|
-
- OpenCode expects main agents at predictable paths
|
|
730
|
-
|
|
731
|
-
**Main agent → subagent relationship:**
|
|
732
|
-
|
|
733
|
-
Main agents provide overview and point to subagents for details (progressive disclosure):
|
|
734
|
-
|
|
735
|
-
```markdown
|
|
736
|
-
**Subagents** (`build-mcp/`):
|
|
737
|
-
| Subagent | When to Read |
|
|
738
|
-
|----------|--------------|
|
|
739
|
-
| `deployment.md` | Adding MCP to AI assistants |
|
|
740
|
-
| `server-patterns.md` | Registering tools, resources |
|
|
741
|
-
```text
|
|
742
|
-
|
|
743
|
-
### Deployment Sync
|
|
744
|
-
|
|
745
|
-
Agent changes in `.agent/` require `setup.sh` to deploy to `~/.aidevops/agents/`:
|
|
746
|
-
|
|
747
|
-
```bash
|
|
748
|
-
cd ~/Git/aidevops && ./setup.sh
|
|
749
|
-
```text
|
|
750
|
-
|
|
751
|
-
**Offer to run setup.sh when:**
|
|
752
|
-
- Creating new agents
|
|
753
|
-
- Renaming or moving agents
|
|
754
|
-
- Merging or deleting agents
|
|
755
|
-
- Modifying agent content users need immediately
|
|
756
|
-
|
|
757
|
-
See `aidevops/setup.md` for deployment details.
|
|
758
|
-
|
|
759
|
-
### Reviewing Existing Agents
|
|
760
|
-
|
|
761
|
-
See `build-agent/agent-review.md` for systematic review sessions. It covers instruction budgets, universal applicability, duplicates, code examples, AI-CONTEXT blocks, stale content, and MCP configuration.
|
|
762
|
-
|
|
763
|
-
## Oh-My-OpenCode Integration
|
|
764
|
-
|
|
765
|
-
When oh-my-opencode is installed, leverage these specialized agents for enhanced agent development:
|
|
766
|
-
|
|
767
|
-
| OmO Agent | When to Use | Example |
|
|
768
|
-
|-----------|-------------|---------|
|
|
769
|
-
| `@oracle` | Agent architecture review, design decisions | "Ask @oracle to review this agent's instruction structure" |
|
|
770
|
-
| `@librarian` | Find agent design patterns, AGENTS.md examples | "Ask @librarian for examples of well-structured AI agents" |
|
|
771
|
-
| `@document-writer` | Agent documentation, clear instructions | "Ask @document-writer to improve this agent's clarity" |
|
|
772
|
-
|
|
773
|
-
**Agent Design Workflow Enhancement**:
|
|
774
|
-
|
|
775
|
-
```text
|
|
776
|
-
1. Design → Build-Agent creates structure
|
|
777
|
-
2. Review → @oracle validates architecture
|
|
778
|
-
3. Examples → @librarian finds similar patterns
|
|
779
|
-
4. Polish → @document-writer improves clarity
|
|
780
|
-
5. Test → Deploy and validate
|
|
781
|
-
```text
|
|
782
|
-
|
|
783
|
-
**Note**: These agents require [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) plugin.
|
|
784
|
-
See `tools/opencode/oh-my-opencode.md` for installation.
|