Add branching-strategy skill with next and create actions
Version-aware branch naming (X.Y.Z.Q/{TASK_CODE}-{FEATURE}-{SEQ}),
branch creation from origin/test with origin/main fallback, and the
PR-into-test merge rule. Ships a TypeScript CLI (next, create) plus
shell modules (loggers, base, cli) run via Taskfile.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# https://taskfile.dev
|
||||
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
build:
|
||||
desc: Compile TypeScript source to dist/
|
||||
cmds:
|
||||
- |
|
||||
./.scripts/cli/api/build.sh {{ .CLI_ARGS }}
|
||||
silent: true
|
||||
|
||||
next:
|
||||
desc: |
|
||||
Compute the next branch name (X.Y.Z.Q/{TASK_MANAGEMENT_CODE}-{FEATURE_X}-{SEQ}).
|
||||
Usage: task cli:next -- --task-key="IIAA-123" --topic="api-cleanup" [--base=…] [--repo-dir=…]
|
||||
cmds:
|
||||
- |
|
||||
./.scripts/cli/api/next.sh {{ .CLI_ARGS }}
|
||||
silent: true
|
||||
|
||||
create:
|
||||
desc: |
|
||||
Compute and create the next branch locally (never pushes).
|
||||
Usage: task cli:create -- --task-key="IIAA-123" --topic="api-cleanup" [--base=…] [--repo-dir=…]
|
||||
cmds:
|
||||
- |
|
||||
./.scripts/cli/api/create.sh {{ .CLI_ARGS }}
|
||||
silent: true
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
set -e
|
||||
|
||||
. ./.scripts/cli/lib/--index.sh
|
||||
|
||||
_cli__build "$@"
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
set -e
|
||||
|
||||
. ./.scripts/cli/lib/--index.sh
|
||||
|
||||
_cli__create "$@"
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
set -e
|
||||
|
||||
. ./.scripts/cli/lib/--index.sh
|
||||
|
||||
_cli__next "$@"
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
ALL_ARGS=("$@")
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
*) ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
set -- "${ALL_ARGS[@]}"
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/cli/lib/--index-api.sh
|
||||
|
||||
# No required environment variables for cli module
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
. ./.scripts/cli/lib/-build.sh
|
||||
|
||||
. ./.scripts/cli/lib/-next.sh
|
||||
|
||||
. ./.scripts/cli/lib/-create.sh
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
. ./.scripts/loggers/lib/--index.sh
|
||||
. ./.scripts/base/lib/--index.sh
|
||||
#
|
||||
# --> passed parameters are read & exported environment variables
|
||||
#
|
||||
. ./.scripts/cli/lib/--env-vars-reader.sh
|
||||
#
|
||||
# --> required environment variables are validated for existence
|
||||
#
|
||||
. ./.scripts/cli/lib/--env-vars-validator.sh
|
||||
#
|
||||
# --> available functions are imported/exported
|
||||
#
|
||||
. ./.scripts/cli/lib/--index-api.sh
|
||||
# -------------------------------------------------------------------------------------
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
_cli__build() {
|
||||
local FUNCTION_NAME="_cli__build"
|
||||
_loggers_info "${FUNCTION_NAME}" "Compiling TypeScript source to dist/"
|
||||
pnpm run build
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
_cli__create() {
|
||||
local FUNCTION_NAME="_cli__create"
|
||||
_loggers_info "${FUNCTION_NAME}" "Creating branch via TypeScript CLI"
|
||||
npx tsx src/cli/commands.ts --action create "$@"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
_cli__next() {
|
||||
local FUNCTION_NAME="_cli__next"
|
||||
_loggers_info "${FUNCTION_NAME}" "Computing next branch name via TypeScript CLI"
|
||||
npx tsx src/cli/commands.ts --action next "$@"
|
||||
}
|
||||
Reference in New Issue
Block a user