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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 78 additions & 21 deletions .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,76 @@ See the full [ROADMAP](./docs/guides/ROADMAP.md) for details on each iteration.

## Getting started

### Installation and deployment
### Claude Code plugin (recommended)

This repository ships a [Claude Code plugin](https://docs.anthropic.com/en/docs/claude-code/plugins) that provides guided workflows for setup, deployment, task submission, and troubleshooting.

#### Installing the plugin

```bash
git clone https://github.com/aws-samples/sample-autonomous-cloud-coding-agents.git
cd sample-autonomous-cloud-coding-agents
claude --plugin-dir docs/abca-plugin
```

The `--plugin-dir` flag tells Claude Code to load the local plugin from the `docs/abca-plugin/` directory. The plugin's skills, commands, agents, and hooks will be available immediately.

> **Tip:** If you use Claude Code via VS Code or JetBrains, you can add `--plugin-dir docs/abca-plugin` to the extension's CLI arguments setting.

#### What the plugin provides

**Skills** (guided multi-step workflows — Claude activates these automatically based on your request):

| Skill | Triggers on | What it does |
|-------|------------|--------------|
| `setup` | "get started", "install", "first time setup" | Full guided setup: prerequisites, toolchain, deploy, smoke test |
| `deploy` | "deploy", "cdk diff", "destroy" | Deploy, diff, or destroy the CDK stack with pre-checks |
| `onboard-repo` | "add a repo", "onboard", 422 errors | Add a new GitHub repository via Blueprint construct |
| `submit-task` | "submit task", "run agent", "review PR", "quick submit" | Submit a coding task with prompt quality coaching (supports quick mode) |
| `troubleshoot` | "debug", "error", "not working", "failed" | Diagnose deployment, auth, or task execution issues |
| `status` | "status", "health check", "is ABCA running" | Platform health check: stack status, running tasks, build health |

**Agents** (specialized subagents, spawned automatically or via the Agent tool):

| Agent | When it's used |
|-------|---------------|
| `cdk-expert` | CDK architecture, construct design, handler implementation, stack modifications |
| `agent-debugger` | Task failure investigation, CloudWatch log analysis, agent runtime debugging |

**Hook** (runs automatically):

A `SessionStart` hook advertises available skills and agents so Claude can proactively suggest them when your request matches.

#### Local plugin development

If you're modifying the plugin itself, here's the file layout:

```
docs/abca-plugin/
plugin.json # Plugin manifest (name, version, description)
skills/
setup/SKILL.md # First-time setup workflow
deploy/SKILL.md # CDK deployment workflow
onboard-repo/SKILL.md # Repository onboarding workflow
submit-task/SKILL.md # Task submission (guided + quick mode)
troubleshoot/SKILL.md # Diagnostic workflow
status/SKILL.md # Platform health check
agents/
cdk-expert.md # CDK infrastructure specialist
agent-debugger.md # Task failure debugger
hooks/
hooks.json # SessionStart capability advertisement
```

**Key conventions:**
- The plugin lives under `docs/` to keep documentation and plugin content colocated
- Skills live in subdirectories with a `SKILL.md` file (not flat `.md` files)
- Agents are flat `.md` files with YAML frontmatter
- The hook advertises plugin capabilities only (no project-specific content)

**After editing plugin files**, restart Claude Code with `claude --plugin-dir docs/abca-plugin` to pick up changes.

### Manual installation and deployment

Install [mise](https://mise.jdx.dev/getting-started.html) if you want to use repo tasks (`mise run install`, `mise run build`). For monorepo-prefixed tasks (`mise //cdk:build`, etc.), set **`MISE_EXPERIMENTAL=1`** — see [CONTRIBUTING.md](./CONTRIBUTING.md).

Expand Down
14 changes: 14 additions & 0 deletions cdk/src/stacks/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,20 @@ export class AgentStack extends Stack {
// Grant the runtime permissions to invoke the inference profile
inferenceProfile.grantInvoke(runtime);

const model3 = new bedrock.BedrockFoundationModel('anthropic.claude-opus-4-20250514-v1:0', {
supportsAgents: true,
supportsCrossRegion: true,
});

model3.grantInvoke(runtime);

const inferenceProfile3 = bedrock.CrossRegionInferenceProfile.fromConfig({
geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
model: model3,
});

inferenceProfile3.grantInvoke(runtime);

const model2 = new bedrock.BedrockFoundationModel('anthropic.claude-haiku-4-5-20251001-v1:0', {
supportsAgents: true,
supportsCrossRegion: true,
Expand Down
106 changes: 106 additions & 0 deletions docs/abca-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# ABCA Plugin for Claude Code

A Claude Code plugin that provides guided workflows for setting up, deploying, operating, and troubleshooting the ABCA (Autonomous Background Coding Agents on AWS) platform.

## Installation

```bash
claude --plugin-dir docs/abca-plugin
```

Or add to your project's `.claude/settings.json`:

```json
{
"plugins": ["./docs/abca-plugin"]
}
```

## What's Included

### Skills (slash commands)

| Skill | Trigger | Description |
|-------|---------|-------------|
| `/setup` | First-time setup, prerequisites | Walk through prerequisites, toolchain, and first deployment |
| `/deploy` | Deploy, diff, destroy | Deploy, diff, or destroy the CDK stack |
| `/onboard-repo` | Add a repository | Onboard a GitHub repo via Blueprint CDK construct |
| `/submit-task` | Submit a coding task | Submit tasks with prompt quality guidance and cost controls (supports quick mode) |
| `/troubleshoot` | Debug, errors, failures | Diagnose build, deployment, auth, and task execution issues |
| `/status` | Status, health check | Check stack health, running tasks, and recent history |

### Agents

| Agent | Model | Description |
|-------|-------|-------------|
| `cdk-expert` | Sonnet | AWS CDK infrastructure expert for construct design, handler implementation, and stack modifications |
| `agent-debugger` | Sonnet | Read-only debugging specialist for task failures, preflight errors, and CloudWatch log analysis |

### Hook

- **SessionStart** — Advertises available skills and agents so Claude can proactively suggest them when your request matches.

## Plugin Structure

```
docs/abca-plugin/
plugin.json # Plugin manifest
agents/
cdk-expert.md # CDK infrastructure agent
agent-debugger.md # Runtime debugging agent
hooks/
hooks.json # SessionStart capability advertisement
skills/
setup/SKILL.md # First-time setup workflow
deploy/SKILL.md # CDK deployment management
onboard-repo/SKILL.md # Repository onboarding
submit-task/SKILL.md # Task submission workflow (guided + quick mode)
troubleshoot/SKILL.md # Troubleshooting guide
status/SKILL.md # Platform status checks
```

## Testing

This plugin is markdown and configuration only (no executable code), so traditional unit tests don't apply. Instead, a **3-layer validation strategy** verifies correctness:

| Layer | What it checks |
|-------|---------------|
| **1. Structural** | `plugin.json` fields, file discovery, JSON/YAML validity, no orphaned files |
| **2. Agent Config** | Frontmatter fields (`model`, `tools`, `description`), valid tool names, file path accuracy, capability alignment with examples |
| **3. Content Integrity** | All repo paths exist, all `mise run` commands are valid tasks, all `bgagent` CLI flags match actual help output, skill cross-references resolve, AWS CLI syntax is correct |

### Running the tests

From the repo root with Claude Code:

```
claude --plugin-dir docs/abca-plugin
```

Then ask Claude to validate the plugin:

```
Validate the abca-plugin using the plugin-validator agent, then verify
all command references and file paths in the skills are accurate.
```

Or run the checks manually:

```bash
# Layer 1: Structural — valid JSON
python3 -c "import json; json.load(open('docs/abca-plugin/plugin.json')); print('plugin.json OK')"

# Layer 3: Content — mise tasks exist
MISE_EXPERIMENTAL=1 mise tasks --all 2>/dev/null | grep -E '(build|install|compile|test|deploy|destroy|diff|synth|bootstrap)'

# Layer 3: Content — CLI flags match
node cli/lib/bin/bgagent.js submit --help && node cli/lib/bin/bgagent.js list --help
```

## Development

To modify the plugin:

1. Edit the relevant `.md` file under `skills/` or `agents/`
2. Re-validate using the testing strategy above
3. Ensure any new file paths or commands you reference actually exist in the repo
Loading
Loading