cangjie-package

Explain Cangjie package declarations, imports, re-exports, and access modifiers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers understand and manage the packaging, module import, and access control mechanisms within the Cangjie programming language, ensuring correct code organization and distribution.

Core Features & Use Cases

  • Package Declaration: Learn how to declare packages and match them with directory structures.
  • Module Imports: Understand different import syntaxes, including aliasing and re-exporting.
  • Access Modifiers: Grasp the nuances of private, internal, protected, and public access levels for top-level declarations.
  • Use Case: When building a multi-file Cangjie project, you need to correctly define packages, import necessary modules from other parts of your project or external libraries, and control the visibility of your functions and types.

Quick Start

Use the cangjie-package skill to learn how to declare a package named 'utils' in a file located at 'src/utils.cj'.

Frequently Asked Questions about cangjie-package

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

FAQPage Schema
How do I declare a package in a Cangjie multi-file project?

To declare a package in Cangjie, you must match the package declaration with the correct directory structure, such as declaring 'utils' in a file located at 'src/utils.cj' for proper code organization.

What access modifiers are available for top-level declarations in Cangjie?

Cangjie supports `private`, `internal`, `protected`, and `public` access modifiers for top-level declarations to control visibility and encapsulation across multi-file projects.

How does the import statement work for modules in Cangjie?

The Cangjie import statement allows you to bring external modules into your project, supporting different syntaxes including aliasing and re-exporting for effective dependency management.

How do I control visibility and encapsulation for functions in Cangjie?

You control visibility in Cangjie by applying top-level access modifiers like `private` or `internal` to your functions and types, ensuring proper encapsulation within your package structure.

Can I re-export imported modules in Cangjie programming language?

Yes, Cangjie supports re-exporting imported modules, allowing you to manage dependencies and expose necessary functionalities from other parts of your project effectively.