This is a Node.js/TypeScript project providing an open-source collection of agent templates, skill definitions, and a CLI tool for OpenCode.
docs/-- 7 documentation files covering OpenCode concepts (agents, skills, MCP, models, rules, tools, permissions)templates/agents/-- 108 agent markdown definitions organized by categorytemplates/skills/-- 15 skill definitions (each in<name>/SKILL.md)templates/configs/-- 5 opencode.json preset configurationscli-tool/-- The@weisser-dev/awesome-opencodenpm packagecli-tool/src/index.js-- Entry point, flow control, re-run detectioncli-tool/src/setup.js-- Core logic: detection, prompts, model intelligence, file generation (~1800 lines)cli-tool/templates/-- Bundled copy of templates for npm distributioncli-tool/scripts/sync-templates.js-- Pre-publish script to sync templates from repo root
The CLI tool (cli-tool/src/setup.js) is the main codebase. It is a single-file ESM module using:
@inquirer/promptsfor interactive CLI prompts (checkbox, select, confirm, input)chalkfor terminal colorsorafor spinner animationsnode:fs,node:pathfor file operationsnode:child_processfor spawning OpenCode after setup
Key data structures:
EXTENSION_HINTS-- Maps file extensions to language/category for auto-detectionLANGUAGE_OPTIONS-- 27+ selectable languages/technologiesAVAILABLE_AGENTS-- 108 agents with name, description, and categoryAVAILABLE_SKILLS-- 15 skills with name and descriptionMODEL_FINGERPRINTS-- 26 regex patterns to identify models from any providerAGENT_TIERS-- Maps agent names to model quality requirements (frontier/strong/fast)AVAILABLE_MCP-- 18 curated MCP servers with language relevance tagsMODEL_PRESETS-- 4 preset model strategies + keep + auto-optimize
- Pure ESM (
"type": "module"in package.json) - Node.js 18+ required (uses global
fetch,AbortSignal.timeout) - No build step -- raw JavaScript, not TypeScript
- All functions are exported and imported explicitly (no default exports except in index.js)
- Template files use YAML frontmatter for agent/skill metadata
- Install:
npm install(in cli-tool/) - Run locally:
node src/index.js(in cli-tool/) - Link globally:
npm link(in cli-tool/) - Sync templates:
node scripts/sync-templates.js(in cli-tool/) - Check syntax:
node --check src/setup.js - Dry-run publish:
npm pack --dry-run(in cli-tool/)
There are currently no automated tests. To verify changes:
node --check cli-tool/src/setup.js-- Syntax validationnpm linkin cli-tool/ then runawesome-opencodein a test project- Verify all exports match:
grep "^export " cli-tool/src/setup.js - Count agents:
grep "category:" cli-tool/src/setup.js | grep "value:" | wc -l(should be 108) - Count skills:
awk '/^const AVAILABLE_SKILLS/,/^];/' cli-tool/src/setup.js | grep "value:" | wc -l(should be 15)
- Conventional commits:
feat:,fix:,chore:,docs: - Agent filenames are kebab-case matching the agent name (e.g.,
typescript-pro.md) - Skill directories are kebab-case matching the skill name (e.g.,
git-release/SKILL.md) - Skill names must match regex:
^[a-z0-9]+(-[a-z0-9]+)*$ - Agent markdown uses YAML frontmatter with
description,mode,model,temperature,permission - All template files in
templates/are the source of truth;cli-tool/templates/is a synced copy
The following subagents are available for this project:
- @code-reviewer: Code review with security & performance focus
- @docs-writer: Technical documentation writer
- @test-writer: Test generation following project patterns
- git-release: Release notes and version bumps
- changelog-generate: CHANGELOG.md from git history
- ci-pipeline: CI/CD pipeline configuration
- dependency-audit: CVE scan, license check, unused dependencies
- Single setup.js file: All logic in one file for simplicity. Trade-off: file is ~1800 lines. Acceptable because it is all closely related setup logic.
- Templates as files, not embedded strings: Agent/skill templates are markdown files, not JS strings. This makes them editable by users and reviewable in PRs.
- Bundled templates in npm package:
cli-tool/templates/is a copy oftemplates/synced viaprepublishOnly. This ensuresnpxworks without the full repo. - Model fingerprinting via regex: Simple pattern matching against model IDs. Works for all known providers. Easy to extend with new patterns.
- No runtime API calls for pricing: Model benchmark scores and cost tiers are embedded, not fetched live. This avoids network dependencies during setup.
- MCP registry search is optional: Curated list is shown first, registry search is offered as a follow-up step. This keeps the happy path fast.