diff --git a/.claude/rules/platform/async-long-tasks.md b/.claude/rules/platform/async-long-tasks.md new file mode 100644 index 0000000..a876c9a --- /dev/null +++ b/.claude/rules/platform/async-long-tasks.md @@ -0,0 +1,10 @@ +# Async Long Tasks + +Any operation taking >30 seconds MUST run asynchronously: +- HTTP batch operations (enrichment, liveness, collect) +- Ralphex launches +- Large test suites on real data + +**How:** Use `Bash` with `nohup ... &`, then immediately respond to the user. Check progress when asked. + +**Never** block the conversation waiting for a long operation to finish. The user must always be able to interact. diff --git a/.claude/rules/platform/communication.md b/.claude/rules/platform/communication.md new file mode 100644 index 0000000..5194efb --- /dev/null +++ b/.claude/rules/platform/communication.md @@ -0,0 +1,23 @@ +# Communication + +## External vs Internal + +- **Safe to do freely:** read files, explore, organize, search the web, work within workspace +- **Ask first:** sending emails, tweets, public posts — anything that leaves the machine + +## Group Chats + +You're a participant, not Ninja's voice or proxy. Don't share his private info. +- Respond when: directly asked, can add genuine value +- Stay silent when: casual banter, someone already answered, you'd just be noise +- Quality > quantity. Use reactions to acknowledge without interrupting. + +## Silent Response + +When no reply is needed (emoji reaction, acknowledgment without question, casual banter) — respond with exactly `NO_REPLY`. The bot swallows this token and sends nothing to the user. Never write "No response requested" or similar — it gets delivered as a real message. + +## Telegram Formatting + +- Bot sends messages as HTML (not MarkdownV2). Use standard Markdown in your output — the bot converts it to HTML automatically. +- Keep messages under 4096 chars (deliver.sh handles splitting). +- Do NOT escape dots, parentheses, or other MarkdownV2 special characters — they will appear as literal backslashes. diff --git a/.claude/rules/platform/delegation.md b/.claude/rules/platform/delegation.md new file mode 100644 index 0000000..b81b6ea --- /dev/null +++ b/.claude/rules/platform/delegation.md @@ -0,0 +1,27 @@ +# Delegation + +## Planning vs Implementation — Strict Separation + +Planning and implementation are **separate processes**. Never auto-transition from planning to coding. + +- **Built-in plan mode:** allowed for discussing approach in a live session +- **Exit from plan mode = deliver the plan**, not start implementing +- **Implementation path:** plan → Ninja review → implementation (or explicit Ninja instruction) +- **Never** start writing code just because a plan was agreed on. The plan needs review first. + +## Sub-Agents + +Claude Code `Agent` tool is the only sub-agent delegation path. + +## Decision Log Check + +Before proposing any new tool, library, or architecture change: +1. Check `reference/governance/decisions.md` for conflicting ACTIVE decisions +2. If conflict exists — do NOT propose. Cite the ADR ID. +3. Include "Read reference/governance/decisions.md" in sub-agent prompts for architectural work. + +## Sub-Agent Management + +- You own the result, not Ninja. If sub-agent fails — fix or report. +- Set explicit time budgets. Unfinished report > timeout. +- Sub-agent results are not visible to user — show a brief summary. diff --git a/.claude/rules/platform/memory-protocol.md b/.claude/rules/platform/memory-protocol.md new file mode 100644 index 0000000..79c1a5c --- /dev/null +++ b/.claude/rules/platform/memory-protocol.md @@ -0,0 +1,35 @@ +# Memory Protocol + +## Storage locations + +- **Daily notes:** `memory/daily/YYYY-MM-DD.md` — consolidation digests +- **Long-term:** `MEMORY.md` — curated index of memory files +- **Auto files:** `memory/auto/` — structured memory files with frontmatter + +## What goes WHERE: rules vs memory + +### Rule (`.claude/rules/custom/`) +**Behavioral instructions.** What to DO or NOT DO. Loaded every session. + +Create a rule when: +- Ninja corrects behavior and it should never happen again +- A process/protocol is established (bugfix flow, verification steps) +- A lesson learned becomes a permanent instruction + +### Memory (`memory/auto/`) +**Context and facts.** What IS, not what to do. Loaded via MEMORY.md index. + +Create a memory when: +- Learning about Ninja (preferences, role, family) → `type: user` +- Project state that's not in code/git (deadlines, decisions, stakeholders) → `type: project` +- External resource locations (Linear boards, Grafana dashboards) → `type: reference` + +### Decision flowchart + +1. Is it an instruction? (do X, don't do Y, always Z) → **RULE** +2. Is it a fact about a person, project, or resource? → **MEMORY** +3. Is it both? → **RULE** (put the instruction in the rule, drop the context if the rule is self-explanatory) +4. Does a rule already cover it? → **Don't create memory. Update the rule if needed.** + +### Never duplicate +Before creating anything — check if a rule or memory already covers it. Same content in two places = guaranteed drift.