Theme Definition
Use this skill when asked to create or update a bundled theme definition for a named color theme or palette.
Goal
Create or update exactly one bundled theme source file in the repository top-level themes/ directory:
Examples:
Gruvbox Dark -> themes/gruvbox_dark.yml
Nord Light -> themes/nord_light.yml
My Theme -> themes/my_theme.yml
If a matching file already exists, update it instead of creating a duplicate.
The YAML source is the authored artifact. Amp's build compiles it into a generated .tmTheme file with the same key during build.rs.
Required Constraints
- Only author bundled YAML theme sources in
themes/.
- Do not manually create or edit generated
.tmTheme files for bundled themes.
- Do not write the theme anywhere except the top-level
themes/ directory unless the user explicitly asks for something else.
- Use the semantic token-family standard in references/token-color-standard.md whenever the user does not provide a custom scope map.
- Treat
palette as the single source of truth for authored colors:
- define hex literals in
palette
- reference palette keys from
settings and rules
- do not place inline hex literals directly in
settings or rules
- Match the actual compiler schema in
build/theme_compiler/:
- required top-level keys:
name, settings, rules
- optional top-level key:
palette
palette values must be hex colors
- required
settings keys: foreground, background, line_highlight
settings.foreground, settings.background, and settings.line_highlight must reference palette keys
rules must not be empty
- each rule may contain
name, scope, foreground, background, font_style
rules[*].foreground and rules[*].background, when present, must reference palette keys
- each rule must define at least one of
foreground, background, or font_style
scope must be a single valid TextMate selector string
font_style values are bold, italic, and underline
- Treat unknown YAML keys as invalid rather than inventing extra structure.
Amp requires these base theme settings:
settings.foreground
settings.background
settings.line_highlight
When the user does not provide a complete scope list, do not stop at a small "practical first pass". Map the requested palette onto the canonical token families in the reference file so common code tokens do not collapse to the default foreground.
Workflow
- Identify the requested theme name and whether it is dark, light, or otherwise palette-driven.
- Inspect nearby files in
themes/ for filename and YAML rule-shape conventions.
- Read references/token-color-standard.md and choose colors for each required family.
- Create or update a YAML theme source with:
- top-level
name
- a
palette containing the authored hex colors
settings.foreground, settings.background, and settings.line_highlight as palette-key references
rules covering the canonical token families in the reference, using the requested palette
- Prefer broadly useful TextMate scopes and stable fallback tiers instead of copying an existing bundled theme's exact rule list.
- Validate through the repository build path before finishing.
Output Guidelines
For Generated Or Updated Themes
- Use a filename stem that matches the theme key Amp will expose in theme selection.
- Keep the YAML concise and readable rather than encoding generated
.tmTheme structure by hand.
- Put literal hex values in
palette, not directly in settings or per-rule color fields.
- If the requested palette is underspecified, make the smallest reasonable set of assumptions and state them briefly.
- Prefer semantically complete coverage over an artificially tiny rule set.
- Ensure the base settings are sufficient for Amp's UI color mapping:
settings.foreground is used for default text
settings.background is used for inverted background mappings
settings.line_highlight is used for the focused or current-line background
- Use the default foreground as a last-resort fallback, not as the intended color for common code tokens.
- Keep at least two punctuation tiers when the palette allows it:
- structural punctuation can stay muted
- semantic operators should remain clearly visible
- Distinguish the following families whenever the palette allows it:
- comments
- strings
- numbers and constants
- keywords and storage
- functions and methods
- types and namespaces
- local variables
- parameters
- support or builtin symbols
- annotations or attributes
- semantic operators
- structural punctuation
- Rust is a useful stress case for validation, but the output must remain cross-language and useful for markup and configuration formats too.
For Validation
- Prefer
cargo check as the main smoke test. It runs build.rs, compiles themes/*.yml, and loads the generated bundled themes.
- Use
cargo test --test theme_compiler when validating compiler-schema behavior or debugging theme-source failures.
- Treat inline color literals outside
palette as source-format errors.
- If there is no dedicated theme test for a specific change, still perform at least a build-path smoke check before finishing.
- When updating a bundled example theme, prefer adding or running a test that confirms the compiled theme loads and that key token families are represented by explicit scope rules.
1---2name: theme-definition3description: Create or update a bundled YAML theme source in the repository `themes/` directory when asked for a specific color theme such as Gruvbox, Nord, or a custom dark or light palette. These YAML files are compiled into TextMate `.tmTheme` files during the build.4---56# Theme Definition78Use this skill when asked to create or update a bundled theme definition for a named color theme or palette.910## Goal1112Create or update exactly one bundled theme source file in the repository top-level `themes/` directory:1314- `themes/<theme-name>.yml`1516Examples:1718- `Gruvbox Dark` -> `themes/gruvbox_dark.yml`19- `Nord Light` -> `themes/nord_light.yml`20- `My Theme` -> `themes/my_theme.yml`2122If a matching file already exists, update it instead of creating a duplicate.2324The YAML source is the authored artifact. Amp's build compiles it into a generated `.tmTheme` file with the same key during `build.rs`.2526## Required Constraints2728- Only author bundled YAML theme sources in `themes/`.29- Do not manually create or edit generated `.tmTheme` files for bundled themes.30- Do not write the theme anywhere except the top-level `themes/` directory unless the user explicitly asks for something else.31- Use the semantic token-family standard in [references/token-color-standard.md](references/token-color-standard.md) whenever the user does not provide a custom scope map.32- Treat `palette` as the single source of truth for authored colors:33 - define hex literals in `palette`34 - reference palette keys from `settings` and `rules`35 - do not place inline hex literals directly in `settings` or `rules`36- Match the actual compiler schema in `build/theme_compiler/`:37 - required top-level keys: `name`, `settings`, `rules`38 - optional top-level key: `palette`39 - `palette` values must be hex colors40 - required `settings` keys: `foreground`, `background`, `line_highlight`41 - `settings.foreground`, `settings.background`, and `settings.line_highlight` must reference palette keys42 - `rules` must not be empty43 - each rule may contain `name`, `scope`, `foreground`, `background`, `font_style`44 - `rules[*].foreground` and `rules[*].background`, when present, must reference palette keys45 - each rule must define at least one of `foreground`, `background`, or `font_style`46 - `scope` must be a single valid TextMate selector string47 - `font_style` values are `bold`, `italic`, and `underline`48- Treat unknown YAML keys as invalid rather than inventing extra structure.4950Amp requires these base theme settings:5152- `settings.foreground`53- `settings.background`54- `settings.line_highlight`5556When the user does not provide a complete scope list, do not stop at a small "practical first pass". Map the requested palette onto the canonical token families in the reference file so common code tokens do not collapse to the default foreground.5758## Workflow59601. Identify the requested theme name and whether it is dark, light, or otherwise palette-driven.612. Inspect nearby files in `themes/` for filename and YAML rule-shape conventions.623. Read [references/token-color-standard.md](references/token-color-standard.md) and choose colors for each required family.634. Create or update a YAML theme source with:64 - top-level `name`65 - a `palette` containing the authored hex colors66 - `settings.foreground`, `settings.background`, and `settings.line_highlight` as palette-key references67 - `rules` covering the canonical token families in the reference, using the requested palette685. Prefer broadly useful TextMate scopes and stable fallback tiers instead of copying an existing bundled theme's exact rule list.696. Validate through the repository build path before finishing.7071## Output Guidelines7273### For Generated Or Updated Themes7475- Use a filename stem that matches the theme key Amp will expose in theme selection.76- Keep the YAML concise and readable rather than encoding generated `.tmTheme` structure by hand.77- Put literal hex values in `palette`, not directly in `settings` or per-rule color fields.78- If the requested palette is underspecified, make the smallest reasonable set of assumptions and state them briefly.79- Prefer semantically complete coverage over an artificially tiny rule set.80- Ensure the base settings are sufficient for Amp's UI color mapping:81 - `settings.foreground` is used for default text82 - `settings.background` is used for inverted background mappings83 - `settings.line_highlight` is used for the focused or current-line background84- Use the default foreground as a last-resort fallback, not as the intended color for common code tokens.85- Keep at least two punctuation tiers when the palette allows it:86 - structural punctuation can stay muted87 - semantic operators should remain clearly visible88- Distinguish the following families whenever the palette allows it:89 - comments90 - strings91 - numbers and constants92 - keywords and storage93 - functions and methods94 - types and namespaces95 - local variables96 - parameters97 - support or builtin symbols98 - annotations or attributes99 - semantic operators100 - structural punctuation101- Rust is a useful stress case for validation, but the output must remain cross-language and useful for markup and configuration formats too.102103### For Validation104105- Prefer `cargo check` as the main smoke test. It runs `build.rs`, compiles `themes/*.yml`, and loads the generated bundled themes.106- Use `cargo test --test theme_compiler` when validating compiler-schema behavior or debugging theme-source failures.107- Treat inline color literals outside `palette` as source-format errors.108- If there is no dedicated theme test for a specific change, still perform at least a build-path smoke check before finishing.109- When updating a bundled example theme, prefer adding or running a test that confirms the compiled theme loads and that key token families are represented by explicit scope rules.