TsukiNi22/ai-utils / skills/libutils/libutils-exception
libutils-exception
Verifiedlibutils exception handling (utils::exception) - IException/AException, Error/Warning/None/Fatal/CustomException, InternalCode vs ExternalCode, Type, restrictions, formated() output, throw/catch/print patterns - and how to add new exception codes to a project (cmake/config/exceptions/*.json, generate_exception_header.py + const.py, CMake custom command, include/exception/generated_external_exception_header.hpp). Use whenever throwing, catching or printing a libutils exception, choosing an exception code, or adding/editing exception codes, the exception JSON config, the generator script or the generated_*_exception_header of a project.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.1 KB |
| requires.txt | markdown | 9 B |
| templates/cmake/config/exceptions/global.json | config | 581 B |
| templates/cmake/scripts/const.pyexecutable | script | 3.6 KB |
| templates/cmake/scripts/generate_exception_header.pyexecutable | script | 9.1 KB |
| templates/cmake/scripts/requirements.txt | manifest | 0 B |
| templates/exception.cmake | other | 1.1 KB |
templates/exception.cmake
View on GitHub# --- Requirement section ---
find_package(Python3 REQUIRED) # Used for the special dependencie
# --- Special Targets section ---
file(GLOB_RECURSE EXCEPTION_CONFIG_FILES
CONFIGURE_DEPENDS
"${CMAKE_SOURCE_DIR}/cmake/config/exceptions/*.json"
)
set(GENERATED_EXCEPTION_HEADER
"${CMAKE_SOURCE_DIR}/include/exception/generated_external_exception_header.hpp"
)
add_custom_command(
OUTPUT ${GENERATED_EXCEPTION_HEADER}
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/cmake/scripts/generate_exception_header.py
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${EXCEPTION_CONFIG_FILES} ${CMAKE_SOURCE_DIR}/cmake/scripts/generate_exception_header.py
COMMENT "Generating exception header (config changed)"
VERBATIM
)
add_custom_target(generated_external_exception_header
DEPENDS ${GENERATED_EXCEPTION_HEADER}
)
# --- Dependencies section (for every target using libutils: main target, plugins, unit_tests) ---
target_include_directories(${TARGET} PRIVATE include include/exception)
target_link_libraries(${TARGET} PRIVATE utils::utils)
add_dependencies(${TARGET} generated_external_exception_header)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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 implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |