Skip to content

feat(adr-013): Phase 0b — submodule bump + dev preset bundles#294

Open
samxu01 wants to merge 4 commits intomainfrom
feat/adr-013-phase-0b-toolchain-and-bundles
Open

feat(adr-013): Phase 0b — submodule bump + dev preset bundles#294
samxu01 wants to merge 4 commits intomainfrom
feat/adr-013-phase-0b-toolchain-and-bundles

Conversation

@samxu01
Copy link
Copy Markdown
Contributor

@samxu01 samxu01 commented May 4, 2026

Summary

ADR-013 Phase 0b + Phase 1 — wires the gateway-side and preset-side so dev agents can produce DOCX/XLSX/PPTX/PDF deliverables and attach them to chat today, with no follow-up PR needed for officecli.

Depends on Team-Commonly/openclaw#2 — submodule pointer references the feature-branch SHA.

What ships

1. Submodule bump → _external/clawdbot

Moves to feat/commonly-attach-file which adds:

  • commonly_attach_file extension tool — kernel verb, uploads + posts [[upload:...]] directive
  • uploadFile() client method — multipart POST to /api/agents/runtime/pods/:podId/uploads
  • toRelativeWorkspacePath exported from plugin-sdk — path-traversal protection
  • OPENCLAW_INSTALL_DOC_TOOLCHAIN build arg — opt-in ~170MB toolchain (pinned OfficeCLI + pandoc + texlive + markitdown + pypdf)

2. defaultSkills bundles for the four production dev presets

Preset Bundle
dev-pm (Theo) github, officecli, pandic-office, markdown-converter, pdf
backend-engineer (Nova) github, tmux, officecli, pandic-office, markdown-converter, pdf
frontend-engineer (Pixel) github, tmux, officecli, pandic-office, markdown-converter, pdf
devops-engineer (Ops) github, tmux, officecli, pandic-office, markdown-converter, pdf

3. Auto-import — making defaultSkills actually do something

The fix to a real gap. Before this commit, defaultSkills was metadata-only — consumed by presets-router.ts to display readiness in the install UI, but never read by provision/reprovision. So those bundle declarations would have been inert.

This commit adds backend/services/presetSkillsAutoImport.ts (new helper, ~210 lines) and wires it into provision.ts + reprovision.ts. The flow:

  1. provisionAgentRuntime returns
  2. NEW: applyPresetDefaultSkills resolves each defaultSkills[i].id to SKILL.md content (local bundle first, then catalog) and upserts each as a PodAsset via the existing PodAssetService.upsertImportedSkillAsset
  3. syncOpenClawSkills queries those PodAsset rows and writes their SKILL.md files to /workspace/<accountId>/skills/<id>/ on the gateway PVC

Pure reuse, zero new plumbing: same path the manual POST /api/skills/import route uses. Same skillKey upsert pattern means re-running provision is idempotent. Same gateway sync runs unchanged. The only new thing is the lookup-and-call helper.

4. Local skill bundles → commonly-bundled-skills/

New top-level directory for skills shipped with this repo that aren't in the upstream catalog yet. The auto-importer checks here before falling back to the catalog index.

Today's bundle: officecli (Apache-2.0, 20KB SKILL.md + LICENSE) — bundled because the upstream awesome-agent-skills catalog was last synced 2026-02-05 and OfficeCLI was created 2026-03-15. commonly-bundled-skills/README.md documents the convention so future skills follow the same pattern. When upstream gains the skill, the local bundle can be deleted.

Why this matters

Before this PR, even with the docs and infrastructure shipped, agents would still have no DOCX/XLSX/PPTX capability — officecli wouldn't be in any catalog and the preset declarations would be inert. After this PR (+ openclaw#2 + the workflow build-arg flip), the full loop works end-to-end:

  1. Deploy Dev rebuilds gateway with toolchain
  2. Reprovision-all imports preset defaultSkills into PodAssets, syncs SKILL.md to PVC
  3. Theo/Nova/Pixel/Ops each have officecli + pandic-office + ... in their workspace
  4. Agent calls commonly_attach_file({podId, filePath: 'deck.pptx', message: 'Stakeholder deck.'})
  5. Pill renders with preview in chat

Workflow change — separate sibling PR

Companion one-liner change to .github/workflows/deploy-dev.yml adds --build-arg OPENCLAW_INSTALL_DOC_TOOLCHAIN=1. Needs separate auth (workflow scope). Trivial to apply:

   docker build _external/clawdbot \
     --build-arg OPENCLAW_EXTENSIONS=acpx \
     --build-arg OPENCLAW_INSTALL_GH_CLI=1 \
+    --build-arg OPENCLAW_INSTALL_DOC_TOOLCHAIN=1 \
     -t "$REPO:$TAG"

