Agent skill

Code Method Normalize

by afkT in afkT/DevUtils

规范化新生成或改写的 Java/Kotlin 方法:Java 用 JavaDoc、Kotlin 用 KDoc,两套规则不混用; Java 入参 final(抽象方法、接口默认方法、@Override 实现除外一律不加); 方法注释与备注同一套结构:首段/首行无内联代码与类型引用,补充说明用 <pre 包裹; 有返回值且带参时补全 @param/@return;Kotlin 的 @param…

Apache-2.0Auto-check passedMobile

Install Code Method Normalize

skills CLI
$ npx skills add afkT/DevUtils --skill code-method-normalize -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install afkT/DevUtils code-method-normalize --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/afkT/DevUtils.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/code-method-normalize .claude/skills/code-method-normalize && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-method-normalize
GitHub stars
1.6k
Token cost
~1.5k tokens
SKILL.md length
357 words
Files
1
Skills in repo
13
Repo updated
First seen
Licence
Apache-2.0

At a glance

规范化新生成或改写的 Java/Kotlin 方法:Java 用 JavaDoc、Kotlin 用 KDoc,两套规则不混用; Java 入参 final(抽象方法、接口默认方法、@Override 实现除外一律不加); 方法注释与备注同一套结构:首段/首行无内联代码与类型引用,补充说明用 <pre 包裹; 有返回值且带参时补全 @param/@return;Kotlin 的 @param…

  • Works in 9 steps: 文档风格:JavaDoc vs KDoc(必须分语言) → 语言差异:入参 final(仅 Java) → @param / @return(JavaDoc 与 KDoc 均适用块标签) → …
  • Tasks that involve Android development
  • SKILL.md covers 0. 文档风格:JavaDoc vs KDoc(必须分语言), 1. 语言差异:入参 final(仅 Java), 2. @param / @return(JavaDoc 与… and 3. 返回类型为 Boolean / boolean 时的…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Code Method Normalize is an agent skill from afkT/DevUtils. 规范化新生成或改写的 Java/Kotlin 方法:Java 用 JavaDoc、Kotlin 用 KDoc,两套规则不混用; Java 入参 final(抽象方法、接口默认方法、@Override 实现除外一律不加); 方法注释与备注同一套结构:首段/首行无内联代码与类型引用,补充说明用 <pre 包裹; 有返回值且带参时补全 @param/@return;Kotlin 的 @param 行不写 [类型](签名已标明);boolean 的 @return:Java 用 {@code true}/{@code false},Kotlin 用 true/false; 类型引用:Java {@link …},Kotlin @return/<pre 等用 […];优先返回入参或有语义的对象替代无意义 void;异常在方法内捕获并安全返回。 在用户要求规范化方法、统一工具类写法、整理 Javadoc/KDoc、或按 DevUtils 方法风格处理时使用。

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering Android development. It works with Kotlin and Java. The repository describes itself as: :fire: ( 持续更新,目前含 300+ 工具类 ) DevUtils 是一个 Android 工具库,主要根据不同功能模块,封装快捷使用的工具类及 API 方法调用。该项目尽可能的便于开发人员,快捷、高效开发安全可靠的项目。 The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Android development

Example prompts

  • “/code-method-normalize”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. 文档风格:JavaDoc vs KDoc(必须分语言)
  2. 语言差异:入参 final(仅 Java)
  3. @param / @return(JavaDoc 与 KDoc 均适用块标签)
  4. 返回类型为 Boolean / boolean 时的 @return
  5. 类与符号引用(补充说明、正文叙述)
  6. 方法注释 vs 方法备注(Java / Kotlin 同一套结构)
  7. 返回值与 void / Unit
  8. 异常与崩溃
  9. 执行清单(改写方法时自测)

What it can do on your machine

Read from SKILL.md and the folder at commit 6022ede. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are java and kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Method Normalize loads about 1.5k tokens when it runs. Until then it costs about 114 tokens; SKILL.md has 357 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~114
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from afkT/DevUtils at commit 6022ede, republished under its Apache-2.0 licence (© afkT). 357 words, ~1,475 tokens.

Download SKILL.mdSave it as .claude/skills/code-method-normalize/SKILL.md (or your agent's skills folder).
name
code-method-normalize
description
规范化新生成或改写的 Java/Kotlin 方法:Java 用 JavaDoc、Kotlin 用 KDoc,两套规则不混用; Java 入参 final(抽象方法、接口默认方法、@Override 实现除外一律不加); 方法注释与备注同一套结构:首段/首行无内联代码与类型引用,补充说明用 <pre> 包裹; 有返回值且带参时补全 @param/@return;Kotlin 的 @param 行不写 [类型](签名已标明);boolean 的 @return:Java 用 {@code true}/{@code false},Kotlin 用 `true`/`false`; 类型引用:Java {@link …},Kotlin @return/<pre> 等用 […];优先返回入参或有语义的对象替代无意义 void;异常在方法内捕获并安全返回。 在用户要求规范化方法、统一工具类写法、整理 Javadoc/KDoc、或按 DevUtils 方法风格处理时使用。

Java / Kotlin:生成方法的规范化

对 新生成或改写 的方法按下列规则整理;仅改与规范化相关的部分,不扩大重构范围。

0. 文档风格:JavaDoc vs KDoc(必须分语言)

语言文档块语法说明
Java/** … */ JavaDoc{@link …}、{@code …} 等 JavaDoc 内联标签。
Kotlin/** … */ KDoc内联代码用 Markdown 反引号 `…`;类型/符号引用用 […](见下文「类与符号引用」)。禁止在 Kotlin 里写 JavaDoc 式的 {@link …} / {@code …}。

同一文件内若同时存在 Java 与 Kotlin,各自文件内严格对应上表,不把 JavaDoc 标签抄进 KDoc。

1. 语言差异:入参 final(仅 Java)

  • Java:普通(非下列例外)方法形参必须加 final。
  • 例外(一律不加 final):
    • abstract 抽象方法(含抽象类或接口中 无方法体 的抽象声明)的形参;
    • interface 中的默认方法(default)的形参;
    • 标注 @Override 的实现方法(覆盖父类 / 实现接口)的形参。
  • Kotlin:暂不要求为参数加等价约束(按语言惯例即可)。

2. @param / @return(JavaDoc 与 KDoc 均适用块标签)

  • 当方法 既有非 void / 非 Unit 的返回类型,又 至少有一个入参 时,必须写 @param(每个入参一条)与 @return。
  • void / Unit:若无返回语义,见下文第 6 节;若保留且无返回值可描述,可不写 @return(以项目既有风格为准时跟随项目)。
2.1 @param / @return 行里的类型标注(按语言)
  • Java(JavaDoc):@param intent {@link Intent}、@return {@link Intent} 等,用 {@link 完全限定或简单名}(与项目导入/可读性一致即可)。
  • Kotlin(KDoc):
    • @param:不要在参数名后再写 [类型];形参类型已在方法签名中,重复标注冗余且易与「正文里对类型的语义说明」混淆。直接写参数语义说明即可。
      • 错误:@param timestamp [Long] 触发用时间戳,大于 0 时执行一次
      • 正确:@param timestamp 触发用时间戳,大于 0 时执行一次
    • @return(以及 <pre> 等允许符号链接处):仍可用 [类型或符号名] 指向返回类型或相关 API,不用 {@link …}。

3. 返回类型为 Boolean / boolean 时的 @return

两种语言都要求 一句话里写清 true / false 各自含义(可对举),但 字面量标记方式不同:

3.1 Java(JavaDoc)
text
@return {@code true} XXXX, {@code false} XXX
  • 默认:XXXX、XXX 为简短中文说明,与业务语义一致。
  • 不必强制改成中文:若已符合上述形式,且两侧说明即可读、能区分语义(例如 @return {@code true} success, {@code false} fail、@return {@code true} yes, {@code false} no 等常见英文对举),保留即可。
3.2 Kotlin(KDoc)
text
@return `true` XXXX, `false` XXX
  • 使用 Markdown 行内代码(反引号)包裹 true / false 字面量,不使用 {@code true}。
  • 中英文对举规则与 Java 一节相同:新写默认中文;已对举且表意充分时可保留英文。

4. 类与符号引用(补充说明、正文叙述)

场景Java(JavaDoc)Kotlin(KDoc)
指向类、成员、常量等{@link 包.类#成员} 等标准 JavaDoc[ClassName] 或 [package.ClassName] 等 KDoc 符号链接语法
行内代码片段{@code foo()}`foo()`(反引号)

注意:首段摘要中仍遵守第 5 节「禁止直接引用」;{@link …} / `[Type]` / `code` 等应放在 <pre> 块 或 @return 行(Kotlin 的 @param 行不写 [类型],见第 2.1 节)等允许引用的位置,见下。

5. 方法注释 vs 方法备注(Java / Kotlin 同一套结构)

方法注释(KDoc/JavaDoc 的 首段摘要,通常首行)与 方法备注(其后的补充说明)共用下列规则:

Show full SKILL.md (152 more words)Show less
5.1 首段 / 首行:方法注释(摘要)
  • 只写方法功能用途:一句话、尽可能简短;可写版本/前提(如「Android 16+:……」)。
  • 禁止在首段直接写「代码形态」的引用,包括但不限于:
    • Java:首段内不出现 {@…}(含 {@code …}、{@link …} 等)。
    • Kotlin:首段内不出现 反引号代码 `…`,也不出现 方括号符号链接 […](避免首行变成「标识符列表」而非摘要)。
  • 首段为 纯叙述:说明「是什么 / 干什么」,不夹带可点击或可拷贝的 API 片段。
5.2 方法备注(首段之后的说明块)
  • 需要补充的场景、风险、滥用说明、API 名、类/方法引用、文档链接提示等,全部放在首段之后。
  • Java 与 Kotlin 均使用 <pre> … </pre> 包裹整块备注。
  • <pre> 内允许:
    • Java:{@code startActivity}、{@link Intent} 等;
    • Kotlin:`startActivity`、[Intent]、[IntentFilter] 等 KDoc 写法。
  • 与首段分工:首段 = 是什么/干什么;<pre> = 细节、约束、引用、注意事项。
5.3 参考结构

Java:

java
/**
 * Android 16+:关闭系统对 Intent 重定向的启动侧加固
 * <pre>
 *     极少数合法嵌套 {@code startActivity} 场景
 *     滥用会增大安全风险,仅当确有需要且已评估后再调用;详见官方「Intent 重定向」说明。
 * </pre>
 * @param intent {@link Intent}
 * @return {@link Intent}
 */
@RequiresApi(Build.VERSION_CODES.BAKLAVA)
public static Intent removeLaunchSecurityProtection(final Intent intent) {
    if (intent != null) {
        intent.removeLaunchSecurityProtection();
    }
    return intent;
}

Kotlin(对照 KDoc 写法):

kotlin
/**
 * Android 16+:关闭系统对 Intent 重定向的启动侧加固
 * <pre>
 *     极少数合法嵌套 `startActivity` 场景
 *     滥用会增大安全风险,仅当确有需要且已评估后再调用;详见官方「Intent 重定向」说明。
 * </pre>
 * @param intent 待处理的 Intent
 * @return [Intent]
 */
@RequiresApi(Build.VERSION_CODES.BAKLAVA)
fun removeLaunchSecurityProtection(intent: Intent?): Intent? {
    intent?.removeLaunchSecurityProtection()
    return intent
}

要点:首行无 {@}(Java)或无 `…` / […](Kotlin);<pre> 内 再放具体 API/类型引用;@param / @return 行按第 2、3 节区分 JavaDoc / KDoc(Kotlin 的 @param 不写 [类型])。

6. 返回值与 void / Unit

  • 非必要不写 void / Unit:若方法本质是「处理入参并供链式/复用」,优先 返回有意义的值;即使「没有额外返回语义」,也可 返回入参对象(如上的 return intent)或项目约定的空值(如 null),便于调用方连续书写。
  • 仅在确实无返回值且不宜伪造返回语义时,再使用 void / Unit。

7. 异常与崩溃

  • 不得因工具方法未捕获异常而导致主进程 未处理崩溃。
  • 可能抛出受检/运行时的逻辑:在方法内 try/catch,记录日志(若项目已有工具类则沿用),返回安全默认值(如 null、false、原入参、空集合等,与语义一致即可)。
  • 避免将「易在调用方忘记处理」的异常通过 throws 层层上抛至未捕获崩溃;宁可 在方法边界消化并返回异常语义下的安全值。

8. 执行清单(改写方法时自测)

  • Java → JavaDoc、Kotlin → KDoc,未混用 {@link} / `code` 规则。
  • Java 形参均已 final(抽象方法、interface default、@Override 方法除外不加)。
  • 有非 void / 非 Unit 返回值且有参:@param / @return 齐全。
  • boolean / Boolean:@return 分支说明齐全——Java {@code true} / {@code false};Kotlin `true` / `false`。
  • 首段无禁止引用(Java 无 {@};Kotlin 无首段 `…` / […]);补充说明在 <pre> 内。
  • 类型引用:Java 用 {@link …};Kotlin 在 @return 行与 <pre> 内 等可用 […];@param 行不写 [类型](见第 2.1 节)。
  • 能用返回入参/有意义值替代的,避免无意义 void / 无返回语义的 Unit。
  • 危险调用已 try/catch,不依赖未捕获异常传播。

© afkT, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/code-method-normalize of afkT/DevUtils.

Open the folder on GitHubat commit 6022ede

Compare with similar skills

Code Method Normalize next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Method Normalize compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Method Normalize this skillafkT/DevUtils1.6k—~1.5kAutomated safety check: PassApache-2.0
Build Teaql Appteaql/teaql-agent-kit2.8k—~4.6kAutomated safety check: PassMIT
Android Maps Ktxgooglemaps/android-maps-ktx360—~897Automated safety check: PassApache-2.0
Android Audio E2Ehyochan/react-native-nitro-sound961—~814Automated safety check: PassMIT
Stabilizing Compose TypesrosuH/EasyWatermark1.9k1 repos~4.4kAutomated safety check: PassApache-2.0
Pre Push Guardqianyumeng0228/ShizukuX109—~584Automated safety check: PassApache-2.0

Similar skills

  • Build Teaql App

    teaql/teaql-agent-kit

    Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries.

    2.8k GitHub stars~4.6k tokensUpdated 10 days ago
    MobileAuto-check passed
  • Android Maps Ktx

    googlemaps/android-maps-ktx

    Provides idiomatic Kotlin extension (KTX) patterns, reactive Flow event streams, and multi-subscriber shareIn rules for Google Maps SDK for Android and its Utility Library.

    360 GitHub stars~897 tokensUpdated 2 days ago
    MobileAuto-check passed
  • Android Audio E2E

    hyochan/react-native-nitro-sound

    Build and run device-backed Android end-to-end checks for react-native-nitro-sound permissions, recording, playback, listeners, pause/resume, seek, speed, audio focus, lifecycle behavior, and rapid…

    961 GitHub stars~814 tokensUpdated 8 days ago
    MobileAuto-check passed
  • Stabilizing Compose Types

    rosuH/EasyWatermark

    A skill your agent uses to fix unstable Jetpack Compose types once a stability diagnosis has identified them.

    1.9k GitHub starsUsed in 1 repo~4.4k tokens
    MobileAuto-check passed
  • Pre Push Guard

    qianyumeng0228/ShizukuX

    ShizukuX codebase integrity checks. An agent skill from qianyumeng0228/ShizukuX.

    109 GitHub stars~584 tokensUpdated today
    MobileAuto-check passed
  • Harmonica Dev

    KenjiOhtsuka/harmonica

    A skill your agent uses when working on the Harmonica Kotlin DB migration tool — planning, phase work, PRs, or anything touching this repo.

    131 GitHub stars~742 tokensUpdated 15 days ago
    MobileAuto-check passed

More from afkT/DevUtils

All 13 skills in this repo
  • 依据 Android 官方「版本」文档完成平台适配:按版本号 N 抓取行为变更(所有应用、 targetSdk=N)、changes/features 子页与探索新功能/API;归纳影响项并落地到 Manifest/Gradle/工具类封装。在用户要求 Android 版本适配、行为变更排查、 targetSdk 升级、新 API 封装或对照…

    1.6k GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed
  • 统一 Android XML 资源命名:layout、drawable、mipmap、color、values、id 的前缀与 snakecase 规则;把颜色/圆角/描边/状态编码进文件名(bg、border、textcolor…selector)。

    1.6k GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check passed
  • 根据用户给出的 Java/Kotlin 工具类或 View 相关源码,设计并实现 androidx.databinding.BindingAdapter。

    1.6k GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • 对 DevUtils 工程(DEPSROOT=file/gradle、DEPSMANIFEST=file/deps)中定义的第三方库 GAV 依赖做版本查证与升级;结合 Maven Central、Google Maven、Gradle Plugin Portal、 JitPack 与 GitHub Releases/README 交叉校验「最新可用版本」;必要时修正…

    1.6k GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • 为布局 XML 中的控件默认补全 DevSimple(lib/DevSimple)的 ViewTheme 样式引用: 按控件继承链匹配 ViewTheme.&lt;类名&gt;,ImageView/AppCompatImageView 使用 ViewTheme.ImageView.FITXY,无匹配则用 ViewTheme.View。工作区内优先 Read…

    1.6k GitHub stars~727 tokensUpdated 1 mo ago
    Auto-check passed
  • UI Devwidget Round

    afkT/DevUtils

    在需要圆角矩形纯色背景、描边边框时,优先用 DevWidget(io.github.afkt:DevWidgetX)的 dev.widget.ui.round 包替代 shape / layer-list drawable。流程与核心坑在 SKILL,Round 系列 View、R.styleable.DevWidget 中 app:dev 属性及源码对照见…

    1.6k GitHub stars~880 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Code Method Normalize

What does Code Method Normalize do?

规范化新生成或改写的 Java/Kotlin 方法:Java 用 JavaDoc、Kotlin 用 KDoc,两套规则不混用; Java 入参 final(抽象方法、接口默认方法、@Override 实现除外一律不加); 方法注释与备注同一套结构:首段/首行无内联代码与类型引用,补充说明用 <pre 包裹; 有返回值且带参时补全 @param/@return;Kotlin 的 @param…. Code Method Normalize is an agent skill from afkT/DevUtils.

When should I use Code Method Normalize?

Code Method Normalize fits situations like: tasks that involve Android development.

How do I install Code Method Normalize in Claude Code?

Run `npx skills add afkT/DevUtils --skill code-method-normalize -a claude-code`. Or copy the skill folder (.cursor/skills/code-method-normalize in afkT/DevUtils) into .claude/skills/code-method-normalize in your project. Claude Code loads it when a task matches its description.

How do I install Code Method Normalize in Codex?

Run `npx skills add afkT/DevUtils --skill code-method-normalize -a codex`. Or copy the skill folder (.cursor/skills/code-method-normalize in afkT/DevUtils) into .agents/skills/code-method-normalize in your project. Codex loads it when a task matches its description.

Can I use Code Method Normalize in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add afkT/DevUtils --skill code-method-normalize -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-method-normalize, .gemini/skills/code-method-normalize, .github/skills/code-method-normalize and .opencode/skills/code-method-normalize in your project.

What does Code Method Normalize need to run?

SKILL.md names no scripts, command-line tools or credentials: Code Method Normalize is instructions for the agent only.

Does Code Method Normalize access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code Method Normalize safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Method Normalize use?

Code Method Normalize is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Method Normalize use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Method Normalize?

Skills that share tags, products or a category with Code Method Normalize: Build Teaql App (teaql/teaql-agent-kit, 2.8k stars), Android Maps Ktx (googlemaps/android-maps-ktx, 360 stars), Android Audio E2E (hyochan/react-native-nitro-sound, 961 stars) and Stabilizing Compose Types (rosuH/EasyWatermark, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Method Normalize?

afkT (a GitHub user) maintains it in afkT/DevUtils, which has 1,612 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on September 2, 2026.

Source: afkT/DevUtils on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.