Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
67 changes: 67 additions & 0 deletions .agent/skills/adr-management/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: adr-management
description: >
ADR management skill. Auto-invoked for generating architecture decisions,
documenting design rationale, and maintaining the decision record log.
Uses native read/write tools to scaffold and update ADR markdown files.
allowed-tools: Bash, Read, Write
---

# Identity: The ADR Manager 📐

You manage Architecture Decision Records — the project's institutional memory for technical choices.

## 🎯 Primary Directive
**Document, Decide, and Distribute.** Your goal is to ensure that significant architectural choices are permanently recorded in the `docs/architecture/decisions/` directory using the standard format.

## 🛠️ Tools (Plugin Scripts)
- **ADR Manager**: `plugins/adr-manager/skills/adr-management/scripts/adr_manager.py` (create, list, get, search)
- **ID Generator**: `plugins/adr-manager/skills/adr-management/scripts/next_number.py`

## Core Workflow: Creating an ADR

When asked to create an Architecture Decision Record (ADR):

### 1. Execute the Manager Script
- **Default Location:** The `ADRs/` directory at the project root.
- Execute the Manager script with the `create` subcommand. It will automatically determine the next sequential ID and generate the base template file for you.
- e.g., `python3 plugins/adr-manager/skills/adr-management/scripts/adr_manager.py create "Use Python 3.12" --context "..." --decision "..." --consequences "..."`
- The script will print the path of the generated `.md` file to stdout.

### 2. Fill in the Logical Content
- Open the newly generated file.
- Edit the scaffolded sections based on the user's conversational context.
- Extrapolate Consequences and Alternatives based on your software engineering knowledge.

### 3. Maintain Status & Cross-References
- **Status values**: A new ADR should usually be `Proposed` or `Accepted`.
- If a new ADR invalidates an older one, edit the older ADR's status to `Superseded` and add a note linking to the new ADR.
- **Reference ADRs by number** — e.g., "This builds upon the database choice outlined in ADR-0003."

## Auxiliary Workflows

### Listing ADRs
```bash
python3 plugins/adr-manager/skills/adr-management/scripts/adr_manager.py list
python3 plugins/adr-manager/skills/adr-management/scripts/adr_manager.py list --limit 10
```

### Viewing a Specific ADR
```bash
python3 plugins/adr-manager/skills/adr-management/scripts/adr_manager.py get 42
```

### Searching ADRs by Keyword
```bash
python3 plugins/adr-manager/skills/adr-management/scripts/adr_manager.py search "ChromaDB"
```

### Sequence Resolution
Use `next_number.py` to identify the next sequential ID across various artifact domains.
- **Scans**: Specs, Tasks, ADRs, Business Rules/Workflows.
- **Example**: `python3 plugins/adr-manager/skills/adr-management/scripts/next_number.py --type adr`

## Best Practices
1. **Always fill all sections**: Never leave an ADR blank. Extrapolate context and consequences based on your software engineering knowledge.
2. **Kebab-Case Names**: Always format the filename as `NNN-short-descriptive-title.md`.
3. **Reference ADRs by number** — e.g., "This builds upon the database choice outlined in ADR-003."
30 changes: 30 additions & 0 deletions .agent/skills/adr-management/evals/evals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"plugin": "adr-manager",
"skill": "adr-management",
"evaluations": [
{
"id": "eval-1-auto-numbering",
"type": "positive",
"prompt": "Create an ADR for switching from SQLite to PostgreSQL.",
"expected_behavior": "Agent runs adr_manager.py create, which auto-determines the next sequential ID from the ADRs/ directory. It does NOT ask the user for an ID or guess one. The generated filename uses 4-digit zero-padded format (e.g., 0023-use-postgresql.md)."
},
{
"id": "eval-2-supersede-old-adr",
"type": "positive",
"prompt": "This new ADR supersedes ADR-0003. Update ADR-0003 accordingly.",
"expected_behavior": "Agent opens ADR-0003, changes its Status field to 'Superseded', and adds a cross-reference link to the new ADR. It does NOT delete or archive ADR-0003."
},
{
"id": "eval-3-all-sections-filled",
"type": "negative",
"prompt": "Create an ADR for using Redis as a cache.",
"expected_behavior": "All 5 sections (Status, Context, Decision, Consequences, Alternatives) are populated. Agent extrapolates Consequences and Alternatives from its software engineering knowledge if the user did not provide them. A blank section is not acceptable."
},
{
"id": "eval-4-search-before-create",
"type": "edge-case",
"prompt": "Create an ADR about database caching.",
"expected_behavior": "Agent runs adr_manager.py search 'cache' to check if a related ADR already exists before creating a new one. If a related ADR is found, it asks the user to confirm whether to create a new one or update the existing one."
}
]
}
17 changes: 17 additions & 0 deletions .agent/skills/adr-management/references/fallback-tree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Procedural Fallback Tree: ADR Management

## 1. ADRs Directory Does Not Exist
If `adr_manager.py create` is run and the target directory (`ADRs/` or custom) does not exist:
- **Action**: The script creates the directory automatically on first run (per acceptance criteria). Report to the user that the directory was created. Do NOT fail silently.

## 2. ID Numbering Conflict (Duplicate Found)
If `next_number.py` detects that the next sequential ID already exists as a file:
- **Action**: Report the conflict, showing the conflicting filename. Do NOT overwrite the existing file. Increment past the conflict and report the new ID used.

## 3. Existing ADR Not Found When Superseding
If instructed to mark an ADR as Superseded but the referenced ADR number does not exist in the directory:
- **Action**: Report the missing ADR number. List the available ADR IDs (via `adr_manager.py list`). Ask the user to confirm the correct ID before making any changes.

## 4. Template Sections Missing or Blank
If any of the 5 required sections (Status, Context, Decision, Consequences, Alternatives) would be left blank:
- **Action**: Extrapolate the missing sections from context using software engineering knowledge. If insufficient information is available, ask the user a targeted question for each blank section. Never create a skeleton ADR with empty sections.
103 changes: 103 additions & 0 deletions .agent/skills/agent-bridge/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
name: agent-bridge
description: Bridge plugin capabilities (commands, skills, agents, hooks, MCP) to specific agent environments (Claude Code, GitHub Copilot, Gemini, Antigravity). Use this skill when converting or installing a plugin to a target runtime.
allowed-tools: Bash, Write, Read
---

# Agent Bridge

## Overview
This skill **adapts and transforms** plugin content into the specific formats required by different AI agent environments. It ensures each runtime can see and use the plugin's capabilities in its native format.

## Prerequisite
The auto-detect mode only targets **existing** directories. Create them first:
```bash
mkdir .agent .github .gemini .claude
```
> If no directories are found, the installer will print this exact error with the mkdir command.

## Usage

> **CRITICAL**: You must **never** use `--target auto`. You must explicitly specify your own runtime environment (e.g., `antigravity`, `claude`, `gemini`, `github`) to avoid polluting other IDEs.

**Universal Target Support (Agent Awareness)**:
You are a Universal Translator. You are not limited to the primary examples. If you identify your host system as ANY of the following platforms (or similar ones), you MUST invoke the installer with that specific target name (e.g. `--target roo`).
*Supported Environments:* amp, codex, cursor, gemini cli, github copilot, kimi code cli, opencode, antigravity, augment, claude code, openclaw, cline, codebuddy, command code, continue, cortex code, crush, droid, goose, junie, iflow cli, kiko code, kiro cli, kode, mcpjam, mistral vibe, mux, openhands, pi, qoder, qwen code, roo code, trae, trae cn, windsurf, zencoder, neovate, pochi, adal.

### Bridge a Single Plugin
```bash
# Bridge to Claude Code specifically
python plugins/plugin-mapper/skills/agent-bridge/scripts/bridge_installer.py --plugin <plugin-path> --target claude

# Bridge to Antigravity specifically
python plugins/plugin-mapper/skills/agent-bridge/scripts/bridge_installer.py --plugin <plugin-path> --target antigravity
```

**Example:**
```bash
python plugins/plugin-mapper/skills/agent-bridge/scripts/bridge_installer.py --plugin plugins/my-plugin --target antigravity
```

### Bridge All Plugins (Ecosystem Sync)
For a standalone plugin install:
```bash
python plugins/plugin-mapper/skills/agent-bridge/scripts/install_all_plugins.py --target gemini
```

> **MASTER SYNC**: For a full system update (all plugins, all environments), use the Plugin Manager's master orchestrator:
> ```bash
> python plugins/plugin-manager/scripts/update_agent_system.py
> ```

---

## Component Mapping Matrix

The bridge intelligently maps plugin source components to the correct file extensions, directories, and architectures expected by the agent environment.

