Sign inSign up

todddensmore978/docker-docs-kit:1.0.1

Manifest digest

sha256:3d42729c84a50596a1d73ad3be272bd9af6ff5342a95f9263b2431c17a9036ef

Last pushed

4 days by todddensmore978

Type

Sandbox Kit

Manifest digest

sha256:3d42729c84a50596a1d73ad3be272bd9af6ff5342a95f9263b2431c17a9036ef

yaml
schemaVersion: "2"
kind: mixin
name: docker-docs
version: 1.0.1
displayName: Docker document standard
description: |
    Makes every document, slide deck, and Google Doc the agent produces look and read like a professional Docker document. Stages the docker-style, docker-doc, docker-slides, docker-gdoc, and docker-review skills plus the brand tokens, and installs the rendering toolchain (LibreOffice, Poppler, pandoc, docx, pptxgenjs) once per sandbox.
licenses:
    - Apache-2.0
agentInstructions:
    content: |
        ## Docker document standard (docker-docs kit)

        Every document, deck, memo, proposal, runbook, or Google Doc you
        produce follows the Docker standard. Skills are in ~/.claude/skills/,
        brand tokens in ~/brand/brand.json, themes in ~/brand/themes/, and
        the dockerdocs command is on PATH.

        Commands (every slash command starts with docker-, type /docker- to see them):

        - /docker-brief: interview the user, then `dockerdocs new` scaffolds the
          Markdown source and its manifest.
        - /docker-create-doc, /docker-create-slides: `dockerdocs create-doc SOURCE.md` and
          `dockerdocs create-slides SOURCE.slides.md` lint, render a NEW file
          with the active theme, and record it in SOURCE.docs.json.
        - /docker-update-doc, /docker-update-slides: `dockerdocs update-doc SOURCE.md` and
          `dockerdocs update-slides SOURCE.slides.md` re-render the recorded
          targets in place. Edit the Markdown, never the .docx or .pptx.
        - /docker-set-theme: `dockerdocs set-theme NAME [--for SOURCE.md]`.
          `dockerdocs themes` lists them. Co-branding goes through a theme.
        - `dockerdocs status`, `dockerdocs pull FILE`, `dockerdocs lint FILE`.

        Rendered files land in $DOCKERDOCS_OUT when it is set (the sbx-docs
        launcher points it at the user's ~/Downloads/docker-docs, mounted from
        the host at the same path), otherwise in out/ next to the Markdown.
        Tell the user the host path of every file you deliver. If dockerdocs
        warns that DOCKERDOCS_OUT is not reachable, the sandbox was started
        without the Downloads mount: say so and give the out/ path instead.

        Google Docs is optional. If the user asks for a Google Doc and no
        gdocs_* tools are available, say that Google Docs is not turned on
        for this sandbox and that `./run.sh gdoc setup` on the host turns it
        on (a new sandbox is needed afterwards). Offer the Word document as
        the alternative. Never try to sign in to Google from the sandbox.

        When a command prints a line starting with HANDOFF, call the named
        gdocs_* MCP tool with the given arguments, then run the `then`
        command it names so the manifest records the Google Doc id.

        Workflow, without exception: load docker-style, draft or edit
        Markdown following its document anatomy, run the command (it lints
        first and refuses on errors), convert Office output to PDF with
        soffice --headless --convert-to pdf and look at the pages, lint the
        rendered file with `dockerdocs lint`, then deliver.

        Hard rules: no em dashes, no semicolons in prose, sentence-case
        headings, no hedge or marketing words, second person, bold only for
        UI elements. Fonts are Arial and Courier New in Office files, Inter
        and Roboto Mono in Google Docs. Colors come from the active theme.

        Toolchain in this sandbox: node with docx, pptxgenjs, marked, sharp,
        react, react-dom, and react-icons installed in /home/agent/node_modules
        and on NODE_PATH, so require() works from any directory. The workspace
        is mounted at the same path it has on the host. LibreOffice (soffice),
        pdftoppm, pandoc, markitdown, python-docx, and python-pptx are
        installed. Anthropic's docx, pptx, and pdf skills, when present in
        ~/.claude/skills, hold the file-format details. The docker-* skills
        hold the standard.
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
            - registry.npmjs.org:443
            - pypi.org:443
            - files.pythonhosted.org:443
            - github.com:443
            - codeload.github.com:443
            - docs.docker.com:443
            - www.docker.com:443
environment:
    variables:
        DOCKER_BRAND_JSON: /home/agent/brand/brand.json
        DOCKER_DOCS_KIT: "1"
        NODE_PATH: /home/agent/node_modules
setup:
    install:
        - command: |
            set -eu
            export DEBIAN_FRONTEND=noninteractive
            apt-get update -qq
            apt-get install -y -qq --no-install-recommends \
              libreoffice-writer libreoffice-impress libreoffice-calc \
              fonts-liberation fonts-dejavu-core fonts-inter fonts-roboto \
              poppler-utils pandoc unzip zip
            rm -rf /var/lib/apt/lists/*
          description: Install LibreOffice, fonts, Poppler, pandoc, and zip tools
        - command: |
            set -eu
            pip3 install --quiet --break-system-packages \
              "markitdown[pptx,docx]" python-pptx python-docx Pillow defusedxml lxml
          description: Install the Python libraries the docx and pptx skills use
        - command: |
            set -eu
            export HOME=/home/agent
            cd /home/agent
            npm install --no-save --no-audit --no-fund --loglevel=error \
              docx pptxgenjs marked sharp react react-dom react-icons
            node -e "require('docx'); require('pptxgenjs'); require('marked'); require('sharp')"
            chmod +x /home/agent/.claude/skills/docker-doc/scripts/*.js \
                     /home/agent/.claude/skills/docker-slides/scripts/*.js \
                     /home/agent/.claude/skills/docker-review/scripts/*.py \
                     /home/agent/.local/bin/dockerdocs || true
          user: "1000"
          description: Install docx, pptxgenjs, marked, and sharp for the renderers
        - command: |
            set -eu
            export HOME=/home/agent
            # The docker-* skills lean on Anthropic's file-format skills. The
            # host's shared skills store usually links them in already; when it
            # does not (a kit pulled from a registry, no `sbx skills add`), fetch
            # them from Anthropic's public repository so the kit is self-contained.
            cd /home/agent/.claude/skills
            missing=""
            for s in docx pptx pdf xlsx; do [ -e "$s" ] || missing="$missing $s"; done
            [ -z "$missing" ] && { echo "office skills already present"; exit 0; }
            tmp=$(mktemp -d)
            git clone -q --depth 1 --filter=blob:none --sparse https://github.com/anthropics/skills "$tmp"
            (cd "$tmp" && git sparse-checkout set $(for s in $missing; do printf 'skills/%s ' "$s"; done) >/dev/null)
            for s in $missing; do [ -d "$tmp/skills/$s" ] && cp -R "$tmp/skills/$s" "./$s" && echo "fetched $s skill"; done
            rm -rf "$tmp"
          user: "1000"
          description: Fetch Anthropic's docx, pptx, pdf, and xlsx skills when the skills store did not provide them
        - command: |
            set -eu
            for b in soffice pdftoppm pandoc node python3; do command -v "$b" >/dev/null || { echo "missing $b" >&2; exit 1; }; done
            python3 -c "import pptx, docx, markitdown"
            su agent -c 'cd /home/agent && DOCKER_BRAND_JSON=/home/agent/brand/brand.json /home/agent/.local/bin/dockerdocs themes' >/dev/null
            echo "docker-docs kit ready"
          description: Verify the toolchain