Skip to content

Commit a07c197

Browse files
yGuyclaude
andcommitted
Release v0.2.0: Add comprehensive ESLint plugin integration
Added official @yfiles/eslint-plugin documentation and guidance across multiple skills: Skills Updated: - yfiles-init: Comprehensive ESLint setup guide with examples and configuration - yfiles-nodestyle-*: Added BaseClass() rule notes for interface implementation - yfiles-interactivity: Added event listener rule notes - yfiles-graphbuilder: Added setter methods rule warning Documentation: - Added complete ESLint configuration examples (flat config and legacy) - Documented all 8 yFiles ESLint rules with explanations - Added TypeScript configuration guidance for typed linting - Updated README with ESLint feature - Created CLAUDE.md for repository guidance This release enhances the plugin's ability to help LLMs and developers write correct yFiles 3.0 code by leveraging the official ESLint plugin that catches common mistakes from deprecated yFiles 2.6 patterns. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 07f508b commit a07c197

File tree

12 files changed

+470
-2
lines changed

12 files changed

+470
-2
lines changed

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yfiles",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Comprehensive skills for developing yFiles for HTML applications including initialization, graph building, layouts, custom styling, and interactivity features",
55
"author": {
66
"name": "yFiles Team",

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ All notable changes to the yFiles Claude Plugin will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.0] - 2026-02-10
9+
10+
### Added
11+
- ESLint plugin documentation in `yfiles-init` skill
12+
- Comprehensive ESLint configuration guide in reference.md covering installation, flat config, and legacy .eslintrc
13+
- Detailed explanation of all 8 yFiles ESLint rules
14+
- Complete eslint.config.mjs example in examples.md
15+
- TypeScript configuration guidance for typed linting
16+
- Added ESLint setup to implementation checklist
17+
- ESLint rule notes across multiple skills:
18+
- `yfiles-nodestyle-basic`, `yfiles-nodestyle-configure`, `yfiles-nodestyle-interaction`, `yfiles-nodestyle-advanced`: Note about `@yfiles/fix-implements-using-baseclass` rule
19+
- `yfiles-interactivity`: Note about `@yfiles/replace-legacy-event-listeners` rule for correct event handling
20+
- `yfiles-graphbuilder`: Warning about `@yfiles/suggest-setter-methods` rule for readonly properties
21+
- ESLint integration feature in README.md
22+
23+
### Changed
24+
- Updated `yfiles-init` skill implementation steps to include ESLint configuration as recommended Step 4
25+
826
## [0.1.0] - 2026-02-09
927

1028
### Added
@@ -104,4 +122,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
104122

105123
## Version History
106124

125+
- **0.2.0** (2026-02-10) - Added comprehensive ESLint plugin integration
107126
- **0.1.0** (2026-02-09) - Initial release with 8 comprehensive skills

CLAUDE.md

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
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.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This plugin includes 8 specialized skills covering all aspects of yFiles for HTM
2828
**API References** - Complete documentation for each feature
2929
**MCP Integration** - Works with yFiles MCP server for up-to-date API info
3030
**Progressive Disclosure** - Main skill files with detailed reference docs
31+
**ESLint Integration** - Includes guidance for the official @yfiles/eslint-plugin to catch common mistakes
3132

3233
## Installation
3334

skills/yfiles-graphbuilder/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ See [examples.md](examples.md) for full working code.
6161
- **Provider functions**: For computed values (styles, labels, layouts)
6262
- **updateGraph()**: Updates existing graph instead of rebuilding
6363

64+
**Important**: Never directly assign to readonly properties like `node.layout`, `edge.sourceNode`, or `edge.targetNode`. Use IGraph methods instead (e.g., `graph.setNodeLayout()`, `graph.setEdgePorts()`). The `@yfiles/eslint-plugin` rule `@yfiles/suggest-setter-methods` warns about these mistakes.
65+
6466
## After Building
6567

6668
Graph likely needs layout:

skills/yfiles-init/SKILL.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Setup Progress:
2525
- [ ] Create HTML entry point
2626
- [ ] Create main TypeScript/JavaScript file
2727
- [ ] Adjust import paths for license
28+
- [ ] Configure ESLint with yFiles plugin (recommended)
2829
- [ ] Test in browser
2930
```
3031

@@ -60,7 +61,17 @@ License path depends on demo location:
6061
- `demos-ts/category/demo/`: Use `../../../lib/license.json`
6162
- Adjust depth as needed
6263

63-
**Step 4: Test**
64+
**Step 4: Configure ESLint (Recommended)**
65+
66+
The official `@yfiles/eslint-plugin` helps catch common mistakes and ensures yFiles 3.0 best practices:
67+
68+
```bash
69+
npm i -D eslint typescript typescript-eslint @yfiles/eslint-plugin
70+
```
71+
72+
See [reference.md](reference.md) for complete ESLint configuration.
73+
74+
**Step 5: Test**
6475

6576
```bash
6677
npm start

skills/yfiles-init/examples.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,60 @@ Complete file templates for initializing yFiles applications.
2323
</html>
2424
```
2525

26+
## ESLint Configuration (Recommended)
27+
28+
### eslint.config.mjs
29+
30+
```javascript
31+
// eslint.config.mjs
32+
import tseslint from "typescript-eslint";
33+
import yfilesconfigs from "@yfiles/eslint-plugin/configs";
34+
35+
export default tseslint.config(
36+
// TypeScript rules (type-checked)
37+
...tseslint.configs.recommendedTypeChecked,
38+
39+
// yFiles plugin preset (type-checked)
40+
yfilesconfigs.recommendedTypeChecked,
41+
42+
// Configure TypeScript project for typed linting
43+
{
44+
languageOptions: {
45+
parserOptions: {
46+
project: ["./tsconfig.json"],
47+
tsconfigRootDir: import.meta.dirname,
48+
},
49+
},
50+
},
51+
52+
// Optional: customize individual rules
53+
{
54+
rules: {
55+
// Enforce yFiles 3.0 import syntax
56+
"@yfiles/replace-legacy-imports": "error",
57+
// Enforce BaseClass() wrapper for interfaces
58+
"@yfiles/fix-implements-using-baseclass": "error",
59+
},
60+
}
61+
);
62+
```
63+
64+
### Installation
65+
66+
```bash
67+
npm i -D eslint typescript typescript-eslint @yfiles/eslint-plugin
68+
```
69+
70+
### Usage
71+
72+
```bash
73+
# Lint all files
74+
npx eslint .
75+
76+
# Auto-fix issues
77+
npx eslint . --fix
78+
```
79+
2680
## TypeScript Template (Minimal)
2781

2882
```typescript

0 commit comments

Comments
 (0)