| Target Environment | `commands/*.md` | `skills/` | `agents/*.md` | `rules/` | `hooks/hooks.json` | `.mcp.json` |
|-------------------|----------------|-----------|---------------|----------|-------------------|-------------|
| **Claude Code** (`.claude/`) | `commands/*.md` | `skills/` | `skills/<plugin>-<agent>/SKILL.md` | Appended to `./CLAUDE.md` | `hooks/<plugin>-hooks.json` | Merged (`./.mcp.json`) |
| **GitHub Copilot** (`.github/`) | `prompts/*.prompt.md` | `skills/` | `skills/<plugin>-<agent>/SKILL.md` | Appended to `.github/copilot-instructions.md` | *(Ignored)* | Merged (`./.mcp.json`) |
| **Google Gemini** (`.gemini/`) | `commands/*.toml` | `skills/` | `skills/<plugin>/agents/` | Appended to `./GEMINI.md` | *(Ignored)* | Merged (`./.mcp.json`) |
| **Antigravity** (`.agent/`) | `workflows/*.md` | `skills/` | `skills/<plugin>-<agent>/SKILL.md` | `.agent/rules/` | *(Ignored)* | Merged (`./.mcp.json`) |
| **Azure AI Foundry** (`.azure/`) | *(Ignored)* | `skills/` | `agents/` | *(Ignored)* | *(Ignored)* | `.vscode/mcp.json` (Capability Hosts) |
| **Universal Generic** (`.<target>/`) | `commands/*.md` | `skills/` | `skills/<plugin>/agents/` | `.<target>/rules/` | *(Ignored)* | Merged (`./.mcp.json`) |

> **GitHub Copilot — Two Agent Types:** The `agents/*.agent.md` column for GitHub Copilot covers two distinct use cases:
> - **IDE / UI Agents**: `.github/agents/name.agent.md` + `.github/prompts/name.prompt.md` — invokable by human via Copilot Chat slash command or agent dropdown in VS Code / GitHub.com.
> - **CI/CD Autonomous Agents**: `.github/agents/name.agent.md` + `.github/workflows/name-agent.yml` — triggered automatically by GitHub Actions on PR/push/schedule with a Kill Switch quality gate.
>
> The `commands/*.md` → `prompts/*.prompt.md` mapping handles the slash-command pointer only. The full rich instruction body should live in the `.agent.md` file, not the `.prompt.md`. Use the `create-agentic-workflow` skill to scaffold either or both agent types from an existing Skill.

## Supported Environments (In-Depth)


### Gemini TOML Format
Command `.md` files are wrapped in TOML. Frontmatter is parsed — the `description` field is extracted and used as the TOML `description`. The frontmatter block is stripped from the prompt body.

---

## Skills vs Workflows (Commands) Caution

> **CRITICAL**: The bridge processes `skills/` and `commands/` (or `workflows/` in older plugins) as distinct directories. **Algorithms/Logic can be deployed to either, but be careful of duplicating them!**
> - `skills/` are typically for passive knowledge, tools, and persistent behavior.
> - `commands/` are for active, slash-command execution workflows.
>
> Do not place identical markdown files in both directories within the same plugin, or the bridge will blindly duplicate the logic into the target environments (e.g. into `.agent/workflows/` and `.agent/skills/` simultaneously, causing contextual bloat).

```toml
command = "plugin-name:command-name"
description = "Description from frontmatter"
prompt = """
# Command content without frontmatter
...
"""
```

---

## When to Use
- **Installing a new plugin**: Run bridge after dropping a plugin into `plugins/`.
- **Adding a new target environment**: Existing plugins need to be re-bridged after adding `.gemini/` etc.
- **Upgrading a plugin**: Re-run bridge to overwrite with latest command content.
30 changes: 30 additions & 0 deletions .agent/skills/agent-bridge/evals/evals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"plugin": "plugin-mapper",
"skill": "agent-bridge",
"evaluations": [
{
"id": "eval-1-never-use-auto-target",
"type": "negative",
"prompt": "Install all my plugins to all my agent environments.",
"expected_behavior": "Agent NEVER uses --target auto. It identifies the host environment (e.g., antigravity, claude) and explicitly specifies that target. It may ask the user to confirm the target if ambiguous."
},
{
"id": "eval-2-single-plugin-bridge",
"type": "positive",
"prompt": "Bridge the rlm-factory plugin to my Gemini CLI setup.",
"expected_behavior": "Agent runs bridge_installer.py with --plugin plugins/rlm-factory and --target gemini. Does NOT use --target auto. Output confirms files written to .gemini/."
},
{
"id": "eval-3-all-plugins-sync",
"type": "positive",
"prompt": "Sync all plugins to my antigravity environment.",
"expected_behavior": "Agent runs install_all_plugins.py with the correct script path (plugins/plugin-mapper/skills/agent-bridge/scripts/install_all_plugins.py). Optionally specifies --target antigravity."
},
{
"id": "eval-4-directory-not-found",
"type": "edge-case",
"prompt": "Run the bridge for my agent setup.",
"expected_behavior": "If the target directory does not exist, agent reports the error, provides the mkdir command to create it, and waits for user confirmation before retrying. Does NOT silently create agent config directories."
}
]
}
28 changes: 28 additions & 0 deletions .agent/skills/agent-bridge/references/agent_bridge_diagram.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
flowchart LR
Plugins["plugins/"]

