Loading...
Loading...
Capture an idea, task, or issue that surfaces during a Kata session as a structured issue for later work. This skill creates markdown issue files in the .planning/issues/open directory with relevant metadata and content extracted from the conversation. Triggers include "add issue", "capture issue", "new issue", "create issue", "log issue", "file issue", "add todo" (deprecated), "capture todo" (deprecated), "new todo" (deprecated).
npx skill4agent add gannonh/kata-skills kata-add-issueNote: "todos" are now "issues". Using./kata-add-issue
if [ -d ".planning/todos/pending" ] && [ ! -d ".planning/todos/_archived" ]; then
# Create new structure
mkdir -p .planning/issues/open .planning/issues/closed
# Copy pending todos to open issues
cp .planning/todos/pending/*.md .planning/issues/open/ 2>/dev/null || true
# Copy done todos to closed issues
cp .planning/todos/done/*.md .planning/issues/closed/ 2>/dev/null || true
# Archive originals
mkdir -p .planning/todos/_archived
mv .planning/todos/pending .planning/todos/_archived/ 2>/dev/null || true
mv .planning/todos/done .planning/todos/_archived/ 2>/dev/null || true
echo "Migrated todos to issues format"
fi_archived/titleproblemsolutionfilesprovenance| Path pattern | Area |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| No files or unclear | |
.planning/issues/open/${date_prefix}-${slug}.md---
created: [timestamp]
title: [title]
area: [area]
provenance: [provenance or "local"]
files:
- [file:lines]
---
## Problem
[problem description - enough context for future Claude to understand weeks later]
## Solution
[approach hints or "TBD"]GITHUB_ENABLED=$(cat .planning/config.json 2>/dev/null | grep -o '"enabled"[[:space:]]*:[[:space:]]*[^,}]*' | head -1 | grep -o 'true\|false' || echo "false")GITHUB_ENABLED=falseGITHUB_ENABLED=trueprovenancegithub:gh label create "backlog" --description "Kata backlog issues" --force 2>/dev/null || true/tmp/issue-body.md## Problem
[problem section from local file]
## Solution
[solution section from local file]
---
*Created via Kata `/kata-add-issue`*ISSUE_URL=$(gh issue create \
--title "$TITLE" \
--body-file /tmp/issue-body.md \
--label "backlog" 2>/dev/null)if [ -n "$ISSUE_URL" ]; then
ISSUE_NUMBER=$(echo "$ISSUE_URL" | grep -oE '[0-9]+$')
REPO_NAME=$(gh repo view --json nameWithOwner --jq '.nameWithOwner' 2>/dev/null)
# Update local file's frontmatter with provenance
# provenance: github:owner/repo#N
fiprovenance: localprovenance: github:${REPO_NAME}#${ISSUE_NUMBER}if ! gh auth status &>/dev/null; then
echo "Warning: gh CLI not authenticated. GitHub sync skipped."
fifind .planning/issues/open -maxdepth 1 -name "*.md" 2>/dev/null | wc -lCOMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=falseCOMMIT_PLANNING_DOCS=falseCOMMIT_PLANNING_DOCS=truegit add .planning/issues/open/[filename]
[ -f .planning/STATE.md ] && git add .planning/STATE.md
git commit -m "$(cat <<'EOF'
docs(issue): capture issue - [title]
Area: [area]
EOF
)"</step>
</process>
<output>
- `.planning/issues/open/[date]-[slug].md`
- Updated `.planning/STATE.md` (if exists)
- GitHub Issue #N with `backlog` label (if github.enabled=true)
</output>
<anti_patterns>
- Don't create issues for work in current plan (that's deviation rule territory)
- Don't create elaborate solution sections - captures ideas, not plans
- Don't block on missing information - "TBD" is fine
</anti_patterns>
<success_criteria>
- [ ] Directory structure exists
- [ ] Issue file created with valid frontmatter
- [ ] Problem section has enough context for future Claude
- [ ] No duplicates (checked and resolved)
- [ ] Area consistent with existing issues
- [ ] STATE.md updated if exists
- [ ] Issue and state committed to git
- [ ] GitHub Issue created with backlog label (if github.enabled=true)
- [ ] Provenance field set in local file (if GitHub synced)
</success_criteria>