Pocket Coach · CTO plan · 2026-05-10

AI-Native SDLC + GitHub Actions CI/CD

A safe delivery system for Pocket Coach: agents can move faster, but prod stays protected. This is a planning artifact only; no repo, GitHub, Supabase, EAS, secrets, or production systems were changed.

Gate: PASS WITH WARNINGS Dev/test first Prod approval required No app-side coaching logic

CTO conclusion

Pocket Coach is ready for an AI-native delivery system, but not for autonomous production deployment. Implement CI and PR governance first, then dev/test deployment, then production deployment behind GitHub Environments with Jack as required reviewer.
First move
Add PR checks, templates, secret scan, boundary scan, and Supabase static checks.
Second move
Add dev/test deployment using explicit dev Supabase project refs only.
Last move
Add production workflow only after Jack approves environments, secrets, and gates.

Evidence reviewed

Target AI-native SDLC

Idea / signal intake

Jack, beta feedback, analytics, or bug signal becomes a GitHub Issue with scope, PRD links, acceptance criteria, env/data impact, and approval level.

Spec + implementation plan

Planning agent drafts a technical plan: in/out of scope, files touched, test plan, dev smoke, release, rollback, and open decisions.

Branch + agent implementation

Agents work on feature/*, fix/*, or claude/* branches. No direct push to main; no deploy from implementation agents.

Pull request

PR template requires linked issue, risk flags, tests run, migration/function/env/EAS impact, AI-boundary statement, dev smoke plan, and rollback notes.

CI + AI review

Typecheck, lint, Jest, secret scan, coaching-boundary scan, Supabase static checks, and advisory AI review summary.

Dev/test deploy

After merge or manual dispatch, migrations/functions deploy only to dev Supabase using explicit project refs. Optional EAS preview build.

Release candidate

Generate RC evidence pack: commits, PRs, migration/function/env impact, QA report, dev smoke evidence, rollback plan, production command preview.

Production deploy

Manual workflow dispatch, GitHub Environment production, Jack required reviewer, explicit prod project refs, post-release monitoring.

GitHub Actions architecture

WorkflowTriggerPurposeDeploys?
PR QualityPull requestInstall, typecheck, lint, JestNo
Security Static ChecksPull requestGitleaks + sensitive file diff checksNo
Coaching BoundaryPull requestFlag app-side coaching intelligenceNo
Supabase Static ChecksPR paths: supabase/**Migration naming, RLS evidence, function auth/env scanNo
AI Review SummaryPull requestAdvisory risk and review focusNo
Deploy Dev/TestManual / approved mergeDev migrations/functions/EAS previewDev only
Create RCManualEvidence pack and approval artifactNo
Deploy ProductionManualProd migrations/functions/EAS buildYes, approved only

Example PR quality workflow

name: PR Quality
on:
  pull_request:
    branches: [main]
jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm
      - run: npm ci
      - run: npm run typecheck
      - run: npm run lint
      - run: npm test -- --runInBand

Example dev deploy guard

environment: development
env:
  SUPABASE_PROJECT_REF: ${{ secrets.SUPABASE_DEV_PROJECT_REF }}
run: |
  supabase db push --project-ref "$SUPABASE_PROJECT_REF"
  supabase functions deploy --project-ref "$SUPABASE_PROJECT_REF"

Supabase, EAS, and env handling

Supabase

  • Every command uses explicit --project-ref.
  • Dev migrations/functions before prod.
  • RLS evidence required for schema changes.
  • Function auth, env, and sensitive logs reviewed.
  • Secrets set per Supabase project, not in repo.

Expo / EAS

  • app.config.ts already splits dev/prod identity.
  • eas.json sets dev vs prod APP_ENV.
  • Production builds require approval and build number bump.
  • Keep TestFlight submit manual initially.
  • Review hardcoded EAS Updates URL before using OTA.
Do not store AI provider keys, OAuth secrets, Supabase service role keys, App Store Connect keys, or beta user data in repo, PR text, workflow logs, or AI review payloads.

AI agent roles and guardrails

RoleModel recommendationPermission
Spec / Product IntakeGPT-5.5 or Claude SonnetDraft issues/specs; approval before risky scope
Planning ArchitectGPT-5.5 high reasoningRead-only plan by default
Implementation AgentClaude Sonnet / GPT-5.5Branch writes only; no deploy
Database / Edge EngineerGPT-5.5 / SonnetBranch writes only; migration/function evidence required
QA ReviewerFast model + escalationRead-only audit
Release ManagerSonnet / GPT-5.5No prod without Jack approval

The central guardrail: agents may help the app assemble context, stream AI responses, execute tool calls, and display AI-returned data. They must not add app-side readiness scoring, training analysis, nutrition interpretation, recommendations, or coaching logic.

Developer-ready implementation backlog

Phase 0 · Governance

PR template, issue templates, branch protection, environments, required reviewers.

Phase 1 · PR CI

Typecheck, lint, Jest, Node/package manager pinning, artifacts.

Phase 2 · Security + boundary

Gitleaks, sensitive diff, coaching-boundary scan, tuned from advisory to blocking.

Phase 3 · Supabase checks

Migration naming, RLS evidence, Edge Function auth/env checks.

Phase 4 · AI review

Advisory PR summary with privacy-safe diff bundle.

Phase 5 · Dev deploy

Manual dev migrations/functions/EAS preview with explicit dev refs.

Phase 6 · RC

Evidence pack, QA report, rollback plan, production command preview.

Phase 7 · Production

Manual approved prod workflow; TestFlight submit later.

Acceptance criteria and approval gates

PR acceptance

Dev/test acceptance

Production acceptance

Rollback strategy

Change typeRollback
App-onlyRebuild previous known-good commit or ship hotfix with incremented build number.
Edge FunctionRedeploy previous function version from known-good commit; monitor errors and sync logs.
Migration/schemaPrefer forward-only rollback migration; avoid destructive changes; require backup for risky ops.
Secret/envRestore from approved secret store; verify values are not exposed in logs.
OAuthRestore provider console settings from baseline; smoke both prod and dev app schemes.
EAS/TestFlightStop rollout/remove build if possible; hotfix from known-good commit.

Recommended first PR

Start with governance and CI only. Do not include Supabase deploy, EAS build, or production workflow in the first PR.