subgraph Bridge ["agent-bridge"]
BI["bridge_installer.py"]
end

subgraph Agents ["Target Environments"]
Antigravity[".agent/ (Antigravity)"]
Copilot[".github/ (Copilot)"]
Claude[".claude/ (Claude Code)"]
Gemini[".gemini/ (Gemini CLI)"]
end

Plugins -->|"load"| BI

BI -->|"workflows + rules"| Antigravity
BI -->|"prompts"| Copilot
BI -->|"commands"| Claude
BI -->|"TOML + commands"| Gemini

classDef source fill:#eee,stroke:#333
classDef bridge fill:#bbf,stroke:#333,stroke-width:2px
classDef agent fill:#bfb,stroke:#333

class Plugins source
class BI bridge
class Antigravity,Copilot,Claude,Gemini agent
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions .agent/skills/agent-bridge/references/agent_bridge_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

# Plugin Bridge: Architecture & Process

**Version**: 2.0

## Overview

The `agent-bridge` skill translates plugins from a common format into the specific structure expected by each agent environment. It reads from `plugins/` and writes to the agent-specific directories.

There is one bridge:

**Plugin Bridge**
- **Source**: `plugins/` (any plugin directory)
- **Tool**: `bridge_installer.py`
- **Responsibility**:
- Installs **Skills** into agent skill/workflow directories
- Deploys **Commands** as agent-specific slash commands
- Converts Markdown workflows into agent-specific formats (TOML for Gemini, prompts for Copilot, etc.)
- Patches agent-specific identifiers (e.g., `--actor` flags) into installed files

---

## Supported Agent Environments

| Environment | Config Directory | Format |
|-------------|-----------------|--------|
| Antigravity | `.agent/` | Markdown workflows + rules |
| Claude Code | `.claude/` | Markdown commands |
| Gemini CLI | `.gemini/` | TOML + Markdown |
| GitHub Copilot | `.github/` | Prompt files |

---

## Execution

### Install a single plugin
```bash
python plugins/plugin-mapper/skills/agent-bridge/scripts/bridge_installer.py \
--plugin plugins/<plugin-name> \
--target <environment>
```

### Install all plugins
```bash
python plugins/plugin-mapper/skills/agent-bridge/scripts/install_all_plugins.py
```

---

## Architecture Diagram

![Process Diagram](agent_bridge_diagram.png)

---

## Notes
- `--target auto` is explicitly discouraged. Always specify the target environment.
- The bridge is format-agnostic: any plugin following the Open Standards structure is compatible.
- Agent-specific patches (actor flags, path formats) are applied automatically per target.
19 changes: 19 additions & 0 deletions .agent/skills/agent-bridge/references/fallback-tree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Procedural Fallback Tree: Agent Bridge

If the bridge scripts fail or produce unexpected results, execute the following triage steps in order.

## 1. Target Directory Not Found
If `bridge_installer.py` reports that the target directory (`.agent/`, `.claude/`, etc.) does not exist:
- **Action**: Do NOT create the directory automatically. Print the exact `mkdir` command needed and wait for the user to confirm before creating it. A missing directory may indicate an uninitialised project.

## 2. Plugin Not Found
If `bridge_installer.py` cannot locate the specified plugin path:
- **Action**: Do NOT scan the filesystem for similar-named plugins. Report the error and list available plugins in the `plugins/` directory. Ask the user to confirm the correct plugin name.

## 3. Partial Bridge (Some Files Failed)
If the bridge completes but reports some files were skipped or failed to write:
- **Action**: Report each failed file individually with its error. Do NOT claim success. Offer to retry individual components once the user has resolved the reported issue (e.g., permissions).

## 4. `--target auto` Attempted
If any command or workflow attempts to use `--target auto`:
- **Action**: STOP immediately. This is explicitly prohibited. Ask the user to specify their exact environment (e.g., `antigravity`, `claude`, `gemini`, `github`). Never run with `--target auto`.
Loading
Loading