Agent skill

Project Binding Adapter From Source

by afkT in afkT/DevUtils

根据用户给出的 Java/Kotlin 工具类或 View 相关源码,设计并实现 androidx.databinding.BindingAdapter。

Apache-2.0Auto-check passedMobile

Install Project Binding Adapter From Source

skills CLI
$ npx skills add afkT/DevUtils --skill project-binding-adapter-from-source -a claude-code

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

GitHub CLI
$ gh skill install afkT/DevUtils project-binding-adapter-from-source --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/project-binding-adapter-from-source .claude/skills/project-binding-adapter-from-source && 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
project-binding-adapter-from-source
GitHub stars
1.6k
Token cost
~1.6k tokens
SKILL.md length
409 words
Files
2 (incl. references)
Skills in repo
13
Repo updated
First seen
Licence
Apache-2.0

At a glance

根据用户给出的 Java/Kotlin 工具类或 View 相关源码,设计并实现 androidx.databinding.BindingAdapter。

  • Works in 6 steps: 核心门槛:方法是否适合 BindingAdapter + XML → 仅 View(接收者)型副作用:Long? 时间戳触发 → 时间戳判定:可复用扩展 → …
  • Tasks that involve Android development
  • SKILL.md covers 模块路径(本地优先,与 viewtheme 共用锚点), 必读搭配, 风格对齐(执行要点) and 1. 核心门槛:方法是否适合 BindingAdapter…, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Project Binding Adapter From Source is an agent skill from afkT/DevUtils. 根据用户给出的 Java/Kotlin 工具类或 View 相关源码,设计并实现 androidx.databinding.BindingAdapter。 工作区内优先 Read lib/DevSimple 下 bindingadapters;范例文件表见 references/reference.md。 过滤不适合 XML 的 API;Long? 时间戳、Boolean? 三态、attribute 合并(参照 XYI);成稿按 code-method-normalize。 在用户要求生成 BindingAdapter、补全 DataBinding 属性、或评审 DevSimple bindingadapters 时使用。

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/reference.md`).

It sits in Mobile, covering Android development. It works with Java, Kotlin and Android. 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

  • “/project-binding-adapter-from-source”

Workflow steps

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

  1. 核心门槛:方法是否适合 BindingAdapter + XML
  2. 仅 View(接收者)型副作用:Long? 时间戳触发
  3. 时间戳判定:可复用扩展
  4. 多参数合并为实体类(减少绑定次数与属性数量)
  5. 布局属性与 Kotlin 命名
  6. 生成工作流(Agent 执行顺序)

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 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

Project Binding Adapter From Source loads about 1.6k tokens when it runs, and up to ~2.9k if it reads all its reference files. Until then it costs about 88 tokens; SKILL.md has 409 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.9k

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). 409 words, ~1,574 tokens.

Download SKILL.mdSave it as .claude/skills/project-binding-adapter-from-source/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
project-binding-adapter-from-source
description
根据用户给出的 Java/Kotlin 工具类或 View 相关源码,设计并实现 androidx.databinding.BindingAdapter。 工作区内优先 Read lib/DevSimple 下 bindingadapters;范例文件表见 references/reference.md。 过滤不适合 XML 的 API;Long? 时间戳、Boolean? 三态、attribute 合并(参照 XYI);成稿按 code-method-normalize。 在用户要求生成 BindingAdapter、补全 DataBinding 属性、或评审 DevSimple bindingadapters 时使用。

从源码生成 DataBinding BindingAdapter

模块路径(本地优先,与 viewtheme 共用锚点)

符号当前值(DevUtils)
DEVSIMPLE_ROOTlib/DevSimple
BINDING_VIEW_DIR{DEVSIMPLE_ROOT}/src/main/java/dev/simple/bindingadapters/view
BINDING_ATTR_DIR{DEVSIMPLE_ROOT}/src/main/java/dev/simple/bindingadapters/view/attribute

存在 {DEVSIMPLE_ROOT} 时 Read 本地 *.kt,勿用 WebFetch 代替。生成前在 {BINDING_VIEW_DIR} 下列出并对照现有实现;优先范例文件名、前缀惯例、判定表 → references/reference.md。

上游 fallback(仅工作区无模块时):https://github.com/afkT/DevUtils/tree/master/lib/DevSimple

必读搭配

生成或改写 方法体与文档 时,同时 Read 并遵守:

本 Skill 负责 「是否该做 BindingAdapter、属性如何设计、时间戳与合并参数」;文档句式交给 code-method-normalize。

风格对齐(执行要点)

  1. Read {BINDING_VIEW_DIR} 下与目标控件相关的 *.kt(至少一份同族文件 + references/reference.md §优先范例 中对应行)。
  2. 合并参数实体放在 {BINDING_ATTR_DIR};XYI 等写法对照同目录 XYI.kt。
  3. 文件头「不适合 BindingAdapter」的说明以 View.kt 为准(路径见 reference)。

1. 核心门槛:方法是否适合 BindingAdapter + XML

BindingAdapter 绑定在 布局里的单个 View 节点;只封装 对该接收者 View(及合理子类型)有意义、且能在 XML 表达参数 的操作。

应跳过或不要求用户封装(与 View.kt 文件头说明一致)的典型类别:

  • 需要 LayoutInflater / 非当前节点上下文 的:inflate 等
  • 返回 Activity / Fragment / 任意非 View 且无法在绑定中作为稳定入参的:getActivity 等
  • 依赖 任意子下标访问、且语义不属于「当前节点自身配置」的:getChildAt 等(除非业务明确绑定的是容器且参数是 index,再按列表类控件单独设计)
  • ViewGroup 结构转换 等与当前节点单次属性语义不符的:convertViewGroup 等

适合封装的正向例子:removeAllViews、requestLayout、setText、滚动到某位置、设置可见性、设置图片资源等——参数为基本类型、String、Drawable、XYI 等可在 Binding / LiveData 中传递的类型。

若某方法 仅 View/TextView/… 一个参数,除「纯状态同步」(如设置某个由 XML 已绑定的 bool)外,重复触发(同值不刷新)往往成问题 → 见第 2 节 时间戳。


2. 仅 View(接收者)型副作用:Long? 时间戳触发

当底层 API 形如 FooUtils.action(view) 仅有当前接收者、无业务参数,又需要在 MVVM 里 多次触发同一逻辑(例如再次滑到底、再次清空)时:

  • 唯一绑定入参 使用 timestamp: Long?(或与其它参数组合时,时间戳作为触发列之一)
  • 在适配器开头使用 与项目一致的正时间戳判断(见第 3 节)
  • 在 KDoc <pre> 中写明:建议绑定 System.currentTimeMillis() 或 ViewModel 内递增时间戳;优于 LiveData<Boolean> 固定 true 不二次刷新

成对语义(示例):已有 EditTextUtils.setText(view, text) 对应「设文本」;可另增 「清空文本」 适配器,入参仅为 timestamp: Long?,内部在通过校验后调用 EditTextUtils.setText(view, "")(或项目等价 API)。文档中说明与 binding_et_text 等的关系,避免重复绑定冲突。


2.5 Boolean 三态开关(开启 / 关闭 / 不修改)

当底层工具类提供 成对的 set / remove(或语义等价的 enable / disable)API,且布局需要绑定 可切换、可保持的 View 效果(下划线、删除线、paintFlags 装饰、部分可见性样式等)时:

  • 绑定入参使用 Boolean?(不用非空 Boolean,以便区分「未绑定」与「显式关闭」)。
  • 适配器内统一约定:
    • null → return,不修改 View(未提供 LiveData、或尚未赋值时保留 XML / 主题默认)。
    • true → 调用 开启 / 设置 API(如 TextViewUtils.setUnderlineText)。
    • false → 调用 关闭 / 移除 API(如 TextViewUtils.removeUnderlineText)。

与 §2 时间戳 的分工:

场景选用
需要 同步并保持 开/关状态,随 DataBinding 刷新更新 UIBoolean? 三态(本节)
无状态,每次都要 再触发一次 副作用(再次滚到底、再次清空)Long? 时间戳(§2)
工具类 仅有 set、无 remove,且 false 语义就是「不做事」可 Boolean? 仅 true 时执行;若业务要在布局里 关掉 已有效果,应补 remove 工具方法后改本节三态

禁止:底层已有 removeXxx 时仍写 if (flag != true) return,导致布局绑 false 无法撤销效果。

仓库参考实现:TextView.bindingTVUnderline、TextView.bindingTVStrikeThru(见 {BINDING_VIEW_DIR}/TextView.kt,reference §优先范例)。

kotlin
fun TextView.bindingTVUnderline(
    underline: Boolean?,
    antiAlias: Boolean?,
) {
    if (underline == null) return
    if (underline) {
        TextViewUtils.setUnderlineText(this, antiAlias ?: true)
    } else {
        TextViewUtils.removeUnderlineText(this)
    }
}
  • 可选第二参数(如 antiAlias)仅在 true 开启分支 使用;requireAll = false 时缺省与工具类一致。
  • KDoc <pre> 中写明三态与对应的 set* / remove* 工具方法名。

Show full SKILL.md (154 more words)Show less

3. 时间戳判定:可复用扩展

逻辑统一为:非 null 且大于 0 才执行。

本仓库已有:

kotlin
fun Long?.qualifiesScroll(): Boolean = this != null && this > 0L

新代码若语义不是滚动(避免命名误导),可在同一模块抽取例如:

kotlin
/** 数据绑定用:时间戳非空且大于 0 时执行一次副作用。 */
fun Long?.qualifiesBindingAction(): Boolean = this != null && this > 0L

具体命名与存放文件随模块惯例;禁止用 <=0 或 null 仍执行(除非项目已有特例并在备注中写明)。


4. 多参数合并为实体类(减少绑定次数与属性数量)

避免 多个密切相关、应同事务触发的量拆成多个 binding_*,导致 多次调用适配器、LiveData 数量膨胀。

做法:

  1. 在 dev.simple.bindingadapters.view.attribute(即 {BINDING_ATTR_DIR},或用户指定包的 attribute 子包)新增 Kotlin data class / open class,字段覆盖原工具方法参数(含可选默认值)。
  2. 单个 @BindingAdapter("binding_…_single_snake_name"),入参为该类型可空;null 时跳过。
  3. 命名与 XYI 对齐习惯:简短后缀表意(如位移用 XYI);补充 equals/hashCode(data class 自带)、toString、伴生工厂方法视需要。
  4. 迁移示例:由 binding_scroll_instant_rel_dx + binding_scroll_instant_rel_dy(requireAll = false)改为 binding_scroll_instant_rel_xy + XYI?(见用户提供的旧/新对照)。

5. 布局属性与 Kotlin 命名

  • XML:app:binding_snake_case;@BindingAdapter 的 value 与之一致。
  • Kotlin 扩展:fun View.bindingCamelCase(...),与文件内现有风格一致。
  • requireAll = false 仅当 确有独立缺省语义 时使用;能合并为实体类则优先合并。
  • 有返回值时:优先 Boolean 表示是否执行/成功,并满足 code-method-normalize 中 boolean/Boolean 的 @return 写法。

6. 生成工作流(Agent 执行顺序)

  1. Read 用户给出的源文件,列出候选 public/internal 方法。
  2. 过滤 第 1 节不适配 XML 的 API。
  3. 对每个保留方法:映射接收者类型(View / TextView / ImageView / ViewGroup / RecyclerView 等)、参数拆分或合并(第 4 节)、是否需要时间戳(第 2 节)或 Boolean 三态开关(第 2.5 节)。
  4. 落文件:新适配器写入 {BINDING_VIEW_DIR}/(按控件分文件,与现有 TextView.kt、ViewScroll.kt 等并列);attribute 类写入 {BINDING_ATTR_DIR}/。
  5. Read code-method-normalize 并整理文档与返回类型。
  6. 自检:@BindingAdapter 不与 {BINDING_VIEW_DIR} 内已有属性名冲突;try/catch 与日志风格参照 reference 中 TextView / ImageViewLoadNative 范例。

判定表、XML 示例、binding_* 前缀表见 references/reference.md。

执行清单

  • 已 Read 本地 {BINDING_VIEW_DIR} 或 reference §优先范例,而非仅凭记忆写适配器。
  • 已对照 reference §DevSimple 前缀惯例,避免 binding_* 冲突。
  • 新 attribute 类落在 {BINDING_ATTR_DIR};成稿前已 Read code-method-normalize。

© 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

SKILL.md and 1 other file (references) in .cursor/skills/project-binding-adapter-from-source of afkT/DevUtils.

  • SKILL.md
  • references/reference.md

Open the folder on GitHubat commit 6022ede

Compare with similar skills

Project Binding Adapter From Source 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.

Project Binding Adapter From Source compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Project Binding Adapter From Source this skillafkT/DevUtils1.6k—~1.6kAutomated safety check: PassApache-2.0
Android Maps Ktxgooglemaps/android-maps-ktx360—~897Automated safety check: PassApache-2.0
Android Audio E2Ehyochan/react-native-nitro-sound961—~814Automated safety check: PassMIT
Pre Push Guardqianyumeng0228/ShizukuX115—~584Automated safety check: PassApache-2.0
Kotlinmargelo/react-native-skills175—~3kAutomated safety check: PassNone
Apc BuildJoker-x-dev/AndroidProject-Compose102—~553Automated safety check: PassNone

Similar skills

  • 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 today
    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
  • Pre Push Guard

    qianyumeng0228/ShizukuX

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

    115 GitHub stars~584 tokensUpdated yesterday
    MobileAuto-check passed
  • Kotlin

    margelo/react-native-skills

    Design, implement, and review Kotlin and Android APIs. An agent skill from margelo/react-native-skills.

    175 GitHub stars~3k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Apc Build

    Joker-x-dev/AndroidProject-Compose

    管理 AndroidProject-Compose 的 Gradle、版本目录、SDK、BuildConfig、构建类型、ABI、签名、混淆、应用资源和 APK/AAB 发布流程。用户要求升级依赖、修改构建配置、替换图标或启动页、配置签名、排查构建失败、缩减包体或生成发布包时使用。

    102 GitHub stars~553 tokensUpdated 21 days ago
    MobileAuto-check passed
  • Android Dev

    sickn33/agentic-awesome-skills

    Production-grade Android app development guide covering native (Kotlin/Java), cross-platform (Flutter, RN, KMM), and hybrid architectures.

    47k GitHub starsUsed in 1 repo~536 tokens
    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
  • 对 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
  • UI Dialogx Dialog

    afkT/DevUtils

    需要对话框、弹窗、菜单、加载等待、轻提示(Toast 替代)、应用内通知、底部弹窗、 上下文菜单、全屏/自定义弹层或操作引导时,默认使用 DialogX (com.github.kongzue.DialogX,本工程已依赖)而非系统 AlertDialog/Toast/PopupMenu。

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

Categories

Questions about Project Binding Adapter From Source

What does Project Binding Adapter From Source do?

根据用户给出的 Java/Kotlin 工具类或 View 相关源码,设计并实现 androidx.databinding.BindingAdapter。. Project Binding Adapter From Source is an agent skill from afkT/DevUtils.md。 过滤不适合 XML 的 API;Long?

When should I use Project Binding Adapter From Source?

Project Binding Adapter From Source fits situations like: tasks that involve Android development.

How do I install Project Binding Adapter From Source in Claude Code?

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

How do I install Project Binding Adapter From Source in Codex?

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

Can I use Project Binding Adapter From Source 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 project-binding-adapter-from-source -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/project-binding-adapter-from-source, .gemini/skills/project-binding-adapter-from-source, .github/skills/project-binding-adapter-from-source and .opencode/skills/project-binding-adapter-from-source in your project.

What does Project Binding Adapter From Source need to run?

SKILL.md names no scripts, command-line tools or credentials: Project Binding Adapter From Source is instructions for the agent only.

Does Project Binding Adapter From Source 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 Project Binding Adapter From Source 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 Project Binding Adapter From Source use?

Project Binding Adapter From Source 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 Project Binding Adapter From Source use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Project Binding Adapter From Source?

Skills that share tags, products or a category with Project Binding Adapter From Source: Android Maps Ktx (googlemaps/android-maps-ktx, 360 stars), Android Audio E2E (hyochan/react-native-nitro-sound, 961 stars), Pre Push Guard (qianyumeng0228/ShizukuX, 115 stars) and Kotlin (margelo/react-native-skills, 175 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Project Binding Adapter From Source?

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.