Agent skill
yfiles-init
Initializes new yFiles for HTML applications with GraphComponent, license registration, and basic setup. Use when creating demos, starting projects, scaffolding applications, or when user mentions "create app", "new demo", "initialize", or "setup yfiles".
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/yfiles-init
SKILL.md
Initialize yFiles Application
Creates a complete yFiles application following package conventions.
Quick Start
/yfiles-init [demo-name]
Creates in current directory if no name specified.
Setup Checklist
Copy this checklist and track progress:
Setup Progress:
- [ ] Verify GraphComponent API with yFiles MCP
- [ ] Create HTML entry point
- [ ] Create main TypeScript/JavaScript file
- [ ] Adjust import paths for license
- [ ] Configure ESLint with yFiles plugin (recommended)
- [ ] Test in browser
Implementation
Step 1: Verify APIs
Use yFiles MCP server to confirm current API:
yfiles:yfiles_get_symbol_details(name="GraphComponent")
yfiles:yfiles_list_members(name="GraphComponent", includeInherited=true)
Step 2: Create files
See examples.md for complete file templates.
Essential pattern:
import { GraphComponent, GraphEditorInputMode, License } from '@yfiles/yfiles'
import licenseData from '../../lib/license.json'
License.value = licenseData // MUST come first
const graphComponent = new GraphComponent('#graphComponent')
graphComponent.inputMode = new GraphEditorInputMode()
Step 3: Adjust import paths
License path depends on demo location:
demos-ts/category/demo/: Use../../../lib/license.json- Adjust depth as needed
Step 4: Configure ESLint (Recommended)
The official @yfiles/eslint-plugin helps catch common mistakes and ensures yFiles 3.0 best practices:
npm i -D eslint typescript typescript-eslint @yfiles/eslint-plugin
See reference.md for complete ESLint configuration.
Step 5: Test
npm start
# Navigate to http://localhost:4242/demos-ts/your-demo/
Key Rules
- License first:
License.value = licenseDatabefore any yFiles API - Use CSS selectors:
new GraphComponent('#id')ornew GraphComponent(element) - Access graph via:
graphComponent.graph - Set defaults before creating: Configure
graph.nodeDefaults.stylebeforecreateNode()
Reference Files
- examples.md: Complete code templates
- reference.md: API patterns and options
MCP Tools for Reference
yfiles:yfiles_get_symbol_details- Get API detailsyfiles:yfiles_search_symbols- Find classes/interfacesyfiles:yfiles_search_documentation- Find tutorials
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?