docs(agents): refine bash style guide and update taskfile documentation

This commit is contained in:
Janik von Rotz committed 2025-11-01 12:35:58 +01:00
1 parent 6aff8877bd
commit a9e4553a95
5 files changed
+44 -38

No files matched your search

+1 -1
View File
@@ -37,6 +37,6 @@ jobs:
with:
context: .
file: image/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/amd64 #,linux/arm64
tags: janikvonrotz/taskfile.build:latest
push: true
+15 -9
View File
@@ -1,7 +1,3 @@
---
layout: layouts/base.njk
---
# AGENTS.md
## General agent guidance
@@ -16,6 +12,16 @@ This section outlines the universal rules and expectations for any LLM agent wor
**Clear Contributions:** All contributions must be submitted via a pull request with a clear, concise commit message and a brief description of the changes.
## Environment & tooling
### Taskfile
This project uses the <https://taskfile.build/> standard.
The `./task` file is a bash script that provides all functions necessary to work with this project.
**Execute**: Always try to run a command with the `./task` file script.
## Coding conventions
### Bash
@@ -26,16 +32,16 @@ The following guideline is heavily based on the [Bash Style Guide | ysap.sh](htt
**Quoting:** This is critical.
- Use double quotes (`"`) for strings that require variable expansion.
- Use single quotes (`'`) for all other literal strings.
- Use double quotes `"` for strings that require variable expansion.
- Use single quotes `'` for all other strings.
**Always quote variable expansions** (`"$var"`) to prevent word-splitting and globbing issues.
**Always quote variable expansions** `"$var"` to prevent word-splitting and globbing issues.
**Variables:** Distinct between local and environment vars.
- Use `local` for all variables inside functions.
- Use lowercase names for local variables (e.g., `buildx_output`).
- Use uppercase names for environment variables (e.g. `BUILDX_PLATFORM`)
- Use uppercase names for environment variables (e.g. `export BUILDX_PLATFORM`)
**Functions:**
@@ -47,7 +53,7 @@ The following guideline is heavily based on the [Bash Style Guide | ysap.sh](htt
- Always use `[[ ... ]]` for conditional testing, not `[ ... ]` or `test`.
- Use `((...))` for arithmetic comparisons (e.g., `((a > b))`).
- When you replace `[]` with `[[]]` make sure to escape the brakets. The `[]` is a regex filter.
- When replacing `[]` with `[[]]` make sure to escape the brackets. The `[]` is a regex filter.
**Command Substitution:**
+4 -4
View File
@@ -3,12 +3,12 @@
build-image() {
local dockerfile=${DOCKERFILE:="Dockerfile"}
local buildx_output="--load"
if [[ "$BUILDX_PLATFORM" == *,* ]]; then
buildx_output="--push"
local buildx_output="--push"
if [[ -n "$1" ]]; then
buildx_output="$1"
fi
echo "Building Docker image:"
echo "Building Docker image with output $buildx_output..."
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) docker buildx build . \
--file "$dockerfile" \
--platform "$BUILDX_PLATFORM" \
+23 -23
View File
@@ -36,13 +36,13 @@ fi
For autocomplete add the command to the help table.
### init-config-dir
### init-config-dir
```bash
printf "$column" "init-config-dir" "" "Setup task file config dir."
```
### template-dotenv
### template-dotenv
```bash
printf "$column" "template-dotenv" "" "Generate .env from .env.template."
@@ -56,7 +56,7 @@ Set git env vars.
GIT_BRANCH=$(git symbolic-ref --short -q HEAD)
```
### init-venv
### init-venv
```bash
printf "$column" "init-venv" "" "Initialize and activate Python virtual env."
@@ -64,49 +64,49 @@ printf "$column" "init-venv" "" "Initialize and activate Python virtual env."
## Environment
### create-odoo-env
### create-odoo-env
```bash
printf "$column" "create-odoo-env" "[env]" "Create env file for Odoo instance."
```
### create-nextcloud-env
### create-nextcloud-env
```bash
printf "$column" "create-nextcloud-env" "[env]" "Create env file for Nextcloud Instance."
```
### list-env
### list-env
```bash
printf "$column" "list-env" "" "List env files."
```
### show-env
### show-env
```bash
printf "$column" "show-env" "[env]" "Output content of the env file."
```
### copy-env
### copy-env
```bash
printf "$column" "copy-env" "[env][env]" "Copy env file."
```
### edit-env
### edit-env
```bash
printf "$column" "edit-env" "[env]" "Open env file in default editor."
```
### load-env
### load-env
```bash
printf "$column" "load-env" "[env]" "Load and export env file."
```
### rename-env
### rename-env
```bash
printf "$column" "rename-env" "[env][env]" "Rename env file."
@@ -118,13 +118,13 @@ printf "$column" "rename-env" "[env][env]" "Rename env file."
printf "$column" "remove-env" "[env]" "Remove environment config."
```
### backup-env-files
### backup-env-files
```bash
printf "$column" "backup-env-files" "[path]" "Archive and copy env files to target location."
```
### restore-env-files
### restore-env-files
```bash
printf "$column" "restore-env-files" "[path]" "Extract and copy env files from backup file."
@@ -132,13 +132,13 @@ printf "$column" "restore-env-files" "[path]" "Extract and copy env files from b
## LLM
### commit-with-llm
### commit-with-llm
```bash
printf "$column" "commit-with-llm" "" "Commit with llm generated commit message."
```
### update-with-llm
### update-with-llm
```bash
printf "$column" "update-with-llm" "[glob][prompt]" "Feed files matching glob to LLM and apply changes."
@@ -146,7 +146,7 @@ printf "$column" "update-with-llm" "[glob][prompt]" "Feed files matching glob to
## Git
### update-submodule
### update-submodule
```bash
printf "$column" "update-submodule" "" "Update git submodules."
@@ -160,13 +160,13 @@ Set path to pass entry.
PASS_ENTRY=$(echo "env/${PWD##*/}" | tr '[:upper:]' '[:lower:]')
```
### save-dotenv-to-pass
### save-dotenv-to-pass
```bash
printf "$column" "save-dotenv-to-pass" "" "Store content of .env in pass entry."
```
### load-dotenv=from-pass
### load-dotenv=from-pass
```bash
printf "$column" "load-dotenv=from-pass" "" "Restore content to .env from pass entry."
@@ -182,13 +182,13 @@ KEEPASS_DATABASE_KEY_FILE="/path/to/keepass.key"
KEEPASS_ENTRY=$(echo "env/${PWD##*/}" | tr '[:upper:]' '[:lower:]')
```
### save-dotenv-to-keepass
### save-dotenv-to-keepass
```bash
printf "$column" "save-dotenv-to-keepass" "" "Store content of .env in KeePass entry."
```
### load-dotenv-from-keepass
### load-dotenv-from-keepass
```bash
printf "$column" "load-dotenv-from-keepass" "" "Restore content to .env from KeePass entry."
@@ -206,14 +206,14 @@ DOCKERFILE="image/Dockerfile"
DOCKER_CONFIG="$HOME/.docker/$CONTAINER_REGISTRY/"
```
### login-docker
### login-docker
```bash
printf "$column" "login-docker" "[user][token]" "Run Docker login and create docker config."
```
### build-image
### build-image
```bash
printf "$column" "build-image" "" "Build Docker image with buildx."
printf "$column" "build-image" "[output]" "Build Docker image with buildx."
```
+1 -1
View File
@@ -11,7 +11,7 @@ help-table() {
echo "|$(printf '%*s' $((cmd_width + 2)) '' | tr ' ' '-')|$(printf '%*s' $((opt_width + 2)) '' | tr ' ' '-')|$(printf '%*s' $((desc_width + 2)) '' | tr ' ' '-')|"
printf "$column" "all" "" "Run all tasks."
printf "$column" "build-11ty" "" "Build the 11ty website."
printf "$column" "build-image" "" "Build Docker image."
printf "$column" "build-image" "[output]" "Build Docker image with buildx."
printf "$column" "commit-with-llm" "" "Commit with llm generated commit message."
printf "$column" "dev-11ty" "" "Run 11ty server."
printf "$column" "help" "[grep]" "Show help for commands."