|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## About This Repository |
| 6 | + |
| 7 | +This is a **Claude Code plugin** for yFiles for HTML development. It provides 8 specialized skills that help developers create yFiles applications more effectively. This is NOT a traditional software project - it's a collection of skill definitions, examples, and documentation. |
| 8 | + |
| 9 | +## Repository Structure |
| 10 | + |
| 11 | +``` |
| 12 | +yfiles-claude-plugin/ |
| 13 | +├── .claude-plugin/ |
| 14 | +│ └── plugin.json # Plugin metadata and MCP server configuration |
| 15 | +├── skills/ # Skill definitions (8 skills) |
| 16 | +│ ├── yfiles-init/ |
| 17 | +│ ├── yfiles-graphbuilder/ |
| 18 | +│ ├── yfiles-layout/ |
| 19 | +│ ├── yfiles-nodestyle-basic/ |
| 20 | +│ ├── yfiles-nodestyle-configure/ |
| 21 | +│ ├── yfiles-nodestyle-interaction/ |
| 22 | +│ ├── yfiles-nodestyle-advanced/ |
| 23 | +│ └── yfiles-interactivity/ |
| 24 | +├── .github/workflows/ |
| 25 | +│ └── validate.yml # GitHub Actions validation |
| 26 | +├── README.md # User-facing documentation |
| 27 | +├── QUICKREF.md # Quick reference for all skills |
| 28 | +├── CONTRIBUTING.md # Development guidelines |
| 29 | +├── CHANGELOG.md # Version history |
| 30 | +└── SETUP.md # GitHub publishing guide |
| 31 | +``` |
| 32 | + |
| 33 | +## Skill Architecture |
| 34 | + |
| 35 | +Each skill directory follows a consistent structure: |
| 36 | + |
| 37 | +- **SKILL.md** - Main skill definition with frontmatter metadata (name, description, triggers) |
| 38 | +- **examples.md** - 7-15 complete code examples from official yFiles demos |
| 39 | +- **reference.md** - Detailed API documentation and patterns |
| 40 | +- **patterns.md** (optional) - Common implementation patterns |
| 41 | +- **algorithms.md** (optional) - Algorithm-specific guidance (layout skill) |
| 42 | +- **advanced.md** (optional) - Advanced topics |
| 43 | + |
| 44 | +### Skill Frontmatter Format |
| 45 | + |
| 46 | +```markdown |
| 47 | +--- |
| 48 | +name: skill-name |
| 49 | +description: Brief description with rich trigger keywords for auto-activation |
| 50 | +--- |
| 51 | +``` |
| 52 | + |
| 53 | +The description field is critical - it contains keywords that Claude uses to automatically activate the skill. |
| 54 | + |
| 55 | +## Development Workflow |
| 56 | + |
| 57 | +### Viewing/Testing the Plugin |
| 58 | + |
| 59 | +This plugin is consumed by Claude Code, not run directly. To test: |
| 60 | + |
| 61 | +```bash |
| 62 | +# Install plugin locally |
| 63 | +/plugin install yfiles@dir@/home/muellese/html-package/yfiles-3.0.0.4/yfiles-claude-plugin |
| 64 | + |
| 65 | +# Or use with --plugin-dir flag |
| 66 | +claude --plugin-dir /home/muellese/html-package/yfiles-3.0.0.4/yfiles-claude-plugin |
| 67 | + |
| 68 | +# Invoke a skill explicitly |
| 69 | +/yfiles:init |
| 70 | +/yfiles:graphbuilder |
| 71 | +``` |
| 72 | + |
| 73 | +### Validating Plugin Structure |
| 74 | + |
| 75 | +The repository includes GitHub Actions validation: |
| 76 | + |
| 77 | +```bash |
| 78 | +# Validation checks: |
| 79 | +# - .claude-plugin/plugin.json exists and is valid JSON |
| 80 | +# - Each skill has SKILL.md with proper frontmatter |
| 81 | +# - All referenced files exist |
| 82 | +# - No common structural issues |
| 83 | +``` |
| 84 | + |
| 85 | +There are no local build or test commands - validation happens through GitHub Actions or manual testing with Claude Code. |
| 86 | + |
| 87 | +### Creating a New Skill |
| 88 | + |
| 89 | +1. Create directory under `skills/` with descriptive name (e.g., `yfiles-edge-styles/`) |
| 90 | +2. Add **SKILL.md** with frontmatter and structured content: |
| 91 | + - Quick Start section |
| 92 | + - "Before Implementing" section with MCP tool calls |
| 93 | + - Core Concepts |
| 94 | + - When to Implement |
| 95 | + - Cross-references to other skills |
| 96 | +3. Add **examples.md** with 7-15 complete, runnable examples |
| 97 | +4. Add **reference.md** with full API documentation |
| 98 | +5. Update `README.md` to include the new skill |
| 99 | +6. Update `CHANGELOG.md` with the addition |
| 100 | +7. Test with actual yFiles projects |
| 101 | + |
| 102 | +### Modifying Existing Skills |
| 103 | + |
| 104 | +When updating skills: |
| 105 | + |
| 106 | +1. Read the entire skill (SKILL.md, examples.md, reference.md) first |
| 107 | +2. Maintain consistent structure and style with other skills |
| 108 | +3. Verify examples are extracted from official yFiles demos when possible |
| 109 | +4. Update trigger keywords in description if adding new use cases |
| 110 | +5. Cross-reference related skills |
| 111 | +6. Update CHANGELOG.md |
| 112 | + |
| 113 | +## Key Concepts |
| 114 | + |
| 115 | +### MCP Server Integration |
| 116 | + |
| 117 | +This plugin configures the yFiles MCP server in `.claude-plugin/plugin.json`: |
| 118 | + |
| 119 | +```json |
| 120 | +{ |
| 121 | + "mcpServers": { |
| 122 | + "yfiles": { |
| 123 | + "command": "npx", |
| 124 | + "args": ["-y", "yfiles-dev-suite@latest", "--mcp"] |
| 125 | + } |
| 126 | + } |
| 127 | +} |
| 128 | +``` |
| 129 | + |
| 130 | +All skills are designed to work with the yFiles MCP server for real-time API access. Skills should reference MCP tools using the `yfiles:` prefix (e.g., `yfiles:yfiles_get_symbol_details`). |
| 131 | + |
| 132 | +### Progressive Disclosure Pattern |
| 133 | + |
| 134 | +Skills follow a progressive disclosure pattern: |
| 135 | +- **SKILL.md**: Concise overview (under 100 lines), essential patterns |
| 136 | +- **examples.md**: Complete working examples with comments |
| 137 | +- **reference.md**: Exhaustive API details, configurations, best practices |
| 138 | + |
| 139 | +This prevents overwhelming Claude with too much information upfront while keeping details accessible. |
| 140 | + |
| 141 | +### Trigger-Based Activation |
| 142 | + |
| 143 | +Skills are auto-activated based on trigger keywords in the description field. Include rich keywords covering: |
| 144 | +- Feature names ("GraphBuilder", "HierarchicalLayout") |
| 145 | +- Action verbs ("initialize", "load", "arrange", "customize") |
| 146 | +- Use cases ("create app", "build graph from data") |
| 147 | +- API names ("createVisual", "isHit", "query-item-tool-tip") |
| 148 | + |
| 149 | +### Documentation Extraction |
| 150 | + |
| 151 | +Examples should be extracted from official yFiles demos when possible: |
| 152 | +- Ensures accuracy and best practices |
| 153 | +- Provides real-world, tested code |
| 154 | +- Maintains consistency with yFiles conventions |
| 155 | +- Reference the source demo in comments |
| 156 | + |
| 157 | +## Important Development Rules |
| 158 | + |
| 159 | +### What This Repository Is NOT |
| 160 | + |
| 161 | +- **NOT a yFiles application** - Don't try to run yFiles code here |
| 162 | +- **NOT a build project** - No compilation, bundling, or testing commands |
| 163 | +- **NOT a Node.js package** - No `npm install` or `package.json` |
| 164 | + |
| 165 | +### What This Repository IS |
| 166 | + |
| 167 | +- **A documentation repository** - Markdown files with structured content |
| 168 | +- **A skill library** - Definitions that Claude Code consumes |
| 169 | +- **An MCP integration** - Connects Claude to yFiles documentation |
| 170 | +- **A reference guide** - Examples and patterns for yFiles development |
| 171 | + |
| 172 | +### Guidelines for Modifications |
| 173 | + |
| 174 | +1. **Preserve structure** - Don't reorganize the skill file structure |
| 175 | +2. **Maintain consistency** - Follow patterns from existing skills |
| 176 | +3. **Use official examples** - Extract from yFiles demos, don't invent code |
| 177 | +4. **Test with Claude Code** - Verify skills activate correctly |
| 178 | +5. **Update all related files** - README, CHANGELOG, cross-references |
| 179 | +6. **Keep SKILL.md concise** - Move details to examples.md or reference.md |
| 180 | +7. **Rich trigger keywords** - Add comprehensive keywords to descriptions |
| 181 | +8. **Follow naming conventions** - Skills use `yfiles-feature-name` format |
| 182 | + |
| 183 | +## Version Management |
| 184 | + |
| 185 | +This plugin follows semantic versioning: |
| 186 | +- **MAJOR**: Breaking changes (removed skills, incompatible structure changes) |
| 187 | +- **MINOR**: New skills or backward-compatible features |
| 188 | +- **PATCH**: Bug fixes, documentation improvements, example updates |
| 189 | + |
| 190 | +Update version in `.claude-plugin/plugin.json` when making changes. |
| 191 | + |
| 192 | +## Installation Methods |
| 193 | + |
| 194 | +Users can install this plugin in three ways: |
| 195 | + |
| 196 | +1. **From GitHub** (when published): |
| 197 | + ```bash |
| 198 | + /plugin install yfiles@github@yworks/yfiles-for-html-claude-plugin |
| 199 | + ``` |
| 200 | + |
| 201 | +2. **From local directory**: |
| 202 | + ```bash |
| 203 | + /plugin install yfiles@dir@/path/to/yfiles-claude-plugin |
| 204 | + ``` |
| 205 | + |
| 206 | +3. **Copy to plugins directory**: |
| 207 | + ```bash |
| 208 | + cp -r yfiles-claude-plugin ~/.claude/plugins/yfiles |
| 209 | + ``` |
| 210 | + |
| 211 | +## Related Files |
| 212 | + |
| 213 | +- **SETUP.md** - Complete guide for publishing to GitHub |
| 214 | +- **CONTRIBUTING.md** - Detailed contribution guidelines |
| 215 | +- **QUICKREF.md** - Quick reference for all skills (for users) |
| 216 | +- **README.md** - User-facing documentation |
| 217 | +- **CHANGELOG.md** - Version history |
| 218 | + |
| 219 | +## Working with yFiles Context |
| 220 | + |
| 221 | +This plugin is designed to work within yFiles for HTML projects. When users invoke skills: |
| 222 | + |
| 223 | +1. Skills reference the yFiles MCP server for current API information |
| 224 | +2. Examples assume a yFiles project structure with license.json |
| 225 | +3. Code uses yFiles for HTML 3.0+ API patterns |
| 226 | +4. Import paths follow the package convention: `@yfiles/yfiles` |
| 227 | + |
| 228 | +The plugin itself does NOT contain yFiles code - it provides guidance for writing yFiles code. |
0 commit comments