nanobot: 2026-09-11 09:44:11
This commit is contained in:
@@ -89,14 +89,20 @@ dropping it.
|
||||
|
||||
## Writing to memory.md
|
||||
|
||||
**Only ever through the script** — never `edit_file` or `write_file`. Pass the
|
||||
text on stdin with a quoted heredoc so quotes and apostrophes survive verbatim:
|
||||
**Only ever through the script** — never `edit_file` or `write_file` on
|
||||
`memory.md` itself. Two steps: write the entry text to a scratch file, then hand
|
||||
the script its path.
|
||||
|
||||
```
|
||||
uv run skills/project/scripts/project_cli.py log <slug> <<'NOTE'
|
||||
<entry text>
|
||||
NOTE
|
||||
```
|
||||
1. `write_file` the entry text to `tmp/project-entry.md`
|
||||
2. `uv run skills/project/scripts/project_cli.py log <slug> --file tmp/project-entry.md`
|
||||
|
||||
**Never put the entry text into the command line** — not as an argument, not in a
|
||||
heredoc, not through a pipe. The exec safety guard scans the raw command string
|
||||
and misreads ordinary prose as a filesystem path: a colon right after a letter
|
||||
that follows a diacritic parses as a Windows drive, so Czech words like `Cíl:`,
|
||||
`Závěr:` or `směr:` block the whole command with *path outside working dir*. The
|
||||
guard has no shell parser, so quoting and heredocs do not help. A file path in
|
||||
the command is unaffected.
|
||||
|
||||
The script prepends today's date and guarantees the entry starts on its own
|
||||
line. Write the entry in the user's language, reformulated, not verbatim.
|
||||
@@ -168,5 +174,8 @@ prints each project with its file sizes; `(!)` marks an empty `state.md`.
|
||||
write project files in the user's language too.
|
||||
- Never fabricate project content — `prompt.md`, `memory.md`, and `state.md`
|
||||
only grow from what the user actually said or what actually happened.
|
||||
- Never write test or throwaway entries to a real project's `memory.md` — it is
|
||||
append-only, so taking them back out means rewriting history. If you genuinely
|
||||
need to try something, run `new <scratch-slug>` and use that.
|
||||
- Never create a new project without the user's explicit confirmation.
|
||||
- Don't force a project context onto an unrelated request.
|
||||
|
||||
Reference in New Issue
Block a user