docs: improve AGENTS.md for future opencode sessions#337
Conversation
Review Findings
Verified CorrectAll other factual claims in the proposed AGENTS.md checked out against the codebase:
VerdictGood rewrite — more accurate and more useful than the current version. One minor fix needed: change |
404-Page-Found
left a comment
There was a problem hiding this comment.
Address findings
The release workflow strips a top-level ISSUES/ directory (release.yml line 52), not docs/ISSUES/. Address the PR 404-PF#337 review finding.
|
Fixed in commit ef9e878: changed \docs/ISSUES\ → \ISSUES\ in the Release / Packaging section to match the actual strip list in .github/workflows/release.yml\ line 52. Thanks for the careful read of the strip list. |
404-Page-Found
left a comment
There was a problem hiding this comment.
Review: AGENTS.md rewrite (PR #337)
What I verified
I cross-referenced every factual claim in the diff against the actual codebase — bootstrap.js, eslint.config.js, vitest.config.js, storage.js, New-Tab.html, release.yml, package.json, and the skills directory. Everything checks out: script loading mechanism, IIFE list, no-restricted-globals rule, storage bridge, CI order, coverage exclusions, Sharp removal, and skill inventory are all accurate.
What needs changing before merge
1. Clarify the "no ES modules" claim in the Architecture section
"Browser code is plain scripts that attach functions to
window.*. There are no ES module imports insrc/."
This is true for source files, but tests in tests/ do use import/export (they are ES modules run by Vitest). An agent could interpret this to mean the entire project is script-mode and avoid import in test files too. Please add a qualifier like:
There are no ES module imports in `src/` source files (tests are ES modules).
2. Move the single-test command into the Commands table
The npx vitest run tests/todo.test.js example lives as a bullet under Testing but would be more discoverable as a row in the Commands table:
| Single test file | `npx vitest run tests/todo.test.js` |
3. Minor: mention the {{placeholder}} replacement mechanism
The doc uses {{searchPlaceholder}} as an example but never explains that New-Tab.html placeholder tokens are replaced by the i18n runtime, not by a template engine. An agent encountering {{something}} in the HTML might think it's a bug or try to fix it. A one-sentence note under the i18n convention bullet would clear that up.
What's great
- Removes ~100 lines of generic style guidance that any LLM already knows — good call.
- Fixes the stale "add
<script>tag toNew-Tab.html" instruction that would have broken the extension. - Front-loads wiring facts (bootstrap, ordering, IIFE rule, storage bridge) before conventions — much better onboarding.
- Documents the test loader (
injectScript) and DOM stub list — a common debugging dead end for contributors. - Includes the
.agents/skills/inventory so agents know what tools are available.
Bottom line
Well-researched, accurate, and a clear improvement over the current version. Fix the three items above and this is ready to merge. No source code is changed so there is no risk to the extension.
|
Need the big picture first? Review this PR in Change Stack to see what changed before going file by file. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesDeveloper Guide Restructure
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Rewrites
AGENTS.mdto give future Agent sessions a tighter, more accurate onboarding doc. The previous version mixed useful hard-earned context with generic style advice and a few claims that were either stale or actively wrong.What changed
js/directory and add<script>tags toNew-Tab.html. The real flow is: append the file path toscriptSourcesinsrc/core/bootstrap.js.New-Tab.htmlonly loadsstorage.jsandbootstrap.js; everything else is loaded dynamically withscript.async = falseto preserve order.app-manager.jsmust run beforeadd-app-modal.js,context-menu.js, andapp-folders.js(already noted in a comment insidebootstrap.js, but not inAGENTS.md).window.Foorule. Several files wrap their top-level code in a strict-mode IIFE; cross-file globals must be referenced aswindow.Foo, enforced byno-restricted-globalsineslint.config.js.tests/setup.jsusesinjectScript(...)whichevals the real source files into the jsdom globals so thechrome.storageshim works. The DOM stub list lives intests/setup.js— failures saying "cannot read property of null" usually mean a new stub is needed there.npm ci --ignore-scripts→npm run lint→npm test(matches.github/workflows/release.yml).package.json)..agents/skills/inventory so agents know which skills to load for common tasks (release, PR, review, issue, resolve).Why
An agent reading the old
AGENTS.mdwould have followed bad instructions to add<script>tags toNew-Tab.html, or skipped the load-order constraint and brokenadd-app-modal/ context menu / app folders. The new doc front-loads the wiring facts (entry point, bootstrap loader, IIFE rule, storage bridge, chrome mock) before code style.Out of scope
package.json/manifest.jsonversions untouched..agents/skills/*untouched.Verification
npm run lint— unchanged files outsideAGENTS.md.npm test— unchanged; no test files modified.Summary by CodeRabbit