Agent助手
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 nano-core
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @0-CYBERDYNE-SYSTEMS-0 · 未声明 license
- Token 消耗评级
- 较高消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS · Windows
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: applescript-automation
description: Comprehensive AppleScript expertise for enterprise-grade macOS You are an expert AppleScript aut…
category: 工程开发
runtime: 无特殊运行时
---
# applescript-automation 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“When to use this skill / When not to use this skill / Quick Reference - Immediate Patterns”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“When to use this skill / When not to use this skill / Quick Reference - Immediate Patterns”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“When to use this skill / When not to use this skill / Quick Reference - Immediate Patterns”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: applescript-automation
description: Comprehensive AppleScript expertise for enterprise-grade macOS You are an expert AppleScript aut…
category: 工程开发
source: 0-CYBERDYNE-SYSTEMS-0/nano-core
---
# applescript-automation
## 什么时候使用
- applescript-automation 是一个工程开发方向的技能,扩展 Agent 在写代码、做 review、跑测试这类场景下的能力 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「When to use this skill / When not to use this skill / Quick Reference - Immediate Patterns」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "applescript-automation" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> When to use this skill / When not to use this skill / Quick Reference - Immediate Patterns
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} AppleScript Automation Mastery
When to use this skill
- Use when the user request matches this skill's domain and capabilities.
- Use when this workflow or toolchain is explicitly requested.
When not to use this skill
- Do not use when another skill is a better direct match for the task.
- Do not use when the request is outside this skill's scope.
You are an expert AppleScript automation specialist with deep knowledge of macOS system architecture, multi-display management, URL scheme implementation, and complex workflow orchestration. When this skill is activated, provide enterprise-grade macOS automation solutions.
Quick Reference - Immediate Patterns
Application Launch & Position
-- Launch app and position on specific display
tell application "System Events"
set screenWidth to item 1 of (size of main screen)
set screenHeight to item 2 of (size of main screen)
end tell
tell application "Terminal"
activate
if (count of windows) = 0 then make new document
set bounds of window 1 to {0, 0, screenWidth/2, screenHeight}
end tell
Multi-Screen Window Management
-- Get information about all displays
tell application "System Events"
set allDisplays to every display
repeat with i from 1 to count of allDisplays
set displayBounds to bounds of display i
set displayResolution to size of display i
log ("Display " & i & ": " & displayResolution)
end repeat
end tell
URL Scheme Registration
-- Register custom URL scheme handler
tell application "System Events"
make new preference pane at end of preference panes with properties {name:"URL Handlers"}
tell preference pane "URL Handlers"
make new URL handler with properties {scheme:"ff-terminal", handler:"/Applications/FF-Terminal.app"}
end tell
end tell
Multi-Screen Mastery
Display Detection & Analysis
-- Comprehensive multi-display information
on getDisplayInfo()
tell application "System Events"
set displayList to {}
set allDisplays to every display
repeat with i from 1 to count of allDisplays
set currentDisplay to display i
set displayBounds to bounds of currentDisplay
set displayResolution to size of currentDisplay
set displayPosition to position of currentDisplay
set displayInfo to {
id:i,
bounds:displayBounds,
resolution:displayResolution,
position:displayPosition,
isMain:(i = 1)
}
set end of displayList to displayInfo
end repeat
end tell
return displayList
end getDisplayInfo
Cross-Display Window Positioning
-- Position window across multiple displays
on positionWindowAcrossDisplays(appName, windowIndex, displayLayout)
tell application "System Events"
set displayInfo to getDisplayInfo()
set targetDisplay to item displayLayout of displayInfo
set displayBounds to bounds of targetDisplay
tell application appName
activate
if (count of windows) ≥ windowIndex then
set windowBounds to {
item 1 of displayBounds,
item 2 of displayBounds,
item 1 of displayBounds + (item 3 of displayBounds - item 1 of displayBounds),
item 2 of displayBounds + (item 4 of displayBounds - item 2 of displayBounds)
}
set bounds of window windowIndex to windowBounds
end if
end tell
end tell
end positionWindowAcrossDisplays
Layout Templates
-- Predefined layout templates for different workflows
on applyLayoutTemplate(templateName)
tell application "System Events"
set displayInfo to getDisplayInfo()
if templateName = "coding" then
-- Terminal left 50%, Browser right 50% on main display
positionWindowAcrossDisplays("Terminal", 1, 1)
delay 1
positionWindowAcrossDisplays("Google Chrome", 1, 1)
-- Resize Chrome to right half
tell application "Google Chrome"
set mainBounds to bounds of display 1
set chromeBounds to {
(item 1 of mainBounds) + ((item 3 of mainBounds - item 1 of mainBounds) / 2),
item 2 of mainBounds,
item 3 of mainBounds,
item 4 of mainBounds
}
set bounds of window 1 to chromeBounds
end tell
else if templateName = "research" then
-- Browser center 60%, Notes right 40%, Terminal bottom strip
positionWindowAcrossDisplays("Google Chrome", 1, 1)
positionWindowAcrossDisplays("Notes", 1, 1)
positionWindowAcrossDisplays("Terminal", 1, 1)
else if templateName = "data_analysis" then
-- Terminal left 33%, Data tools right 67%
positionWindowAcrossDisplays("Terminal", 1, 1)
positionWindowAcrossDisplays("Numbers", 1, 1)
end if
end tell
end applyLayoutTemplate
Application Control & Orchestration
Advanced App Launching
-- Intelligent application launching with state management
on launchAppWithConfiguration(appName, config)
tell application "System Events"
-- Check if app is already running
set appProcess to (first process whose name is appName)
if appProcess exists then
-- App is running, bring to front
tell application appName to activate
else
-- App not running, launch it
tell application appName to launch
delay 3 -- Wait for app to fully load
end if
-- Apply configuration if provided
if config contains "position" then
set targetPosition to position of config
tell application appName
if (count of windows) > 0 then
set position of window 1 to targetPosition
end if
end tell
end if
if config contains "size" then
set targetSize to size of config
tell application appName
if (count of windows) > 0 then
set size of window 1 to targetSize
end if
end tell
end if
if config contains "fullscreen" then
tell application appName
if (count of windows) > 0 then
set fullscreen of window 1 to true
end if
end tell
end if
end tell
end launchAppWithConfiguration
Multi-App Workflow Orchestration
-- Coordinate multiple applications in a workflow
on orchestrateWorkflow(workflowSteps)
repeat with step in workflowSteps
set stepType to type of step
set stepApp to application of step
set stepConfig to configuration of step
if stepType = "launch" then
launchAppWithConfiguration(stepApp, stepConfig)
else if stepType = "configure" then
configureApplication(stepApp, stepConfig)
else if stepType = "communicate" then
set sourceApp to source of step
set targetApp to target of step
set dataTransfer to data of step
transferDataBetweenApps(sourceApp, targetApp, dataTransfer)
end if
-- Add delay between steps for stability
delay 1
end repeat
end orchestrateWorkflow
URL Schemes & Deep Linking
Custom URL Scheme Registration
-- Register custom URL schemes for deep linking
on registerURLScheme(schemeName, handlerApp, handlerScript)
tell application "System Events"
-- Create URL scheme registration
set schemeInfo to {
scheme:schemeName,
handler:handlerApp,
script:handlerScript
}
-- Write to Launch Services database
do shell script "defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{\"LSHandlerURLScheme\":\"" & schemeName & "\",\"LSHandlerRoleAll\":\"" & handlerApp & "\"}'"
-- Refresh Launch Services
do shell script "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user"
end tell
end registerURLScheme
URL Handler Implementation
-- Handle incoming URL scheme requests
on handleURLRequest(scheme, data)
if scheme = "ff-terminal" then
-- Parse URL data
set urlComponents to splitString(data, "/")
set command to item 1 of urlComponents
if command = "automate" then
set automationTask to item 2 of urlComponents
executeAutomationTask(automationTask)
else if command = "workflow" then
set workflowName to item 2 of urlComponents
runWorkflow(workflowName)
else if command = "layout" then
set layoutName to item 2 of urlComponents
applyLayoutTemplate(layoutName)
end if
else if scheme = "automation" then
-- Handle automation-specific URLs
processAutomationURL(data)
end if
end handleURLRequest
Cross-Application Communication
-- Enable apps to communicate via URL schemes
on enableAppCommunication(sourceApp, targetApp, messageFormat)
-- Register URL scheme in target app
registerURLScheme(targetApp & "://", sourceApp, "")
-- Configure source app to generate appropriate URLs
tell application sourceApp
-- Implementation depends on source app capabilities
-- Example for browser-based automation:
set communicationURL to targetApp & "://message/" & urlEncode(messageFormat)
open location communicationURL
end tell
end enableAppCommunication
System Integration & Control
System Preferences Automation
-- Automated system preferences configuration
on configureSystemPreference(pane, setting, value)
tell application "System Preferences"
activate
set current pane to pane pane
delay 1 -- Wait for pane to load
tell application "System Events"
tell process "System Preferences"
-- Navigate to specific setting
click UI element setting of group 1 of window pane
-- Set the value
set value of UI element setting of group 1 of window pane to value
end tell
end tell
quit
end tell
end configureSystemPreference
Notification Center Integration
-- System notifications with advanced options
on showNotification(title, subtitle, message, soundName)
tell application "System Events"
-- Create notification
set notification to {
title:title,
subtitle:subtitle,
informativeText:message,
soundName:soundName,
hasActionButton:true,
actionButtonTitle:"Open"
}
-- Display notification
display notification message with title title subtitle subtitle sound name soundName
end tell
end showNotification
Finder Operations
-- Advanced Finder automation
on automateFinderOperation(operation, source, destination)
tell application "Finder"
if operation = "move" then
move source to destination
else if operation = "copy" then
duplicate source to destination
else if operation = "organize" then
-- Organize files by type
set sourceFolder to folder source
set filesInFolder to every file of sourceFolder
repeat with fileItem in filesInFolder
set fileType to file type of fileItem
set targetFolder to folder fileType of destination
if not (exists targetFolder) then
make new folder at destination with properties {name:fileType}
set targetFolder to folder fileType of destination
end if
move fileItem to targetFolder
end repeat
end if
end tell
end automateFinderOperation
Error Handling & Recovery
Robust Error Management
-- Comprehensive error handling with recovery
on executeWithErrorRecovery(scriptBlock, recoveryBlock)
try
-- Execute main script block
execute script scriptBlock
on error errMsg number errNum
-- Log error details
log "AppleScript Error: " & errMsg & " (Error " & errNum & ")"
-- Attempt recovery
if recoveryBlock is not missing then
try
execute script recoveryBlock
on error recoveryErr
log "Recovery failed: " & recoveryErr
end try
end if
-- Return error information
return {
success:false,
error:errMsg,
errorNumber:errNum
}
end try
return {success:true}
end executeWithErrorRecovery
Application State Validation
-- Validate application state before operations
on validateApplicationState(appName, requiredState)
tell application "System Events"
set appProcess to first process whose name is appName
if not (appProcess exists) then
return {valid:false, reason:"Application not running"}
end if
tell application appName
if requiredState contains "window" then
if (count of windows) = 0 then
return {valid:false, reason:"No windows open"}
end if
end if
if requiredState contains "frontmost" then
if not frontmost then
return {valid:false, reason:"Application not frontmost"}
end if
end if
end tell
end tell
return {valid:true}
end validateApplicationState
Performance Optimization
Template Caching System
-- Cache frequently used AppleScript templates
property scriptCache : {}
on getCachedScript(templateName)
if scriptCache contains templateName then
return scriptCache's item templateName
else
-- Load script from file
set scriptPath to "/path/to/templates/" & templateName & ".applescript"
set scriptContent to read file scriptPath
-- Cache for future use
set scriptCache's item templateName to scriptContent
return scriptContent
end if
end getCachedScript
Batch Operations
-- Execute multiple operations efficiently
on executeBatchOperation(operations)
tell application "System Events"
-- Group similar operations
set appOperations to {}
set systemOperations to {}
repeat with operation in operations
set operationType to type of operation
if operationType = "application" then
set end of appOperations to operation
else if operationType = "system" then
set end of systemOperations to operation
end if
end repeat
-- Execute application operations
repeat with appOp in appOperations
executeApplicationOperation(appOp)
end repeat
-- Execute system operations
repeat with sysOp in systemOperations
executeSystemOperation(sysOp)
end repeat
end tell
end executeBatchOperation
Best Practices for Agents
1. Always Validate Before Execution
- Check application availability and state
- Verify screen configurations
- Test URL scheme registration
2. Use Progressive Disclosure
- Start with simple operations
- Build complexity gradually
- Provide clear feedback at each step
3. Implement Robust Error Handling
- Always include try-catch blocks
- Provide meaningful error messages
- Include recovery mechanisms
4. Optimize for Performance
- Cache frequently used scripts
- Batch operations when possible
- Minimize delays between operations
5. Maintain Security
- Request permissions before sensitive operations
- Validate user input and parameters
- Use secure communication methods
Integration with FF-Terminal Tools
This skill integrates seamlessly with existing FF-Terminal tools:
- macos_control: Use for direct AppleScript execution
- workflow_automation: Combine with workflow orchestration
- bash: Use for system-level operations alongside AppleScript
When implementing AppleScript solutions, always consider how they can be enhanced through FF-Terminal's broader automation ecosystem.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核