Skip to content

Create a Cancer Care Family Brief

Category Creative & Real-World AI Builds
Status ๐ŸŸก Partially completed
Repo nextwork-create-a-cancer-care-family-brief
Original NextWork guide nextwork.ai

Learning project

Practice work following a NextWork guide, separate from my production projects.

๐Ÿ“š NextWork learning project. This is a practice project I built while working through NextWork's Create a Cancer Care Family Brief guide. It is part of my Learning portfolio and is fully separate from my production projects.

Category: Learning โ€บ Creative & Real-World AI Builds
Status: ๐ŸŸก Partial

Overview

A family brief is useful only if a suspicion never reads as a fact. This repo encodes that rule in the data: each finding carries a certainty level and a source, the renderer enforces the limits, and trial results stay conditional until a site confirms eligibility.

Summary

Built the brief workflow with my own organiser on a fictional case I wrote (Riley: lung adenocarcinoma with an indeterminate adrenal spot and pending gene tests). The brief keeps confirmed, suspicious, unresolved and pending findings in separate sections and refuses to render if a stage is marked confirmed or if there are more than 3 actions or 5 questions. A shortlist script queried the live ClinicalTrials.gov API, found 37 recruiting trials with a Houston site, and kept 5, each labelled eligibility unknown with the reasons it might not fit. It also lists 3 second-opinion routes. Secret mission: a mock appointment update moved three pending results to confirmed, added the adrenal biopsy, replaced the plan and appended to the care log; re-applying it is refused. Partial because Antigravity, the third-party skill and a restricted Google Doc weren't used: sharing is a local single-copy stand-in.

The checks behind this are in docs/verification.txt.

Skills & tools

Python, ClinicalTrials.gov API v2, Plain-language health writing, Data minimisation, Living documents

What I built

  • case/case.json: my fictional case. Every finding is tagged confirmed / suspicious / unresolved / pending with its source, alongside plain-language terms, 3 next actions and 5 first-person questions.
  • tools/brief.py โ†’ Brief.md: renders the brief and refuses to write it if a limit is broken (more than 3 actions or 5 questions, trials outside 3 to 5, more than 3 second opinions, a trial claiming eligibility, or a confirmed stage).
  • tools/trials.py โ†’ docs/trials.json (+ the raw API reply in docs/trials-raw.json): recruiting NSCLC trials with a site in Houston. Each title is read against what the brief knows (gene changes not tested, surgery-only, metastatic-only, high PD-L1), the trials are ranked, and 5 are kept. No one is contacted.
  • tools/share.py โ†’ shared/: one copy only, owner-only file mode, and an access list with 1 viewer, 0 editors and link sharing off. It stands in for the restricted Google Doc.
  • Secret mission: tools/apply_update.py case/update-2027-01-14.json โ†’ docs/secret-mission-run.txt (the diff of the brief before and after). Pending EGFR/ALK/MRI move to confirmed, the adrenal biopsy is added as pending, and the plan is replaced while the care log grows. A second apply is refused.

How to run

python3 tools/trials.py                      # live ClinicalTrials.gov query (no key)
python3 tools/brief.py --trials docs/trials.json
python3 tools/share.py
python3 tools/apply_update.py case/update-2027-01-14.json   # already applied in this repo; refuses a second time

Verification

I ran the verification command on 2026-12-03. The full output is in docs/verification.txt.

python3 -m py_compile tools/*.py && python3 tools/brief.py --trials docs/trials.json --out /tmp/brief-check.md && diff -q /tmp/brief-check.md Brief.md && python3 -c "import json;t=json.load(open('docs/trials.json'));assert 3<=len(t['trials'])<=5 and len(t['second_opinions'])<=3 and all(x['eligibility'].startswith('unknown') for x in t['trials']);c=json.load(open('case/case.json'));assert len(c['care_log'])==1 and not any('stage' in f['text'].lower() and f['level']=='confirmed' for f in c['findings']);b=open('Brief.md').read();assert all(h in b for h in ['## Confirmed','## Suspicious, not confirmed','## Pending','## Care log']);print('trials',len(t['trials']),'found',t['found_with_local_site'])" && ! python3 tools/apply_update.py case/update-2027-01-14.json 2>/dev/null && rm /tmp/brief-check.md && echo BRIEF OK

Notes

Everything is fictional: the person, the report and the appointment are mine, written for practice, and nothing here is medical advice. Trial data is a live snapshot from 3 Dec 2026, so re-running tools/trials.py will give different results. Git doesn't keep the 600 file mode, so tools/share.py sets it again on each run.

What isn't done, and why

Google Antigravity CLI and the third-party cancer Agent Skill weren't used (macOS/Google account). I wrote my own organiser instead, so no AI agent did the organising. There's no Google Doc: the restricted share is a local file stand-in. Second-opinion options are general routes, not named, verified services.


Original project: https://nextwork.ai/projects/a3e806c9-54c6-4e29-9cc2-49f4107b2ae2 ยท Part of my NextWork Learning portfolio (hub).

Verification output

From docs/verification.txt:

$ python3 -m py_compile tools/*.py && python3 tools/brief.py --trials docs/trials.json --out /tmp/brief-check.md && diff -q /tmp/brief-check.md Brief.md && python3 -c "import json;t=json.load(open('docs/trials.json'));assert 3<=len(t['trials'])<=5 and len(t['second_opinions'])<=3 and all(x['eligibility'].startswith('unknown') for x in t['trials']);c=json.load(open('case/case.json'));assert len(c['care_log'])==1 and not any('stage' in f['text'].lower() and f['level']=='confirmed' for f in c['findings']);b=open('Brief.md').read();assert all(h in b for h in ['## Confirmed','## Suspicious, not confirmed','## Pending','## Care log']);print('trials',len(t['trials']),'found',t['found_with_local_site'])" && ! python3 tools/apply_update.py case/update-2027-01-14.json 2>/dev/null && rm /tmp/brief-check.md && echo BRIEF OK

wrote /tmp/brief-check.md: limits OK
trials 5 found 37
BRIEF OK

[exit code 0]