feat(toolbox-stack): add shared prompt and scaffolding template

This commit is contained in:
2025-10-29 07:17:56 -05:00
parent d26235f5e2
commit fa12fd0983
9 changed files with 203 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
{
"name": "TSYSDevStack {{toolbox_name}}",
"dockerComposeFile": [
"../docker-compose.yml"
],
"service": "{{toolbox_name}}",
"workspaceFolder": "/workspace",
"remoteUser": "toolbox",
"runServices": [
"{{toolbox_name}}"
],
"overrideCommand": false,
"postCreateCommand": "zsh -lc 'starship --version >/dev/null'"
}

View File

@@ -0,0 +1,25 @@
You are Codex, collaborating with a human on the TSYSDevStack ToolboxStack project.
- Seed context:
- `SEED` captures the initial scope. Edit it once to define goals, then treat it as read-only unless the high-level objectives change.
- Start each session by reading it (`cat SEED`) and summarize progress or adjustments here in PROMPT.
Context snapshot ({{toolbox_name}}):
- Working directory: artifacts/ToolboxStack/{{toolbox_name}}
- Image: tsysdevstack-toolboxstack-{{toolbox_name}} (Ubuntu 24.04)
- Container user: toolbox (non-root, UID/GID mapped to host)
- Mounted workspace: current repo at /workspace (rw)
Current state:
- Seed items above still need to be translated into Dockerfile/tooling work.
- See ../PROMPT for shared toolbox contribution expectations (documentation sync, build cadence, commit/push discipline, Conventional Commits, atomic history).
Collaboration checklist:
1. Translate SEED goals into concrete tooling decisions; mirror outcomes in README.md and this PROMPT (do not rewrite SEED unless the scope resets).
2. Prefer aqua-managed CLIs and mise-managed runtimes for reproducibility.
3. After each tooling change, update README/PROMPT, run ./build.sh, commit (Conventional Commit message, focused diff), and push only once the build succeeds per ../PROMPT.
4. Record verification steps (build/test commands) as they are performed.
5. Maintain UID/GID mapping and non-root execution.
Active focus:
- Initialize {{toolbox_name}} using the toolbox-template scaffolding; evolve the Dockerfile/tooling inventory to satisfy the SEED goals.

View File

@@ -0,0 +1,3 @@
- TODO: describe what this toolbox should provide (languages, CLIs, workflows).
- TODO: list required base image modifications or additional mounts.
- TODO: note verification or testing expectations specific to this toolbox.

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
IMAGE_NAME="tsysdevstack-toolboxstack-{{toolbox_name}}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
USER_ID="${USER_ID_OVERRIDE:-$(id -u)}"
GROUP_ID="${GROUP_ID_OVERRIDE:-$(id -g)}"
USERNAME="${USERNAME_OVERRIDE:-toolbox}"
TEA_VERSION="${TEA_VERSION_OVERRIDE:-0.11.1}"
BUILDER_NAME="${BUILDER_NAME:-tsysdevstack-toolboxstack-builder}"
CACHE_DIR="${SCRIPT_DIR}/.build-cache"
echo "Building ${IMAGE_NAME} with UID=${USER_ID} GID=${GROUP_ID} USERNAME=${USERNAME}"
if ! docker buildx inspect "${BUILDER_NAME}" >/dev/null 2>&1; then
docker buildx create --driver docker-container --name "${BUILDER_NAME}" --use >/dev/null
else
docker buildx use "${BUILDER_NAME}" >/dev/null
fi
mkdir -p "${CACHE_DIR}"
docker buildx build \
--builder "${BUILDER_NAME}" \
--load \
--progress=plain \
--build-arg USER_ID="${USER_ID}" \
--build-arg GROUP_ID="${GROUP_ID}" \
--build-arg USERNAME="${USERNAME}" \
--build-arg TEA_VERSION="${TEA_VERSION}" \
--cache-from "type=local,src=${CACHE_DIR}" \
--cache-to "type=local,dest=${CACHE_DIR},mode=max" \
--tag "${IMAGE_NAME}" \
"${SCRIPT_DIR}"

View File

@@ -0,0 +1,20 @@
services:
{{toolbox_name}}:
container_name: tsysdevstack-toolboxstack-{{toolbox_name}}
image: tsysdevstack-toolboxstack-{{toolbox_name}}
build:
context: .
args:
USER_ID: ${LOCAL_UID:-1000}
GROUP_ID: ${LOCAL_GID:-1000}
USERNAME: ${LOCAL_USERNAME:-toolbox}
user: "${LOCAL_UID:-1000}:${LOCAL_GID:-1000}"
working_dir: /workspace
command: ["sleep", "infinity"]
init: true
tty: true
stdin_open: true
volumes:
- .:/workspace:rw
- ${HOME}/.local/share/mise:/home/toolbox/.local/share/mise:rw
- ${HOME}/.cache/mise:/home/toolbox/.cache/mise:rw

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
COMPOSE_FILE="${SCRIPT_DIR}/docker-compose.yml"
export LOCAL_UID="${USER_ID_OVERRIDE:-$(id -u)}"
export LOCAL_GID="${GROUP_ID_OVERRIDE:-$(id -g)}"
export LOCAL_USERNAME="${USERNAME_OVERRIDE:-toolbox}"
if [[ ! -f "${COMPOSE_FILE}" ]]; then
echo "Error: docker-compose.yml not found at ${COMPOSE_FILE}" >&2
exit 1
fi
ACTION="${1:-up}"
shift || true
if [[ "${ACTION}" == "up" ]]; then
mkdir -p "${HOME}/.local/share/mise" "${HOME}/.cache/mise"
fi
case "${ACTION}" in
up)
docker compose -f "${COMPOSE_FILE}" up --build --detach "$@"
;;
down)
docker compose -f "${COMPOSE_FILE}" down "$@"
;;
*)
echo "Usage: $0 [up|down] [additional docker compose args]" >&2
exit 1
;;
esac