Add OpenCode skills and global config

This commit is contained in:
pali112 committed 2026-11-16 12:58:01 +01:00
commit b888c1db70
9 files changed
+215

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
# Runtime state / secrets — never commit
service.json
log/
node_modules/
*.log
+31
View File
@@ -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
```
+4
View File
@@ -0,0 +1,4 @@
{
"$schema": "https://opencode.ai/v2/cli.json",
"plugins": []
}
+19
View File
@@ -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"
}
}
}
}
}
+11
View File
@@ -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.
@@ -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`.
+4
View File
@@ -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.");
+74
View File
@@ -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 <path>/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,'$.<field>') 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.
@@ -0,0 +1,62 @@
-- Taskwarrior TaskChampion productivity queries
-- Run: sqlite3 -readonly <data.location>/taskchampion.sqlite3 -bail
-- Substitutions: <DB> = 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;