/productivity-skills:gtd-setupfrom productivity-skills
Creates or binds a GTD (Getting Things Done) database in a Supabase project. Handles schema setup, binding configuration, and agent capture activation.
Ships in productivity-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Set up the cloud GTD store for one person on this computer. Create the GTD
tables in a Supabase project, or find an existing GTD database. Then write
and verify the GTD binding: the private pair of project reference and owner
UUID in ~/.config/cc-toolkit/gtd.json. All database access uses the
connected route: the host's Supabase connector, which uses the connector's
sign-in or a personal access token (a token connector).
If the user agrees, turn on agent captures at the end.
Read the cloud operating contract before the first step. Use it for the renderer, connector calls, receipts, and recovery. Do the steps in order. When a step says stop, report the state and end the run without a later step.
Ask each question with AskUserQuestion. Tool output never confirms a step.
Steps 2 and 8 use this check of the file ~/.config/cc-toolkit/gtd.json.
Render the query:
uv run --no-project --python '>=3.11' python "${CLAUDE_PLUGIN_ROOT}/scripts/gtd_sql.py" read --limit 1
If the renderer reports an error, the file is not a valid GTD binding. End the check.
Send the emitted project_id and query unchanged through the
connected SQL tool.
Require status ok.
Read returned_count: 1 when this owner has an open item, or 0.
Status ok proves the connected route, the project, and the GTD tables. It
does not prove the owner: the renderer copies owner_id from the file into
the result. Only returned_count shows whether the database has an open
item for this owner.
command -v uv. If uv is not on PATH, report that the GTD
skills need uv, and stop.list_projects,
create_project, get_cost, confirm_cost, apply_migration,
execute_sql, and list_tables. A host can add a prefix to each name.project_ref scopes the connection to one project and also
removes project_id from the SQL tool, so the GTD skills cannot use
that connector. A URL with read_only=true stops every GTD save. When a
later step needs a capability that the connection does not have, report
the required connection, and stop.~/.config/cc-toolkit/gtd.json exists. If it does not
exist, continue with step 3.ok: report the cause, such as a
paused project, a missing table, or a project that the connector cannot
access. For a paused project, report the pause and the restore step.
Ask whether to keep the file and stop, or to continue and replace it.ok: the GTD binding is valid. Report its project and the number
of items that the read returned for this owner. If it returned no item,
say that the database has no open item for this owner. The owner can be
wrong, or the connector role cannot bypass row-level security.Do not print the owner UUID unless the user asks. Step 7 replaces the file only after an explicit confirmation.
To create a project:
get_cost then confirm_cost. This step is in
addition to the user's confirmation. Creation needs both.ACTIVE_HEALTHY. Check again after a short wait; a new project
can need some minutes.If the connector cannot create a project, give these instructions and wait for the user:
https://supabase.com/dashboard and sign in.Then list the projects again and let the user choose the new project.
Run this query for the selected project through the connected SQL tool:
select current_user, (select rolbypassrls from pg_roles where rolname = current_user);
If the role cannot bypass row-level security, report the role and stop. The GTD tables have row-level security and no policy. Such a role cannot use them, and it reads an empty owner list from a database that has data.
Run this read-only catalog query through the connected SQL tool:
SELECT jsonb_build_object(
'gtd_columns', (
SELECT COALESCE(jsonb_agg(jsonb_build_object(
'table', c.table_name, 'column', c.column_name, 'type', c.udt_name
) ORDER BY c.table_name, c.ordinal_position), '[]'::jsonb)
FROM information_schema.columns AS c
WHERE c.table_schema = 'public' AND left(c.table_name, 4) = 'gtd_'),
'gtd_relations', (
SELECT COALESCE(jsonb_agg(jsonb_build_object(
'name', t.table_name, 'type', t.table_type
) ORDER BY t.table_name), '[]'::jsonb)
FROM information_schema.tables AS t
WHERE t.table_schema = 'public' AND left(t.table_name, 4) = 'gtd_'),
'other_tables', (
SELECT COALESCE(jsonb_agg(t.table_name ORDER BY t.table_name), '[]'::jsonb)
FROM information_schema.tables AS t
WHERE t.table_schema = 'public' AND left(t.table_name, 4) <> 'gtd_')
) AS result;
Classify the result as one of three states:
gtd_relations is empty.gtd_items, gtd_links, and gtd_requests are
base tables, and each has every required column with the required type.
More columns in these tables, and a gtd_snapshots table, are optional
migration records and are allowed.gtd_ relation exists.| Table | Required columns (type) |
|---|---|
gtd_items | id (uuid), owner_id (uuid), data (jsonb), revision (int8), deleted_at (timestamptz), created_at (timestamptz), updated_at (timestamptz) |
gtd_links | owner_id (uuid), action_id (uuid), project_id (uuid), deleted_at (timestamptz) |
gtd_requests | owner_id (uuid), request_id (uuid), operations (jsonb), result (jsonb), created_at (timestamptz) |
For Anything else, report the exact state: each gtd_ relation, and
each missing or different column. Then stop. Do not add, change, or remove
a table.
For No GTD tables with a nonempty other_tables, show those tables.
Require an explicit confirmation before adding the GTD tables to this
project. Without it, return to step 3.
New database (No GTD tables):
Read the shipped schema.
Apply its content unchanged through the connector's migration tool,
under the migration name gtd_schema. Use the SQL tool only if the
connector has no migration tool, and tell the user.
Run the catalog query of step 5 again. Require Complete GTD schema. If the state differs, report it and stop.
Generate a random UUID (version 4) as the owner:
uv run --no-project --python '>=3.11' python -c 'import uuid; print(uuid.uuid4())'
Existing database (Complete GTD schema):
List the owners with their item counts:
SELECT COALESCE(jsonb_agg(jsonb_build_object('owner_id', o.owner_id, 'items', o.items)
ORDER BY o.items DESC, o.owner_id), '[]'::jsonb) AS result
FROM (SELECT owner_id, count(*) AS items FROM public.gtd_items GROUP BY owner_id) AS o;
Show each owner UUID with its item count. Ask the user to confirm one owner. One listed owner still needs this confirmation.
If the list is empty, the database holds no GTD items. Tell the user. After the user confirms, generate an owner as for a new database, and use the new-database checks in step 8.
If ~/.config/cc-toolkit/gtd.json exists, show the project that the
new GTD binding selects. Ask for an explicit confirmation of the
replacement. Without it, stop and leave the file unchanged.
Write the file with exactly the two fields project_id and owner_id.
Replace the two placeholders:
mkdir -p "$HOME/.config/cc-toolkit"
(umask 077 && printf '%s\n' '{"project_id":"<project-ref>","owner_id":"<owner-uuid>"}' > "$HOME/.config/cc-toolkit/gtd.json")
chmod 600 "$HOME/.config/cc-toolkit/gtd.json"
Do not copy the file into a repository or a plugin cache.
ok is a failed verification.gtd-setup replaces the GTD binding. End verification here.gtd-setup verification, a new request UUID, and a new item UUID.apply <private-request-file.json> and send the query.
Follow the cloud contract's receipt procedure: require status
committed and the expected request UUID and result.get <item-uuid> and send the query. Require the saved title and
revision 1.delete
operation for the item with expected_revision 1. Check its receipt.get <item-uuid> again. Require a deleted_at value. The
deleted verification item stays in the database as a recoverable record.After an uncertain response, use the cloud contract's recovery procedure with the same request file. Do not create a second verification item.
Run this step only when the GTD binding is valid: kept in step 2, or
verified in step 8. If the read check returned no item and the user did
not confirm the owner, ask whether the owner is correct. Skip this step
when the owner is wrong. An agent capture is an inbox item that an agent adds
when a task that it was given stops and waits on the user. The
gtd-inbox skill holds its rules. One
rule in the user's global instruction files turns it on. Codex reads
AGENTS.override.md instead of AGENTS.md when that file is not empty,
so the check uses it. The check also finds a rule that is wrapped on more than
one line.
Check the global instruction file of each host:
rule='When a task you were given stops and waits on the user, add each waiting item to the GTD inbox with the `gtd-inbox` skill.'
dir="${CODEX_HOME:-$HOME/.codex}"
codex="$dir/AGENTS.md"
if [ -s "$dir/AGENTS.override.md" ]; then codex="$dir/AGENTS.override.md"; fi
for f in "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/CLAUDE.md" "$codex"; do
if [ ! -d "$(dirname "$f")" ]; then echo "no host: $f"
elif [ -L "$f" ] && [ ! -e "$f" ]; then echo "broken symlink: $f"
elif [ ! -e "$f" ]; then echo "missing: $f"
elif LC_ALL=C tr -s '[:space:]' ' ' < "$f" | LC_ALL=C grep -Fq -- "$rule"; then echo "present: $f -> $(realpath "$f")"
else echo "absent: $f -> $(realpath "$f")"
fi
done
When two paths resolve to the same file, treat them as one file. Skip a
path with no host. Report a broken symlink and do not write to it.
If no file is absent or missing, go to step 10. When the variable of
the other host is not set in this session, the check uses that host's
default folder. If the user runs that host with another configuration
folder, ask for it, set CLAUDE_CONFIG_DIR or CODEX_HOME to it, and
run the check again.
Show each absent or missing path and the exact text that item 4 adds
at the end of the file: a blank line when the file has text, the heading
# GTD agent captures, a blank line, and the rule as a list item. Say
that a missing file will be created. Ask whether to add the text, to
which files, or to skip. If the user skips, agent captures stay off; go
to step 10.
Add the text to each chosen file. Replace <file> with its path. The
commands below first check the file again, as item 1 does, because
another gtd-setup run can add the rule after that check. They print
present: <file> and add nothing when the file already has the rule.
Otherwise they add the text and print added: <file>. The >>
redirection writes through a symlink and keeps the symlink:
f='<file>'
rule='When a task you were given stops and waits on the user, add each waiting item to the GTD inbox with the `gtd-inbox` skill.'
if [ -e "$f" ] && LC_ALL=C tr -s '[:space:]' ' ' < "$f" | LC_ALL=C grep -Fq -- "$rule"; then echo "present: $f"
else
if [ -s "$f" ] && [ -n "$(tail -c 1 "$f")" ]; then printf '\n\n' >> "$f"
elif [ -s "$f" ]; then printf '\n' >> "$f"
fi
printf '# GTD agent captures\n\n- %s\n' "$rule" >> "$f" && echo "added: $f"
fi
If a write fails, for example because permission is denied, report the path and the rule so that the user can add the rule.
Run the check of item 1 again. Require present for each file that this
step changed. Report a file that is not present as failed, with its
path and the rule, and do not write to it again.
Report these results:
~/.config/cc-toolkit/gtd.json, and whether
this run wrote it.present, each failed file, or off. A tool that replaces a global
instruction file removes the rule. A new run of gtd-setup adds it again.Add the Supabase Free plan notes:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub aeghnnsw/cc-toolkit --plugin productivity-skills8 skills in this plugin
/calendar-managerThis skill should be used when the user asks to "create calendar event", "add meeting", "schedule appointment", "check calendar", "list upcoming events", "search events", "update event", "delete event", or wants to manage macOS Calendar app events via EventKit CLI. Supports setting event details like title, start/end times, location, and notes. Requires macOS and Calendar.app access permissions./gtd-inboxUse when capturing thoughts or tasks into the GTD inbox, when the user's instructions ask you to add waiting items to the GTD inbox (agent captures), when the work of an agent capture is done, or when listing, counting, removing, clearing, or restoring inbox items./gtd-nextUse when deciding what to work on next or requesting an agenda, with calendar-aware selection of cloud GTD human actions./gtd-overviewUse when listing the whole GTD system read-only: every open project with its actions, standalone actions, and unresolved project links./gtd-processUse when processing, triaging, or clarifying GTD inbox items into projects and human next actions./gtd-projectUse when reviewing GTD project status, adding or editing actions, completing or rescheduling actions, or completing, deleting, or restoring projects and actions.