Rename scaffold skill to android-project-scaffold-new; add module interactions to android audit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5201aa9bd5
commit
204cb13d60
6 changed files with 65 additions and 10 deletions
|
|
@ -20,7 +20,7 @@ You are auditing part of an Android codebase. Your job is to read source files *
|
|||
## For each file in the batch, in order
|
||||
|
||||
1. **Read the whole file** with the file-read tool (`Read` / `read`), one file per call (never judge from the filename or a grep, and never `cat` groups of files through Bash). For very large files (>800 lines) read it in chunks, but read all of it.
|
||||
2. Decide what it shows. Categories: `build-and-modules file-organization architecture ui navigation networking serialization persistence concurrency dependency-injection background-work platform-integration security-auth observability testing features observations`. One file can feed several categories.
|
||||
2. Decide what it shows. Categories: `build-and-modules file-organization architecture module-interactions ui navigation networking serialization persistence concurrency dependency-injection background-work platform-integration security-auth observability testing features observations`. One file can feed several categories.
|
||||
3. For each thing it shows, choose ONE of:
|
||||
- **New pattern** → record it:
|
||||
```bash
|
||||
|
|
@ -34,7 +34,16 @@ You are auditing part of an Android codebase. Your job is to read source files *
|
|||
- **Refinement of an existing pattern** (adds something genuinely new — a variant, an exception, a second mechanism, or a correction of an earlier claim) → same `finding` command with the existing slug and **no title**; it is inserted under that entry.
|
||||
- **Pure repetition** (same pattern, nothing new) → `bash $A also {AUDIT_DIR} <category> <slug> <path>` only. Do not write prose. This keeps prevalence counts honest without bloating the docs.
|
||||
4. **Features:** if the file is a screen, route, entry point, worker, receiver, or widget the user experiences, record a `features` entry (slug `feature-<name>`) describing in user language what it lets the user do, the entry-point file, and the route/deep link if any. Read string resources referenced for labels if needed.
|
||||
5. Mark the file — exactly one status:
|
||||
5. **Module interactions:** if the file calls into, exposes an API to, or exchanges data with **another module** (see the orientation summary's module list; in a single-module app, another top-level feature/layer package), record it under `module-interactions`. Slug names the edge and purpose: `<from>-to-<to>-<purpose>`, e.g. `feature-home-to-core-data-load-feed`, `sync-worker-to-core-network-refresh`. Body:
|
||||
```
|
||||
- **Kind:** user-facing | background
|
||||
- **From → To:** `:feature:home` `HomeViewModel.load()` (`path:line`) → `:core:data` `FeedRepository.feed()`
|
||||
- **Mechanism:** e.g. injected interface returning `Flow<List<FeedItem>>`
|
||||
- **Data passed:** request types → result/stream types; where mapping happens
|
||||
- **Trigger:** e.g. screen open, pull-to-refresh, periodic WorkManager job
|
||||
```
|
||||
`user-facing` = started by a user action or feeding what's on screen; `background` = no user waiting (workers, services, receivers, push, alarms, startup init). If the same edge is used by both, record two entries. Record the side you can see; if the other side is outside your batch, name the expected callee path and mark it "Inferred:" until confirmed. A file that merely repeats a known edge gets `also`.
|
||||
6. Mark the file — exactly one status:
|
||||
- `contributed` — you recorded at least one `finding` (new or refinement)
|
||||
- `redundant` — only `also` occurrences; note = the slug(s) it repeats
|
||||
- `trivial` — nothing worth recording (empty, constants, generated-like, tiny glue); note = why
|
||||
|
|
|
|||
|
|
@ -50,15 +50,40 @@ Include user-perceivable background features (sync, notifications, widgets, shar
|
|||
- Offline/caching strategy, source of truth.
|
||||
- Optional Mermaid diagram.
|
||||
|
||||
## 7. Observations
|
||||
## 7. Module interactions
|
||||
How modules call each other and what data crosses each boundary, from `library/module-interactions.md` (prevalence from `occurrences.tsv`). In a single-module app, use top-level feature/layer packages as the units and say so.
|
||||
|
||||
### 7.1 User-facing interactions
|
||||
Started by a user action or feeding what's on screen. Group rows by feature (matching §5) when there are more than ~10.
|
||||
|
||||
| From → To | Purpose | Mechanism | Data passed (in → out) | Trigger | Code pointers |
|
||||
|---|---|---|---|---|---|
|
||||
| `:feature:home` → `:core:data` | Load the feed | Injected `FeedRepository`, collected as `Flow` | `—` → `Flow<List<FeedItem>>` (entity → domain mapped in `:core:data`) | Screen open, pull-to-refresh | `feature/home/.../HomeViewModel.kt:42`, `core/data/.../FeedRepositoryImpl.kt` |
|
||||
| `:feature:home` → `:feature:detail` | Open an item | Nav route with args | `itemId: String` | Tap on item | `feature/home/.../HomeNavigation.kt` |
|
||||
|
||||
### 7.2 Background interactions
|
||||
No user waiting: workers, services, receivers, push, alarms, startup init, observers of shared storage.
|
||||
|
||||
| From → To | Purpose | Mechanism | Data passed (in → out) | Trigger | Code pointers |
|
||||
|---|---|---|---|---|---|
|
||||
| `:sync` → `:core:network` → `:core:database` | Refresh cache | `CoroutineWorker` calls API, writes Room | `SyncRequest` → `List<FeedDto>` → `FeedEntity` rows | Periodic WorkManager, 6h, unmetered | `sync/.../SyncWorker.kt` |
|
||||
|
||||
### 7.3 Interaction map
|
||||
A Mermaid `graph LR` of modules, with edges labelled by purpose and data type. Draw user-facing edges solid (`-->`) and background edges dashed (`-.->`). Keep it to the edges in the tables. If there are more than ~25, draw one diagram per group.
|
||||
|
||||
### 7.4 Notes
|
||||
- Shared state reached through more than one path (e.g. a Room table written by a worker and observed by a screen): say which module owns it.
|
||||
- Module dependencies that no interaction uses (possibly dead), and layer violations, with paths.
|
||||
|
||||
## 8. Observations
|
||||
- **Inconsistencies / migrations in progress** (two ways of doing the same thing, with counts).
|
||||
- **Risks & tech debt** (with paths).
|
||||
- **Strengths** worth preserving.
|
||||
|
||||
## 8. Coverage & method
|
||||
## 9. Coverage & method
|
||||
How many files were in scope, read, and contributed; what was excluded and why (generated code, resources counted not read: `resource-counts.tsv`); how many subagents/batches. Location of the library: `{AUDIT_DIR}/library/`.
|
||||
|
||||
## 9. Usage & duration
|
||||
## 10. Usage & duration
|
||||
Paste `usage.md` verbatim: wall-clock duration, per-phase durations, and the token table per harness / session kind / model, with the total row. Below it, add one line per caveat that applies:
|
||||
- Tokens for writing this report fall after `finish` and are not included.
|
||||
- The run was resumed across sessions, so wall clock includes idle time.
|
||||
|
|
@ -66,4 +91,4 @@ Paste `usage.md` verbatim: wall-clock duration, per-phase durations, and the tok
|
|||
- Another audit or unrelated work ran in the same session during the window, so the session row includes that.
|
||||
```
|
||||
|
||||
After writing the file, print to the terminal: section 1, the Implementation summary table, the Features table, the top 3–5 observations, the duration and token total row from §9, and the path to `REPORT.md`.
|
||||
After writing the file, print to the terminal: section 1, the Implementation summary table, the Features table, the two Module interactions tables (or their first ~10 rows each, if long), the top 3–5 observations, the duration and token total row from §10, and the path to `REPORT.md`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue