Skip to content
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0612c6e
feat(service): add MiniMax translation service
darcyYe Feb 20, 2026
5f87c51
chore: rename to align the naming convention
darcyYe Feb 20, 2026
68b5a0b
[ADD] auto remove the excerpt notice info when select from the Books.app
wendell21-z Feb 3, 2026
8f0dbbf
[ADD] auto remove the excerpt notice info when select from the Books.app
wendell21-z Feb 3, 2026
c9ed26e
Apply suggestion from @Copilot
tisfeng Feb 8, 2026
1e247d4
fix(settings): reorder book excerpt removal toggle placement
tisfeng Feb 8, 2026
6a1b787
fix(settings): update toggle label for removing book excerpt copyrigh…
tisfeng Feb 8, 2026
6b1f86a
fix(text): improve copyright removal regex for Chinese text
tisfeng Feb 8, 2026
bccd081
refactor: optimize book copyright removal logic
tisfeng Feb 8, 2026
236c505
fix(query): enable copyright removal for mouse selection queries
tisfeng Feb 8, 2026
1e8f7c1
fix(zhipu): tolerate text/plain completion error in stream
darcyYe Feb 20, 2026
326bedf
refactor(stream): harden text/plain completion suppression checks
darcyYe Feb 20, 2026
2ba5fb1
fix(menu-item-view): remove unused Vision import
tisfeng Feb 11, 2026
8f34fe4
docs(contributing): update branch naming and direct commit guidelines
tisfeng Feb 21, 2026
3c19a0e
fix(window): remove redundant NSWindowDidResizeNotification
tisfeng Feb 21, 2026
884688c
docs(git-commit): update commit workflow and execution rules
tisfeng Mar 14, 2026
029c20c
fix(window): prevent recursive query window resize updates
tisfeng Mar 14, 2026
95d607b
docs(agents): point commit guidance to shared git-commit skill
tisfeng Mar 14, 2026
195718f
docs(readme): add git-commit helper instructions for AI agents
tisfeng Mar 14, 2026
739373d
docs(build): align derived data path with Xcode defaults
tisfeng Mar 15, 2026
df85cb1
docs(agents): move build command guidance to claude rules
tisfeng Mar 15, 2026
665a381
security: comprehensive security hardening for API keys, TLS, and dat…
Littleyd Mar 19, 2026
0ec1084
fix: restore NSAllowsArbitraryLoads for HTTP translation endpoints
Littleyd Mar 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions .agent/rules/agents.md

This file was deleted.

136 changes: 136 additions & 0 deletions .agents/skills/git-commit/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
name: git-commit
description: Draft Angular-style Git commit messages from staged changes and execute `git commit` safely after explicit approval. Use for commit message generation, staged-diff review for commit wording, and Chinese previews of English commit messages.
---

# Git Commit Workflow

Generate accurate Angular-style Git commit messages from staged changes only.

## Required Workflow

Follow this sequence exactly:

1. Collect context with:
- `git status`
- `git diff --staged`
- `git branch --show-current`
- `git log --oneline -10`
2. Stop immediately if there are no staged changes. Ask the user to stage files first.
3. Analyze the staged diff precisely:
- Identify additions, deletions, and behavior impact.
- Infer the most accurate `type(scope): subject`.
4. Draft the commit message in English using the format rules below.
5. Prepare a Simplified Chinese preview that fully matches the English message.
6. Present the result using the output rules below and wait for explicit approval.
7. After approval, execute the commit in three separate steps:
- Write only the English commit message to `commit_message.txt`
- Run `git commit -F commit_message.txt`
- Remove `commit_message.txt`

## Hard Rules

- Do not run `git add`.
- Do not run `git push`.
- Do not commit without explicit user authorization.
- Do not include Chinese text in the actual commit message file.
- Do not describe unstaged or unrelated changes.
- Keep the Chinese preview accurate and complete.
- Do not chain `git commit` together with file creation or cleanup in a single shell command.

## Commit Execution Rules

- Treat `git commit` as the only step that needs repository write access. Keep message-file creation and cleanup as separate commands.
- If `git commit` fails with sandbox-style permission errors such as `Operation not permitted` while creating `.git/index.lock`, immediately rerun `git commit -F commit_message.txt` with the required escalation instead of retrying the same non-privileged command.
- When the environment is known to block writes under `.git`, prefer requesting the needed escalation for `git commit` directly after the user approves the message.
- If commit succeeds, remove `commit_message.txt` afterward. If commit fails, keep the file unless cleanup is clearly safe and intentional.

## Angular-Style Commit Format

Use this structure when additional detail is needed:

```text
type(scope): subject

Body paragraph(s) explaining what changed and why.

Footer for breaking changes or special notes when applicable.
```

Apply these formatting rules:

- Use the standard title form: `type(scope): subject`.
- Write the `subject` as an imperative summary, start it with a lowercase letter, and do not end it with a period.
- Keep the title at or below 80 characters.
- Keep the full commit message under 600 characters.
- Use the optional `body` to explain what changed and why, not implementation minutiae.
- The `body` may contain multiple paragraphs, separated by one blank line.
- Use the optional `footer` only for breaking changes or special considerations.

### Breaking Changes

Mark breaking changes with `!`, with a `BREAKING CHANGE:` footer, or with both when the title should signal the break immediately and the footer needs to explain migration impact.

