new-control

new-control is a cursor rule for Cursor from tobitege/Flowery.Uno. It costs 0 tokens per session (3,652 once invoked), scanned A, original, MIT.

A step-by-step rule for creating a new Flowery.Uno control for Uno Platform and WinUI. It covers the C# control, XAML styling, gallery example, sidebar entry, and documentation.

In plain words
What is it for?
Building a new control or porting one from another library using Microsoft UI XAML, dependency properties, and the project's required gallery and documentation steps.
Why use it?
It prevents a control from being added only to the code while missing its visual theme, demo, navigation, or documentation. Uno Platform is a framework for building apps that run across several platforms.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/build_all.sh.

Good fit Building a new control or porting one from another library using Microsoft UI XAML, dependency properties, and the project's required gallery and documentation steps.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/tobitege/Flowery.Uno
agentmods
npx agentmods add rules/tobitege/flowery.uno/new-control

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for new-control

README.md
[![agentmods](https://agentmods.dev/badge/rules/tobitege/flowery.uno/new-control/github.svg)](https://agentmods.dev/rules/tobitege/flowery.uno/new-control)
Your own site
<a href="https://agentmods.dev/rules/tobitege/flowery.uno/new-control"><img src="https://agentmods.dev/badge/rules/tobitege/flowery.uno/new-control/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for new-control

Your own site · 80×15
<a href="https://agentmods.dev/rules/tobitege/flowery.uno/new-control"><img src="https://agentmods.dev/badge/rules/tobitege/flowery.uno/new-control.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,652 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03652
Opus 5.5 $0.00000 $0.01461
Sonnet 5.5 $0.00000 $0.00730
Haiku 4.5 $0.00000 $0.00365

Measured 13d ago against content hash b34ae4318fa0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

new-control scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/new-control.mdc · 566 lines

How it starts

The opening of the file, as written. The whole thing — 566 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Creating a New Flowery.Uno Control (Uno Platform / WinUI)

This rule outlines the complete workflow for creating a new control in Flowery.Uno, whether it's a brand new control or a port from another library.

Platform: Uno Platform / WinUI (NOT Avalonia). Use Microsoft.UI.Xaml.* namespaces, .xaml files, and DependencyProperty.

Overview

Creating a new control involves these major phases:

  1. Control Implementation - C# class with properties and logic
  2. Theme/Styling - XAML ResourceDictionary for visual appearance
  3. Gallery Examples - Demo page in the gallery application
  4. Sidebar Integration - Add to the sidebar data
  5. Documentation - Markdown file for supplementary docs

Phase 1: Control Implementation

1.1 Create the C# Control File

Location: Flowery.Uno/Controls/Daisy[ControlName].cs

If the control is a custom extension (not a direct DaisyUI component), place it under:

  • Flowery.Uno/Controls/Custom/Daisy[ControlName].cs
  • Namespace: Flowery.Controls

Required elements:

using System;
using Flowery.Theming;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Windows.UI;
// Add other required usings at the TOP

namespace Flowery.Controls
{
    // Define enums at namespace level
    public enum Daisy[ControlName]Variant
    {
        Default,
        Primary,
        // ... other values
    }

    /// <summary>
    /// Brief description of what the control does (Uno/WinUI).
    /// </summary>
    public partial class Daisy[ControlName] : ContentControl // or appropriate base class
    {
        /// <summary>
        /// Gets or sets the property description.
        /// </summary>
        public static readonly DependencyProperty VariantProperty =
            DependencyProperty.Register(
                nameof(Variant),
                typeof(Daisy[ControlName]Variant),
                typeof(Daisy[ControlName]),
                new PropertyMetadata(Daisy[ControlName]Variant.Default, OnAppearanceChanged));

        public Daisy[ControlName]Variant Variant
        {
            get => (Daisy[ControlName]Variant)GetValue(VariantProperty);
            set => SetValue(VariantProperty, value);
        }

        private static void OnAppearanceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (d is Daisy[ControlName] control)
            {
                control.ApplyAll();
            }
        }

        public Daisy[ControlName]()
        {
            DefaultStyleKey = typeof(Daisy[ControlName]);
            Loaded += OnLoaded;
            Unloaded += OnUnloaded;
        }

        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            BuildVisualTree();
            ApplyAll();
        }

        private void OnUnloaded(object sender, RoutedEventArgs e)
        {
            // Cleanup (unsubscribe from events, etc.)
        }

        private void BuildVisualTree()
        {
            // Build control's visual tree programmatically
        }

        private void ApplyAll()
        {
            // Apply sizing, colors, states
        }
    }
}

Read the full file on GitHub · 566 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 566 lines · 0 tokens per session scan A b34ae4318fa0

Subscribe to this mod's changes

new-control is a cursor rule published in the GitHub repository tobitege/Flowery.Uno (16 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,652 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.