cangjie-interface

Explain Cangjie interface definition, implementation, inheritance, and default implementations.

1|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/SunriseSummer/CangjieDocValidator --skill cangjie-interface
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cangjie-interface
Source: https://github.com/SunriseSummer/CangjieDocValidator/tree/main/.github/skills/interface
Command: npx skills add https://github.com/SunriseSummer/CangjieDocValidator --skill cangjie-interface

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers understand and utilize the powerful interface definition and implementation features within the Cangjie programming language, enabling robust and flexible code design.

Core Features & Use Cases

  • Interface Definition: Learn how to declare abstract types, members (functions, properties), and sealed interfaces.
  • Implementation Strategies: Understand how to implement interfaces in classes and structs, including handling mut functions and return type variations.
  • Inheritance and Defaults: Explore interface inheritance, default implementations, and how Cangjie resolves diamond inheritance conflicts.
  • Advanced Concepts: Grasp the use of generic members, the Any type, and property usage within interfaces.
  • Use Case: When designing a new library or framework in Cangjie, use this Skill to ensure your interfaces are correctly defined, implemented, and extendable.

Quick Start

Use the cangjie-interface skill to learn how to define a basic interface with a function and a property.

Frequently Asked Questions about cangjie-interface

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

FAQPage Schema
How do I define and implement interfaces in the Cangjie programming language?

To define interfaces in Cangjie, declare abstract types, functions, and properties. Implement them in classes or structs by adhering to `mut` function rules and return type variations for robust code design.

How does Cangjie handle diamond inheritance conflicts in interfaces?

Cangjie resolves diamond inheritance conflicts in interfaces through specific language rules. The Skill explains these resolution mechanisms to ensure your interface hierarchies compile correctly without ambiguity.

Can I use default implementations and generic members in Cangjie interfaces?

Yes, Cangjie interfaces support default implementations and generic members. You can utilize these advanced features alongside the `Any` type to create flexible and extensible abstract definitions.

What are sealed interfaces in Cangjie and when should I use them?

Sealed interfaces in Cangjie restrict which types can implement them. Use sealed interfaces when designing libraries or frameworks to ensure controlled implementation and prevent unauthorized extensions.

How do `mut` function implementation rules differ between structs and classes in Cangjie?

`mut` function implementation rules in Cangjie dictate mutation behavior for structs and classes. The Skill details how to handle these rules and return type variations during interface implementation.