xiaohongshu
xiaohongshu
js-checker
JavaScript 代码检查和修复工具。当需要执行 JavaScript 代码时,使用此技能进行:1) 检查本地 Node.js 版本是否支持代码语法,2) 自动修复全角符号等常见问题,3) 验证代码可执行性,4) 返回检查结果供主 Agent 使用 execute_shell_command 执行
Full skill instructions
此技能提供 JavaScript 代码的检查、修复和验证功能,确保代码可以在本地 Node.js 环境中成功执行。
node --check 验证语法execute_shell_command 使用)检查 Node.js 版本
使用 scripts/check_node_version.py 检查本地 Node.js 版本
检查代码语法
使用 scripts/check_js_syntax.py 检查 JavaScript 代码语法
修复代码问题
使用 scripts/fix_js_code.py 自动修复全角符号等问题
验证代码可执行性
使用 scripts/validate_js.py 验证代码是否可以执行
返回结果
返回检查结果、修复后的代码和执行命令
# 1. 检查 Node.js 版本
node_version = check_node_version()
# 2. 检查代码语法
syntax_result = check_js_syntax(js_code, node_version)
# 3. 修复代码
fixed_code = fix_js_code(js_code)
# 4. 验证代码
validation_result = validate_js(fixed_code)
# 5. 返回结果
return {
"node_version": node_version,
"syntax_ok": syntax_result["valid"],
"fixed_code": fixed_code,
"validation_ok": validation_result["valid"],
"execute_command": f"node -e \"{fixed_code}\""
}
# 一次性完成所有检查
result = check_and_fix_js(js_code)
检查本地 Node.js 版本和兼容性。
功能:
返回:
{
"installed": true,
"version": "18.17.0",
"major": 18,
"minor": 17,
"patch": 0,
"meets_requirement": true
}
检查 JavaScript 代码语法。
功能:
node --check 检查语法参数:
js_code: JavaScript 代码字符串node_version: Node.js 版本(可选)返回:
{
"valid": true,
"errors": [],
"warnings": [],
"syntax_features": ["arrow-functions", "async-await"]
}
自动修复 JavaScript 代码中的常见问题。
功能:
参数:
js_code: JavaScript 代码字符串返回:
{
"fixed_code": "...",
"fixes_applied": [
{"type": "fullwidth_char", "line": 5, "original": ",", "fixed": ","},
{"type": "encoding", "line": 10, "description": "Fixed UTF-8 encoding"}
]
}
验证 JavaScript 代码是否可以执行。
功能:
node -e)参数:
js_code: JavaScript 代码字符串返回:
{
"valid": true,
"executable": true,
"errors": [],
"output": "..."
}
检查完成后,主 Agent 可以使用 AgentScope 的 execute_shell_command 工具执行代码:
from agentscope.tool import execute_shell_command
# 1. 使用 js-checker 检查代码
check_result = check_and_fix_js(js_code)
# 2. 如果检查通过,执行代码
if check_result["validation_ok"]:
execute_command = check_result["execute_command"]
result = await execute_shell_command(execute_command)
输入代码:
console.log("Hello,World!");
修复后:
console.log("Hello,World!");
输入代码:
const x = 1;
let y = 2;
检查结果:
输入代码:
console.log("Test");
验证结果:
execute_shell_command: 执行修复后的代码xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience