Builds security-focused full-stack web applications by implementing integrated frontend and backend components with layered security at every level. Covers the complete stack from database to UI, enforcing auth, input validation, output encoding, and parameterized queries across all layers. Use when implementing features across frontend and backend, building REST APIs with corresponding UI, connecting frontend components to backend endpoints, creating end-to-end data flows from database to UI, o
git clone https://github.com/Jeffallan/claude-skills.git--- name: fullstack-guardian description: Builds security-focused full-stack web applications by implementing integrated frontend and backend components with layered security at every level. Covers the complete stack from database to UI, enforcing auth, input validation, output encoding, and parameterized queries across all layers. Use when implementing features across frontend and backend, building REST APIs with corresponding UI, connecting frontend components to backend endpoints, creating end-to-end data flows from database to UI, or implementing CRUD operations with UI forms. Distinct from frontend-only, backend-only, or API-only skills in that it simultaneously addresses all three perspectives—Frontend, Backend, and Security—within a single implementation workflow. Invoke for full-stack feature work, web app development, authenticated API routes with views, microservices, real-time features, monorepo architecture, or technology selection decisions. license: MIT metadata: author: https://github.com/Jeffallan version: "1.1.1" domain: security triggers: fullstack, implement feature, build feature, create API, frontend and backend, full stack, new feature, implement, microservices, websocket, real-time, deployment pipeline, monorepo, architecture decision, technology selection, end-to-end role: expert scope: implementation output-format: code related-skills: feature-forge, test-master, devops-engineer, secure-code-guardian, architecture-designer, react-expert, typescript-pro --- # Fullstack Guardian Security-focused full-stack developer implementing features across the entire application stack. ## Core Workflow 1. **Gather requirements** - Understand feature scope and acceptance criteria 2. **Design solution** - Consider all three perspectives (Frontend/Backend/Security) 3. **Write technical design** - Document approach in `specs/{feature}_design.md` 4. **Security checkpoint** - Run through `references/security-checklist.md` before writing any code; confirm auth, authz, validation, and output encoding are addressed 5. **Implement** - Build incrementally, testing each component as you go 6. **Hand off** - Pass to Test Master for QA, DevOps for deployment ## Reference Guide Load detailed guidance based on context: | Topic | Reference | Load When | |-------|-----------|-----------| | Design Template | `references/design-template.md` | Starting feature, three-perspective design | | Security Checklist | `references/security-checklist.md` | Every feature - auth, authz, validation | | Error Handling | `references/error-handling.md` | Implementing error flows | | Common Patterns | `references/common-patterns.md` | CRUD, forms, API flows | | Backend Patterns | `references/backend-patterns.md` | Microservices, queues, observability, Docker | | Frontend Patterns | `references/frontend-patterns.md` | Real-time, optimization, accessibility, testing | | Integration Patterns | `references/integration-patterns.md` | Type sharing, deployment, architecture decisions | | API Design | `references/api-design-standards.md` | REST/GraphQL APIs, versioning, CORS, validation | | Architecture Decisions | `references/architecture-decisions.md` | Tech selection, monolith vs microservices | | Deliverables Checklist | `references/deliverables-checklist.md` | Completing features, preparing handoff | ## Constraints ### MUST DO - Address all three perspectives (Frontend, Backend, Security) - Validate input on both client and server - Use parameterized queries (prevent SQL injection) - Sanitize output (prevent XSS) - Implement proper error handling at every layer - Log security-relevant events - Write the implementation plan before coding - Test each component as you build ### MUST NOT DO - Skip security considerations - Trust client-side validation alone - Expose sensitive data in API responses - Hardcode credentials or secrets - Implement features without acceptance criteria - Skip error handling for "happy path only" ## Three-Perspective Example A minimal authenticated endpoint illustrating all three layers: **[Backend]** — Authenticated route with parameterized query and scoped response: ```python @router.get("/users/{user_id}/profile", dependencies=[Depends(require_auth)]) async def get_profile(user_id: int, current_user: User = Depends(get_current_user)): if current_user.id != user_id: raise HTTPException(status_code=403, detail="Forbidden") # Parameterized query — no raw string interpolation row = await db.fetchone("SELECT id, name, email FROM users WHERE id = ?", (user_id,)) if not row: raise HTTPException(status_code=404, detail="Not found") return ProfileResponse(**row) # explicit schema — no password/token leakage ``` **[Frontend]** — Component calls the endpoint and handles errors gracefully: ```typescript async function fetchProfile(userId: number): Promise<Profile> { const res = await apiFetch(`/users/${userId}/profile`); // apiFetch attaches auth header if (!res.ok) throw new Error(await res.text()); return res.json(); } // Client-side input guard (never the only guard) if (!Number.isInteger(userId) || userId <= 0) throw new Error("Invalid user ID"); ``` **[Security]** - Auth enforced server-side via `require_auth` dependency; client header is a convenience, not the gate. - Response schema (`ProfileResponse`) explicitly excludes sensitive fields. - 403 returned before any DB access when IDs don't match — no timing leak via 404. ## Output Templates When implementing features, provide: 1. Technical design document (if non-trivial) 2. Backend code (models, schemas, endpoints) 3. Frontend code (components, hooks, API calls) 4. Brief security notes [Documentation](https://jeffallan.github.io/claude-skills/skills/security/fullstack-guardian/)
1. **Define Your Requirements**: Replace [APPLICATION_NAME] and [USER_DATA_TYPE] in the prompt with your specific use case (e.g., 'e-commerce platform' and 'payment information'). 2. **Select Your Tech Stack**: Modify the stack components (React, Node.js, PostgreSQL) to match your team's expertise. For example, swap React for Vue.js or Node.js for Python/Django. 3. **Customize Security Policies**: Adjust the security requirements based on your threat model. For healthcare apps, emphasize HIPAA compliance; for financial apps, focus on PCI DSS requirements. 4. **Implement Layer by Layer**: - Start with database security (RLS policies, encryption) - Build backend with auth, validation, and rate limiting - Develop frontend with input/output sanitization - Add security headers and testing last 5. **Validate and Test**: - Use tools like OWASP ZAP, Trivy, and Snyk for scanning - Implement unit tests for validation logic - Run end-to-end tests with tools like Playwright Tip: For enterprise applications, consider adding a secrets management system (HashiCorp Vault) and infrastructure-as-code (Terraform) for consistent deployments.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/Jeffallan/claude-skills/tree/main/skills/fullstack-guardianCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Build a secure full-stack web application for [APPLICATION_NAME] that handles [USER_DATA_TYPE] with the following requirements: 1) Implement JWT-based authentication with refresh tokens stored in HTTP-only cookies, 2) Create a React frontend with form validation and CSRF protection, 3) Design a Node.js/Express backend with rate limiting, CORS restrictions, and parameterized queries for all database interactions, 4) Use PostgreSQL with row-level security policies, 5) Add security headers (CSP, HSTS) and input/output sanitization throughout. Include unit and integration tests for security vulnerabilities. Deploy using Docker with non-root containers.
## Secure Full-Stack Application: Medical Records Portal
**Frontend (React with TypeScript):**
- Implemented a dashboard with patient record management using Material-UI components
- Added form validation with Zod schemas for all input fields (e.g., SSN validation regex: `/^\d{3}-\d{2}-\d{4}$/`)
- Integrated Axios with CSRF tokens from backend meta tags
- Enforced strict Content Security Policy via meta tag: `default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net`
- All API calls include Authorization header with JWT from secure cookie storage
**Backend (Node.js/Express):**
- Authentication flow with JWT (access token: 15min expiry, refresh token: 7d expiry stored in HTTP-only cookie)
- Rate limiting: 100 requests/minute per IP with sliding window algorithm
- All database queries use parameterized statements (e.g., `SELECT * FROM patients WHERE id = $1`)
- Implemented Helmet middleware with custom CSP, HSTS (max-age=31536000), and XSS protection
- Added request validation middleware using express-validator for all endpoints
**Database (PostgreSQL 15):**
- Row-level security policies: `CREATE POLICY patient_access_policy ON patients USING (provider_id = current_setting('app.current_user_id')::int)`
- All tables have audit triggers logging changes with `pgAudit`
- Implemented connection pooling with `pgBouncer` (max 20 connections)
- Sensitive columns encrypted at rest using `pgcrypto` with AES-256-GCM
**Security Testing:**
- OWASP ZAP baseline scan passed with 0 high/critical vulnerabilities
- Added Jest tests for input validation (e.g., testing SQL injection attempts return 400)
- Implemented end-to-end tests with Cypress for authentication flows
**Deployment:**
- Dockerized with multi-stage builds (frontend built in stage 1, served by Nginx in stage 2)
- Non-root user (UID 1000) running containers
- Secrets managed via Kubernetes secrets (in production) or .env files (development)
- All images scanned with Trivy before deployment
**Sample API Flow:**
1. User logs in via `/auth/login` with username/password
2. Backend validates credentials, sets refresh token cookie, returns access token
3. Frontend stores access token in memory (not localStorage)
4. Subsequent requests include token in Authorization header
5. Backend validates token, checks RLS policies, returns sanitized data
6. Frontend renders data with DOMPurify on all user-generated content
The application passed a third-party security audit with no critical findings and achieved SOC 2 Type II compliance for data handling.skills-collection
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan