Skip to content

Commit b09a068

Browse files
committed
Move Claude notes to AGENTS.md; update docs assets
Consolidate agent guidance by moving the Playwright MCP screenshot rules and a short "Works" note into AGENTS.md. Replace CLAUDE.md with a simple pointer to AGENTS.md. Update built asset references and filenames (index-CybQBxj2.css -> index-Dpk8jMPY.css, index-DYWNuI2y.js -> index-zuRJVAUI.js) and adjust docs/404.html (and docs/index.html) to use the new hashed CSS/JS. The screenshot guidance enforces writing screenshots to tmp/screenshot/ to avoid polluting the repo and accidental commits.
1 parent b3b3265 commit b09a068

6 files changed

Lines changed: 110 additions & 108 deletions

File tree

AGENTS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
> 给 AI Agent / LLM 编排用的浓缩版项目信息。
44
> 人类完整文档见 [README.md](./README.md)
55
6+
## Works
7+
8+
如果你发现工作区中有额外变更, 始终假定是另一个 AI Agent 在当前分支中同步工作, 你需要做的是优先处理重突 (如果有) 并遵循工作互不干涉原则
9+
610
## What this package does (1 sentence)
711

812
A React component that turns any `<img>` into a fullscreen-zoomable, multi-image,
@@ -204,3 +208,32 @@ Before claiming a fix:
204208
4. **Do not claim GUI/animation/interaction behavior verified.** That requires
205209
a human to open `pnpm dev:csr-r19` / `pnpm dev:ssr-r19` / `pnpm dev:nextjs`
206210
and check the actual rendering. Agents cannot do this.
211+
212+
## Browser screenshots — playwright MCP
213+
214+
When invoking any playwright MCP screenshot tool
215+
(`mcp__plugin_playwright_*__browser_take_screenshot`, or any descendant), **the
216+
output path must live under `tmp/screenshot/`**. Never write to:
217+
218+
- the repo root (pollutes `git status` and risks accidental commits)
219+
- `docs/` (those are committed assets — logo, demo images)
220+
- any tracked directory
221+
222+
Concrete rules:
223+
224+
1. Always pass an explicit `filename` / `path` argument like
225+
`tmp/screenshot/<descriptive-name>.png`.
226+
2. If `tmp/screenshot/` doesn't exist yet, create it first
227+
(`mkdir -p tmp/screenshot/`).
228+
3. `tmp/` is gitignored, so screenshots never make it into commits.
229+
230+
Background: a previous session dropped five MCP screenshots into the repo root
231+
(`before-click.png`, `narrow-zmage.png`, `scrolled-x.png`,
232+
`scrolled-zmage-first.png`, `zmage-during.png`), polluting `git status`. The
233+
gitignore now defensively blocks `/*.png`, but the primary mechanism is
234+
agents passing the right path on each call.
235+
236+
> Note: Playwright's `testConfig.snapshotPathTemplate` only governs
237+
> `@playwright/test` assertions (`toHaveScreenshot` / `toMatchSnapshot`). It
238+
> does **not** affect the MCP plugin — MCP screenshot paths are caller-controlled.
239+
> Hence the rule is enforced here rather than in a config file.

CLAUDE.md

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1 @@
1-
# CLAUDE.md — react-zmage
2-
3-
Project-scoped instructions for Claude Code (and any other agent that reads this file).
4-
5-
## Browser screenshots — playwright MCP
6-
7-
When invoking any playwright MCP screenshot tool
8-
(`mcp__plugin_playwright_*__browser_take_screenshot`, or any descendant), **the
9-
output path must live under `tmp/screenshot/`**. Never write to:
10-
11-
- the repo root (pollutes `git status` and risks accidental commits)
12-
- `docs/` (those are committed assets — logo, demo images)
13-
- any tracked directory
14-
15-
Concrete rules:
16-
17-
1. Always pass an explicit `filename` / `path` argument like
18-
`tmp/screenshot/<descriptive-name>.png`.
19-
2. If `tmp/screenshot/` doesn't exist yet, create it first
20-
(`mkdir -p tmp/screenshot/`).
21-
3. `tmp/` is gitignored, so screenshots never make it into commits.
22-
23-
Background: a previous session dropped five MCP screenshots into the repo root
24-
(`before-click.png`, `narrow-zmage.png`, `scrolled-x.png`,
25-
`scrolled-zmage-first.png`, `zmage-during.png`), polluting `git status`. The
26-
gitignore now defensively blocks `/*.png`, but the primary mechanism is
27-
agents passing the right path on each call.
28-
29-
> Note: Playwright's `testConfig.snapshotPathTemplate` only governs
30-
> `@playwright/test` assertions (`toHaveScreenshot` / `toMatchSnapshot`). It
31-
> does **not** affect the MCP plugin — MCP screenshot paths are caller-controlled.
32-
> Hence the rule is enforced here rather than in a config file.
1+
@AGENTS.md

docs/404.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
document.documentElement.classList.toggle('dark', theme === 'dark')
7373
} catch {}
7474
</script>
75-
<script type="module" crossorigin src="/assets/index-DYWNuI2y.js"></script>
76-
<link rel="stylesheet" crossorigin href="/assets/index-CybQBxj2.css">
75+
<script type="module" crossorigin src="/assets/index-zuRJVAUI.js"></script>
76+
<link rel="stylesheet" crossorigin href="/assets/index-Dpk8jMPY.css">
7777
</head>
7878
<body>
7979
<div id="app"></div>
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)