원클릭으로
housekeeping
session-indexer repo health check. Universal hygiene + Go vet/fmt + project-specific checks. Usage: /housekeeping
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
session-indexer repo health check. Universal hygiene + Go vet/fmt + project-specific checks. Usage: /housekeeping
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Read-only bug audit of the current branch vs a base ref. Dispatches subagents per stack (Go, JS/TS, etc.), consolidates findings, produces a prioritized report. Does not fix. Usage: /find-bugs [base-ref]
Multi-model PR review with parallel fan-out. Three Ollama models (Cloud `:cloud` by default, local fallback) review the full PR diff in parallel; Claude acts as Arbiter, using vote count as a confidence prior to confirm/escalate/dismiss findings, then applies a single consolidated fix commit. Auto-merges (squash) when no fixes were reverted and the PR is mergeable; otherwise leaves it for manual review. Usage: /fix-review [PR-number]
Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production, security-sensitive logic, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.
Self-learning system — log mistakes/wins, run retrospectives, promote patterns to hard rules, and coach on workflow quality. Usage: /self-learn [log|retro|status|init|tips]
session-indexer ship pipeline: issue → implement → review → merge → close. Usage: /ship [--yes|-y] [issue-number | title]
Systematic bug diagnosis — reproduce, isolate, hypothesize, verify, fix. Usage: /debug [what's broken]
| name | housekeeping |
| description | session-indexer repo health check. Universal hygiene + Go vet/fmt + project-specific checks. Usage: /housekeeping |
/housekeeping → run checks → Markdown table: Check | Status | Detail
→ Summary: N passed, M failed
Read-only. Never modifies files, never commits, never opens a PR. Run any time for a hygiene snapshot. Any FAIL = exit signal to fix before shipping.
Goal: ≤ 10 local branches after pruning remote-tracking refs.
git remote prune origin 2>&1 | tail -3
LOCAL_COUNT=$(git branch | grep -v '^\*' | wc -l | tr -d ' ')
Pass: LOCAL_COUNT <= 10
Fail: "N local branches — prune merged ones"
Cleanup tip:
git branch --merged main | grep -v 'main\|^\*'
# delete with: git branch -d <branch>
Goal: Zero debug/print statements in production source (excluding test files).
Auto-detect language and run the appropriate check:
# JavaScript/TypeScript
COUNT=$(grep -r --include="*.ts" --include="*.tsx" --include="*.js" \
--exclude="*.test.*" --exclude="*.spec.*" \
-l "console\.log(" src/ 2>/dev/null | wc -l | tr -d ' ')
# Go
COUNT=$(grep -r --include="*.go" \
--exclude="*_test.go" \
-l "fmt\.Println\|fmt\.Printf\|fmt\.Print(" . 2>/dev/null \
| grep -v "_test.go" | wc -l | tr -d ' ')
# Python
COUNT=$(grep -r --include="*.py" \
-l "^\s*print(" . 2>/dev/null \
| grep -v "test_\|_test.py" | wc -l | tr -d ' ')
Run whichever applies. If multiple apply, sum them.
Pass: COUNT == 0
Fail: list offending files (up to 5, then "+ N more")
Goal: .env must not be tracked by git (would leak secrets).
TRACKED=$(git ls-files .env 2>/dev/null)
Pass: empty result
Fail: ".env is tracked — add to .gitignore and run git rm --cached .env"
Goal: backup/ directory (if it exists) must not be tracked by git.
TRACKED=$(git ls-files backup/ 2>/dev/null)
Pass: empty result (or backup/ doesn't exist)
Fail: list the tracked backup files
Goal: Report count. No threshold — visibility only.
COUNT=$(grep -r --include="*.ts" --include="*.tsx" \
--include="*.go" --include="*.py" --include="*.js" \
-E "//\s*(TODO|FIXME)|#\s*(TODO|FIXME)" \
--exclude-dir=node_modules --exclude-dir=.git \
. 2>/dev/null | wc -l | tr -d ' ')
Status: Always INFO.
Detail: "N TODO/FIXME comments" — append " (consider a cleanup sprint)" if > 20.
This check never contributes to the failed count.
Goal: files in docs/ should not be working drafts or duplicates of
canonical artifacts in the sibling ../context/ directory (per the
personal-projects convention ~/wrk/projects/<name>/<name>/ repo +
~/wrk/projects/<name>/context/ notes).
# 6a — draft / iter / dated working files that escaped into docs/
STRAY=$(find docs -maxdepth 1 -type f \( \
-name '*-DRAFT.md' -o \
-name 'review-prompt-*.md' -o \
-name '*-iter[0-9]*.md' -o \
-name '20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]-*.md' \
\) 2>/dev/null)
# 6b — exact or date-prefixed duplicates of files in ../context/
DUPES=""
if [ -d ../context ]; then
for f in docs/*.md 2>/dev/null; do
[ -f "$f" ] || continue
base=$(basename "$f")
# Pattern A: exact same filename in ../context/
if [ -f "../context/$base" ]; then
DUPES="$DUPES $f (exact: ../context/$base)"
continue
fi
# Pattern B: context/ has date-prefixed twin
# (docs/X.md ↔ ../context/YYYY-MM-DD-X.md)
for ctx in ../context/20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]-"$base"; do
[ -f "$ctx" ] || continue
DUPES="$DUPES $f (date-prefixed twin: $ctx)"
break
done
done
fi
Pass: no strays, no duplicates.
Fail: list offenders (up to 5, then "+ N more"). Recommend manual review
— files may be intentional copies for repo distribution, or strays that
should be deleted / moved to ../context/.
Skip: ../context/ does not exist (this isn't a convention-based project).
Goal: files explicitly listed under a "Key Files" / "Ключові файли"
section of CLAUDE.md should actually exist on disk.
MISSING=""
if [ -f CLAUDE.md ]; then
# Pull section between heading and next heading; extract backtick-quoted paths
MISSING=$(awk '
/^##.*[Kk]ey [Ff]iles|^##.*[Кк]лючов.*файл/ {in_section=1; next}
/^##/ && in_section {in_section=0}
in_section
' CLAUDE.md | grep -oE '`[^`]+`' | tr -d '`' | while read f; do
# filter: only paths that look like real files (contain / or end in known ext)
case "$f" in
*/*|*.md|*.go|*.py|*.ts|*.tsx|*.js|*.yaml|*.yml|*.json|*.xlsx|*.toml)
[ -e "$f" ] || echo "$f"
;;
esac
done)
fi
Pass: all listed files exist (or no Key Files section).
Fail: list missing paths — likely doc drift after a rename/delete.
Skip: no CLAUDE.md at repo root.
Goal: report /tmp/<skill>-* directories older than 7 days from
interactive skill runs (fix-review, lookup-docs, apply-dreaming, etc).
COUNT=$(find /tmp -maxdepth 1 -type d -mtime +7 \
\( -name 'fix-review-*' -o -name 'lookup-docs-*' -o -name 'apply-dreaming-*' \) \
2>/dev/null | wc -l | tr -d ' ')
Status: Always INFO.
Detail: "N stale skill temp dirs in /tmp" — append " (rm -rf /tmp/-* to clean)" if > 5.
This check never contributes to the failed count.
Goal: go vet must pass with zero errors.
go vet ./... 2>&1
Pass: no output (exit 0)
Fail: list the vet errors
Skip: go.mod does not exist (project not yet implemented)
Goal: All .go files are properly formatted.
UNFORMATTED=$(gofmt -l . 2>/dev/null | grep -v vendor)
COUNT=$(echo "$UNFORMATTED" | grep -c . 2>/dev/null || echo 0)
Pass: 0 unformatted files
Fail: list unformatted files (up to 5, then "+ N more"); fix with gofmt -w .
Skip: no .go files found
Goal: Generated files (bin/, session-indexer binary, .claude/sessions.db)
must not be tracked by git.
TRACKED=$(git ls-files bin/ session-indexer .claude/sessions.db 2>/dev/null)
Pass: empty result
Fail: list the tracked files — add to .gitignore and git rm --cached <file>
## /housekeeping — Repo Health Report
| Check | Status | Detail |
|-------|--------|--------|
| Stale local branches | PASS | 6 local branches |
| Debug output in src | FAIL | 2 files: src/hooks/useData.ts, src/util/api.ts |
| Tracked .env | PASS | — |
| Tracked backup files | PASS | — |
| TODO/FIXME count | INFO | 11 TODO/FIXME comments |
| Project layout drift | PASS | — |
| CLAUDE.md key files | SKIP | no CLAUDE.md |
| Skill temp dirs | INFO | 3 stale skill temp dirs in /tmp |
**4 passed, 1 failed** (2 informational, 1 skipped)
Status values:
PASS — check succeededFAIL — check failed (must be addressed)INFO — informational only, never counted as failedSKIP — could not run (missing tools, no artifacts)Summary: N passed, M failed — with optional (K informational, J skipped).
Checks 6-7 assume the personal-projects layout convention
(~/wrk/projects/<name>/<name>/ repo + sibling context/ notes) — they
SKIP gracefully when the convention doesn't apply (no ../context/, no
CLAUDE.md). Checks 9-11 are session-indexer-specific and SKIP when go.mod
or .go files are absent (project in pre-implementation stage).