Agent skill
core-development
Work on the core package (types, validation, normalization, diff). Use when modifying DSL processing logic or data flow.
Install this agent skill to your Project
npx add-skill https://github.com/aiskillstore/marketplace/tree/main/skills/7nohe/core-development
SKILL.md
Core Package Development
The core package (packages/core/) is dependency-free and handles all DSL processing.
Data Flow
DSL (YAML input) → validate() → normalize() → IR → diff() → Patch
Key Files
| File | Purpose | Exports |
|---|---|---|
types.ts |
Type definitions | DSL*, IR*, Patch, WebSocket protocol |
validate.ts |
YAML validation | validate(dsl): ValidationResult |
normalize.ts |
DSL → IR conversion | normalize(dsl): IRDocument |
diff.ts |
IR diff calculation | diff(prev, next): Patch |
Type Hierarchy
DSL Types (user input) IR Types (normalized)
───────────────────── ────────────────────
DSLDocument IRDocument
├─ version: number ├─ version: number
├─ docId: string ├─ docId: string
├─ title?: string ├─ title: string
├─ nodes: DSLNode[] ├─ nodes: Record<string, IRNode>
└─ edges?: DSLEdge[] └─ edges: Record<string, IREdge>
DSLNode IRNode
├─ id: string ├─ id: string
├─ provider: string ├─ provider: string
├─ kind: string ├─ kind: string
├─ label?: string ├─ label: string (default: id)
├─ parent?: string ├─ parent: string | null
└─ layout: DSLLayout └─ layout: { x, y, w, h }
DSLEdge IREdge
├─ id: string ├─ id: string
├─ from: string ├─ from: string
├─ to: string ├─ to: string
└─ label?: string └─ label: string (default: "")
Patch Operations
type PatchOp =
| { op: "upsertNode"; node: IRNode }
| { op: "removeNode"; id: string }
| { op: "upsertEdge"; edge: IREdge }
| { op: "removeEdge"; id: string };
interface Patch {
baseRev: number;
nextRev: number;
ops: PatchOp[];
}
WebSocket Protocol Types
// Plugin → CLI
interface HelloMessage {
type: "hello";
docId: string;
secret?: string;
}
interface RequestFullMessage {
type: "requestFull";
docId: string;
}
// CLI → Plugin
interface FullMessage {
type: "full";
rev: number;
ir: IRDocument;
}
interface PatchMessage {
type: "patch";
baseRev: number;
nextRev: number;
ops: PatchOp[];
}
interface ErrorMessage {
type: "error";
message: string;
}
Development Workflow
- Modify types → Update
types.ts - Update validation → Ensure
validate.tscatches invalid input - Update normalization → Handle new fields/defaults in
normalize.ts - Update diff → Handle new patch scenarios in
diff.ts - Add tests → Co-located
*.test.tsfiles - Run tests →
bun test packages/core/
Testing
# All core tests
bun test packages/core/
# Specific test file
bun test packages/core/src/diff.test.ts
bun test packages/core/src/validate.test.ts
bun test packages/core/src/normalize.test.ts
# Watch mode
bun test --watch packages/core/
Common Patterns
Adding a new node property
- Add to
DSLNodeandIRNodeintypes.ts - Add validation in
validate.ts - Add default value handling in
normalize.ts - Update diff logic if property affects equality
- Add test cases for validation, normalization, and diff
Adding a new edge property
- Add to
DSLEdgeandIREdgeintypes.ts - Add validation in
validate.ts - Add default value handling in
normalize.ts - Update diff logic for edge equality check
- Add test cases
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
perigon-backend
Perigon ASP.NET Core + EF Core + Aspire conventions
perigon-agent
Pointers for Copilot/agents to apply Perigon conventions
perigon-angular
Angular 21+ standalone/Material/signal conventions for Perigon WebApp
fastapi-mastery
Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation, Pydantic models, or FastAPI-specific features.
context7-efficient
Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.
browser-use
Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction.
Didn't find tool you were looking for?