This commit is contained in:
wassname
2026-01-29 20:20:14 +08:00
parent bf8b38346d
commit eeefc69f5a
3 changed files with 53 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
{
"permissions": {
"allow": [
"Bash(chmod:*)",
"Bash(curl:*)",
"Bash(sh)",
"Bash(./render_diagram.sh:*)",
"Bash(typst:*)",
"WebFetch(domain:cetz-package.github.io)",
"Bash(tree:*)"
]
}
}
+4
View File
@@ -0,0 +1,4 @@
*.png
diagrams/
!diagrams/examples/
!diagrams/TEMPLATE.typ
+36
View File
@@ -0,0 +1,36 @@
# draw_diag
CeTZ/Typst diagrams with Claude Code iteration loop.
## Setup
```bash
sudo snap install typst
```
## Usage
```bash
./render_diagram.sh diagrams/example/my_diagram.typ
```
## Claude Code iteration workflow
1. Read source code, create `.typ` file with source docs in comments
2. Render: `./render_diagram.sh diagram.typ`
3. **Use a sub-agent to review the PNG** (critical - avoids confirmation bias):
```
Task tool, subagent_type: general-purpose
"Look at this PNG and explain what concept it conveys. No context - just describe what you see. Maybe give constructive criticism and describe any issues you have with the task"
```
4. Fix issues based on sub-agent feedback
1. Each time make a new file: `diagram_v2.typ`, `diagram_v3.typ`, etc. So we can visualize the changes over time.
5. Repeat until sub-agent correctly understands the diagram without hints
## References
- [CeTZ docs](https://cetz-package.github.io/docs/)
- [CeTZ gallery](https://github.com/typst/packages/tree/main/packages/preview/cetz/0.4.2/gallery)
![example of usage](img/README-1769681321214-image.png)