cangjie-interface

Explain Cangjie interface definitions, implementations, and inheritance patterns.

2|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/zhenzhizhi12/NexusAgent --skill cangjie-interface-zhenzhizhi12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cangjie-interface
Source: https://github.com/zhenzhizhi12/NexusAgent/tree/main/.opencode/skills/common-skill-l1/interface
Command: npx skills add https://github.com/zhenzhizhi12/NexusAgent --skill cangjie-interface-zhenzhizhi12

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers understand and utilize the complex features of Cangjie language interfaces, ensuring correct implementation and usage of abstract types and their behaviors.

Core Features & Use Cases

  • Interface Definition: Learn the syntax for defining abstract types, including members like functions, operators, and properties.
  • Interface Implementation: Understand how classes and structs implement interfaces, including handling mut functions and return type variations.
  • Inheritance and Defaults: Explore interface inheritance, default implementations, and how to resolve conflicts in diamond inheritance scenarios.
  • Advanced Concepts: Grasp the use of sealed interfaces, generic members, and the Any type for flexible programming.
  • Use Case: A developer needs to define a common contract for different data storage mechanisms (e.g., database, file system) and ensure all implementations adhere to specific methods like save and load.

Quick Start

Explain how to define a Cangjie interface named 'Shape' with a 'draw' function.

Frequently Asked Questions about cangjie-interface

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

FAQPage Schema
How do I define an interface in the Cangjie language?

To define a Cangjie interface, you declare an abstract type with member contracts like functions, operators, and properties. This Skill provides the syntax for defining interfaces such as 'Shape' with a 'draw' function.

How do classes and structs implement Cangjie interfaces?

Classes and structs implement Cangjie interfaces by adhering to defined member contracts, handling 'mut' functions for mutability, and ensuring return type variations match. This Skill details the rules for correct interface implementation.

How does interface inheritance handle default implementations and diamond inheritance conflicts in Cangjie?

Cangjie interface inheritance supports default implementations to provide baseline behavior. This Skill explains how to explore interface inheritance and resolve conflicts in diamond inheritance scenarios effectively.

Can I use sealed interfaces and generic constraints in Cangjie programming?

Yes, you can use sealed interfaces and generic members in Cangjie for flexible programming. This Skill helps you grasp advanced concepts including sealed interfaces, generic constraints, and the 'Any' type.

When should I use Cangjie interfaces for software design?

Use Cangjie interfaces when you need to define a common contract for different data storage mechanisms, ensuring all implementations adhere to specific methods like 'save' and 'load' for robust software design.