The intended way is to ignore all automatically included default packages, and only add the additional top-level packages to the list.
You do not even need to include all "lower" dependency packages, as they are pulled in via dependencies. E.g. no need to add "sqm-scripts", if you have the LuCI app "luci-app-sqm" which pulls in the underlying sqm-scripts.
I usually build via full toolchain, but here is example of a shell script to build via imagebuilder.
make image \
PROFILE="dynalink_dl-wrx36" \
PACKAGES="ca-bundle ccrypt diffutils gdbserver htop irqbalance \
mtr-nojson nano-full openssh-sftp-server patch tcpdump-mini tree wget-ssl \
block-mount kmod-usb-storage kmod-fs-cifs kmod-fs-exfat libblkid \
kmod-fs-ext4 kmod-fs-msdos kmod-fs-ntfs3 kmod-nls-cp437 kmod-nls-iso8859-1 \
kmod-nls-utf8 hostapd-utils wpad-openssl \
luci-ssl-openssl \
luci-app-adblock luci-app-banip luci-app-bcp38 luci-app-commands \
luci-app-irqbalance luci-app-nlbwmon luci-app-sqm luci-app-uhttpd \
apk-openssl luci-app-package-manager \
luci-app-statistics collectd-mod-conntrack collectd-mod-cpufreq \
collectd-mod-ping collectd-mod-thermal collectd-mod-uptime \
kmod-tun luci-proto-wireguard unetd unet-cli luci-proto-unet \
iptables-nft ip6tables-nft ipset \
-wpad-basic-mbedtls -libustream-mbedtls -libmbedtls -apk-mbedtls" \
FILES="../files"