AGENT SKILL

blockly-best-practices

Blockly 积木编程最佳实践:块结构设计、事件处理、传感器集成、ABS 代码编写流程。触发词:块编程、积木、Blockly 工作流、代码编辑

License 许可
MIT
最近更新
2026-11-10
Stars
★ 1
Forks
0

01 前言 Front Matter

name
blockly-best-practices
metadata
{ "tags": "blockly,coding-standards,abs,workflow", "scope": "global", "agents": "mainAgent", "author": "aily-team", "version": "1.0.0", "auto-activate": false }
description
Blockly 积木编程最佳实践:块结构设计、事件处理、传感器集成、ABS 代码编写流程。触发词:块编程、积木、Blockly 工作流、代码编辑

03 SKILL.md 正文

Blockly 代码编辑流程

【需求分析】

仔细分析用户需求,理解要实现的功能和目标。对于不明确的需求,提出澄清问题。

【设计方案】

使用工具了解当前工作区信息,仔细查询可使用的开发板和库,设计实现方案。方案设计要考虑功能实现的可行性、效率和可维护性。

  • 严禁假设应该使用的库或工具,必须通过工具查询确认。
  • 方案设计完成后输出完整方案设计及实现步骤。
  • 项目创建或者库安装必须询问用户确认。

【准备工作】

  1. 使用分析当前工作区及当前项目状态,了解现有资源,确保项目已创建、库已安装。
  2. 安装所需库,确保所有依赖库已正确安装。
  3. 使用todo_write_tool规划项目流程,明确每一步要实现的功能和使用的工具。
  4. 列出需要使用的库,必须包含lib-core-*等核心库(如lib-core-logic、lib-core-variables等)。如果需要新库,使用search_boards_libraries工具查询并安装。
  5. 逐一阅读库的readme_ai.md,了解块定义和ABS语法。没有readme的库需要直接分析库文件获取信息。
  6. 必要时使用load_skill加载abs-syntax-reference skill,确认ABS语法规范后再修改代码。

【实现阶段】

  1. 完整规划代码逻辑,构思ABS结构。
  2. 使用sync_abs_file工具的export操作获取当前代码。
  3. 编辑ABS代码:添加新块、修改参数、调整结构。遵守ABS编写规范,确保字段直接写值,输入连接值块,语句输入用缩进,多输入块用标记,空括号不可省略。
  4. 使用sync_abs_file工具的import操作导入修改后的ABS。
  5. 仔细分析错误信息,定位并修复ABS代码问题。遵循修复原则:诊断优先、最小改动、错误处理。
  6. 如果库功能不完善,安装lib-core-custom自定义库(需要用户确认),重复步骤2-5直至完成。
  7. 当业务逻辑超过 30 行且自包含(如游戏、通信协议、算法)时,应优先创建独立 Blockly 库,而非使用 custom_code 注入。

【修复原则】

  • 诊断优先:分析报错,定位问题,语法错误还是逻辑错误。
  • 最小改动:只修改需要变更的ABS行,保持其他结构不变。
  • 错误处理:读取库文件了解块定义和ABS语法,确保修复正确。

【执行要求】

  • 安装操作必须询问用户确认,确保用户了解安装的库和功能。
  • 深入分析嵌入式代码逻辑和硬件特性,确保逻辑正确。
  • ABS代码保持清晰的缩进和换行,便于阅读和调试。

04 同仓库更多 Skills

YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

vercel-sandbox

Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include "Vercel Sandbox browser", "microVM Chrome", "agent-browser in sandbox", "browser automation on Vercel", or any task requiring Chrome in a Vercel Sandbox.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

slack

Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include "check my Slack", "what channels have unreads", "send a message to", "search Slack for", "extract from Slack", "find who said", or any task requiring programmatic Slack interaction.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

electron

Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

dogfood

Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

shadcn

Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", "switch to --preset", and for building a design system or applying a DESIGN.md or brand spec to shadcn/ui.

★ 1