HUB
Sign inSign up

todddensmore978/docker-instruqt-kit:1.0.0

Manifest digest

sha256:d064fd9876fbf04b08a607dcbad69822a3aad90eed1ba8e4c271227706d50574

Last pushed

18 days by todddensmore978

Type

Sandbox Kit

Manifest digest

sha256:d064fd9876fbf04b08a607dcbad69822a3aad90eed1ba8e4c271227706d50574

yaml
schemaVersion: "2"
kind: mixin
name: docker-instruqt
version: 1.0.0
displayName: Docker Instruqt lab standard
description: |
    Makes every Instruqt track the agent writes look and behave like a professional Docker lab. Stages the lab-style, lab-track, lab-scripts, lab-brief, lab-create, lab-add-challenge, and lab-review skills, the labkit command (scaffold, lint, preview), and the Docker lab theme. No Instruqt credential enters the sandbox.
licenses:
    - Apache-2.0
agentInstructions:
    content: |
        ## Docker Instruqt lab standard (docker-instruqt kit)

        Every Instruqt track, lab, challenge, or quiz you write follows the Docker
        lab standard. Skills are in ~/.claude/skills/, the theme is in
        ~/brand/lab-theme.json, and the labkit command is on PATH.

        Commands (type /lab- to see them):

        - /lab-brief: interview the user, then write a brief file.
        - /lab-create: build a complete track from a brief or a description.
        - /lab-add-challenge: add or rewrite one challenge in an existing track.
        - /lab-review: audit any track (made here or not), report, and fix on request.

        labkit commands: `labkit new`, `labkit add-challenge [--quiz]`, `labkit lint`,
        `labkit rehero`, `labkit preview [--png]`, `labkit validate`, `labkit prose`,
        `labkit rules`. Scaffold with labkit, never write track.yml, a hero card,
        or script boilerplate from memory.

        Workflow, without exception: load lab-style, scaffold with labkit, fill every
        TODO(lab) marker, run `labkit lint TRACK` until it prints 0 errors, run
        `labkit preview TRACK --png` and look at the image, then hand off.

        Hard rules: no em dashes or en dashes anywhere (code comments in scripts
        too), no semicolons in prose, sentence-case headings, second person, no hedge
        or marketing words, "select" instead of "click".

        This sandbox holds no Instruqt credential and never will. Do not run
        `instruqt auth`, `track push`, or `track test`. When the work is done, give the
        user these host commands: `cd TRACK`, `instruqt track validate`,
        `instruqt auth login`, `instruqt track push`, `instruqt track test`,
        `instruqt track open`. Never claim a script was tested on the platform:
        `labkit lint` checks structure, style, and shell syntax, and `instruqt track
        test` is the real test. List what could not be verified.

        The instruqt CLI is installed only when this sandbox is x86 (its Linux build is
        not available for arm64). `labkit validate` runs it when it can and says so when
        it cannot. A skipped validate is not a pass.

        Preview PNGs need Chromium. If `labkit preview --png` reports no browser, open
        preview/index.html is the fallback: tell the user its host path.
permissions:
    network:
        allow:
            - archive.ubuntu.com:80
            - archive.ubuntu.com:443
            - security.ubuntu.com:80
            - security.ubuntu.com:443
            - ports.ubuntu.com:80
            - ports.ubuntu.com:443
            - pypi.org:443
            - files.pythonhosted.org:443
            - cdn.playwright.dev:443
            - playwright.download.prss.microsoft.com:443
            - github.com:443
            - objects.githubusercontent.com:443
            - release-assets.githubusercontent.com:443
            - docs.instruqt.com:443
            - docs.docker.com:443
            - fonts.googleapis.com:443
            - fonts.gstatic.com:443
environment:
    variables:
        DOCKER_INSTRUQT_KIT: "1"
        LABKIT_THEME: /home/agent/brand/lab-theme.json
        PYTHONPATH: /home/agent/labkit
setup:
    install:
        - command: |
            set -eu
            export DEBIAN_FRONTEND=noninteractive
            apt-get update -qq
            apt-get install -y -qq --no-install-recommends shellcheck unzip curl ca-certificates fonts-inter fonts-roboto
            rm -rf /var/lib/apt/lists/*
          description: Install shellcheck and fonts
        - command: |
            set -eu
            pip3 install --quiet --break-system-packages -r /home/agent/labkit/requirements.txt
            chmod +x /home/agent/.local/bin/labkit
            chown -R agent:agent /home/agent/labkit /home/agent/.local /home/agent/brand 2>/dev/null || true
          description: Install labkit's Python dependencies
        - command: |
            set -eu
            # The instruqt CLI ships a Linux build for x86 only. Pinned, checksum verified.
            if [ "$(uname -m)" != "x86_64" ]; then
              echo "instruqt CLI skipped: no Linux build for $(uname -m). labkit validate will say so."
              exit 0
            fi
            v=2427-422d0f4
            sha=6bcef7c37b82fce83653c620d1eb1d11577e0d5b962fcc34ebb4358e61220735
            tmp=$(mktemp -d)
            curl -fsSL "https://github.com/instruqt/cli/releases/download/$v/instruqt-linux.zip" -o "$tmp/i.zip"
            echo "$sha  $tmp/i.zip" | sha256sum -c -
            unzip -q "$tmp/i.zip" -d "$tmp"
            install -m 0755 "$tmp/instruqt" /usr/local/bin/instruqt
            rm -rf "$tmp"
            instruqt version | head -2
          description: Install the instruqt CLI when the architecture allows
        - command: |
            set -u
            # Optional: headless Chromium so labkit preview can write PNGs. Failure is not fatal.
            # Playwright's --with-deps refuses newer Ubuntu releases, so install the libraries with apt
            # and download the Ubuntu 24.04 build, which runs on later releases.
            export DEBIAN_FRONTEND=noninteractive PLAYWRIGHT_BROWSERS_PATH=/opt/pw
            case "$(uname -m)" in x86_64) plat=ubuntu24.04-x64 ;; *) plat=ubuntu24.04-arm64 ;; esac
            apt-get update -qq || true
            apt-get install -y -qq --no-install-recommends libglib2.0-0t64 libdbus-1-3 libatk1.0-0t64 libatspi2.0-0t64 \
              libx11-6 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libxcb1 libxkbcommon0 \
              libasound2t64 libnss3 libnspr4 libcups2t64 libdrm2 libpango-1.0-0 libcairo2 || true
            rm -rf /var/lib/apt/lists/*
            if pip3 install --quiet --break-system-packages "playwright==1.55.0" \
              && PLAYWRIGHT_HOST_PLATFORM_OVERRIDE="$plat" python3 -m playwright install chromium; then
              chmod -R a+rX /opt/pw
              echo "chromium installed"
            else
              echo "preview PNGs unavailable: Chromium did not install. HTML preview still works." >&2
            fi
            exit 0
          description: Install headless Chromium for preview screenshots (optional)
        - command: |
            set -eu
            su agent -c '/home/agent/.local/bin/labkit rules >/dev/null && /home/agent/.local/bin/labkit --version'
            command -v shellcheck >/dev/null
            echo "docker-instruqt kit ready"
          description: Verify the toolchain