# ios-coding-standard: plan contents

Read by `/multi-agent:ios-coding-standard` before writing the Phase 4 plan. The
plan contains, in order:

1. **Coverage ledger**  -  total targets · audited · skipped with reasons. Not 100% accounted for
   means the plan is not deliverable.
2. **Summary**  -  counts by severity and source, resolved vocabulary, branch to create.
3. **Sensitive-data inventory** (Phase 2d)  -  first, because it is the highest-risk content.
4. **Screen × role matrix** `[STRUCT-02]`  -  screens as rows, manifest roles as columns, cells
   `✓ / missing / misplaced`. The structural map a newcomer reads first.
5. **Type placement table** `[STRUCT-05]`  -  type · location · consumer count · correct tier ·
   move required. Paired with the nested-type list `[STRUCT-01]`: owner · nested type · kind ·
   reference count · verdict.
6. **Visibility report** `[VIS-01, VIS-02]`  -  over-exposed declarations per file, non-final
   classes with no subclass.
7. **Boundary report** `[MOD-*]`  -  import graph (allowed vs forbidden, with coupling depth) ·
   manifest graph (declared vs legal for the role, plus dead edges) · **removability delta**
   ("removing X touches N files: ...") · inbound test (tests compile with no sibling present).
8. **Testability seam report** `[TEST-*]`  -  types reaching for the environment, logic requiring a
   view to execute, doubles whose signatures have drifted.
9. **Change-cost probe** `[FLEX-*]`  -  pick two plausible upcoming changes (a new variant of an
   existing screen; a new field on a shared entity) and state what each costs in files today.
10. **Findings table**  -  rule ID · `file:line` · current state · proposed fix · severity · source ·
    onboarding impact.
11. **Per-file work**  -  grouped per file, blocking → important → suggestion; within a severity,
    highest onboarding impact first.
12. **Behaviour-preservation guard**  -  splitting files, adding MARKs, extracting extensions and
    moving types must not change behaviour. Anything requiring a behaviour change (a missing
    analytics event, a wrong result type, a timezone fix, a storage migration) goes in a
    **separate group**, reviewed and tested on its own, never inside a mechanical split commit.
13. **Tooling delegation & the ratchet**  -  the section that decides whether any of this survives.
    - Classify each applied rule by its registry `enforcement`. For every `lint` / `format` /
      `scan` rule, state the concrete mechanism and whether that toolchain exists in the repo
      (`LintToolchain`). **When it does not exist, saying so is a finding**, ranked above most
      individual violations it would have caught.
    - Recommend **baseline-and-ratchet, never big-bang**: grandfather existing violations, surface
      only new ones, drain the backlog behind a green build. Order the plan the same way  -  stop
      the bleeding, then clean up.
    - Custom lint rule identifiers **are** the registry IDs (`sec_01_no_plaintext_persistence`,
      `mod_01_no_sibling_import`) so a violation points straight at the rule entry.
    - **Linting is local-only by decision**  -  the skill's `references/lint-local.sh` with `references/swiftlint.draft.yml`, config
      and baseline kept outside the repository; no committed config, no build phase, no CI job.
      State this honestly in the plan rather than describing a gate that does not exist: a
      pre-PR habit catches less than a wall, so the residual risk is real and belongs in the
      report. Adopting it project-wide remains an open decision  -  record it as one so it stays
      visible instead of quietly lapsing.
    - Never imply the audit substitutes for the linter, or the linter for a gate. The audit finds
      the debt once; the linter keeps a developer honest; only a gate stops it returning.
14. **Numeric exit criteria**  -  target and today's measured value side by side: lint violations
    per 1k lines (<1) · public-surface ratio, public declarations ÷ externally consumed symbols
    (≈1) · forbidden cross-module imports (0) · removability delta · files over threshold and
    files >120 lines with no sectioning (0) · screens missing a manifest role (0) · escape-hatch
    count `[CONC-03]` (flat or falling) · exception-marker count (flat or falling) · dead code (0)
    · screens with logic and no mirrored tests (0) · unclassified sensitive symbols (0).
15. **Exception ledger**  -  every `// standard:exception(<ID>)` in the module: rule · reason ·
    expiry · expired yes/no.
16. **Open Questions**  -  Phase 2b dimensions with no majority, and unclassifiable symbols.
17. **Suggested commit slicing**  -  one commit per file-group / concern.
18. **Scope guard**  -  only this module is touched; definition of done is the module's own
    verification path.

## Onboarding summary

Then write a **separate one-page onboarding summary** beside the plan, aimed at a developer
joining next week rather than at whoever does the remediation: the ten always/never lines
specialised to this module, the screen file manifest, the placement ladder, the sensitive-data
classes in play, and the verification command. Nobody learns a codebase from a 40-finding audit -
this page is the actual deliverable, and the audit is how you earn the right to write it
accurately. Derive it from `references/STANDARD.md section 0`, do not re-invent it.

