본문으로 건너뛰기
cccskills
무료GitHub에 공개

ns-architecture

Design the technical architecture for a NowStack Mobile app from .agents/plan/PRD.md, mapping the product onto the FIXED boilerplate stack (Convex schema + functions, Expo Router screens, Better Auth, Apple IAP/Stripe, R2), then save .agents/plan/ARCHITECTURE.md. Use for "design the architecture", "ns architecture", "plan the schema and screens", or as the second planning step after ns-prd and before ns-tasks. Not a blank-slate stack design — the stack is set; this maps features onto it.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Stripe
설치 방법 보기

포함된 파일(1)

  • SKILL.md5.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

ns-architecture — Mobile technical architecture

<objective> Turn `.agents/plan/PRD.md` into a concrete technical plan and write **`.agents/plan/ARCHITECTURE.md`**. Second step of the pipeline: PRD → **architecture** → `/ns tasks`.

Critical framing: the stack is already decided (read CLAUDE.md / AGENTS.md). You are NOT choosing a database or a framework — you are designing how the PRD's features map onto Convex + Expo + Better Auth + Apple IAP/Stripe + R2 + TanStack Start. The valuable output is the data model, the Convex function surface, the screens, and the payment/auth/storage wiring — grounded in the real files, not invented. </objective>

<process> ## Phase 1 — Read the PRD and the real codebase 1. Read `.agents/plan/PRD.md` (require it; if missing → run `/ns prd` first). 2. Read the rules so the design respects them: `.agents/rules/convex.md`, `.agents/rules/mobile-app.md`, `.agents/rules/auth-payments-storage.md`, and `convex/_generated/ai/guidelines.md`. 3. Read what already exists so you EXTEND, not duplicate: `convex/schema.ts`, `convex/functions.ts` (the `authQuery`/`authMutation`/`adminQuery`/`adminMutation` builders), the `convex/users|admin|payments|storage/` domains, `mobile-app/app/` route groups (`(app)`, `(auth)`, `(flow)`, `(tabs)`, onboarding, paywall), and `site-config.ts`.

Phase 2 — Design, challenging every decision

For each must-have feature in the PRD, decide:

  • Data model — new Convex tables + the indexes each query needs (.withIndex, pagination — never unbounded .collect()/.filter(); counters for real counts). What hangs off the users row.
  • Function surface — the public/internal Convex queries/mutations/actions, each built with the project builders and derived server-side identity (never a client userId). Name them and state args/returns at a high level.
  • Screens — which Expo Router screens/route groups (mind the group-segment paths, e.g. /(flow)/paywall), what's a tab vs a stack screen, and what the web /app surface shows (if any).
  • Entitlement & gating — what's behind the paywall; record the entitlement on the user level and apply derived grants idempotently (the auth-payments-storage rule: a validated purchase must never fail because a derived grant threw). IAP on iOS, Stripe on Android/web.
  • Storage — any R2 uploads (Convex storage helpers, signed URLs) and where.
  • Auth/admin — which surfaces are signed-in vs admin-only; allowlist in site-config.ts + Convex check.

Phase 3 — Write .agents/plan/ARCHITECTURE.md

Use the template. Keep it real: cite actual paths and builders, include an ADR for each non-obvious choice, and a build-order. Don't restate the whole stack — only the deltas this product adds.

Phase 4 — Next step

Point at /ns tasks to slice this into implementable work, then /ns setup if config values (products, admin emails) changed. </process>

<output_template>

# Technical Architecture: [App Name]

## Overview
[2–3 sentences: how the PRD maps onto the stack. Link .agents/plan/PRD.md.]

## Data Model (Convex)
| Table | Fields (key) | Indexes | Notes |
|---|---|---|---|
| `xyz` | … | `by_user`, … | hangs off users / counters / pagination |
[Reference: extends `convex/schema.ts`. Indexes for every queried field.]

## Convex Function Surface
| Function | Type (builder) | Args → Returns | Auth |
|---|---|---|---|
| `xyz.list` | `authQuery` | … | user-scoped |
| `admin.…` | `adminQuery` | … | admin-only |
[Identity derived server-side. Validators on every arg.]

## Screens (Expo Router)
| Screen | Path (with group) | Type | Notes |
|---|---|---|---|
| … | `/(tabs)/…` / `/(flow)/…` | tab / stack / modal | |
[Web `/app` surface, if any.]

## Payments & Entitlements
- Gated: [features] · iOS: Apple IAP · Android/web: Stripe
- Entitlement recorded on: **user** · derived grants: [idempotent, try/catch]

## Storage / Auth
- R2: [what, where] · Signed-in surfaces: […] · Admin-only: […]

## Architecture Decision Records
### ADR-001: [decision] — context / choice / why / trade-offs
### ADR-002: …

## Build Order
1. **Foundation** — schema + indexes, core Convex functions
2. **Core features** — screens + wiring
3. **Monetization & polish** — paywall, entitlements, analytics

</output_template>

<constraints> - The stack is fixed — Convex only (no Prisma/Supabase/Firebase), Expo Router, Better Auth, IAP/Stripe split, R2. Don't propose alternatives. - Ground every table/function/screen in real paths and the project builders; extend existing domains rather than inventing parallel ones. - Enforce the Convex rules: indexes for queried fields, no unbounded `.collect()`/`.filter()`, counters for counts, validators on args, server-derived identity. - Honor the purchase-safety rule: user-level entitlement first, derived grants idempotent in try/catch. - Require `.agents/plan/PRD.md`. Write to `.agents/plan/ARCHITECTURE.md`. </constraints> <verification> - Every PRD must-have feature has a data model + function + screen mapping. - Indexes named for each query; no scan-the-table patterns; entitlements user-level. - `.agents/plan/ARCHITECTURE.md` written. Next: `/ns tasks`. </verification>

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Melvynx/saveit.now322026년 10월 19일 업데이트

convex

무료

Routes general Convex requests to the right project skill. Use when the user asks which Convex skill to use or gives an underspecified Convex app task.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Melvynx/saveit.now322026년 10월 19일 업데이트

Use when optimizing Convex database read bandwidth, documents-read cost, query indexes, full-table scans, function-level usage dashboard findings, or code that uses .filter(), unbounded .collect(), N+1 reads, or expensive reactive Convex queries.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Melvynx/saveit.now322026년 10월 19일 업데이트

Build reusable Convex components with isolated tables and app-facing wrappers. Use for defineComponent, app.use, ComponentApi, or shared backend modules.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Melvynx/saveit.now322026년 10월 19일 업데이트

Plan safe Convex schema and data migrations. Use for widen-migrate-narrow rollouts, backfills, breaking field changes, table splits, or failed schema deploys.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Melvynx/saveit.now322026년 10월 19일 업데이트

Audit Convex performance for hot reads, write contention, subscriptions, function limits, OCC conflicts, latency, read amplification, and expensive reactive queries.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Melvynx/saveit.now322026년 10월 19일 업데이트

Melvynx의 스킬 모두 보기

이 스킬의 문제 신고