docs(workflow): require upstream repo + branch/update hygiene
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,6 +15,7 @@ memory/
|
||||
.clawhub/
|
||||
bin/
|
||||
patches/
|
||||
external/
|
||||
|
||||
# Logs and local runtime artifacts
|
||||
logs/
|
||||
|
||||
27
AGENTS.md
27
AGENTS.md
@@ -125,6 +125,33 @@ Reactions are lightweight social signals. Humans use them constantly — they sa
|
||||
|
||||
Skills provide your tools. When you need one, check its `SKILL.md`. Keep local notes (camera names, SSH details, voice preferences) in `TOOLS.md`.
|
||||
|
||||
## Git Workflow
|
||||
|
||||
- Commit frequently in small, meaningful checkpoints.
|
||||
- Use Conventional Commits format: `type(scope): summary`.
|
||||
- Create a feature branch when work is non-trivial, multi-step, or risky.
|
||||
- Keep `main` stable; merge focused changes back after verification.
|
||||
- Before commit, quickly check staged diff and avoid committing secrets/runtime noise.
|
||||
|
||||
### OpenClaw upstream workflow (required for core code changes)
|
||||
|
||||
- Treat `external/openclaw-upstream/` as the source repo for OpenClaw codebase work.
|
||||
- Do **not** rely on editing installed dist files under `~/.npm-global/.../dist` as the long-term fix path.
|
||||
- For OpenClaw code changes:
|
||||
1. `cd external/openclaw-upstream`
|
||||
2. `git fetch --all --prune && git checkout main && git pull --ff-only`
|
||||
3. Create a focused branch (`fix/...`, `feat/...`, `chore/...`)
|
||||
4. Implement in `src/` and add/adjust tests
|
||||
5. Run relevant tests before commit
|
||||
6. Commit, push branch, and open PR
|
||||
- If an emergency local dist hotfix is unavoidable, also:
|
||||
- capture an idempotent patch script in `scripts/`
|
||||
- document rollback/update behavior
|
||||
- follow up with an upstream PR ASAP
|
||||
- Keep local OpenClaw runtime current:
|
||||
- check status with `openclaw update status`
|
||||
- prefer `scripts/openclaw-update-safe.sh` for updates when local compatibility patches exist
|
||||
|
||||
**🎭 Voice Storytelling:** If you have `sag` (ElevenLabs TTS), use voice for stories, movie summaries, and "storytime" moments! Way more engaging than walls of text. Surprise people with funny voices.
|
||||
|
||||
**📝 Platform Formatting:**
|
||||
|
||||
53
scripts/openclaw-upstream-workflow.md
Normal file
53
scripts/openclaw-upstream-workflow.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# OpenClaw Upstream Workflow
|
||||
|
||||
Use this whenever modifying OpenClaw itself.
|
||||
|
||||
## Source of truth
|
||||
|
||||
- Upstream working clone: `external/openclaw-upstream/`
|
||||
- Install path (`~/.npm-global/lib/node_modules/openclaw/dist`) is runtime output, not long-term source.
|
||||
|
||||
## Standard flow
|
||||
|
||||
```bash
|
||||
cd external/openclaw-upstream
|
||||
git fetch --all --prune
|
||||
git checkout main
|
||||
git pull --ff-only
|
||||
git checkout -b fix/<short-topic>
|
||||
```
|
||||
|
||||
Then:
|
||||
1. Implement in `src/` (and docs/tests as needed).
|
||||
2. Run targeted tests first; run broader suite if change touches shared paths.
|
||||
3. Commit with Conventional Commit format.
|
||||
4. Push branch and open PR.
|
||||
|
||||
## Branch naming
|
||||
|
||||
- `fix/...` for bugfixes
|
||||
- `feat/...` for new behavior
|
||||
- `chore/...` for maintenance
|
||||
- keep names short and specific (`fix/tui-hide-internal-runtime-context`)
|
||||
|
||||
## Update hygiene
|
||||
|
||||
- Check runtime version: `openclaw update status`
|
||||
- If local compatibility patch exists, update with:
|
||||
|
||||
```bash
|
||||
scripts/openclaw-update-safe.sh
|
||||
```
|
||||
|
||||
- After runtime update, re-sync upstream clone before new changes:
|
||||
|
||||
```bash
|
||||
cd external/openclaw-upstream && git fetch --all --prune && git checkout main && git pull --ff-only
|
||||
```
|
||||
|
||||
## Emergency dist hotfix policy
|
||||
|
||||
If a dist-file hotfix is unavoidable:
|
||||
- keep it scripted (`scripts/...`), idempotent, and reversible
|
||||
- document it (`patches/.../README.md`)
|
||||
- land the proper upstream source fix and PR as soon as possible
|
||||
Reference in New Issue
Block a user