跳到正文
cccskills
免费在 GitHub 公开

abs-syntax-reference

Use this reference to write Aily Block Syntax (ABS), a text format for Blockly scripts. It explains block connections, parameter order, statement inputs, values, and variable references, with examples for conditions, loops, and Arduino program structure.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

ABS 语法快速参考:权威 ABS 规则与示例 skill,覆盖块连接类型、参数顺序、语句输入、变量引用与常见示例。触发词:ABS、语法、块脚本

ailyProject/aily-blockly星标 3,860(GitHub 3,860 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • Check the correct order of block parameters
  • Write conditions and loops in ABS
  • Look up value and variable syntax for Blockly scripts

包含的文件(1)

  • SKILL.md5.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

ABS (Aily Block Syntax) 快速参考

本 skill 只负责 ABS 语法规则与示例。项目规划、库安装、证据读取、工作区同步和验证流程由当前 host profile、可用工具说明及 blockly-best-practices skill 负责;不要从本语法参考重建那些流程。

使用库块时,参数顺序必须来自该库当前的 readme_ai.md 或 block.json,不能仅根据本文件中的通用示例推断。

Block Connection Types

TypeRoleParameter Style
Value作为值嵌入到其他块参数中所有参数都写在括号内:logic_compare($a, EQ, $b)
Statement独立成行,通过 next 串联普通参数写在括号内,语句输入使用 @NAME:
Hat根入口块,如 arduino_setup、arduino_loop规则与 Statement 相同

Syntax Rules

ElementSyntaxExample
Block callblock_type(param1, param2)serial_println(Serial, text("Hi"))
Empty paramsblock_type()time_millis()
Statement input@NAME: + 换行 + 缩进@DO0:\n action()
Variable ref$varName$count, $sensor

Parameter Types

TypeSyntaxExample
DropdownENUM_VALUESerial, HIGH, EQ, AND
Text"string""hello", "dht"
Number1239600, 13
Variable$name$count, $temp
Value blockblock(args)math_number(10), $var

参数顺序规则

参数顺序必须严格遵循 block.json 中 args0 的定义顺序,字段和输入可能交错出现,不能想当然地把下拉字段放到最前面。

例如 logic_compare 的 args0 顺序是:A(input_value), OP(field_dropdown), B(input_value),因此:

  • 正确:logic_compare($a, EQ, $b)
  • 错误:logic_compare(EQ, $a, $b)

Value Blocks

值块的所有参数都必须写在括号里,不能使用命名输入。

# Comparison: logic_compare(A, OP, B)
logic_compare($a, EQ, math_number(10))
logic_compare($temp, GT, math_number(30))

# Logic: logic_operation(A, OP, B)
logic_operation($sensor1, AND, $sensor2)
logic_operation(logic_compare($a, GT, math_number(0)), OR, logic_compare($a, LT, math_number(100)))

# Math: math_arithmetic(A, OP, B)
math_arithmetic($a, ADD, $b)

# Ternary: logic_ternary(condition, trueValue, falseValue)
logic_ternary(logic_compare($score, GTE, math_number(90)), text("A"), text("B"))

# Negate
logic_negate($flag)

# Boolean
logic_boolean(TRUE)

Statement Blocks with Statement Inputs

语句输入必须使用 @NAME:,并且子块体使用 4 个空格缩进。

# If-Else: statement inputs use @NAME:
controls_if()
    @IF0: logic_compare($temp, GT, math_number(30))
    @DO0:
        serial_println(Serial, text("Hot"))
    @ELSE:
        serial_println(Serial, text("OK"))

# If-ElseIf-Else
controls_if()
    @IF0: logic_compare($v, GT, math_number(100))
    @DO0:
        action1()
    @IF1: logic_compare($v, GT, math_number(50))
    @DO1:
        action2()
    @ELSE:
        action3()

# Loop
controls_repeat_ext(math_number(10))
    serial_println(Serial, text("Loop"))

controls_for($i, math_number(0), math_number(10), math_number(1))
    serial_println(Serial, $i)

Simple Statement Blocks

无语句输入的语句块,同样全部使用括号参数。

serial_begin(Serial, 115200)
serial_println(Serial, text("Hello"))
serial_println(Serial, $count)
time_delay(math_number(1000))
variables_set($count, math_number(0))
math_change($count, math_number(1))

Program Structure

arduino_setup()
    serial_begin(Serial, 115200)

arduino_loop()
    serial_println(Serial, text("Hello"))
    time_delay(math_number(1000))

Variable Reference Context

Target Type$var Becomes
field_variable变量字段,如 variables_set($x, ...)
input_valuevariables_get 表达式,如 serial_println(Serial, $x)

Checklist

  • 必须写括号:block(),不能省略为 block
  • input_value 位置的数字应写成 math_number(n)
  • input_value 位置的文本应写成 text("s")
  • 下拉值使用枚举值,如 HIGH、Serial、EQ、AND
  • 语句体使用 4 空格缩进
  • 只有语句输入才使用命名输入:@IF0:、@DO0:、@ELSE:
  • 值块的所有参数都在括号里,不能写命名输入
  • 参数顺序严格遵循 block.json 的 args0 定义,而不是“字段优先”

调试建议

  1. 读取当前 project.abs 并从具体报错位置开始定位;host 已在提交 turn 前同步可见工作区。
  2. 仅当工作区可能在 turn 开始后发生变化时,才使用 syncAbs action="export" 刷新文件。
  3. 对照相关库 readme_ai.md 或 block.json 的 args0 顺序,修正参数位置、缩进和值块包装方式。
  4. 使用当前 host 同步能力重新导入并验证,依据最近的报错做最小修复。

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Implement or modify Blockly/ABS programs using the project’s current board and installed libraries. Check only relevant library evidence, edit the canonical ABS source, sync it to the workspace, and run focused validation when needed.

中文简介正在准备中。当前显示英语简介。

  • Adding a feature to an existing Blockly program
  • Editing ABS source and syncing the workspace
  • Checking a focused build or syntax issue
ailyProject/aily-blockly38602026年10月26日 更新

Plan a new Blockly hardware project by discovering suitable board and library packages, then comparing viable combinations. Each plan outlines wiring assumptions, workspace structure, implementation steps, and validation before the user confirms project creation.

中文简介正在准备中。当前显示英语简介。

  • Comparing boards for a new Blockly project
  • Planning libraries for a sensor or actuator
  • Reviewing wiring and validation assumptions
ailyProject/aily-blockly38602026年10月26日 更新

chronicle

免费

Search indexed chat history to find earlier decisions, tool activity, project summaries, files, and workflow tips. It can also rebuild the local history index when requested or when search results appear out of date.

中文简介正在准备中。当前显示英语简介。

  • Find a decision made in an earlier conversation
  • Check which tools were used for past work
  • Summarize recent project sessions
ailyProject/aily-blockly38602026年10月26日 更新

handoff

免费

Create a concise handoff document in the operating system’s temporary directory so another agent can continue the work. It summarizes the conversation, suggests relevant skills, references existing artifacts, and redacts sensitive information.

中文简介正在准备中。当前显示英语简介。

  • Hand ongoing work to another agent
  • Prepare context for a fresh session
  • Summarize progress without duplicating project artifacts
ailyProject/aily-blockly38602026年10月26日 更新

improve

免费

Survey a codebase and turn verified improvement opportunities into prioritized, self-contained implementation plans for another agent. It can assess bugs, security, performance, tests, technical debt, migrations, tooling, and product direction while keeping source code read-only.

中文简介正在准备中。当前显示英语简介。

  • Audit a codebase for high impact issues
  • Plan fixes for security or performance findings
  • Create a grounded roadmap for another agent
ailyProject/aily-blockly38602026年10月26日 更新

Follow a workflow for converting Arduino and ESP32 libraries into Aily Blockly libraries. The guide covers analyzing public APIs, defining blocks, generating code, configuring toolboxes, initializing Serial, I2C, and SPI, adapting boards, and packaging the result.

中文简介正在准备中。当前显示英语简介。

  • Convert an Arduino library for Aily Blockly
  • Design block definitions and generated code
  • Adapt a library to supported development boards
ailyProject/aily-blockly38602026年10月26日 更新

查看 ailyProject 的全部技能

报告此技能的问题