Generates a devfile.yaml for a project repository. Devfiles are YAML files that define development environments for cloud-native applications following the Devfile v2 specification.
- When a project needs a new
devfile.yaml - When setting up a cloud-native development environment (e.g., OpenShift Dev Spaces, Eclipse Che)
- When a user asks to create or regenerate a devfile
Examine the repository to determine:
- Project type — Look at build files to identify the stack:
pom.xmlorbuild.gradle→ Java (check for Quarkus, Spring Boot, etc.)package.json→ Node.js (check for React, Angular, Vue, etc.)requirements.txtorpyproject.toml→ Pythongo.mod→ GoCargo.toml→ RustGemfile→ RubyContainerfileorDockerfile→ Container-based
- Framework — Identify specific frameworks from dependencies
- Build commands — Determine how the project is built and run
- Required ports — Identify which ports the application exposes
- Existing devfile — Check if a
devfile.yamlalready exists and whether it should be updated or replaced
Choose a Universal Developer Image (UDI) or stack-specific image:
| Stack | Recommended Image |
|---|---|
| Java (general) | registry.redhat.io/devspaces/udi-rhel8 |
| Java + Quarkus | registry.redhat.io/devspaces/udi-rhel8 |
| Java + Spring Boot | registry.redhat.io/devspaces/udi-rhel8 |
| Node.js | registry.redhat.io/devspaces/udi-rhel8 |
| Python | registry.redhat.io/devspaces/udi-rhel8 |
| Go | registry.redhat.io/devspaces/udi-rhel8 |
| .NET | registry.redhat.io/devspaces/udi-rhel8 |
| Multi-language | registry.redhat.io/devspaces/udi-rhel8 |
If the project has a parent devfile URI, prefer using the parent field instead of inlining everything.
Create a devfile.yaml at the project root following this structure:
schemaVersion: 2.3.0
metadata:
name: <project-name>
version: <project-version> # optional
description: <brief-description> # optional
language: <primary-language> # optional, e.g., Java, JavaScript, Python
projectType: <framework> # optional, e.g., Quarkus, Spring Boot, Node.js
# Use parent if a shared/base devfile exists
# parent:
# uri: <url-to-parent-devfile>
components:
- name: tools
container:
image: registry.redhat.io/devspaces/udi-rhel8
memoryLimit: 4Gi
memoryRequest: 512Mi
cpuLimit: "2"
cpuRequest: 250m
mountSources: true
volumeMounts:
- name: m2
path: /home/user/.m2 # For Java/Maven projects
endpoints:
- name: https-<app>
targetPort: <port>
exposure: public
protocol: https
# Add volume components as needed
- name: m2
volume:
size: 2Gi
commands:
- id: build
exec:
label: "Build"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "<build-command>"
group:
kind: build
isDefault: true
- id: run
exec:
label: "Run"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "<run-command>"
group:
kind: run
isDefault: true
- id: debug
exec:
label: "Debug"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "<debug-command>"
group:
kind: debug
isDefault: true
- id: test
exec:
label: "Test"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "<test-command>"
group:
kind: test
isDefault: truecommands:
- id: build
exec:
commandLine: ./mvnw package -DskipTests
component: tools
workingDir: ${PROJECT_SOURCE}
group:
kind: build
isDefault: true
- id: run
exec:
commandLine: ./mvnw quarkus:dev -Dquarkus.http.host=0.0.0.0
component: tools
workingDir: ${PROJECT_SOURCE}
group:
kind: run
isDefault: true
- id: debug
exec:
commandLine: ./mvnw quarkus:dev -Dquarkus.http.host=0.0.0.0 -Ddebug=5005
component: tools
workingDir: ${PROJECT_SOURCE}
group:
kind: debug
isDefault: true
- id: test
exec:
commandLine: ./mvnw test
component: tools
workingDir: ${PROJECT_SOURCE}
group:
kind: test
isDefault: true- Default port:
8080 - Volume:
.m2cache at/home/user/.m2
commands:
- id: build
exec:
commandLine: ./mvnw package -DskipTests
- id: run
exec:
commandLine: ./mvnw spring-boot:run -Dspring-boot.run.arguments="--server.address=0.0.0.0"
- id: test
exec:
commandLine: ./mvnw test- Default port:
8080
commands:
- id: build
exec:
commandLine: ./gradlew build -x test
- id: run
exec:
commandLine: ./gradlew bootRun # Spring Bootcommands:
- id: install
exec:
commandLine: npm install
group:
kind: build
isDefault: false
- id: build
exec:
commandLine: npm run build
group:
kind: build
isDefault: true
- id: run
exec:
commandLine: npm start
group:
kind: run
isDefault: true
- id: test
exec:
commandLine: npm test
group:
kind: test
isDefault: true- Default port:
3000(React/Express) or4200(Angular) or5173(Vite) - Volume: npm cache
commands:
- id: install
exec:
commandLine: pip install -r requirements.txt
group:
kind: build
isDefault: true
- id: run
exec:
commandLine: python app.py
group:
kind: run
isDefault: true
- id: test
exec:
commandLine: pytest
group:
kind: test
isDefault: true- Default port:
8000(Django/FastAPI) or5000(Flask)
commands:
- id: build
exec:
commandLine: go build -o app .
group:
kind: build
isDefault: true
- id: run
exec:
commandLine: go run .
group:
kind: run
isDefault: true
- id: test
exec:
commandLine: go test ./...
group:
kind: test
isDefault: trueAfter generating the devfile:
- Ensure the YAML is valid (proper indentation, no syntax errors)
- Verify the
schemaVersionis2.3.0 - Confirm all referenced components in commands exist in the components section
- Check that port numbers match the application's actual configuration
- Verify volume mount paths are correct for the stack
If the project uses a parent devfile (common in enterprise environments):
schemaVersion: 2.3.0
metadata:
name: <project-name>
parent:
uri: <url-to-parent-devfile>
# OR reference a devfile registry
# id: <devfile-id>
# registryUrl: <registry-url>- Parent devfiles provide base components and commands
- Child devfiles can override or extend parent definitions
- Only include fields that differ from or extend the parent
The skill produces a devfile.yaml file at the project root that is ready to use with OpenShift Dev Spaces, Eclipse Che, or any devfile-compatible tool.