mirror of
https://github.com/mengxi-ream/read-frog.git
synced 2026-04-30 01:56:46 +00:00
docs: update claude md (#985)
* docs: update claude md * fix: comment pr
This commit is contained in:
parent
0569c5b187
commit
ee313e923b
2 changed files with 1 additions and 54 deletions
2
.github/workflows/claude-code-review.yml
vendored
2
.github/workflows/claude-code-review.yml
vendored
|
|
@ -38,7 +38,7 @@ jobs:
|
|||
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
|
||||
plugins: code-review@claude-code-plugins
|
||||
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
|
||||
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }} --comment'
|
||||
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||
# or https://code.claude.com/docs/en/cli-reference for available options
|
||||
claude_args: |
|
||||
|
|
|
|||
53
CLAUDE.md
53
CLAUDE.md
|
|
@ -179,46 +179,6 @@ pnpm lint
|
|||
pnpm lint:fix
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Extension Structure
|
||||
|
||||
The extension follows WXT's entrypoints pattern:
|
||||
|
||||
- **`src/entrypoints/background/`** - Background service worker
|
||||
- Handles extension lifecycle, message routing, proxy fetch
|
||||
- Manages translation queues, database cleanup, config backup
|
||||
- Coordinates between content scripts and popup
|
||||
|
||||
- **`src/entrypoints/*.content/`** - Content scripts injected into web pages
|
||||
- `host.content` - Main article reading and analysis UI
|
||||
- `selection.content` - Selection translation popup
|
||||
- `side.content` - Side panel interface
|
||||
- `guide.content` - Onboarding guide overlay
|
||||
|
||||
- **`src/entrypoints/popup/`** - Extension popup UI
|
||||
- **`src/entrypoints/options/`** - Settings page (multi-page React app)
|
||||
|
||||
### Extension Config Migration
|
||||
|
||||
When changing the schema of the config, you need to add a migration script to the `src/utils/config/migration-scripts` directory, update the `CONFIG_SCHEMA_VERSION` constant and write examples for testing migration scripts.
|
||||
|
||||
### State Management Architecture
|
||||
|
||||
Uses Jotai atoms with a custom storage adapter pattern:
|
||||
|
||||
- **Config Atom** ([src/utils/atoms/config.ts](src/utils/atoms/config.ts))
|
||||
- Single source of truth for extension settings
|
||||
- Syncs with browser.storage.local via `storageAdapter`
|
||||
- Uses `deepmerge-ts` with array overwrite strategy for updates
|
||||
- Watches for changes across extension contexts (popup, content, options)
|
||||
- Handles visibility changes to prevent stale config in inactive tabs
|
||||
|
||||
- **Storage Adapter** ([src/utils/atoms/storage-adapter.ts](src/utils/atoms/storage-adapter.ts))
|
||||
- Abstraction over browser.storage API
|
||||
- Provides `get`, `set`, `watch` methods with Zod schema validation
|
||||
- Enables reactive state sync across extension contexts
|
||||
|
||||
## Commit Conventions
|
||||
|
||||
Follow [Conventional Commits](https://www.conventionalcommits.org/) with these types:
|
||||
|
|
@ -227,19 +187,6 @@ Standard types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `bui
|
|||
|
||||
Custom types: `i18n`, `ai`
|
||||
|
||||
Examples:
|
||||
|
||||
- `feat: add openrouter provider support`
|
||||
- `fix: resolve translation state race condition`
|
||||
- `i18n: update Japanese translations`
|
||||
- `ai: improve read article prompt for better analysis`
|
||||
|
||||
Enforced via commitlint and husky pre-commit hooks.
|
||||
|
||||
## Pull Request Process
|
||||
|
||||
follow `.claude/commands/create-pr.md`
|
||||
|
||||
## Important Notes
|
||||
|
||||
As AI, you should be extremely concise. Sacrifice grammar for the sake of concision.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue