agentleFS
shelbeelyshelbeely/Shelbeely-Agent-skills/skills/m3-web-ink/SKILL.md

m3-web-ink

Skill4 starsChanged 10 months agoApache-2.0View on GitHub

Implement Material Design 3 in terminal CLIs using Ink (React for CLIs) with @inkjs/ui components. Covers M3 token mapping to terminal colors, ThemeProvider setup, component mapping, and ANSI fallbacks. Use this when building M3-styled command-line interfaces.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When you want M3-consistent styling in the terminal

    line 19
  2. Distinctive:

    Always provide fallback named colors for maximum compatibility

    line 195

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Material Design 3 — Ink (React CLI)

Overview

Ink is a React renderer for building interactive command-line interfaces. Combined with @inkjs/ui, it provides themeable CLI components. M3 design tokens can be mapped to terminal colors for consistent, Material-styled CLI experiences.

Keywords: Material Design 3, M3, Ink, CLI, terminal, command-line, @inkjs/ui, React CLI, terminal UI

When to Use

  • Node.js CLI tools and developer tooling
  • Interactive terminal applications
  • When you want M3-consistent styling in the terminal
  • React-based CLI projects

Install

npm install ink react @inkjs/ui

M3 Theme Setup

Map M3 tokens to terminal colors:

// m3-theme.js
export const m3Theme = {
  colors: {
    primary: '#6750A4',
    onPrimary: '#FFFFFF',
    secondary: '#625B71',
    tertiary: '#7D5260',
    error: '#B3261E',
    surface: '#FEF7FF',
    onSurface: '#1D1B20',
    outline: '#79747E',
    // Terminal-friendly named colors (for broader compatibility)
    primaryTerminal: 'magenta',
    secondaryTerminal: 'gray',
    errorTerminal: 'red',
    successTerminal: 'green',
  },
};

// For dark terminal backgrounds
export const m3ThemeDark = {
  colors: {
    primary: '#D0BCFF',
    onPrimary: '#381E72',
    secondary: '#CCC2DC',
    error: '#F2B8B5',
    surface: '#141218',
    onSurface: '#E6E0E9',
    primaryTerminal: 'magentaBright',
    errorTerminal: 'redBright',
  },
};

Component Examples

Full App with M3 Tokens

import React from 'react';
import {render, Box, Text} from 'ink';
import {TextInput, Select, Spinner, Badge} from '@inkjs/ui';
import {m3Theme} from './m3-theme.js';

function App() {
  return (
    <Box flexDirection="column" padding={1} gap={1}>
      {/* M3 Primary colored heading */}
      <Text color={m3Theme.colors.primary} bold>
        ✦ Material Design 3 CLI
      </Text>

      {/* M3 Surface container */}
      <Box
        borderStyle="round"
        borderColor={m3Theme.colors.outline}
        paddingX={2}
        paddingY={1}
        flexDirection="column"
        gap={1}
      >
        <Text color={m3Theme.colors.onSurface}>
          Welcome to the M3-styled terminal
        </Text>

        <TextInput
          placeholder="Enter your name..."
          onSubmit={name => {}}
        />

        <Select
          options={[
            {label: 'Option 1', value: '1'},
            {label: 'Option 2', value: '2'},
          ]}
          onChange={value => {}}
        />
      </Box>

      {/* M3 Status indicators */}
      <Box gap={1}>
        <Badge color="green">Success</Badge>
        <Badge color={m3Theme.colors.errorTerminal}>Error</Badge>
      </Box>

      <Spinner label="Loading..." />
    </Box>
  );
}

render(<App />);

Button Equivalent

import {Box, Text} from 'ink';

<Box paddingX={2} paddingY={0}>
  <Text backgroundColor="magenta" color="white" bold> Action </Text>
</Box>

Navigation (Select)

import {Select} from '@inkjs/ui';

<Select
  options={[
    {label: '🏠 Home', value: 'home'},
    {label: '🔍 Search', value: 'search'},
    {label: '⚙️ Settings', value: 'settings'},
  ]}
  onChange={value => {}}
/>

ThemeProvider for M3

import {ThemeProvider, extendTheme} from '@inkjs/ui';

const m3InkTheme = extendTheme({
  components: {
    TextInput: {
      styles: {
        focusColor: 'magenta', // M3 primary
      },
    },
    Select: {
      styles: {
        highlightColor: 'magenta',
      },
    },
    Spinner: {
      styles: {
        color: 'magenta',
      },
    },
  },
});

function App() {
  return (
    <ThemeProvider theme={m3InkTheme}>
      {/* All child components use M3-inspired theme */}
    </ThemeProvider>
  );
}

Terminal Color Considerations

  • Modern terminals support 24-bit (true color) via hex values — use full M3 hex tokens
  • For legacy terminals (256/16 color), map M3 roles to named ANSI colors:
    • Primary → magenta (closest to M3 purple primary)
    • Secondary → gray
    • Tertiary → cyan
    • Error → red
    • Success → green (custom role for CLI)
  • Detect color support with chalk.level or supports-color package
  • Always provide fallback named colors for maximum compatibility

M3 Component Mapping for CLI

M3 ComponentInk/ink-ui EquivalentNotes
Filled Button<Box> + <Text> styledBackground color + text
Text Field<TextInput>From @inkjs/ui
Select / Menu<Select>From @inkjs/ui
Multi-select<MultiSelect>From @inkjs/ui
Progress Indicator<Spinner>, <ProgressBar>From @inkjs/ui
Badge / Chip<Badge>From @inkjs/ui
Confirm Dialog<ConfirmInput>From @inkjs/ui
Card<Box borderStyle="round">Bordered container
Divider<Text>{'─'.repeat(n)}</Text>Horizontal rule
List<UnorderedList>, <OrderedList>From @inkjs/ui
Alert / Snackbar<Alert>From @inkjs/ui

Checklist

  • M3 color tokens defined in a theme object
  • Terminal color fallbacks provided for legacy terminals
  • @inkjs/ui ThemeProvider configured with M3-inspired colors
  • Components use theme tokens (not hard-coded colors)
  • Dark terminal variant provided
  • Color detection implemented (true color vs 256 vs 16)

Resources

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.