Cohub work publish
Build and publish a Cohub Work from a Vite/React app directory (usually Work Kit). Use when publishing or updating a Work with --dir dist, setting work/viewer scopes, or refreshing a work-kit based product URL.From its SKILL.md
npx -y skills add markbang/cohub-work-skill --skill cohub-work-publishAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 27 days oldThe repository was created 27 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.4 KB, 581 tokens by cl100k_base, as published. Nobody here has run it
Cohub Work Publish
Publish a static Cohub Work from a built app directory.
Install this skill
npx skills add https://github.com/markbang/cohub-work-skill \
--skill "cohub-work-publish" \
--agent codex \
--yes \
--copy
When to use
- User asks to publish / update a Work
- A Work Kit product is ready for
dist/snapshot publish - Need a public URL after build
Inputs
Resolve:
space_id(default$COHUB_SPACE_ID)- app directory containing
package.json+vite.config.ts - Work
slug(stable; keep existing if updating) - scopes actually required by the product
Preconditions
- App builds with relative base:
// vite.config.ts
base: "./"
- Router is hash-based for static directory Works.
- Owner username + space slug exist (public Work identity).
Build
cd <app-dir>
pnpm install
pnpm build
Confirm:
test -f dist/index.html
Publish
From the Space workspace root (paths are Space-relative):
cohub -s "$space_id" works publish "$slug" \
--dir <space-relative-path-to-dist> \
--work-scope file.view \
--json
Add scopes only as needed:
--work-scope space.view
--work-scope session.view
--viewer-scope session.prompt.readonly
--viewer-scope session.prompt.fullaccess
Notes:
--dirmust be a path inside the Space file tree- Re-publishing the same slug updates the Work version
Fetch public URL
cohub -s "$space_id" works ls --json
cohub works get <workId> --json
Return publicUrl (fallback content.url).
Smoke check
- Open
publicUrl - Runtime should become ready inside Cohub shell
- Relative JS/CSS load (no absolute
/assets404) - Optional: one read query + one authorized action if those scopes were published
Failure hints
| Symptom | Check |
|---|---|
| invalid path / not found | Space-relative --dir, files actually uploaded |
| assets 404 | base: "./" missing |
| context null | opened raw asset URL instead of Cohub Work page |
| 403 on files/sessions | missing workScopes |
| auth dialog never useful | missing allowedViewerScopes |
Done criteria
- build ok
- publish ok
publicUrlreturned to user- scopes listed explicitly
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.