Enforces Zinc syntax and JASS migration standards.

Install

mkdir -p .claude/skills/zinc-j && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16517" && unzip -o skill.zip -d .claude/skills/zinc-j && rm skill.zip

Installs to .claude/skills/zinc-j

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

本项目 .j 文件中的 Zinc(//! zinc ... //! endzinc)语法与约定:库/结构体写法、匿名函数(无闭包)最佳实践、回调参数传递、资源释放/置空、以及 JASS->Zinc 迁移要点。
104 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Wrap Zinc code blocks with `//! zinc` and `//! endzinc`
  • Declare arrays using `type name[];` without specifying size
  • Declare local variables at the beginning of functions
  • Release handle resources using `Destroy*` or `Remove*` APIs
  • Define static methods with `static method foo(...)` syntax
  • Migrate JASS `loop/exitwhen/endloop` to Zinc `for` loops

How it works

The skill provides guidelines for writing Zinc code, covering syntax, variable declarations, function ordering, and resource management. It also details how to migrate JASS code constructs to their Zinc equivalents.

Inputs & outputs

You give it
JASS code or Zinc code
You get back
Zinc code adhering to project conventions

When to use zinc-j

  • Write optimized Zinc code
  • Migrate JASS to Zinc
  • Ensure proper handle resource release

About this skill

Zinc(本项目)语法与约定

必须遵守

  • //! zinc / //! endzinc 包裹 Zinc 代码块。
  • 禁用 ++/--;用 += 1 / -= 1
  • 禁用 break/continue;用 if 分支或布尔开关改写。
  • 数组声明一律用 type name[];,不要写大小(例如 integer a[10] 是错的)。
  • 返回类型用 -> type 写在参数列表后;无返回可省略。
  • 局部变量统一在函数/匿名函数开头声明:先基础类型,后句柄类型。
  • 函数定义顺序按“自上而下可见”处理:下方函数可以直接调用上方函数;上方函数不能直接调用下方函数。
  • 上方若必须调用下方逻辑:优先把下方逻辑封装到 struct 静态方法后再调用;或使用 xxxx.execute(...) / xxxx.evaluate(...) 间接调用。
  • 本地场景(例如 UI 本地执行)禁止 execute,只能用 evaluate,否则有 OOS 风险。

匿名函数(无闭包)

  • 匿名函数内不能直接访问外层局部变量;需要显式传参。
  • 传参优先用结构体/库的 static 成员变量,并在回调结束后立刻清理为默认值(null/0/"")。
  • 临时触发器回调用 CreateTrigger + TriggerAddCondition + TriggerEvaluate,随后 DestroyTrigger 并置 null

句柄生命周期(资源释放)

  • 创建出来的句柄资源(timer/trigger/group/effect/location/...):按对应 Destroy* / Remove* API 释放,并在作用域末尾 = null
  • 结构体析构只写 method onDestroy();不要自定义 destroy()

结构体/方法写法

  • 静态方法:static method foo(...) -> type { ... }
  • 实例方法:method foo(...) -> type { ... }
  • 纯静态“管理器”可用 struct X [] { ... }(避免 create/destroy)。

跨位置调用与性能约束

  • execute:不带返回值(底层是 TriggerExecute 触发 action)。
  • evaluate:可用于需要返回值或不需要返回值的调用场景。
  • 非必要不要做“上方间接调下方”;编译后会为这类调用生成额外 trigger/condition 包装,有额外资源开销。
  • 仅在必要情形(例如循环调用链 A -> B -> A)才设计成上方间接调下方。

JASS -> Zinc 迁移要点

  • JASS 默认 public;Zinc 默认 private:需要对外可见的函数/全局变量要显式 public
  • loop/exitwhen/endloop 优先改写为 Zinc 的范围 for (a <= i <= b) 或常规 for。
  • timer/trigger 的一次性逻辑优先改成匿名回调。

References(按需加载)

  • references/jass-to-zinc.md
  • references/anonymous-functions.md
  • references/callback-params.md
  • references/method-syntax.md
  • references/function-order-and-indirect-call.md

When not to use it

  • When using `++/--` operators
  • When using `break/continue` statements
  • When calling a lower-order function from a higher-order function without using a struct static method or `execute`/`evaluate`

Limitations

  • Anonymous functions cannot directly access outer local variables
  • Local UI scenarios prohibit `execute` due to OOS risk
  • Custom `destroy()` methods are not allowed for struct destruction

How it compares

This skill provides specific Zinc syntax and convention rules, unlike a generic linter that might not enforce project-specific patterns.

Compared to similar skills

zinc-j side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
zinc-j (this skill)06moNo flagsIntermediate
architect-review1094moNo flagsAdvanced
solid-principles579moNo flagsIntermediate
codex322moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

architect-review

sickn33

Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.

109320

solid-principles

SmidigStorm

Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.

57236

codex

Lucklyric

Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.

32238

error-handling-patterns

wshobson

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

35170

deepwiki-rs

sopaco

AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.

25170

senior-fullstack

davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.

35110

Search skills

Search the agent skills registry