aw-spec-cli 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/.agents/agent.json +28 -0
- package/assets/.agents/skills/appweaver/SKILL.md +56 -0
- package/assets/.agents/skills/appweaver-demo/SKILL.md +59 -0
- package/assets/.claude/agent.json +27 -0
- package/assets/.claude/skills/appweaver/SKILL.md +55 -0
- package/assets/.claude/skills/appweaver-demo/SKILL.md +59 -0
- package/assets/.kilocode/agent.json +28 -0
- package/assets/.kilocode/workflows/appweaver-demo.md +59 -0
- package/assets/.kilocode/workflows/appweaver.md +55 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -54
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.agents/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.agents/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.agents/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.agents/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.agents/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.agents/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.agents/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.agents/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.agents/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.aw-spec/domain.json +0 -3
- package/assets/.aw-spec/extensions/.registry +0 -19
- package/assets/.aw-spec/extensions/agent-context/README.md +0 -57
- package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +0 -4
- package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +0 -26
- package/assets/.aw-spec/extensions/agent-context/extension.yml +0 -34
- package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +0 -201
- package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +0 -237
- package/assets/.aw-spec/extensions.yml +0 -23
- package/assets/.aw-spec/feature.json +0 -3
- package/assets/.aw-spec/init-options.json +0 -9
- package/assets/.aw-spec/integration.json +0 -15
- package/assets/.aw-spec/integrations/aw-spec.manifest.json +0 -17
- package/assets/.aw-spec/integrations/claude.manifest.json +0 -17
- package/assets/.aw-spec/memory/constitution.md +0 -50
- package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +0 -189
- package/assets/.aw-spec/scripts/bash/common.sh +0 -582
- package/assets/.aw-spec/scripts/bash/create-new-feature.sh +0 -299
- package/assets/.aw-spec/scripts/bash/setup-plan.sh +0 -84
- package/assets/.aw-spec/scripts/bash/setup-tasks.sh +0 -91
- package/assets/.aw-spec/templates/checklist-template.md +0 -40
- package/assets/.aw-spec/templates/constitution-template.md +0 -57
- package/assets/.aw-spec/templates/plan-template.md +0 -113
- package/assets/.aw-spec/templates/spec-template.md +0 -131
- package/assets/.aw-spec/templates/tasks-template.md +0 -252
- package/assets/.aw-spec/workflows/aw-spec/workflow.yml +0 -77
- package/assets/.aw-spec/workflows/workflow-registry.json +0 -13
- package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.claude/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.claude/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.claude/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.claude/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.claude/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.claude/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.claude/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.claude/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.claude/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.kilocode/rules/specify-rules.md +0 -4
- package/assets/.kilocode/workflows/aw-spec-addcomponent.md +0 -129
- package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +0 -31
- package/assets/.kilocode/workflows/aw-spec-analyze.md +0 -296
- package/assets/.kilocode/workflows/aw-spec-checklist.md +0 -374
- package/assets/.kilocode/workflows/aw-spec-clarify.md +0 -320
- package/assets/.kilocode/workflows/aw-spec-constitution.md +0 -194
- package/assets/.kilocode/workflows/aw-spec-fast-implement.md +0 -263
- package/assets/.kilocode/workflows/aw-spec-foundation.md +0 -358
- package/assets/.kilocode/workflows/aw-spec-implement.md +0 -279
- package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +0 -204
- package/assets/.kilocode/workflows/aw-spec-plan.md +0 -221
- package/assets/.kilocode/workflows/aw-spec-select-domain.md +0 -73
- package/assets/.kilocode/workflows/aw-spec-specify.md +0 -382
- package/assets/.kilocode/workflows/aw-spec-tasks.md +0 -259
- package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +0 -107
- package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +0 -25248
- package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +0 -5726
- package/assets/docs/ModularMonolith/pack-foundation.ps1 +0 -145
- package/assets/docs/ModularMonolith/pack-foundation.sh +0 -196
- package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/ModularMonolith/pack-reference-foundation.sh +0 -209
- package/assets/docs/ModularMonolith/unpack-foundation.ps1 +0 -126
- package/assets/docs/ModularMonolith/unpack-foundation.sh +0 -217
- package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +0 -218
- package/assets/docs/README.md +0 -106
- package/assets/docs/UI.Visualization/PACKAGING.md +0 -191
- package/assets/docs/UI.Visualization/UI.Visualization.Reference.pack.txt +0 -11768
- package/assets/docs/UI.Visualization/UI.Visualization.pack.txt +0 -11214
- package/assets/docs/UI.Visualization/pack-foundation.ps1 +0 -165
- package/assets/docs/UI.Visualization/pack-foundation.sh +0 -206
- package/assets/docs/UI.Visualization/pack-reference-foundation.ps1 +0 -159
- package/assets/docs/UI.Visualization/pack-reference-foundation.sh +0 -205
- package/assets/docs/UI.Visualization/unpack-foundation.ps1 +0 -126
- package/assets/docs/UI.Visualization/unpack-foundation.sh +0 -217
- package/assets/docs/UI.Visualization/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/UI.Visualization/unpack-reference-foundation.sh +0 -218
- package/assets/docs/VerticalSlice/PACKAGING.md +0 -185
- package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +0 -19318
- package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +0 -2833
- package/assets/docs/VerticalSlice/pack-foundation.ps1 +0 -145
- package/assets/docs/VerticalSlice/pack-foundation.sh +0 -196
- package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/VerticalSlice/pack-reference-foundation.sh +0 -209
- package/assets/docs/VerticalSlice/unpack-foundation.ps1 +0 -126
- package/assets/docs/VerticalSlice/unpack-foundation.sh +0 -217
- package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +0 -218
- package/assets/docs/architecture/clean-architecture.md +0 -71
- package/assets/docs/architecture/cqrs.md +0 -141
- package/assets/docs/architecture/eventing.md +0 -83
- package/assets/docs/architecture/folder-structure.md +0 -61
- package/assets/docs/architecture/modular-monolith.md +0 -47
- package/assets/docs/architecture/persistence.md +0 -269
- package/assets/docs/architecture/testing.md +0 -55
- package/assets/docs/architecture/vertical-slices.md +0 -201
- package/assets/docs/command.txt +0 -295
- package/assets/docs/components/Email/README.md +0 -119
- package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +0 -84
- package/assets/docs/components/Email/integration.md +0 -300
- package/assets/docs/components/Jobs/README.md +0 -113
- package/assets/docs/components/Jobs/integration.md +0 -259
- package/assets/docs/components/QrGenerator/README.md +0 -85
- package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +0 -57
- package/assets/docs/components/QrGenerator/integration.md +0 -230
- package/assets/docs/components/README.md +0 -74
- package/assets/docs/domain/domain-driven-design.md +0 -212
- package/assets/docs/domainspecs/UIVisualization/chart-bubble.md +0 -70
- package/assets/docs/domainspecs/UIVisualization/chart-dimred.md +0 -58
- package/assets/docs/domainspecs/UIVisualization/chart-heatmap.md +0 -62
- package/assets/docs/domainspecs/UIVisualization/chart-network.md +0 -69
- package/assets/docs/domainspecs/UIVisualization/chart-parallel.md +0 -75
- package/assets/docs/domainspecs/UIVisualization/chart-scurve.md +0 -66
- package/assets/docs/domainspecs/UIVisualization/chart-survival.md +0 -69
- package/assets/docs/domainspecs/UIVisualization/chart-trellis.md +0 -68
- package/assets/docs/domainspecs/UIVisualization/chart-violin.md +0 -61
- package/assets/docs/domainspecs/UIVisualization/chart-volcano.md +0 -63
- package/assets/docs/domainspecs/UIVisualization/charting-standards.domain.md +0 -80
- package/assets/docs/domainspecs/UIVisualization/clean-architecture.domain.md +0 -87
- package/assets/docs/domainspecs/UIVisualization/coding-standards.domain.md +0 -47
- package/assets/docs/domainspecs/UIVisualization/comandrulemap.md +0 -130
- package/assets/docs/domainspecs/UIVisualization/component-contracts.domain.md +0 -67
- package/assets/docs/domainspecs/UIVisualization/data-source.domain.md +0 -68
- package/assets/docs/domainspecs/UIVisualization/domain-requirements.md +0 -110
- package/assets/docs/domainspecs/UIVisualization/folder-structure.domain.md +0 -55
- package/assets/docs/domainspecs/UIVisualization/state-management.domain.md +0 -67
- package/assets/docs/domainspecs/UIVisualization/testing.domain.md +0 -52
- package/assets/docs/domainspecs/UIVisualization/ui-viz-terms.md +0 -39
- package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +0 -34
- package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +0 -17
- package/assets/docs/domainspecs/healthcare/auditing.domain.md +0 -29
- package/assets/docs/domainspecs/healthcare/authorization.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/clinical-terms.md +0 -20
- package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/comandrulemap.md +0 -166
- package/assets/docs/domainspecs/healthcare/consent.md +0 -19
- package/assets/docs/domainspecs/healthcare/cqrs.domain.md +0 -12
- package/assets/docs/domainspecs/healthcare/data-classification.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/healthcare/dicom.md +0 -15
- package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/domain-requirements.md +0 -55
- package/assets/docs/domainspecs/healthcare/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/fhir.md +0 -36
- package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +0 -23
- package/assets/docs/domainspecs/healthcare/hipaa.md +0 -34
- package/assets/docs/domainspecs/healthcare/hl7.md +0 -15
- package/assets/docs/domainspecs/healthcare/integration-terms.md +0 -21
- package/assets/docs/domainspecs/healthcare/persistence.domain.md +0 -20
- package/assets/docs/domainspecs/healthcare/terminology.md +0 -30
- package/assets/docs/domainspecs/healthcare/testing.domain.md +0 -15
- package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +0 -12
- package/assets/docs/domainspecs/pharma/ai-rules.domain.md +0 -32
- package/assets/docs/domainspecs/pharma/api-versioning.domain.md +0 -20
- package/assets/docs/domainspecs/pharma/atc.md +0 -22
- package/assets/docs/domainspecs/pharma/auditing.domain.md +0 -26
- package/assets/docs/domainspecs/pharma/authorization.domain.md +0 -25
- package/assets/docs/domainspecs/pharma/coding-standards.domain.md +0 -28
- package/assets/docs/domainspecs/pharma/comandrulemap.md +0 -186
- package/assets/docs/domainspecs/pharma/cqrs.domain.md +0 -16
- package/assets/docs/domainspecs/pharma/data-classification.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/data-provenance.md +0 -21
- package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +0 -36
- package/assets/docs/domainspecs/pharma/domain-requirements.md +0 -99
- package/assets/docs/domainspecs/pharma/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/pharma/fhir.md +0 -31
- package/assets/docs/domainspecs/pharma/folder-structure.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/hl7.md +0 -17
- package/assets/docs/domainspecs/pharma/idmp.md +0 -26
- package/assets/docs/domainspecs/pharma/integration-terms.md +0 -21
- package/assets/docs/domainspecs/pharma/ndc.md +0 -28
- package/assets/docs/domainspecs/pharma/persistence.domain.md +0 -23
- package/assets/docs/domainspecs/pharma/pharma-terms.md +0 -27
- package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +0 -30
- package/assets/docs/domainspecs/pharma/regulatory-compliance.md +0 -19
- package/assets/docs/domainspecs/pharma/terminology.md +0 -32
- package/assets/docs/domainspecs/pharma/testing.domain.md +0 -19
- package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +0 -17
- package/assets/docs/domainspecs/pharma/zero-trust.domain.md +0 -12
- package/assets/docs/glossary/ai-rules.md +0 -59
- package/assets/docs/governance/api-versioning.md +0 -99
- package/assets/docs/governance/coding-standards.md +0 -87
- package/assets/docs/governance/dependency-policy.md +0 -40
- package/assets/docs/interop/ihe-conformance.md +0 -31
- package/assets/docs/security/auditing.md +0 -117
- package/assets/docs/security/authorization-matrix.md +0 -14
- package/assets/docs/security/authorization.md +0 -87
- package/assets/docs/security/data-classification.md +0 -38
- package/assets/docs/security/zero-trust.md +0 -76
- package/assets/docs/technology-constitution.md +0 -172
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# unpack-reference-foundation.sh — bash/macOS port of unpack-reference-foundation.ps1
|
|
4
|
-
#
|
|
5
|
-
# SYNOPSIS
|
|
6
|
-
# Unpack an AW-Spec reference pack file into a target project, renaming the
|
|
7
|
-
# sentinel app name to the caller's app name.
|
|
8
|
-
#
|
|
9
|
-
# DESCRIPTION
|
|
10
|
-
# Reads --pack-file (produced by pack-reference-foundation.sh/.ps1), takes the sentinel
|
|
11
|
-
# from its header (override with --sentinel), derives four case forms of the target app
|
|
12
|
-
# name, and writes every file block to --out-dir with the sentinel rewritten in both file
|
|
13
|
-
# CONTENTS and file/dir PATHS. Text blocks are rewritten and written as UTF-8; base64
|
|
14
|
-
# blocks are decoded as-is. Refuses to overwrite existing files unless --force.
|
|
15
|
-
#
|
|
16
|
-
# EXAMPLE
|
|
17
|
-
# ./unpack-reference-foundation.sh \
|
|
18
|
-
# --pack-file ./UI.Visualization.Reference.pack.txt \
|
|
19
|
-
# --target-app-name MyApp \
|
|
20
|
-
# --out-dir ../../
|
|
21
|
-
#
|
|
22
|
-
set -euo pipefail
|
|
23
|
-
|
|
24
|
-
# ------------------------------------------------------------------ defaults ---
|
|
25
|
-
PACK_FILE=''
|
|
26
|
-
TARGET_APP_NAME=''
|
|
27
|
-
OUT_DIR='.'
|
|
28
|
-
SENTINEL=''
|
|
29
|
-
FORCE=0
|
|
30
|
-
DRYRUN=0
|
|
31
|
-
|
|
32
|
-
usage() {
|
|
33
|
-
cat >&2 <<'EOF'
|
|
34
|
-
Usage: unpack-reference-foundation.sh --pack-file <file> --target-app-name <name>
|
|
35
|
-
[--out-dir <dir>] [--sentinel <name>]
|
|
36
|
-
[--force] [--dry-run]
|
|
37
|
-
|
|
38
|
-
-p, --pack-file <file> Reference pack file to unpack (required)
|
|
39
|
-
-t, --target-app-name <name> New app name to rename the sentinel into (required)
|
|
40
|
-
-o, --out-dir <dir> Output root (default: .)
|
|
41
|
-
--sentinel <name> Override the sentinel from the pack header
|
|
42
|
-
--force Overwrite files that already exist
|
|
43
|
-
--dry-run List what would be written, write nothing
|
|
44
|
-
-h, --help Show this help
|
|
45
|
-
|
|
46
|
-
Positional fallback: unpack-reference-foundation.sh <pack-file> <target-app-name> [out-dir]
|
|
47
|
-
EOF
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
# -------------------------------------------------------------- arg parsing ---
|
|
51
|
-
while [ $# -gt 0 ]; do
|
|
52
|
-
case "$1" in
|
|
53
|
-
-p|--pack-file) PACK_FILE="${2:?--pack-file needs a value}"; shift 2 ;;
|
|
54
|
-
-t|--target-app-name) TARGET_APP_NAME="${2:?--target-app-name needs a value}"; shift 2 ;;
|
|
55
|
-
-o|--out-dir) OUT_DIR="${2:?--out-dir needs a value}"; shift 2 ;;
|
|
56
|
-
--sentinel) SENTINEL="${2:?--sentinel needs a value}"; shift 2 ;;
|
|
57
|
-
--force) FORCE=1; shift ;;
|
|
58
|
-
--dry-run) DRYRUN=1; shift ;;
|
|
59
|
-
-h|--help) usage; exit 0 ;;
|
|
60
|
-
--) shift; break ;;
|
|
61
|
-
-*) echo "Error: unknown option: $1" >&2; usage; exit 2 ;;
|
|
62
|
-
*)
|
|
63
|
-
if [ -z "$PACK_FILE" ]; then PACK_FILE="$1"
|
|
64
|
-
elif [ -z "$TARGET_APP_NAME" ]; then TARGET_APP_NAME="$1"
|
|
65
|
-
else OUT_DIR="$1"
|
|
66
|
-
fi
|
|
67
|
-
shift ;;
|
|
68
|
-
esac
|
|
69
|
-
done
|
|
70
|
-
|
|
71
|
-
[ -n "$PACK_FILE" ] || { echo "Error: --pack-file is required." >&2; usage; exit 2; }
|
|
72
|
-
[ -n "$TARGET_APP_NAME" ] || { echo "Error: --target-app-name is required." >&2; usage; exit 2; }
|
|
73
|
-
[ -f "$PACK_FILE" ] || { echo "Error: pack file not found: $PACK_FILE" >&2; exit 1; }
|
|
74
|
-
|
|
75
|
-
case "$TARGET_APP_NAME" in
|
|
76
|
-
*[!A-Za-z0-9._-]*)
|
|
77
|
-
echo "Error: --target-app-name may contain only letters, digits, '.', '_' or '-': $TARGET_APP_NAME" >&2
|
|
78
|
-
exit 2 ;;
|
|
79
|
-
esac
|
|
80
|
-
|
|
81
|
-
# ------------------------------------------------ sentinel from header --------
|
|
82
|
-
if [ -z "$SENTINEL" ]; then
|
|
83
|
-
SENTINEL="$(LC_ALL=C sed -n 's/^#[[:space:]]*sentinel:[[:space:]]*\(.*[^[:space:]]\)[[:space:]]*$/\1/p' "$PACK_FILE" | head -n1)"
|
|
84
|
-
fi
|
|
85
|
-
[ -n "$SENTINEL" ] || { echo "Error: Sentinel not found in pack header; supply it with --sentinel." >&2; exit 1; }
|
|
86
|
-
|
|
87
|
-
# ------------------------------------------------ derive case forms -----------
|
|
88
|
-
to_lower() { printf '%s' "$1" | LC_ALL=C tr '[:upper:]' '[:lower:]'; }
|
|
89
|
-
|
|
90
|
-
S_DOT="$SENTINEL"; T_DOT="$TARGET_APP_NAME"
|
|
91
|
-
S_UND="${SENTINEL//./_}"; T_UND="${TARGET_APP_NAME//./_}"
|
|
92
|
-
s_low="$(to_lower "$SENTINEL")"; t_low="$(to_lower "$TARGET_APP_NAME")"
|
|
93
|
-
S_HYP="${s_low//./-}"; T_HYP="${t_low//./-}"
|
|
94
|
-
S_LDOT="$s_low"; T_LDOT="$t_low"
|
|
95
|
-
|
|
96
|
-
FROM=(); TO=()
|
|
97
|
-
add_form() {
|
|
98
|
-
local from="$1" to="$2" e
|
|
99
|
-
[ -n "$from" ] || return 0
|
|
100
|
-
[ "$from" = "$to" ] && return 0
|
|
101
|
-
if [ "${#FROM[@]}" -gt 0 ]; then
|
|
102
|
-
for e in "${FROM[@]}"; do [ "$e" = "$from" ] && return 0; done
|
|
103
|
-
fi
|
|
104
|
-
FROM+=("$from"); TO+=("$to")
|
|
105
|
-
}
|
|
106
|
-
add_form "$S_DOT" "$T_DOT"
|
|
107
|
-
add_form "$S_UND" "$T_UND"
|
|
108
|
-
add_form "$S_HYP" "$T_HYP"
|
|
109
|
-
add_form "$S_LDOT" "$T_LDOT"
|
|
110
|
-
|
|
111
|
-
# Sort indices by FROM length descending
|
|
112
|
-
ORDER=()
|
|
113
|
-
{
|
|
114
|
-
local_n="${#FROM[@]}"
|
|
115
|
-
used=(); for ((k = 0; k < local_n; k++)); do used[$k]=0; done
|
|
116
|
-
for ((pass = 0; pass < local_n; pass++)); do
|
|
117
|
-
best=-1; bestlen=-1
|
|
118
|
-
for ((j = 0; j < local_n; j++)); do
|
|
119
|
-
if [ "${used[$j]}" -eq 0 ] && [ "${#FROM[$j]}" -gt "$bestlen" ]; then
|
|
120
|
-
bestlen="${#FROM[$j]}"; best="$j"
|
|
121
|
-
fi
|
|
122
|
-
done
|
|
123
|
-
used[$best]=1; ORDER+=("$best")
|
|
124
|
-
done
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
REPL_OUT=''
|
|
128
|
-
apply_repl() {
|
|
129
|
-
local text="$1" idx from to
|
|
130
|
-
if [ "${#ORDER[@]}" -gt 0 ]; then
|
|
131
|
-
for idx in "${ORDER[@]}"; do
|
|
132
|
-
from="${FROM[$idx]}"; to="${TO[$idx]}"
|
|
133
|
-
text="${text//"$from"/$to}"
|
|
134
|
-
done
|
|
135
|
-
fi
|
|
136
|
-
REPL_OUT="$text"
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
# ------------------------------------------------ output root ----------------
|
|
140
|
-
[ -d "$OUT_DIR" ] || mkdir -p "$OUT_DIR"
|
|
141
|
-
OUT_ROOT="$(cd "$OUT_DIR" && pwd -P)"
|
|
142
|
-
|
|
143
|
-
# ------------------------------------------------ base64 decoder (portable) --
|
|
144
|
-
B64D=()
|
|
145
|
-
if printf 'aGk=' | base64 -d >/dev/null 2>&1; then B64D=(base64 -d)
|
|
146
|
-
elif printf 'aGk=' | base64 -D >/dev/null 2>&1; then B64D=(base64 -D)
|
|
147
|
-
elif printf 'aGk=' | base64 --decode >/dev/null 2>&1; then B64D=(base64 --decode)
|
|
148
|
-
else B64D=(openssl base64 -d -A)
|
|
149
|
-
fi
|
|
150
|
-
|
|
151
|
-
# ------------------------------------------------ parse file blocks ----------
|
|
152
|
-
rels=(); encs=(); contents=()
|
|
153
|
-
in_block=0; cur_rel=''; cur_enc=''; cur_content=''; first_line=1
|
|
154
|
-
file_re='^<<<FILE path="([^"]+)"( encoding="([^"]+)")?>>>[[:space:]]*$'
|
|
155
|
-
|
|
156
|
-
while IFS= read -r line || [ -n "$line" ]; do
|
|
157
|
-
line="${line%$'\r'}"
|
|
158
|
-
if [ "$in_block" -eq 0 ]; then
|
|
159
|
-
if [[ "$line" =~ $file_re ]]; then
|
|
160
|
-
cur_rel="${BASH_REMATCH[1]}"
|
|
161
|
-
cur_enc="${BASH_REMATCH[3]:-}"
|
|
162
|
-
in_block=1; first_line=1; cur_content=''
|
|
163
|
-
fi
|
|
164
|
-
else
|
|
165
|
-
if [ "$line" = '<<<ENDFILE>>>' ]; then
|
|
166
|
-
rels+=("$cur_rel"); encs+=("$cur_enc"); contents+=("$cur_content")
|
|
167
|
-
in_block=0
|
|
168
|
-
elif [ "$first_line" -eq 1 ]; then
|
|
169
|
-
cur_content="$line"; first_line=0
|
|
170
|
-
else
|
|
171
|
-
cur_content="$cur_content"$'\n'"$line"
|
|
172
|
-
fi
|
|
173
|
-
fi
|
|
174
|
-
done < "$PACK_FILE"
|
|
175
|
-
|
|
176
|
-
[ "${#rels[@]}" -gt 0 ] || { echo "Error: No <<<FILE>>> blocks found in pack: $PACK_FILE" >&2; exit 1; }
|
|
177
|
-
|
|
178
|
-
# ------------------------------------------------ resolve destinations -------
|
|
179
|
-
dests=()
|
|
180
|
-
for ((i = 0; i < ${#rels[@]}; i++)); do
|
|
181
|
-
apply_repl "${rels[$i]}"
|
|
182
|
-
dests+=("$OUT_ROOT/$REPL_OUT")
|
|
183
|
-
done
|
|
184
|
-
|
|
185
|
-
# ------------------------------------------------ conflict guard -------------
|
|
186
|
-
if [ "$FORCE" -eq 0 ] && [ "$DRYRUN" -eq 0 ]; then
|
|
187
|
-
conflicts=()
|
|
188
|
-
for d in "${dests[@]}"; do [ -e "$d" ] && conflicts+=("$d"); done
|
|
189
|
-
if [ "${#conflicts[@]}" -gt 0 ]; then
|
|
190
|
-
echo "Error: Refusing to overwrite existing files (re-run with --force):" >&2
|
|
191
|
-
printf ' %s\n' "${conflicts[@]}" >&2
|
|
192
|
-
exit 1
|
|
193
|
-
fi
|
|
194
|
-
fi
|
|
195
|
-
|
|
196
|
-
# ------------------------------------------------ write ----------------------
|
|
197
|
-
written=0
|
|
198
|
-
for ((i = 0; i < ${#rels[@]}; i++)); do
|
|
199
|
-
rel="${rels[$i]}"; enc="${encs[$i]}"; dest="${dests[$i]}"
|
|
200
|
-
if [ "$DRYRUN" -eq 1 ]; then
|
|
201
|
-
echo "WOULD WRITE $rel -> $dest"
|
|
202
|
-
continue
|
|
203
|
-
fi
|
|
204
|
-
mkdir -p "$(dirname "$dest")"
|
|
205
|
-
if [ "$enc" = 'base64' ]; then
|
|
206
|
-
printf '%s' "${contents[$i]}" | tr -d '[:space:]' | "${B64D[@]}" > "$dest"
|
|
207
|
-
else
|
|
208
|
-
apply_repl "${contents[$i]}"
|
|
209
|
-
printf '%s' "$REPL_OUT" > "$dest"
|
|
210
|
-
fi
|
|
211
|
-
written=$((written + 1))
|
|
212
|
-
done
|
|
213
|
-
|
|
214
|
-
if [ "$DRYRUN" -eq 1 ]; then
|
|
215
|
-
echo "DryRun: ${#rels[@]} file(s) would be written to $OUT_ROOT (sentinel '$SENTINEL' -> '$TARGET_APP_NAME')."
|
|
216
|
-
else
|
|
217
|
-
echo "Unpacked $written file(s) to $OUT_ROOT (sentinel '$SENTINEL' -> '$TARGET_APP_NAME')."
|
|
218
|
-
fi
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
# VerticalSlice — Foundation Packaging Rules
|
|
2
|
-
|
|
3
|
-
> **Why this exists.** The old `/aw-spec-foundation` skill *reconstructed* every project
|
|
4
|
-
> file from prose rule docs. Any omission or namespace drift produced a broken,
|
|
5
|
-
> non-compiling skeleton. This packaging model replaces reconstruction with a
|
|
6
|
-
> **byte-for-byte bundle of a real, verified solution**.
|
|
7
|
-
>
|
|
8
|
-
> You build the foundation **once** (a solution that actually compiles and runs),
|
|
9
|
-
> pack it into a single text file, and the scaffolder just **unpacks + renames** it.
|
|
10
|
-
> No regeneration, no drift.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## The single artifact
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
docs/VerticalSlice/
|
|
18
|
-
├── VerticalSlice.pack.txt ← THE BUNDLE: every source file, in one text file
|
|
19
|
-
├── PACKAGING.md ← this file (how to build the bundle)
|
|
20
|
-
├── pack-foundation.ps1 ← produces VerticalSlice.pack.txt from a solution
|
|
21
|
-
└── unpack-foundation.ps1 ← extracts + renames into a target app (used by the skill)
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
The bundle is the single source of truth for scaffolding. The engineering standards
|
|
25
|
-
the foundation solution must satisfy (vertical slices, DDD, CQRS, persistence, etc.)
|
|
26
|
-
live in the project constitution and the domain-specs rule files, not in this folder.
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## The sentinel convention
|
|
31
|
-
|
|
32
|
-
You author the foundation solution under one fixed **sentinel app name**:
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
AppWeaver.Foundation
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
This is the placeholder that the scaffolder rewrites into the caller's app name.
|
|
39
|
-
It must be a **distinctive two-segment token** that is **not a prefix of any
|
|
40
|
-
`AppWeaver.*` NuGet package** (it isn't — there is no `AppWeaver.Foundation` package),
|
|
41
|
-
so a full-token replacement can never clobber a framework reference.
|
|
42
|
-
|
|
43
|
-
The scaffolder rewrites the sentinel in **four case forms** (ordinal, case-sensitive),
|
|
44
|
-
applied to **file contents and to file/folder paths**:
|
|
45
|
-
|
|
46
|
-
| Form | Sentinel | Example target (`AppWeaver.Health`) | Where it appears |
|
|
47
|
-
|-------------|------------------------|-------------------------------------|---------------------------------------------------|
|
|
48
|
-
| dotted | `AppWeaver.Foundation` | `AppWeaver.Health` | namespaces, `.csproj`/`.sln` names, project refs |
|
|
49
|
-
| underscored | `AppWeaver_Foundation` | `AppWeaver_Health` | Aspire project class names (`Projects.X_Service`) |
|
|
50
|
-
| lower-hyphen| `appweaver-foundation` | `appweaver-health` | `UserSecretsId`, db/container names |
|
|
51
|
-
| lower-dot | `appweaver.foundation` | `appweaver.health` | any lowercased identifiers |
|
|
52
|
-
|
|
53
|
-
**Never** rename the bare `AppWeaver` company segment on its own — only the full
|
|
54
|
-
sentinel token in the forms above. The framework packages (`AppWeaver.Mediator`,
|
|
55
|
-
`AppWeaver.Repository`, …) stay exactly as written.
|
|
56
|
-
|
|
57
|
-
### What does NOT get renamed
|
|
58
|
-
|
|
59
|
-
- `AppWeaver.*` framework package references (`Directory.Packages.props`, every `.csproj`).
|
|
60
|
-
- The sample domain folder **`Projects`** (aggregate `Project`, `CreateProject`, etc.).
|
|
61
|
-
This is intentional sample content the caller renames to their own bounded context later.
|
|
62
|
-
- `<Company>` / `<Authors>` metadata in `Directory.Build.props` (display-only; edit manually if desired).
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## How to author the foundation solution (do this once)
|
|
67
|
-
|
|
68
|
-
1. **Pick a scratch folder** outside `docs/`, e.g.
|
|
69
|
-
`E:\Work\Bytestrone\AppWeaver\Testing\AppWeaver.Spec\.foundation-build\`.
|
|
70
|
-
2. **Create the solution under the sentinel name** `AppWeaver.Foundation`, following the
|
|
71
|
-
engineering standards in the project constitution and domain-specs rule files:
|
|
72
|
-
```
|
|
73
|
-
AppWeaver.Foundation.sln
|
|
74
|
-
global.json
|
|
75
|
-
Directory.Build.props
|
|
76
|
-
Directory.Packages.props
|
|
77
|
-
src/
|
|
78
|
-
AppWeaver.Foundation.AppHost/
|
|
79
|
-
AppWeaver.Foundation.ServiceDefaults/
|
|
80
|
-
AppWeaver.Foundation.Service/ (includes the sample 'Projects' domain)
|
|
81
|
-
AppWeaver.Foundation.Web/
|
|
82
|
-
```
|
|
83
|
-
3. **Make it actually work.** This is the whole point — the bundle is only as good as
|
|
84
|
-
the solution you pack. Verify before packing:
|
|
85
|
-
```powershell
|
|
86
|
-
dotnet restore .foundation-build/AppWeaver.Foundation.sln
|
|
87
|
-
dotnet build .foundation-build/AppWeaver.Foundation.sln -c Debug
|
|
88
|
-
# optional end-to-end:
|
|
89
|
-
dotnet run --project .foundation-build/src/AppWeaver.Foundation.AppHost
|
|
90
|
-
```
|
|
91
|
-
Fix every error and warning-as-error here, in the real project, where the compiler
|
|
92
|
-
tells you exactly what's wrong. The packed bundle inherits this correctness.
|
|
93
|
-
4. **Use the sentinel everywhere** the app name belongs: namespaces, project/folder
|
|
94
|
-
names, `UserSecretsId`, the Aspire db resource name, container names. Use the correct
|
|
95
|
-
case form for each (see table above).
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## How to build the bundle
|
|
100
|
-
|
|
101
|
-
From `docs/VerticalSlice/`:
|
|
102
|
-
|
|
103
|
-
```powershell
|
|
104
|
-
# This foundation intentionally ships the org-internal Azure Artifacts PAT in NuGet.config,
|
|
105
|
-
# so the secret guard must be overridden with -AllowSecrets (org-internal use only — rotate periodically).
|
|
106
|
-
./pack-foundation.ps1 -SourceDir ../../.foundation-build -OutFile ./VerticalSlice.pack.txt -AllowSecrets
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
The packer:
|
|
110
|
-
|
|
111
|
-
- walks the solution, **excluding** build/IDE artifacts and secret-bearing files:
|
|
112
|
-
- dirs: `bin obj .vs .git .idea .vscode TestResults node_modules packages App_Data artifacts .next logs`
|
|
113
|
-
- files: `*.user *.suo *.DotSettings.user *.db *.db-shm *.db-wal *.sqlite *.log`
|
|
114
|
-
and **secrets**: `.env.* *.pfx *.pem *.key *.snk id_rsa id_rsa.pub secrets.json`;
|
|
115
|
-
> The root **`.env` is bundled on purpose** (required sample config); only per-environment
|
|
116
|
-
> overrides (`.env.local`, `.env.production`, …) are excluded. Keep the bundle org-internal
|
|
117
|
-
> and rotate any real values — the content scan still blocks PATs/keys regardless of filename.
|
|
118
|
-
- **fails closed on detected secrets** — it scans file *contents* for credential markers
|
|
119
|
-
(`ClearTextPassword`, private-key blocks, AWS keys, Azure DevOps PAT patterns) and
|
|
120
|
-
**refuses to pack** if any are found, unless you pass `-AllowSecrets`. This is what stops
|
|
121
|
-
a `NuGet.config` PAT from being baked into the committed bundle. **Fix the source** (rotate
|
|
122
|
-
the secret, switch the feed to env/CLI auth) rather than overriding the guard;
|
|
123
|
-
- stores text files **verbatim** and binary files (e.g. a `.png`) **base64-encoded**;
|
|
124
|
-
- writes a header (foundation, sentinel, file count, format version, replacement contract);
|
|
125
|
-
- **warns** if the sentinel token appears in zero files (a sign you used the wrong name).
|
|
126
|
-
|
|
127
|
-
> **Credentials in a scaffold.** The bundled `NuGet.config` should contain only feed
|
|
128
|
-
> *definitions* and `packageSourceMapping` — never `<packageSourceCredentials>`. Developers
|
|
129
|
-
> authenticate to private feeds with `dotnet nuget` / the Azure Artifacts credential provider
|
|
130
|
-
> / environment variables, not a checked-in PAT.
|
|
131
|
-
|
|
132
|
-
Re-run it whenever the foundation changes; commit the regenerated `VerticalSlice.pack.txt`.
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Pack file format (`aw-spec-pack/v1`)
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
# AW-SPEC FOUNDATION PACK
|
|
140
|
-
# foundation: VerticalSlice
|
|
141
|
-
# sentinel: AppWeaver.Foundation
|
|
142
|
-
# generated: 2026-06-14T10:00:00.0000000Z
|
|
143
|
-
# files: 47
|
|
144
|
-
# format: aw-spec-pack/v1
|
|
145
|
-
# --- replacement contract ... ---
|
|
146
|
-
# ============================================================
|
|
147
|
-
|
|
148
|
-
<<<FILE path="Directory.Build.props">>>
|
|
149
|
-
...verbatim file content...
|
|
150
|
-
<<<ENDFILE>>>
|
|
151
|
-
<<<FILE path="src/AppWeaver.Foundation.AppHost/Program.cs">>>
|
|
152
|
-
...verbatim file content...
|
|
153
|
-
<<<ENDFILE>>>
|
|
154
|
-
<<<FILE path="src/AppWeaver.Foundation.Web/wwwroot/favicon.ico" encoding="base64">>>
|
|
155
|
-
AAABAAE...
|
|
156
|
-
<<<ENDFILE>>>
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
- Paths are repo-root-relative with `/` separators.
|
|
160
|
-
- The marker lines `<<<FILE …>>>` and `<<<ENDFILE>>>` are **reserved** — they must never
|
|
161
|
-
occur as a literal line inside a source file (they can't in C#/XML/JSON/Razor).
|
|
162
|
-
- `encoding="base64"` marks a binary file; everything else is UTF-8 text.
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
## How scaffolding consumes the bundle
|
|
167
|
-
|
|
168
|
-
`/aw-spec-foundation VerticalSlice <AppName> [OutputDir]` runs `unpack-foundation.ps1`,
|
|
169
|
-
which reads the sentinel from the pack header, derives the four target case forms, and
|
|
170
|
-
writes the renamed files to the output directory (**repo root by default**). See
|
|
171
|
-
`.claude/skills/aw-spec-foundation/SKILL.md`.
|
|
172
|
-
|
|
173
|
-
```powershell
|
|
174
|
-
./unpack-foundation.ps1 -PackFile ./VerticalSlice.pack.txt -TargetAppName AppWeaver.Health -OutDir ../../
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## Maintenance checklist
|
|
180
|
-
|
|
181
|
-
- [ ] Foundation solution builds clean (`dotnet build`, warnings-as-errors satisfied).
|
|
182
|
-
- [ ] Sentinel `AppWeaver.Foundation` used consistently in all four case forms.
|
|
183
|
-
- [ ] No `bin/obj/.vs` or local `.db` files committed into the pack.
|
|
184
|
-
- [ ] `pack-foundation.ps1` reported a non-zero sentinel hit count.
|
|
185
|
-
- [ ] `VerticalSlice.pack.txt` regenerated and committed after any change.
|