Skip to content

Commit f5df07b

Browse files
committed
first commit
0 parents  commit f5df07b

240 files changed

Lines changed: 44399 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: clawbox-chat-stream
3+
description: Use when changing or debugging ClawBox chat sending, SSE streaming, reasoning blocks, tool-call blocks, session synchronization, or title generation across the React frontend and the Bun OpenClaw bridge.
4+
---
5+
6+
# ClawBox Chat Stream
7+
8+
Use this skill when the task involves ClawBox chat flow, assistant streaming, tool event rendering, session history hydration, or title generation.
9+
10+
## Read first
11+
12+
- `src/hooks/useChat.ts`
13+
- `src/services/ai.ts`
14+
- `src/store/chat.ts`
15+
- `src/components/chat/`
16+
- `internal/routes/chat.ts`
17+
- `internal/providers/openclaw-rpc.ts`
18+
- `src/services/api.ts`
19+
20+
## Workflow
21+
22+
1. Map the end-to-end path: UI event -> frontend store/hook -> SSE parser -> backend route -> OpenClaw RPC event.
23+
2. If request or response payloads change, update every consumer in the same task instead of leaving cross-layer drift.
24+
3. For tool-call regressions, verify both streamed events and history rehydration. ClawBox uses live events plus follow-up history reconciliation.
25+
4. For title or unread-count issues, inspect the `finally` path in `src/hooks/useChat.ts` and the corresponding Zustand store updates.
26+
27+
## Verification
28+
29+
- Run `npm run build:frontend`.
30+
- Run `npm run build:backend`.
31+
- If the local gateway is available, use `bun test/openclaw-stream.ts --prompt "..."` as a manual smoke test.
32+
33+
## Guardrails
34+
35+
- Never guess OpenClaw protocol fields or event names.
36+
- Preserve the SSE event types expected by `src/services/ai.ts`.
37+
- Keep message block ordering consistent with the `text`, `reasoning`, and `tool_call` model.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: clawbox-git-commit-push
3+
description: Use when the user asks to stage ClawBox changes, write a git commit, create a non-interactive commit, or push the current branch safely without mixing unrelated worktree changes.
4+
---
5+
6+
# ClawBox Git Commit Push
7+
8+
Use this skill when the task is to prepare a clean git commit and push it from the current ClawBox repository.
9+
10+
## Read first
11+
12+
- `git status --short --branch`
13+
- `git diff --stat`
14+
- `git diff --cached --stat`
15+
- Targeted `git diff -- <paths>` for files intended for the commit
16+
17+
## Workflow
18+
19+
1. Inspect repo state before staging anything.
20+
2. Confirm the requested commit scope from actual modified files, not assumptions.
21+
3. Stage only intended paths with `git add <paths>`.
22+
4. Create the commit with `git commit -m "..."`.
23+
5. Check upstream with `git rev-parse --abbrev-ref --symbolic-full-name @{u}`.
24+
6. Use `git push` when upstream exists, or `git push -u origin <branch>` when the target is obvious.
25+
7. Report the commit hash, branch, and push result.
26+
27+
## Guardrails
28+
29+
- Never use destructive commands such as `git reset --hard`, `git checkout --`, rebase, or force-push unless the user explicitly asks.
30+
- Never stage unrelated or generated files silently.
31+
- Never amend a commit unless explicitly requested.
32+
- Prefer non-interactive git commands only.
33+
- Stop and ask when branch target, commit scope, or staged changes are ambiguous.
34+
35+
## Verification
36+
37+
- Run `git status --short --branch` before and after the commit.
38+
- Run `git log --oneline -1` after the commit.
39+
- If pushed, verify the branch is no longer ahead with `git status --short --branch`.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: clawbox-release-packaging
3+
description: Use when changing ClawBox Tauri packaging, sidecar bootstrapping, version synchronization, Bun backend compilation, or release-related scripts and configuration. This includes the UTC date-based version generator, Tauri and Cargo version sync, Windows installer signing helpers, and GitHub release workflow guards. Do not use for actually cutting and pushing a release tag; use the release publish skill for that.
4+
---
5+
6+
# ClawBox Release Packaging
7+
8+
Use this skill when the task involves ClawBox versioning, Tauri configuration, backend binary packaging, sidecar lifecycle, or release build scripts.
9+
10+
## Read first
11+
12+
- `package.json`
13+
- `docs/releasing.md`
14+
- `.github/release-notes-template.md`
15+
- `docs/releases/`
16+
- `scripts/collect-release-assets.mjs`
17+
- `scripts/release-version.mjs`
18+
- `scripts/sync-version.mjs`
19+
- `scripts/sign-win-installer.mjs`
20+
- `scripts/build-backend.mjs`
21+
- `.github/workflows/release.yml`
22+
- `src-tauri/tauri.conf.json`
23+
- `src-tauri/Cargo.toml`
24+
- `src-tauri/src/lib.rs`
25+
- `internal/onboard/` if the task also affects runtime bootstrap or environment setup
26+
27+
## Workflow
28+
29+
1. Identify which layer is changing: UTC version generation, version synchronization, Bun backend compile output, Tauri shell, release workflow guard, release-notes lookup, release-asset filtering, or installer/signing script.
30+
2. Preserve `package.json` as the single source of truth for the app version. Any version automation must keep `package-lock.json`, `src-tauri/tauri.conf.json`, and `src-tauri/Cargo.toml` aligned.
31+
3. Keep the UTC date-based version format semver-safe. The current release flow uses `YYYY.M.D-N`, with `git fetch --tags` plus local `vYYYY.M.D-N` tags determining the next sequence.
32+
4. Keep sidecar naming and resource lookup behavior aligned with `scripts/build-backend.mjs` and `src-tauri/src/lib.rs`.
33+
5. Keep Windows installer signing dynamic. `tauri:build-win:sign-installer` should resolve `ClawBox_<version>_x64-setup.exe` from `package.json`, not from a hard-coded filename.
34+
6. Keep release publication scoped to user-facing assets only. The workflow should publish final `.dmg`, `.exe`, and the combined `CHECKSUMS.txt`, not the entire Tauri bundle tree.
35+
7. Keep release notes lookup aligned with the documented flow. Hand-written notes live at `docs/releases/<tag>.md`, with GitHub-generated notes as the fallback when the file is absent.
36+
8. If the change touches release publication behavior rather than packaging/configuration, hand off to `clawbox-release-publish` instead of extending this skill.
37+
9. If the change touches Windows signing or platform-specific installers, note any credentials or OS environments you could not validate.
38+
39+
## Verification
40+
41+
- Run `node scripts/release-version.mjs --dry-run` or `npm run release:version -- --dry-run` when changing release-version logic.
42+
- Run `npm run sync-version`.
43+
- Run `npm run build:backend`.
44+
- If Rust is available, run `cargo check --manifest-path src-tauri/Cargo.toml`.
45+
- If the change touches the release workflow, confirm that the workflow still rejects a tag/version mismatch, still publishes only final user assets, and still prefers `docs/releases/<tag>.md` over auto-generated notes when that file exists.
46+
47+
## Guardrails
48+
49+
- Do not guess bundle resource paths or binary names.
50+
- Do not hand-edit version values when changing the automated version flow; keep `npm version ... --no-git-tag-version` as the writer for `package.json` and `package-lock.json`.
51+
- Do not reintroduce a hard-coded Windows installer filename into `package.json` scripts.
52+
- Do not blur the boundary between "release packaging/config" and "actual release execution"; use `clawbox-release-publish` when the task is to cut, commit, tag, or push a release.
53+
- Keep cross-platform branches explicit instead of merging them into a single simplified path.
54+
- Mention any skipped platform validation in the final response.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
name: clawbox-release-publish
3+
description: Use when the user asks to prepare, cut, validate, tag, or publish a ClawBox desktop release. Covers the UTC date-based version flow (`npm run release:version`), release validation commands, release commit/tag creation, and pushing the matching `v` tag for the current package version that triggers GitHub Releases. Do not use for changing packaging or versioning logic itself; use the packaging skill for that.
4+
---
5+
6+
# ClawBox Release Publish
7+
8+
Use this skill to run the current ClawBox release process end to end.
9+
10+
## Read first
11+
12+
- `docs/releasing.md`
13+
- `.github/release-notes-template.md`
14+
- `docs/releases/`
15+
- `package.json`
16+
- `scripts/release-version.mjs`
17+
- `scripts/sync-version.mjs`
18+
- `.github/workflows/release.yml`
19+
- `git status --short --branch`
20+
21+
If the user also asks to create the commit or push the branch/tag, read `.agents/skills/clawbox-git-commit-push/SKILL.md`.
22+
23+
## Workflow
24+
25+
1. Inspect the worktree before starting. Stop if unrelated dirty changes would be mixed into the release.
26+
2. Fetch tags with `git fetch --tags` before generating a version. The UTC day sequence is based on local tags.
27+
3. Run `npm run release:version`. This updates `package.json`, `package-lock.json`, `src-tauri/tauri.conf.json`, and `src-tauri/Cargo.toml`.
28+
4. Read back the selected version with `node -p "require('./package.json').version"` and use that exact value for the release commit and tag.
29+
5. If the user wants curated release notes, copy `.github/release-notes-template.md` to `docs/releases/v<version>.md` and fill it in before the release commit. If that file is missing, GitHub falls back to auto-generated notes.
30+
6. Run the standard release validation set unless the user explicitly scopes it down:
31+
- `npm run scan:repo`
32+
- `npm run audit:licenses`
33+
- `npm run audit:deps`
34+
- `npm run build:frontend`
35+
- `npm run build:backend`
36+
- `cargo check --manifest-path src-tauri/Cargo.toml`
37+
7. If the user wants the release prepared but not published, stop after reporting the version, changed files, release notes status, and validation status.
38+
8. If the user wants the release published, create a focused commit for the release files, create tag `v<version>`, push the branch, then push the tag.
39+
40+
## Expected commands
41+
42+
Prepare the next release version:
43+
44+
```bash
45+
git fetch --tags
46+
npm run release:version
47+
```
48+
49+
Validate the release:
50+
51+
```bash
52+
npm run scan:repo
53+
npm run audit:licenses
54+
npm run audit:deps
55+
npm run build:frontend
56+
npm run build:backend
57+
cargo check --manifest-path src-tauri/Cargo.toml
58+
```
59+
60+
Publish after validation:
61+
62+
```bash
63+
VERSION=$(node -p "require('./package.json').version")
64+
cp .github/release-notes-template.md "docs/releases/v${VERSION}.md"
65+
66+
git add package.json package-lock.json src-tauri/tauri.conf.json src-tauri/Cargo.toml docs/releases/v${VERSION}.md
67+
git commit -m "release: v$VERSION"
68+
git tag "v$VERSION"
69+
git push origin HEAD
70+
git push origin "v$VERSION"
71+
```
72+
73+
## Guardrails
74+
75+
- Do not hand-edit the version fields when the goal is to cut a release. Use `npm run release:version`.
76+
- Do not create or push a tag that differs from `v<package.json version>`. The release workflow rejects mismatches.
77+
- Do not silently skip `git fetch --tags`; without it, the same UTC day can generate the wrong `-N`.
78+
- Do not stage unrelated files, generated artifacts, or user work that is outside the release scope.
79+
- Do not assume release notes are mandatory; if `docs/releases/<tag>.md` is absent, the workflow falls back to GitHub-generated notes.
80+
- Do not claim Windows signing was performed unless `WIN_SIGN_THUMBPRINT` or equivalent signing prerequisites were actually available.
81+
- If validation is incomplete, say exactly which commands were skipped or failed.
82+
83+
## Verification
84+
85+
- Confirm `package.json`, `package-lock.json`, `src-tauri/tauri.conf.json`, and `src-tauri/Cargo.toml` all reflect the same version after `npm run release:version`.
86+
- Run `npm run sync-version` after version generation only when you need to verify the sync chain; it should not create additional diffs.
87+
- After commit/tag creation, report the version, commit hash, branch, and pushed tag.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "ClawBox Release"
3+
short_description: "Run ClawBox UTC date-based release flow"
4+
default_prompt: "Use $clawbox-release-publish to prepare or execute the next ClawBox release."
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: clawbox-ui-i18n
3+
description: Use when changing ClawBox React components, dialogs, settings pages, sidebar flows, or any user-facing copy that must stay aligned with react-i18next and the project's bilingual locale files.
4+
---
5+
6+
# ClawBox UI i18n
7+
8+
Use this skill for ClawBox frontend UI work, copy changes, settings screens, onboarding screens, dialogs, and general React component changes.
9+
10+
## Read first
11+
12+
- The target component under `src/components/`
13+
- Any matching Zustand store under `src/store/`
14+
- `src/services/api.ts` if the component loads or mutates backend data
15+
- `src/locales/en/translation.json`
16+
- `src/locales/zh/translation.json`
17+
18+
## Workflow
19+
20+
1. Add or update translation keys before wiring UI text.
21+
2. Keep translation keys nested by feature instead of flattening unrelated labels into generic buckets.
22+
3. Prefer existing store actions and selectors over adding duplicate component-local copies of remote state.
23+
4. If a component opens dialogs or renders chat blocks, inspect the sibling components in the same feature folder before changing layout or behavior.
24+
25+
## Verification
26+
27+
- Update both locale files in the same diff.
28+
- Run `npm run build:frontend`.
29+
30+
## Guardrails
31+
32+
- Do not leave hard-coded user-facing strings in JSX.
33+
- Preserve existing Radix UI and Tailwind patterns unless the task explicitly redesigns the feature.
34+
- Keep frontend API usage centralized in service modules where possible.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Bug report
3+
about: Report a reproducible ClawBox bug
4+
title: "[Bug] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Summary
10+
11+
Describe the bug clearly and briefly.
12+
13+
## Environment
14+
15+
- ClawBox version:
16+
- OpenClaw version:
17+
- OS / architecture:
18+
- Install mode: development / packaged app
19+
20+
## Steps To Reproduce
21+
22+
1.
23+
2.
24+
3.
25+
26+
## Expected Behavior
27+
28+
Describe what you expected to happen.
29+
30+
## Actual Behavior
31+
32+
Describe what actually happened.
33+
34+
## Validation
35+
36+
- [ ] `npm run build:frontend`
37+
- [ ] `npm run build:backend`
38+
- [ ] `npm run smoke:backend` if real OpenClaw was unavailable
39+
40+
## Support Boundary
41+
42+
- [ ] I believe this is a ClawBox client issue rather than a pure OpenClaw daemon/runtime issue
43+
44+
## Logs / Screenshots
45+
46+
Add relevant logs or screenshots after redacting tokens, personal paths, and private data.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Security policy
4+
url: https://github.com/CommonstackAI/clawbox/blob/main/SECURITY.md
5+
about: Please read the private reporting guidance before sharing a vulnerability.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Feature request
3+
about: Suggest an improvement for ClawBox
4+
title: "[Feature] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Problem
10+
11+
What user problem or workflow gap should this solve?
12+
13+
## Proposed Change
14+
15+
Describe the behavior you want.
16+
17+
## OpenClaw Compatibility
18+
19+
Does this require new Gateway RPCs, config fields, or protocol changes?
20+
21+
## Alternatives Considered
22+
23+
List any alternatives you considered.
24+
25+
## Additional Context
26+
27+
Add links, screenshots, or related issues if helpful.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Summary
2+
3+
- What changed?
4+
- Why was it needed?
5+
6+
## Validation
7+
8+
- [ ] `npm run build:frontend`
9+
- [ ] `npm run build:backend`
10+
- [ ] `cargo check --manifest-path src-tauri/Cargo.toml` when Tauri/package code changed
11+
- [ ] `npm run smoke:backend` when a real OpenClaw runtime was unavailable
12+
- [ ] `npm run scan:repo`
13+
- [ ] `npm run audit:deps`
14+
15+
## Compatibility Notes
16+
17+
- OpenClaw version impact:
18+
- Migration / rollout notes:
19+
20+
## Screenshots / Logs
21+
22+
Include screenshots or logs when the change affects UI or onboarding.
23+
24+
## Ownership
25+
26+
State whether the change is ClawBox-only or also requires coordinated OpenClaw updates.

0 commit comments

Comments
 (0)