计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
shortcuts-builder【效率与协作】Build and remix Apple Shortcuts from natural-language automation requests in Minis — routing, clarification, action-chain planning, XML generation, local validation, and signing via a user-chosen backend; suited to system automation, notes, reminders, weather, share, URL, files, and hybrid shortcuts.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Reply to the user in the user's language (e.g. Chinese question -> Chinese answer). The skill files themselves are English.
Reliably turn natural-language automation requests into one or more of the following results:
.shortcut productThis skill is an adaptation of the upstream viticci/shortcuts-playground-plugin (MIT) for Minis on iPhone/iPad. It keeps the upstream knowledge base and methods, and adds Minis-oriented routing, clarification, an environment profile, build checks, and delivery logic. See UPSTREAM_ATTRIBUTION.md.
For a typical request, do these in order. Every item is detailed later; this is the map.
BUILD_CHECKLIST.md, CAPABILITY_DECISION.md). If the request is not shortcut-first, stop.user_ask (section 4). Use the recommended default on timeout, except for signing and uploads.is.workflow.actions.* -> first-party classic action -> ACTION_PARAM_INDEX.mdcom.apple.* -> first-party App Intent -> APPINTENTS.md<bundle id>.<Intent>) -> third-party App Intent -> THIRD_PARTY_INTENTS.md and scripts/appintent_catalog.py/var/minis/attachments/shortcut/drafts/, then validate (scripts/validate-shortcut) until it passes.AEA1.BUILD_CHECKLIST.md first to decide whether the conditions to start work are met.shortcut-native, shortcut-hybrid, not-shortcut-first.user_ask tool when it is available (see section 4: batches of at most 4, recommended option first and set as default). Use the fixed option-style text template only when user_ask is unavailable, and end it with a recommended flow and copyable confirmation text. Ask in the user's language.user_ask card times out, and say which default was applied. Never apply a default for a confirm-type question; a timeout there means do not perform the action./var/minis/attachments/shortcut/./var/minis/attachments/shortcut/drafts/ or the archive directory.scripts/resolve-icon to set WFWorkflowIconGlyphNumber and WFWorkflowIconStartColor, unless the user explicitly specifies integer values.scripts/placeholder-range to compute positions when a WFTextTokenString contains placeholders.scripts/validate-shortcut; at most 5 rounds, and stop if the same error is unchanged for 2 consecutive rounds.sign-shortcut --show-config). If it is unconfigured (exit code 10), ask the user to pick one of the two backends first (use an interactive question tool if available); never choose HubSign on the user's behalf.scripts/sign-shortcut; the backend is mac (the user's own Mac, over SSH) or hubsign (third-party; drafts are uploaded).AEA1.THIRD_PARTY_INTENTS.md lists it as verified (text and bool). Other kinds may be written only through appintent_catalog.py step (experimental tier, variables for image/file/entity/array/date); name every experimental parameter in the report and ask the user to check it after import. Never invent a literal form for a refused kind.value and title name different cases.hubsign, drafts are uploaded to a third-party service: say so plainly and get the user's confirmation (--i-understand-upload).--password-env VARIABLE_NAME, or use --key.Applies to:
Does not apply to:
.shortcutMETHODOLOGY.md ← Primary entry point: 10-step methodology cheat sheet; read this file first for every build taskBUILD_CHECKLIST.mdCAPABILITY_DECISION.mdROUTING_FRAMEWORK.mdCLARIFICATION_TEMPLATES.mdCOMMON_PATTERNS.mdACTION_RECIPES.mdTEMPLATE_MAPPING.mdTASK_FAMILY_INDEX.mdXML_SNIPPET_PATTERNS.mdACTION_PARAM_INDEX.mdKNOWN_PITFALLS.mdENV_PROFILE.mdSTABILITY_NOTES.mdBEST_PRACTICES.mdACTIONS.mdAPPINTENTS.mdAUTOMATION_TRIGGERS.md (OS 27 automation triggers; can only be written with an exported sample)PARAMETER_TYPES.mdPLIST_FORMAT.mdVARIABLES.mdCONTROL_FLOW.mdFILTERS.mdEXAMPLES.mdURL_SCHEMES.mdICONS_AND_COLORS.mdHEALTHKIT.mdTHIRD_PARTY_ACTIONS.mdTHIRD_PARTY_INTENTS.md (read before using any third-party app step: step structure, which parameter kinds may be authored, chaining, what is unverified)EXTRACTING_APP_INTENTS.md (maintainers only: how to extract a new app's intents from its package and refresh the catalog; not needed to build a shortcut, read it only when the user asks to add or update an app's intents)TOOLKIT_SNAPSHOT.mdgolden-shortcuts/index.jsonlscripts/check-local-assetsscripts/profile-summaryscripts/load-env-profilescripts/preflight-requestscripts/render-clarificationscripts/resolve-iconscripts/placeholder-rangescripts/validate-shortcut (the default target is iOS/iPadOS, OS 27; no flag is needed for a normal iPhone shortcut. Add --target-platform macos only for a Mac-only shortcut, and --target-os 26 only to check against the older OS)scripts/lookup_action_grounding.py (look up action parameters/enum values/platform compatibility: python3 scripts/lookup_action_grounding.py --identifier openapp; same iOS default)scripts/appintent_catalog.py (search/show/step over the third-party App Intents catalog: python3 scripts/appintent_catalog.py search weather; details in THIRD_PARTY_INTENTS.md)scripts/fix-positionsscripts/index-goldenscripts/match-goldenscripts/sign-shortcut (signing entry point, choose one of two backends; implementation in sign_shortcut.py, HubSign channel in sign_shortcut_via_hubsign.py)scripts/selftest_minis.pyFirst read BUILD_CHECKLIST.md and confirm:
If one is missing and would change the route, stop and clarify first.
Read CAPABILITY_DECISION.md and label the task:
shortcut-nativeshortcut-hybridnot-shortcut-firstConsult MINIS_CAPABILITIES.md to locate tools only when the user explicitly asks to involve Minis (for example "use Minis", "can Minis do this", or "go through Minis"). Otherwise decide the route as usual.
If it is not-shortcut-first, do not proceed to XML generation.
Read ROUTING_FRAMEWORK.md and break the request into:
goaltriggerinputtransformoutputdestinationpermissionsdependenciesinteractionruntimedelivery_modeIf the spec is incomplete, do not proceed to generation.
If the spec lacks key boundaries, use CLARIFICATION_TEMPLATES.md, or run directly:
/var/minis/skills/shortcuts-builder/scripts/preflight-request 'raw user request'
/var/minis/skills/shortcuts-builder/scripts/render-clarification 'raw user request'
Requirements:
Preferred: the user_ask tool. Get the questions ready to send:
/var/minis/skills/shortcuts-builder/scripts/render-clarification --json 'raw user request'
The output has batches; each batch is a valid questions array for one user_ask call (at most 4 questions per call). The recommended option is first and default is "0", so the card marks it as recommended. Translate the question and option text into the user's language before sending. Put every needed question in one call; start a second call only when a later question depends on an earlier answer.
Answer handling:
| Result | What to do |
|---|---|
answered / other | Use it. other text is the user's own words: follow it. |
delegated ("You decide") | Use the recommended option and state that assumption. |
timeout | Proceed with the default option, say plainly which default was applied so the user can correct it, and keep the build easy to change. |
dismissed | Do not ask the same question again; if the user's next message answers it, take that as the answer. |
unavailable | Fall back to the text template below. |
Defaults are the most reliable and least surprising route, never an irreversible one. Choose the default yourself when the tool output does not, using the same rule.
Fallback: text template. Only when user_ask is not available, run render-clarification without --json and send the fixed option-style template, ending with a recommended flow and copyable confirmation text.
Run first:
/var/minis/skills/shortcuts-builder/scripts/profile-summary
/var/minis/skills/shortcuts-builder/scripts/load-env-profile
Read the summary first, then decide whether the full profile is needed. If defaults exist, use them directly; if missing but the route is unaffected, state a default and continue.
Read first:
TASK_FAMILY_INDEX.mdCOMMON_PATTERNS.mdACTION_RECIPES.mdTEMPLATE_MAPPING.mdOnce the action chain is determined, run scripts/match-golden to match the most relevant golden shortcut as a wiring reference:
/var/minis/skills/shortcuts-builder/scripts/match-golden --actions "action1,action2" --patterns "pattern1,pattern2" --top 2
If the task has been clearly decided to go through Minis (the user asked for it), also confirm in this step:
Determine:
Check the cheat sheets first:
ACTION_PARAM_INDEX.md — confirm the required parameters and serialization of the current actionKNOWN_PITFALLS.md — confirm whether the current action hits a known pitfallSTABILITY_NOTES.md — confirm whether a known instability point is hitThen read detailed references as needed:
BEST_PRACTICES.mdACTIONS.mdAPPINTENTS.mdTHIRD_PARTY_INTENTS.md (when the flow uses a third-party app's Intent)VARIABLES.mdCONTROL_FLOW.mdFILTERS.mdPARAMETER_TYPES.mdEXAMPLES.mdRead only the parts the current task needs; do not load all docs at once.
First write a short plan that states:
scripts/appintent_catalog.py (search, then show), note its authoring level (full / partial / editor-only), and generate the step with appintent_catalog.py step. Prefer a first-party action when one does the job. See THIRD_PARTY_INTENTS.md.When a frequent action is hit, read XML_SNIPPET_PATTERNS.md first and use the minimal snippet skeleton directly.
scripts/resolve-icon to generate the icon and colorOutput to:
/var/minis/attachments/shortcut/drafts/<shortcut name>.xml
Requirements:
BEST_PRACTICES.mdRun:
/var/minis/skills/shortcuts-builder/scripts/validate-shortcut /path/to/draft.xml
Before validating, automatically fix placeholder positions:
/var/minis/skills/shortcuts-builder/scripts/fix-positions /path/to/draft.xml
Rules:
Supported:
draft-onlybuild-and-validatefull-deliveryFor complex new tasks default to build-and-validate; use full-delivery when the user explicitly wants a finished product.
Run only in full-delivery mode. First check the backend:
/var/minis/skills/shortcuts-builder/scripts/sign-shortcut --show-config
If configured is false (or signing exits with code 10), ask the user to pick one of the two with user_ask (an options question; put the Mac option first). A timeout here is not consent: do not sign and do not fall back to HubSign. Tell the user the build is ready unsigned and ask again later. The HubSign upload also needs its own explicit answer (--i-understand-upload only after the user chose it):
| Option | Privacy | Prerequisites |
|---|---|---|
| The user's own Mac (SSH) | Drafts are sent only to the user's own Mac; recommended | A Mac (macOS 12+) with the shortcuts command and SSH access; the user must provide an SSH key or put the password in an environment variable |
| HubSign (third-party, free) | Drafts are uploaded to a third-party service and their content is visible to the operator | None, zero configuration |
After the choice, configure once:
# Mac: pick one of the two (the password is passed only as an env var name; the value is never saved to disk)
scripts/sign-shortcut --setup-mac user@host --password-env MAC_SSH_PASSWORD
scripts/sign-shortcut --setup-mac user@host --key ~/.ssh/id_ed25519
# HubSign: you must first tell the user that drafts will be uploaded; add this flag only after the user agrees
scripts/sign-shortcut --setup-hubsign --i-understand-upload
Then sign as usual:
scripts/sign-shortcut /path/to/draft.xml --name "Shortcut Name"
# Optional: --mode anyone|people-who-know-me (mac backend only), --backend mac|hubsign (temporary override for this run)
This step will:
.shortcut product and verify the header is AEA1When delivering, remind the user: the signing certificate is issued by Apple per signature and is not the user's own developer certificate, so on first import iOS shows a system prompt and the user must tap "Allow" / "Import Anyway" once. This is a normal step, not a fault.
Minimum verification:
AEA1Report contents:
The skill is working as intended if it can:
/var/minis/attachments/shortcut/ when needed