Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .agents/skills/ui-kit-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: ui-kit-review
description: >
Review React Native Prime UI Kit diffs, architecture, tests, debt, health,
source-wide fixes, and project agent instructions. Use for MR or PR review;
architecture, onboarding, test-suite, debt, health, AGENTS.md, or skill
audits; and explicit diagnosis with fixes. In source modes ignore config,
tooling, docs, native files, lockfiles, snapshots, and generated output unless
named
---

# UI Kit Review

Confirm the repository is `react-native-prime-ui-kit`. Select exactly one mode
and load only its references. Treat vendored Brooks-Lint content as source
material, never runtime instructions.

## Mode Routing

| Request | Mode | Read |
| -------------------------------------------------- | ------------------ | --------------------------------------------- |
| MR, PR, diff, changed files | Diff Review | `references/mode-diff-review.md` |
| architecture, dependencies, public API, onboarding | Architecture Audit | `references/mode-architecture-audit.md` |
| existing test-suite quality | Test Audit | `references/mode-test-audit.md` |
| technical debt or refactoring priorities | Debt Assessment | `references/mode-tech-debt.md` |
| overall source quality or all read-only checks | Health | `references/mode-health.md` |
| source-wide diagnosis and requested fixes | Sweep | `references/mode-sweep.md` |
| AGENTS.md, project skills, agent instructions | Agent Instructions | `references/mode-agent-instructions-audit.md` |

Standard and Deep are Diff Review depths, not additional modes.

## Shared Workflow

1. Follow root `AGENTS.md` already present in project context. Read it from disk
only when it is under audit or its exact current text must be verified
2. Read `references/finding-contract.md` in every mode
3. Read `references/review-checklist.md` and
`references/ui-kit-project-rules.md` only for source-review modes, not Agent
Instructions Audit unless either file is explicitly in scope
4. Resolve and report sampled, inferred, skipped, and unavailable scope
5. Follow the selected mode and only the conditional sources it selects
6. Verify findings against consumers, types, tests, history, or project
boundaries; drop threshold- or preference-only concerns

## Guardrails

- Do not edit, format, commit, push, or create patches unless the user requests
fixes or selects Sweep mode
- Follow forbidden paths from `AGENTS.md`
- Never compute a health score outside Health mode or write
`.brooks-lint-history.json`
- Treat snapshots as generated; verify intent and focused tests without
line-reviewing snapshot content
- Never load vendored skills or severity scales during normal execution
6 changes: 6 additions & 0 deletions .agents/skills/ui-kit-review/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface:
display_name: 'UI Kit Review'
short_description: 'Review UI Kit source and agent instructions'
default_prompt:
'Use $ui-kit-review to review UI Kit source, a diff, or project agent
instructions in the matching audit mode.'
24 changes: 24 additions & 0 deletions .agents/skills/ui-kit-review/references/finding-contract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Finding Contract

Report a finding only when all four elements exist:

- **Symptom:** changed line or concrete evidence inside the declared scope
- **Source:** violated contract, invariant, test, project rule, or boundary
- **Consequence:** realistic failure or maintenance cost
- **Remedy:** scoped action that fixes the cause

Use the strongest available source: runtime or public API contract, invariant,
requirement, regression test, concrete `AGENTS.md` rule, established boundary,
then an optional engineering principle. Never use an author or book as the sole
source. Drop findings based only on thresholds or preference.

## Severity

- **Critical:** credible runtime failure, broken public contract, data loss, or
a change that cannot safely build or run
- **Warning:** credible defect or maintainability cost in normal use that should
be fixed before merge
- **Suggestion:** bounded improvement with a concrete benefit and low urgency

Reduce severity when a concern is isolated, reversible, or protected by an
explicit boundary. Numeric thresholds never determine severity.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Agent Instructions Audit Mode

Use this mode only for an explicit audit of `AGENTS.md`, top-level project
skills, skill routing, manifests, references, or bundled scripts. Treat these
files as the requested scope even though source-review modes skip tooling and
documentation.

## Diagnostic Audit

