Skip to content

Commit c056970

Browse files
authored
cleanup docs for agents (#448)
1 parent 6f93aec commit c056970

9 files changed

Lines changed: 102 additions & 50 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ This is a crypto wallet. Treat security-sensitive changes as high risk by defaul
5353

5454
## Task Completion
5555

56-
During active implementation, rebase conflict resolution, or compile-fix loops, prefer targeted build/test commands and defer broad lint/format runs until the change is ready to commit. Do not skip the required lint/format checks silently before final handoff; run them then, or report the exact reason they are still pending.
56+
For documentation-only changes, do not run mobile/core build and test suites unless the docs change also modifies executable scripts, generated inputs, localization inputs, CI configuration, build configuration, or release/security procedures. Verify docs-only changes with lightweight checks such as `git diff --check`, link/path inspection, and a quick read-through of the edited files.
57+
58+
During active implementation, rebase conflict resolution, or compile-fix loops, prefer targeted build/test commands and defer broad verification until the change is ready to commit. Do not run full platform builds, full test suites, broad lint, or format after every small edit unless the risk of the change requires it. Do not skip required lint/format checks silently before final handoff; run them in the final verification batch, or report the exact reason they are still pending.
59+
60+
Run final verification as a batch after you believe no more code edits are needed. If formatting, localization, generation, or a compile fix changes source after that batch starts, rerun the affected targeted checks before handoff.
5761

5862
Before finishing a task:
5963
1. Build the affected platform(s)

android/AGENTS.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,10 @@ Read `core/AGENTS.md` when the task touches `core/`, generated models, JNI bindi
3131
## Task Completion
3232

3333
Before finishing an Android task:
34-
1. Build the affected variant or module
35-
2. Run the relevant Gradle tests
36-
3. Run the relevant lint and formatting tasks when Kotlin or resources changed
34+
1. Use [Quality Checks](../skills/quality-checks.md) to choose targeted vs full verification
35+
2. Run at least one real Gradle verification command for the touched codepath
36+
3. If `core/` changed, regenerate shared artifacts and verify Android still builds
3737
4. Clean imports and avoid unnecessary comments
38-
5. If `core/` changed, regenerate shared artifacts and verify Android still builds
39-
6. In tests, prefer shared `:gemcore` fixtures with sensible defaults over inline full-field mock construction
38+
5. In tests, prefer shared `:gemcore` fixtures with sensible defaults over inline full-field mock construction
4039

41-
Add or update tests only for high-impact behavior where a compact test materially reduces risk; skip trivial logic and purely visual Compose polish unless coverage is explicitly requested or already cheap to extend.
42-
43-
Do not finish an Android task without running at least one real Gradle verification command for the touched codepath. `git diff --check`, code inspection, or reasoning are not enough. If Gradle is blocked by unrelated repo failures, report the exact command and the blocking error instead of claiming the change was verified.
40+
For UI changes, smoke the changed flow on an emulator or device when the flow is reachable. `git diff --check`, code inspection, or reasoning are not enough. If Gradle is blocked by unrelated repo failures, report the exact command and blocking error instead of claiming the change was verified.

android/skills/development-commands.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@ For release builds, read `release-and-verification.md`.
3232

3333
From the repo root, use `just start-emulator`, then `just run-android` as the default Android run flow.
3434

35+
## Compose Iteration
36+
37+
For presentation-only Compose work, build the owning module first and avoid repeating full app builds for each visual adjustment:
38+
39+
```bash
40+
./gradlew :features:asset:presents:assembleDebug
41+
./gradlew :features:settings:settings:presents:assembleDebug
42+
./gradlew :ui:assembleDebug
43+
```
44+
45+
For ViewModel or display-model behavior, pair the module build with the narrowest matching unit test:
46+
47+
```bash
48+
./gradlew :features:asset:viewmodels:testDebugUnitTest
49+
./gradlew :features:wallets:presents:testDebugUnitTest
50+
```
51+
52+
Use `./gradlew assembleGoogleDebug` when the change touches app composition, navigation wiring, flavor-specific code, generated bindings, or code that cannot be validated by a module build.
53+
3554
## Test and Quality Commands
3655

3756
```bash

android/skills/testing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `just test` or `./gradlew testGoogleDebugUnitTest` — Google Debug unit tests
88
- `just test-integration` or `./gradlew connectedGoogleDebugAndroidTest` — instrumented tests (requires emulator)
99
- `./gradlew :app:testGoogleDebugUnitTest` — app module only
10+
- `./gradlew :<module>:testDebugUnitTest` — one feature or shared module
1011
- Run the narrowest relevant target while iterating, then finish with broader validation
1112

1213
## Test Structure

ios/AGENTS.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ Read `core/AGENTS.md` when the task touches `core/`, generated bindings, or file
2525
## Task Completion
2626

2727
Before finishing an iOS task:
28-
1. Run `just build`
29-
2. Run the relevant tests with `just test ...` for unit coverage or `just test-integration` / `just test-ui` for iOS integration coverage
30-
3. Run `just lint` and `just format` when Swift code changed
31-
4. If generated files or `core/` changed, run the required generation step and verify iOS still builds
32-
5. Keep imports clean and remove dead code
28+
1. Use [Quality Checks](../skills/quality-checks.md) to choose targeted vs full verification
29+
2. Run at least one real verification command for the touched codepath
30+
3. If generated files or `core/` changed, run the required generation step and verify iOS still builds
31+
4. Keep imports clean and remove dead code
3332

34-
Add or update tests only for high-impact behavior where a compact test materially reduces risk; skip trivial logic and purely visual SwiftUI polish unless coverage is explicitly requested or already cheap to extend.
35-
36-
Do not finish an iOS task without running at least one real verification command for the touched codepath. `swift build` succeeding is not the same as the feature working — for UI changes, exercise the flow on a simulator or device. If verification is blocked by unrelated repo state, report the exact command and the blocking failure instead of claiming the change was verified.
33+
`swift build` succeeding is not the same as the feature working. For UI changes, exercise the changed flow on a simulator or device when the flow is reachable. If verification is blocked by unrelated repo state, report the exact command and blocking failure instead of claiming the change was verified.

ios/skills/development-commands.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ Use the iOS `justfile` commands by default.
88
just bootstrap # first-time setup
99
just clean # clean DerivedData and build artifacts
1010
just build # build the app
11-
just build-package Primitives
11+
just build-for-testing # build once for repeated test runs
12+
just build-package Primitives # build one Swift package/scheme
1213
just test # run unit test plans
14+
just test-without-building # re-run tests after build-for-testing
1315
just test AssetsTests # run a specific test target
1416
just test-integration # run iOS integration/UI tests
1517
just test-ui # run iOS integration/UI tests
@@ -29,6 +31,32 @@ just localize # update localization files
2931

3032
From the repo root, use `just generate-stone` and `just run-ios` as the default Gemstone/iOS flow. The optional `GemStone` Xcode scheme combines cached Gemstone generation with the normal app build.
3133

34+
## SwiftUI Iteration
35+
36+
For presentation-only SwiftUI work, build the owning package first and avoid repeating full app builds for each visual adjustment:
37+
38+
```bash
39+
just build-package Assets
40+
just build-package Components
41+
just build-package PrimitivesComponents
42+
```
43+
44+
For ViewModel or display-model behavior, pair the package build with the narrowest matching test target:
45+
46+
```bash
47+
just test AssetsTests
48+
just test LockManagerTests
49+
```
50+
51+
For repeated test debugging, build once and re-run without rebuilding:
52+
53+
```bash
54+
just build-for-testing
55+
just test-without-building
56+
```
57+
58+
Use `just build` when the change touches app composition, navigation wiring, generated bindings, or code that cannot be validated by a package build.
59+
3260
## Additional Utilities
3361

3462
```bash

ios/skills/testing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Default commands:
77
- `just test`
88
- `just test <TARGET>`
9+
- `just build-for-testing` followed by `just test-without-building` for repeated test-debug loops
910
- `just test-integration` or `just test-ui` for the iOS integration suite
1011
- Run the narrowest relevant target while iterating, then finish with the appropriate broader validation
1112

skills/new-feature-workflow.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ Read `ios/AGENTS.md`. Work in `ios/`.
3131

3232
1. Add Swift UI, ViewModel, or service code that consumes the new types
3333
2. If extending generated models, add Swift extensions in separate files — never edit generated files
34-
3. Build and test:
34+
3. Iterate with targeted package/test commands first, then run broader validation:
3535
```bash
36+
cd ios && just build-package <PACKAGE>
37+
cd ios && just test <TARGET>
3638
cd ios && just build
37-
cd ios && just test
3839
cd ios && just lint
3940
```
4041

@@ -44,10 +45,11 @@ Read `android/AGENTS.md`. Work in `android/`.
4445

4546
1. Add Kotlin UI (Compose), ViewModel, or repository code that consumes the new types
4647
2. Wire dependencies through Hilt modules
47-
3. Build and test:
48+
3. Iterate with targeted module/test commands first, then run broader validation:
4849
```bash
50+
cd android && ./gradlew :<module>:assembleDebug
51+
cd android && ./gradlew :<module>:testDebugUnitTest
4952
cd android && ./gradlew assembleGoogleDebug
50-
cd android && ./gradlew test
5153
cd android && ./gradlew lint
5254
```
5355

skills/quality-checks.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,49 @@
11
# Quality Checks
22

3-
Run the checks that match the area you touched.
3+
Run the checks that match the area you touched. Use the narrowest meaningful command while iterating, then finish with the broader validation required by the risk of the change.
44

5-
## Verification Matrix
5+
For SwiftUI and Compose work, pure presentation changes should not spend most of the loop in full app builds.
6+
7+
## Iteration Matrix
8+
9+
| Change Type | Inner Loop Checks |
10+
|-------------|-------------------|
11+
| iOS presentation-only SwiftUI | `cd ios && just build-package <PACKAGE>` |
12+
| iOS ViewModel, formatter, validation, or display-model behavior | `cd ios && just build-package <PACKAGE>`<br>`cd ios && just test <TARGET>` when a targeted test exists or is added |
13+
| Android presentation-only Compose or resource change | `cd android && ./gradlew :<module>:assembleDebug` |
14+
| Android ViewModel, formatter, validation, or display-model behavior | `cd android && ./gradlew :<module>:assembleDebug`<br>`cd android && ./gradlew :<module>:testDebugUnitTest` when a targeted test exists or is added |
15+
| Core-only Rust change with no mobile API impact | `cd core && just test <CRATE>` |
16+
| Core change that affects mobile bindings or shared models | `cd core && just test <CRATE>`<br>`just generate`<br>then targeted mobile compile until app integration is ready |
17+
| Shared localization input change | `just localize`<br>then targeted app/package/module compile where generated strings are consumed |
18+
19+
## Closing Matrix
620

721
| Change Type | Minimum Closing Checks |
822
|-------------|------------------------|
9-
| iOS-only Swift or SwiftUI change | `cd ios && just build`<br>`cd ios && just test <TARGET>` or `cd ios && just test`<br>`cd ios && just lint`<br>`cd ios && just format` |
10-
| Android-only Kotlin, Compose, or resource change | `cd android && ./gradlew assembleGoogleDebug` or build the affected module/variant<br>`cd android && ./gradlew test`<br>`cd android && ./gradlew lint`<br>`cd android && ./gradlew detekt`<br>`cd android && ./gradlew ktlintFormat` |
23+
| iOS presentation-only SwiftUI | `cd ios && just build-package <PACKAGE>`<br>Simulator/device smoke when the changed flow is reachable |
24+
| iOS ViewModel, navigation, app wiring, or behavioral UI change | `cd ios && just build`<br>`cd ios && just test <TARGET>` or `cd ios && just test`<br>`cd ios && just lint` and `cd ios && just format` when Swift code changed |
25+
| Android presentation-only Compose or resource change | `cd android && ./gradlew :<module>:assembleDebug`<br>Emulator/device smoke when the changed flow is reachable |
26+
| Android ViewModel, navigation, app wiring, or behavioral UI change | `cd android && ./gradlew assembleGoogleDebug` or build the affected app/module variant<br>`cd android && ./gradlew :<module>:testDebugUnitTest` or `cd android && ./gradlew test`<br>`cd android && ./gradlew lint`<br>`cd android && ./gradlew detekt`<br>`cd android && ./gradlew ktlintFormat` |
1127
| Core-only Rust change with no mobile API impact | `cd core && just test <CRATE>`<br>`cd core && cargo clippy -p <crate> -- -D warnings`<br>`cd core && just format` |
1228
| Core change that affects mobile bindings or shared models | `cd core && just test <CRATE>`<br>`cd core && cargo clippy -p <crate> -- -D warnings`<br>`cd core && just format`<br>`just generate`<br>`just ios build`<br>`just android build` |
1329
| Shared localization input change | `just localize`<br>Rebuild the affected app(s) if the generated strings are consumed by the change |
30+
| Documentation-only change | `git diff --check`<br>Inspect changed links, paths, commands, and instructions |
1431

15-
Use the narrowest relevant test target while iterating, then finish with the broader validation required by the change.
16-
17-
Closing a task requires at least one real build or test command for the changed area. Do not substitute `git diff`, static inspection, or reasoning for execution. If execution is blocked by unrelated repo state, include the exact command and the blocking failure in the handoff.
18-
19-
## iOS
32+
Navigation, app wiring, wallet-critical UI, security-sensitive code, Room migrations, signing, transaction construction, wallet import/export, seed phrases, private keys, and auth flows are never presentation-only. Use the stricter platform/security checks for those tasks.
2033

21-
```bash
22-
cd ios && just build
23-
cd ios && just test
24-
cd ios && just lint
25-
cd ios && just format
26-
```
34+
Except for documentation-only changes, closing a task requires at least one real build or test command for the changed area. Do not substitute `git diff`, static inspection, or reasoning for execution. If execution is blocked by unrelated repo state, include the exact command and the blocking failure in the handoff.
2735

28-
## Android
36+
## Ready-to-Commit Batch
2937

30-
```bash
31-
cd android && ./gradlew test
32-
cd android && ./gradlew lint
33-
cd android && ./gradlew detekt
34-
cd android && ./gradlew ktlintFormat
35-
```
38+
Do not run the closing matrix after every edit. Once the implementation is stable and no more code edits are expected, run the applicable closing checks as one batch:
3639

37-
## Core
40+
1. Regenerate models/bindings or localization if the changed inputs require it.
41+
2. Run formatters and linters required for the touched platform.
42+
3. Run the targeted tests that cover the changed behavior.
43+
4. Build the affected package/module/app according to the closing matrix.
44+
5. Exercise the changed UI flow when the platform guide requires a simulator, emulator, or device smoke check.
3845

39-
```bash
40-
cd core && just test <CRATE>
41-
cd core && cargo clippy -p <crate> -- -D warnings
42-
cd core && just format
43-
```
46+
If any step modifies source files or forces a compile fix, return to the narrow iteration loop, then run the affected final checks again.
4447

4548
If you change shared models or bindings, also run the generation steps and validate both mobile apps.
4649

0 commit comments

Comments
 (0)