From b888c1db70df256ce78e255e5d8853cd754e3f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Paluch?= Date: Mon, 16 Nov 2026 12:58:01 +0100 Subject: [PATCH] Add OpenCode skills and global config --- .gitignore | 5 ++ README.md | 31 ++++++++ cli.json | 4 + opencode.json | 19 +++++ skills/git-release/SKILL.md | 11 +++ .../git-release/references/release-policy.md | 5 ++ skills/git-release/scripts/changelog.ts | 4 + skills/taskwarrior-productivity/SKILL.md | 74 +++++++++++++++++++ .../references/queries.sql | 62 ++++++++++++++++ 9 files changed, 215 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 cli.json create mode 100644 opencode.json create mode 100644 skills/git-release/SKILL.md create mode 100644 skills/git-release/references/release-policy.md create mode 100644 skills/git-release/scripts/changelog.ts create mode 100644 skills/taskwarrior-productivity/SKILL.md create mode 100644 skills/taskwarrior-productivity/references/queries.sql diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50654d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Runtime state / secrets — never commit +service.json +log/ +node_modules/ +*.log diff --git a/README.md b/README.md new file mode 100644 index 0000000..d1f5898 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# opencode_config + +Backup konfiguracji OpenCode: skille i ustawienia globalne +(zawartość `~/.config/opencode/`). + +## Zawartość + +| Plik/katalog | Opis | +|---|---| +| `opencode.json` | Konfiguracja serwera (model, provider llamacpp) | +| `cli.json` | Ustawienia CLI/TUI | +| `skills/` | Skille agenta (`git-release`, `taskwarrior-productivity`) | + +`service.json` jest celowo wykluczony (zawiera hasło usługi). + +## Przywracanie + +```sh +# wyczyść istniejący katalog (jeśli jest) i sklonuj: +rm -rf ~/.config/opencode +git clone https://gitea.myftp.org/pali112/opencode_config ~/.config/opencode +``` + +## Zmiany + +Katalog jest repo git — po edycji konfiguracji: + +```sh +cd ~/.config/opencode +git add -A && git commit -m "opis zmiany" && git push +``` diff --git a/cli.json b/cli.json new file mode 100644 index 0000000..a941cf1 --- /dev/null +++ b/cli.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://opencode.ai/v2/cli.json", + "plugins": [] +} diff --git a/opencode.json b/opencode.json new file mode 100644 index 0000000..9b75f50 --- /dev/null +++ b/opencode.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://opencode.ai/config.json", + "model": "llamacpp/qwen3.8-27b", + "providers": { + "llamacpp": { + "name": "llama.cpp", + "package": "@opencode/ai/providers/openai-compatible", + "settings": { + "baseURL": "http://127.0.0.1:8081/v1" + }, + "models": { + "qwen3.8-27b": { + "name": "Qwen3.8 27B (Q6_K_M)", + "modelID": "/mnt/nvme_data/LLamaModels/Qwen3.8-27B-UD-Q6_K_M.gguf" + } + } + } + } +} diff --git a/skills/git-release/SKILL.md b/skills/git-release/SKILL.md new file mode 100644 index 0000000..510fd51 --- /dev/null +++ b/skills/git-release/SKILL.md @@ -0,0 +1,11 @@ +--- +name: Git Release +description: Prepare release notes, version bumps, and GitHub releases +--- + +## Workflow + +1. Read `references/release-policy.md`. +2. Summarize merged changes since the previous tag. +3. Propose the version bump before changing any files. +4. Run `scripts/changelog.ts` only after the user approves the version. diff --git a/skills/git-release/references/release-policy.md b/skills/git-release/references/release-policy.md new file mode 100644 index 0000000..2fa00a8 --- /dev/null +++ b/skills/git-release/references/release-policy.md @@ -0,0 +1,5 @@ +# Release Policy + +- Follow Semantic Versioning (`major.minor.patch`). +- Bump `major` for breaking changes, `minor` for new features, `patch` for fixes. +- Tag releases with `v` prefix, e.g. `v1.2.3`. diff --git a/skills/git-release/scripts/changelog.ts b/skills/git-release/scripts/changelog.ts new file mode 100644 index 0000000..9ca6e37 --- /dev/null +++ b/skills/git-release/scripts/changelog.ts @@ -0,0 +1,4 @@ +#!/usr/bin/env tsx +// Placeholder changelog generator for the `git-release` example skill. +// Run only after the version bump has been approved. +console.log("Generate the changelog here."); diff --git a/skills/taskwarrior-productivity/SKILL.md b/skills/taskwarrior-productivity/SKILL.md new file mode 100644 index 0000000..8304934 --- /dev/null +++ b/skills/taskwarrior-productivity/SKILL.md @@ -0,0 +1,74 @@ +--- +name: Taskwarrior Productivity +description: Check Taskwarrior productivity — completed vs pending tasks, monthly trends, average completion time, burndown, oldest/overdue backlog. Use when the user asks (in Polish or English) to check their productivity, progress, task stats, or how they are doing in Taskwarrior (np. "sprawdź moją produktywność w taskwarrior", "ile zadań ogarnąłem?"). +--- + +# Taskwarrior Productivity Report + +Report the user's Taskwarrior productivity: totals, monthly trend, recent +completions, backlog age, and warnings (unsynced changes, overdue, blocked). +Answer in the user's language (for this user: Polish). + +## Workflow + +1. **Sanity check** — confirm the CLI and data location: + + ```sh + task version + task show data.location + ``` + +2. **Built-in reports** (all safe, read-only): + + ```sh + task stats # totals: pending/waiting/completed/deleted, avg pending time, sync backlog + task summary # per-project progress table + task burndown # weekly trend, net fix rate, estimated completion date + ``` + +3. **Detailed stats from the database.** Taskwarrior 3.x uses the + TaskChampion backend: a SQLite file `taskchampion.sqlite3` in the data + location (there is NO legacy `task.data` file). Tasks are JSON blobs in + table `tasks(uuid, data)`. Run the queries from + `references/queries.sql` with `sqlite3 -readonly /taskchampion.sqlite3`. + + The queries cover: completion span, completions per month, 7/30/90-day + windows, average time-to-completion, top projects by completions, last 10 + completions, and average pending age. + +4. **Compose the report** — a compact table of key metrics, a small + ASCII monthly bar chart, the 10 most recent completions, top projects, and + a short "warnings" section: + - sync backlog size from `task stats` (e.g. "67 local changes. Sync required") + - overdue pending tasks (`task list overdue limit:10`) + - blocked / blocking tasks (counted in `task stats`) + - oldest pending tasks worth flagging + +5. Keep it concise. End by offering to drill into one slice (e.g. list the + oldest or overdue tasks) rather than dumping everything. + +## Pitfalls (learned the hard way — do not repeat) + +- **Never run bare `task done` / `task done limit:N`** — `done` is an ACTION. + With no filter it tries to complete ALL tasks and only an interactive + yes/no prompt saves the data. There is no `task report done` either. +- **Do not trust list filters for completed tasks on this setup:** + `task list done`, `task list status:done`, and `task list status:completed` + all return "No matches" even with completed tasks present. Query the + SQLite database instead (step 3). +- **TaskChampion timestamps are Unix SECONDS stored as JSON TEXT.** + Always `CAST(json_extract(data,'$.') AS INTEGER)` before comparing + with `strftime('%s','now')` or doing arithmetic. Without the CAST, + integer-vs-text comparisons silently return wrong results. +- **Field names:** `entry` = created, `end` = completed, `start`, + `modified`, `due`. There is no `created` field. `start` is often absent — + use `COALESCE(start, entry)`. +- **Statuses:** `pending`, `completed`, `deleted`, `recurring`. + Waiting tasks are `pending` with a `wait` date. +- **`task pending count` / `task done count`** can be mis-parsed (a bare + `count` with an action word prompts for destructive confirmation). + Prefer `task stats` or the SQL queries. +- **`task summary` triggers recurring-task creation** (new instances appear); + that is normal, not corruption. +- Read-only access only: always pass `-readonly` to sqlite3; never write to + the database from this skill. diff --git a/skills/taskwarrior-productivity/references/queries.sql b/skills/taskwarrior-productivity/references/queries.sql new file mode 100644 index 0000000..d8fea2c --- /dev/null +++ b/skills/taskwarrior-productivity/references/queries.sql @@ -0,0 +1,62 @@ +-- Taskwarrior TaskChampion productivity queries +-- Run: sqlite3 -readonly /taskchampion.sqlite3 -bail +-- Substitutions: = path from `task show data.location` +-- Schema: tasks(uuid TEXT PRIMARY KEY, data TEXT) where data is a JSON blob. +-- Timestamps (entry, start, end, modified, due) are Unix SECONDS as JSON TEXT +-- -> always CAST(... AS INTEGER). + +-- Status overview +SELECT json_extract(data,'$.status') AS status, COUNT(*) +FROM tasks GROUP BY 1; + +-- Completion span +SELECT datetime(MIN(CAST(json_extract(data,'$.end') AS INTEGER)),'unixepoch') AS first_done, + datetime(MAX(CAST(json_extract(data,'$.end') AS INTEGER)),'unixepoch') AS last_done +FROM tasks +WHERE json_extract(data,'$.status')='completed' + AND json_extract(data,'$.end') IS NOT NULL; + +-- Completions per month (last 18) +SELECT strftime('%Y-%m', CAST(json_extract(data,'$.end') AS INTEGER),'unixepoch') AS month, + COUNT(*) AS completed +FROM tasks +WHERE json_extract(data,'$.status')='completed' + AND json_extract(data,'$.end') IS NOT NULL +GROUP BY 1 ORDER BY 1 DESC LIMIT 18; + +-- 7 / 30 / 90 day windows +SELECT SUM(CAST(json_extract(data,'$.end') AS INTEGER) > strftime('%s','now')-7*86400) AS last_7d, + SUM(CAST(json_extract(data,'$.end') AS INTEGER) > strftime('%s','now')-30*86400) AS last_30d, + SUM(CAST(json_extract(data,'$.end') AS INTEGER) > strftime('%s','now')-90*86400) AS last_90d +FROM tasks WHERE json_extract(data,'$.status')='completed'; + +-- Average time-to-completion in days (entry -> end) +SELECT printf('%.1f', + AVG(CAST(json_extract(data,'$.end') AS INTEGER) + - CAST(json_extract(data,'$.entry') AS INTEGER))/86400.0) AS avg_days +FROM tasks +WHERE json_extract(data,'$.status')='completed' + AND json_extract(data,'$.entry') IS NOT NULL; + +-- Top 10 projects by completions +SELECT COALESCE(json_extract(data,'$.project'), '(none)') AS project, COUNT(*) +FROM tasks WHERE json_extract(data,'$.status')='completed' +GROUP BY 1 ORDER BY 2 DESC LIMIT 10; + +-- Last 10 completions +SELECT datetime(CAST(json_extract(data,'$.end') AS INTEGER),'unixepoch') AS done, + json_extract(data,'$.description') AS description +FROM tasks WHERE json_extract(data,'$.status')='completed' +ORDER BY 1 DESC LIMIT 10; + +-- Average age of pending tasks in days +SELECT printf('%.0f', + AVG(strftime('%s','now') - CAST(json_extract(data,'$.entry') AS INTEGER))/86400.0) AS avg_pending_age_days +FROM tasks WHERE json_extract(data,'$.status')='pending'; + +-- Oldest 10 pending tasks +SELECT json_extract(data,'$.uuid') AS uuid, + datetime(CAST(json_extract(data,'$.entry') AS INTEGER),'unixepoch') AS added, + json_extract(data,'$.description') AS description +FROM tasks WHERE json_extract(data,'$.status')='pending' +ORDER BY 2 ASC LIMIT 10;