trail-sense-scaffold-quick-action

Scaffolds Trail Sense quick action classes with registration, ids, and resources.

2.8k|175|Updated Oct 14, 2019
One-click install
npx skills add https://github.com/kylecorry31/Trail-Sense --skill trail-sense-scaffold-quick-action
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: trail-sense-scaffold-quick-action
Source: https://github.com/kylecorry31/Trail-Sense/tree/main/.agents/skills/trail-sense-scaffold-quick-action
Command: npx skills add https://github.com/kylecorry31/Trail-Sense --skill trail-sense-scaffold-quick-action

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a new quick action to the Trail Sense Android app requires touching several files consistently: a Kotlin class, a persisted id in Tools.kt, tool registration, and string/icon resources. This Skill guides that process so nothing is missed and existing persisted ids are never renumbered.

Core Features & Use Cases

  • Quick Action Class Scaffolding: Generates a QuickActionButton subclass in the correct tool package with icon, click, and long-click behavior.
  • Id and Registration Management: Adds a unique Tools.QUICK_ACTION_* constant and wires the action into the owning ToolRegistration file.
  • Use Case: When adding a new quick action to the flashlight tool, follow the workflow to create the class, assign the next available id, register it with a display string, and confirm it compiles without duplicating existing actions.

Quick Start

Ask the assistant to scaffold a new quick action for a specific Trail Sense tool with a given name, icon, and click behavior.

Frequently Asked Questions about trail-sense-scaffold-quick-action

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a quick action to a Trail Sense tool?▼

Create a QuickActionButton subclass in the tool's quickactions package, add a unique Tools.QUICK_ACTION_* constant, and register it in the tool's ToolRegistration file with ToolQuickAction referencing the id, display string, and constructor.

Where do quick action classes go in the Trail Sense codebase?▼

Quick action classes live under app/src/main/java/com/kylecorry/trail_sense/tools/<tool_package>/quickactions/ and are named QuickAction<Name>.kt, extending QuickActionButton.

Why must quick action ids never be renumbered in Tools.kt?▼

Quick-action ids are persisted in user preferences, so changing an existing id would break saved user configurations. Always append a new constant with the next available integer greater than existing ids.

Can a quick action define custom click and long-click behavior?▼

Yes, override onClick and onLongClick in the QuickActionButton subclass. The template's long-click opens the owning tool via findNavController().openTool(Tools.<TOOL_ID>), while click behavior is left for the implementer.