Use `!` after the type or scope in the title:

```text
feat(api)!: send an email to the customer when a product is shipped
```

Use a `BREAKING CHANGE:` footer to describe the compatibility impact:

```text
feat(config)!: allow provided config object to extend other configs

BREAKING CHANGE: `extends` key in the config file now extends other config files
```

## Commit Type Guidance

Choose the narrowest commit `type` that matches the staged diff:

- `feat`: introduce user-facing behavior or a new capability.
- `fix`: correct a bug, regression, or broken behavior.
- `refactor`: improve internal structure without changing behavior.
- `perf`: improve performance or reduce resource usage.
- `docs`: update documentation only.
- `test`: add or adjust tests without changing production behavior.
- `build`: change dependencies, packaging, or build configuration.
- `ci`: update CI workflows or automation pipelines.
- `chore`: make routine maintenance changes that do not fit other types.
- `style`: apply formatting or non-functional code style updates.

Choose `scope` from the touched module, feature, service, or component name whenever possible. Prefer specific scopes such as `openai`, `screenshot`, or `settings` over broad labels like `app` or `misc`.

## Output and Approval Rules

- Present the result using this exact format and wait for explicit approval:

```
{English commit message}
```

```
{Simplified Chinese translation}
```

- Do not create `commit_message.txt` or run `git commit` before explicit approval.
- Write only the English message into `commit_message.txt`.

## Example

```
fix(screenshot): defer overlay capture until view appears

Move screenshot capture out of the overlay initializer so the view hierarchy is stable before capture starts.

This prevents the startup race that caused layout conflicts and crashes during screenshot translation.
```

```
fix(screenshot): 推迟悬浮层截图直到视图出现后再执行

将截图操作从悬浮层初始化方法中移出,待视图层级稳定后再开始截图。

此修改可防止因启动竞态条件引发的布局冲突和截图翻译崩溃问题。
```
60 changes: 0 additions & 60 deletions .claude/commands/git/commit.md

This file was deleted.

11 changes: 7 additions & 4 deletions .claude/rules/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@
# Open workspace in Xcode (NOT the .xcodeproj)
open Easydict.xcworkspace

# Uses this machine's Xcode DerivedData directory. Update the home path if needed on another Mac.
# Install xcbeautify first, for example: brew install xcbeautify

# Build
xcodebuild build \
-workspace Easydict.xcworkspace \
-scheme Easydict \
-derivedDataPath ./DerivedData | xcbeautify
-derivedDataPath ~/Library/Developer/Xcode/DerivedData | xcbeautify

# Build for testing
xcodebuild build-for-testing \
-workspace Easydict.xcworkspace \
-scheme Easydict \
-derivedDataPath ./DerivedData | xcbeautify
-derivedDataPath ~/Library/Developer/Xcode/DerivedData | xcbeautify

# e.g. run specific test class, -only-testing:<Target>/<TestClass>
xcodebuild test-without-building \
-workspace Easydict.xcworkspace \
-scheme Easydict \
-derivedDataPath ./DerivedData \
-derivedDataPath ~/Library/Developer/Xcode/DerivedData \
-only-testing:EasydictTests/UtilityFunctionsTests | xcbeautify

# e.g. run specific test method, -only-testing:<Target>/<TestClass>/<testMethod>
xcodebuild test-without-building \
-workspace Easydict.xcworkspace \
-scheme Easydict \
-derivedDataPath ./DerivedData \
-derivedDataPath ~/Library/Developer/Xcode/DerivedData \
-only-testing:EasydictTests/UtilityFunctionsTests/testAES | xcbeautify
```
1 change: 1 addition & 0 deletions .claude/skills/git-commit/SKILL.md
24 changes: 14 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@ The project is currently **actively migrating from Objective-C to Swift + SwiftU

**Note:** All new development should prefer modern Swift and SwiftUI APIs available on macOS 13.0+ to ensure cleaner, safer, and future‑proof code.

## Build Commands

In general, do not need to run `xcodebuild` commands if not demanded.

See [build.md](build.md) for common build and test commands.

## Code Architecture
****

### Directory Structure

- `Easydict/App/` - App entry point, bridging header, assets, localization
Expand Down Expand Up @@ -52,14 +46,24 @@ Translation services inherit from a base query service. Each service lives in it
- PCH file at `Easydict/App/PrefixHeader.pch`
- String localization uses Xcode String Catalogs (`Localizable.xcstrings` files)

## Build Commands

In general, do not need to run `xcodebuild` commands if not demanded.

See [build.md](.claude/rules/build.md) for common build and test commands.

## Coding Standards

See [code-style.md](code-style.md) for detailed coding rules.
See [code-style.md](.claude/rules/code-style.md) for detailed coding rules.

## Localization

See [localization.md](localization.md) for detailed localization rules.
See [localization.md](.claude/rules/localization.md) for detailed localization rules.

## Git Commit Messages

See [commit.md](commit.md) for Angular-style commit message guidelines.
See [SKILL.md](.claude/skills/git-commit/SKILL.md) for Angular-style commit message guidelines.

## MCP Servers

Always use the OpenAI developer documentation MCP server if you need to work with the OpenAI API, ChatGPT Apps SDK, Codex,… without me having to explicitly ask.
Loading
Loading