Skip to content
Open
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
20 changes: 20 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
"name": "devfile",
"description": "Claude Code plugins for devfile development",
"owner": {
"name": "devfile.io"
},
"plugins": [
{
"name": "devfile",
"description": "Skills for creating, modifying, and reviewing devfile YAML files (devfile.io v2.3.0)",
"author": {
"name": "devfile.io"
},
"source": "./plugins/devfile",
"category": "productivity",
"homepage": "https://github.com/devfile/claude-plugin/tree/main/plugins/devfile"
}
]
}
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# claude-plugin
Claude plugin that contains skills related to devfile development
# devfile

Claude Code plugin marketplace by [devfile.io](https://devfile.io) for devfile development.

## Plugins

| Plugin | Description |
|--------|-------------|
| [devfile](./plugins/devfile) | Skills for creating, modifying, and reviewing devfile YAML files (v2.3.0) |

## Installation

### 1. Register the marketplace (one-time)

In Claude Code, run:

```
/plugin marketplace add
```

Select "GitHub repository" and enter `devfile/claude-plugin`.

### 2. Install plugins

```
/plugin install devfile@devfile
```
Comment on lines +17 to +27

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add fence languages to command examples.

Both fenced blocks are missing a language identifier, which triggers markdownlint MD040.

Suggested patch
-```
+```bash
 /plugin marketplace add

@@
- +bash
/plugin install devfile@devfile

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 17-17: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 25-25: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 17 - 27, The fenced code blocks containing the shell
commands "/plugin marketplace add" and "/plugin install devfile@devfile" are
missing a language identifier; update those three backtick fences to include a
shell language (e.g., bash) so they read ```bash instead of ``` to satisfy
markdownlint MD040 and ensure correct syntax highlighting for the command
examples.

Source: Linters/SAST tools


## License

[Apache License 2.0](LICENSE)
7 changes: 7 additions & 0 deletions plugins/devfile/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "devfile",
"description": "Skills for creating, modifying, and reviewing devfile YAML files (devfile.io v2.3.0)",
"author": {
"name": "devfile.io"
}
}
100 changes: 100 additions & 0 deletions plugins/devfile/skills/devfile/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
name: devfile
description: Use when creating, modifying, or reviewing devfile/devfile.yaml files or devworkspace configurations (devfile.io v2.3.0)
---

## Overview

A devfile is a YAML file defining containerized development environments — components, commands, events, and deployment flows.
This skill covers the devfile v2.3.0 schema.

**Schema reference:** Read `devfile-schema-reference.md` when you need exact property names, types, defaults, or constraints.

**Output format:** Always output the full devfile YAML in a fenced code block. Add a brief explanation only for non-obvious choices.

## Default Devfile

When starting from scratch, use this as the base:

```yaml
schemaVersion: 2.3.0
metadata:
name: devfile
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:latest
```

## Language/Framework Requests

When asked about a devfile for a specific programming language or framework:

1. Fetch the registry index via `WebFetch` on `https://registry.devfile.io/index` — returns a JSON array of all stacks with `name`, `language`, `projectType`, `tags`, and `description` fields.
2. Pick the best match by language, framework, or tags.
3. Fetch the devfile via `WebFetch` on `https://registry.devfile.io/devfiles/{name}` — returns the raw devfile YAML.
4. Adapt the devfile to the user's needs (adjust image, add components, set resources).
5. Link to `https://registry.devfile.io/devfiles/{name}` as the source.

If no registry match exists, build the devfile from scratch using the default template and appropriate container image.

## Guidelines

### Container Component

- Include `mountSources: true` by default. Omit it only when the container uses `dedicatedPod: true`.
- For non-UDI images (anything other than `quay.io/devfile/universal-developer-image`), include `command: ['sleep', 'infinity']` to keep the container alive for exec commands.

### Volume Component

When adding a volume mount to a container, always create a matching volume component with the same name and size.
For ephemeral volumes, add `ephemeral: true`.

### Image Component

When adding an image component, add `buildContext: .`.

### Variable Substitution Rules

**Syntax:** `{{variable-name}}`

**Cannot substitute in:**
- `schemaVersion`, `metadata`, `parent` source
- Element identifiers: `command.id`, `component.name`, `endpoint.name`, `project.name`
- References to identifiers: event bindings, `exec.component`, `volumeMounts.name`
- String enums: `group.kind`, `endpoint.exposure`

**Undefined variables:** Non-blocking warning (devfile still processed).

### Reserved Environment Variables

These cannot be overridden via container `env`:
- `$PROJECTS_ROOT` — path where project sources are mounted (default `/projects`)
- `$PROJECT_SOURCE` — path to the default project source (`$PROJECTS_ROOT/<project-name>`)

### Pod & Container Overrides

```yaml
# Top-level pod overrides
attributes:
pod-overrides:
spec:
__KUBERNETES_POD_SPEC_FIELDS_HERE__

# Component-level overrides
components:
- name: tools
attributes:
container-overrides:
__KUBERNETES_CONTAINER_FIELDS_HERE__
pod-overrides:
spec:
__KUBERNETES_POD_SPEC_FIELDS_HERE__
```

Merge strategy: devfile-level `pod-overrides` are applied first, then component-level, using Strategic Merge Patch.

| Override Type | Restricted Properties |
|--------------|----------------------|
| `container-overrides` | `image`, `name`, `ports`, `env`, `volumeMounts`, `command`, `args` |
| `pod-overrides` | `containers`, `initContainers`, `volumes` |
Loading