Overview
Runningditto-spec init --agent installs three slash commands into .claude/commands/. These give agents interactive, multi-step workflows for working with Ditto specs.
Skills are committed to your repo alongside Ditto spec files and config — every team member gets them automatically, no separate plugin install.
/ditto-spec-component
Analyze a component, create Ditto spec files for it and its dependencies, auto-fill surfaces and tags, and sync style guide rules from the platform.Button) or a file path (e.g. src/components/Button/index.tsx).
Workflow
Discovery
Locates the component, walks its imports to find child components that render user-facing text, and checks which components already have Ditto specs.
Surface analysis
For each component needing a Ditto spec, identifies every text surface — string props,
children, nested props, hardcoded strings — and suggests tags from the workspace.ditto.md tag inventory. Estimates maxLength where layout context provides constraints.Pauses for your review before creating any files. You can add, remove, or modify surfaces and tags./ditto-spec-audit
Audit copy in component instances against the style guide rules in their Ditto spec files and report violations.Workflow
Load specs
Reads
workspace.ditto.md and each relevant component’s index.ditto.md to build the full set of style guide rules — workspace rules, component-level rules, per-surface rules, and locale-scoped rules.Find instances
Searches the codebase for files that import and render each component. For each instance, resolves the actual copy bound to every text surface:
- Inline — string literals, template strings, hardcoded text
- i18n keys — resolves values across all locale catalogs, including plural forms
- Ditto text items — resolves values across variant files by Developer ID
- Unresolvable — flags dynamic or computed values for manual review
Evaluate
Checks each instance’s copy against all applicable style guide rules — style rules, terminology entries,
maxLength constraints, and locale-scoped rules where relevant./ditto-spec-gaps
Find style guide rule gaps — copy patterns that should be rules but aren’t — then create them on the platform.Workflow
Load existing rules
Reads Ditto specs and runs
ditto-spec rules to load the complete set of style guide rules on the platform — not just the rules that match local tags. This prevents proposing duplicates of rules that exist but aren’t tagged for local components.Analyze text
Gathers copy from all component instances (inline, i18n, Ditto text items) and looks for patterns no existing style guide rule covers:
- Terminology inconsistencies — the same concept with different forms (e.g. “sign up” vs “signup”)
- Tone mismatches — some instances formal, others casual
- Anti-patterns — passive voice in CTAs, redundant wording
- Conventions that should be formalized (e.g. “all action buttons start with a verb”)
Propose rules
Presents proposed style rules and terminology entries with names, descriptions, tags, examples, and target sections.Pauses for your review. You choose which rules to create, modify, or skip.
This is the only skill that writes to the Ditto platform. The other two skills are read-only.
Updating and customizing
Skill files are plain markdown in.claude/commands/. You can edit them to add project-specific behavior — custom tags, additional audit checks, or tailored prompts.
To update skills to the latest CLI version:
Re-running
init --agent overwrites skill files with the current templates and removes legacy skill files (previously named spec-component.md, etc.). If you’ve customized skills, commit your changes first, then use --force to accept the update and merge in your customizations.