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/check.sh

View on GitHub
#!/bin/bash
# Is the libutils reference of this skill up to date? (installed version, libutils repository)
#
# Usage: check.sh [--fetch] [--repo <libutils path>]
#
#   --fetch        also compare with origin/main (network)
#   --repo <path>  libutils repository (default: $LIBUTILS or ~/personal_delivery/cpp/libutils)
#
# Last line: "status: up to date" (exit 0) | "status: outdated" (exit 1) | "status: unknown" (exit 2)

set -euo pipefail

SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
REPO="${LIBUTILS:-$HOME/personal_delivery/cpp/libutils}"
FETCH=false

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

# Reference of the skill
VERSION_FILE="$SKILL_DIR/reference/VERSION.md"
REF_VERSION="$(sed -n 's/^| Version (`CMakeLists.txt`) | `\([^`]*\)` |$/\1/p' "$VERSION_FILE" 2> /dev/null || true)"
REF_HASH="$(sed -n 's/^| Commit | `\([0-9a-f]*\)` |$/\1/p' "$VERSION_FILE" 2> /dev/null || true)"
if [[ -z "$REF_HASH" ]]; then
    echo "reference: none ($VERSION_FILE)"
    echo "status: unknown"
    exit 2
fi
echo "reference: $REF_VERSION (${REF_HASH:0:7})"
OUTDATED=false
KNOWN=false

# Installed headers
INSTALLED=""
CPATH_DIRS="${CPATH:-}"
for dir in ${CPATH_DIRS//:/ } /usr/local/include /usr/include "$HOME/.local/include"; do
    if [[ -f "$dir/utils/version.hpp" ]]; then
        INSTALLED="$(sed -n 's/.*#define __LIBUTILS_VERSION__ "\([^"]*\)".*/\1/p' "$dir/utils/version.hpp" | head -1)"
        break
    fi
done
if [[ -n "$INSTALLED" ]]; then
    KNOWN=true
    if [[ "$INSTALLED" != "$REF_VERSION" ]]; then
        OUTDATED=true
        echo "installed: $INSTALLED (differs from the reference)"
    else
        echo "installed: $INSTALLED"
    fi
else
    echo "installed: none"
fi

# Repository (local HEAD, origin/main with --fetch)
if [[ -d "$REPO/.git" ]]; then
    KNOWN=true
    $FETCH && { git -C "$REPO" fetch -q origin 2> /dev/null || echo "warning: fetch failed, local refs only"; }
    for ref in HEAD origin/main; do
        git -C "$REPO" rev-parse -q --verify "$ref" > /dev/null || continue
        AHEAD="$(git -C "$REPO" rev-list --count "$REF_HASH..$ref" -- include src CHANGELOG.md 2> /dev/null || echo "?")"
        echo "repository $ref: $AHEAD commit(s) after the reference"
        [[ "$AHEAD" != "0" ]] && OUTDATED=true
    done
fi

if ! $KNOWN; then
    echo "status: unknown"
    exit 2
fi
if $OUTDATED; then
    echo "status: outdated (update: bash $SKILL_DIR/scripts/update.sh, see the changes: --check)"
    exit 1
fi
echo "status: up to date"
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