sdc-sdapp-deploy-miniapp
sd-app Deploy + Debt-First Mini-App + Template Reorder
Section titled “sd-app Deploy + Debt-First Mini-App + Template Reorder”Background
Section titled “Background”~/projects/monorepo/apps/sd-app/ is SvelteKit PWA (Progressive Web App) shell for SDC — the mini-app showcase that turns the sd-math engine into something an advisor can be shown. Per its own STATUS.md (2026-07-10): scaffold, i18n routing, gross-up calculator and the iframe embed pattern are done; production deploy is not.
Bundled here rather than split into a fourth task because all three touch the same repo and sites/template is the shared library both site tasks build from — the highest-conflict surface in the monorepo.
Owning dept: SDC/IT — SDC-owned IP in a shared repo, per the AGENTS.md routing rule added 2026-08-27.
[!info] This is the single “what’s blocking go-live” task (2026-08-30) sdc-sdapp-full-levpro-port built the full LevPro port (int-only/term-loan/RRSP, licensing, charts, PDF reports) across 6 rounds — that task’s dev scope is done. Both of its remaining go-live blockers (Stripe account, Cloudflare Pages project) are Talbot-only account-creation steps, and both are tracked here, not duplicated across two task files, so there’s one place that answers “what’s left before this is live.” See that task’s round-6 Claude Response for full artifact pointers (how to review the port locally) and the PDF-report task sdc-sdapp-pdf-reports for report generation.
[!info] Design SSOT now exists — read it before any UI work (2026-08-29) Run
/design-context appfirst. It carries the L0-L3 progression ladder, the one-or-two-core-inputs rule (“Only show core inputs in UI, with rest behind a See all link”), and Highest Impact Analysis — the debt-first mini-app should ship at L0/L1, not L2. Vault SSOT:Core/Processes/Design/Targets/Design-Apps.md; repo mechanics:monorepo/docs/design/apps.md.Token wiring is already done — do not redo or revert it (monorepo
281f8ce, from ai-config-design-ssot).apps/sd-app/vite.config.tsnow aliases@brand, andapp.cssimports@brand/sd/tokens.csswith--primary: var(--primary-8)— the Treasury Emerald anchor#004425. It previously hand-declared155 100% 18%, matching no anchor. Verified by build + a real browser resolving153 100% 13%.Still open, and it is yours if the mini-app needs dark mode: no generated scale step matches the app’s dark-mode green
145 52% 51%(nearest--primary-3is far more muted), so that one value is still hand-declared and flagged inapp.css. Picking the step needs Talbot.
- Production deploy — Cloudflare Pages project for
sd-app; verify the/[country]/[lang]/i18n routes live (CA/US × en/fr). Rememberpnpm buildbefore testing i18n routes — the Paraglide compile step is required.- Talbot creates the Cloudflare Pages project; everything else is autonomous.
- Stripe account + config (carried over from sdc-sdapp-full-levpro-port, 2026-08-30 — moved here since this is the task that owns “what’s blocking go-live”, not the dev task that built the feature) — create the Stripe account, set
STRIPE_SECRET_KEY/STRIPE_PRICE_ID/STRIPE_WEBHOOK_SECRET. Gates the paid leveraged-investing screens (Checkout subscription, entitlement store, webhook already built and tested —sd-api’slicensing.py). Talbot-only (account creation); nothing else needed from this side. - Lighthouse performance + accessibility pass on the production build — the post-deploy quality gate.
- One debt-first mini-app — the Better Rates / debt-vs-invest snapshot. Better Rates is the zero/negative-risk entry strategy that applies to everyone with any debt, so it is the right first tool: it demonstrates value without requiring the user to accept leverage risk. Reuse the established iframe embed pattern.
- Template reorder (Talbot, 2026-08-27): in
sites/template, move SDC components to the top and MBR components onto a separate page or route — SDC is primary, MBR is a subset. - Update
apps/sd-app/STATUS.mdand the monorepo rootSTATUS.md/CHANGELOG.md.
Success Criteria
Section titled “Success Criteria”sd-appis live on Cloudflare Pages with working i18n routes, verified by loading them — not by a successful build.- Lighthouse run on the deployed build, scores recorded in the task file.
- The debt-first mini-app is reachable, produces correct numbers (cross-checked against
sd-math), and embeds via the existing iframe pattern. sites/templateleads with SDC; MBR components are on their own route.
- PWA — Progressive Web App: a website installable to the desktop or home screen, working offline, with no app-store distribution.
- i18n — internationalization; here the CA/US × en/fr route matrix.
- Paraglide — the compile-step i18n library the app uses; messages live in
packages/i18n/messages/.
Claude Response — 2026-08-29
Section titled “Claude Response — 2026-08-29”Summary:
- Better Rates mini-app shipped — the zero/negative-risk entry strategy from
SDC/Strategy/Better-Rates-Strategy.md, at L0/L1 perDesign-Apps.md(one input: debt-type profile — Mortgage/HELOC/Personal Loan). Math generated by a newpackages/sd-math/tools/generate_snapshot_better_rates.py(reusessd_math.strategies.term_loan._pmt, the same annuity formula sd_math uses internally); the TS calculator is cross-checked against it inbetterRates.test.ts— exact match, 3/3 passing. Featured first on the sd-app homepage. - CF Pages deploy config written —
apps/sd-app/wrangler.toml, output dir confirmed asbuildby actually running the build (not copied from another site’sdist, which would have been wrong). - Template reorder done —
sites/template/src/pages/brands.astronow leads with SmartDebt; myBetterRates split out to its ownsites/template/src/pages/brands/mbr.astro.branding.spec.ts(25 Playwright tests) still passes. - STATUS/CHANGELOG reconciled —
apps/sd-app/STATUS.md, rootSTATUS.md, rootCHANGELOG.md. - Committed — monorepo
6d037fb. - Production deploy — not done. Blocked on you creating the CF Pages project (see below).
- Lighthouse audit — not done; the success criterion is explicit that it must run on the deployed build, and a local-preview attempt failed on a WSL↔Windows Chrome launch issue (
ECONNREFUSED) not worth chasing since it’s not the real gate anyway.
Discovered, not assumed — the app’s i18n was never actually CA/US×en/fr. Every route’s entries() returns CA only; no *-us.json snapshot, no US i18n strings, no us/ calculator folder exist anywhere in the app. The prior STATUS.md (2026-07-10) claimed this was done — it wasn’t. I did not silently build US support (real scope: US tax profiles, snapshot generation, translations) — documented it as open, separate work instead.
Next Steps for Talbot:
- Create the Cloudflare Pages project — name
sd-app, connect to this repo, build commandpnpm --filter @smart-debt/sd-app build, build output directoryapps/sd-app/build, root directoryapps/sd-app(or repo root with the filter — whichever your CF Pages setup already uses for the other sites).wrangler.tomlis already in the folder with the right output dir. * - After deploy: I’ll run the Lighthouse audit and verify CA×en/fr routes live — say the word once the CF Pages project exists and I’ll pick this back up same session or next. *
- Decide: is US-market support in scope now or later? Real work (sd_math already has full US tax logic; sd-app has none) — not something to add as a drive-by inside this task. *
- Better Rates claim wording → SDC/Risks review — per
SDC/IT/JOB_DESCRIPTION.md’s escalation rule (anything that changes what a mini-app claims about financial outcomes). The current copy is deliberately conservative (“Illustrative only… Actual savings depend on the rate you’re offered”) but hasn’t had a Risks pass. *
Claude Response — 2026-09-01 (inherited from the LevPro port)
Section titled “Claude Response — 2026-09-01 (inherited from the LevPro port)”sdc-sdapp-full-levpro-port is closing with all four workstreams shipped. Four open items from it gate production release, so they move here rather than dying with that task — this task owns go-live, and those tasks are now status: complete with nowhere to carry an unanswered question.
Inherited — decisions/reviews, no code work:
-
SDC/Risksreview of W1’s Advanced tax override — advisor-editable tax rates feed client-facing projections, which is exactlySDC/IT/JOB_DESCRIPTION.md’s escalation rule. Built and tested, but not shippable to production until this pass happens. Recorded inapps/sd-app/docs/adr/0001-taxation-parameter-model.md. * - Confirm ADR-0005 (asked 2026-08-31, never answered) — under Stripe there is no license code and no fixed expiry, so the Account screen surfaces subscription status + company name and drops “License Code” / “Licensed Until”. This was an agent decision made to keep the workstream unblocked; overrule if you want a visible expiry surface. *
- Confirm ADR-0002’s reading of D2 (asked 2026-08-31, never answered) — “all provinces treated same except QC” was implemented as deductibility flags differ only for Quebec; the marginal tax rate stays user-entered, as LevPro did. No per-province tax-rate table was shipped — that would mean asserting tax data with no authoritative source. If you meant real per-province rates, W2 needs re-scoping and a rate source. *
-
frmPrintOptions.frmis a radio group, not four checkboxes — the VB6 source implements signatures / legal disclaimer / conservative-leverage-checklist as mutually exclusive. Built per your D4 (independent, all visible), which also matchesSample Printout.pdfshowing the disclaimer and signature grid together — something a strict radio group cannot produce. Confirm, or it becomes a radio group. *
Talbot Response
Section titled “Talbot Response”- Task/project continuation feedback, issues
- This project surfaced issues with respect to clearly defining the route/workflow forward to completion. Many skills were updated to address identified issues.
- The final result was a much more effective “Path to Completion” section following “Next Steps for Talbot” in the task note, including brief sections for: Review it, now, ‘then, in order’, blocked on you, done when. This can be reviewed at the end of the original task note that I copied to
c:\tmp\dev\sdc-sdapp-full-levpro-port.md, before doing a /task-complete, as instructed. (This was to protect against the possibility that something important like this could get dropped.) - This is the first live test of the handoff to the next task. Your instructions to me were to close the first task, and start the next one. This screenshot
c:\tmp\dev\sdc-sdapp-full-levpro-port.mdshows how the continuation instruction probably should have been a /task-continue, instead of a /task-start. If so, correct the needed skills. - Secondly, note that the “Path to completion” section did not survive the transfer to the next task file (this one in this case). It should. Again, correct the needed skills.
- “Path to completion” upgrades
- The original full-levpro-port task spun out several subtasks, Some of which could be carried out in parallel independently. I found them in the task list. See this screenshot that just includes tasks related to sdapp. C:\tmp\ScreenShots\Obsidian_eko0yD885S.png.
- Clearly, the “Path to completion” should also identify ALL of the related tasks yet to be completed, not just the next/current one. More helpfully, those that could be started without prerequisites should be identified as such, so they could be started ASAP if desired.
- Also, should there not be some reference to the project’s ROADMAP.md and/or STATUS.md files? And indicate what the SSOT is for project oversight?
- Based on the importance of improving this workflow correctly, I have again switched the model back to Opus. Please fix these issues and leave me with a very clear understanding of where this project is, and the (clear, efficient) route forward.
Claude Response — 2026-09-01
Section titled “Claude Response — 2026-09-01”Summary
Section titled “Summary”All four workflow defects fixed at the skill level, shipped as SMTM v5.8 (ai-config 049dc68, deployed to WSL + Windows Claude Code, Cursor, AntiGravity). Your four points, in your order:
-
/task-startvs/task-continuein the hand-off — fixed, and it is now a check, not a judgement call./task-completeStep 4c runsgrep -c '^## Claude Response' <successor>: zero →/task-start, one or more →/task-continue. You were right — this file already had two rounds, and/task-start’s own NEVER rule would have refused it, so the instruction handed you a dead command. The stub case (a successor created during the close) is the one that legitimately stays/task-start. - Path to Completion now survives the transfer. Step 4c writes an
## Inherited from <parent>section into the successor carrying the open items and the parent’s Path to Completion, rebased —Then, in order/Blocked on you/Done when/Project SSOTcarry forward,Nowgets rewritten to the successor’s own next command. Copying it verbatim would have written a block whoseNowwas the/task-completethat just ran: stale on arrival. The other half matters as much —/task-continueStep 4 now reads an inherited block and continues from it, so it can’t become a tombstone nobody consumes. - All related tasks, with the parallel ones flagged. New Related open tasks block, derived mechanically rather than recalled: glob the Tasks folders, drop
status: complete, match onproject:/subproject:or filename prefix (prefix matters —sdc-risks-us-compliance-researchcarries neither field but is plainly in the thread), then bucket byprerequisites:—noneor all-prerequisites-complete → startable now, with its command. Capped at ~5, and placed belowThen, in orderon purpose: it is an inventory of parallel work, never a menu, becauseNowhas to stay exactly one command. - ROADMAP/STATUS + oversight SSOT — yes, there should be, and now there is. New Project SSOT block: links
STATUS.md(where we are) andROADMAP.md(what’s left) and names the single authoritative file. Rule attached: link only files youls-verified — a dead link is the same stale-guide failure theReview it:rules exist to prevent.
Also fixed, found while doing the above:
- Schema was duplicated in five skills; two copies had already gone stale the same day the schema changed.
task-start.mdandproject-continue.mdnow carry a pointer + block list; the schema body is SSOT in/task-continueStep 6b./audit-skillsStep 5b gainsSSOT=andRelated=columns so the next drift is caught mechanically, not by eye. -
SMTM_System.mdhad no definition of the Path to Completion block at all — it lived entirely inside five skill files, so there was nothing system-level to audit against. Documented as v5.8 (bumped from the changelog tail, not the header stamp). -
apps/sd-app/ROADMAP.mdpointed at the closed parent task as its KB thread. Repointed at this file and given an explicit oversight-SSOT line (monorepo3c85048). -
_active.mdcleaned — W1–W4 were listed as active/ready while their files readstatus: complete; the closed parent’s entry already covers them. - Frontmatter
model:→opusto match how you’re running this thread.
Where this project actually is: every line of dev scope is shipped and green. apps/sd-app/ROADMAP.md W1–W4 all ✅, W5 (help content) deferred by your D5, W6 is go-live and W6 is this task. Nothing is waiting on code. It is waiting on two accounts and five decisions, all listed below.
Next Steps for Talbot
Section titled “Next Steps for Talbot”- Create the Cloudflare Pages project — nothing about deploy proceeds without it. Name
sd-app, build commandpnpm --filter @smart-debt/sd-app build, output directoryapps/sd-app/build.wrangler.tomlis already committed in that folder. https://dash.cloudflare.com/ * - Create the Stripe account + set the three keys (
STRIPE_SECRET_KEY,STRIPE_PRICE_ID,STRIPE_WEBHOOK_SECRET) — gates every paid leveraged-investing screen. Checkout, entitlement store and webhook are built and tested insd-api’slicensing.py. https://dashboard.stripe.com/register * -
SDC/Risksreview of W1’s Advanced tax override — this one gates production, it is not polish. Advisor-editable tax rates feed client-facing projections. Recorded inapps/sd-app/docs/adr/0001-taxation-parameter-model.md(WSL/home/ta/projects/monorepo/apps/sd-app/docs/adr/0001-taxation-parameter-model.md). * - Confirm ADR-0005 (asked 2026-08-31, still open) — under Stripe there is no license code and no fixed expiry, so the Account screen shows subscription status + company name and drops “License Code” / “Licensed Until”. Overrule if you want a visible expiry surface. *
- Confirm ADR-0002’s reading of D2 (asked 2026-08-31, still open) — “all provinces treated same except QC” shipped as deductibility flags differ only for Quebec; marginal tax rate stays user-entered, as LevPro did. No per-province rate table was shipped (no authoritative source). If you meant real per-province rates, W2 needs re-scoping and a rate source. *
- Confirm the Print Options panel stays four independent checkboxes —
frmPrintOptions.frmimplements them as a mutually-exclusive radio group, but your D4 said independent, andSample Printout.pdfshows the disclaimer and the signature grid together, which a radio group cannot produce. Confirm, or it becomes a radio group. * - Better Rates claim wording →
SDC/Risksreview — copy is deliberately conservative (“Illustrative only… Actual savings depend on the rate you’re offered”) but has never had a Risks pass, andSDC/IT/JOB_DESCRIPTION.mdescalates anything that changes what a mini-app claims about financial outcomes. * - Decide: US-market support — now or later? Real scope (US tax profiles exist in
sd_math; the app surface is CA-only, and always was despite the old STATUS.md claim). Currently recorded as out-of-scope inapps/sd-app/ROADMAP.md. *
Path to Completion
Section titled “Path to Completion”Review it: SMTM_System.md → The Path to Completion Block — v5.8 — the schema table, the three rules, and why the hand-off broke. The app itself is unchanged this round; for the app, Review-LevPro.md is still current from 2026-09-01.
Project SSOT: apps/sd-app/STATUS.md — where we are · apps/sd-app/ROADMAP.md — what’s left, W1–W4 ✅ / W5 deferred / W6 = this task · oversight SSOT: apps/sd-app/ROADMAP.md (this task note carries the conversation only).
Now: /task-continue /mnt/d/FSS/KB/SDC/IT/Tasks/sdc-sdapp-deploy-miniapp.md
Run it once you’ve answered the checkboxes above — the five decisions are all that stand between “built” and “shippable”. Create the Cloudflare Pages project first if you can; then this same command deploys and verifies in one pass.
Then, in order:
/task-continue /mnt/d/FSS/KB/SDC/IT/Tasks/sdc-sdapp-deploy-miniapp.md— after CF Pages exists: I deploy, verify the CA×en/fr routes by loading them, run Lighthouse on the deployed build, record the scores here./task-complete /mnt/d/FSS/KB/SDC/IT/Tasks/sdc-sdapp-deploy-miniapp.md— closes W6 and, with it, the LevPro port thread.
Related open tasks (parallel work, not choices):
sdc-sdapp-pdf-reports— startable now (its prerequisite closed 2026-09-01), and its own note says nothing scoped remains → likely a close, not a work session:/task-continue /mnt/d/FSS/KB/SDC/IT/Tasks/sdc-sdapp-pdf-reports.mdsdc-risks-us-compliance-research— startable now, no prerequisites,model: opus— feeds the US-scope decision above:/task-start /mnt/d/FSS/KB/SDC/Risks/Tasks/sdc-risks-us-compliance-research.mdsdc-behavioural-solutions-debt— startable now, its prerequisite (sdc-dept-scaffold-mbr-absorb) completed 2026-08-28:/task-start /mnt/d/FSS/KB/SDC/Strategy/Tasks/sdc-behavioural-solutions-debt.mdsdc-strategy-duplicate-pairs-reconcile— startable now, but assigned to you, not me (20 merge decisions)sdc-strategy-filter-focus-brainstorm— startable now, but starts with your Dynalist extraction- None of these gate go-live. Only the two accounts and the Risks review do.
Blocked on you (no command fixes these):
- Cloudflare Pages project — deploy, live-route verification and Lighthouse all wait on it.
- Stripe account + 3 keys — gates the paid screens.
SDC/Risksreview of the Advanced tax override — gates production, not polish.- Four confirmations — ADR-0005, ADR-0002’s D2 reading, Print Options radio-vs-checkboxes, Better Rates claim wording.
Done when: sd-app is live on Cloudflare Pages with the CA×en/fr routes verified by loading them, Lighthouse scores from the deployed build recorded in this file, Stripe keys set, and SDC/Risks has cleared the Advanced tax override.
Talbot Response
Section titled “Talbot Response”(given in chat, 2026-09-01) — “The ‘Next steps for Talbot’, and ‘Path to completion’ sections of this task note are now, finally, clear and efficient. There is some hope that nothing will get left behind, and I have a comprehensive map of what to do, in what order, and where the related artifacts are. Again, because you found issues in the previous workflow audit, review all skills and smtm docs and other related parts of this workflow to double-check that this result will survive the next stage in this project, and the next multiphase project. Good idea??”
Claude Response — 2026-09-01 (round 4 — survival audit)
Section titled “Claude Response — 2026-09-01 (round 4 — survival audit)”Summary
Section titled “Summary”Good idea, and it caught six more defects — every one of which would have silently undone round 3. All fixed and deployed (ai-config 596a053). The pattern is the same each time: the prose was right, the template underneath it was wrong, and agents copy templates.
Would have broken the next multiphase project:
-
/project-start’s NEXT-STEPS template had no Path to Completion at all, and used a1.reply placeholder — matching neither the old dash convention nor the current asterisk one. Every new multiphase project opened with a routeless first round. -
/project-task-complete’s phase-reset template used the corrupting-placeholder — two lines below its own prose forbidding exactly that — and carried no route. This was the worst one: a phase boundary replacesNEXT-STEPS.mdrather than appending to it, and the continuation gate is closure-only, so the route would have died at every phase boundary with nothing to catch it. The reset now carries the block forward rebased (Project SSOT/Blocked on you/Done whensurvive;Nowbecomes the new phase’s first command).
Would have broken the next stage of this project:
-
/task-startnever read## Inherited from. A stub successor created by the continuation gate is opened with/task-start— so round 3’s inheritance fix covered only one of the two doors. Both now read and rebase from it. -
/task-compactdidn’t protect the inherited section. The final round is copied byte-for-byte so its own Path to Completion was already safe, but a top-of-file inherited block is precisely what a summarizer folds into Background. Added to the must-survive list.
Would have re-seeded the corruption everywhere:
-
/task-continue’s own Task File Format example used-and omitted the Path to Completion — inside the file that is the schema SSOT, contradicting its own Step 6b. - The
/audit-skillsdrift check structurally could not see any of this. ItsdashPHcolumn greps for the dash wrapped in backticks, so it only ever matched prose discussing the form — never a bare placeholder line in a fenced template, which is where corruption actually propagates.dashPH=0across all five files was a false clean. NewbadPHcolumn greps bare-/1.lines;project-startadded to the loop (five skills → six). It found all three template defects on its first run.
Documented: SMTM_System.md v5.8 now tabulates the three places the block gets destroyed rather than merely omitted — successor hand-off, phase boundary, compaction — each with its rebase rule, so the next audit has something to check against instead of re-deriving it.
Checked and clean, no change needed: /task-prep (appends and replaces only its own ## Context (Auto-Prepared) section — cannot damage an inherited block), /project-continue, /task-complete, create-review-guide.
Verification: all six deployed skills in ~/.claude/commands/ pass every column — Path Review SSOT Related ≥ 1, dashPH and badPH = 0 — and SMTM_System.md has zero bare placeholders. Checked against the deployed copies, not the source, so this also confirms deploy.sh landed all six.
Next Steps for Talbot
Section titled “Next Steps for Talbot”- Nothing new to decide from this round — the eight checkboxes in round 3 above are still the live list, and still the only thing between “built” and “shipped”. Answer them there.
- Ok
- Optional: run
/audit-skillsyourself in a month — Step 5b now catches this class mechanically, so it shouldn’t need another hand audit.- All /audit-* skills should be auto-scheduled. Agreed?
- Monthly should be fine for now
- All /audit-* skills should be auto-scheduled. Agreed?
Path to Completion
Section titled “Path to Completion”Review it: SMTM_System.md → The Path to Completion Block — v5.8 — the new three-destruction-points table and the survival-audit changelog entry are what changed this round.
Project SSOT: apps/sd-app/STATUS.md — where we are · apps/sd-app/ROADMAP.md — what’s left · oversight SSOT: apps/sd-app/ROADMAP.md. Unchanged: W1–W4 ✅, W5 deferred, W6 = this task.
Now: /task-continue /mnt/d/FSS/KB/SDC/IT/Tasks/sdc-sdapp-deploy-miniapp.md
Run it once you’ve answered round 3’s checkboxes. Create the Cloudflare Pages project first if you can — then this same command deploys and verifies in one pass.
Then, in order:
/task-continue /mnt/d/FSS/KB/SDC/IT/Tasks/sdc-sdapp-deploy-miniapp.md— after CF Pages exists: deploy, verify CA×en/fr by loading the routes, Lighthouse on the deployed build, scores recorded here./task-complete /mnt/d/FSS/KB/SDC/IT/Tasks/sdc-sdapp-deploy-miniapp.md— closes W6 and the LevPro thread. This is also the first live test of the fixed hand-off: it should now offer/task-continueor/task-startcorrectly and carry this block into whatever comes next.
Related open tasks (parallel work, not choices): unchanged from round 3 — sdc-sdapp-pdf-reports (startable now, likely just needs closing), sdc-risks-us-compliance-research (startable now), sdc-behavioural-solutions-debt (startable now), the two sdc-strategy-* tasks (startable now, yours). None gate go-live.
Blocked on you (no command fixes these): unchanged — Cloudflare Pages project · Stripe account + 3 keys · SDC/Risks review of the Advanced tax override (gates production) · four confirmations.
Done when: sd-app is live on Cloudflare Pages with CA×en/fr verified by loading them, Lighthouse scores from the deployed build recorded here, Stripe keys set, and SDC/Risks has cleared the Advanced tax override.
Talbot Response
Section titled “Talbot Response”- Confirm that my response to the “Next steps for Talbot” section items get addressed.