Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问许可证需确认审计通过

alloy-howtos合金教程

Agent Skill

alloy-howtos 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

216

周安装

9

GitHub Stars

1

下载量

72
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:alloy-howtos(合金教程)
来源仓库:https://github.com/maccesar/titanium-sdk-skills
仓库路径:skills/alloy-howtos
安装命令:
npx skills add https://github.com/maccesar/titanium-sdk-skills --skill alloy-howtos
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/maccesar/titanium-sdk-skills --skill alloy-howtos

简介

alloy-howtos 提供 Titanium Alloy 项目的实用操作指南。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中配置 Alloy CLI 和解决常见问题时使用。
  • 自动检测 Alloy 项目,提供配置文件和命令行操作指导。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 支持 alloy.jmk 或 config.json 文件的项目识别,非 Alloy 项目会提示切换技能。

SKILL.md

Titanium Alloy How-tos

Practical guide for Alloy MVC projects in the Titanium SDK.

Project detection

️ℹ️ Auto-detects Alloy projects This skill checks for Alloy projects when invoked and provides CLI and configuration guidance. Detection is automatic. No manual command is needed. Alloy project indicators: - app/ folder with Alloy structure - alloy.jmk or config.json files Behavior based on detection: - Alloy detected -> Provide Alloy CLI command guidance, configuration file help, Alloy-specific troubleshooting - Not detected -> Explain this skill is for Alloy projects only and suggest Alloy guides if the user wants to migrate

Quick reference

TopicReference
Best Practices & Naming Conventionsbest_practices.md
CLI Commands (new, generate, compile)cli_reference.md
Configuration Files (alloy.jmk, config.json)config_files.md
Custom XML Tags & Reusable Componentscustom_tags.md
Debugging & Common Errorsdebugging_troubleshooting.md
Code Samples & Conditionalssamples.md

Key practices

Naming conventions

  • Never use double underscore prefixes (__foo) - reserved for Alloy
  • Never use JavaScript reserved words as IDs

Global events - use Backbone.Events

Avoid Ti.App.fireEvent / Ti.App.addEventListener. It can cause memory leaks and poor performance.

Use the Backbone.Events pattern:

// In alloy.js
Alloy.Events = _.clone(Backbone.Events);

// Listener
Alloy.Events.on('updateMainUI', refreshData);
// Clean up on close
$.controller.addEventListener('close', () => {
    Alloy.Events.off('updateMainUI');
});

// Trigger
Alloy.Events.trigger('updateMainUI');

Global variables in non-controller files

Always require Alloy modules:

const Alloy = require('alloy');
const Backbone = require('alloy/backbone');
const _ = require('alloy/underscore')._;

Conditional views

Use if attributes in XML for conditional rendering (evaluated before render):

<Alloy>
    <Window>
        <View if="Alloy.Globals.isLoggedIn()" id="notLoggedIn">
             <Label text="Not logged in" />
        </View>
        <View if="!Alloy.Globals.isLoggedIn()" id="loggedIn">
            <Label text="Logged in" />
        </View>
    </Window>
</Alloy>

Conditional TSS styles:

"#info[if=Alloy.Globals.isIos7Plus]": {
    font: { textStyle: Ti.UI.TEXT_STYLE_FOOTNOTE }
}

Data-binding conditionals:

<TableViewRow if="$model.shouldShowCommentRow()">

Common error solutions

ErrorSolution
No app.js foundRun alloy compile --config platform=<platform>
Android assets not showingUse absolute paths (prepend /)
Alloy is not defined (non-controller)Add const Alloy = require('alloy');
iOS invalid method passed to UIModuleCreating Android-only object - use platform attribute

CLI quick reference

# New project
alloy new [path] [template]

# Generate components
alloy generate controller <name>
alloy generate model <name> <adapter> <schema>
alloy generate style --all

# Compile
alloy compile [--config platform=android,deploytype=test]

# Extract i18n strings
alloy extract-i18n en --apply

# Copy/move/remove controllers
alloy copy <old> <new>
alloy move <old> <new>
alloy remove <name>

Configuration files priority

config.json precedence: os:ios > env:production > global

Access at runtime: Alloy.CFG.yourKey

Custom XML tags

Create reusable components without widgets. Drop a file in app/lib/:

app/lib/checkbox.js

exports.createCheckBox = args => {
    const wrapper = Ti.UI.createView({ layout: "horizontal", checked: false });
    const box = Ti.UI.createView({ width: 15, height: 15, borderWidth: 1 });
    // ... build component, return Ti.UI.* object
    return wrapper;
};

view.xml

<CheckBox module="checkbox" id="terms" caption="I agree" onChange="onCheck" />

Key: the module attribute points to the file in app/lib/ (without .js). The function must be create<TagName>.

See custom_tags.md for complete examples.

Resources

references/

Reference docs by topic:

  • best_practices.md - Coding standards, naming conventions, global events patterns
  • cli_reference.md - All CLI commands with options and model schema format
  • config_files.md - alloy.jmk tasks, config.json structure, widget.json format
  • custom_tags.md - Creating reusable custom XML tags without widgets
  • debugging_troubleshooting.md - Common errors with solutions
  • samples.md - Controller examples, conditional views, data-binding patterns

Related skills

For tasks beyond Alloy CLI and configuration, use these related skills:

TaskUse This Skill
Modern architecture, services, patternsti-expert
Alloy MVC concepts, models, data bindingalloy-guides
SDK config, Hyperloop, app distributionti-guides

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.84%
按下载量换算24

Claude

31.88%
按下载量换算23

Cursor

20.43%
按下载量换算15

Gemini CLI

8.54%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/maccesar/titanium-sdk-skills --skill alloy-howtos 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills