Skip to content

Commit 3beb8e5

Browse files
Lykhoydaclaude
andauthored
feat!: replace Experience Engine with repo-local troubleshooting memory (closes #200) (#203)
* refactor: relocate redact.ts to util/ (carve-out before Experience Engine removal) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor: extract lean observability instrumentation seam from experience/telemetry Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat!: remove Experience Engine modules (compaction/telemetry/ghost/sharing) — GH #200 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * build: rebuild cdp-bridge dist after Experience Engine removal Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat!: remove rn-agent-{compact,health,export,import} commands + experience-engine scaffold Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: scaffold .rn-agent/local/ troubleshooting doc at SessionStart Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: capture redacted tool failures to .rn-agent/local/session-buffer.jsonl Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix: restore project-gated capture guard; test sets up project evidence Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(security): redaction parity with redact.ts — ${1} keyed rule, redact-before-truncate, slurp-mode multiline, generic-prefix+PEM patterns Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat: gated Stop hook synthesizes session buffer into troubleshooting.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat: inject repo-local troubleshooting doc at SessionStart When .rn-agent/local/troubleshooting.md exists with real content (beyond the scaffold template), the detect-rn-project.sh SessionStart hook now injects that content into the agent context before the main banner, so the agent begins each session aware of repo-specific config and known gotchas. Also corrects banner tool count from 75 → 76. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: point agents at .rn-agent/local/troubleshooting.md; changeset; close GH #200 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore: drop stale experience-engine reference in nav-graph comment * test: drop engine-only unit tests; repoint observer test to observability/instrumentation The Experience Engine removal orphaned 4 unit tests importing dist/experience/*. Delete the 3 that tested deleted code (audit-b4-experience, gh-106-flow-bundle, gh-106-sharing-flows); repoint observability-observer to the relocated instrumentation seam. Full unit suite green (1590/1590). * docs: remove published docs for deleted rn-agent-* commands; point at troubleshooting memory * docs: add Troubleshooting Memory feature page + sidebar entry (GH #200) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 960b590 commit 3beb8e5

80 files changed

Lines changed: 520 additions & 6311 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"rn-dev-agent-plugin": minor
3+
---
4+
5+
Replace the Experience Engine with a repo-local troubleshooting memory.
6+
7+
`/rn-agent-compact`, `/rn-agent-health`, `/rn-agent-export`, and `/rn-agent-import`
8+
are removed (GH #200: compaction had no runnable entry point and the read path was
9+
vestigial). In their place, rn-dev-agent now maintains a gitignored
10+
`.rn-agent/local/troubleshooting.md` per repo: failures are captured by a hook,
11+
the agent synthesizes them into the doc at session end, and the doc is injected at
12+
session start so the agent learns this repo's config and gotchas.

.claude-plugin/plugin.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
"./commands/build-and-test.md",
4343
"./commands/rn-feature-dev.md",
4444
"./commands/proof-capture.md",
45-
"./commands/rn-agent-compact.md",
46-
"./commands/rn-agent-export.md",
47-
"./commands/rn-agent-import.md",
48-
"./commands/rn-agent-health.md",
4945
"./commands/nav-graph.md",
5046
"./commands/send-feedback.md",
5147
"./commands/setup.md",

CLAUDE-MD-TEMPLATE.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ This project uses the **rn-dev-agent** plugin for React Native development and t
1111
It provides MCP tools across three categories: CDP introspection, device control, and testing.
1212
Run `/rn-dev-agent:check-env` to verify the current plugin version and tool count.
1313

14+
### 🧠 Repo-local troubleshooting memory
15+
16+
This project keeps an auto-maintained, gitignored notes file at
17+
`.rn-agent/local/troubleshooting.md` with two sections: **Configuration & How-To**
18+
(repo-specific facts — Metro start dir, store exposure, testID conventions,
19+
auth/deeplink, build quirks) and **Troubleshooting** (failure→resolution gotchas).
20+
21+
- **Read it first.** At the start of any device/CDP task, consult this file (the
22+
SessionStart hook also injects it) so you don't re-derive known gotchas or
23+
re-hit a known failure.
24+
- **It updates itself.** When rn-dev-agent tool calls fail, a hook records them;
25+
at session end a Stop hook asks you to merge new gotchas into this file. If
26+
prompted, do it — keep entries concise and under ~2000 tokens total.
27+
- It is per-developer and never committed.
28+
1429
### 🚨 MANDATORY PRE-FLIGHT (before ANY device_* call)
1530

1631
Run this 3-step checklist at the start of every UI-touching task. This is the
@@ -96,7 +111,6 @@ afterward — discovery is a one-time cost, replay is the steady state.
96111
| **Run** | `/rn-dev-agent:run-action <id> [-e KEY=VALUE …]` (calls `cdp_run_action`) | Replays with safety pre-flights (mutates flag, appId match, parameter coverage) and auto-repair on `SELECTOR_NOT_FOUND` |
97112
| **Self-heal** | `cdp_repair_action <id>` | Fuzzy-matches the stale testID against the live snapshot, patches the YAML in place, bumps `revision`, demotes `status` to `experimental` until next clean replay. Bounded: max 3 attempts/24h, refuses on human edits (mtime check) |
98113
| **Assert state** | `expect_redux`, `expect_route`, `expect_visible_by_testid`, `expect_text` | Macro-Asserts — embed internal-state assertions inside replays. Maestro asserts pixels; these assert what the app actually believes |
99-
| **Compact** | `/rn-dev-agent:rn-agent-compact` | Periodic corpus health report — flags cold (90+ day), flaky (>50% failure), or high-churn (5+ repairs/30d) actions. Deletion is human-in-the-loop |
100114

101115
**Canonical loop.** Record a verified walk once → save as an action → in the
102116
next session, `list-learned-actions` surfaces it for the agent → `run-action`

CLAUDE.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,8 @@ Actions (replayable flows — see "Actions" section below):
6464
/rn-dev-agent:run-action <name> -e K=V — Replay a saved action; auto-repair-aware
6565
```
6666

67-
Experience Engine (cross-session learning):
68-
```
69-
/rn-dev-agent:rn-agent-health — Health check the local experience store
70-
/rn-dev-agent:rn-agent-compact — Compact telemetry on disk
71-
/rn-dev-agent:rn-agent-export — Export the experience store
72-
/rn-dev-agent:rn-agent-import — Import an experience snapshot
73-
```
67+
Repo-local troubleshooting memory (replaces the Experience Engine):
68+
`.rn-agent/local/troubleshooting.md` — gitignored, agent-read at SessionStart, auto-updated by the Stop hook after failures (GH #200).
7469

7570
### How it works
7671
1. Always start with `cdp_status` — this connects to your running app via CDP

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ An **action** is a saved Maestro flow the agent **emits** when `/test-feature` v
100100
| `/rn-dev-agent:nav-graph` | Extract and inspect the app navigation graph |
101101
| `/rn-dev-agent:send-feedback` | Open a GitHub issue with sanitized environment context |
102102

103-
**Experience Engine** (cross-session learning): `/rn-dev-agent:rn-agent-export`, `/rn-dev-agent:rn-agent-import`, `/rn-dev-agent:rn-agent-health`, `/rn-dev-agent:rn-agent-compact` — see [docs](https://lykhoyda.github.io/rn-dev-agent/commands/).
103+
Repo-local troubleshooting memory: the agent maintains a gitignored `.rn-agent/local/troubleshooting.md` per project (auto-captured failures + config notes), read at session start and updated at session end.
104104

105105
## What makes this different
106106

commands/rn-agent-compact.md

Lines changed: 0 additions & 61 deletions
This file was deleted.

commands/rn-agent-export.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

commands/rn-agent-health.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

commands/rn-agent-import.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

docs-site/astro.config.mjs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default defineConfig({
4545
{ label: 'Getting Started', slug: 'getting-started' },
4646
{ label: 'Architecture', slug: 'architecture' },
4747
{ label: 'Actions', slug: 'actions' },
48+
{ label: 'Troubleshooting Memory', slug: 'troubleshooting-memory' },
4849
{
4950
label: 'Commands',
5051
items: [
@@ -75,15 +76,6 @@ export default defineConfig({
7576
{ label: 'nav-graph', slug: 'commands/nav-graph' },
7677
],
7778
},
78-
{
79-
label: 'Experience Engine',
80-
items: [
81-
{ label: 'rn-agent-health', slug: 'commands/rn-agent-health' },
82-
{ label: 'rn-agent-compact', slug: 'commands/rn-agent-compact' },
83-
{ label: 'rn-agent-export', slug: 'commands/rn-agent-export' },
84-
{ label: 'rn-agent-import', slug: 'commands/rn-agent-import' },
85-
],
86-
},
8779
{ label: 'send-feedback', slug: 'commands/send-feedback' },
8880
],
8981
},

0 commit comments

Comments
 (0)