Skip to content

joedaws/agent-techniques / skills/weekly-companion

weekly-companion

Verified

Use in a long-running (one week) personal session driven from a phone — capture voice-to-text messages verbatim, turn them into work/life todos and an effort log, persist everything to the private data repo after every message, and answer "what are my priorities" with a ranked work + life list. Trigger when the user says "start my week", "capture", "priorities", "what did I do", "end the week", "/weekly-companion", or sends a rambling dictated note in a repo that has a weeks/ directory.

FileKindSize
.shellcheckrcother22 B
SKILL.mdskill md6.2 KB
scripts/bootstrap.shexecutablescript2.7 KB
scripts/capture.shexecutablescript1.5 KB
scripts/lib.shscript1.7 KB
scripts/sync.shexecutablescript2.7 KB
scripts/week-init.shexecutablescript3.6 KB
scripts/week-stats.shexecutablescript3.5 KB
templates/CLAUDE.mdmarkdown730 B
templates/areas.mdmarkdown381 B
tests/run-tests.shexecutablescript2.2 KB
tests/test-cases.shscript7.2 KB

scripts/week-init.sh

View on GitHub
#!/usr/bin/env bash
# Creates weeks/<YYYY-Www>/ in the data repo and carries over open todos
# from the most recent earlier week. Idempotent: an existing week is left alone.
set -o errexit
set -o nounset
set -o pipefail
IFS=$'\n\t'

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_DIR
# shellcheck source=lib.sh
source "${SCRIPT_DIR}/lib.sh"

usage() {
    printf 'Usage: %s [--root <data-repo>] [--week <YYYY-Www>]\n' "$(basename "$0")" >&2
}

# Prints the id of the latest week directory strictly before $2, or nothing.
find_previous_week() {
    local weeks_root="$1"
    local week_id="$2"
    [[ -d "${weeks_root}" ]] || return 0
    local candidate
    local previous=""
    for candidate in "${weeks_root}"/*/; do
        candidate="$(basename "${candidate}")"
        [[ "${candidate}" =~ ${WEEK_ID_PATTERN} ]] || continue
        [[ "${candidate}" < "${week_id}" ]] || continue
        [[ "${candidate}" > "${previous}" ]] && previous="${candidate}"
    done
    printf '%s' "${previous}"
}

# Prints the open todo lines of a todos file with carry:N incremented.
carried_open_todos() {
    local todos_path="$1"
    [[ -f "${todos_path}" ]] || return 0
    awk '
        /^- \[ \] / {
            if (match($0, / carry:[0-9]+/)) {
                count = substr($0, RSTART + 7, RLENGTH - 7) + 1
                $0 = substr($0, 1, RSTART - 1) " carry:" count substr($0, RSTART + RLENGTH)
            } else {
                $0 = $0 " carry:1"
            }
            print
        }
    ' "${todos_path}"
}

write_todos_file() {
    local week_dir="$1"
    local week_id="$2"
    local carried="$3"
    {
        printf '# Todos — %s\n\n' "${week_id}"
        printf '<!-- open:  - [ ] <text> #work|#life [!1|!2|!3] [due:YYYY-MM-DD] added:YYYY-MM-DD [carry:N] -->\n'
        printf '<!-- done:  - [x] <same line> done:YYYY-MM-DD -->\n\n'
        printf '## Open\n\n'
        [[ -n "${carried}" ]] && printf '%s\n' "${carried}"
        printf '\n## Done\n\n'
    } > "${week_dir}/${TODOS_FILE}"
}

write_week_files() {
    local week_dir="$1"
    local week_id="$2"
    local carried="$3"
    mkdir -p "${week_dir}"
    printf '# Inbox — %s\n\nRaw captures, verbatim. Append-only.\n' "${week_id}" > "${week_dir}/${INBOX_FILE}"
    printf '# Effort log — %s\n\n<!-- - YYYY-MM-DD #work|#life [NNm] <what happened> -->\n\n' "${week_id}" \
        > "${week_dir}/${LOG_FILE}"
    write_todos_file "${week_dir}" "${week_id}" "${carried}"
}

main() {
    local requested_root=""
    local week_id=""
    while (($# > 0)); do
        case "$1" in
            --root) requested_root="${2:?--root needs a value}"; shift 2 ;;
            --week) week_id="${2:?--week needs a value}"; shift 2 ;;
            -h|--help) usage; exit 0 ;;
            *) usage; die "unknown argument: $1" ;;
        esac
    done
    [[ -n "${week_id}" ]] || week_id="$(current_week_id)"
    validate_week_id "${week_id}"

    local root week_dir
    root="$(resolve_root "${requested_root}")"
    week_dir="$(week_dir_path "${root}" "${week_id}")"
    if [[ -d "${week_dir}" ]]; then
        log_info "week ${week_id} already initialized; nothing to do"
        printf '%s\n' "${week_dir}"
        return 0
    fi

    local previous carried=""
    previous="$(find_previous_week "${root}/${WEEKS_DIR_NAME}" "${week_id}")"
    if [[ -n "${previous}" ]]; then
        carried="$(carried_open_todos "$(week_dir_path "${root}" "${previous}")/${TODOS_FILE}")"
    fi
    write_week_files "${week_dir}" "${week_id}" "${carried}"
    log_info "initialized ${week_id} (carried from: ${previous:-none})"
    printf '%s\n' "${week_dir}"
}

main "$@"
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall