Skip to content

Commit 267a384

Browse files
committed
add skills files
1 parent df2783a commit 267a384

20 files changed

Lines changed: 398 additions & 616 deletions

File tree

AGENTS.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
> **Registry Architecture**: Commands are defined as `Resource` + `Operation` structs in `internal/resources/`, NOT as raw Cobra commands in `cmd/`. When adding a new command, implement the `Resource` interface and register it in `register.go`. Do NOT add `cobra.Command` definitions directly.
99
1010
> [!IMPORTANT]
11-
> **Embedded Skills**: Skill documents live in `internal/resources/skills/*.md` and are compiled into the binary via `//go:embed`. Do not create external skill files or reference paths outside this directory.
11+
> **Skills**: Per-command agent skill documents live at `skills/<command>/SKILL.md` (top-level `skills/` directory), each with YAML frontmatter (`name`, `description`, `command`). They are not embedded in the binary — they are distributed separately for agent harnesses to consume.
1212
1313
> [!NOTE]
1414
> **Minimal Dependencies**: The CLI has only 2 external dependencies (Cobra + pflag). Everything else is stdlib. Do not add new dependencies without strong justification.
@@ -40,7 +40,8 @@ The CLI uses a **resource-registry** pattern:
4040
| `main.go` | Entry point: config -> auth -> client -> registry -> execute |
4141
| `cmd/` | Root Cobra command, persistent flags, version command |
4242
| `internal/registry/` | Resource/Operation types, dynamic Cobra command builder |
43-
| `internal/resources/` | All resource implementations + embedded skill docs |
43+
| `internal/resources/` | All resource implementations |
44+
| `skills/` | Per-command agent skill documents (`<command>/SKILL.md` with YAML frontmatter) |
4445
| `internal/client/` | HTTP client with retry logic, structured error types |
4546
| `internal/auth/` | Credential resolution (env -> file), OAuth token caching |
4647
| `internal/config/` | Environment variable configuration loader |
@@ -64,7 +65,6 @@ The CLI uses a **resource-registry** pattern:
6465
| `workspaces.go` | `workspaces list` -- list/filter workspaces with automatic cursor pagination |
6566
| `connectors.go` | `connectors list\|list-available\|describe\|execute\|delete` -- connector management with name->ID resolution hooks |
6667
| `connectors_create.go` | `connectors create` -- interactive browser-based credential flow (OAuth session + polling) |
67-
| `skills.go` | `skills list\|show` -- embedded skill document access via `//go:embed` |
6868

6969
### Client (`internal/client/`)
7070

@@ -94,8 +94,6 @@ The CLI uses a **resource-registry** pattern:
9494
| `connectors` | `execute` | Execute a connector action | `name`+`workspace` or `--id`, `entity`, `action`, `params` |
9595
| `connectors` | `create` | Interactive credential flow | `workspace`, `template_name` or `template_id` |
9696
| `connectors` | `delete` | Delete a connector | `name`+`workspace` or `--id` |
97-
| `skills` | `list` | List available skill docs | -- |
98-
| `skills` | `show` | Show skill document content | `name` (required) |
9997

10098
### Global Flags
10199

@@ -196,24 +194,24 @@ When adding a new resource or operation:
196194
3. Add tests in `internal/resources/<name>_test.go` using `newTestTokenServer()` and `newTestClient()` helpers
197195
4. If the resource uses name-based lookup, add a `PreRun` hook for server-side ID resolution
198196
5. Update the **Command Surface** table in this file
199-
6. If the resource needs usage guidance, add a skill document in `internal/resources/skills/<name>.md`
197+
6. If the resource adds a new leaf command, add a corresponding `skills/<command>/SKILL.md` with frontmatter (`name`, `description`, `command`) and task-oriented agent guidance
200198

201199
### Adding New Skills
202200

203-
Skill documents auto-register via Go's `//go:embed` directive. To add a new skill:
201+
Skills are plain markdown files at `skills/<command>/SKILL.md`. To add one:
204202

205-
1. Create `internal/resources/skills/<name>.md` with a `# Title` heading followed by a one-line description
206-
2. The skill will automatically appear in `airbyte skills list` and be readable via `airbyte skills show --json '{"name": "<name>"}'`
207-
3. No code changes required -- the embed FS picks up all `.md` files in the directory
203+
1. Create the folder: `skills/<resource>-<operation>/`
204+
2. Add `SKILL.md` with YAML frontmatter:
205+
```
206+
---
207+
name: <resource>-<operation>
208+
description: <one-line summary used by listing tools>
209+
command: airbyte <resource> <operation>
210+
---
211+
```
212+
3. Follow with task-oriented body content (when to use, usage examples, error recovery, "do NOT" guidance).
213+
4. No Go changes required — skills are not embedded in the binary.
208214

209215
## Skills Reference
210216

211-
| Skill | Purpose |
212-
| --- | --- |
213-
| `getting-started` | Auth setup, first commands, schema discovery, error handling |
214-
| `connectors` | Connector management workflows, credential flow, error recovery |
215-
| `workspaces` | Workspace discovery and filtering |
216-
| `discovery` | First-time enrollment, provisioning, organization listing |
217-
218-
Run `airbyte skills list` to see all available skills.
219-
Run `airbyte skills show --json '{"name": "<skill>"}'` for detailed guidance.
217+
Skills live at `skills/<command>/SKILL.md`, one per leaf command. Browse the `skills/` directory directly to see what is available.

CONTEXT.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,6 @@ echo '{"workspace": "my-workspace", "name": "my-source", "entity": "users", "act
158158
airbyte connectors execute --json @params.json
159159
```
160160

161-
### 8. Skills
162-
163-
```bash
164-
# List available skill documents
165-
airbyte skills list
166-
167-
# Read a specific skill
168-
airbyte skills show --json '{"name": "connectors"}'
169-
```
170-
171161
## Error Handling
172162

173163
All errors are JSON on stderr with an exit code:

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The CLI exposes Airbyte's resources (organizations, workspaces, connectors, etc.
99
- **Resource-driven**: commands aren't hand-written Cobra trees. Resources are declared as Go structs in `internal/resources/`, registered into a global registry, and dynamically materialized into Cobra commands at startup.
1010
- **Self-describing**: any command will print its full parameter schema with `--describe`, so callers (especially LLMs) can discover required fields without guessing.
1111
- **Minimal**: only two external dependencies (Cobra + pflag). Everything else is stdlib.
12-
- **Embedded skills**: usage guidance for common workflows (auth, connectors, workspaces, discovery) is compiled into the binary and accessible via `airbyte skills`.
12+
- **Distributable skills**: per-command agent skill documents live in `skills/<command>/SKILL.md` for downstream tooling (e.g. Claude Code) to consume directly.
1313

1414
See `AGENTS.md` for the full architecture reference and `CONTEXT.md` for the agent-facing usage guide.
1515

@@ -30,7 +30,8 @@ main.go
3030
| --- | --- |
3131
| `cmd/` | Root Cobra command, persistent flags, version |
3232
| `internal/registry/` | `Resource` interface, dynamic command builder |
33-
| `internal/resources/` | Resource implementations + embedded skill docs |
33+
| `internal/resources/` | Resource implementations |
34+
| `skills/` | Per-command agent skill documents (`<command>/SKILL.md`) |
3435
| `internal/client/` | HTTP client (3x exponential-backoff retry on 429/5xx, 30s timeout) |
3536
| `internal/auth/` | Credential resolution, OAuth token caching |
3637
| `internal/config/` | Environment variable loader |
@@ -127,7 +128,6 @@ airbyte connectors execute --describe # show parameter schema
127128
| `connectors` | `execute` | Run an action on a connector |
128129
| `connectors` | `create` | Interactive browser-based credential flow |
129130
| `connectors` | `delete` | Delete a connector |
130-
| `skills` | `list` / `show` | Read embedded usage guides |
131131

132132
### Examples
133133

@@ -184,14 +184,7 @@ When you see a validation error, re-run the command with `--describe` to inspect
184184

185185
## Skills
186186

187-
Skill documents are markdown files compiled into the binary via `//go:embed`. They provide task-oriented guidance for agents.
188-
189-
```bash
190-
airbyte skills list
191-
airbyte skills show --json '{"name": "connectors"}'
192-
```
193-
194-
Available skills: `getting-started`, `connectors`, `workspaces`, `discovery`.
187+
Per-command agent skill documents live under `skills/<command>/SKILL.md`, each with YAML frontmatter (`name`, `description`, `command`) and task-oriented guidance. They are designed to be consumed by agent harnesses (e.g. Claude Code) — copy or symlink the directory into the harness's skill location, or distribute via your own tooling.
195188

196189
## Develop
197190

internal/resources/enrollment_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ func TestResourceMetadata(t *testing.T) {
206206
{&organizationsResource{}, "organizations", "Manage organizations"},
207207
{&workspacesResource{}, "workspaces", "Manage workspaces"},
208208
{&connectorsResource{}, "connectors", "Manage connectors"},
209-
{&skillsResource{}, "skills", "Agent skill documents"},
210209
}
211210

212211
for _, tt := range tests {

internal/resources/register.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ func RegisterAll() {
88
registry.Register(&organizationsResource{})
99
registry.Register(&workspacesResource{})
1010
registry.Register(&connectorsResource{})
11-
registry.Register(&skillsResource{})
1211
}

internal/resources/skills.go

Lines changed: 0 additions & 112 deletions
This file was deleted.

internal/resources/skills/connectors.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)