agentleFS
MingYuan0415MingYuan0415/MicroTech/.agents/skills/design-contract/SKILL.md

design-contract

Skill1 starsChanged 8 days agoMITView on GitHub

Resolve, validate, compare and switch MicroTech design profiles and target profiles. Use when choosing a visual language, adding a style variant, changing target capabilities, or when another design skill needs a profile/target context before planning or reviewing UI.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the owning profile and target before changing a page.

    line 32
  2. Distinctive:

    Resolve a context: Run:

    line 37
  3. Very specific:

    If the caller did not choose a pair, run select --mode design.

    line 44
  4. Very specific:

    Author a new style when needed: Follow references/switching.md, copy neutral.json, change the style axes and roles, keep the schema …

    line 54
  5. Very specific:

    Record the context in the handoff: Every design or review output must name profile_id, profile_version, target_id and any downgrade …

    line 63
  6. Very specific:

    Only select --mode current may select it.

    line 88
  7. Distinctive:

    Do not create a profile with raw values copied from a page.

    line 104
  8. Very specific:

    Do not add a new style axis outside references/profile-schema.md without updating the schema, validator, tests and all profiles.

    line 105
  9. Very specific:

    Do not claim that a synthetic target is supported hardware.

    line 107
  10. Distinctive:

    Do not use the current panel geometry or current palette as an implicit fallback.

    line 109
  11. Distinctive:

    Do not add CMake/Kconfig gates for design profiles.

    line 111

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

MicroTech Design Contract

The design contract separates three things that must not be conflated:

  1. Universal floor — contrast, touch targets, readable text, state clarity, error recovery. These apply to every style and target.
  2. Style profile — a named visual language: surface model, depth model, density, corner scale, type scale, decoration and motion level.
  3. Target profile — display, input and resource capabilities: geometry, DPI, colour mode, refresh rate, CPU/RAM class, motion and asset budgets.

A page is always resolved against (style profile, target profile). dark_sparse is one profile in this repository, not a universal baseline.

Sources of Truth

  • doc/design/README.md explains the contract and current implementation limits.
  • doc/design/profiles/*.json are style profiles.
  • doc/design/targets/*.json are target capability profiles. A product manifest (products/<product>/product.cmake) binds its MT_PRODUCT_DESIGN_TARGET to one of them; the board manifest owns the physical display facts, not the design budget.
  • doc/design/active.json selects the current project pair for review only.
  • scripts/design_profile.py is the only supported resolver and validator.
  • references/inspiration.md records provenance and scope.

Read the owning profile and target before changing a page. Do not copy hex values or pixel values from the current theme into a page or another skill.

Workflow

  1. Resolve a context. Run:

    python3 .agents/skills/design-contract/scripts/design_profile.py resolve \
        --profile <profile-id> --target <target-id> --output <context.json>

    If the caller did not choose a pair, run select --mode design. This mode uses the explicit argument first, then the environment variable, then neutral + generic_constrained; it never reads active.json. To audit the current UI, run select --mode current, which adds active.json after the explicit and environment choices. Its selection object records mode and which source won for each side. active.json is a review subject, not a design baseline.

  2. Read the resolved context. It contains semantic colours, space/radius/type scales, minimum touch size, motion budget, effect permissions and any downgrade findings. Treat the resolved values as the design input.
  3. Author a new style when needed. Follow references/switching.md, copy neutral.json, change the style axes and roles, keep the schema version, run validate, then run diff against an existing profile. A new style that only changes colours is not a new style; at least three style axes must differ.
  4. Validate before use. validate checks schema, role completeness, contrast pairs, monotonic scales, motion budget and all profile × target pairs (pairs in its JSON output). Expected incompatibilities such as a colour profile on a mono target are reported with their error code.
  5. Record the context in the handoff. Every design or review output must name profile_id, profile_version, target_id and any downgrade findings.

Commands

python3 .agents/skills/design-contract/scripts/design_profile.py validate
python3 .agents/skills/design-contract/scripts/design_profile.py resolve \
    --profile paper_light --target panel_240x320_touch_30hz --output .cache/design-context.json
python3 .agents/skills/design-contract/scripts/design_profile.py select --mode design
python3 .agents/skills/design-contract/scripts/design_profile.py select --mode current
python3 .agents/skills/design-contract/scripts/design_profile.py diff paper_light soft_playful
python3 .agents/skills/design-contract/scripts/design_profile.py check-current

check-current compares dark_sparse with the C headers that own the current colours and metrics. A mismatch is drift, not a style choice.

Switching Rules

  • Explicit --profile / --target wins over everything.
  • Environment variables are the second choice for CI or temporary sessions.
  • select --mode design never reads active.json; with no explicit or environment pair it falls back to neutral + generic_constrained.
  • active.json is the current UI review subject, not a design baseline. Only select --mode current may select it.
  • In current mode, active.json version pins must match the loaded profile/target; a mismatch is VERSION_MISMATCH, not a silent upgrade.
  • Unknown or missing profile/target must fail with UNKNOWN_PROFILE or UNKNOWN_TARGET; do not guess and do not reuse the previous context.
  • A style profile may declare requires.color_modes and requires.min_refresh_hz. If the target cannot satisfy them, stop and report COLOR_MODE_UNSUPPORTED or REFRESH_TOO_LOW.
  • Motion is resolved as min(style.motion_level, target.max_motion_level). Record MOTION_DOWNGRADED when the target caps the style.
  • Shadow, blur and gradient permissions are the intersection of style rules and target capabilities. Record EFFECT_DOWNGRADED when the target removes an effect.

Prohibited

  • Do not create a profile with raw values copied from a page.
  • Do not add a new style axis outside references/profile-schema.md without updating the schema, validator, tests and all profiles.
  • Do not claim that a synthetic target is supported hardware. supported must remain false for fixtures.
  • Do not use the current panel geometry or current palette as an implicit fallback.
  • Do not add CMake/Kconfig gates for design profiles; this is a skill and test contract, not a build gate.

Handoff

Report the resolved pair, the scale values in semantic terms, any capability downgrade, and the remaining implementation limits (for example, a type scale that cannot be mapped to the current font roles).

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.