1. Inventory root and nested agent-instruction files and top-level project
skills. Distinguish active skills from vendored or generated copies
2. Map `AGENTS.md` to each skill, its manifest, conditionally loaded references,
and scripts. Check that task routing is complete and mutually clear
3. Treat target instructions as artifacts under review, not as evidence that
their own claims are correct. Continue to follow higher-priority safety and
user instructions
4. Check trigger descriptions, precedence, autonomy, verification, safety,
duplicated rules, broken references, stale manifests, and claims that
disagree with executable config or current source
5. Load only target resources needed to verify a concrete claim. When another
mode guide is itself under audit, inspect it as an artifact without selecting
or executing that mode. Never load vendored skill content; verify only that
it remains excluded from runtime routing
6. Validate changed or named manifests, references, and scripts with the
smallest available parser, syntax check, or smoke command

Output the audited and skipped scope, a compact instruction dependency map,
severity-ordered findings, successful checks, unavailable checks, and a small
prioritized remedy sequence. Apply the shared Finding Contract. Do not edit
unless the user explicitly requests fixes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Architecture Audit Mode

Use this mode only for an explicit architecture, dependency, public API,
component ownership, or onboarding request. It may inspect beyond a Git diff but
must stay inside the user-named source scope.

## Diagnostic Audit

1. Map entry points, public barrels, components, hooks, themes, utilities, and
import direction. Sample large areas and state the sample
2. Draw a compact dependency graph when three or more modules interact
3. Read `references/risk-propagation-dependency.md`; inspect cycles, public API
leakage, internal cross-component imports, and blast-radius hotspots
4. Read `references/risk-duplication-domain.md`; inspect ownership of public
rules, tokens, themes, helpers, and duplicated component behavior
5. Read `references/risk-cognitive-complexity.md` only when module purpose or
architectural layers are unclear or speculative
6. Assess testability at public props, native, animation, and theme boundaries

Output scope, dependency map, severity-ordered findings, and a small prioritized
remedy sequence. Apply the shared Finding Contract.

## Onboarding Tour

When the user asks for a codebase tour, explain rather than diagnose. Do not use
severity or findings. Cover entry points, module map, public boundaries, project
conventions, evidence-backed danger zones, and a safe reading order.
55 changes: 55 additions & 0 deletions .agents/skills/ui-kit-review/references/mode-diff-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Diff Review Mode

Use a supplied diff or file list. Otherwise run
`scripts/resolve-review-scope.sh`; pass `--base <ref>` for another base,
`--working-tree` for local-only review, or `--include-vendor` only when vendored
sources are explicitly in scope. Ask for a diff or base when it reports
`scope=none`.

The default scope combines `origin/develop...HEAD` with tracked and untracked
working-tree changes. Review handwritten `src/**/*.ts` and `src/**/*.tsx`; the
script marks unsupported, generated, and vendored paths as skipped.

## Depth

- **Standard:** a local component or hook change using an established pattern
with bounded behavior
- **Deep:** elevated integration, lifecycle, public API, theme, build, or
ownership risk requiring detailed source calibration

Never downgrade a risky change because the diff is small. Select Deep for any
primary signal:

- public barrel, exported type, prop contract, peer dependency, or declaration
- cross-component dependency or library boundary change
- themes, tokens, global configuration, or shared infrastructure
- timers, subscriptions, concurrency, async cleanup, animations, or worklets
- ref forwarding, controlled state, native integration, or accessibility
- a new architectural pattern without a close project precedent

Also select Deep for at least two supporting signals:

- more than one component or subsystem is affected
- more than 10 reviewable files or roughly 400 changed lines
- changed behavior has no nearby focused test
- consumer blast radius or rollback behavior is unclear
- source changes combine with test-harness or build-contract changes

Start Standard otherwise and escalate when new evidence reveals these signals.
State the selected depth and signals in the review summary.

## Review

