agentleFS
alexferrari88alexferrari88/skills/tasker/SKILL.md

tasker

Skill1 starsChanged 6 months agoMITView on GitHub

Automating Android tasks, profiles, scenes, and actions using Tasker. Use this skill when the user wants to design, modify, or debug Tasker configurations, write JavaScriptlets or shell scripts for Tasker, handle Android intents, or use Tasker variables and matching logic.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Local Variables: All lowercase (e.g., %local_var).

    line 17
  2. Distinctive:

    When designing a Tasker automation, follow this workflow:

    line 31
  3. Distinctive:

    Use Local Variables: Keep intermediate states in local (all-lowercase) variables to prevent global namespace pollution.

    line 35
  4. Very specific:

    Error Handling: Use the %err and %errmsg local variables after actions that might fail (e.g., HTTP request, file read) to gracefully handle …

    line 36
  5. Very specific:

    Use setLocal('varname', value) to set local variables.

    line 43
  6. Very specific:

    Use setGlobal('VARNAME', value) to set global variables.

    line 44
  7. Very specific:

    Run shell commands via the Run Shell action.

    line 54
  8. Distinctive:

    Ensure "Use Root" is checked only if root permissions are required.

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tasker Automation

Tasker is a comprehensive automation app for Android that uses a trigger-action model to automate tasks based on contexts (conditions).

Core Concepts

  • Profiles: Connects triggers (Contexts) to tasks (Enter Task and optional Exit Task).
  • Contexts: Triggers that can be based on State (persistent condition), Event (one-off occurrence), Time, Day, Location, or Application (foreground app).
  • Tasks: A named sequence of Actions executed step-by-step.
  • Variables: State holders starting with %.
    • Global Variables: Contain at least one capital letter (e.g., %MyGlobal). Persisted and shared across all Profiles and Tasks.
    • Local Variables: All lowercase (e.g., %local_var). Created and used only within the current execution of a Task.

Reference Documentation

Detailed references are partitioned as follows to avoid context bloat:

  • Profiles & Contexts: See contexts.md for details on Time, Day, Location, State, and Event contexts.
  • Tasks & Actions: See tasks.md for detailed descriptions of Task parameters, Flow Control (If, Else, End If, For, Goto), Widgets, and specific actions.
  • Variables & Logic: See variables.md for built-in variables, custom variables, variable formatting, pattern matching, and mathematical expressions.
  • Scenes & UI: See scenes.md for UI elements (buttons, sliders, text inputs), scene properties, and element actions.
  • Advanced Features: See advanced.md for JavaScriptlets, Java Object creation, Android Intents, Midi control, and Power management.

Tasker Development Workflow

When designing a Tasker automation, follow this workflow:

  1. Identify the Trigger: Determine if the trigger is a State (e.g., connected to a specific Wi-Fi) or an Event (e.g., receiving an SMS).
  2. Design the Task: List the actions needed. If stateful, decide if you need an Exit Task to revert settings when the state changes.
  3. Use Local Variables: Keep intermediate states in local (all-lowercase) variables to prevent global namespace pollution.
  4. Error Handling: Use the %err and %errmsg local variables after actions that might fail (e.g., HTTP request, file read) to gracefully handle failures.

Scripting in Tasker

JavaScript / JavaScriptlet Action

You can execute JavaScript within a task. In JavaScriptlets:

  • Access local/global Tasker variables directly by name without the % (e.g., local variables as localvar and global as GLOBALVAR).
  • Use setLocal('varname', value) to set local variables.
  • Use setGlobal('VARNAME', value) to set global variables.
  • Example:
    var battery = global('BATT');
    if (battery < 20) {
        setLocal('low_power', 'true');
    }

Shell Commands

Run shell commands via the Run Shell action.

  • Ensure "Use Root" is checked only if root permissions are required.
  • Store output in %stdout and errors in %stderr.

Android Intents

Send broadcast, activity, or service intents using the Send Intent action.

  • Action: The intent action (e.g., android.intent.action.VIEW).
  • Cat: Category (e.g., Default).
  • Data: Data URI (e.g., https://example.com).
  • Extra: Key-value extras (e.g., key:value).

Exporting & Importing Configurations

Tasker is highly sensitive to the structure of exported XML configurations.

File Extensions

For Tasker to recognize the XML data during an import, files must end with specific double extensions:

  • Projects: .prj.xml
  • Profiles: .prf.xml
  • Tasks: .tsk.xml
  • Scenes: .scn.xml

XML Root Structure

Tasker requires files to start directly with the <TaskerData> root tag. Including standard XML headers (like <?xml version="1.0" encoding="utf-8"?>) or other root wrappers will fail to parse and trigger errors.

Matching Import Actions with UI Elements

Tasker's UI contains isolated import functions. Selecting a file that doesn't match the import context will trigger errors (e.g., "no Project found"):

  • Importing a Project: Long-press on the Project/Home tab at the bottom of the screen and choose Import Project.
  • Importing a Profile/Task/Scene: Tap the corresponding tab at the top, long-press the tab label, and choose Import.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.