kronos-dev-kcp

Design, implement, and test Kotlin compiler plugins using K2 FIR and IR APIs.

43|5|Updated Jun 4, 2024
One-click install
npx skills add https://github.com/Kronos-orm/Kronos-orm --skill kronos-dev-kcp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kronos-dev-kcp
Source: https://github.com/Kronos-orm/Kronos-orm/tree/main/.agents/skills/kronos-dev-kcp
Command: npx skills add https://github.com/Kronos-orm/Kronos-orm --skill kronos-dev-kcp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires kotlin-stdlib, kotlin-reflect, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and tools for designing, implementing, and testing Kotlin compiler plugins, focusing on the K2 FIR/frontend and IR/backend plugins, extension registration, diagnostics, and declaration generation.

Core Features & Use Cases

  • Programming Guide: Offers a step-by-step guide for Kotlin compiler plugin development, covering K2 FIR and IR APIs, diagnostics, and testing.
  • References: Provides detailed documentation on building Kotlin compiler plugins, including FIR checker APIs, declaration generation, and IR extension patterns.
  • Testing: Offers a comprehensive approach to testing Kotlin compiler plugins, including golden file testing and integration with Kotlin's test infrastructure.

Quick Start

Start using the kronos-dev-kcp to design a Kotlin compiler plugin by following the provided references and examples.

Frequently Asked Questions about kronos-dev-kcp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I develop a Kotlin compiler plugin using the K2 FIR frontend?

To develop a Kotlin compiler plugin using the K2 FIR frontend, you use FIR checker APIs and declaration generation patterns. This involves extending the compiler architecture by registering extensions and implementing specific frontend components to analyze and transform code.

What is the best way to test Kotlin compiler plugins?

The best way to test Kotlin compiler plugins is through golden file testing and integration with Kotlin's test infrastructure. This approach validates plugin behavior by comparing compiler outputs against expected reference files to ensure transformation accuracy.

How does IR backend extension work in Kotlin compiler plugins?

IR backend extension in Kotlin compiler plugins works by applying IR extension patterns to modify or generate code during the backend phase. It operates after the K2 FIR frontend, allowing developers to transform the intermediate representation for backend-specific optimizations.

Do I need to know Kotlin compiler architecture to build compiler plugins?

Yes, you need knowledge of Kotlin compiler architecture and plugin APIs to build compiler plugins. Understanding the K2 FIR frontend, IR backend, and extension registration mechanisms is required to effectively design, implement, and test plugin diagnostics and declarations.

Can I generate new declarations with Kotlin K2 FIR compiler plugins?

Yes, you can generate new declarations with Kotlin K2 FIR compiler plugins. The plugin development process specifically handles declaration generation, allowing you to programmatically introduce new synthetic elements into the codebase during the frontend analysis phase.