Blog post: jq recipes you’ll actually use Reference: jq manual Problem JSON from an API/CLI/config file needs reshaping — extract fields, filter elements, flatten to lines — without writing a script. jq’s filter language does it in one expression; these are the patterns that cover ~95% of daily use. Basics jq '.' # pretty-print jq '.field' # one field jq '.a.b.c' # nested field jq '.items[0]' # first array element jq '.items[-1]' # last element jq '.items[0:3]' # slice (first 3) jq 'length' # array/object size jq 'keys' # object keys Arrays jq '.[]' # every element (flatten) jq '.[].name' # one field from each jq '.[].name' -r # -r: raw output, no quotes jq 'map(.name)' # same, but stays an array jq 'map(.name) | sort' # sort the array jq 'map(.name) | unique' # dedupe jq 'first(.[] | select(.active))' # first match jq 'contains(["a","b"])' # array includes all listed jq '.[] | select(.x > 5)' # filter elements jq 'group_by(.env)' # group into arrays Objects jq '{name, id}' # build object from fields jq '.[] | {name, id}' # object per element jq 'to_entries' # [{key, value}, ...] jq 'to_entries[] | "\(.key)=\(.value)"' # flatten to key=value jq 'with_entries(.key |= ascii_upcase)' # transform all keys jq 'del(.secrets)' # remove fields jq '.a + .b' # merge objects Strings & interpolation jq '.[] | "\(.org)/\(.repo):\(.version)"' # interpolation jq -r '.[] | join(",")' # join array fields jq 'test("regex")' # boolean match jq '.[] | select(.name | test("^harbour-"))' # filter by regex jq 'ascii_downcase' # case ops jq 'ltrimstr("prefix")' # strip prefix Conditionals & logic jq 'if .env == "prod" then "p" else "np" end' jq '.[] | select(.env == "prod" and .enabled)' jq '.value // "default"' # fallback for null/missing jq '.items | any(.ready)' # any element true jq '.items | all(.ready)' # all elements true jq '.items | INDEX(.id)' # array → map keyed by .id Aggregation jq '[.[] | .size] | add' # sum jq '[.[] | .v] | min, max' # min/max jq 'sort_by(.created) | last' # latest jq 'map(select(.x)) | length' # count matches Handy combos jq -r '.[] | [.id, .name] | @tsv' # tab-separated rows jq -r '.[] | [.id, .name] | @csv' # CSV jq -r 'paths | join(".")' # every leaf path jq 'getpath(["a","b"])' # safe nested get jq '.. | objects | select(has("token"))' # find anywhere in tree jq -S '.' # sort all keys (canonical diff) gh api patterns # one field per element gh api orgs/ORG/installations --jq '.installations[] | {app_id, app_slug}' # find a specific app gh api orgs/ORG/installations \ --jq '.installations[] | select(.app_slug=="ifc-mentor-jenkins") | {app_id, id}' # file list from a tree gh api repos/ORG/REPO/git/trees/main?recursive=1 --jq '.tree[].path' # repo names only gh api 'orgs/ORG/repos?per_page=100' --jq '.[].name' # count gh api 'orgs/ORG/repos?per_page=100' --jq 'length' # raw file content (skip jq entirely) gh api repos/ORG/REPO/contents/path.yaml -H "Accept: application/vnd.github.raw" Gotchas .foo.bar fails on null parents → use .foo?.bar or .foo // {}. -r for scripts/config; keep JSON mode when piping to another jq. select() filters elements; map() transforms — mixing them up is the #1 mistake. @tsv/@csv need -r to look right. gh api --jq = gh api then pipe to jq; identical to gh api ... | jq ....
How to convert Markdown to Word (.docx) without templates
Blog post: Markdown to Word without the template tax Problem You need a .docx (Word) version of markdown content — runbooks, notes, tracking docs — without hand-maintaining a template or a placeholder contract. Pandoc output often needs post-editing; corporate recipients just want a Word file. Solution Use the agent skill simple-md-docx-converter — repo: https://gitlab.com/shoujunni/skill-md-docx-converter. It converts any well-formed .md to native Word constructs with python-docx: Headings, paragraphs, lists (incl. task lists), tables, code fences, blockquotes, strikethrough, horizontal rules <mark> highlighting, inline images, {{toc}} fields, page breaks, multi-file merge Mermaid diagrams render to images via mmdc/Kroki/npx when available, else degrade to labelled text Optional --template (.docx/.dotx/.dotm or a named template from templates/) inherits corporate styles/headers/footers and fills {{key}} tokens via --set key=value Quick start git clone https://gitlab.com/shoujunni/skill-md-docx-converter.git cd skill-md-docx-converter # One-time: create the venv with python-docx ./scripts/setup.sh # Convert (writes input.docx next to input.md) .venv/bin/python scripts/convert_md_to_docx.py input.md # Merge several files, branded output .venv/bin/python scripts/convert_md_to_docx.py a.md b.md -o merged.docx \ --template corporate-report --set title="Quarterly Report" Useful flags: --code-theme <pygments-name>, --code-font <name>, --toc, --scan-placeholders, --open (open on completion), --no-verify. ...