Merge pull request #55 from 4shil/cross-platform-support
feat: multi-tool integration scripts (Antigravity, Gemini CLI, OpenCode, Cursor, Aider, Windsurf)
This commit is contained in:
11
.gitignore
vendored
11
.gitignore
vendored
@@ -62,3 +62,14 @@ scratch/
|
||||
notes/
|
||||
TODO.md
|
||||
NOTES.md
|
||||
|
||||
# Generated integration files — run scripts/convert.sh to regenerate locally
|
||||
# The scripts/ and integrations/*/README.md files ARE committed; only generated
|
||||
# agent/skill files are excluded.
|
||||
integrations/antigravity/agency-*/
|
||||
integrations/gemini-cli/skills/
|
||||
integrations/gemini-cli/gemini-extension.json
|
||||
integrations/opencode/agent/
|
||||
integrations/cursor/rules/
|
||||
integrations/aider/CONVENTIONS.md
|
||||
integrations/windsurf/.windsurfrules
|
||||
|
||||
233
README.md
233
README.md
@@ -44,6 +44,23 @@ Each agent file contains:
|
||||
|
||||
Browse the agents below and copy/adapt the ones you need!
|
||||
|
||||
### Option 3: Use with Other Tools (Cursor, Aider, Windsurf, Gemini CLI, OpenCode)
|
||||
|
||||
```bash
|
||||
# Step 1 -- generate integration files for all supported tools
|
||||
./scripts/convert.sh
|
||||
|
||||
# Step 2 -- install interactively (auto-detects what you have installed)
|
||||
./scripts/install.sh
|
||||
|
||||
# Or target a specific tool directly
|
||||
./scripts/install.sh --tool cursor
|
||||
./scripts/install.sh --tool aider
|
||||
./scripts/install.sh --tool windsurf
|
||||
```
|
||||
|
||||
See the [Multi-Tool Integrations](#-multi-tool-integrations) section below for full details.
|
||||
|
||||
---
|
||||
|
||||
## 🎨 The Agency Roster
|
||||
@@ -289,19 +306,19 @@ Each agent is designed with:
|
||||
|
||||
> "I don't just test your code - I default to finding 3-5 issues and require visual proof for everything."
|
||||
>
|
||||
> — **Evidence Collector** (Testing Division)
|
||||
> -- **Evidence Collector** (Testing Division)
|
||||
|
||||
> "You're not marketing on Reddit - you're becoming a valued community member who happens to represent a brand."
|
||||
>
|
||||
> — **Reddit Community Builder** (Marketing Division)
|
||||
> -- **Reddit Community Builder** (Marketing Division)
|
||||
|
||||
> "Every playful element must serve a functional or emotional purpose. Design delight that enhances rather than distracts."
|
||||
>
|
||||
> — **Whimsy Injector** (Design Division)
|
||||
> -- **Whimsy Injector** (Design Division)
|
||||
|
||||
> "Let me add a celebration animation that reduces task completion anxiety by 40%"
|
||||
>
|
||||
> — **Whimsy Injector** (during a UX review)
|
||||
> -- **Whimsy Injector** (during a UX review)
|
||||
|
||||
---
|
||||
|
||||
@@ -315,21 +332,223 @@ Each agent is designed with:
|
||||
|
||||
---
|
||||
|
||||
## 🔌 Multi-Tool Integrations
|
||||
|
||||
The Agency works natively with Claude Code, and ships conversion + install scripts so you can use the same agents across every major agentic coding tool.
|
||||
|
||||
### Supported Tools
|
||||
|
||||
- **[Claude Code](https://claude.ai/code)** — native `.md` agents, no conversion needed → `~/.claude/agents/`
|
||||
- **[Antigravity](https://github.com/google-gemini/antigravity)** — `SKILL.md` per agent → `~/.gemini/antigravity/skills/`
|
||||
- **[Gemini CLI](https://github.com/google-gemini/gemini-cli)** — extension + `SKILL.md` files → `~/.gemini/extensions/agency-agents/`
|
||||
- **[OpenCode](https://opencode.ai)** — `.md` agent files → `.opencode/agent/`
|
||||
- **[Cursor](https://cursor.sh)** — `.mdc` rule files → `.cursor/rules/`
|
||||
- **[Aider](https://aider.chat)** — single `CONVENTIONS.md` → `./CONVENTIONS.md`
|
||||
- **[Windsurf](https://codeium.com/windsurf)** — single `.windsurfrules` → `./.windsurfrules`
|
||||
|
||||
---
|
||||
|
||||
### ⚡ Quick Install
|
||||
|
||||
**Step 1 -- Generate integration files:**
|
||||
```bash
|
||||
./scripts/convert.sh
|
||||
```
|
||||
|
||||
**Step 2 -- Install (interactive, auto-detects your tools):**
|
||||
```bash
|
||||
./scripts/install.sh
|
||||
```
|
||||
|
||||
The installer scans your system for installed tools, shows a checkbox UI, and lets you pick exactly what to install:
|
||||
|
||||
```
|
||||
+------------------------------------------------+
|
||||
| The Agency -- Tool Installer |
|
||||
+------------------------------------------------+
|
||||
|
||||
System scan: [*] = detected on this machine
|
||||
|
||||
[x] 1) [*] Claude Code (claude.ai/code)
|
||||
[x] 2) [*] Antigravity (~/.gemini/antigravity)
|
||||
[ ] 3) [ ] Gemini CLI (gemini extension)
|
||||
[ ] 4) [ ] OpenCode (opencode.ai)
|
||||
[x] 5) [*] Cursor (.cursor/rules)
|
||||
[ ] 6) [ ] Aider (CONVENTIONS.md)
|
||||
[ ] 7) [ ] Windsurf (.windsurfrules)
|
||||
|
||||
[1-7] toggle [a] all [n] none [d] detected
|
||||
[Enter] install [q] quit
|
||||
```
|
||||
|
||||
**Or install a specific tool directly:**
|
||||
```bash
|
||||
./scripts/install.sh --tool cursor
|
||||
./scripts/install.sh --tool opencode
|
||||
./scripts/install.sh --tool antigravity
|
||||
```
|
||||
|
||||
**Non-interactive (CI/scripts):**
|
||||
```bash
|
||||
./scripts/install.sh --no-interactive --tool all
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Tool-Specific Instructions
|
||||
|
||||
<details>
|
||||
<summary><strong>Claude Code</strong></summary>
|
||||
|
||||
Agents are copied directly from the repo into `~/.claude/agents/` -- no conversion needed.
|
||||
|
||||
```bash
|
||||
./scripts/install.sh --tool claude-code
|
||||
```
|
||||
|
||||
Then activate in Claude Code:
|
||||
```
|
||||
Use the Frontend Developer agent to review this component.
|
||||
```
|
||||
|
||||
See [integrations/claude-code/README.md](integrations/claude-code/README.md) for details.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Antigravity (Gemini)</strong></summary>
|
||||
|
||||
Each agent becomes a skill in `~/.gemini/antigravity/skills/agency-<slug>/`.
|
||||
|
||||
```bash
|
||||
./scripts/install.sh --tool antigravity
|
||||
```
|
||||
|
||||
Activate in Gemini with Antigravity:
|
||||
```
|
||||
@agency-frontend-developer review this React component
|
||||
```
|
||||
|
||||
See [integrations/antigravity/README.md](integrations/antigravity/README.md) for details.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Gemini CLI</strong></summary>
|
||||
|
||||
Installs as a Gemini CLI extension with 61 skills + a manifest.
|
||||
|
||||
```bash
|
||||
./scripts/install.sh --tool gemini-cli
|
||||
```
|
||||
|
||||
See [integrations/gemini-cli/README.md](integrations/gemini-cli/README.md) for details.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>OpenCode</strong></summary>
|
||||
|
||||
Agents are placed in `.opencode/agent/` in your project root (project-scoped).
|
||||
|
||||
```bash
|
||||
cd /your/project
|
||||
/path/to/agency-agents/scripts/install.sh --tool opencode
|
||||
```
|
||||
|
||||
Or install globally:
|
||||
```bash
|
||||
mkdir -p ~/.config/opencode/agent
|
||||
cp integrations/opencode/agent/*.md ~/.config/opencode/agent/
|
||||
```
|
||||
|
||||
Activate in OpenCode:
|
||||
```
|
||||
Use the Backend Architect agent to design this API.
|
||||
```
|
||||
|
||||
See [integrations/opencode/README.md](integrations/opencode/README.md) for details.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Cursor</strong></summary>
|
||||
|
||||
Each agent becomes a `.mdc` rule file in `.cursor/rules/` of your project.
|
||||
|
||||
```bash
|
||||
cd /your/project
|
||||
/path/to/agency-agents/scripts/install.sh --tool cursor
|
||||
```
|
||||
|
||||
Rules are auto-applied when Cursor detects them in the project. Reference them explicitly:
|
||||
```
|
||||
Use the @security-engineer rules to review this code.
|
||||
```
|
||||
|
||||
See [integrations/cursor/README.md](integrations/cursor/README.md) for details.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Aider</strong></summary>
|
||||
|
||||
All agents are compiled into a single `CONVENTIONS.md` file that Aider reads automatically.
|
||||
|
||||
```bash
|
||||
cd /your/project
|
||||
/path/to/agency-agents/scripts/install.sh --tool aider
|
||||
```
|
||||
|
||||
Then reference agents in your Aider session:
|
||||
```
|
||||
Use the Frontend Developer agent to refactor this component.
|
||||
```
|
||||
|
||||
See [integrations/aider/README.md](integrations/aider/README.md) for details.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Windsurf</strong></summary>
|
||||
|
||||
All agents are compiled into `.windsurfrules` in your project root.
|
||||
|
||||
```bash
|
||||
cd /your/project
|
||||
/path/to/agency-agents/scripts/install.sh --tool windsurf
|
||||
```
|
||||
|
||||
Reference agents in Windsurf's Cascade:
|
||||
```
|
||||
Use the Reality Checker agent to verify this is production ready.
|
||||
```
|
||||
|
||||
See [integrations/windsurf/README.md](integrations/windsurf/README.md) for details.
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
### Regenerating After Changes
|
||||
|
||||
When you add new agents or edit existing ones, regenerate all integration files:
|
||||
|
||||
```bash
|
||||
./scripts/convert.sh # regenerate all
|
||||
./scripts/convert.sh --tool cursor # regenerate just one tool
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Roadmap
|
||||
|
||||
- [ ] Interactive agent selector web tool
|
||||
- [x] Multi-agent workflow examples — see [examples/](examples/)
|
||||
- [x] Multi-agent workflow examples -- see [examples/](examples/)
|
||||
- [x] Multi-tool integration scripts (Claude Code, Antigravity, Gemini CLI, OpenCode, Cursor, Aider, Windsurf)
|
||||
- [ ] Video tutorials on agent design
|
||||
- [ ] Community agent marketplace
|
||||
- [ ] Agent "personality quiz" for project matching
|
||||
- [ ] Integration examples with popular tools
|
||||
- [ ] "Agent of the Week" showcase series
|
||||
|
||||
---
|
||||
|
||||
## 🌐 Community Translations & Localizations
|
||||
|
||||
Community-maintained translations and regional adaptations. These are independently maintained — see each repo for coverage and version compatibility.
|
||||
Community-maintained translations and regional adaptations. These are independently maintained -- see each repo for coverage and version compatibility.
|
||||
|
||||
| Language | Maintainer | Link | Notes |
|
||||
|----------|-----------|------|-------|
|
||||
|
||||
117
integrations/README.md
Normal file
117
integrations/README.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# 🔌 Integrations
|
||||
|
||||
This directory contains The Agency's 61 AI agents converted into formats
|
||||
compatible with popular agentic coding tools.
|
||||
|
||||
## Supported Tools
|
||||
|
||||
- **[Claude Code](#claude-code)** — `.md` agents, use the repo directly
|
||||
- **[Antigravity](#antigravity)** — `SKILL.md` per agent in `antigravity/`
|
||||
- **[Gemini CLI](#gemini-cli)** — extension + `SKILL.md` files in `gemini-cli/`
|
||||
- **[OpenCode](#opencode)** — `.md` agent files in `opencode/`
|
||||
- **[Cursor](#cursor)** — `.mdc` rule files in `cursor/`
|
||||
- **[Aider](#aider)** — `CONVENTIONS.md` in `aider/`
|
||||
- **[Windsurf](#windsurf)** — `.windsurfrules` in `windsurf/`
|
||||
|
||||
## Quick Install
|
||||
|
||||
```bash
|
||||
# Install for all detected tools automatically
|
||||
./scripts/install.sh
|
||||
|
||||
# Install for a specific tool
|
||||
./scripts/install.sh --tool antigravity
|
||||
./scripts/install.sh --tool gemini-cli
|
||||
./scripts/install.sh --tool cursor
|
||||
./scripts/install.sh --tool aider
|
||||
./scripts/install.sh --tool windsurf
|
||||
./scripts/install.sh --tool claude-code
|
||||
```
|
||||
|
||||
## Regenerating Integration Files
|
||||
|
||||
If you add or modify agents, regenerate all integration files:
|
||||
|
||||
```bash
|
||||
./scripts/convert.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Claude Code
|
||||
|
||||
The Agency was originally designed for Claude Code. Agents work natively
|
||||
without conversion.
|
||||
|
||||
```bash
|
||||
cp -r <category>/*.md ~/.claude/agents/
|
||||
# or install everything at once:
|
||||
./scripts/install.sh --tool claude-code
|
||||
```
|
||||
|
||||
See [claude-code/README.md](claude-code/README.md) for details.
|
||||
|
||||
---
|
||||
|
||||
## Antigravity
|
||||
|
||||
Skills are installed to `~/.gemini/antigravity/skills/`. Each agent becomes
|
||||
a separate skill prefixed with `agency-` to avoid naming conflicts.
|
||||
|
||||
```bash
|
||||
./scripts/install.sh --tool antigravity
|
||||
```
|
||||
|
||||
See [antigravity/README.md](antigravity/README.md) for details.
|
||||
|
||||
---
|
||||
|
||||
## Gemini CLI
|
||||
|
||||
Agents are packaged as a Gemini CLI extension with individual skill files.
|
||||
The extension is installed to `~/.gemini/extensions/agency-agents/`.
|
||||
|
||||
```bash
|
||||
./scripts/install.sh --tool gemini-cli
|
||||
```
|
||||
|
||||
See [gemini-cli/README.md](gemini-cli/README.md) for details.
|
||||
|
||||
---
|
||||
|
||||
## Cursor
|
||||
|
||||
Each agent becomes a `.mdc` rule file. Rules are project-scoped — run the
|
||||
installer from your project root.
|
||||
|
||||
```bash
|
||||
cd /your/project && /path/to/agency-agents/scripts/install.sh --tool cursor
|
||||
```
|
||||
|
||||
See [cursor/README.md](cursor/README.md) for details.
|
||||
|
||||
---
|
||||
|
||||
## Aider
|
||||
|
||||
All agents are consolidated into a single `CONVENTIONS.md` file that Aider
|
||||
reads automatically when present in your project root.
|
||||
|
||||
```bash
|
||||
cd /your/project && /path/to/agency-agents/scripts/install.sh --tool aider
|
||||
```
|
||||
|
||||
See [aider/README.md](aider/README.md) for details.
|
||||
|
||||
---
|
||||
|
||||
## Windsurf
|
||||
|
||||
All agents are consolidated into a single `.windsurfrules` file for your
|
||||
project root.
|
||||
|
||||
```bash
|
||||
cd /your/project && /path/to/agency-agents/scripts/install.sh --tool windsurf
|
||||
```
|
||||
|
||||
See [windsurf/README.md](windsurf/README.md) for details.
|
||||
38
integrations/aider/README.md
Normal file
38
integrations/aider/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Aider Integration
|
||||
|
||||
All 61 Agency agents are consolidated into a single `CONVENTIONS.md` file.
|
||||
Aider reads this file automatically when it's present in your project root.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# Run from your project root
|
||||
cd /your/project
|
||||
/path/to/agency-agents/scripts/install.sh --tool aider
|
||||
```
|
||||
|
||||
## Activate an Agent
|
||||
|
||||
In your Aider session, reference the agent by name:
|
||||
|
||||
```
|
||||
Use the Frontend Developer agent to refactor this component.
|
||||
```
|
||||
|
||||
```
|
||||
Apply the Reality Checker agent to verify this is production-ready.
|
||||
```
|
||||
|
||||
## Manual Usage
|
||||
|
||||
You can also pass the conventions file directly:
|
||||
|
||||
```bash
|
||||
aider --read CONVENTIONS.md
|
||||
```
|
||||
|
||||
## Regenerate
|
||||
|
||||
```bash
|
||||
./scripts/convert.sh --tool aider
|
||||
```
|
||||
49
integrations/antigravity/README.md
Normal file
49
integrations/antigravity/README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Antigravity Integration
|
||||
|
||||
Installs all 61 Agency agents as Antigravity skills. Each agent is prefixed
|
||||
with `agency-` to avoid conflicts with existing skills.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
./scripts/install.sh --tool antigravity
|
||||
```
|
||||
|
||||
This copies files from `integrations/antigravity/` to
|
||||
`~/.gemini/antigravity/skills/`.
|
||||
|
||||
## Activate a Skill
|
||||
|
||||
In Antigravity, activate an agent by its slug:
|
||||
|
||||
```
|
||||
Use the agency-frontend-developer skill to review this component.
|
||||
```
|
||||
|
||||
Available slugs follow the pattern `agency-<agent-name>`, e.g.:
|
||||
- `agency-frontend-developer`
|
||||
- `agency-backend-architect`
|
||||
- `agency-reality-checker`
|
||||
- `agency-growth-hacker`
|
||||
|
||||
## Regenerate
|
||||
|
||||
After modifying agents, regenerate the skill files:
|
||||
|
||||
```bash
|
||||
./scripts/convert.sh --tool antigravity
|
||||
```
|
||||
|
||||
## File Format
|
||||
|
||||
Each skill is a `SKILL.md` file with Antigravity-compatible frontmatter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: agency-frontend-developer
|
||||
description: Expert frontend developer specializing in...
|
||||
risk: low
|
||||
source: community
|
||||
date_added: '2026-03-08'
|
||||
---
|
||||
```
|
||||
31
integrations/claude-code/README.md
Normal file
31
integrations/claude-code/README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Claude Code Integration
|
||||
|
||||
The Agency was built for Claude Code. No conversion needed — agents work
|
||||
natively with the existing `.md` + YAML frontmatter format.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# Copy all agents to your Claude Code agents directory
|
||||
./scripts/install.sh --tool claude-code
|
||||
|
||||
# Or manually copy a category
|
||||
cp engineering/*.md ~/.claude/agents/
|
||||
```
|
||||
|
||||
## Activate an Agent
|
||||
|
||||
In any Claude Code session, reference an agent by name:
|
||||
|
||||
```
|
||||
Activate Frontend Developer and help me build a React component.
|
||||
```
|
||||
|
||||
```
|
||||
Use the Reality Checker agent to verify this feature is production-ready.
|
||||
```
|
||||
|
||||
## Agent Directory
|
||||
|
||||
Agents are organized into divisions. See the [main README](../../README.md) for
|
||||
the full roster of 61 specialists.
|
||||
38
integrations/cursor/README.md
Normal file
38
integrations/cursor/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Cursor Integration
|
||||
|
||||
Converts all 61 Agency agents into Cursor `.mdc` rule files. Rules are
|
||||
**project-scoped** — install them from your project root.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# Run from your project root
|
||||
cd /your/project
|
||||
/path/to/agency-agents/scripts/install.sh --tool cursor
|
||||
```
|
||||
|
||||
This creates `.cursor/rules/<agent-slug>.mdc` files in your project.
|
||||
|
||||
## Activate a Rule
|
||||
|
||||
In Cursor, reference an agent in your prompt:
|
||||
|
||||
```
|
||||
@frontend-developer Review this React component for performance issues.
|
||||
```
|
||||
|
||||
Or enable a rule as always-on by editing its frontmatter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
description: Expert frontend developer...
|
||||
globs: "**/*.tsx,**/*.ts"
|
||||
alwaysApply: true
|
||||
---
|
||||
```
|
||||
|
||||
## Regenerate
|
||||
|
||||
```bash
|
||||
./scripts/convert.sh --tool cursor
|
||||
```
|
||||
36
integrations/gemini-cli/README.md
Normal file
36
integrations/gemini-cli/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Gemini CLI Integration
|
||||
|
||||
Packages all 61 Agency agents as a Gemini CLI extension. The extension
|
||||
installs to `~/.gemini/extensions/agency-agents/`.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
./scripts/install.sh --tool gemini-cli
|
||||
```
|
||||
|
||||
## Activate a Skill
|
||||
|
||||
In Gemini CLI, reference an agent by name:
|
||||
|
||||
```
|
||||
Use the frontend-developer skill to help me build this UI.
|
||||
```
|
||||
|
||||
## Extension Structure
|
||||
|
||||
```
|
||||
~/.gemini/extensions/agency-agents/
|
||||
gemini-extension.json
|
||||
skills/
|
||||
frontend-developer/SKILL.md
|
||||
backend-architect/SKILL.md
|
||||
reality-checker/SKILL.md
|
||||
...
|
||||
```
|
||||
|
||||
## Regenerate
|
||||
|
||||
```bash
|
||||
./scripts/convert.sh --tool gemini-cli
|
||||
```
|
||||
58
integrations/opencode/README.md
Normal file
58
integrations/opencode/README.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# OpenCode Integration
|
||||
|
||||
OpenCode uses the same agent format as Claude Code — `.md` files with YAML
|
||||
frontmatter stored in `.opencode/agent/`. No conversion is technically
|
||||
needed, but this integration packages the agents into the correct directory
|
||||
structure for drop-in use.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# Run from your project root
|
||||
cd /your/project
|
||||
/path/to/agency-agents/scripts/install.sh --tool opencode
|
||||
```
|
||||
|
||||
This creates `.opencode/agent/<slug>.md` files in your project directory.
|
||||
|
||||
## Activate an Agent
|
||||
|
||||
In OpenCode, reference an agent by its name or description:
|
||||
|
||||
```
|
||||
Use the Frontend Developer agent to help build this component.
|
||||
```
|
||||
|
||||
```
|
||||
Activate the Reality Checker agent and review this PR.
|
||||
```
|
||||
|
||||
You can also select agents from the OpenCode UI's agent picker.
|
||||
|
||||
## Agent Format
|
||||
|
||||
OpenCode agents use the same frontmatter as Claude Code:
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: Frontend Developer
|
||||
description: Expert frontend developer specializing in modern web technologies...
|
||||
color: cyan
|
||||
---
|
||||
```
|
||||
|
||||
## Project vs Global
|
||||
|
||||
Agents in `.opencode/agent/` are **project-scoped**. To make them available
|
||||
globally across all projects, copy them to your OpenCode config directory:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.config/opencode/agent
|
||||
cp integrations/opencode/agent/*.md ~/.config/opencode/agent/
|
||||
```
|
||||
|
||||
## Regenerate
|
||||
|
||||
```bash
|
||||
./scripts/convert.sh --tool opencode
|
||||
```
|
||||
26
integrations/windsurf/README.md
Normal file
26
integrations/windsurf/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Windsurf Integration
|
||||
|
||||
All 61 Agency agents are consolidated into a single `.windsurfrules` file.
|
||||
Rules are **project-scoped** — install them from your project root.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# Run from your project root
|
||||
cd /your/project
|
||||
/path/to/agency-agents/scripts/install.sh --tool windsurf
|
||||
```
|
||||
|
||||
## Activate an Agent
|
||||
|
||||
In Windsurf, reference an agent by name in your prompt:
|
||||
|
||||
```
|
||||
Use the Frontend Developer agent to build this component.
|
||||
```
|
||||
|
||||
## Regenerate
|
||||
|
||||
```bash
|
||||
./scripts/convert.sh --tool windsurf
|
||||
```
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: Senior Project Manager
|
||||
description: Converts specs to tasks, remembers previous projects\n - Focused on realistic scope, no background processes, exact spec requirements
|
||||
description: Converts specs to tasks and remembers previous projects. Focused on realistic scope, no background processes, exact spec requirements
|
||||
color: blue
|
||||
---
|
||||
|
||||
|
||||
362
scripts/convert.sh
Executable file
362
scripts/convert.sh
Executable file
@@ -0,0 +1,362 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# convert.sh — Convert agency agent .md files into tool-specific formats.
|
||||
#
|
||||
# Reads all agent files from the standard category directories and outputs
|
||||
# converted files to integrations/<tool>/. Run this to regenerate all
|
||||
# integration files after adding or modifying agents.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/convert.sh [--tool <name>] [--out <dir>] [--help]
|
||||
#
|
||||
# Tools:
|
||||
# antigravity — Antigravity skill files (~/.gemini/antigravity/skills/)
|
||||
# gemini-cli — Gemini CLI extension (skills/ + gemini-extension.json)
|
||||
# opencode — OpenCode agent files (.opencode/agent/*.md)
|
||||
# cursor — Cursor rule files (.cursor/rules/*.mdc)
|
||||
# aider — Single CONVENTIONS.md for Aider
|
||||
# windsurf — Single .windsurfrules for Windsurf
|
||||
# all — All tools (default)
|
||||
#
|
||||
# Output is written to integrations/<tool>/ relative to the repo root.
|
||||
# This script never touches user config dirs — see install.sh for that.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# --- Colour helpers ---
|
||||
if [[ -t 1 ]]; then
|
||||
GREEN=$'\033[0;32m'; YELLOW=$'\033[1;33m'; RED=$'\033[0;31m'; BOLD=$'\033[1m'; RESET=$'\033[0m'
|
||||
else
|
||||
GREEN=''; YELLOW=''; RED=''; BOLD=''; RESET=''
|
||||
fi
|
||||
|
||||
info() { printf "${GREEN}[OK]${RESET} %s\n" "$*"; }
|
||||
warn() { printf "${YELLOW}[!!]${RESET} %s\n" "$*"; }
|
||||
error() { printf "${RED}[ERR]${RESET} %s\n" "$*" >&2; }
|
||||
header() { echo -e "\n${BOLD}$*${RESET}"; }
|
||||
|
||||
# --- Paths ---
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
OUT_DIR="$REPO_ROOT/integrations"
|
||||
TODAY="$(date +%Y-%m-%d)"
|
||||
|
||||
AGENT_DIRS=(
|
||||
design engineering marketing product project-management
|
||||
testing support spatial-computing specialized
|
||||
)
|
||||
|
||||
# --- Usage ---
|
||||
usage() {
|
||||
sed -n '3,22p' "$0" | sed 's/^# \{0,1\}//'
|
||||
exit 0
|
||||
}
|
||||
|
||||
# --- Frontmatter helpers ---
|
||||
|
||||
# Extract a single field value from YAML frontmatter block.
|
||||
# Usage: get_field <field> <file>
|
||||
get_field() {
|
||||
local field="$1" file="$2"
|
||||
awk -v f="$field" '
|
||||
/^---$/ { fm++; next }
|
||||
fm == 1 && $0 ~ "^" f ": " { sub("^" f ": ", ""); print; exit }
|
||||
' "$file"
|
||||
}
|
||||
|
||||
# Strip the leading frontmatter block and return only the body.
|
||||
# Usage: get_body <file>
|
||||
get_body() {
|
||||
awk 'BEGIN{fm=0} /^---$/{fm++; next} fm>=2{print}' "$1"
|
||||
}
|
||||
|
||||
# Convert a human-readable agent name to a lowercase kebab-case slug.
|
||||
# "Frontend Developer" → "frontend-developer"
|
||||
slugify() {
|
||||
echo "$1" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//'
|
||||
}
|
||||
|
||||
# --- Per-tool converters ---
|
||||
|
||||
convert_antigravity() {
|
||||
local file="$1"
|
||||
local name description slug outdir outfile body
|
||||
|
||||
name="$(get_field "name" "$file")"
|
||||
description="$(get_field "description" "$file")"
|
||||
slug="agency-$(slugify "$name")"
|
||||
body="$(get_body "$file")"
|
||||
|
||||
outdir="$OUT_DIR/antigravity/$slug"
|
||||
outfile="$outdir/SKILL.md"
|
||||
mkdir -p "$outdir"
|
||||
|
||||
# Antigravity SKILL.md format mirrors community skills in ~/.gemini/antigravity/skills/
|
||||
cat > "$outfile" <<HEREDOC
|
||||
---
|
||||
name: ${slug}
|
||||
description: ${description}
|
||||
risk: low
|
||||
source: community
|
||||
date_added: '${TODAY}'
|
||||
---
|
||||
${body}
|
||||
HEREDOC
|
||||
}
|
||||
|
||||
convert_gemini_cli() {
|
||||
local file="$1"
|
||||
local name description slug outdir outfile body
|
||||
|
||||
name="$(get_field "name" "$file")"
|
||||
description="$(get_field "description" "$file")"
|
||||
slug="$(slugify "$name")"
|
||||
body="$(get_body "$file")"
|
||||
|
||||
outdir="$OUT_DIR/gemini-cli/skills/$slug"
|
||||
outfile="$outdir/SKILL.md"
|
||||
mkdir -p "$outdir"
|
||||
|
||||
# Gemini CLI skill format: minimal frontmatter (name + description only)
|
||||
cat > "$outfile" <<HEREDOC
|
||||
---
|
||||
name: ${slug}
|
||||
description: ${description}
|
||||
---
|
||||
${body}
|
||||
HEREDOC
|
||||
}
|
||||
|
||||
convert_opencode() {
|
||||
local file="$1"
|
||||
local name description color slug outfile body
|
||||
|
||||
name="$(get_field "name" "$file")"
|
||||
description="$(get_field "description" "$file")"
|
||||
color="$(get_field "color" "$file")"
|
||||
slug="$(slugify "$name")"
|
||||
body="$(get_body "$file")"
|
||||
|
||||
outfile="$OUT_DIR/opencode/agent/${slug}.md"
|
||||
mkdir -p "$OUT_DIR/opencode/agent"
|
||||
|
||||
# OpenCode agent format: same as the source format (.md with frontmatter).
|
||||
# color field is supported. No conversion needed beyond directory placement.
|
||||
cat > "$outfile" <<HEREDOC
|
||||
---
|
||||
name: ${name}
|
||||
description: ${description}
|
||||
color: ${color}
|
||||
---
|
||||
${body}
|
||||
HEREDOC
|
||||
}
|
||||
|
||||
convert_cursor() {
|
||||
local file="$1"
|
||||
local name description slug outfile body
|
||||
|
||||
name="$(get_field "name" "$file")"
|
||||
description="$(get_field "description" "$file")"
|
||||
slug="$(slugify "$name")"
|
||||
body="$(get_body "$file")"
|
||||
|
||||
outfile="$OUT_DIR/cursor/rules/${slug}.mdc"
|
||||
mkdir -p "$OUT_DIR/cursor/rules"
|
||||
|
||||
# Cursor .mdc format: description + globs + alwaysApply frontmatter
|
||||
cat > "$outfile" <<HEREDOC
|
||||
---
|
||||
description: ${description}
|
||||
globs: ""
|
||||
alwaysApply: false
|
||||
---
|
||||
${body}
|
||||
HEREDOC
|
||||
}
|
||||
|
||||
# Aider and Windsurf are single-file formats — accumulate into temp files
|
||||
# then write at the end.
|
||||
AIDER_TMP="$(mktemp)"
|
||||
WINDSURF_TMP="$(mktemp)"
|
||||
trap 'rm -f "$AIDER_TMP" "$WINDSURF_TMP"' EXIT
|
||||
|
||||
# Write Aider/Windsurf headers once
|
||||
cat > "$AIDER_TMP" <<'HEREDOC'
|
||||
# The Agency — AI Agent Conventions
|
||||
#
|
||||
# This file provides Aider with the full roster of specialized AI agents from
|
||||
# The Agency (https://github.com/msitarzewski/agency-agents).
|
||||
#
|
||||
# To activate an agent, reference it by name in your Aider session prompt, e.g.:
|
||||
# "Use the Frontend Developer agent to review this component."
|
||||
#
|
||||
# Generated by scripts/convert.sh — do not edit manually.
|
||||
|
||||
HEREDOC
|
||||
|
||||
cat > "$WINDSURF_TMP" <<'HEREDOC'
|
||||
# The Agency — AI Agent Rules for Windsurf
|
||||
#
|
||||
# Full roster of specialized AI agents from The Agency.
|
||||
# To activate an agent, reference it by name in your Windsurf conversation.
|
||||
#
|
||||
# Generated by scripts/convert.sh — do not edit manually.
|
||||
|
||||
HEREDOC
|
||||
|
||||
accumulate_aider() {
|
||||
local file="$1"
|
||||
local name description body
|
||||
|
||||
name="$(get_field "name" "$file")"
|
||||
description="$(get_field "description" "$file")"
|
||||
body="$(get_body "$file")"
|
||||
|
||||
cat >> "$AIDER_TMP" <<HEREDOC
|
||||
|
||||
---
|
||||
|
||||
## ${name}
|
||||
|
||||
> ${description}
|
||||
|
||||
${body}
|
||||
HEREDOC
|
||||
}
|
||||
|
||||
accumulate_windsurf() {
|
||||
local file="$1"
|
||||
local name description body
|
||||
|
||||
name="$(get_field "name" "$file")"
|
||||
description="$(get_field "description" "$file")"
|
||||
body="$(get_body "$file")"
|
||||
|
||||
cat >> "$WINDSURF_TMP" <<HEREDOC
|
||||
|
||||
================================================================================
|
||||
## ${name}
|
||||
${description}
|
||||
================================================================================
|
||||
|
||||
${body}
|
||||
|
||||
HEREDOC
|
||||
}
|
||||
|
||||
# --- Main loop ---
|
||||
|
||||
run_conversions() {
|
||||
local tool="$1"
|
||||
local count=0
|
||||
|
||||
for dir in "${AGENT_DIRS[@]}"; do
|
||||
local dirpath="$REPO_ROOT/$dir"
|
||||
[[ -d "$dirpath" ]] || continue
|
||||
|
||||
while IFS= read -r -d '' file; do
|
||||
# Skip files without frontmatter (non-agent docs like QUICKSTART.md)
|
||||
local first_line
|
||||
first_line="$(head -1 "$file")"
|
||||
[[ "$first_line" == "---" ]] || continue
|
||||
|
||||
local name
|
||||
name="$(get_field "name" "$file")"
|
||||
[[ -n "$name" ]] || continue
|
||||
|
||||
case "$tool" in
|
||||
antigravity) convert_antigravity "$file" ;;
|
||||
gemini-cli) convert_gemini_cli "$file" ;;
|
||||
opencode) convert_opencode "$file" ;;
|
||||
cursor) convert_cursor "$file" ;;
|
||||
aider) accumulate_aider "$file" ;;
|
||||
windsurf) accumulate_windsurf "$file" ;;
|
||||
esac
|
||||
|
||||
(( count++ )) || true
|
||||
done < <(find "$dirpath" -maxdepth 1 -name "*.md" -type f -print0 | sort -z)
|
||||
done
|
||||
|
||||
echo "$count"
|
||||
}
|
||||
|
||||
write_single_file_outputs() {
|
||||
# Aider
|
||||
mkdir -p "$OUT_DIR/aider"
|
||||
cp "$AIDER_TMP" "$OUT_DIR/aider/CONVENTIONS.md"
|
||||
|
||||
# Windsurf
|
||||
mkdir -p "$OUT_DIR/windsurf"
|
||||
cp "$WINDSURF_TMP" "$OUT_DIR/windsurf/.windsurfrules"
|
||||
}
|
||||
|
||||
# --- Entry point ---
|
||||
|
||||
main() {
|
||||
local tool="all"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--tool) tool="${2:?'--tool requires a value'}"; shift 2 ;;
|
||||
--out) OUT_DIR="${2:?'--out requires a value'}"; shift 2 ;;
|
||||
--help|-h) usage ;;
|
||||
*) error "Unknown option: $1"; usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
local valid_tools=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf" "all")
|
||||
local valid=false
|
||||
for t in "${valid_tools[@]}"; do [[ "$t" == "$tool" ]] && valid=true && break; done
|
||||
if ! $valid; then
|
||||
error "Unknown tool '$tool'. Valid: ${valid_tools[*]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
header "The Agency -- Converting agents to tool-specific formats"
|
||||
echo " Repo: $REPO_ROOT"
|
||||
echo " Output: $OUT_DIR"
|
||||
echo " Tool: $tool"
|
||||
echo " Date: $TODAY"
|
||||
|
||||
local tools_to_run=()
|
||||
if [[ "$tool" == "all" ]]; then
|
||||
tools_to_run=("antigravity" "gemini-cli" "opencode" "cursor" "aider" "windsurf")
|
||||
else
|
||||
tools_to_run=("$tool")
|
||||
fi
|
||||
|
||||
local total=0
|
||||
for t in "${tools_to_run[@]}"; do
|
||||
header "Converting: $t"
|
||||
local count
|
||||
count="$(run_conversions "$t")"
|
||||
total=$(( total + count ))
|
||||
|
||||
# Gemini CLI also needs the extension manifest
|
||||
if [[ "$t" == "gemini-cli" ]]; then
|
||||
mkdir -p "$OUT_DIR/gemini-cli"
|
||||
cat > "$OUT_DIR/gemini-cli/gemini-extension.json" <<'HEREDOC'
|
||||
{
|
||||
"name": "agency-agents",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
HEREDOC
|
||||
info "Wrote gemini-extension.json"
|
||||
fi
|
||||
|
||||
info "Converted $count agents for $t"
|
||||
done
|
||||
|
||||
# Write single-file outputs after accumulation
|
||||
if [[ "$tool" == "all" || "$tool" == "aider" || "$tool" == "windsurf" ]]; then
|
||||
write_single_file_outputs
|
||||
info "Wrote integrations/aider/CONVENTIONS.md"
|
||||
info "Wrote integrations/windsurf/.windsurfrules"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
info "Done. Total conversions: $total"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
465
scripts/install.sh
Executable file
465
scripts/install.sh
Executable file
@@ -0,0 +1,465 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# install.sh -- Install The Agency agents into your local agentic tool(s).
|
||||
#
|
||||
# Reads converted files from integrations/ and copies them to the appropriate
|
||||
# config directory for each tool. Run scripts/convert.sh first if integrations/
|
||||
# is missing or stale.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/install.sh [--tool <name>] [--interactive] [--no-interactive] [--help]
|
||||
#
|
||||
# Tools:
|
||||
# claude-code -- Copy agents to ~/.claude/agents/
|
||||
# antigravity -- Copy skills to ~/.gemini/antigravity/skills/
|
||||
# gemini-cli -- Install extension to ~/.gemini/extensions/agency-agents/
|
||||
# opencode -- Copy agents to .opencode/agent/ in current directory
|
||||
# cursor -- Copy rules to .cursor/rules/ in current directory
|
||||
# aider -- Copy CONVENTIONS.md to current directory
|
||||
# windsurf -- Copy .windsurfrules to current directory
|
||||
# all -- Install for all detected tools (default)
|
||||
#
|
||||
# Flags:
|
||||
# --tool <name> Install only the specified tool
|
||||
# --interactive Show interactive selector (default when run in a terminal)
|
||||
# --no-interactive Skip interactive selector, install all detected tools
|
||||
# --help Show this help
|
||||
#
|
||||
# Platform support:
|
||||
# Linux, macOS (requires bash 3.2+), Windows Git Bash / WSL
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Colours -- only when stdout is a real terminal
|
||||
# ---------------------------------------------------------------------------
|
||||
if [[ -t 1 ]]; then
|
||||
C_GREEN=$'\033[0;32m'
|
||||
C_YELLOW=$'\033[1;33m'
|
||||
C_RED=$'\033[0;31m'
|
||||
C_CYAN=$'\033[0;36m'
|
||||
C_BOLD=$'\033[1m'
|
||||
C_DIM=$'\033[2m'
|
||||
C_RESET=$'\033[0m'
|
||||
else
|
||||
C_GREEN=''; C_YELLOW=''; C_RED=''; C_CYAN=''; C_BOLD=''; C_DIM=''; C_RESET=''
|
||||
fi
|
||||
|
||||
ok() { printf "${C_GREEN}[OK]${C_RESET} %s\n" "$*"; }
|
||||
warn() { printf "${C_YELLOW}[!!]${C_RESET} %s\n" "$*"; }
|
||||
err() { printf "${C_RED}[ERR]${C_RESET} %s\n" "$*" >&2; }
|
||||
header() { printf "\n${C_BOLD}%s${C_RESET}\n" "$*"; }
|
||||
dim() { printf "${C_DIM}%s${C_RESET}\n" "$*"; }
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Box drawing -- pure ASCII, fixed 52-char wide
|
||||
# box_top / box_mid / box_bot -- structural lines
|
||||
# box_row <text> -- content row, right-padded to fit
|
||||
# ---------------------------------------------------------------------------
|
||||
BOX_INNER=48 # chars between the two | walls
|
||||
|
||||
box_top() { printf " +"; printf '%0.s-' $(seq 1 $BOX_INNER); printf "+\n"; }
|
||||
box_bot() { box_top; }
|
||||
box_sep() { printf " |"; printf '%0.s-' $(seq 1 $BOX_INNER); printf "|\n"; }
|
||||
box_row() {
|
||||
# Strip ANSI escapes when measuring visible length
|
||||
local raw="$1"
|
||||
local visible
|
||||
visible="$(printf '%s' "$raw" | sed 's/\x1b\[[0-9;]*m//g')"
|
||||
local pad=$(( BOX_INNER - 2 - ${#visible} ))
|
||||
if (( pad < 0 )); then pad=0; fi
|
||||
printf " | %s%*s |\n" "$raw" "$pad" ''
|
||||
}
|
||||
box_blank() { printf " |%*s|\n" $BOX_INNER ''; }
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Paths
|
||||
# ---------------------------------------------------------------------------
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
INTEGRATIONS="$REPO_ROOT/integrations"
|
||||
|
||||
ALL_TOOLS=(claude-code antigravity gemini-cli opencode cursor aider windsurf)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Usage
|
||||
# ---------------------------------------------------------------------------
|
||||
usage() {
|
||||
sed -n '3,28p' "$0" | sed 's/^# \{0,1\}//'
|
||||
exit 0
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Preflight
|
||||
# ---------------------------------------------------------------------------
|
||||
check_integrations() {
|
||||
if [[ ! -d "$INTEGRATIONS" ]]; then
|
||||
err "integrations/ not found. Run ./scripts/convert.sh first."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Tool detection
|
||||
# ---------------------------------------------------------------------------
|
||||
detect_claude_code() { [[ -d "${HOME}/.claude" ]]; }
|
||||
detect_antigravity() { [[ -d "${HOME}/.gemini/antigravity/skills" ]]; }
|
||||
detect_gemini_cli() { command -v gemini >/dev/null 2>&1 || [[ -d "${HOME}/.gemini" ]]; }
|
||||
detect_cursor() { command -v cursor >/dev/null 2>&1 || [[ -d "${HOME}/.cursor" ]]; }
|
||||
detect_opencode() { command -v opencode >/dev/null 2>&1 || [[ -d "${HOME}/.config/opencode" ]]; }
|
||||
detect_aider() { command -v aider >/dev/null 2>&1; }
|
||||
detect_windsurf() { command -v windsurf >/dev/null 2>&1 || [[ -d "${HOME}/.codeium" ]]; }
|
||||
|
||||
is_detected() {
|
||||
case "$1" in
|
||||
claude-code) detect_claude_code ;;
|
||||
antigravity) detect_antigravity ;;
|
||||
gemini-cli) detect_gemini_cli ;;
|
||||
opencode) detect_opencode ;;
|
||||
cursor) detect_cursor ;;
|
||||
aider) detect_aider ;;
|
||||
windsurf) detect_windsurf ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Fixed-width labels: name (14) + detail (24) = 38 visible chars
|
||||
tool_label() {
|
||||
case "$1" in
|
||||
claude-code) printf "%-14s %s" "Claude Code" "(claude.ai/code)" ;;
|
||||
antigravity) printf "%-14s %s" "Antigravity" "(~/.gemini/antigravity)" ;;
|
||||
gemini-cli) printf "%-14s %s" "Gemini CLI" "(gemini extension)" ;;
|
||||
opencode) printf "%-14s %s" "OpenCode" "(opencode.ai)" ;;
|
||||
cursor) printf "%-14s %s" "Cursor" "(.cursor/rules)" ;;
|
||||
aider) printf "%-14s %s" "Aider" "(CONVENTIONS.md)" ;;
|
||||
windsurf) printf "%-14s %s" "Windsurf" "(.windsurfrules)" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Interactive selector
|
||||
# ---------------------------------------------------------------------------
|
||||
interactive_select() {
|
||||
# bash 3-compatible arrays
|
||||
declare -a selected=()
|
||||
declare -a detected_map=()
|
||||
|
||||
local t
|
||||
for t in "${ALL_TOOLS[@]}"; do
|
||||
if is_detected "$t" 2>/dev/null; then
|
||||
selected+=(1); detected_map+=(1)
|
||||
else
|
||||
selected+=(0); detected_map+=(0)
|
||||
fi
|
||||
done
|
||||
|
||||
while true; do
|
||||
# --- header ---
|
||||
printf "\n"
|
||||
box_top
|
||||
box_row "${C_BOLD} The Agency -- Tool Installer${C_RESET}"
|
||||
box_bot
|
||||
printf "\n"
|
||||
printf " ${C_DIM}System scan: [*] = detected on this machine${C_RESET}\n"
|
||||
printf "\n"
|
||||
|
||||
# --- tool rows ---
|
||||
local i=0
|
||||
for t in "${ALL_TOOLS[@]}"; do
|
||||
local num=$(( i + 1 ))
|
||||
local label
|
||||
label="$(tool_label "$t")"
|
||||
local dot
|
||||
if [[ "${detected_map[$i]}" == "1" ]]; then
|
||||
dot="${C_GREEN}[*]${C_RESET}"
|
||||
else
|
||||
dot="${C_DIM}[ ]${C_RESET}"
|
||||
fi
|
||||
local chk
|
||||
if [[ "${selected[$i]}" == "1" ]]; then
|
||||
chk="${C_GREEN}[x]${C_RESET}"
|
||||
else
|
||||
chk="${C_DIM}[ ]${C_RESET}"
|
||||
fi
|
||||
printf " %s %s) %s %s\n" "$chk" "$num" "$dot" "$label"
|
||||
(( i++ )) || true
|
||||
done
|
||||
|
||||
# --- controls ---
|
||||
printf "\n"
|
||||
printf " ------------------------------------------------\n"
|
||||
printf " ${C_CYAN}[1-7]${C_RESET} toggle ${C_CYAN}[a]${C_RESET} all ${C_CYAN}[n]${C_RESET} none ${C_CYAN}[d]${C_RESET} detected\n"
|
||||
printf " ${C_GREEN}[Enter]${C_RESET} install ${C_RED}[q]${C_RESET} quit\n"
|
||||
printf "\n"
|
||||
printf " >> "
|
||||
read -r input </dev/tty
|
||||
|
||||
case "$input" in
|
||||
q|Q)
|
||||
printf "\n"; ok "Aborted."; exit 0 ;;
|
||||
a|A)
|
||||
for (( j=0; j<${#ALL_TOOLS[@]}; j++ )); do selected[$j]=1; done ;;
|
||||
n|N)
|
||||
for (( j=0; j<${#ALL_TOOLS[@]}; j++ )); do selected[$j]=0; done ;;
|
||||
d|D)
|
||||
for (( j=0; j<${#ALL_TOOLS[@]}; j++ )); do selected[$j]="${detected_map[$j]}"; done ;;
|
||||
"")
|
||||
local any=false
|
||||
local s
|
||||
for s in "${selected[@]}"; do [[ "$s" == "1" ]] && any=true && break; done
|
||||
if $any; then
|
||||
break
|
||||
else
|
||||
printf " ${C_YELLOW}Nothing selected -- pick a tool or press q to quit.${C_RESET}\n"
|
||||
sleep 1
|
||||
fi ;;
|
||||
*)
|
||||
local toggled=false
|
||||
local num
|
||||
for num in $input; do
|
||||
if [[ "$num" =~ ^[0-9]+$ ]]; then
|
||||
local idx=$(( num - 1 ))
|
||||
if (( idx >= 0 && idx < ${#ALL_TOOLS[@]} )); then
|
||||
if [[ "${selected[$idx]}" == "1" ]]; then
|
||||
selected[$idx]=0
|
||||
else
|
||||
selected[$idx]=1
|
||||
fi
|
||||
toggled=true
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if ! $toggled; then
|
||||
printf " ${C_RED}Invalid. Enter a number 1-%s, or a command.${C_RESET}\n" "${#ALL_TOOLS[@]}"
|
||||
sleep 1
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
# Clear UI for redraw
|
||||
local lines=$(( ${#ALL_TOOLS[@]} + 14 ))
|
||||
local l
|
||||
for (( l=0; l<lines; l++ )); do printf '\033[1A\033[2K'; done
|
||||
done
|
||||
|
||||
# Build output array
|
||||
SELECTED_TOOLS=()
|
||||
local i=0
|
||||
for t in "${ALL_TOOLS[@]}"; do
|
||||
[[ "${selected[$i]}" == "1" ]] && SELECTED_TOOLS+=("$t")
|
||||
(( i++ )) || true
|
||||
done
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Installers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
install_claude_code() {
|
||||
local dest="${HOME}/.claude/agents"
|
||||
local count=0
|
||||
mkdir -p "$dest"
|
||||
local dir f first_line
|
||||
for dir in design engineering marketing product project-management \
|
||||
testing support spatial-computing specialized; do
|
||||
[[ -d "$REPO_ROOT/$dir" ]] || continue
|
||||
while IFS= read -r -d '' f; do
|
||||
first_line="$(head -1 "$f")"
|
||||
[[ "$first_line" == "---" ]] || continue
|
||||
cp "$f" "$dest/"
|
||||
(( count++ )) || true
|
||||
done < <(find "$REPO_ROOT/$dir" -maxdepth 1 -name "*.md" -type f -print0)
|
||||
done
|
||||
ok "Claude Code: $count agents -> $dest"
|
||||
}
|
||||
|
||||
install_antigravity() {
|
||||
local src="$INTEGRATIONS/antigravity"
|
||||
local dest="${HOME}/.gemini/antigravity/skills"
|
||||
local count=0
|
||||
[[ -d "$src" ]] || { err "integrations/antigravity missing. Run convert.sh first."; return 1; }
|
||||
mkdir -p "$dest"
|
||||
local d
|
||||
while IFS= read -r -d '' d; do
|
||||
local name; name="$(basename "$d")"
|
||||
mkdir -p "$dest/$name"
|
||||
cp "$d/SKILL.md" "$dest/$name/SKILL.md"
|
||||
(( count++ )) || true
|
||||
done < <(find "$src" -mindepth 1 -maxdepth 1 -type d -print0)
|
||||
ok "Antigravity: $count skills -> $dest"
|
||||
}
|
||||
|
||||
install_gemini_cli() {
|
||||
local src="$INTEGRATIONS/gemini-cli"
|
||||
local dest="${HOME}/.gemini/extensions/agency-agents"
|
||||
local count=0
|
||||
[[ -d "$src" ]] || { err "integrations/gemini-cli missing. Run convert.sh first."; return 1; }
|
||||
mkdir -p "$dest/skills"
|
||||
cp "$src/gemini-extension.json" "$dest/gemini-extension.json"
|
||||
local d
|
||||
while IFS= read -r -d '' d; do
|
||||
local name; name="$(basename "$d")"
|
||||
mkdir -p "$dest/skills/$name"
|
||||
cp "$d/SKILL.md" "$dest/skills/$name/SKILL.md"
|
||||
(( count++ )) || true
|
||||
done < <(find "$src/skills" -mindepth 1 -maxdepth 1 -type d -print0)
|
||||
ok "Gemini CLI: $count skills -> $dest"
|
||||
}
|
||||
|
||||
install_opencode() {
|
||||
local src="$INTEGRATIONS/opencode/agent"
|
||||
local dest="${PWD}/.opencode/agent"
|
||||
local count=0
|
||||
[[ -d "$src" ]] || { err "integrations/opencode missing. Run convert.sh first."; return 1; }
|
||||
mkdir -p "$dest"
|
||||
local f
|
||||
while IFS= read -r -d '' f; do
|
||||
cp "$f" "$dest/"; (( count++ )) || true
|
||||
done < <(find "$src" -maxdepth 1 -name "*.md" -print0)
|
||||
ok "OpenCode: $count agents -> $dest"
|
||||
warn "OpenCode: project-scoped. Run from your project root to install there."
|
||||
}
|
||||
|
||||
install_cursor() {
|
||||
local src="$INTEGRATIONS/cursor/rules"
|
||||
local dest="${PWD}/.cursor/rules"
|
||||
local count=0
|
||||
[[ -d "$src" ]] || { err "integrations/cursor missing. Run convert.sh first."; return 1; }
|
||||
mkdir -p "$dest"
|
||||
local f
|
||||
while IFS= read -r -d '' f; do
|
||||
cp "$f" "$dest/"; (( count++ )) || true
|
||||
done < <(find "$src" -maxdepth 1 -name "*.mdc" -print0)
|
||||
ok "Cursor: $count rules -> $dest"
|
||||
warn "Cursor: project-scoped. Run from your project root to install there."
|
||||
}
|
||||
|
||||
install_aider() {
|
||||
local src="$INTEGRATIONS/aider/CONVENTIONS.md"
|
||||
local dest="${PWD}/CONVENTIONS.md"
|
||||
[[ -f "$src" ]] || { err "integrations/aider/CONVENTIONS.md missing. Run convert.sh first."; return 1; }
|
||||
if [[ -f "$dest" ]]; then
|
||||
warn "Aider: CONVENTIONS.md already exists at $dest (remove to reinstall)."
|
||||
return 0
|
||||
fi
|
||||
cp "$src" "$dest"
|
||||
ok "Aider: installed -> $dest"
|
||||
warn "Aider: project-scoped. Run from your project root to install there."
|
||||
}
|
||||
|
||||
install_windsurf() {
|
||||
local src="$INTEGRATIONS/windsurf/.windsurfrules"
|
||||
local dest="${PWD}/.windsurfrules"
|
||||
[[ -f "$src" ]] || { err "integrations/windsurf/.windsurfrules missing. Run convert.sh first."; return 1; }
|
||||
if [[ -f "$dest" ]]; then
|
||||
warn "Windsurf: .windsurfrules already exists at $dest (remove to reinstall)."
|
||||
return 0
|
||||
fi
|
||||
cp "$src" "$dest"
|
||||
ok "Windsurf: installed -> $dest"
|
||||
warn "Windsurf: project-scoped. Run from your project root to install there."
|
||||
}
|
||||
|
||||
install_tool() {
|
||||
case "$1" in
|
||||
claude-code) install_claude_code ;;
|
||||
antigravity) install_antigravity ;;
|
||||
gemini-cli) install_gemini_cli ;;
|
||||
opencode) install_opencode ;;
|
||||
cursor) install_cursor ;;
|
||||
aider) install_aider ;;
|
||||
windsurf) install_windsurf ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Entry point
|
||||
# ---------------------------------------------------------------------------
|
||||
main() {
|
||||
local tool="all"
|
||||
local interactive_mode="auto"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--tool) tool="${2:?'--tool requires a value'}"; shift 2; interactive_mode="no" ;;
|
||||
--interactive) interactive_mode="yes"; shift ;;
|
||||
--no-interactive) interactive_mode="no"; shift ;;
|
||||
--help|-h) usage ;;
|
||||
*) err "Unknown option: $1"; usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
check_integrations
|
||||
|
||||
# Validate explicit tool
|
||||
if [[ "$tool" != "all" ]]; then
|
||||
local valid=false t
|
||||
for t in "${ALL_TOOLS[@]}"; do [[ "$t" == "$tool" ]] && valid=true && break; done
|
||||
if ! $valid; then
|
||||
err "Unknown tool '$tool'. Valid: ${ALL_TOOLS[*]}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Decide whether to show interactive UI
|
||||
local use_interactive=false
|
||||
if [[ "$interactive_mode" == "yes" ]]; then
|
||||
use_interactive=true
|
||||
elif [[ "$interactive_mode" == "auto" && -t 0 && -t 1 && "$tool" == "all" ]]; then
|
||||
use_interactive=true
|
||||
fi
|
||||
|
||||
SELECTED_TOOLS=()
|
||||
|
||||
if $use_interactive; then
|
||||
interactive_select
|
||||
|
||||
elif [[ "$tool" != "all" ]]; then
|
||||
SELECTED_TOOLS=("$tool")
|
||||
|
||||
else
|
||||
# Non-interactive: auto-detect
|
||||
header "The Agency -- Scanning for installed tools..."
|
||||
printf "\n"
|
||||
local t
|
||||
for t in "${ALL_TOOLS[@]}"; do
|
||||
if is_detected "$t" 2>/dev/null; then
|
||||
SELECTED_TOOLS+=("$t")
|
||||
printf " ${C_GREEN}[*]${C_RESET} %s ${C_DIM}detected${C_RESET}\n" "$(tool_label "$t")"
|
||||
else
|
||||
printf " ${C_DIM}[ ] %s not found${C_RESET}\n" "$(tool_label "$t")"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ ${#SELECTED_TOOLS[@]} -eq 0 ]]; then
|
||||
warn "No tools selected or detected. Nothing to install."
|
||||
printf "\n"
|
||||
dim " Tip: use --tool <name> to force-install a specific tool."
|
||||
dim " Available: ${ALL_TOOLS[*]}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
header "The Agency -- Installing agents"
|
||||
printf " Repo: %s\n" "$REPO_ROOT"
|
||||
printf " Installing: %s\n" "${SELECTED_TOOLS[*]}"
|
||||
printf "\n"
|
||||
|
||||
local installed=0 t
|
||||
for t in "${SELECTED_TOOLS[@]}"; do
|
||||
install_tool "$t"
|
||||
(( installed++ )) || true
|
||||
done
|
||||
|
||||
# Done box
|
||||
local msg=" Done! Installed $installed tool(s)."
|
||||
printf "\n"
|
||||
box_top
|
||||
box_row "${C_GREEN}${C_BOLD}${msg}${C_RESET}"
|
||||
box_bot
|
||||
printf "\n"
|
||||
dim " Run ./scripts/convert.sh to regenerate after adding or editing agents."
|
||||
printf "\n"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user