skills-experimental/csi-sequence-generator/SKILL.md
# CSI Sequence Generator Skill CSI Sequence Generator - CSI_PREFIX + csi() function + parameter byte ranges + isCSIParam/Intermediate/Final checks + cursor movement constants + erase/insert/delete commands + DECSTBM scroll region + SU/SD scroll commands + single arg raw body pattern。 ## 功能概述 从Claude Code的ink/termio/csi.ts提取的CSI序列生成模式,用于OpenClaw的终端控制序列。 ## 核心机制 ### CSI_PREFIX ```typescript import { ESC, ESC_TYPE, SEP } from './ansi.js' export const CSI_PREFIX = ESC + String.fromCharCode(ESC
npx skillsauth add bianhaifeng789-hue/openclaw-config skills-experimental/csi-sequence-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CSI Sequence Generator - CSI_PREFIX + csi() function + parameter byte ranges + isCSIParam/Intermediate/Final checks + cursor movement constants + erase/insert/delete commands + DECSTBM scroll region + SU/SD scroll commands + single arg raw body pattern。
从Claude Code的ink/termio/csi.ts提取的CSI序列生成模式,用于OpenClaw的终端控制序列。
import { ESC, ESC_TYPE, SEP } from './ansi.js'
export const CSI_PREFIX = ESC + String.fromCharCode(ESC_TYPE.CSI)
// ESC [ = CSI prefix
// Control Sequence Introducer
/**
* Generate a CSI sequence: ESC [ p1;p2;...;pN final
* Single arg: treated as raw body
* Multiple args: last is final byte, rest are params joined by ;
*/
export function csi(...args: (string | number)[]): string {
if (args.length === 0) return CSI_PREFIX
if (args.length === 1) return `${CSI_PREFIX}${args[0]}` // Raw body
const params = args.slice(0, -1)
const final = args[args.length - 1]
return `${CSI_PREFIX}${params.join(SEP)}${final}`
}
// Single arg: raw body (ESC [ <arg>)
# Multiple args: params + final byte
export const CSI_RANGE = {
PARAM_START: 0x30, // 0x30-0x3f: parameter bytes
PARAM_END: 0x3f,
INTERMEDIATE_START: 0x20, // 0x20-0x2f: intermediate bytes
INTERMEDIATE_END: 0x2f,
FINAL_START: 0x40, // 0x40-0x7e: final bytes (@ through ~)
FINAL_END: 0x7e,
} as const
// CSI structure: ESC [ params intermediate final
# Byte range definitions
export function isCSIParam(byte: number): boolean {
return byte >= CSI_RANGE.PARAM_START && byte <= CSI_RANGE.PARAM_END
}
export function isCSIIntermediate(byte: number): boolean {
return byte >= CSI_RANGE.INTERMEDIATE_START && byte <= CSI_RANGE.INTERMEDIATE_END
}
export function isCSIFinal(byte: number): boolean {
return byte >= CSI_RANGE.FINAL_START && byte <= CSI_RANGE.FINAL_END
}
// Byte type checks
# Parser helpers
export const CSI = {
CUU: 0x41, // A - Cursor Up
CUD: 0x42, // B - Cursor Down
CUF: 0x43, // C - Cursor Forward
CUB: 0x44, // D - Cursor Back
CNL: 0x45, // E - Cursor Next Line
CPL: 0x46, // F - Cursor Previous Line
CHA: 0x47, // G - Cursor Horizontal Absolute
CUP: 0x48, // H - Cursor Position
CHT: 0x49, // I - Cursor Horizontal Tab
VPA: 0x64, // d - Vertical Position Absolute
HVP: 0x66, // f - Horizontal Vertical Position
}
// Cursor movement final bytes
# Hex constants
export const CSI = {
ED: 0x4a, // J - Erase in Display
EL: 0x4b, // K - Erase in Line
ECH: 0x58, // X - Erase Character
}
// Erase commands
# Display/Line/Char erase
export const CSI = {
IL: 0x4c, // L - Insert Lines
DL: 0x4d, // M - Delete Lines
ICH: 0x40, // @ - Insert Characters
DCH: 0x50, // P - Delete Characters
}
// Insert/Delete commands
# Lines/Characters
// DECSTBM: Set Top and Bottom Margins
// CSI top ; bottom r
export const CSI = {
DECSTBM: 0x72, // r - Set Scrolling Region
}
// DECSTBM scroll region
# top ; bottom r
// CSI n S: Scroll Down (content moves up)
// CSI n T: Scroll Up (content moves down)
export const CSI = {
SU: 0x53, // S - Scroll Up
SD: 0x54, // T - Scroll Down
}
// Hardware scroll commands
# Scroll Up/Down
if (args.length === 1) return `${CSI_PREFIX}${args[0]}` // Raw body
// Single arg: treated as raw body
// No params, no final byte separation
# Direct CSI + body
{
"csiSequence": "ESC[5;10r",
"command": "DECSTBM",
"params": [5, 10]
}
csi(...args) → ESC [ params ; final → CSI sequence string
# csi()函数生成CSI sequence
# 多args: params + final byte
# 单arg: raw body
PARAM: 0x30-0x3f | INTERMEDIATE: 0x20-0x2f | FINAL: 0x40-0x7e → parser classification
# 参数字节、中间字节、终结字节分类
# Parser使用
CSI.CUU = 0x41 → 'A' → Cursor Up → hex constant → readable
# Final byte用hex constant定义
# 可读性好
# 符合ANSI标准
CSI top ; bottom r → DECSTBM → CSI n S/T → hardware scroll → terminal optimization
# DECSTBM设置滚动区域
# CSI n S/T硬件滚动
# 终端优化
ink/termio/csi.ts (319 lines)business
IAA 日报飞书输出能力。 支持把固定 CSV 模板一键转换成: - 中文运营结论 - 飞书卡片 JSON - 飞书发送载荷 Use when: - 需要把 IAA 日报直接发到飞书 - 需要从 CSV 一键生成运营日报
data-ai
IAA日报分析模型 功能: - 渠道日报自动分析 - 小时级+日级ROI联动判断 - 按地区输出加量/降量/停投建议 - 按产品类型输出阈值 - 自动识别利润区/观察区/止损区 Use when: - 分析每天投放数据 - 生成运营日报结论 - 判断是否加量/降量/停投 - 对比美加澳/日韩表现 Keywords: - 日报模型, 投放日报, 加量, 降量, 停投, ROI日报, 分地区分析
data-ai
IAA固定日报分析模板 功能: - 固定字段模板(可直接贴每天数据) - 自动输出总盘结论 - 自动输出美加澳/日韩结论 - 自动给出加量/降量/停投建议 - 适配文件修复/清理两类产品 Use when: - 需要固定日报格式 - 每天复盘渠道表现 - 给运营团队出统一结论 Keywords: - 固定模板, 日报模板, ROI模板, IAA日报, 运营模板
development
# HyperlinkPool Pattern Skill HyperlinkPool Pattern - HyperlinkPool class + strings array + stringMap + Index 0 no hyperlink + intern(hyperlink) + get(id) + undefined handling + 5-minute reset + OSC8 hyperlink interning。 ## 功能概述 从Claude Code的ink/screen.ts提取的HyperlinkPool模式,用于OpenClaw的OSC8超链接池管理。 ## 核心机制 ### HyperlinkPool Class ```typescript export class HyperlinkPool { private strings: string[] = [''] // Index 0 = no hyperlink private stringMap = new Map<string, number>() // strings