template-engine-copier skill: initial import

Copier + Jinja template-repository design skill: reference architecture,
implementation workflow, validation checklist, and a full worked example
template (questionnaire, extensions, resolvers, wrapper-first .scripts).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-12 22:30:29 +03:00
co-authored by Claude Opus 5
commit 97991021ff
29 changed files with 932 additions and 0 deletions
@@ -0,0 +1,5 @@
#!/bin/bash
. ./.scripts/copier/lib/answers/-new-ensure-existance.sh
. ./.scripts/copier/lib/answers/-previous-pull-and-merge.sh
. ./.scripts/copier/lib/answers/-params-pull-and-merge.sh
@@ -0,0 +1,5 @@
#!/bin/bash
_copier_answers_new_ensure_existence() {
[ -f "${HL_V1_COPIER_FILE_COPIER_ANSWERS_NEW}" ] || touch "${HL_V1_COPIER_FILE_COPIER_ANSWERS_NEW}"
}
@@ -0,0 +1,17 @@
#!/bin/bash
_copier_answers_params_pull_and_merge() {
[ -f "${HL_V1_COPIER_PARAMS_FILE}" ] || return 0
[ -f "${HL_V1_COPIER_FILE_COPIER_ANSWERS_NEW}" ] || return 0
if command -v yq >/dev/null 2>&1; then
local TMP_WORK_FILE="tmp-work-file.yml"
yq eval-all '. as $item ireduce ({}; . * $item)' \
"${HL_V1_COPIER_FILE_COPIER_ANSWERS_NEW}" \
"${HL_V1_COPIER_PARAMS_FILE}" >"${TMP_WORK_FILE}"
mv "${TMP_WORK_FILE}" "${HL_V1_COPIER_FILE_COPIER_ANSWERS_NEW}"
else
# Fallback: params file wins as full override when yq is unavailable.
cp "${HL_V1_COPIER_PARAMS_FILE}" "${HL_V1_COPIER_FILE_COPIER_ANSWERS_NEW}"
fi
}
@@ -0,0 +1,6 @@
#!/bin/bash
_copier_answers_previous_pull_and_merge() {
local PREVIOUS="${HL_V1_COPIER_TARGET_DIR}/${HL_V1_COPIER_FILE_COPIER_ANSWERS}"
[ -f "${PREVIOUS}" ] && cp "${PREVIOUS}" "${HL_V1_COPIER_FILE_COPIER_ANSWERS_NEW}" || true
}