gtat-tech-career-kickstarte.../.cursor/skills/rebuild-proto/SKILL.md

40 lines
1.5 KiB
Markdown

---
name: rebuild-proto
description: Rebuild generated Python protobuf files by running build_proto.sh after any modification to .proto files. Use automatically whenever the agent edits, creates, or deletes any .proto file in the solution/proto/ or x_template/proto/ directories.
---
# Rebuild Proto Files
## When to Trigger
**Automatically** run this skill whenever you modify, create, rename, or delete any `.proto` file under:
- `solution/proto/`
- `x_template/proto/`
This includes changes made via `Write`, `StrReplace`, or `Delete` tools on any `*.proto` file.
## How to Rebuild
Each top-level directory (`solution/` and `x_template/`) has its own `build_proto.sh`. Run the script **from the directory that contains the modified proto file**.
After editing a proto file in `solution/proto/`:
```bash
cd solution && bash build_proto.sh
```
After editing a proto file in `x_template/proto/`:
```bash
cd x_template && bash build_proto.sh
```
If you modified proto files in **both** directories, run both commands.
## Important Notes
- Always run the rebuild **after all proto edits in a batch are complete**, not after each individual file edit. This avoids redundant rebuilds.
- The script generates Python files into `src/proto/` (relative to the directory) and fixes imports to use relative style.
- If `protoc` fails, check that all `.proto` imports resolve correctly and that no syntax errors were introduced.
- Do **not** edit the generated `*_pb2.py` or `*_pb2.pyi` files directly — they will be overwritten on the next rebuild.