Skip to content

TsukiNi22/ai-utils / skills/libutils/libutils

libutils

Verified

Reference of Tsukini's C++20 library libutils (namespace utils::, github TsukiNi22/libutils) - every section, header, class and public method with the version and commit hash it was generated from, how to link/include it, exceptions/error codes, verbose, and how to find what changed since. Use whenever code uses or could use libutils (utils::..., include "utils/...", find_package(utils)), when the user asks which libutils class/function does something, how to use one, or what is new in libutils, instead of searching the library sources.

FileKindSize
SKILL.mdskill md14.6 KB
reference/VERSION.mdmarkdown612 B
reference/api/algorithms.mdmarkdown10.0 KB
reference/api/arguments.mdmarkdown8.4 KB
reference/api/attribute.mdmarkdown9.0 KB
reference/api/cli.mdmarkdown5.0 KB
reference/api/concepts.mdmarkdown3.0 KB
reference/api/encapsulation.mdmarkdown9.8 KB
reference/api/exception.mdmarkdown6.7 KB
reference/api/manip.mdmarkdown10.9 KB
reference/api/math.mdmarkdown2.3 KB
reference/api/network.mdmarkdown8.4 KB
reference/api/platform.mdmarkdown6.0 KB
reference/api/pool.mdmarkdown5.1 KB
reference/api/root.mdmarkdown2.2 KB
reference/api/security.mdmarkdown8.8 KB
reference/api/system.mdmarkdown10.7 KB
reference/api/type.mdmarkdown38.5 KB
reference/api/verbose.mdmarkdown3.6 KB
reference/exception-codes.mdmarkdown7.6 KB
reference/index.mdmarkdown20.0 KB
scripts/check.shexecutablescript2.7 KB
scripts/gen_api.pyexecutablescript20.8 KB
scripts/update.shexecutablescript2.3 KB

scripts/update.sh

View on GitHub
#!/bin/bash
# Show what changed in libutils since the commit of the reference, then regenerate it.
#
# Usage: update.sh [--ref <git ref>] [--repo <libutils path>] [--check]
#
#   --ref <ref>    commit to generate the reference from (default: HEAD of the repo)
#   --repo <path>  libutils repository (default: ~/personal_delivery/cpp/libutils,
#                  cloned into ~/.cache/libutils if missing)
#   --check        only show the changes, don't regenerate

set -euo pipefail

SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
REPO="$HOME/personal_delivery/cpp/libutils"
REMOTE="https://github.com/TsukiNi22/libutils.git"
REF="HEAD"
CHECK=false

while [[ $# -gt 0 ]]; do
    case "$1" in
        --ref) REF="$2"; shift ;;
        --repo) REPO="$2"; shift ;;
        --check) CHECK=true ;;
        -h|--help) sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
        *) echo "Error: unknown argument '$1'" >&2; exit 1 ;;
    esac
    shift
done

# Repository (fallback on a cached clone)
if [[ ! -d "$REPO/.git" ]]; then
    REPO="$HOME/.cache/libutils"
    if [[ -d "$REPO/.git" ]]; then
        git -C "$REPO" fetch -q origin && git -C "$REPO" reset -q --hard origin/main
    else
        git clone -q "$REMOTE" "$REPO"
    fi
fi
git -C "$REPO" fetch -q origin 2>/dev/null || echo "warning: fetch failed, using the local refs" >&2

OLD="$(sed -n 's/^| Commit | `\([0-9a-f]*\)` |$/\1/p' "$SKILL_DIR/reference/VERSION.md" 2>/dev/null || true)"
NEW="$(git -C "$REPO" rev-parse "$REF")"

echo "Repository: $REPO"
echo "Reference : ${OLD:0:7} -> ${NEW:0:7} ($REF)"
if [[ -n "$(git -C "$REPO" status --porcelain -- include src 2>/dev/null)" ]]; then
    echo "warning: uncommitted changes in include/ or src/ are NOT part of the reference (commit them first)"
fi
if [[ -z "$OLD" ]]; then
    echo "No previous reference."
elif [[ "$OLD" = "$NEW" ]]; then
    echo "Already up to date."
else
    echo
    echo "=== Commits"
    git -C "$REPO" log --oneline "$OLD..$NEW" -- include src cmake/config CHANGELOG.md || true
    echo
    echo "=== Headers changed"
    git -C "$REPO" diff --stat "$OLD" "$NEW" -- include || true
    echo
    echo "=== CHANGELOG (added lines)"
    git -C "$REPO" diff "$OLD" "$NEW" -- CHANGELOG.md | grep -E '^\+[^+]' | sed 's/^+//' || true
fi

$CHECK && exit 0
echo
python3 "$SKILL_DIR/scripts/gen_api.py" --repo "$REPO" --ref "$NEW"
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 319kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 319kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 319kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 319kUpdated Claude CodeCodexVerifiedInstall