# Content Density Audit

## Objective

Measure what each screen asks the user to read, scan, and decide before trimming it.

A repeatable review of the app's main screens that records how much content, chrome, and choice each one presents, and what should be removed.

## Before You Begin

This feature is being added to an application that already exists and already
works. Do not scaffold a new project, and do not assume a blank slate.

Inspect the codebase first and establish:

- The existing application structure and where code of this kind already lives.
- The framework and version in use.
- The existing design system — colours, spacing, typography, and component conventions.
- Existing UI components you can reuse instead of writing new ones.
- The existing database structure, if this feature needs to persist anything.
- The existing authentication and authorization system, if this feature is user-scoped.
- Dependencies already installed, so you don't add a library that duplicates one.
- The existing test setup and conventions.

Only start writing code once you understand the above. If the application
already implements part of this feature, extend it rather than replacing it.

## Implementation Instructions

1. Pick the screens that carry real work — the list, the detail view, the editor, the settings pages people actually visit — and for each record the counts that matter: distinct actions, competing headings, nested containers, and the number of decisions before the primary task.
2. Distinguish information the user came for from chrome that surrounds it. A dense table of the records someone is comparing is doing its job; four toolbars above that table are not.
3. Review each screen at a narrow width and a wide one separately and record them as different findings. A layout that is comfortable on a desktop can be an unbroken column of controls on a phone.
4. List every action reachable more than once on a screen and every container that adds a border or a shadow without separating anything, and mark them as candidates for removal with a named replacement.
5. Do not reduce everything to a single density target. A monitoring dashboard and an onboarding step have opposite goals, so set the target from the workflow the screen serves and say what that workflow is.

## UI and UX Requirements

Match the application's existing design system exactly. Reuse its components,
spacing, and typography. This feature should look like it was always there.

## Responsive Requirements

Works on mobile, tablet, and desktop. Touch targets are large enough to hit on a
phone, and nothing overflows horizontally at 320px.

## Accessibility Requirements

- Fully keyboard navigable.
- Correct semantic elements and ARIA roles.
- Visible focus states.
- Meets WCAG AA contrast.
- Dynamic changes are announced to screen readers.
- Respects prefers-reduced-motion.

## Edge Cases

- Useful density and clutter look identical in a screenshot. The test is whether the user needs the item to complete the screen's task; apply that test explicitly rather than counting elements alone.
- Mobile and desktop must be audited as separate surfaces with separate findings, because a screen that passes at one width routinely fails at the other.
- The same action offered in a row menu, a toolbar, and a bulk bar is not three affordances but three places to maintain and three chances to disagree; record every duplicate and keep one.
- Cards nested inside panels inside sections add visual weight and no information. Flag containers that do not separate genuinely different things.
- Targets must be set per workflow. A dense analytics screen for a daily operator and a sparse setup screen for a first-time user cannot share a threshold.
- The audit is a finding, not a change. Removing something that only power users need, on the strength of a count, is worse than the clutter.
- Spacing tokens and the comfortable-versus-compact setting belong to Display Density; this audit decides what should be on the screen at all, not how tightly it is spaced.

## Testing

Exercise the feature end to end in the running application. Cover every edge case
above, then run the existing test suite and confirm nothing regressed.

## Acceptance Criteria

- [ ] Every primary screen has a recorded audit covering both narrow and wide widths.
- [ ] Each finding states whether the item is content the user came for or surrounding chrome.
- [ ] Duplicated actions and non-separating containers are listed with a recommended single home.
- [ ] Density targets are stated per workflow, with the workflow named.
- [ ] Findings are ranked by their effect on the screen's primary task.
- [ ] The audit is repeatable — a second pass on the same screen produces comparable numbers.
- [ ] The feature matches the existing design system.
- [ ] No existing functionality is broken.

## Adaptation Rules

- Match the existing design system. Do not introduce a new colour palette,
  spacing scale, or component library.
- Reuse existing components and utilities wherever they fit.
- Follow the naming, file layout, and code style already present.
- Do not upgrade, replace, or remove existing dependencies to make this
  feature fit. Adapt the feature to the app, not the app to the feature.
- Do not break existing functionality. If a change is genuinely required in
  existing code, make the smallest one that works and say so.
- If something in these instructions conflicts with how the application is
  built, follow the application and explain the deviation.

## Final Verification

Before you report the work as done:

1. Re-read the acceptance criteria above and check each one against what you
   actually built.
2. Run the application and exercise the feature end to end.
3. Run the existing test suite and confirm you have broken nothing.
4. Check the feature on mobile, tablet, and desktop widths.
5. Check keyboard navigation and focus handling.
6. Summarize what changed: files added, files modified, and anything you
   deliberately did differently because of how this application is built.

If any acceptance criterion is unmet, fix it before reporting completion.
