cangjie-extension

Extend Cangjie types with functions, interfaces, and generic constraints.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the need to enhance and customize the Cangjie programming language by adding new functionalities and implementing interfaces to existing types.

Core Features & Use Cases

  • Direct Extension: Add new functions, operator overloads, and properties to existing types without modifying their original definition.
  • Interface Extension: Implement interfaces for types, enabling them to conform to specific contracts.
  • Generic Type Extension: Extend generic types with specific or new type parameters, including constraints.
  • Access Control & Rules: Understand and apply access rules, orphan rules, and export/import rules for extensions.
  • Use Case: You can add a printSize() method to the built-in String type in Cangjie, or implement a PrintSizeable interface for Array types.

Quick Start

Use the cangjie-extension skill to add a printSize function to the String type.

Frequently Asked Questions about cangjie-extension

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

FAQPage Schema
How do I add new functions to existing types in the Cangjie programming language?

To add new functions to existing types in the Cangjie programming language, use direct extensions to define new functions, operator overloads, and properties without modifying the original type definition.

Can I implement interfaces for built-in types like Array in Cangjie?

Yes, you can implement interfaces for built-in types in Cangjie. Interface extension allows you to implement specific contracts like a PrintSizeable interface for Array types, enabling them to conform to desired behaviors.

Does Cangjie support extending generic types with constraints?

Cangjie supports extending generic types with constraints. You can extend generic types by adding specific or new type parameters, including constraints, to enhance their type capabilities safely.

What are the access and orphan rules for type extensions in Cangjie?

Access and orphan rules in Cangjie govern type extensions by defining how access rules, orphan rules, and export/import rules are applied, ensuring safe language extensibility and preventing conflictive definitions.

When do I need to use direct extension versus interface extension in Cangjie?

Use direct extension in Cangjie when adding new functions or properties to a type, and use interface extension when you need existing types to conform to specific contracts, ensuring language extensibility based on your customization needs.