claude-configs/skills/backlog/SKILL.md
Cal Corum 047ec745eb Add new skills, commands, scripts; update Paper Dynasty workflows
New:
- backlog, cognitive-memory, optimise-claude skills
- commands/ and scripts/ directories
- usage-data tracking

Updated:
- Paper Dynasty: consolidated workflows, updated API client and CLI
- .gitignore, CLAUDE.md, settings.json

Removed:
- Deprecated Paper Dynasty workflows (card-refresh, database-sync,
  discord-app-troubleshooting, gauntlet-cleanup, custom-player-db)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:10:21 -06:00

114 lines
3.6 KiB
Markdown

---
name: backlog
description: Check Gitea repo for open issues and surface the next task to work on. Scans for TODOs in the codebase if no issues exist, creates issues for them, then offers options. USE WHEN user says "backlog", "what should I work on", "next task", "open issues", "check issues", "/backlog", or wants to find work to do.
---
# Backlog - Find Next Task
## When to Activate This Skill
- "/backlog"
- "What should I work on?"
- "Check for open issues"
- "Any tasks to do?"
- "What's next?"
- "Show me the backlog"
## Core Workflow
### Step 1: Detect the current repo
Extract the Gitea `owner/repo` from the git remote:
```bash
git remote get-url origin 2>/dev/null | sed -n 's|.*git\.manticorum\.com[:/]\(.*\)\.git|\1|p'
```
If no `git.manticorum.com` remote is found, ask the user which repo to check.
### Step 2: Fetch open issues from Gitea
```bash
curl -s -H "Authorization: token $(cat /home/cal/.claude/secrets/gitea_token)" \
"https://git.manticorum.com/api/v1/repos/{owner/repo}/issues?state=open&type=issues&limit=20&sort=priority" \
| python -m json.tool
```
**Gitea API base:** `https://git.manticorum.com/api/v1`
**Auth token:** `/home/cal/.claude/secrets/gitea_token`
### Step 3: Branch based on results
#### Path A: Open issues exist
Present issues to the user as numbered options:
```
Found 3 open issues for cal/my-memory:
1. #12 — Add dark mode toggle (enhancement)
Labels: feature, ui
Created: 2d ago
2. #10 — Fix audio recording on Wayland (bug)
Labels: bug, audio
Created: 5d ago
3. #8 — Add export to markdown (feature)
Labels: feature
Created: 1w ago
Which issue would you like to work on?
```
Include: issue number, title, labels, relative age. If there are many issues, show the top 5-7 most relevant (prioritize bugs, then features, then enhancements).
#### Path B: No open issues — scan for TODOs
Use Grep to scan the codebase for TODO/FIXME/HACK/XXX markers:
```
Grep pattern: "(TODO|FIXME|HACK|XXX):?\s"
```
**Exclude:** `.git/`, `node_modules/`, `__pycache__/`, `.venv/`, `*.lock`, `*.min.*`
For each TODO found:
1. Read surrounding context (a few lines around the match)
2. Group related TODOs if they're in the same function/section
3. Create a Gitea issue for each distinct task:
```bash
curl -s -X POST \
-H "Authorization: token $(cat /home/cal/.claude/secrets/gitea_token)" \
-H "Content-Type: application/json" \
"https://git.manticorum.com/api/v1/repos/{owner/repo}/issues" \
-d '{
"title": "Clear, actionable title derived from the TODO",
"body": "Found in `file/path.py:42`:\n\n```\n# TODO: the original comment\n```\n\nContext: brief description of what needs to be done.",
"labels": []
}'
```
After creating issues, present them as options (same format as Path A).
#### Path C: No issues and no TODOs
```
No open issues and no TODO markers found in cal/my-memory.
The backlog is clear — nice work!
```
## Issue Creation Guidelines
- **Title:** Imperative verb form, concise ("Add export feature", "Fix audio clipping on short recordings")
- **Body:** Include the file path and line number, the TODO text, and brief surrounding context
- **Deduplication:** Before creating, check if an open issue with a very similar title already exists
- **Grouping:** If multiple TODOs clearly relate to the same task (e.g., in the same function), combine them into one issue
## Key Principles
1. Always detect repo from git remote — don't hardcode repos
2. Present options clearly so the user can pick their next task quickly
3. Only create issues for genuine TODOs, not commented-out code or documentation examples
4. Keep issue titles actionable and concise