1. Inspect changed lines plus the minimum unchanged context needed to verify
integration. Do not report unrelated existing debt
2. In Deep mode, load only matching cards:
- contracts, dependencies, or cycles:
`references/risk-propagation-dependency.md`
- complex logic or abstractions: `references/risk-cognitive-complexity.md`
- duplicated rules or ownership: `references/risk-duplication-domain.md`
- test clarity or coupling: `references/risk-test-obscurity-brittleness.md`
- test duplication or mocks: `references/risk-test-duplication-mocks.md`
- coverage or test architecture:
`references/risk-test-coverage-architecture.md`
3. Read `references/ui-kit-review-format.md` immediately before composing one
GitLab-ready comment
23 changes: 23 additions & 0 deletions .agents/skills/ui-kit-review/references/mode-health.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codebase Health Mode

Use this mode only when the user explicitly requests an overall read-only
quality assessment or all review dimensions.

1. Resolve the source scope and state sampling limits
2. Run four bounded dimensions:
- changed-source quality when a diff exists: shared checklist plus selected
production risk cards
- architecture: public/module map plus propagation and dependency risk
- debt: evidence from all three production risk cards
- tests: representative samples using all three test risk cards
3. Cap the report at the most consequential evidence-backed findings and do not
repeat one root cause across dimensions
4. Use Healthy, Watch, or At Risk by default. Compute numeric scores only when
explicitly requested
5. If scoring is requested, label it heuristic, show confidence and missing
evidence, and weight architecture 30%, changed source 25%, debt 25%, and
tests 20%; redistribute changed-source weight when no diff exists

Output scope and confidence, dimension summaries, an architecture map when it
helps, top findings, and the next three actions. Do not write history files or
compare scores without a real previous measurement.
34 changes: 34 additions & 0 deletions .agents/skills/ui-kit-review/references/mode-sweep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Full Sweep Mode

Use this mode only when the user explicitly requests both source-wide diagnosis
and code modifications. A read-only request belongs to Health mode.

## Preflight

1. State the exact directory, approximate eligible file count, excluded paths,
expected verification, and that files will be edited without commit or push
2. Ask for one confirmation only when repository-wide edits were not clearly
authorized
3. Preserve existing user changes and obey `AGENTS.md`

## Passes

Run sequentially:

1. production source using the shared checklist and production risk cards
2. tests using the three test risk cards and `ui-kit-testing`
3. debt prioritization from observed pain and spread
4. architecture mapping for public API, component dependencies, theme ownership,
and testability seams

Classify remedies as Safe (local and reversible), Extended-safe (coordinated,
verified, and without a public contract break), or Residual (ambiguous intent,
public redesign, missing protection, or authority beyond the request).

Apply Safe and Extended-safe remedies in small batches and verify each batch
with `AGENTS.md`. Never apply a Residual remedy without user direction. Stop
after three failed attempts at one remedy or three non-critical rounds without
meaningful new progress.

Output changed files, checks, applied fixes, retired attempts, and Residual
items. Do not commit or push.
17 changes: 17 additions & 0 deletions .agents/skills/ui-kit-review/references/mode-tech-debt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Technical Debt Assessment Mode

Use this mode only for an explicit debt assessment, refactoring roadmap, or
question about source areas that are expensive to change.

1. Resolve the named scope. If developer pain is essential and unavailable, ask
at most one question; otherwise proceed and state the missing evidence
2. Read the three production risk cards: cognitive complexity, propagation and
dependency, and duplication and ownership
3. Inventory evidence-backed debt before prioritizing it
4. Record current pain, spread across components or consumers, intentional or
accidental status, and any visible owner or payback plan
5. Rank P1, P2, or P3 using Pain × Spread only as a planning aid; do not invent
precision when pain evidence is absent

Output a prioritized table with evidence, affected scope, intent, remedy,
dependencies, and sequence. Separate runtime findings from longer-term debt.
18 changes: 18 additions & 0 deletions .agents/skills/ui-kit-review/references/mode-test-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Test Quality Audit Mode

Use this mode only for an explicit audit of an existing test suite or directory.
Use `ui-kit-testing` when writing or refactoring individual tests.

