| name | New Feature | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Implement a new Dev Container Feature in this repository. | ||||||||||||
| tools |
|
||||||||||||
| user-invocable | true | ||||||||||||
| disable-model-invocation | false | ||||||||||||
| target | vscode |
DELIVERABLES_CREATE: YAML<<
- path: "src/{FEATURE_ID}/devcontainer-feature.json" purpose: "Feature metadata with id, name, version, description, and options"
- path: "src/{FEATURE_ID}/install.sh" purpose: "Installer script that downloads from GitHub releases"
- path: "test/{FEATURE_ID}/test.sh" purpose: "Basic smoke test using dev-container-features-test-lib"
- path: "test/_global/{FEATURE_ID}-specific-version.sh" purpose: "Version-pinned test that greps for expected version string"
DELIVERABLES_UPDATE: YAML<<
- path: "test/_global/all-tools.sh" action: "Add a check line for the new binary before reportResults"
- path: "test/_global/scenarios.json" action: "Add feature to all-tools.features and add a version-pinned scenario"
- path: ".github/workflows/test.yaml" action: "Add feature id to matrix.features array"
- path: "README.md" action: "Add row to features table and add usage section"
ARCH_MAP: YAML<< x86_64: "x86_64" amd64: "x86_64" aarch64: "aarch64" arm64: "aarch64" armv7l: "armv7" i386: "i686" i686: "i686"
FEATURE_JSON_TEMPLATE: JSON<< { "name": "{FEATURE_DISPLAY_NAME}", "id": "{FEATURE_ID}", "version": "1.0.0", "description": "{DESCRIPTION}", "options": { "version": { "type": "string", "default": "latest", "description": "Version to install from GitHub releases" } } }
INSTALL_SH_STRUCTURE: TEXT<<
- Shebang: #!/usr/bin/env bash with set -e
- Variables: REPO_OWNER, REPO_NAME, BINARY_NAME, VERSION
- Root check: exit 1 if $(id -u) is not 0
- Clean up: rm -rf /var/lib/apt/lists/*
- check_packages helper: install apt deps if missing
- Install deps: curl jq ca-certificates tar
- get_latest_version: query GitHub API /repos/OWNER/REPO/releases/latest
- Version resolution: if empty or "latest" call get_latest_version
- Architecture: uname -m with case for x86_64, i686, aarch64, armv7l
- OS: uname -s mapped to linux/darwin identifiers
- Download URL: construct from owner/repo/version/arch/os
- Temp dir: mktemp -d, cd, curl -sSL, extract
- Move: mv binary /usr/local/bin/, chmod if needed
- Cleanup: rm -rf temp dir, rm -rf /var/lib/apt/lists/*
- Verify: run binary --version
TEST_PATTERN: TEXT<< #!/bin/bash set -e source dev-container-features-test-lib check "{FEATURE_ID}" {BINARY_NAME} --version reportResults
VERSION_TEST_PATTERN: TEXT<< #!/bin/bash set -e source dev-container-features-test-lib check "{FEATURE_ID} with specific version" /bin/bash -c "{BINARY_NAME} --version | grep '{PIN_VERSION}'" reportResults
# Feature: ()
Source: <SOURCE_REPO>
<CREATED_FILES>
<UPDATED_FILES>
<TEST_COMMANDS>
WHERE: - is Markdown; bulleted list of created file paths. - is String; human-friendly feature name. - is String; lowercase identifier used in file paths. - is String; warnings, assumptions, or follow-up actions. - is String; GitHub owner/repo of the upstream tool. - is Markdown; shell commands to test the new feature. - is Markdown; bulleted list of updated file paths with change summary. FEATURE_ID: "" FEATURE_DISPLAY_NAME: "" SOURCE_REPO: "" BINARY_NAME: "" REQUESTED_VERSION: "latest" SUPPORT_CHECKSUM: false RELEASE_ASSET_PATTERN: "" TEST_RESULT: "" RUN `parse-input` RUN `create-branch` RUN `inspect-upstream` RUN `scaffold` RUN `integrate` RETURN: format="SCAFFOLD_SUMMARY" WAIT for user approval RUN `commit-feature` RUN `test-feature` RUN `create-pr` SET FEATURE_ID := (from "Agent Inference" using INP) SET SOURCE_REPO := (from "Agent Inference" using INP) SET FEATURE_DISPLAY_NAME := (from "Agent Inference" using FEATURE_ID) SET BINARY_NAME := (from "Agent Inference" using FEATURE_ID) IF INP contains "version=": SET REQUESTED_VERSION := (from "Agent Inference" using INP) IF INP contains "checksum=true": SET SUPPORT_CHECKSUM := true (from "Agent Inference") USE `execute/runInTerminal` where: command="git checkout -b feat/{FEATURE_ID}" USE `web/githubRepo` where: query="latest release assets", repo=SOURCE_REPO CAPTURE RELEASE_ASSET_PATTERN from result USE `read/readFile` where: filePath="src/bat/install.sh" CAPTURE REFERENCE_INSTALL from result USE `edit/createDirectory` where: dirPath="src/{FEATURE_ID}" SET FEATURE_JSON := (from "Agent Inference" using FEATURE_DISPLAY_NAME, FEATURE_ID, FEATURE_JSON_TEMPLATE) USE `edit/createFile` where: content=FEATURE_JSON, filePath="src/{FEATURE_ID}/devcontainer-feature.json" SET INSTALL_SCRIPT := <SCRIPT> (from "Agent Inference" using INSTALL_SH_STRUCTURE, REFERENCE_INSTALL, RELEASE_ASSET_PATTERN, SOURCE_REPO, SUPPORT_CHECKSUM) USE `edit/createFile` where: content=INSTALL_SCRIPT, filePath="src/{FEATURE_ID}/install.sh" USE `edit/createDirectory` where: dirPath="test/{FEATURE_ID}" SET TEST_SCRIPT := <SCRIPT> (from "Agent Inference" using BINARY_NAME, FEATURE_ID, TEST_PATTERN) USE `edit/createFile` where: content=TEST_SCRIPT, filePath="test/{FEATURE_ID}/test.sh" SET VERSION_TEST := <SCRIPT> (from "Agent Inference" using BINARY_NAME, FEATURE_ID, REQUESTED_VERSION, VERSION_TEST_PATTERN) USE `edit/createFile` where: content=VERSION_TEST, filePath="test/_global/{FEATURE_ID}-specific-version.sh" USE `read/readFile` where: filePath="test/_global/all-tools.sh" USE `edit/editFiles` where: filePath="test/_global/all-tools.sh" USE `read/readFile` where: filePath="test/_global/scenarios.json" USE `edit/editFiles` where: filePath="test/_global/scenarios.json" USE `read/readFile` where: filePath=".github/workflows/test.yaml" USE `edit/editFiles` where: filePath=".github/workflows/test.yaml" USE `read/readFile` where: filePath="README.md" USE `edit/editFiles` where: filePath="README.md" USE `execute/runInTerminal` where: command="git add -A && git commit -m 'feat: add {FEATURE_ID} dev container feature'" USE `execute/runInTerminal` where: command="devcontainer features test -f {FEATURE_ID} -i ubuntu:latest ." CAPTURE TEST_RESULT from result IF TEST_RESULT contains "FAILED": TELL "Test failed. Review output and fix install.sh." level=error USE `execute/runInTerminal` where: command="git push origin feat/{FEATURE_ID}" USE `execute/runInTerminal` where: command="gh pr create --base main --head feat/{FEATURE_ID} --title 'feat: add {FEATURE_DISPLAY_NAME} dev container feature' --fill" Feature request in the form: in @/ [version=] [checksum=true] Examples: "ripgrep in @BurntSushi/ripgrep", "mise in @jdx/mise version=2024.7.1"