Add development-scripts agent skill
Ports generic-scripts-module-v1 into a routed skill: module anatomy, shared loggers/base modules, Taskfile integration, workflows, and pattern decisions. Fixes a latent defect in the loggers example that silenced all logging in the module scaffold: loggers/lib/--index-api.sh now sources --env-vars-reader.sh, and the reader preserves already-exported values so caller overrides still win. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
# --> defaults preserve already-exported values so a caller can override
|
||||
# any level before sourcing the loggers module
|
||||
#
|
||||
export LOGGER_TRAILING_NEW_LINE_ENABLED="${LOGGER_TRAILING_NEW_LINE_ENABLED:-TRUE}"
|
||||
|
||||
export LOGGER_IS_ENABLED_ERROR="${LOGGER_IS_ENABLED_ERROR:-true}"
|
||||
export LOGGER_IS_ENABLED_INFO="${LOGGER_IS_ENABLED_INFO:-true}"
|
||||
export LOGGER_IS_ENABLED_WARN="${LOGGER_IS_ENABLED_WARN:-true}"
|
||||
export LOGGER_IS_ENABLED_DEBUG="${LOGGER_IS_ENABLED_DEBUG:-true}"
|
||||
export LOGGER_IS_ENABLED_TRACE="${LOGGER_IS_ENABLED_TRACE:-false}"
|
||||
|
||||
export LOCAL_STRING_005_SPACES=" "
|
||||
export LOCAL_STRING_010_SPACES="${LOCAL_STRING_005_SPACES}${LOCAL_STRING_005_SPACES}"
|
||||
export LOCAL_STRING_050_SPACES="${LOCAL_STRING_010_SPACES}${LOCAL_STRING_010_SPACES}${LOCAL_STRING_010_SPACES}${LOCAL_STRING_010_SPACES}${LOCAL_STRING_010_SPACES}"
|
||||
export LOCAL_STRING_070_SPACES="${LOCAL_STRING_050_SPACES}${LOCAL_STRING_010_SPACES}${LOCAL_STRING_010_SPACES}"
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# --> logger level flags and padding strings must exist before any logger
|
||||
# function runs; the reader preserves already-exported values, so this
|
||||
# is safe to source repeatedly and from any dependent module
|
||||
#
|
||||
. ./.scripts/loggers/lib/--env-vars-reader.sh
|
||||
|
||||
. ./.scripts/loggers/lib/-enable-trailing-new-line.sh
|
||||
|
||||
. ./.scripts/loggers/lib/-info.sh
|
||||
. ./.scripts/loggers/lib/-trace.sh
|
||||
. ./.scripts/loggers/lib/-debug.sh
|
||||
. ./.scripts/loggers/lib/-error.sh
|
||||
. ./.scripts/loggers/lib/-warn.sh
|
||||
|
||||
. ./.scripts/loggers/lib/-empty-line.sh
|
||||
. ./.scripts/loggers/lib/-waiting-dot.sh
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
# --> available functions are imported/exported
|
||||
#
|
||||
. ./.scripts/loggers/lib/--index-api.sh
|
||||
# -------------------------------------------------------------------------------------
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/loggers/lib/-enable-trailing-new-line.sh
|
||||
|
||||
_loggers_debug() {
|
||||
_loggers_enableLoggerTrailingNewLine
|
||||
if
|
||||
[ "${LOGGER_IS_ENABLED_DEBUG}" = true ]
|
||||
then
|
||||
local TMP_1ST_PARAM="${1}${LOCAL_STRING_070_SPACES}"
|
||||
TMP_1ST_PARAM="${TMP_1ST_PARAM:0:70}"
|
||||
local TMP_LINE="# DEBUG # ${TMP_1ST_PARAM} # ${2}"
|
||||
echo -e "\033[1;36m${TMP_LINE}\033[0m" >&2
|
||||
fi
|
||||
}
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/loggers/lib/-enable-trailing-new-line.sh
|
||||
|
||||
_loggers_emptyLine() {
|
||||
_loggers_enableLoggerTrailingNewLine
|
||||
echo -e "" >&2
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
_loggers_enableLoggerTrailingNewLine() {
|
||||
if
|
||||
[ -z "$LOGGER_TRAILING_NEW_LINE_DISABLED" ]
|
||||
then
|
||||
echo "" >&2
|
||||
export LOGGER_TRAILING_NEW_LINE_DISABLED="TRUE"
|
||||
fi
|
||||
}
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/loggers/lib/-enable-trailing-new-line.sh
|
||||
|
||||
_loggers_error() {
|
||||
_loggers_enableLoggerTrailingNewLine
|
||||
if
|
||||
[ "${LOGGER_IS_ENABLED_ERROR}" = true ]
|
||||
then
|
||||
local TMP_1ST_PARAM="${1}${LOCAL_STRING_070_SPACES}"
|
||||
TMP_1ST_PARAM="${TMP_1ST_PARAM:0:70}"
|
||||
local TMP_LINE="# ERROR # ${TMP_1ST_PARAM} # $2"
|
||||
echo -e "\033[1;31m${TMP_LINE}\033[0m" >&2
|
||||
fi
|
||||
|
||||
}
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/loggers/lib/-enable-trailing-new-line.sh
|
||||
|
||||
_loggers_info() {
|
||||
_loggers_enableLoggerTrailingNewLine
|
||||
if
|
||||
[ "${LOGGER_IS_ENABLED_INFO}" = true ]
|
||||
then
|
||||
local TMP_1ST_PARAM="${1}${LOCAL_STRING_070_SPACES}"
|
||||
TMP_1ST_PARAM="${TMP_1ST_PARAM:0:70}"
|
||||
local TMP_LINE="# INFO # ${TMP_1ST_PARAM} # ${2}"
|
||||
echo -e "${TMP_LINE}" >&2
|
||||
fi
|
||||
}
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/loggers/lib/-enable-trailing-new-line.sh
|
||||
|
||||
_loggers_trace() {
|
||||
_loggers_enableLoggerTrailingNewLine
|
||||
if
|
||||
[ "${LOGGER_IS_ENABLED_TRACE}" = true ]
|
||||
then
|
||||
local TMP_1ST_PARAM="${1}${LOCAL_STRING_070_SPACES}"
|
||||
TMP_1ST_PARAM="${TMP_1ST_PARAM:0:70}"
|
||||
local TMP_LINE="# TRACE # ${TMP_1ST_PARAM} # $2"
|
||||
echo -e "\033[0;94m${TMP_LINE}\033[0m" >&2
|
||||
fi
|
||||
|
||||
}
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/loggers/lib/-enable-trailing-new-line.sh
|
||||
|
||||
_loggers_waitingDot() {
|
||||
echo -n "." >&2
|
||||
export LOGGER_TRAILING_NEW_LINE_DISABLED=""
|
||||
}
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
# IBM Confidential
|
||||
# 6949-70F, 6949-80D
|
||||
# © Copyright IBM Corp. 2018, 2024
|
||||
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/loggers/lib/-enable-trailing-new-line.sh
|
||||
|
||||
_loggers_warn() {
|
||||
_loggers_enableLoggerTrailingNewLine
|
||||
if
|
||||
[ "${LOGGER_IS_ENABLED_WARN}" = true ]
|
||||
then
|
||||
local TMP_1ST_PARAM="${1}${LOCAL_STRING_070_SPACES}"
|
||||
TMP_1ST_PARAM="${TMP_1ST_PARAM:0:70}"
|
||||
local TMP_LINE="# WARN # ${TMP_1ST_PARAM} # $2"
|
||||
echo -e "\033[1;33m${TMP_LINE}\033[0m" >&2
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user