Two files, one repository
chen08209/FlClash ships 2 formats across 2 indexed files. The question worth asking is whether the second one says anything the first does not.
CompareAGENTS.md ↔ CLAUDE.md
| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 4 | 6 | 0% |
| Commands | 0 | 5 | 0 | 0% |
| Section tags | 1 | 1 | 2 | 25% |
What each file covers
Sections
0 shared · 4 only in A · 6 only in B- − AGENTS.md
- − Start Here
- − Highest Priority Rules
- − Repo Skills
- + CLAUDE.md
- + Project Overview
- + Build System
- + Code Generation
- + Architecture
- + Adding a New Rust Function
Commands
0 shared · 5 only in A · 0 only in B- − flutter test
- − dart test
- − flutter pub get
- − flutter analyze --no-fatal-infos
- − flutter test --reporter expanded
Section tags
1 shared · 1 only in A · 2 only in B- − do-not
- + build
- + architecture
- agent-behaviour
Line diff
chen08209/FlClash · AGENTS.md
@@ −1 @@
1# AGENTS.md
2
3This file is the entry point for AI coding agents working in this repository. Keep it small: detailed guidance lives under
4`.agents/`, and discoverable repo skills live under `.agents/skills/*/SKILL.md`.
5
6## Start Here
7
8Read these files before making changes:
9
10- [.agents/project.md](.agents/project.md): project overview, versions, and build dependencies.
11- [.agents/commands.md](.agents/commands.md): build, development, code generation, and test commands.
12- [.agents/rules.md](.agents/rules.md): lint, testing, generated-code, and workflow rules.
13
14Read these only when the task touches their area:
15
16- [.agents/architecture.md](.agents/architecture.md): core integration, providers, database, managers, build system, and
17 local plugins.
18- [.agents/agent-config.md](.agents/agent-config.md): how to choose between `AGENTS.md`, `.agents`, skills, Codex config,
19 command rules, and hooks.
20- [.agents/skills.md](.agents/skills.md): index of repo-scoped skills in `.agents/skills/`.
21
22## Highest Priority Rules
23
24- When the user explicitly requests a scoped, low-risk change, inspect the relevant context and implement it directly.
25 Do not require brainstorming, design documents, implementation plans, multiple-option proposals, or repeated confirmation.
26 Ask only when material ambiguity, destructive impact, additional authority, or scope expansion could change the result.
27- Do not add code or configuration comments unless the user explicitly asks for comments. This includes explanatory,
28 narrative, TODO, and documentation comments.
29- Use `flutter test`, not `dart test`, because models pull in Flutter types.
30- Run code generation after modifying models, providers, or database schema.
31- Do not manually edit generated files.
32- Preserve lifecycle ownership: desktop Core process convergence belongs to `lib/core/desktop/`; Android service intent
33 arbitration belongs to `ServiceState`. UI/provider code may request a transition but must not become a second source of
34 truth.
35- Keep start/stop/restart paths latest-intent-safe. Flutter-to-Android service commands are deliberately optimistic, while
36 native state serializes the actual work; desktop lifecycle results distinguish applied, coalesced, and superseded
37 requests.
38- Follow `analysis_options.yaml`, especially single quotes, trailing commas, `child:` last, no `print()`, const/final
39 preferences, and declared return types.
40- For CI parity, verify with `flutter pub get`, `flutter analyze --no-fatal-infos`, and
41 `flutter test --reporter expanded` when practical.
42
43## Repo Skills
44
45Use repo skills from `.agents/skills/` when a task matches their descriptions. Current skills cover localization,
46provider tests, UI work, and core/platform changes.
47
chen08209/FlClash · plugins/rust_api/CLAUDE.md
@@ +1 @@
1# CLAUDE.md
2
3This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
5## Project Overview
6
7`rust_api` is a Flutter FFI plugin using **flutter_rust_bridge v2.12.0** to call Rust functions from Dart. The Rust
8library is compiled as both `cdylib` (dynamic) and `staticlib`, and bundled into Flutter apps on all platforms
9(Android, iOS, macOS, Linux, Windows) via the `ffiPlugin: true` flag in `pubspec.yaml`.
10
11## Build System
12
13Platform builds are orchestrated by **cargokit** (`cargokit/`), a third-party build harness that invokes Cargo and
14integrates with each platform's build system (Gradle for Android, CocoaPods for Apple, CMake for Linux/Windows).
15
16Rust compilation happens automatically as part of the host Flutter app's build — there's no standalone build step for
17this plugin.
18
19## Code Generation
20
21All Dart-Rust bindings are generated by `flutter_rust_bridge_codegen`. The mapping is configured in
22`flutter_rust_bridge.yaml`:
23
24```yaml
25rust_input: crate::api # Rust source: rust/src/api/
26rust_root: rust/
27dart_output: lib/src/rust # Generated Dart output
28```
29
30**To regenerate bindings** after changing Rust code:
31
32```bash
33flutter_rust_bridge_codegen generate
34```
35
36The generated files are `lib/src/rust/frb_generated.dart`, `lib/src/rust/frb_generated.io.dart`,
37`lib/src/rust/frb_generated.web.dart`, `lib/src/rust/api/<module>.dart` (one per Rust source module),
38and `rust/src/frb_generated.rs`. These should not be edited by hand.
39
40## Architecture
41
42```
43Rust source Generated Dart Public Dart API
44───────────────────── ───────────────────── ─────────────────
45rust/src/api/ lib/src/rust/api/ lib/rust_api.dart
46 mod.rs ──► init.rs (init has no Dart file)
47 named_pipe.rs named_pipe.dart
48 lib/src/rust/
49 frb_generated.dart (re-exports RustLib)
50 frb_generated.io.dart (FFI for native)
51 frb_generated.web.dart (stub for web)
52```
53
54- **Rust side** (`rust/src/api/`): Functions annotated with `#[flutter_rust_bridge::frb]` attributes. The `mod.rs`
55 declares API modules.
56- **Generated Dart** (`lib/src/rust/`): Auto-generated top-level functions that delegate through `RustLib.instance.api`.
57- **Public API** (`lib/rust_api.dart`): Re-exports generated functions and `RustLib` for initialization.
58- **`RustLib`** is the singleton entrypoint. Call `RustLib.init()` before calling any API functions, and
59 `RustLib.dispose()` on teardown.
60
61## Adding a New Rust Function
62
631. Add a public function in `rust/src/api/` (in an existing module or a new one)
642. If a new module, add `pub mod <name>;` to `rust/src/api/mod.rs`
653. Run `flutter_rust_bridge_codegen generate`
664. Export the new generated Dart file from `lib/rust_api.dart` if a new module was added
@@ −1 +1 @@
1−# AGENTS.md
1+# CLAUDE.md
22
3−This file is the entry point for AI coding agents working in this repository. Keep it small: detailed guidance lives under
4−`.agents/`, and discoverable repo skills live under `.agents/skills/*/SKILL.md`.
3+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
54
6−## Start Here
5+## Project Overview
76
8−Read these files before making changes:
7+`rust_api` is a Flutter FFI plugin using **flutter_rust_bridge v2.12.0** to call Rust functions from Dart. The Rust
8+library is compiled as both `cdylib` (dynamic) and `staticlib`, and bundled into Flutter apps on all platforms
9+(Android, iOS, macOS, Linux, Windows) via the `ffiPlugin: true` flag in `pubspec.yaml`.
910
10−- [.agents/project.md](.agents/project.md): project overview, versions, and build dependencies.
11−- [.agents/commands.md](.agents/commands.md): build, development, code generation, and test commands.
12−- [.agents/rules.md](.agents/rules.md): lint, testing, generated-code, and workflow rules.
11+## Build System
1312
14−Read these only when the task touches their area:
13+Platform builds are orchestrated by **cargokit** (`cargokit/`), a third-party build harness that invokes Cargo and
14+integrates with each platform's build system (Gradle for Android, CocoaPods for Apple, CMake for Linux/Windows).
1515
16−- [.agents/architecture.md](.agents/architecture.md): core integration, providers, database, managers, build system, and
17− local plugins.
18−- [.agents/agent-config.md](.agents/agent-config.md): how to choose between `AGENTS.md`, `.agents`, skills, Codex config,
19− command rules, and hooks.
20−- [.agents/skills.md](.agents/skills.md): index of repo-scoped skills in `.agents/skills/`.
16+Rust compilation happens automatically as part of the host Flutter app's build — there's no standalone build step for
17+this plugin.
2118
22−## Highest Priority Rules
19+## Code Generation
2320
24−- When the user explicitly requests a scoped, low-risk change, inspect the relevant context and implement it directly.
25− Do not require brainstorming, design documents, implementation plans, multiple-option proposals, or repeated confirmation.
26− Ask only when material ambiguity, destructive impact, additional authority, or scope expansion could change the result.
27−- Do not add code or configuration comments unless the user explicitly asks for comments. This includes explanatory,
28− narrative, TODO, and documentation comments.
29−- Use `flutter test`, not `dart test`, because models pull in Flutter types.
30−- Run code generation after modifying models, providers, or database schema.
31−- Do not manually edit generated files.
32−- Preserve lifecycle ownership: desktop Core process convergence belongs to `lib/core/desktop/`; Android service intent
33− arbitration belongs to `ServiceState`. UI/provider code may request a transition but must not become a second source of
34− truth.
35−- Keep start/stop/restart paths latest-intent-safe. Flutter-to-Android service commands are deliberately optimistic, while
36− native state serializes the actual work; desktop lifecycle results distinguish applied, coalesced, and superseded
37− requests.
38−- Follow `analysis_options.yaml`, especially single quotes, trailing commas, `child:` last, no `print()`, const/final
39− preferences, and declared return types.
40−- For CI parity, verify with `flutter pub get`, `flutter analyze --no-fatal-infos`, and
41− `flutter test --reporter expanded` when practical.
21+All Dart-Rust bindings are generated by `flutter_rust_bridge_codegen`. The mapping is configured in
22+`flutter_rust_bridge.yaml`:
4223
43−## Repo Skills
24+```yaml
25+rust_input: crate::api # Rust source: rust/src/api/
26+rust_root: rust/
27+dart_output: lib/src/rust # Generated Dart output
28+```
4429
45−Use repo skills from `.agents/skills/` when a task matches their descriptions. Current skills cover localization,
46−provider tests, UI work, and core/platform changes.
30+**To regenerate bindings** after changing Rust code:
4731
32+```bash
33+flutter_rust_bridge_codegen generate
34+```
35+
36+The generated files are `lib/src/rust/frb_generated.dart`, `lib/src/rust/frb_generated.io.dart`,
37+`lib/src/rust/frb_generated.web.dart`, `lib/src/rust/api/<module>.dart` (one per Rust source module),
38+and `rust/src/frb_generated.rs`. These should not be edited by hand.
39+
40+## Architecture
41+
42+```
43+Rust source Generated Dart Public Dart API
44+───────────────────── ───────────────────── ─────────────────
45+rust/src/api/ lib/src/rust/api/ lib/rust_api.dart
46+ mod.rs ──► init.rs (init has no Dart file)
47+ named_pipe.rs named_pipe.dart
48+ lib/src/rust/
49+ frb_generated.dart (re-exports RustLib)
50+ frb_generated.io.dart (FFI for native)
51+ frb_generated.web.dart (stub for web)
52+```
53+
54+- **Rust side** (`rust/src/api/`): Functions annotated with `#[flutter_rust_bridge::frb]` attributes. The `mod.rs`
55+ declares API modules.
56+- **Generated Dart** (`lib/src/rust/`): Auto-generated top-level functions that delegate through `RustLib.instance.api`.
57+- **Public API** (`lib/rust_api.dart`): Re-exports generated functions and `RustLib` for initialization.
58+- **`RustLib`** is the singleton entrypoint. Call `RustLib.init()` before calling any API functions, and
59+ `RustLib.dispose()` on teardown.
60+
61+## Adding a New Rust Function
62+
63+1. Add a public function in `rust/src/api/` (in an existing module or a new one)
64+2. If a new module, add `pub mod <name>;` to `rust/src/api/mod.rs`
65+3. Run `flutter_rust_bridge_codegen generate`
66+4. Export the new generated Dart file from `lib/rust_api.dart` if a new module was added