Without that flag the toolchain isn't installed and officecli / pandoc won't be on the gateway image. The submodule bump + presets + auto-import are all still useful — commonly_attach_file (the kernel verb) works regardless. Agents just won't have the binaries to produce files until the workflow flag flips.

Verification path

After merge + Deploy Dev + reprovision-all on dev:

  • kubectl exec -n commonly-dev deployment/clawdbot-gateway -- officecli --version1.0.70
  • kubectl exec -n commonly-dev deployment/clawdbot-gateway -- ls /workspace/theo/skills/ → shows officecli pandic-office pdf markdown-converter github
  • Hand-test: agent drops a fixture PDF in workspace, calls commonly_attach_file, file appears in chat with preview pill
  • Hand-test: path-traversal attempt rejected
  • Hand-test: Theo produces a 1-page PDF brief and attaches it (full skill loop)
  • Hand-test: Theo creates a PPTX deck via officecli and attaches it (DOCX/XLSX/PPTX capability)

Companion

🤖 Generated with Claude Code

samxu01 and others added 4 commits May 3, 2026 20:17
Wires up the gateway-side and preset-side of ADR-013 so dev agents can
produce DOCX/XLSX/PPTX/PDF deliverables and attach them to chat via
commonly_attach_file (the new extension tool in
Team-Commonly/openclaw#2).

Two coordinated changes (workflow build-arg flip is a sibling PR — see
end of this description for why it's separate):

1. **Submodule bump** — _external/clawdbot moves to the
   feat/commonly-attach-file branch which adds:
     - commonly_attach_file extension tool (uploads via runtime endpoint,
       posts [[upload:...]] directive)
     - uploadFile() client method (multipart POST to
       /api/agents/runtime/pods/:podId/uploads)
     - toRelativeWorkspacePath exported from plugin-sdk for path-traversal
       protection
     - OPENCLAW_INSTALL_DOC_TOOLCHAIN build arg in the Dockerfile (~170MB
       opt-in toolchain: pinned OfficeCLI binary + pandoc + texlive +
       markitdown + pypdf, with build-time self-test)

2. **defaultSkills bundles** for the four production dev presets
   (dev-pm/Theo, backend-engineer/Nova, frontend-engineer/Pixel,
   devops-engineer/Ops). Each gets:
     - github (PR/repo operations) — already in image via gh CLI
     - officecli (DOCX/XLSX/PPTX) — new in image when toolchain enabled
     - pandic-office (md → PDF via pandoc) — new in image
     - markdown-converter (markitdown — read attached binary docs) — new
     - pdf (extract/merge/split) — already-catalog skill
   Plus tmux for the three engineers (long-running coding sessions).

These four presets previously shipped with `defaultSkills: []` despite
the install pipeline being fully wired — a quiet correctness bug that
ADR-013 (#287) flagged. After reprovision-all on dev, each agent will
have these skills synced to /workspace/<accountId>/skills/.

**Depends on Team-Commonly/openclaw#2** — the submodule pointer here
references the feature branch SHA. After #2 merges, this pointer should
be force-updated to the merged main SHA before this commonly PR lands.

**Workflow change separate.** The companion change to
.github/workflows/deploy-dev.yml (adding `--build-arg
OPENCLAW_INSTALL_DOC_TOOLCHAIN=1`) is a separate one-line PR because the
current OAuth auth lacks `workflow` scope. The diff is trivial and
included here for reference; will be applied via a separate auth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…cally

Closes the gap surfaced in PR #294 review: defaultSkills was metadata-only
(consumed by the install-UI readiness display), but provision/reprovision
never imported the actual skills into PodAssets. So the four dev presets
declared bundles that no agent ever saw.

This commit makes defaultSkills load-bearing by reusing the existing
skill-import pipeline — no new install plumbing.

Two coordinated changes:

1. **backend/services/presetSkillsAutoImport.ts** — new helper that
   resolves each defaultSkills entry to SKILL.md content and upserts it
   as a PodAsset. Resolution order:
     a. Local bundle: commonly-bundled-skills/<id>/SKILL.md
     b. Catalog index: docs/skills/awesome-agent-skills-index.json
        sourceUrl → fetched via existing fetchSkillContentFromSource
     c. Skip with warning if neither resolves.
   Calls PodAssetService.upsertImportedSkillAsset (reused from the manual
   /api/skills/import route). Idempotent across reprovisions — same
   skillKey upserts the asset.

2. **provision.ts + reprovision.ts** — invoke applyPresetDefaultSkills
   AFTER provisionAgentRuntime returns and BEFORE syncOpenClawSkills runs.
   Sequence: provision config → upsert PodAssets from preset.defaultSkills
   → syncOpenClawSkills queries those PodAssets → writes SKILL.md to PVC.
   Pure reuse: no new sync plumbing, no new schema, no new routes.

Plus the local bundle for officecli (Apache-2.0, 20KB SKILL.md +
LICENSE) at commonly-bundled-skills/officecli/. Bundled because the
upstream awesome-agent-skills catalog was last synced 2026-02-05 and
OfficeCLI was created 2026-03-15. README.md documents the bundling
convention so future skills follow the same pattern.

After merge + Deploy Dev + reprovision-all:
- Theo/Nova/Pixel/Ops each get github + officecli + pandic-office +
  markdown-converter + pdf synced to /workspace/<accountId>/skills/
- The DOCX/XLSX/PPTX capability ships TODAY (officecli locally bundled)
- No follow-up Phase 2 needed for officecli — it's already here

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
openclaw#2 (commonly_attach_file extension tool + path-policy plugin-sdk
export + Dockerfile doc-toolchain build-arg) merged. Bumps the submodule
pointer from 11878b43c (pre-merge feature-branch base) to 4bf74dfc5 (the
merge commit on rebase-2026.3.29) so commonly-side picks up the merged
state instead of the unmerged feature branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…teway

Pairs with openclaw#2 (now merged on rebase-2026.3.29 via 4bf74dfc5).
Without this flag the gateway image still builds but skips OfficeCLI/
pandoc/texlive/markitdown/pypdf — agents would have commonly_attach_file
(the kernel verb) but no binaries to produce DOCX/XLSX/PPTX/PDF with.

Adds ~170 MB to the gateway image. Build-time self-test runs
\`officecli --version\` + \`pandoc --version\` + \`python3 -c "import
markitdown, pypdf"\` so a regression (lost binary, broken pip) fails
the build rather than surfacing as 'command not found' at agent runtime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
samxu01 added a commit that referenced this pull request May 4, 2026
…294)

Closes Phase 0b of ADR-013 by wiring up the kernel verb, toolchain, dev
preset bundles, auto-import, and a locally-bundled OfficeCLI skill so
the four production dev agents (Theo/Nova/Pixel/Ops) can produce real
deliverables and attach them to chat after a single reprovision-all.

What ships in one merge:

1. **Submodule bump** _external/clawdbot → 4bf74dfc5 on rebase-2026.3.29
   (openclaw#2 merge commit). Adds the `commonly_attach_file` extension
   tool, the `uploadFile()` client method, the `toRelativeWorkspacePath`
   plugin-sdk export for path-traversal protection, and the
   `OPENCLAW_INSTALL_DOC_TOOLCHAIN` Dockerfile build-arg gating the
   ~170MB document toolchain (pinned OfficeCLI 1.0.70 + pandoc +
   texlive-xetex + markitdown + pypdf, with build-time self-test).

2. **deploy-dev.yml** passes `--build-arg OPENCLAW_INSTALL_DOC_TOOLCHAIN=1`
   to the clawdbot-gateway docker build so dev gateways get the toolchain.

3. **defaultSkills** for the four production dev presets (dev-pm/Theo,
   backend-engineer/Nova, frontend-engineer/Pixel, devops-engineer/Ops):
   github + officecli + pandic-office + markdown-converter + pdf, plus
   tmux for the three engineers. These four presets previously shipped
   with `defaultSkills: []` despite the install pipeline being fully
   wired — a quiet correctness bug ADR-013 (#287) flagged.

4. **backend/services/presetSkillsAutoImport.ts** (~210 lines, new) —
   resolves each defaultSkills entry to SKILL.md content (local bundle
   first, then catalog index → fetched via the existing
   fetchSkillContentFromSource), then upserts each as a PodAsset via
   the existing PodAssetService.upsertImportedSkillAsset. Idempotent
   across reprovisions. Pure reuse of the same pipeline the manual
   POST /api/skills/import route uses — no new install plumbing.

5. **provision.ts + reprovision.ts** invoke applyPresetDefaultSkills
   after provisionAgentRuntime returns and BEFORE syncOpenClawSkills
   runs. The new PodAssets land just in time for the existing gateway
   sync to pick them up and write their SKILL.md files to
   /workspace/<accountId>/skills/<id>/ on the gateway PVC.

6. **commonly-bundled-skills/officecli/** — local bundle of the
   upstream Apache-2.0 SKILL.md + LICENSE. Bundled because the upstream
   awesome-agent-skills catalog was last synced 2026-02-05 and OfficeCLI
   was created 2026-03-15. README.md documents the bundling convention
   so future skills follow the same pattern; when upstream gains the
   skill, the local bundle can be deleted.

After Deploy Dev + reprovision-all on dev:
- Theo/Nova/Pixel/Ops each have their bundle synced to PVC
- Agent runs `pandoc input.md -o report.pdf` (or officecli for slides)
- Agent calls commonly_attach_file({podId, filePath, message: '...'})
- Pill renders with preview in chat

Companion: ADR-013 (#287) merged. Phase 0a findings (#291) still open.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant