agentleFS
ViviBeriViviBeri/webcraft-pro/skills/frontend-architecture/SKILL.md

frontend-architecture

Skill11 starsChanged 11 days agoMITView on GitHub

Use when planning, reviewing or changing a frontend application architecture, routing, rendering strategy, state ownership, data flow or project boundaries.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use backend-architecture, mobile-design and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GoldenWing-360Skill

    backend-architecture

    Design backends that survive redeploys, server reboots, and modest scaling. Covers stateless application servers, state placement (object storage, managed databases, Redis), immutable deploy artifacts, health checks, graceful shutdown, database migrations that don't lock the world, and the twelve-factor baseline. Invoke when designing a new backend, when uploads disappear after a redeploy, or when productionizing a vibe-coded prototype.

    Also in 3 projects that use this

  • xenitV1Skill

    mobile-design

    Mobile-first design thinking and decision-making for iOS and Android apps. Touch interaction, performance patterns, platform conventions. Teaches principles, not fixed values. Use when building React Native, Flutter, or native mobile apps.

    Also in 3 projects that use this

  • harrissohail6Skill

    database-design

    Database schema design and SQL best practices. Use when designing tables, writing queries, or optimizing database performance.

    Also in 3 projects that use this

  • xenitV1Skill

    clean-code

    Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

    Also in 3 projects that use this

  • AnthropicSkill

    architecture

    Create or evaluate an architecture decision record (ADR). Use when choosing between technologies (e.g., Kafka vs SQS), documenting a design decision with trade-offs and consequences, reviewing a system design proposal, or designing a new component from requirements and constraints.

    Also in 3 projects that use this

  • JetBrainsSkill

    webapp-testing

    Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. 0 are common, 24 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 24

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read entry points, route definitions, layouts, data access, state management, tests and deployment configuration relevant to the task.

    line 16
  2. Distinctive:

    Keep route composition, reusable UI, domain logic and infrastructure responsibilities distinguishable.

    line 21
  3. Distinctive:

    Place code according to existing architecture.

    line 22
  4. Distinctive:

    Prefer the simplest rendering mode compatible with SEO, latency, personalization, interactivity and deployment.

    line 25
  5. Distinctive:

    Keep secrets and privileged operations on trusted server boundaries.

    line 26
  6. Distinctive:

    Treat browser state as untrusted input.

    line 27
  7. Distinctive:

    Consider complexity, bundle cost, accessibility, testability, operational burden and migration risk.

    line 31
  8. Distinctive:

    Avoid adding dependencies when platform APIs or existing packages are sufficient.

    line 32
  9. Distinctive:

    Prefer incremental, reversible changes with clear compatibility boundaries.

    line 35
  10. Distinctive:

    Run the repository's existing lint, typecheck, tests and production build.

    line 38
  11. Distinctive:

    Add or update tests for changed boundaries and failure paths.

    line 39
  12. Distinctive:

    Check direct navigation, refresh, not-found behavior and environment configuration where relevant.

    line 40
  13. Distinctive:

    Check keyboard operation, accessible names, focus visibility, heading hierarchy, form labels, contrast and responsive reflow.

    line 48
  14. Distinctive:

    Verify the resulting code in the target application and report any retained dependencies or limitations.

    line 50
  15. Very specific:

    Do not assume React, Next.js, Vue, Angular or any specific framework.

    line 58
  16. Distinctive:

    Do not impose a state library, router, monorepo or microfrontend architecture without a demonstrated need.

    line 59
  17. Distinctive:

    Avoid global mutable state and hidden cross-module side effects.

    line 60
  18. Distinctive:

    Keep configuration explicit and validate required environment variables at startup.

    line 61
  19. Distinctive:

    Use stable contracts between independently changing modules.

    line 62
  20. Distinctive:

    Do not place secrets, privileged credentials or authorization decisions in client bundles.

    line 63
  21. Distinctive:

    Prefer observability that helps diagnose real failures.

    line 64
  22. Distinctive:

    Keep server data authoritative.

    line 82
  23. Distinctive:

    Treat server/client component boundaries as data and capability boundaries where supported.

    line 84
  24. Distinctive:

    Prefer progressive enhancement for critical flows when the platform and product allow it.

    line 85
  25. Distinctive:

    Document route ownership, deep-link behavior, refresh behavior and fallback behavior for unavailable dependencies.

    line 86

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Frontend Architecture

Objective

Make the smallest coherent architectural change that improves clarity, reliability and delivery speed without replacing working project conventions unnecessarily.

