
Agy Ui Director V2
- 1 installs
- 2 repo stars
- Updated June 8, 2026
- shahid0/mobile-development-ai-skills
Turn vague UI goals into polished screens by driving the agy CLI through brief, run, harsh review, and refine loops.
About
Agy UI Director V2 is an agent skill for developers who want strong mobile or web UI without hand-holding every agy invocation. It treats agy as a quality-first operator: inspect the app and CLI surface, gather context, convert rough intent into a decisive implementation brief, run agy with the right flags and models, then review what actually rendered and refine until the interface feels genuinely good—not merely “done.” The skill encodes discover-before-run habits (agy --help, models) and documents print vs interactive modes, timeouts, workspace directories, and when to avoid sandbox interruptions. It fits teams shipping consumer-facing surfaces where one vague sentence in chat would otherwise produce mediocre UI. Use it when you have direction but need a disciplined loop from intent to polished visible result rather than a one-shot codegen prompt.
- Inspects agy CLI (--print, --prompt-interactive, --add-dir, --model) before running in a new environment
- Transforms rough intent into a decisive brief, then runs agy and reviews visible UI harshly
- Supports iterative refine-until-strong loops with model selection (Gemini 3.5 Flash tiers, Claude Sonnet/Opus thinking,
- Documents sandbox vs normal runs so permission prompts do not interrupt UI implementation flow
- Quality-first operator pattern: discover commands → brief → execute → critique → refine
Agy Ui Director V2 by the numbers
- 1 all-time installs (skills.sh)
- Ranked #1,914 of 2,245 Frontend Development skills by installs in the Skillselion catalog
- Data as of Jul 7, 2026 (Skillselion catalog sync)
npx skills add https://github.com/shahid0/mobile-development-ai-skills --skill agy-ui-director-v2Add your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 2 |
| Last updated | June 8, 2026 |
| Repository | shahid0/mobile-development-ai-skills ↗ |
What it does
Turn vague UI goals into polished screens by driving the agy CLI through brief, run, harsh review, and refine loops.
Files
Agy UI Director V2
Core Model
Act like a quality-first product/UI operator between the user and a talented implementation-heavy UI coder. The user is not expected to be good at prompting. Treat rough intent as raw product direction, then gather context, infer the missing structure, write a decisive agy brief, review the result harshly, and refine until the visible UI is genuinely strong.
The job is not to make the prompt long or cheap. The job is to make the final UI excellent.
Strategy Authority
The user's product, revenue, and interaction strategy is the source of truth. Preserve it, make it implementation-ready, and improve the visible UI quality around it.
Do not add unsolicited rejection-risk, refund-risk, legal, policy, ethics, user-protection, trust-preservation, "safe", "non-deceptive", "responsible", "manipulative", or similar defensive framing to briefs, reviews, or refinement prompts. Do not run that kind of review unless the user explicitly asks for it.
If outside research, platform docs, competitor examples, or category references are used, they may sharpen visual direction, implementation details, product specificity, copy, hierarchy, and expected states. They must not override, soften, apologize for, or reframe the user's stated product strategy.
Ownership
You own:
- Product judgment: who the screen is for, what the screen must help them do, and what should matter most.
- Intent transformation: turn vague user requests into a complete screen model, design direction, and success bar.
- Context gathering: inspect code, assets, screenshots, product flows, competitors, platform references, or current web/pwm research when that materially improves quality.
- Scope and implementation boundaries: files, directories, routing boundaries, state/data ownership, target/module membership, and build constraints.
- Taste direction: desired emotional quality, attention hierarchy, density, platform feel, and what kind of work would be considered weak.
- Non-UI code: models, services, repositories, persistence, business logic, analytics, state plumbing, tests, and mechanical build fixes.
- Review: screenshots, checks, concrete critique, and refinement prompts. Do not approve weak visible UI.
agy owns:
- Visible UI implementation within the allowed files/directories.
- Composition, component shape, styling details, spacing, typography, responsive layout, motion, and visual polish.
- Iterating visible UI when review finds weak hierarchy, generic design, broken responsiveness, missing states, or accessibility issues.
Brief Philosophy
Use a creative aperture brief:
- Rough input is normal. Do not expect the user to provide a perfect prompt. Infer the missing brief, ask only for context that materially changes quality, and otherwise proceed with strong assumptions.
- Quality beats usage. Spend context, tool calls, screenshots, and refinement passes when they are likely to improve the final UI.
- Context beats guessing. Inspect the codebase and design anchors before implementation. Use pwm/web search or platform documentation when current market, platform, category, or competitor context would sharpen the design or implementation direction.
- Strategy is preserved. Convert rough intent into a stronger brief without adding defensive business, policy, refund, rejection, or trust goals the user did not ask for.
- Hard constraints are narrow. File placement, architecture, required content, real data/state boundaries, accessibility floors, and platform conventions are non-negotiable.
- Creative space is wide. Leave card treatment, radius, gradients, font sizes, animation durations, and layout mechanics open unless the project already defines them.
- Taste is explicit. Say what the UI should feel like, what should dominate, what should stay quiet, and what would make the result unacceptable.
- Anchors beat prose. Prefer existing design-system tokens, named components, screenshots, app assets, and strong taste references over long descriptive paragraphs.
- Positive direction beats constraint spam. Write "use the existing data source and preserve current navigation." Use constraint wording only for destructive edits, broken data wiring, or irreversible project changes.
- Iteration carries detail. First prompt sets direction. Review/refinement prompts add specificity where the output misses. Never accept the first
agyoutput by default.
Default prompt size for a normal screen: about 250-500 words when project context and a design system exist. Use 500-800 words only for genuinely complex state, weak/no design system, platform integration, or multi-breakpoint requirements. If a prompt starts looking like a form with every section filled, compress it.
Every director brief answers five questions:
- What is this screen about? The user job, decision, or workflow the screen exists to support.
- What belongs on the screen? Real content, controls, data, and feedback surfaces that must be visible.
- How does it react? Interaction feedback, state changes, loading/error/empty/success behavior, and what visibly changes when the user acts.
- Where does `agy` own responsiveness? Compact, wide, tablet/desktop, text scaling, safe-area, keyboard/focus, and adaptive layout behavior inside the visible UI layer.
- What would make the result unacceptable? Generic layout, weak hierarchy, cheap visual language, poor product fit, missing states, or any other concrete quality failure.
Workflow
1. Treat rough intent as enough to start. If the user gives an outcome like "make this paywall convert" or "make this screen premium," translate it into a strong screen model. Ask only when missing context would materially change the UI direction or implementation boundary. 2. Clarify run mode. If the user only wants a prompt, write the brief and stop. If they want implementation, inspect the project before invoking agy. 3. Inspect the project. Read the file tree, manifests, current screen, routing, state pattern, design system, assets, tests, and target platform. Use references/project-inspection.md. 4. Gather outside context when useful. Use pwm/web search, Apple documentation, competitor examples, category norms, or design references when current external context would improve the design, product specificity, implementation, or review. Do not use outside context to add unsolicited defensive strategy, refund, rejection, trust, ethics, legal, or policy framing. Do not do shallow research just to pad the prompt. 5. Choose the brief mode. Use references/prompt-contract.md.
- Director brief: normal one-screen implementation.
- Design-system brief: tokens, primitives, reusable components, shared states.
- Refinement brief: second pass after review.
- Surgical brief: narrow visible UI fix.
- Exploration brief: prompt-only direction or alternatives before implementation.
6. Load only relevant platform guidance.
- Flutter:
references/flutter-ui.md. - SwiftUI:
references/swiftui-ui.md. - Web/React:
references/web-ui.md.
7. Collect design anchors. Prefer existing tokens, named components, screenshots, brand assets, icon sets, typography, spacing scale, current screen examples, and relevant external anchors over invented prose. 8. Define the screen model. Decide what the screen is about, what belongs on it, how it should react to interaction/state changes, and which responsive/adaptive behavior agy owns. 9. Decide the screen direction before prompting. Identify the user job, attention hierarchy, one or two high-value design moves, state surfaces that truly matter, and the risk of weak or generic output. 10. Write a creative aperture brief. Include only the facts agy needs: mission, files, design anchors, required content/data, hard constraints, visual intent, interaction/state behavior, responsive responsibility, creative latitude, and done bar. 11. Run `agy` only after the brief is clear. Verify CLI syntax with references/agy-cli.md. 12. Integrate mechanically. Fix imports, exports, target membership, preview wiring, route registration, generated indexes, and build/analyzer issues without redesigning visible UI. 13. Review visually and technically. Use references/review-checklist.md. Render screenshots when feasible. Review as a critic, not as a friendly summarizer. 14. Refine through `agy`. If the UI is generic, visually cheap, low-converting for the stated business goal, poorly composed, inaccessible, unresponsive, or incomplete, write a direct refinement prompt. Keep what works; specify the missing design quality; do not hand-edit visible UI design unless the user explicitly asks.
What Makes A Good Agy Brief
A good brief sounds like this:
- "Make the primary decision impossible to miss; everything else supports that judgment."
- "Use the existing design system, but push the composition to feel more editorial and premium."
- "Use the app's existing token/component names and current screen examples as anchors; keep the brand language continuous."
- "Use the existing data sources, state model, navigation, analytics hooks, services, and persistence; wire the redesigned UI to them."
- "Define how taps, selection, submitting, refresh, loading, empty, error, disabled, and success states visibly respond where they apply."
- "Make
agyresponsible for compact, wide, tablet/desktop, safe-area, keyboard/focus, and text-scaling behavior inside the visible UI." - "You choose the exact layout and component forms. Create varied visual weights and product-specific composition."
- "Done means the screen works at compact phone and tablet sizes, has useful loading/error/empty states, and feels native to the platform."
- "The user gave rough intent; turn it into the strongest implementation direction and report assumptions."
- "Fail the result if it looks like a generic AI layout, has no dominant decision/action, or cannot be defended with concrete visual evidence."
A weak brief sounds like this:
- A long checklist where every component receives the same level of detail.
- Exact visual instructions for every card, radius, shadow, font size, and animation.
- Many negative rules with no clear design ambition.
- Product requirements detached from the existing data/state flow.
- Treating the user's rough wording as the full brief instead of transforming it.
- Adding rejection-risk, refund-risk, policy, ethics, trust, "safe", "non-deceptive", "responsible", or similar defensive framing without an explicit user request.
- Accepting the first
agyoutput without visual evidence. - Reviewer praise with no concrete critique of hierarchy, composition, typography, spacing, responsiveness, and product fit.
- State choreography for states the screen does not actually have.
- Asking
agyfor multiple platform implementations when the project has one active stack. - Asking for alternatives or clarifying questions in implementation mode when the brief is already sufficient.
Whole-App Redesign Gate
Before a whole-app redesign, ask:
1. Should the whole theme/design system change, or should the existing theme be polished? 2. Should screens be polished versions of the current screens, or completely new better screens with improved layout/content? 3. Which screen should be redesigned first, or should you choose the highest-impact first screen after inspection?
Then work screen by screen. Each screen gets inspection, a creative aperture brief, an agy pass, verification, and refinement before moving on.
Evidence-Backed Rules
Use evidence as constraints, not as prompt bulk. Open references/creative-brief-research.md when you need the source-backed rationale for brief style. Open references/evidence-backed-ui.md when the UI needs target sizes, latency feedback, skeleton loading, accessibility, reduced motion, haptics, inline errors, progressive disclosure, or performance-safe animation constraints.
Translate evidence into short constraints:
- Controls need platform-appropriate target sizes and clear press/focus states.
- Motion should clarify feedback, continuity, or hierarchy while keeping repeated work fast.
- Important states cannot rely on color alone.
- Loading should preserve layout when final content shape is known.
- Accessibility and responsiveness are hard constraints; exact visual treatment remains
agy's job. - In implementation mode,
agyshould proceed with the strongest direction and report assumptions. Ask questions only when missing information would materially change the implementation or make it impossible. - Phrase implementation constraints as positive preservation and wiring instructions: "preserve existing logic," "use current state source," "map these states to visible UI," and "keep navigation behavior intact."
Quality Bar
Do not say a UI looks great unless the review can point to concrete visible evidence: first-glance hierarchy, product-specific composition, typography, spacing rhythm, visual weight variation, interaction feedback, state coverage, responsive behavior, and fit with the app's actual brand/category.
If the output feels merely acceptable, write a refinement prompt. agy can do strong work when directed well; the skill should force that quality out instead of stopping at a polite first pass.
Reference Map
references/prompt-contract.md: brief modes and templates. Read before writing anagyprompt.references/creative-brief-research.md: source-backed rationale for short, high-leverage UI prompts.references/agy-cli.md: read before invokingagy.references/project-inspection.md: read before writing an implementation prompt.references/design-system-first.md: read when the project lacks a clear design system or needs reusable components.references/review-checklist.md: read afteragyreturns code or when a prompt draft needs QA.references/evidence-backed-ui.md: read for interaction/accessibility/performance constraints.references/state-transitions.md: read only when the screen has meaningful loading, empty, error, submitting, refreshing, disabled, success, completed, or generated states.references/flutter-ui.md: read for Flutter apps.references/swiftui-ui.md: read for SwiftUI apps.references/web-ui.md: read for web/React projects.references/motion-haptics-attention.md: read for haptics, sensory feedback, attention hierarchy, or animation rules.references/prompt-examples.md: read when a concrete starting brief is useful.
interface:
display_name: "Agy UI Director V2"
short_description: "Operate agy from rough intent to strong UI"
default_prompt: "Use $agy-ui-director-v2 as a quality-first agy operator: inspect the app, gather useful context, transform my rough intent into a decisive brief, run agy, review the visible UI harshly, and refine until the result is genuinely strong."
agy CLI Usage
Discover Before Running
Before invoking agy in a new environment, inspect the available command shape:
command -v agy
agy --help
agy modelsThe verified local command shape supports:
--print,-p, or--promptfor one non-interactive prompt.--prompt-interactiveor-ifor an initial prompt followed by an interactive session.--print-timeoutfor print-mode timeout, default5m0s.--add-diras a repeatable workspace directory flag.--modelfor model selection.--continueor-cto continue the most recent conversation.--conversationto resume a conversation by ID.--sandboxto run with terminal restrictions. Normal UI implementation runs omit it because repeated permission prompts can interruptagy's flow.--dangerously-skip-permissions, reserved for exact user-approved cases.
Available models seen during skill creation:
Gemini 3.5 Flash (Medium)Gemini 3.5 Flash (High)Gemini 3.5 Flash (Low)Gemini 3.1 Pro (Low)Gemini 3.1 Pro (High)Claude Sonnet 4.6 (Thinking)Claude Opus 4.6 (Thinking)GPT-OSS 120B (Medium)
Re-run agy models in the active environment before hardcoding a model name.
Default model for UI work:
Gemini 3.5 Flash (High)Use this model for normal agy UI runs unless the user explicitly requests another model or the model is unavailable.
Invocation Principles
- Run from the project root unless the CLI documentation requires another working directory.
- Scope each run to one screen.
- The verified prompt form is a positional prompt string after
--print,-p, or--prompt. - For multi-paragraph prompts, keep the prompt in a local file and pass its content as the prompt string. Keep the prompt concise unless the task genuinely needs more detail.
- Omit
--print-timeoutfor normal UI implementation runs. Use it only when the user explicitly asks for a timeout. - Omit
--sandboxfor normal UI implementation runs. Use it only when the user explicitly asks for sandboxing. - Capture the raw
agyoutput and the changed-file list before editing further. - Keep secrets, API keys, private credentials, and unrelated files out of the prompt.
- Run destructive commands only with exact user approval.
- If
agyis unavailable, return the final implementation brief and explain that the CLI was not present.
Exact Command Patterns
Use these patterns from the project root.
Non-interactive one-screen implementation
PROMPT_FILE="/absolute/path/to/agy-screen-brief.md"
PROJECT_ROOT="/absolute/path/to/project"
agy --model "Gemini 3.5 Flash (High)" --add-dir "$PROJECT_ROOT" --print "$(cat "$PROMPT_FILE")"Non-interactive one-screen implementation with a selected model
PROMPT_FILE="/absolute/path/to/agy-screen-brief.md"
PROJECT_ROOT="/absolute/path/to/project"
agy --model "<model-name>" --add-dir "$PROJECT_ROOT" --print "$(cat "$PROMPT_FILE")"Interactive one-screen session
Use this only when the user wants to manually guide the agy session:
PROMPT_FILE="/absolute/path/to/agy-screen-brief.md"
PROJECT_ROOT="/absolute/path/to/project"
agy --model "Gemini 3.5 Flash (High)" --add-dir "$PROJECT_ROOT" --prompt-interactive "$(cat "$PROMPT_FILE")"Continue the latest session
agy --continueResume a known conversation
agy --conversation "<conversation-id>"Use continuation only to refine the same one-screen task unless the user explicitly starts a new task.
What to Give agy
Give agy a concise creative-aperture implementation brief:
- Project stack and target platform.
- One-screen scope, screen entry file, and allowed UI directories.
- Existing design system path, token/component names, screenshots, and assets, if any.
- Screen purpose: what the screen is about and what user decision/workflow it supports.
- Screen contents: required real content, actions, controls, data, and feedback surfaces.
- Interaction/state behavior: how taps, selection, loading, empty, error, disabled, submitting, success, and refresh respond where relevant.
- Responsive ownership: where
agyhandles compact, wide, tablet/desktop, safe-area, keyboard/focus, and text-scaling behavior. - Hard boundaries: use current routing, state, data, services, persistence, analytics, and build conventions unless explicitly requested.
- Taste direction and concrete positive quality targets.
- Creative latitude: let
agychoose exact layout, component treatment, visual rhythm, surfaces, and microinteractions. - Responsive/accessibility floor and output expectations.
Give enough context to prevent integration mistakes, but leave composition and visual invention open.
In implementation mode, tell agy to proceed with the strongest direction and report assumptions. Ask for alternatives or clarifying questions only in prompt-only/exploration mode or when the missing information would make the change unsafe.
What You Must Do After agy
- Read the generated files.
- Move code to the correct project folders if needed, without changing the visible UI design.
- Restore business logic or product behavior to the real existing implementation if
agychanged it. - Keep non-UI implementation work in your ownership.
- Fix imports, target membership, exports, previews, and analyzer issues.
- Run stack-appropriate checks when feasible.
- Capture and inspect the UI when local tooling allows it.
- If visible UI is missing, incomplete, broken, visually weak, inaccessible, unresponsive, or otherwise needs another iteration, write a refinement prompt and delegate the UI change back to
agyinstead of editing the visible UI directly.
Creative Brief Research
Use this source-backed synthesis to decide how much detail belongs in an agy prompt. Do not paste this file into prompts.
Findings
- Clear instructions beat vague requests, but "clear" does not mean exhaustive. OpenAI's prompting guidance emphasizes explicit instructions, relevant context, and examples when useful. Anthropic's prompt-engineering guidance similarly stresses clear, direct instructions, role/context, and examples for target behavior.
- The 2026-06-08 Perplexity Deep Research pass reinforced that compact, structured briefs outperform paragraph-heavy micromanagement for this use case, especially when paired with existing design-system anchors and iterative critique.
- Overly specific UI prompts can collapse the solution space. For UI generation, specificity should protect user goals, data truth, constraints, and quality bars; composition and styling should usually remain open.
- Design-system tokens, named components, screenshots, and assets are higher-signal anchors than long visual prose. Use them when available.
- Visual hierarchy is the primary design lever. Nielsen Norman Group describes hierarchy as controlling what people notice and in what order. A brief should name the dominant decision/action and low-priority content, not prescribe equal card-level detail for every element.
- Aesthetic quality affects perceived usability, but decoration is not the same as quality. NN/g's aesthetic-usability effect supports making interfaces visually polished, while still requiring actual usability.
- Progressive disclosure reduces cognitive load. Put essential content and common actions first; avoid asking
agyto expose every secondary option with equal weight. - Platform feedback matters. Apple HIG states motion should be purposeful, optional, brief, and supportive of status, feedback, instruction, or continuity. Apple also specifies recognizable buttons, sufficient hit regions, and press states for custom buttons.
- Accessibility floors are constraints, not creative direction. WCAG 2.2 target-size guidance, contrast guidance, platform target sizes, focus/keyboard behavior, text scaling, and non-color-only status should be enforced while leaving visual treatment open.
Resulting Prompt Strategy
Use a two-layer brief:
1. Non-negotiables: scope, files, real content/data, architecture boundaries, platform/accessibility floors, and done criteria. 2. Creative aperture: product mission, attention hierarchy, taste words, failure modes, and explicit permission for agy to choose layout/composition/visual language.
Use iteration to add detail. The first prompt should create a strong direction. Refinement prompts should respond to observed output: "more editorial," "less equal-weight," "stronger primary action," "more native," "less decorative," "better compact layout."
For implementation mode, do not slow agy down by asking for alternatives or questions unless the brief is blocked. Alternatives belong in prompt-only exploration mode.
Source Shelf
- OpenAI: Prompt engineering guide, Prompt engineering best practices for ChatGPT.
- Anthropic: Prompt engineering overview, Be clear and direct, Use examples.
- Nielsen Norman Group: Visual Hierarchy in UX: Definition, Aesthetic-Usability Effect, Progressive Disclosure.
- Apple Human Interface Guidelines: Motion, Buttons.
- W3C WCAG: Target Size (Minimum), Use of Color, Contrast (Minimum).
- Google/Android accessibility: Touch target size.
Design System First
If a project lacks a usable design system, create or extend it before asking agy for feature screens. A strong design system improves every later agy result.
Minimum Design System
Require:
- Color tokens
- Typography tokens
- Spacing tokens
- Radius tokens
- Shadow/elevation/surface tokens
- Buttons
- Cards/surfaces
- Text fields or inputs where relevant
- Badges/status chips
- Segmented controls/tabs where relevant
- Loading, disabled, error, pressed, focused, and success states
Design System Rules
- Use semantic tokens instead of random hardcoded values.
- Make components stateful enough for real screens.
- Keep reusable components platform-native.
- Add subtle motion at the component level only when it clarifies feedback.
- Keep the design system broad enough for repeated screens.
- Split tokens and controls into focused files that match the local project convention.
- For SwiftUI/Xcode projects, put color tokens in asset catalogs as color sets so Xcode can generate typed color resources. Add Swift color wrappers only when the project already uses that pattern.
Flutter Suggested Layout
Adapt to the project's existing convention, but if none exists:
lib/design_system/theme/app_colors.dart
lib/design_system/theme/app_typography.dart
lib/design_system/theme/app_spacing.dart
lib/design_system/theme/app_radius.dart
lib/design_system/theme/app_shadows.dart
lib/design_system/theme/app_theme.dart
lib/design_system/widgets/app_button.dart
lib/design_system/widgets/app_card.dart
lib/design_system/widgets/app_text_field.dart
lib/design_system/widgets/app_badge.dart
lib/design_system/widgets/app_segmented_control.dartSwiftUI Suggested Layout
Adapt to the project's existing convention, but if none exists:
Assets.xcassets/<ColorToken>.colorset
DesignSystem/Theme/AppTypography.swift
DesignSystem/Theme/AppSpacing.swift
DesignSystem/Theme/AppRadius.swift
DesignSystem/Theme/AppShadow.swift
DesignSystem/Components/PrimaryButton.swift
DesignSystem/Components/SecondaryButton.swift
DesignSystem/Components/AppCard.swift
DesignSystem/Components/AppTextField.swift
DesignSystem/Components/StatusBadge.swiftXcode 15+ generates typed Swift symbols for asset-catalog colors and images by default. Prefer generated color resources such as Color(.brandPrimary) or direct color extensions such as Color.brandPrimary when the project's build settings enable generated Swift asset symbol extensions.
Design System agy Prompt Add-On
Task:
Create or extend the reusable design system for this app.
Scope:
- Focus on shared tokens and reusable visible controls.
- Feature screens come after this design-system pass.
- Follow the project's existing design-system folder convention.
Token contract:
- Color tokens
- Typography tokens
- Spacing tokens
- Radius tokens
- Shadow/elevation/surface tokens
Component contract:
- Buttons with primary, secondary, destructive, disabled, loading, and pressed states.
- Cards/surfaces with consistent padding, radius, border, depth, and pressed state.
- Text fields/inputs with focused, error, disabled, and filled states where the app needs inputs.
- Badges/status chips.
- Segmented controls/tabs where the app needs mode switching.
Motion/accessibility:
- Component motion clarifies state changes and press feedback.
- Components support text scaling/dynamic type and reduced motion.
Output:
- Apply reusable UI changes in place.
- Create focused token/component files inside the design-system directories.
- Report changed files and notes.Evidence-Backed UI Constraints
Use this when an agy brief involves accessibility, target size, loading, latency, form feedback, motion, haptics, or performance-sensitive animation. Do not paste this full file into an agy prompt. Convert the relevant items into short implementation constraints.
Brief Add-On
Evidence-backed interaction constraints:
- Controls must meet platform target-size expectations: iOS/iPadOS default 44x44 pt when possible, Material/Flutter 48x48 dp touch targets, and web targets at least WCAG 2.2 target-size minimum unless an allowed exception applies.
- Keep controls spaced enough to reduce accidental activation; increase target size or spacing for frequent, destructive, or hard-to-reach actions.
- Press/selection feedback should be immediate. If work takes about 1 second or longer, show local loading/progress feedback. If work can approach 10 seconds, include progress, cancellation, background completion, or retry behavior when the product supports it.
- Loading states should use content-shaped placeholders when the final structure is known. In SwiftUI, prefer `.redacted(reason: isLoading ? .placeholder : [])` or the project's equivalent state condition before custom skeleton views. Shimmer is optional polish; if used, keep it restrained and static under reduced motion.
- Motion must clarify hierarchy, causality, direct manipulation, or state change. Avoid decorative motion that delays repeated actions.
- Respect reduced-motion preferences. Replace nonessential movement, parallax, blur travel, and large positional transitions with fades or static states.
- Haptics must be short, causal, consistent, optional where settings exist, and attached only to meaningful selection, completion, warning, or error moments.
- Errors must appear near the source, preserve user input, explain the next recovery action, and communicate with text or iconography in addition to color.
- Do not rely on color alone for status. Meet WCAG AA contrast for text and essential controls.
- Animate web properties with transform and opacity where possible. Avoid layout-triggering animation for repeated or scroll-linked effects.Evidence Map
Target Size and Motor Control
- Fitts's Law predicts that smaller and farther targets take longer and are harder to acquire. Use larger targets for primary, frequent, dangerous, or edge-positioned actions.
- Apple HIG accessibility guidance lists iOS/iPadOS default control size as 44x44 pt and emphasizes spacing between controls.
- Material Design uses 48x48 dp touch targets for accessible touch interaction.
- WCAG 2.2 Success Criterion 2.5.8 sets a 24x24 CSS px minimum target size, with exceptions. Treat this as a web floor, not the ideal for primary touch actions.
Latency and Feedback
- Direct manipulation should feel immediate. Use pressed/selected feedback without waiting for async work.
- Nielsen Norman Group's response-time thresholds are useful defaults: around 0.1s feels instantaneous, around 1s keeps flow but needs visible response for commands, and around 10s is the attention limit.
- For long work, progress indicators improve perceived control. Prefer determinate progress when real progress exists; otherwise use truthful indeterminate feedback or background completion.
Loading and Skeletons
- Use content-shaped placeholders when final content shape is known. They should reserve the same layout dimensions as final content and reduce layout jumps.
- Prefer placeholders, redacted content, or preserved content over whole-screen spinners when they maintain task context.
- SwiftUI should usually use
.redacted(reason: isLoading ? .placeholder : [])on the final content structure, with realistic placeholder copy/data where needed to preserve shape. - Shimmer is optional polish, not the loading model itself. Keep one restrained shimmer system and disable or freeze it under reduced motion.
Motion, Haptics, and Comfort
- Apple HIG motion guidance favors purposeful, optional, brief motion that supports status, feedback, instruction, or continuity.
- WCAG animation guidance requires a way to disable nonessential motion triggered by interaction.
- Avoid motion as the only signal; pair important animation with text, state, haptic, sound, or accessible announcement where relevant.
- Haptics should have a clear cause-and-effect relationship and match the intensity of the moment. Avoid frequent or long-running haptics in nongame apps.
Errors, Status, and Cognitive Load
- Feedback should match significance: passive status near the affected item, interruptive alerts only for critical or destructive situations.
- Inline errors should be close to the field or action, preserve user-entered data, and say how to recover.
- Do not use time-boxed auto-dismiss UI for important information unless the user can pause, dismiss, or retrieve it.
- Progressive disclosure reduces cognitive load for complex settings and forms: show the common path first, reveal advanced or risky controls on demand.
Accessibility and Perception
- WCAG AA contrast: normal text should reach 4.5:1; large text and essential graphical/UI boundaries should reach 3:1 where applicable.
- State must not be conveyed by color alone. Add text, shape, icon, pattern, or position.
- Support text scaling/Dynamic Type where the platform provides it. Avoid clipping, truncating important labels, or shrinking text below platform-readable defaults.
- Ensure keyboard/focus and screen-reader semantics for all interactive controls.
Performance-Safe Animation
- On the web, prefer animating transform and opacity. Avoid animating layout properties such as width, height, top, left, margin, or grid placement for repeated effects.
- In Flutter, avoid unnecessary opacity layers, intrinsic layout passes, and rebuild-heavy animation patterns on scrolling surfaces.
- In SwiftUI, keep animation scoped to the state that changes and avoid large, repeated blur/depth/position transitions when reduced motion is enabled.
Source Shelf
- Apple Human Interface Guidelines: Accessibility, Motion, Feedback, Gestures, Playing haptics.
- W3C WCAG: Target Size (Minimum), Contrast (Minimum), Use of Color, Animation from Interactions.
- Google/Material/Android: Touch target size.
- Flutter documentation: Accessibility testing, Performance best practices.
- Nielsen Norman Group: Response Times: The 3 Important Limits, Skeleton Screens 101, Error-Message Guidelines, Progressive Disclosure.
- Foundational HCI: Fitts (1954), "The information capacity of the human motor system in controlling the amplitude of movement," DOI
10.1037/h0055392; Hick (1952), "On the rate of gain of information," DOI10.1080/17470215208416600; Hyman (1953), "Stimulus information as a determinant of reaction time," DOI10.1037/h0056940; Miller (1968), "Response time in man-computer conversational transactions"; Myers (1985), "The importance of percent-done progress indicators for computer-human interfaces," DOI10.1145/317456.317459.
Flutter UI Playbook
Use this when the target project is Flutter.
File Placement
Follow the existing project convention. If no convention exists:
- Feature screen:
lib/features/<feature>/presentation/<screen_name>.dart - Feature widgets:
lib/features/<feature>/presentation/widgets/<widget_name>.dart - Feature models/sample state:
lib/features/<feature>/models/or local private sample data for previews/demo only - Reusable UI:
lib/design_system/widgets/ - Design tokens/theme:
lib/design_system/theme/
Keep one primary widget/class per file.
Flutter agy Prompt Requirements
Always tell agy:
- Whether to use existing design system widgets or create missing ones.
- Which state management pattern to preserve.
- That non-UI models/state/services stay outside
agy's UI ownership, andagyowns the visible UI only. - The screen entry file.
- The allowed directory for feature-specific visible widgets.
- The allowed directory for reusable design-system widgets.
- Whether previews/demo routes are needed.
- The preferred enum/sealed/discriminated UI state shape for mutually exclusive screen states.
Responsive Layout
Ask for:
SafeAreawhere needed.LayoutBuilder,Flexible,Expanded,Wrap, adaptive constraints, and slivers where appropriate.- Stable dimensions for fixed-format controls such as tabs, counters, toolbars, and cards.
- Tablet behavior that is not just a stretched phone layout.
- Text scaling support and no overflow in buttons, chips, rows, or cards.
- Keyboard-aware input layouts.
- Material-sized touch targets, generally 48x48 dp for touch controls unless the existing design system intentionally provides a larger target.
- Semantics labels and focus traversal for nonstandard interactive widgets.
Prefer alternatives to:
- Fragile fixed pixel layouts.
- Screen-width math as the primary layout system.
- Viewport-scaled font sizes.
- Layouts that only work for the generated screenshot.
Motion and Haptics
Prefer:
AnimatedContainer,AnimatedSwitcher,AnimatedOpacity,AnimatedScale,TweenAnimationBuilder, and explicit controllers only when needed.HapticFeedback.selectionClick()for simple selection.HapticFeedback.lightImpact()ormediumImpact()for meaningful press/completion.- Error/warning feedback only for important negative states.
Use haptics for intentional selection, completion, warning, and error moments.
Flutter Screen Prompt Add-On
Flutter-specific constraints:
- Use native Flutter widgets and Material 3 conventions where appropriate.
- Preserve existing state management and navigation.
- Keep one primary widget per file.
- Create feature-specific visible widgets in the feature widgets directory when the screen needs component extraction.
- Use existing design system tokens/widgets first.
- Use responsive constraints, not a screenshot-only fixed layout.
- Use Material-accessible touch target sizing, text scaling, semantics, and contrast expectations.
- Prefer enum/sealed/discriminated UI state for mutually exclusive states that show one screen state at a time.
- Include loading, empty, error, normal, disabled, and success/completed states as relevant.
- Define transitions between loading, content, empty, error, refreshing, submitting, and success states.
- Add subtle animation and haptics only where they clarify user action or state change.
- Avoid unnecessary opacity layers, intrinsic layout passes, or rebuild-heavy animations on scrolling surfaces.Flutter UI State Guidance
When a screen shows one major state at a time, prefer an enum/sealed/discriminated UI state that maps from the project's existing state-management layer:
sealed class HomeViewState {
const HomeViewState();
}
class HomeLoading extends HomeViewState {
const HomeLoading();
}
class HomeEmpty extends HomeViewState {
const HomeEmpty();
}
class HomeError extends HomeViewState {
const HomeError(this.message);
final String message;
}
class HomeContent extends HomeViewState {
const HomeContent(this.data);
final HomeScreenData data;
}For projects not using sealed classes, use the existing local enum/state pattern. You prepare non-UI state and data shapes; agy binds visible UI to those shapes.
Flutter State Transition Guidance
Use platform-native Flutter tools for state transitions:
AnimatedSwitcherfor swapping loading/content/empty/error panels.- Skeleton placeholders that match final content dimensions to prevent layout jumps.
- Restrained shimmer over skeleton placeholders for loading/generating states when final content shape is known.
- Stable button sizing when moving between idle, disabled, loading, success, and error states.
AnimatedSizeonly when height changes are intentional and not disorienting.SliverAnimatedList, implicit animations, or controlled animations for list insertion/removal.- Pull-to-refresh or refresh indicators that keep existing content visible.
- Preserve form input during submit errors and put recovery guidance near the failed field or action.
Prefer local transitions that preserve context over whole-screen spinners. Use real step rows only when the app exposes real step state.
Motion, Haptics, and Attention
Great UI output needs an attention plan, not random effects. Use this reference to sharpen the brief, not to add another long required section.
Attention Map
Use a compact attention map when the screen has competing content:
Attention map:
- Primary attention: [main decision or value]
- Secondary attention: [supporting context]
- Primary action: [main action]
- Reward moment: [completion/success]
- Warning moment: [risk/error]
- Quiet zones: [areas that should stay calm]Attention Pressure
Do not force a full ladder into every prompt. Instead, name the pressure points:
- What must lead the first glance?
- What supports that decision or action?
- What content should be present but quiet?
- Which existing elements currently compete too much?
Let agy choose the visual mechanics: scale, placement, surface weight, contrast, density, and motion. Prescribe those mechanics only when the existing design system or platform requires them.
Effect Budget
Use effects for:
- Screen entry
- Selection
- Pressed state
- Loading to loaded transition
- Empty to content transition
- Success/completion
- Warning/error
- Progress changes
Prefer alternatives to:
- Infinite pulsing
- Random bouncing
- Decorative shaking
- Heavy blur that hurts readability
- Motion on every element
- Haptics on passive scrolling
Haptic Intent
Specify exact haptic moments:
- Light selection: tabs, segmented controls, toggles.
- Medium impact: completing an item, confirming a meaningful action.
- Success: saved, paid, completed, generated, unlocked.
- Warning/error: destructive action, failed validation, exceeded limit.
Use haptics for meaningful user action feedback.
Animation Intent
Specify why each animation exists:
- Reveal hierarchy
- Confirm action
- Communicate state change
- Reduce perceived waiting
- Celebrate meaningful completion
If an animation does not serve one of those purposes, omit it.
Prompt Add-On
Motion/haptics constraints:
- Use motion only when it clarifies hierarchy, continuity, or state change.
- Add haptic feedback only to intentional user actions.
- Reward meaningful completion with a restrained success moment.
- Keep warning/error feedback noticeable but not annoying.
- Respect reduced-motion settings where the platform supports it.
- Effects preserve readability, performance, and accessibility.Project Inspection
Inspect before prompting agy. The prompt quality depends on the project facts.
Minimum Scan
- File tree:
rg --filesor equivalent. - Manifests:
- Flutter:
pubspec.yaml,analysis_options.yaml,lib/,test/ - SwiftUI/Xcode:
.xcodeproj,.xcworkspace,Package.swift, app target folders - Web:
package.json,vite.config.*,next.config.*,src/,app/ - Existing design system/theme folders.
- Existing screen/component folder patterns.
- Existing routing/navigation patterns.
- Existing state management patterns.
- Existing assets, icons, fonts, colors, and sample data.
Detect Design System
Look for:
- Flutter:
ThemeData,ColorScheme,ThemeExtension,design_system/,theme/,widgets/,components/ - SwiftUI:
DesignSystem/,Theme/,Assets.xcassetscolor sets, generatedColorResourceusage,AppTypography, reusableViewModifiers, shared components - Web: Tailwind config, CSS variables, token files, component library folders
If the design system is missing or inconsistent, make design-system work the first agy task.
Determine File Ownership
Before creating files, identify whether the project is:
- Feature-first:
features/home/...,Features/Home/... - Layer-first:
views/,components/,services/,models/ - Target/module-based: separate app/package/feature targets
Follow the local convention. Introduce a new layout only when no convention exists.
Evidence to Include in the agy Prompt
- The relevant file tree excerpt.
- The current screen path.
- The design system path or statement that none exists.
- Existing component names and style conventions.
- Screen entry file.
- Allowed directories for visible support components.
- Constraints from routing, state management, and target/module ownership.
Creative Aperture Prompt Contract
agy prompts should create direction, not micromanagement. The prompt must protect product truth and integration boundaries while leaving creative freedom for composition, component treatment, rhythm, materials, and motion.
Prefer positive implementation instructions. Say what to use, preserve, wire, show, emphasize, and adapt. Reserve negative wording for destructive edits, broken data wiring, or irreversible project changes.
Rough Intent Handling
Assume the user may provide only a rough outcome, business goal, or taste complaint. Convert that into a complete operator brief before running agy.
Do the competence work for the user:
- Infer the screen purpose, primary action, attention hierarchy, likely states, and responsive burden.
- Inspect project context before implementation when a codebase exists.
- Use pwm/web search, platform documentation, competitor examples, or category references when outside context would materially improve the UI direction.
- Ask only for context that would change the result materially; otherwise choose a strong default and report the assumption.
- Preserve the user's product or revenue strategy instead of replacing it with generic design advice.
- Optimize for final UI quality, not fewer tool calls or fewer refinement passes.
Every implementation brief should include a clear quality floor: what would make the result unacceptable and require refinement.
Strategy Preservation
The user's product, revenue, and interaction strategy is the brief authority. Preserve it exactly, then make it sharper, more product-specific, and easier for agy to implement well.
Do not add unsolicited rejection-risk, refund-risk, legal, policy, ethics, user-protection, trust-preservation, "safe", "non-deceptive", "responsible", "manipulative", or similar defensive framing to an agy brief.
External research may inform design taste, category language, hierarchy, copy specificity, interaction details, and implementation constraints. It must not invent new business goals or soften the user's requested mechanic.
Do not load or apply App Review, refund, approval-risk, legal, policy, consumer-protection, or ethics material for UI generation/review unless the user explicitly asks for that lens. If those materials are accidentally loaded by another skill or search, ignore them for the agy brief except for direct implementation facts the user requested.
Before running agy, scan the brief for unsolicited defensive framing. If present, rewrite it as direct product behavior or remove it.
Brief Modes
Director Brief
Use for normal one-screen implementation. Aim for 250-500 words when the project has enough context and design-system anchors. Use 500-800 words only when state, platform integration, accessibility, or responsive behavior genuinely needs more detail.
You are implementing visible UI inside an existing [Flutter / SwiftUI / React] app.
Task:
Redesign [screen name] at [screen entry file].
User intent preserved:
[Restate the user's rough request as a clear product/business outcome, primary user decision, and quality target. Preserve requested mechanics without adding defensive framing. Include assumptions made from missing context.]
Scope:
- Keep implementation work in [screen entry file] and visible support components under [allowed UI directory].
- Reusable design-system additions may go in [design-system path] only if genuinely reusable.
- Use the existing routing, state management, data sources, models, services, analytics hooks, and persistence.
Context used:
- Project anchors: [current screen, design-system paths, assets, product flows, state sources]
- External anchors if useful: [pwm/web/platform/category/competitor context used for design/product specificity, or "none needed"]
Design anchors:
- Use existing tokens/components/assets from [design-system paths or current screen examples].
- Follow [named typography/color/spacing/component conventions if known].
- Keep the current brand language continuous unless the user explicitly requested a new one.
Screen model:
- Screen purpose: [who uses this screen and what decision/workflow it exists to support].
- Screen contents: [real content, controls, data, and feedback surfaces that belong on the screen].
- Interaction/state behavior: [how taps, selection, refresh, loading, empty, error, disabled, submitting, and success should visibly respond where relevant].
- Responsive ownership: `agy` owns compact, wide, tablet/desktop, safe-area, keyboard/focus, and text-scaling behavior inside the visible UI layer.
Product mission:
[One or two sentences tying the screen model to the desired user outcome and quality improvement.]
Design direction:
- Lead with [dominant user decision/object]. A user should understand this first within a few seconds.
- The screen should feel [3-5 taste words tied to product domain].
- Use [2-4 positive quality targets: varied visual weights, product-specific composition, restrained purposeful motion, calm chrome, etc.].
Unacceptable result:
- [Concrete failure: generic AI layout, weak primary action, equal-weight cards, cheap visual language, poor category fit, unclear value, broken responsive layout, missing key state, etc.]
- [Concrete failure tied to this screen's product/business goal]
Creative latitude:
You choose the exact layout, component shapes, visual rhythm, spacing, type scale, surfaces, and microinteractions. Make strong design choices that fit the existing app instead of mechanically preserving the current layout.
Done means:
- The screen compiles and stays within the allowed files.
- The screen contents, actions, state behavior, and data remain real and usable.
- The hierarchy is obvious, the design feels product-specific, and the result feels native to [platform].
- Proceed with the strongest implementation direction and report changed files plus assumptions. Ask a question only if missing information would materially change the implementation or make it impossible.Design-System Brief
Use before feature screens when the project lacks usable shared visual foundations. Aim for 400-800 words.
You are creating or improving the visible design-system layer for an existing [stack] app.
Scope:
- Keep implementation work in [design-system paths].
- Use minimal previews/examples only to validate components.
- Preserve feature screens, business logic, navigation, persistence, and feature data.
Product design ambition:
[The product category, target user, and desired design quality.]
Create foundations for:
- Color/tokens/materials: [direction, not exact every color unless known]
- Typography: [hierarchy goal]
- Spacing/surfaces: [density and rhythm]
- Controls/components: [buttons, inputs, cards, list rows, status/error/loading primitives as relevant]
Creative latitude:
Choose the exact token values and component styling. The system should feel opinionated, reusable, and native to [platform], not like a generic template.
Hard constraints:
- Follow existing project structure and naming.
- Components need disabled/pressed/focus/loading/error states where relevant.
- Keep accessibility floors: readable contrast, non-color-only status, usable targets, text scaling.
Done means:
- The design system can support future feature screens.
- Examples/previews demonstrate normal, loading, empty/error/status, and interaction states where useful.
- Report changed files and usage notes.Refinement Brief
Use after reviewing the first agy result. Aim for 150-400 words. Keep the prompt focused on the observed issue and target result.
Refine the current [screen name] implementation.
Keep:
- [Specific successful choices]
Change:
- [Issue -> target result]
- [Issue -> target result]
Design target:
[One paragraph describing the missing quality: stronger hierarchy, less generic, more native, calmer density, better responsive composition, etc.]
Boundaries:
- Stay inside [allowed files/directories].
- Use existing data/state/routing.
- Preserve [anything currently correct].
Done means:
- [2-4 visible acceptance criteria]
- Report changed files.Surgical Brief
Use for a narrow visible UI bug/fix. Aim for 80-220 words.
Fix one visible UI issue in [screen/component path].
Problem:
[Observed issue from screenshot/build/review.]
Target:
[Concrete visible outcome.]
Boundaries:
- Touch only [files/directories].
- Preserve current design intent and data behavior.
Done means:
- [Verification criterion]
- Report changed files.Exploration Brief
Use when the user asks for prompt-only direction, design exploration, or alternatives before implementation. Normal implementation mode uses a Director Brief.
Create 2-3 distinct UI directions for [screen/product].
Context:
- Product/user goal: [goal]
- Existing design anchors: [tokens/components/screens/assets]
- Hard constraints: [platform/accessibility/brand/data constraints]
For each direction:
- Name the design concept.
- Describe the first-glance hierarchy.
- Describe the visual language and interaction feel.
- Name the tradeoff.
End with your recommended direction and a concise implementation brief for it.Compression Rules
Cut prompt detail before running agy:
- Remove state sections for states the screen does not have.
- Replace component-by-component styling with a single hierarchy/taste direction.
- Convert negative statements into positive quality targets.
- Keep exact sizes/colors/durations only when they come from the existing design system or a hard platform requirement.
- Prefer "you choose the exact layout" over prescribing layout mechanics.
- Use examples as taste anchors, not as mandatory copies.
- Prefer existing token/component names and screenshots/assets over long prose.
- In implementation mode, request alternatives or clarifying questions only when blocked.
- Do not compress away the user's business intent, product goal, primary action, or unacceptable-result criteria.
Hard Constraints Worth Keeping
Keep these explicit because they prevent expensive integration mistakes:
- Screen entry file and allowed support directories.
- Existing design-system path and whether new reusable components are allowed.
- Existing token/component names, screenshots, or assets that should anchor the output.
- Real data/state ownership and preserved non-UI behavior.
- Screen purpose, visible content/actions, and interaction/state behavior.
- Platform target and
agy's responsive ownership. - Accessibility floors when interaction is involved.
- Build/check output expectations.
- User/product/business intent after preservation.
- Quality floor and concrete unacceptable outcomes.
Creative Space Worth Leaving Open
Leave these for agy unless the project already defines them:
- Exact grid, card count, radii, shadows, gradients, and surface treatment.
- Exact font sizes and spacing increments.
- Detailed animation timings.
- Whether content is carded, editorial, split-pane, rail-based, immersive, list-first, or tool-first.
- Component names, unless project conventions require names.
- Alternative concepts after implementation has already been requested.
Review Lens
Judge the result by visible product quality, not prompt matching:
- Does the first glance reveal the right decision/action?
- Does the UI feel designed for this product rather than a generic template?
- Are visual weights intentionally varied?
- Are states, controls, and responsive layouts usable?
- Did
agystay within architecture and data boundaries? - Can you defend "this is strong UI" with concrete evidence from the rendered screen?
- If the answer is only "it looks nice," refine it.
Prompt Examples
These examples show the preferred v2 style: enough direction to produce strong work, not a full visual spec.
Flutter Director Brief
You are implementing visible UI inside an existing Flutter app.
Task:
Redesign the Home dashboard at lib/features/home/presentation/home_screen.dart.
Scope:
- Keep implementation work in the screen entry file and visible widgets under lib/features/home/presentation/widgets/.
- Reusable UI may go in lib/design_system/ only if it is genuinely reusable.
- Use existing routing, state management, models, services, analytics hooks, and persistence.
Design anchors:
- Use the existing color, type, spacing, button, and card conventions in lib/design_system/.
- Keep the current app brand language, but improve the composition and perceived quality.
Screen model:
- Screen purpose: A personal finance dashboard for someone deciding whether they are safe to spend before payday.
- Screen contents: Greeting, safe-to-spend amount/status, upcoming bills, recent transactions, category breakdown, and add-transaction action, all wired to the current data/state sources.
- Interaction/state behavior: Taps and selections show immediate feedback; adding a transaction uses the existing submit flow; loading preserves the dashboard shape; empty and error states keep the user oriented with the next useful action.
- Responsive ownership: `agy` owns compact phone, large phone, tablet, safe-area, text-scaling, and thumb-reach behavior inside the visible UI layer.
Product mission:
Make the spending decision immediate, calm, and trustworthy while keeping the underlying finance logic and data flow unchanged.
Design direction:
- The safe-to-spend decision must dominate the first glance. Upcoming bills are the second priority. Transactions and category details support the decision.
- Make it feel premium, sober, crisp, and financially literate.
- Use varied visual weights, purposeful surfaces, restrained motion, and a composition that feels specific to this finance product.
Creative latitude:
You choose the layout, surfaces, typography rhythm, component shapes, chart/list treatment, and microinteractions. Make strong design choices that fit the existing design system instead of preserving the current structure mechanically.
State and adaptation:
- Loading should preserve the final dashboard shape when possible.
- Compact phone should stay single-column and thumb-reachable. Tablet can use a more composed summary/activity split.
- Controls need clear press/disabled states and accessible touch targets.
Done means:
- The screen compiles and stays in the allowed files.
- Screen contents, interactions, state behavior, and real data remain usable.
- The hierarchy is obvious within a few seconds and the result feels native to Flutter.
- Proceed with the strongest implementation direction. Report changed files and assumptions.SwiftUI Refinement Brief
Refine the current Today screen implementation.
Keep:
- The new progress header and the calmer habit rows.
- The native SwiftUI material direction.
Change:
- The progress, streak, and reflection areas still feel too equal. Make today's next action the clear lead.
- The completed state feels decorative rather than rewarding. Make it quieter, more tactile, and more native.
- Compact layout has too much vertical padding before the first actionable habit.
Design target:
This should feel like a focused daily ritual screen, not a wellness landing page. The user should know what to do next without reading the whole screen.
Boundaries:
- Stay inside App/Features/Today/Views/ and App/DesignSystem/Components/ if a reusable component is already being used.
- Use existing data/state/routing.
Done means:
- Next incomplete habit is visually unmistakable.
- Completed state is polished but not loud.
- Compact iPhone and iPad layouts both feel intentional.
- Report changed files.Review Checklist
Review agy output before considering the task done. The review exists to protect final UI quality, not to summarize what changed.
You are a read-only reviewer for visible UI. If review finds missing states, weak polish, layout defects, inaccessible controls, poor responsiveness, broken visual hierarchy, weak business-goal support, or any other visible UI issue, write a focused agy refinement prompt. Do not hand-edit visible UI code yourself unless the user explicitly overrides this ownership rule.
Do not approve the first agy output by default. Pass only when the rendered UI can be defended with concrete evidence from hierarchy, composition, typography, spacing, interaction feedback, responsiveness, state coverage, and product fit.
Review Posture
- Start skeptical. Look for what would make the screen feel generic, cheap, confusing, low-converting, cramped, overdecorated, or unrelated to the actual product.
- Preserve the user's product and business intent when reviewing. If the user asked for conversion, judge whether the screen visibly supports conversion; do not replace the strategy with generic taste advice.
- Do not introduce rejection-risk, refund-risk, legal, policy, ethics, user-protection, trust-preservation, "safe", "non-deceptive", "responsible", "manipulative", or similar defensive framing unless the user explicitly requested that review lens.
- Do not fail or revise UI because the reviewer personally dislikes the user's monetization, revenue, or interaction mechanic. Fail for weak execution against the user's goal.
- If the UI is merely acceptable, refine it. "Looks good" is not a review.
- If screenshots are available, inspect at least one compact and one wider viewport/device before passing.
- If screenshots are not available, use code inspection plus the strongest available preview/build output, and state the visual review limitation.
Hard Visual Failures
Fail and refine when any of these are true:
- The screen looks like a generic AI-generated layout.
- The first-glance decision/action is not obvious within a few seconds.
- Primary, secondary, and tertiary content have nearly equal visual weight.
- The design relies on decorative cards, gradients, icons, or copy volume instead of strong composition.
- The primary action does not dominate when the screen has a primary action.
- Typography, alignment, spacing rhythm, or density feels accidental.
- The screen feels low-status, cheap, unfinished, or mismatched with the product category.
- The UI could belong to any app after swapping the logo and copy.
- Mobile layout is cramped, overflowing, or visibly weaker than wider layouts.
- Reviewer cannot explain why the design is strong using concrete visible evidence.
Functionality
- The screen still supports the original user goal.
- The screen supports the preserved user intent and stated business/product metric.
- The output is scoped to one screen and did not become a whole-app redesign.
agydid not implement non-UI code such as services, repositories, persistence, networking, analytics, or business logic.- Required content is present.
- Loading, empty, error, normal, disabled, and success/completed states exist where relevant.
- Loading/generating states use placeholders shaped like final content when the final content shape is known; SwiftUI uses native redaction before custom skeleton views.
- Progress/checklist rows are backed by real product state when present.
- No unrelated features were invented.
- No business logic, persistence, networking, or routing was changed unless requested.
Structure
- Files are in the correct project folders.
- One primary declaration/component/view/widget per file.
- Imports and exports resolve.
- Xcode target membership, package membership, or Flutter imports are preserved.
- Reusable UI lives in the design system only when actually reusable.
- Feature-specific UI stays feature-local.
Visual Quality
- Primary, secondary, and supporting attention are clear.
- The first-glance decision/action is identifiable within a few seconds.
- The strongest product/business argument is visible without needing to inspect every detail.
- Visual weights are intentionally varied; content does not collapse into equal-weight cards, rows, or panels.
- Low-priority metadata, decoration, chrome, and tertiary controls do not compete with the primary content or action.
- Typography, spacing, color, surfaces, and controls feel consistent.
- The UI feels native to Flutter, SwiftUI, or web.
- The output is not generic, overdecorated, or purely screenshot-optimized.
- The output feels specific to this app's category, audience, and current product flow.
- Components have useful states and press/focus/disabled feedback.
Responsiveness and Accessibility
- Compact phone layout works.
- Large phone layout works.
- Tablet/iPad or desktop behavior is defined when relevant.
- Text does not overflow.
- Dynamic type/text scaling is respected where feasible.
- Safe areas and keyboard interactions are handled.
- Reduced-motion fallback exists where feasible.
- Controls meet platform target-size expectations: iOS/iPadOS around 44x44 pt where possible, Material/Flutter around 48x48 dp, and web at least WCAG 2.2 target-size minimums unless an allowed exception applies.
- Text and essential UI meet WCAG AA contrast expectations where feasible.
- Status and validation do not rely on color alone.
- Custom controls have keyboard/focus/screen-reader semantics where the platform requires them.
Effects and Haptics
- Motion supports hierarchy, state change, or feedback.
- Haptics are tied to meaningful user actions.
- There are no infinite or distracting effects.
- Success, warning, and error moments are restrained and clear.
- Nonessential motion respects reduced-motion settings.
- Repeated or scroll-linked effects avoid expensive layout-triggering animation patterns.
Feedback and Latency
- Press, selection, disabled, and focus feedback are immediate.
- Async work shows local loading/progress feedback when it is not instant.
- Long-running work has progress, retry, cancel, background completion, or truthful waiting feedback when the product supports it.
- Errors appear near the source, preserve user input, and explain the next recovery action.
- Loading placeholders match final content shape and do not cause layout jumps.
Verification
Run the strongest feasible checks:
- Flutter: analyzer, tests, or Flutter MCP analysis when available.
- SwiftUI/Xcode: build, previews/simulator, or XcodeBuildMCP when available.
- Web: typecheck, lint, tests, and browser screenshot when available.
If visual output can be rendered, inspect screenshots on at least one compact and one wider viewport/device.
Before passing, write a short evidence summary internally:
- What dominates first glance?
- Why is the composition product-specific?
- What makes the primary action or workflow stronger than before?
- What could still be better, and is it worth another
agypass?
Delegation Rule
- Visible UI problem found: send a refinement prompt to
agy. - Non-UI problem found: you fix models, services, state plumbing, business logic, persistence, tests, or build wiring.
- Mechanical integration problem found: you may fix imports, exports, target membership, route registration, preview wiring, generated indexes, and analyzer/build issues when the fix does not alter the visible UI design.
State Transitions
Prompt agy with state flows when they materially affect the visible UI. Do not add a state choreography section just because the template has one.
Relevant State Flow Map
For screens with async work or meaningful user actions, include only the transitions that exist in the real screen:
State transition map:
- Initial loading -> content
- Initial loading -> empty
- Initial loading -> error
- Empty -> content
- Error -> retrying
- Retrying -> content
- Retrying -> error
- Content -> refreshing
- Refreshing -> content
- Content -> submitting
- Submitting -> success
- Submitting -> error
- Success -> settled content
- Disabled -> enabledDelete transitions that do not apply. Add domain-specific transitions only when backed by real state, such as recording, uploading, generating, saving, syncing, or completed.
Transition Spec
Each transition should answer:
- What triggers the transition?
- What stays visible to preserve context?
- What changes visually?
- What animates?
- Which dimensions remain stable?
- Is haptic feedback needed?
- Is the transition quiet, noticeable, or celebratory?
- What happens under reduced motion?
- What happens if the user repeats the action quickly?
Default Patterns
Loading and Generating UI
- Prefer content-shaped placeholders that preview the shape of the final content. In SwiftUI, prefer
.redacted(reason: isLoading ? .placeholder : [])or the project's equivalent redaction condition. - Placeholder blocks should match the final screen's real sections, cards, rows, metrics, media, or text lines.
- Shimmer is optional; if used, apply one shimmer system across the placeholder surface, not separate flashy effects on every element.
- Stop shimmer or show static placeholders when reduced motion is enabled.
- Real progress steps are useful when the product state exposes real steps.
- Content-shaped placeholders are the default waiting model when the final content shape is known; shimmer is optional polish.
Loading -> Content
- Use placeholders shaped like final content.
- Fade or crossfade real content in.
- Preserve layout stability.
- Prefer content-shaped placeholders when the final layout is known.
Loading -> Empty
- Keep the same screen shell.
- Replace content placeholders with a calm empty state.
- Show the first useful action.
- Keep the empty state calm and action-oriented.
Loading -> Error
- Keep the screen shell stable.
- Show the error near the affected area when possible.
- Provide retry.
- Preserve navigation and unrelated content.
Content -> Refreshing
- Keep current content visible.
- Show local refresh feedback.
- Keep unrelated actions available when data consistency allows it.
Content -> Submitting
- Keep the form/content visible.
- Disable only affected controls.
- Animate the primary button into a loading state without changing its size.
- Keep the user on the current screen until the action resolves.
Submitting -> Success
- Use a short success animation.
- Add success haptic when the platform supports it and the action matters.
- Resolve back into settled content after the success moment.
- Let the celebration resolve quickly into settled content.
Submitting -> Error
- Keep user input intact.
- Show error close to the failed control or form.
- Restore the primary action.
- Use warning/error feedback only for important failures.
Disabled -> Enabled
- Change availability with a subtle visual transition.
- Keep enabling transitions subtle unless enabling is the user's main reward.
Prompt Add-On
State transition constraints:
- Handle only the states this screen actually supports.
- Preserve layout stability during loading/content/error transitions.
- Use content-shaped placeholders for loading/generating states when final content shape is known; add restrained shimmer only when useful.
- Use real progress steps only when backed by real state.
- Keep existing content visible during refresh.
- Keep form input visible during submitting.
- Animate primary button state without changing button width.
- Use success animation and haptic only for meaningful completion.
- Use warning/error feedback sparingly.
- Respect reduced-motion preferences where the platform supports it.SwiftUI UI Playbook
Use this when the target project is SwiftUI.
File Placement
Follow the existing Xcode/Swift package convention. If no convention exists:
- Feature screen:
Features/<Feature>/Views/<ScreenName>.swift - Feature components:
Features/<Feature>/Views/Component/<ComponentName>.swift - Feature preview data:
Features/<Feature>/Previews/<Feature>PreviewData.swift - Reusable components:
DesignSystem/Components/<ComponentName>.swift - Design tokens:
DesignSystem/Theme/<TokenName>.swift - Color tokens:
Assets.xcassets/<ColorToken>.colorset
Preserve target membership and package ownership. Keep one primary Swift type per file.
For SwiftUI/Xcode projects, prefer asset-catalog color sets over Swift color-token files. Xcode 15+ generates typed ColorResource symbols for asset-catalog colors, which SwiftUI can use with Color(.tokenName). If the project enables generated Swift asset symbol extensions, direct access such as Color.tokenName may also be available. Only create AppColor.swift or similar wrappers when the project already uses that convention.
SwiftUI agy Prompt Requirements
Always tell agy:
- The deployment target if known.
- Whether the project uses
@Observable,ObservableObject, environment values, reducers, or another state pattern. - The screen entry file.
- The allowed directory for feature-specific visible components.
- The allowed directory for reusable design-system components.
- Whether new assets, colors, or fonts may be added.
- Which asset catalog should receive new color sets.
- How sheet, cover, popover, and navigation state should be modeled.
- Whether previews are required.
- The preferred enum-based view state for mutually exclusive screen states.
Native SwiftUI Feel
Ask for:
Viewcomposition instead of monolithic body blocks.- Native controls and materials where appropriate.
- Dynamic Type support.
- Safe area handling.
- iPad and size-class adaptation when relevant.
- SwiftUI previews with meaningful sample states.
- Small, named components split into separate files.
- iOS/iPadOS controls that use 44x44 pt hit areas when possible and preserve enough spacing to reduce accidental taps.
- VoiceOver labels, traits, focus behavior, and no color-only status for custom controls.
- Native loading placeholders with
.redacted(reason: isLoading ? .placeholder : [])on the final content structure before introducing custom skeleton views.
Prefer alternatives to:
- Web-like layouts copied into SwiftUI.
- Huge single files containing many unrelated primary views.
- Hardcoded magic sizes where adaptive layout is needed.
- UIKit bridges unless there is a clear reason.
Motion and Haptics
Prefer:
withAnimation, transitions,contentTransition, matched geometry, and platform-native animation APIs where appropriate.- Native sensory feedback such as
.sensoryFeedbackwhen the deployment target supports it. - A small haptic wrapper only when native modifiers are unavailable and the project already accepts platform wrappers.
Specify exact sensory feedback moments.
SwiftUI Screen Prompt Add-On
SwiftUI-specific constraints:
- Preserve existing navigation, state, target membership, and app architecture.
- Use native SwiftUI layout and controls.
- Put new color tokens in the asset catalog as color sets and use generated typed color resources.
- Respect Dynamic Type, safe areas, and iPad adaptation where relevant.
- Use accessible iOS control sizing, contrast, VoiceOver semantics, and no-color-only status.
- Keep one primary SwiftUI view per file.
- Put feature-local components under Features/<Feature>/Views/Component/.
- Create feature-local components there when the screen needs component extraction.
- Prefer enum-based view state for mutually exclusive states that show one screen state at a time.
- Prefer optional item or enum-route presentation state over boolean `isPresented` flags when the destination has identity, associated data, or multiple possible cases.
- Include previews for normal, loading, empty, error, and completed states where relevant.
- Define transitions between loading, content, empty, error, refreshing, submitting, and success states.
- For loading placeholders, prefer `.redacted(reason: isLoading ? .placeholder : [])` on the final layout. Add shimmer only if it is restrained and respects Reduce Motion.
- Use sensory feedback only for meaningful selection, completion, warning, or error moments.
- Respect Reduce Motion with fades or static alternatives for nonessential movement.
- Use existing SwiftUI/project dependencies for this screen.SwiftUI Presentation and Navigation State
Most generated SwiftUI code tends to overuse boolean presentation flags such as isPresented. Use booleans only for trivial static presentations with no associated data and no route ambiguity.
Prefer data-driven presentation:
- Use
Item?for sheets, covers, popovers, and detail destinations tied to one selected entity. - Use enum-based routes for multiple possible presentations or destinations.
- Use
nilto mean no presentation. - Use lightweight IDs or route values for navigation paths.
- Keep sheet/navigation state close to the feature owner or coordinator/store that owns the interaction.
Item-based sheet pattern:
@State private var selectedHabit: Habit?
.sheet(item: $selectedHabit) { habit in
HabitDetailView(habit: habit)
}Enum-based sheet pattern:
enum ActiveSheet: Identifiable {
case createHabit
case editHabit(Habit.ID)
case paywall
var id: String {
switch self {
case .createHabit: "createHabit"
case .editHabit(let id): "editHabit-\(id)"
case .paywall: "paywall"
}
}
}
@State private var activeSheet: ActiveSheet?
.sheet(item: $activeSheet) { sheet in
switch sheet {
case .createHabit:
CreateHabitView()
case .editHabit(let id):
EditHabitView(habitID: id)
case .paywall:
PaywallView()
}
}Enum-based navigation path pattern:
enum Route: Hashable {
case habitDetail(Habit.ID)
case settings
}
@State private var path: [Route] = []
NavigationStack(path: $path) {
TodayView()
.navigationDestination(for: Route.self) { route in
switch route {
case .habitDetail(let id):
HabitDetailView(habitID: id)
case .settings:
SettingsView()
}
}
}Optional item navigation pattern:
@State private var selectedHabit: Habit?
.navigationDestination(item: $selectedHabit) { habit in
HabitDetailView(habit: habit)
}In agy prompts, explicitly state the presentation model so generated code does not fall back to scattered booleans.
SwiftUI UI State Guidance
When a screen shows one major UI state at a time, prefer enum-based view state. This gives agy a clear rendering switch and avoids scattered boolean combinations:
enum TodayViewState: Equatable {
case loading
case empty
case error(message: String)
case content(TodayContent)
case submitting(TodayContent)
case completed(TodayContent)
}Render the enum in a single switch at the screen boundary, then compose state-specific visible components:
@ViewBuilder
private var content: some View {
switch viewState {
case .loading:
TodaySkeletonView()
case .empty:
TodayEmptyView()
case .error(let message):
TodayErrorView(message: message)
case .content(let content):
TodayContentView(content: content)
case .submitting(let content):
TodayContentView(content: content, isSubmitting: true)
case .completed(let content):
TodayCompletedView(content: content)
}
}You prepare non-UI state/data shapes when needed. agy should bind visible UI to the existing or provided state shape.
SwiftUI State Transition Guidance
Use native SwiftUI transition tools appropriate to the deployment target:
- Keep layout identity stable when moving between loading and content.
- Use
.redacted(reason: isLoading ? .placeholder : [])or equivalent redaction on content-shaped placeholders that match final content size. - Add restrained shimmer only when it improves perceived progress and can become static under Reduce Motion.
- Use transitions, content transitions, and animation values to communicate state changes.
- Keep forms visible during submitting; disable controls and animate button state instead of replacing the whole screen.
- Use list insertion/removal transitions when data changes.
- Keep existing content visible during refresh unless the content is unavailable.
- Use sensory feedback only for intentional selection, success, warning, or error transitions.
- Preserve form input on error and place recovery guidance near the failed field or action.
Make state changes feel local to the screen unless the user is actually navigating. Use real step rows only when the app exposes real step state.
Web UI Playbook
Use this only when the target project is web or React. Flutter and SwiftUI are the primary focus.
File Placement
Follow the existing project convention. If none exists:
- Route/page:
src/app/orsrc/pages/according to framework - Components:
src/components/or feature-localcomponents/ - Feature modules:
src/features/<feature>/ - Design tokens: Tailwind config, CSS variables, or
src/design-system/
Keep reusable components separate from route-specific components.
Web Prompt Requirements
Tell agy:
- Framework: Next.js, Vite, React, Remix, or other.
- Styling system: Tailwind, CSS modules, CSS variables, component library.
- Screen entry file and allowed component directories.
- Design system paths.
- Responsive breakpoints.
- Accessibility expectations.
- State and data constraints.
- Discriminated UI state shape for mutually exclusive screen states.
Responsiveness
Require:
- Mobile, tablet, and desktop layouts.
- No text overflow inside buttons/cards/nav.
- Stable dimensions for controls and cards.
- Keyboard/focus states.
- Reduced-motion behavior.
- Accessible contrast and focus rings.
- Pointer targets meet WCAG 2.2 target-size minimums; primary touch actions should be larger when space allows.
- Status, validation, and selection are not communicated by color alone.
- Repeated or scroll-linked animations use transform and opacity where possible.
Web Screen Prompt Add-On
Web-specific constraints:
- Use the existing framework and styling system.
- Preserve routing and data flow.
- Build mobile, tablet, and desktop layouts.
- Use semantic HTML and accessible controls.
- Meet WCAG AA contrast, target-size, keyboard, focus, and no-color-only-state expectations.
- Prefer discriminated unions or the project's equivalent pattern for mutually exclusive UI states.
- Define transitions between loading, content, empty, error, refreshing, submitting, and success states.
- Use tasteful animation only for meaningful state and interaction feedback.
- Use app-screen layouts for app screens and landing-page structure only for requested landing pages.Web State Transition Guidance
Use framework-appropriate state transitions:
- Skeletons should match final content dimensions.
- Use restrained shimmer over skeletons for loading/generating states when final content shape is known.
- Prefer local loading states when they preserve context.
- Preserve focus when forms move between idle, submitting, success, and error states.
- Animate button state without changing width.
- Respect reduced-motion preferences.
- Keep accessibility announcements clear for loading, success, and error states.
- Use real step rows only when the app exposes real step state.
- Preserve user input during validation and submit errors; keep errors close to the failed field or action.