KKKKhazix/khazix-skills / neat-freak
neat-freak
Unverified干完活的知识收尾:把项目文档、CLAUDE.md/AGENTS.md 等规则文件、Agent 记忆和会话留下的临时文件,对齐到代码和线上的真实现状,让下一个会话或接手的人读到的是唯一、正确的现役答案。触发:用户点名 "neat-freak"、"洁癖"、"/neat",或明确的知识收尾意图——开发后同步文档与记忆、CLAUDE.md/记忆过期或冲突、交接前清场、审计规则是否被遵守("把文档和记忆整理一下"、"docs 和代码对不上了")。不触发:纯写代码/重构/调试、整理数据或文稿(JSON、周报、changelog)、没有项目知识语境的裸"整理"。
scripts/audit-inventory.sh
View on GitHub#!/usr/bin/env bash
# Read-only inventory for neat-freak. Prints metadata and paths only; never reads file contents.
set -euo pipefail
usage() {
echo "usage: $0 <project-root>" >&2
exit 64
}
[[ $# -eq 1 ]] || usage
[[ -d "$1" ]] || { echo "[ERR] project root is not a directory: $1" >&2; exit 66; }
PROJECT_ROOT="$(cd "$1" && pwd -P)"
SEEN_RULE_FILES=$'\n'
section() {
printf '\n## %s\n' "$1"
}
file_size() {
local file="$1"
local lines bytes
lines="$(wc -l < "$file" | tr -d ' ')"
bytes="$(wc -c < "$file" | tr -d ' ')"
printf '%s\tlines=%s\tbytes=%s\n' "$file" "$lines" "$bytes"
}
describe_rule_file() {
local file="$1"
case "$SEEN_RULE_FILES" in
*$'\n'"$file"$'\n'*) return ;;
esac
SEEN_RULE_FILES+="$file"$'\n'
if [[ -L "$file" ]]; then
local target state
target="$(readlink "$file")"
if [[ -e "$file" ]]; then state="valid"; else state="broken"; fi
printf '%s\tsymlink=%s\tstate=%s\n' "$file" "$target" "$state"
elif [[ -f "$file" ]]; then
file_size "$file"
fi
}
printf '# neat-freak inventory v2\n'
printf 'project_root=%s\n' "$PROJECT_ROOT"
printf 'generated_at=%s\n' "$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
section "platform-directories"
# Common agent home dirs; nonexistent ones are skipped silently.
for dir in "$HOME/.agents" "$HOME/.claude" "$HOME/.codex" "$HOME/.cursor" "$HOME/.gemini" \
"$HOME/.qoder" "$HOME/.trae" "$HOME/.iflow" "$HOME/.codebuddy"; do
[[ -d "$dir" ]] && printf '%s\n' "$dir"
done
section "other-agent-rule-artifacts"
# Platform-specific rule forms at the project root (existence only).
for rel in .claude/rules .claude/skills .agents/skills .github/copilot-instructions.md .github/instructions .cursorrules .windsurfrules .cursor/rules .qoder .trae .iflow; do
[[ -e "$PROJECT_ROOT/$rel" ]] && printf '%s\n' "$PROJECT_ROOT/$rel"
done
true
section "git"
if git -C "$PROJECT_ROOT" rev-parse --show-toplevel >/dev/null 2>&1; then
GIT_ROOT="$(git -C "$PROJECT_ROOT" rev-parse --show-toplevel)"
printf 'git_root=%s\n' "$GIT_ROOT"
printf 'branch=%s\n' "$(git -C "$PROJECT_ROOT" branch --show-current 2>/dev/null || true)"
printf 'head=%s\n' "$(git -C "$PROJECT_ROOT" rev-parse HEAD)"
printf 'status_entries=%s\n' "$(git -C "$PROJECT_ROOT" status --porcelain=v1 | wc -l | tr -d ' ')"
printf 'worktrees=%s\n' "$(git -C "$PROJECT_ROOT" worktree list --porcelain | awk '$1 == "worktree" {n++} END {print n+0}')"
else
printf 'git_root=none\n'
fi
section "rule-chain-candidates"
cursor="$PROJECT_ROOT"
while :; do
for rel in AGENTS.override.md AGENTS.md CLAUDE.md CLAUDE.local.md .claude/CLAUDE.md GEMINI.md; do
describe_rule_file "$cursor/$rel"
done
[[ "$cursor" == "/" ]] && break
parent="$(dirname "$cursor")"
[[ "$parent" == "$cursor" ]] && break
cursor="$parent"
done
for file in \
"$HOME/.codex/AGENTS.override.md" \
"$HOME/.codex/AGENTS.md" \
"$HOME/.claude/CLAUDE.md" \
"$HOME/.gemini/GEMINI.md"; do
describe_rule_file "$file"
done
section "project-markdown"
find "$PROJECT_ROOT" \
\( -name .git -o -name node_modules -o -name .next -o -name dist -o -name build -o -name .venv -o -name venv -o -name __pycache__ -o -name target -o -name vendor -o -name .turbo -o -name .cache \) -prune \
-o -type f \( -name '*.md' -o -name '*.mdx' \) -print \
| LC_ALL=C sort
section "project-markdown-count"
find "$PROJECT_ROOT" \
\( -name .git -o -name node_modules -o -name .next -o -name dist -o -name build -o -name .venv -o -name venv -o -name __pycache__ -o -name target -o -name vendor -o -name .turbo -o -name .cache \) -prune \
-o -type f \( -name '*.md' -o -name '*.mdx' \) -print \
| awk 'END {print NR+0}'
section "root-entries"
find "$PROJECT_ROOT" -mindepth 1 -maxdepth 1 -print | LC_ALL=C sort
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |