Skip to content

Commit 6001222

Browse files
fitz123claude
andauthored
feat: add 4 platform rules (async-long-tasks, communication, delegation, memory-protocol) (#83)
Generic behavioral rules useful for any workspace: - async-long-tasks: never block conversation on long operations - communication: external vs internal actions, group chat etiquette, NO_REPLY, Telegram formatting - delegation: plan/implement separation, sub-agent management, decision log check - memory-protocol: storage locations, rules vs memory decision flowchart Co-authored-by: fitz123 <fitz123@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3328adb commit 6001222

4 files changed

Lines changed: 95 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)