references/api_data_patterns.md
# API and data patterns
## Table of contents
1. [REST conventions](#rest-conventions)
2. [Pagination](#pagination)
3. [Idempotency](#idempotency)
4. [Migrations](#migrations)
## REST conventions
- `GET` safe, `PUT`/`PATCH` idempotent where possible
- Use nouns for resources; avoid verbs in paths
- Return consistent error shape: `{ code, message, details? }`
## Pagination
Prefer cursor-based for large feeds; offset only for admin tools.
## Idempotency
Accept `Idempotency-Key` header on `POST` that creates billable or external side effects.
## Migrations
- Backward-compatible expand → deploy → contract
- Never drop column in same release as code stops reading it
references/debugging_ops.md
# Production debugging
## Table of contents
1. [Triage order](#triage-order)
2. [Common causes](#common-causes)
## Triage order
1. Correlation ID across logs and traces
2. Deploy timeline vs error spike
3. Feature flags and config changes
4. Dependency health (DB, cache, third-party API)
5. Resource saturation (CPU, connections)
## Common causes
| Symptom | Check |
|---|---|
| 502/503 | Upstream timeout, pod restarts |
| Slow queries | Missing index, N+1 |
| Auth errors | Clock skew, expired keys, wrong env |
references/feature_delivery.md
# Feature delivery
## Table of contents
1. [Vertical slice checklist](#vertical-slice-checklist)
2. [PR description template](#pr-description-template)
## Vertical slice checklist
- [ ] Acceptance criteria met
- [ ] API contract documented or OpenAPI updated
- [ ] Authz on all new routes
- [ ] UI states: loading, empty, error
- [ ] Tests for happy path + main failure
- [ ] Feature flag if gradual rollout
- [ ] Rollback steps in PR or release notes
## PR description template
```markdown
## What
## Why
## How to test
## Risks / rollback
## Screenshots (if UI)
```
references/frontend_patterns.md
# Frontend patterns
## Table of contents
1. [Next.js App Router](#nextjs-app-router)
2. [Forms](#forms)
3. [Performance](#performance)
## Next.js App Router
- Fetch on server by default; pass serializable props to client components
- Use `loading.tsx` and `error.tsx` boundaries
- Cache with explicit `revalidate` strategy
## Forms
- Validate on client for UX; always validate on server
- Optimistic UI only when rollback is cheap
## Performance
- Measure LCP, INP; lazy-load below-fold
- Avoid waterfall client fetches; batch where possible
references/testing_quality.md
# Testing and quality
## Table of contents
1. [Test pyramid](#test-pyramid)
2. [What to test](#what-to-test)
3. [Flaky tests](#flaky-tests)
## Test pyramid
| Layer | Scope |
|---|---|
| Unit | Pure logic, validators |
| Integration | API + DB (test container) |
| E2E | Critical user journeys only |
## What to test
- Authz matrix for new endpoints
- Edge cases in validation
- Regression for every production bug fix
## Flaky tests
Quarantine with ticket; fix or delete within 2 sprints—do not retry indefinitely without investigation.
SKILL.md
---
name: senior-fullstack-developer
description: |
Guides senior full-stack delivery across TypeScript/React/Next.js frontends, Node or Python APIs,
relational databases, authentication, testing, performance, and pragmatic system design for product features.
Use when implementing end-to-end features, designing REST/GraphQL contracts, refactoring UI and backend,
debugging production issues in app code, or reviewing PRs for maintainability—not for standard full-stack
IC delivery without senior scope (fullstack-software-engineer), CI/CD platform work (devops), security
program design (cybersecurity), ML modeling (data-scientist), or LLM prompt/agent design (ai-engineer,
prompt-engineer).
---
# Senior Fullstack Developer
## When to Use
- Senior-owned vertical features with higher design bar
- PR review for authz, data layer, and frontend architecture
- Production debugging across app layers with mentorship-level guidance
## When NOT to Use
- Routine full-stack feature work at standard IC bar → `fullstack-software-engineer`
- Cross-team RFCs and service boundaries → `senior-software-engineer`
- Infrastructure or pipelines → `infrastructure-engineer`, `devops`
## Related skills
| Need | Skill |
|---|---|
| General full-stack IC delivery | `fullstack-software-engineer` |
| Pipelines, deploy, SLOs | `devops` |
| SAST, dependency, pipeline security | `devsecops` |
| Requirements and BRDs | `business-analyst` |
| RAG, agents, LLM APIs | `ai-engineer` |
| Docs and API reference publishing | `tech-writer-researcher` |
| RFCs, service design, senior code review | `senior-software-engineer` |
| Front-end-only senior work | `senior-frontend-software-engineer` |
| Web platform security and auth patterns | `web-application-developer` |
## Core Workflows
### 1. Feature delivery (vertical slice)
1. Clarify acceptance criteria and non-goals
2. Sketch API contract + UI states (loading, empty, error)
3. Implement backend with validation and authz checks first
4. Implement UI against contract; use typed client
5. Add tests: unit for logic, integration for API, e2e for critical path
6. Instrument logs/metrics for new endpoints
7. Ship behind flag if risky; document rollout and rollback
**See `references/feature_delivery.md` for slice checklist and PR template.**
### 2. API and data layer design
| Concern | Default |
|---|---|
| Style | REST with OpenAPI or tRPC for TS monoliths |
| Auth | Session or JWT; validate on every mutating route |
| Validation | Schema at boundary (Zod, Pydantic) |
| DB | Migrations versioned; indexes for query paths |
| Errors | Stable error codes; no stack traces to clients |
**See `references/api_data_patterns.md` for pagination, idempotency, and transaction patterns.**
### 3. Frontend architecture
- Prefer server components where data is read-heavy (Next.js App Router)
- Colocate state: server for fetch, client only for interaction
- Accessible components (labels, focus, contrast)
- Avoid premature abstraction; extract after second use
**See `references/frontend_patterns.md` for forms, caching, and performance.**
### 4. Quality and review
**PR review focus:** correctness, authz, input validation, N+1 queries, error paths, test coverage on changed lines.
**Before merge:** lint, typecheck, tests green; no secrets; migration plan if schema changed.
**See `references/testing_quality.md` for test pyramid and flaky test handling.**
### 5. Production debugging
1. Reproduce with correlation ID
2. Check recent deploys and feature flags
3. Trace logs → metrics → DB slow queries
4. Fix forward or rollback; add regression test
**See `references/debugging_ops.md` for common failure modes.**
## When to load references
- **End-to-end feature flow** → `references/feature_delivery.md`
- **APIs and databases** → `references/api_data_patterns.md`
- **React/Next UI** → `references/frontend_patterns.md`
- **Testing and review** → `references/testing_quality.md`
- **Prod debugging** → `references/debugging_ops.md`