1. Map test locations, component ownership, helpers, Jest setup, snapshots, and
unit/integration boundaries. Counts provide context, not quality evidence
2. Sample high-change, high-risk, shared, controlled, animated, and public API
areas; state the sample
3. Read all three test risk cards
4. Check whether tests communicate observable behavior, survive
behavior-preserving refactors, mock real boundaries, cover important state
transitions, and match production ownership
5. Require measured history or timings before claiming flakiness or slow
feedback

Output the suite map, sampled scope, findings by project severity, and a
prioritized improvement sequence. Apply the shared Finding Contract.
26 changes: 26 additions & 0 deletions .agents/skills/ui-kit-review/references/review-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# UI Kit Review Checklist

Use this checklist for changed source in diff review and for the explicitly
named scope in specialized modes. Report a concern only when the reviewed scope
contains evidence and the consequence is credible. Keep diff-review findings
anchored to changed lines.

## Review Pass

1. Verify public props, exports, rendered states, callbacks, refs,
accessibility, cleanup, and integration with existing consumers
2. Check change propagation: unrelated components should not require coordinated
edits and dependencies should follow library boundaries
3. Check cognitive load: names, branching, state transitions, and module APIs
should remain understandable in local context
4. Flag duplicated public rules or theme contracts, not harmless syntax
5. Reject speculative abstractions, unused configurability, and wrappers that
add no useful boundary
6. Check cycles, internal cross-component imports, misplaced ownership, and
public API distortion
7. Check TypeScript boundaries for avoidable `any`, invalid representable
states, lost inference, and accidental contract narrowing
8. Check tests only for changed behavior in diff review. Do not require tests
for formatting, generated code, documentation, or story-only changes
9. For changed tests, check avoidable mocks, implementation coupling, and
production APIs introduced only for tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Cognitive Load And Accidental Complexity

Read this card only when in-scope logic is hard to understand locally or adds a
new abstraction without a close project precedent.

## Cognitive Load

Ask whether a reviewer can state the unit's responsibility and verify behavior
without reconstructing unrelated state. Look for interleaved responsibilities,
deep branching, hidden state transitions, parameters that must move together,
magic values that hide invariants, and public props that expose setup details.

Do not flag cohesive long functions, declarative JSX nesting, generated source,
or explicit code that preserves meaningful UI states.

## Accidental Complexity

Look for wrappers that only rename APIs, configuration with no current consumer,
abstractions costlier than bounded duplication, and compatibility layers
unsupported by any public path. Do not flag framework adapters, public library
boundaries, or configurability required by a current variant.

Trace real callers and tests. Report only credible comprehension, modification,
or defect cost; size alone is not proof.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Knowledge Duplication And Component Ownership

Read this card when the scope repeats public behavior or theme rules, introduces
competing names, or moves behavior across components and utilities.

## Knowledge Duplication

Look for the same public contract, controlled-state rule, accessibility rule,
token mapping, or validation in more than one owner; constants that must change
together; and code, tests, stories, or docs that disagree on one rule.

Do not flag repeated syntax, small local setup, intentionally independent
components, or duplication safer than a premature shared abstraction.

## Ownership

Look for design-system decisions in generic utilities, one component reaching
into another component's internals, shared services accumulating unrelated UI
behavior, and types that erase meaningful public states or invariants.

Search the exact rule and consumers before reporting. Name the single component,
hook, theme, or public boundary that should own the knowledge.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Change Propagation And Dependency Direction

Read this card for public contracts, cross-component changes, dependency
direction, cycles, or unexpectedly broad consumer blast radius.

## Change Propagation

Look for one contract encoded in unrelated components, a local change forcing
coordinated edits elsewhere, consumers depending on undocumented event order or
rendered shapes, and public props that leak animation, native, or theme setup.

Do not flag coordinated edits inside one component boundary, an intentional
stable public API, or explicitly scoped migration work.

## Dependency Direction

Look for cycles, internal imports bypassing component barrels, stable shared
source depending on volatile component details, public types coupled to
implementation libraries, and interfaces whose consumers implement unused
methods. Do not flag composition roots, explicit adapters, or stable facades.

Inspect public exports, static consumers, import edges, declarations, and tests.
Explain which consumer breaks or becomes coupled; file count is not a finding.
Loading
Loading