This document defines the team workflow for planning, building, testing, and deploying changes in this repository. It complements (does not replace) PLANS.md, which governs ExecPlans for agent-driven work.
- Planning for larger changes:
PLANS.md(ExecPlan rules and structure). - Commands and tooling:
CLAUDE.md. - Quality bar and release guidance:
docs/workflow/. - Testing guides:
docs/testing/anddocs/qa/. - Skills playbooks:
docs/skills/. - Setup and environment:
docs/setup/.
If a detail is missing here but exists elsewhere, add a short pointer here so the workflow stays discoverable.
Use an ExecPlan when any of the following are true:
- The change is user-facing or changes behavior.
- The change touches multiple modules/services or requires schema changes.
- The work has unclear requirements, dependencies, or rollout risk.
- The work needs coordinated testing or deployment steps.
Small, contained fixes can proceed without an ExecPlan, but should still state scope and acceptance in the PR description.
For ExecPlan work, follow PLANS.md exactly. For smaller changes, define:
- Goal: what the user can do after the change.
- Acceptance: how to verify it (commands and expected outputs).
- Tests: the minimum set to run.
Before opening a PR, agents should:
- Attach an ExecPlan link for non-trivial changes.
- Run local quality gates:
npm run lint,npm run test:core,npm run test:diff-coverage,npm run build. - Run
npm run test:e2ewhen user flows or UI behavior are touched. - Provide a test plan and risk level in the PR template.
- List milestone commits in the PR when an ExecPlan is used.
- Ensure local githooks are installed (auto via
postinstallor runnpm run install:githooks). Pushing tomainrunsnpm run preflightand prompts for a manual override;ALLOW_MAIN_PUSH=1can be used for non-interactive automation.
- Branch from
main. - Keep PRs focused and scoped.
- PR title format:
[narrata] <Title>(per repo instructions).
Branch naming: keep it semantic and concise (e.g., fix-upload-timeout, feat-gap-summary, chore-build-warnings).
Review policy: first pass is an agent review; use Playwright MCP for UI verification when relevant. After agent confirmation, human approval is required before merge.
For main, configure a branch protection rule with:
- Require a pull request before merging.
- Require at least 1 approval (human approval).
- Require status checks to pass:
CIworkflow (or theCI / qualityjob).
- Require branches to be up to date before merging.
Use the commands in CLAUDE.md as the default toolchain:
- Install:
npm install - Dev server:
npm run dev(http://localhost:8080) - Lint:
npm run lint - Unit tests:
npm testornpm test -- path/to/test.test.tsx - Unit tests (CI + coverage):
npm run test:ci - Unit tests (core + coverage gate):
npm run test:core - Diff coverage (core changes):
npm run test:diff-coverage - UI tests:
npm run test:ui - Build:
npm run build - Preview:
npm run preview
Suggested minimums:
- Code changes: run targeted tests for the area you touched.
- Structural changes (imports/moves): run
npm run lint. - User-facing changes: run
npm run buildand a manual smoke check. - CI gates:
.github/workflows/ci.ymlruns lint, core unit tests with coverage, diff coverage, and build on PRs andmain. Full unit tests run non-blocking for visibility.
Nightly coverage:
.github/workflows/nightly.ymlruns full unit tests + Playwright E2E on a schedule and uploads artifacts.
- Schema changes go in
supabase/migrations/following existing patterns. - Use Supabase CLI or MCP tools for schema inspection and verification.
- Edge Functions live in
supabase/functions/and must be deployed after code changes.
Define the exact migration/deploy commands and environments here once finalized.
Staging and production deploys use FTP and are automated via GitHub Actions.
Workflow: .github/workflows/deploy.yml
- Staging deploys on push to
mainand can also be triggered manually. - Production deploys are manual via workflow dispatch and should be gated by a GitHub Environment approval.
Required GitHub Secrets:
STAGING_FTP_HOST,STAGING_FTP_USER,STAGING_FTP_PASSPROD_FTP_HOST,PROD_FTP_USER,PROD_FTP_PASS
Notes:
- Both environments deploy to
/(root) in their respective FTP accounts. - If you need server-side backups (
backup-latest/backup-del), add a pre-deploy step usinglftpor switch to tag-based rollback. .htaccessandrobots.txtare expected to be built intodist/on each deploy.- For the marketing site, see
docs/marketing/DEPLOYMENT_GUIDE.md.
Rollback is tag-based: redeploy a prior git tag via the production workflow. No server-side backup rotation is used at this time.
To redeploy a tag:
- Create or identify the tag (e.g.,
v1.2.3). - Example:
git tag v1.2.3 && git push origin v1.2.3 - Run the
Deploy (FTP)workflow manually. - Select
productionand setrefto the tag (e.g.,v1.2.3).
At minimum:
- Run a smoke test on the main user flows you changed.
- Verify any backend jobs or Edge Functions you touched.
- Check logs/monitoring for errors.
Specify exact checks and URLs once the deployment workflow is defined.
- What is the staging environment URL and access flow?
Fill these in as decisions are made so the workflow remains actionable.