You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've authored a proposed Agentic Rule designed to standardize how components are created, tested, and documented for the Flowbite Vue project — with the specific goal of making contributions more consistent and compatible with Agentic AI workflows.
🎯 Why This Rule?
Reflects your existing project conventions (naming, structure, styling)
Adds structure for automated code generation incuding components, testing, accessibility, and documentation
Enables developers (and AI agents) to programmatically contribute
Built for use with tools like Roo Code or Cursor which enforces rules during generation and refactoring
Agentic workflows are rapidly gaining traction in frontend engineering. This rule would make Flowbite Vue an early adopter UI library to support this kind of scalable, automated contribution model — without changing anything about how the library works today.
Let me know your thoughts — happy to adapt this to fit the direction of the project or discuss how it could be integrated into the docs or contribution flow.
Thanks again for building such a clean and extensible component library — it's been a huge help in the agentic space! 🙌
📄 Proposed Coding Standards Document
Click to expand
## Flowbite Vue Coding Standards### Objective
Build reusable, accessible Vue 3 components using **Flowbite’s design system**, **Tailwind CSS**, and the **Composition API**. Components must integrate with `flowbite-vue` and follow project standards.
> Note for contributors:> **Always** generate code that fully complies with these standards and passes all linting, formatting, and style checks automatically.---### Project Structure```textflowbite-vue/├── src/│ ├── components/│ │ ├── [ComponentName]/│ │ │ ├── [ComponentName].vue│ │ │ └── types.ts│ ├── composables/│ ├── tests/│ │ └── [ComponentName].spec.ts│ └── index.ts├── docs/components/[component-name].md├── docs/components/[component-name]/examples/[ComponentName]Example.vue
Optionally support auto-import via unplugin-vue-components with prefix fwb-
15. Code Style
Use 2 spaces for indentation.
Use single quotes for strings, unless escaping makes double quotes more readable.
Use === and !== for comparisons.
Prefer const over let, and avoid var.
Use arrow functions for callbacks and function expressions.
Add spaces around operators (e.g., a + b, x === y).
Aim to keep lines under ~120 characters for readability.
Break lines when it improves clarity (e.g., long props, class lists).
Avoid empty lines between grouped imports.
Do not add a space between function parentheses and braces (e.g., function foo() {).
Add a blank line between class members.
End every .vue, .js, and .ts file with a newline.
Use trailing commas in multi-line arrays, objects, and imports.
Use kebab-case for file names and PascalCase for component names (e.g., MyComponent.vue).
Use self-closing tags for elements without children.
15a. Template Attribute Formatting
Maintain consistent and readable formatting in all <template> elements. These conventions are enforced by ESLint and must be followed to avoid lint errors.
docs/components/[component-name]/examples/[ComponentName]Example.vue — Usage example
Rule Type
This is a convention rule to guide component structure, syntax, and project integration. AI agents should treat this as a source of truth for generation, refactoring, and validation when working within a Flowbite Vue environment.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Flowbite Vue team 👋
I've authored a proposed Agentic Rule designed to standardize how components are created, tested, and documented for the Flowbite Vue project — with the specific goal of making contributions more consistent and compatible with Agentic AI workflows.
🎯 Why This Rule?
Agentic workflows are rapidly gaining traction in frontend engineering. This rule would make Flowbite Vue an early adopter UI library to support this kind of scalable, automated contribution model — without changing anything about how the library works today.
Let me know your thoughts — happy to adapt this to fit the direction of the project or discuss how it could be integrated into the docs or contribution flow.
Thanks again for building such a clean and extensible component library — it's been a huge help in the agentic space! 🙌
📄 Proposed Coding Standards Document
Click to expand
Naming
Button.vue
,Modal/
)fwb-
(e.g.,<fwb-button>
)1. Dependencies
Declare
flowbite
andvue
as peerDependencies:Assume
flowbite
is pre-installed in the consumer project.Use named ESM imports only — no global scripts or CDN reliance.
Do not re-export
flowbite
modules.Externalize
vue
,flowbite
, and other peers in bundler config.Use third-party libraries only when essential:
peerDependencies
for optional/shared packages.dependencies
only for internal runtime needs.Favor small, internal utilities over large helper libraries.
2. Component Order
Use the following SFC block order:
<template>
<script>
<style>
3. Composition API
Use
<script setup lang="ts">
Define props/emits using
defineProps
anddefineEmits
with TypeScript typesPrefer
ref
,computed
, andwatchEffect
Avoid
reactive
unless deep reactivity is neededGuard browser-only APIs (
window
,document
) for SSR support:4. Tailwind + Flowbite Styling
class
/:class
props for wrapper customizationclsx
ortwMerge
to safely merge internal/external classesdark:
variant for dark mode — no runtime toggling5. Interactivity & Flowbite JS
Use
data-*
attributes from Flowbite (e.g.,data-modal-toggle
)Abstract behavior into composables like
useDataAttribute
If using Flowbite JS (e.g., Dropdowns), import ESM modules directly:
6. Accessibility
Follow WAI-ARIA best practices
Use semantic HTML with
aria-*
,role
,tabindex
, etc.Enable keyboard navigation
Trap focus where needed (e.g., modals, drawers)
Example:
7. Props & Emits
update:model-value
,open
)8. Slots & Customization
icon
,header
,footer
).md
file9. Theming
dark:
variant for styling10. Transitions
transition-opacity
,duration-300
, etc.)<Transition>
/<TransitionGroup>
11. Icons
icon
prop or<slot name="icon">
.md
file12. Testing
@testing-library/vue
userEvent
for interaction testing13. Documentation
.md
file atdocs/components/[component-name].md
Required
.md
File Sections Checklist[ComponentName]Example.vue
)14. Naming & Import / Export
fwb-
(e.g.,<fwb-modal>
)src/index.ts
:unplugin-vue-components
with prefixfwb-
15. Code Style
===
and!==
for comparisons.const
overlet
, and avoidvar
.a + b
,x === y
).function foo() {
)..vue
,.js
, and.ts
file with a newline.MyComponent.vue
).15a. Template Attribute Formatting
Maintain consistent and readable formatting in all
<template>
elements. These conventions are enforced by ESLint and must be followed to avoid lint errors.Attribute Order (Top → Bottom)
Use the following order for attributes:
v-if
,v-model
,v-bind
,v-on
,:
,@
)id
,type
,name
,value
, etc.)class
,:class
,style
)role
,aria-*
,tabindex
)data-*
)@click
,@change
, etc.)Line Formatting
<input>
,<img>
,<br>
, or<hr>
.Examples
✅ Correct:
❌ Incorrect:
✅ SVG:
Enforced Rules
These ESLint rules enforce this structure:
vue/max-attributes-per-line
vue/attributes-order
vue/html-self-closing
16. Error Handling
17. Class Composition
class
passthrough on root elementstwMerge
for merging user and internal styles18. Linting & Tooling
The codebase uses ESLint to enforce code quality and maintain a consistent coding style across the project.
eslint-plugin-vue
using thevue3-recommended
preset.eslintrc.cjs
in the project root for configuration detailsnpm run lint
before every commit and pull request.Component Checklist
<script setup lang="ts">
dark:
variant).md
+ examples)src/index.ts
Output Files
src/components/[ComponentName].vue
— Main componentsrc/components/[ComponentName]/types.ts
— Type declarationssrc/index.ts
— Public exportstests/components/[ComponentName].spec.ts
— Unit testsdocs/components/[component-name].md
— Component documentationdocs/components/[component-name]/examples/[ComponentName]Example.vue
— Usage exampleRule Type
This is a convention rule to guide component structure, syntax, and project integration. AI agents should treat this as a source of truth for generation, refactoring, and validation when working within a Flowbite Vue environment.
Beta Was this translation helpful? Give feedback.
All reactions