Workflow

  1. Inspect before designing
    • Identify the framework, language, package manager, build system and supported runtime from repository files.
    • Read entry points, route definitions, layouts, data access, state management, tests and deployment configuration relevant to the task.
    • Map the request path: user action → UI → state or request → domain logic → persistence/API → rendered result.
    • Record constraints such as SSR, static generation, client-only behavior, hosting limits and browser support.
  2. Define boundaries
    • Separate presentation from domain rules and external I/O where the project benefits from it.
    • Keep route composition, reusable UI, domain logic and infrastructure responsibilities distinguishable.
    • Place code according to existing architecture; do not introduce layers solely to satisfy a diagram.
    • Define ownership for shared state and avoid duplicated sources of truth.
  3. Choose rendering and data flow
    • Prefer the simplest rendering mode compatible with SEO, latency, personalization, interactivity and deployment.
    • Keep secrets and privileged operations on trusted server boundaries.
    • Treat browser state as untrusted input. Revalidate authorization and data on the server.
    • Handle loading, empty, error, stale and success states explicitly.
  4. Evaluate trade-offs
    • Compare viable approaches when the decision is consequential.
    • Consider complexity, bundle cost, accessibility, testability, operational burden and migration risk.
    • Avoid adding dependencies when platform APIs or existing packages are sufficient.
  5. Plan migration
    • Identify affected modules, routes, contracts, tests and deployment settings.
    • Prefer incremental, reversible changes with clear compatibility boundaries.
    • Preserve public APIs and URLs unless a breaking change is explicitly required.
  6. Verify
    • Run the repository's existing lint, typecheck, tests and production build.
    • Add or update tests for changed boundaries and failure paths.
    • Check direct navigation, refresh, not-found behavior and environment configuration where relevant.
    • Report checks not run and explain why.

Reviewing Visual Builder Export Code

If a user provides HTML/CSS exported from a visual builder (like GrapesJS, Webstudio, or Webflow), do not blindly trust it. Audit it for semantic HTML (div-soup), unused CSS, WCAG accessibility violations, and vendor lock-in scripts. Strip out unnecessary builder bloat before integrating it into the codebase.

  • Preserve required behavior and visual intent while replacing generic containers with semantic elements where appropriate.
  • Check keyboard operation, accessible names, focus visibility, heading hierarchy, form labels, contrast and responsive reflow.
  • Identify builder runtime dependencies, hosted assets, proprietary attributes and scripts; remove them only when they are not required by the exported experience.
  • Verify the resulting code in the target application and report any retained dependencies or limitations.

Component Architecture

Angular's Dependency Injection and module organization are useful conceptual references for decoupling responsibilities and making dependencies explicit. Apply the underlying principles—not Angular-specific APIs or conventions—even when working in React, Vue or another frontend stack. Keep abstractions proportionate to the project and follow its existing framework conventions.

Design constraints

  • Do not assume React, Next.js, Vue, Angular or any specific framework.
  • Do not impose a state library, router, monorepo or microfrontend architecture without a demonstrated need.
  • Avoid global mutable state and hidden cross-module side effects.
  • Keep configuration explicit and validate required environment variables at startup.
  • Use stable contracts between independently changing modules.
  • Do not place secrets, privileged credentials or authorization decisions in client bundles.
  • Prefer observability that helps diagnose real failures; never log passwords, tokens or unnecessary personal data.

Deliverables

For architecture work, provide a current-state summary, proposed boundaries and data flow, key trade-offs, incremental implementation plan, verification evidence and known limitations.

Completion criteria

The architecture fits the actual stack, reduces rather than relocates complexity, preserves required behavior, has clear ownership boundaries and is verified by relevant automated checks.

Decision record

For consequential architecture choices, record context, constraints, options considered, decision, trade-offs, migration/rollback path and verification plan. Keep the record proportionate to the decision.

State and rendering boundaries

  • Classify state by lifetime and ownership: ephemeral component state, URL/shareable state, server data, cross-route client state and persisted preferences.
  • Keep server data authoritative; define cache freshness, invalidation and optimistic-update rollback behavior where applicable.
  • Make route-level loading, error, not-found, empty and permission-denied states explicit. Do not collapse distinct failures into a generic empty screen.
  • Treat server/client component boundaries as data and capability boundaries where supported; pass only minimum serializable data to client code.
  • Prefer progressive enhancement for critical flows when the platform and product allow it.
  • Document route ownership, deep-link behavior, refresh behavior and fallback behavior for unavailable dependencies.

Common AI failure mode

Failure: An agent introduces a second mutable source of truth for the same application state, allowing the UI, URL, and server data to diverge.

Why it matters: Updates become order-dependent and stale values can overwrite newer user intent. Bugs appear during navigation, refresh, optimistic updates, and error recovery because ownership and synchronization rules are unclear.

Symptoms:

  • The same value is independently stored in component state, a global store, and the URL or server cache.
  • A change in one representation does not update or invalidate the others.
  • Back/forward navigation or a failed optimistic update restores a value that no longer matches the authoritative state.

Prevention: Assign each state value one authoritative owner based on its lifetime and sharing needs. Derive presentation state where possible, define URL synchronization and server-cache invalidation explicitly, and document optimistic-update rollback. Test navigation, refresh, concurrent updates, and failed requests to prove that duplicate mutable copies cannot drift.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.