-
Notifications
You must be signed in to change notification settings - Fork 0
docs: enhance CLAUDE.md with architecture and commands #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add Claude Code standard prefix - Add single test and watch mode commands - Add extension loading instructions - Add architecture diagram and core files description - Add safety invariant documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| | `npm run build` | Production build to `dist/` | | ||
| | `npm test` | Run all tests | | ||
| | `npm test -- src/path/to/file.test.ts` | Run single test file | | ||
| | `npm test -- --watch` | Watch mode | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor Clarification Needed: The watch mode command syntax could be clearer.
The current documentation shows:
npm test -- --watch
While this is technically correct for vitest, it might be clearer to show it as:
npm test -- --watch
or mention that vitest runs in watch mode by default when using:
npm test
This is not technically incorrect, but adding a brief note about vitest's watch behavior could improve clarity for developers unfamiliar with vitest.
| | `npm test` | Run all tests | | ||
| | `npm test -- src/path/to/file.test.ts` | Run single test file | | ||
| | `npm test -- --watch` | Watch mode | | ||
| | `npm run typecheck` | Type check | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test commands documentation is good, but it's missing coverage-related commands. Consider adding:
| `npm test -- --coverage` | Run tests with coverage report |The project has @vitest/coverage-v8 installed (as seen in package.json), so developers should know how to generate coverage reports. This is especially important for a Chrome extension where critical safety invariants need thorough testing.
| - `src/messages.ts` - UI ↔ Background IPC contract | ||
| - `src/utils/ChromeApi.ts` - Promise-based Chrome API wrapper | ||
|
|
||
| **Safety invariant:** Tabs are NEVER closed before storage write succeeds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The safety invariant "Tabs are NEVER closed before storage write succeeds" is critical and well-documented. However, it would be helpful to add a reference to the test files that verify this invariant:
**Safety invariant:** Tabs are NEVER closed before storage write succeeds.
(See: `src/background/snoozeLogic.safety.test.ts`)This helps developers understand where to look for examples of how this critical behavior is tested and ensures they maintain these tests when making changes.
| | LESSONS.md | 学んだ教訓 | | ||
| | TODO.md | 未完了タスク | | ||
| - External API calls: `try-catch` + retry | ||
| - Update dev-docs/ on task completion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Development Notes section mentions error handling (try-catch + retry) but doesn't mention testing best practices. Consider adding a bullet point about testing:
- Write tests for new features (unit tests for logic, integration tests for Chrome APIs)
- Test error paths and edge cases, especially for storage operationsThis would help establish testing as a core development practice and remind developers to test error scenarios, which is particularly important for Chrome extension APIs that can fail in various ways.
|
|
||
| Chrome拡張機能(Manifest V3)- タブをスヌーズして指定時刻に自動復元 | ||
|
|
||
| ## Commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation Best Practice: Section Organization
The Commands section appears before Architecture, but typically architectural overview comes before operational commands in documentation. This helps readers understand what they're working with before learning how to use it.
Suggestion:
Consider reordering sections as follows:
- Project Overview
- Architecture (understand the system)
- Commands (learn how to use it)
- Development Notes
- Documentation
Impact: Improves logical flow and makes documentation easier to navigate for new developers.
| | File | Content | | ||
| |------|---------| | ||
| | ARCHITECTURE.md | Full architecture, data model, flows | | ||
| | SPEC.md | Feature specifications | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation references section is helpful, but it should mention testing documentation or patterns. Consider adding:
| File | Content |
|------|---------|
| ARCHITECTURE.md | Full architecture, data model, flows |
| SPEC.md | Feature specifications |
| DECISIONS.md | Design decision records |
| src/test/setup.ts | Test environment configuration and mocks |This helps developers understand where to find test setup and mocking patterns, especially for Chrome extension APIs which require special mocking.
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Summary
🤖 Generated with Claude Code