first
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
# Tasks
|
||||
|
||||
A task is a set of instructions to accomplish an atomic goal. Each task lives in its own directory under `tasks/` and is defined by a `TASK.md` file.
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
tasks/
|
||||
<task-slug>/
|
||||
TASK.md
|
||||
```
|
||||
|
||||
## TASK.md Format
|
||||
|
||||
A task file has two parts: **frontmatter** (YAML metadata) and **body** (Markdown instructions).
|
||||
|
||||
### Frontmatter
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: Task Name
|
||||
description: A short description of what the task does.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- tag1
|
||||
- tag2
|
||||
skills:
|
||||
- skill-name
|
||||
trigger:
|
||||
- type: file
|
||||
extensions:
|
||||
- ext1
|
||||
- ext2
|
||||
- type: directory
|
||||
inputs:
|
||||
- name: input_name
|
||||
description: What this input is.
|
||||
required: true
|
||||
---
|
||||
```
|
||||
|
||||
#### Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `name` | string | yes | Human-readable name of the task. |
|
||||
| `description` | string | yes | Short description of what the task does. |
|
||||
| `version` | integer | no | Version number of the task definition. |
|
||||
| `author` | string | no | Author of the task. |
|
||||
| `tags` | string[] | no | Tags for categorization. |
|
||||
| `skills` | string[] | no | Skills required to execute the task. |
|
||||
| `trigger` | object[] | no | List of triggers that define when this task is applicable. |
|
||||
| `trigger[].type` | string | yes | What the trigger applies to (`file` or `directory`). |
|
||||
| `trigger[].extensions` | string[] | no | File extensions that match this trigger. Only applicable when `type` is `file`. |
|
||||
| `inputs` | object[] | no | Inputs the task expects. |
|
||||
| `inputs[].name` | string | yes | Name of the input parameter. |
|
||||
| `inputs[].description` | string | yes | Description of the input. |
|
||||
| `inputs[].required` | boolean | no | Whether the input is required. |
|
||||
|
||||
### Body
|
||||
|
||||
The body contains:
|
||||
|
||||
1. **Title** — `# Task Name`, matching the frontmatter `name`.
|
||||
2. **Description** — A one-line summary, matching the frontmatter `description`.
|
||||
3. **Steps** — An ordered list under `## Steps` describing the instructions to accomplish the task.
|
||||
|
||||
### Example
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: Transcribe Audio File
|
||||
description: Transcribe an audio file to text using whisper.cpp.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- audio
|
||||
- transcription
|
||||
skills:
|
||||
- whisper.cpp
|
||||
trigger:
|
||||
- type: file
|
||||
extensions:
|
||||
- mp3
|
||||
- wav
|
||||
- m4a
|
||||
inputs:
|
||||
- name: file_path
|
||||
description: Path to the audio file to transcribe.
|
||||
required: true
|
||||
---
|
||||
|
||||
# Transcribe Audio File
|
||||
|
||||
Transcribe an audio file to text using whisper.cpp.
|
||||
|
||||
## Steps
|
||||
|
||||
1. First step.
|
||||
2. Second step.
|
||||
3. Third step.
|
||||
```
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
name: Convert To MP3
|
||||
description: Convert audio files to MP3 320kbps, preserving metadata.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- audio
|
||||
- conversion
|
||||
skills:
|
||||
- convert-audio-to-mp3
|
||||
trigger:
|
||||
- type: file
|
||||
extensions:
|
||||
- flac
|
||||
- wav
|
||||
- ogg
|
||||
- wma
|
||||
- aac
|
||||
- m4a
|
||||
- opus
|
||||
- aiff
|
||||
- aif
|
||||
- ape
|
||||
- wv
|
||||
- alac
|
||||
- dsf
|
||||
- dff
|
||||
- type: directory
|
||||
inputs:
|
||||
- name: file_path
|
||||
description: Path to an audio file or an artist directory to convert.
|
||||
required: true
|
||||
---
|
||||
|
||||
# Convert To MP3
|
||||
|
||||
Convert audio files to MP3 320kbps, preserving metadata.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Determine whether `file_path` points to a single audio file or a directory.
|
||||
2. If it is a single file, use the Convert Audio To MP3 skill's single-file script to convert it. The source file is deleted on success.
|
||||
3. If it is a directory, use the Convert Audio To MP3 skill's batch script with the directory name as the artist name. All audio files within subdirectories are converted recursively.
|
||||
4. Verify the conversion completed successfully and report the result to the user.
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"id":"12f6c028-f2b8-4461-83cf-6ed8eb6bd3c9"}
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Transcribe Audio File
|
||||
description: Transcribe an audio file to text using whisper.cpp.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- audio
|
||||
- transcription
|
||||
skills:
|
||||
- whisper.cpp
|
||||
trigger:
|
||||
- type: file
|
||||
extensions:
|
||||
- mp3
|
||||
- wav
|
||||
- m4a
|
||||
inputs:
|
||||
- name: file_path
|
||||
description: Path to the audio file to transcribe.
|
||||
required: true
|
||||
---
|
||||
|
||||
# Transcribe Audio File
|
||||
|
||||
Transcribe an audio file to text using whisper.cpp.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Determine the user's root directory by navigating one level up from the current working directory. Read `settings.json` from the root directory and extract the `languages` section.
|
||||
2. Detect the language of the audio file using the whisper.cpp skill with `detect_language=true` and `response_format=verbose_json`.
|
||||
3. Compare the detected language against the user's `languages.spoken` list. If the detected language is in the list, skip translation. Otherwise, set `translate=true`.
|
||||
4. Use the whisper.cpp skill to transcribe the audio file at `file_path`, passing the detected language as the `language` parameter and the `translate` flag from the previous step.
|
||||
5. Read the transcription and generate a short, descriptive title based on its contents.
|
||||
6. Create a directory alongside the original audio file named `<date>_<slug>`, where `<date>` is the current date in `YYYYMMDD` format and `<slug>` is a slug derived from the generated title.
|
||||
7. Move the original audio file and save the transcription as a Markdown file (`.md`) into the new directory, using the same base name for the `.md` file.
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"id":"2dfd2db0-9f36-414b-8639-16918d98448c"}
|
||||
Reference in New Issue
Block a user