xonecas.io
64875
Mc

mini-coder / commit 0251d49

chore: docs pass

xonecas2026-06-15 0251d49514c9fea1350e40dba08ecc0e2cdb7367 parent fbf2fa8

3 files changed

AGENTS.md+13−0
@@ -24,6 +24,19 @@ Plain text readme file: https://raw.githubusercontent.com/badlogic/pi-mono/refs/
2424 - Typescript files should be modules with exports over classes.
2525 - Hoist variables, define helpers before using them, ensure code reads well for humans.
2626
27+## Coding style
28+
29+- Prefer small named functions and plain exported objects over classes or heavy abstractions.
30+- Keep imports grouped as node built-ins, external packages, then local modules. Use `type` imports for types.
31+- Use 2-space indentation, semicolons, double quotes, and trailing commas in multiline literals/calls.
32+- Name values with `camelCase`, types/schemas/TUI components with `PascalCase`, and fixed defaults with `SCREAMING_SNAKE_CASE`.
33+- Model state and events with explicit TypeScript types, discriminated unions, and TypeBox schemas for persisted or parsed data.
34+- Use early returns and guard clauses for validation, missing files, aborts, and fallback cases.
35+- Prefer Bun APIs (`Bun.file`, `Bun.write`, `Bun.spawn`, `Bun.Glob`) for runtime, file, and process work.
36+- Keep async flows readable with `async` functions/generators, `for await`, and explicit `AbortSignal` handling before writes or long work.
37+- In tool runners, report recoverable failures as tool result text instead of throwing; reserve thrown `Error`s for caller-facing validation failures.
38+- Comments should explain why something exists or document non-obvious behavior; use `TODO:` for known follow-up work.
39+
2740 ## Benchmarks
2841
2942 - Please see `BENCHMARK.md` for Terminal Bench benchmark info, and how to run it.
TODO.md+0−29
@@ -4,34 +4,5 @@
44
55 ## TODO
66
7-- [ ] Session fork/undo — either tree-view forking (like pi coding agent) or undo flow, or both. Complex feature, needs UI and storage design.
87 - [ ] Path autocomplete in TUI — `Tab` on file paths opens path picker.
98 - [ ] Status bar richness — detailed git counts (staged/modified/untracked/ahead/behind).
10-
11-## TODO: Better prompts, tools descriptions and reminder prompt engineering.
12-
13-Raw notes, references:
14-
15-### JetBrains Junie: Observation Masking
16-
17-Published research found that **simply hiding old tool outputs** matched the quality of full LLM summarization with **zero extra compute**:
18-
19-> good lessons from claude and general advice, seems good and grounded on real experience. Matches with learnings.
20-> https://www.indiehackers.com/post/the-complete-guide-to-writing-agent-system-prompts-lessons-from-reverse-engineering-claude-code-6e18d54294
21-
22-> How pi coding agent does it, minimal and structured, a good approach, but we can be even more focused and minimal.
23-> https://raw.githubusercontent.com/badlogic/pi-mono/refs/heads/main/packages/coding-agent/src/core/system-prompt.ts
24-
25-### Prompt learnings:
26-
27-> Key sentence to add:
28-
29-```
30-Prioritize technical accuracy and truthfulness over validating the user's beliefs.
31-Focus on facts and problem-solving, providing direct, objective technical info
32-without any unnecessary superlatives, praise, or emotional validation.
33-```
34-
35-More reading material:
36-
37-- https://arxiv.org/html/2601.16507v1#S3
src/session.ts+0−2
@@ -9,7 +9,6 @@ export async function ensureSessionsDir(): Promise<void> {
99 await mkdir(SESSIONS_DIR, { recursive: true });
1010 }
1111
12-// readSession: writes the session
1312 export async function getSession(id: string): Promise<Session | undefined> {
1413 const file = Bun.file(join(SESSIONS_DIR, `${id}.json`));
1514
@@ -65,7 +64,6 @@ export async function saveSession(s: Session) {
6564 await Bun.write(file, JSON.stringify(s));
6665 }
6766
68-// updateSession: finds and appends to the existing setting file
6967 export async function updateSession(id: string, messages: Message[]) {
7068 const existing = await getSession(id);
7169 if (existing) {