# 2298 Prompt Engineering Fundamentals B2c4c8cf

> Prompt Engineering Fundamentals

- Skill: `tools-only/2298-prompt-engineering-fundamentals-b2c4c8cf` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/2298-prompt-engineering-fundamentals-b2c4c8cf`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/2298-prompt-engineering-fundamentals-b2c4c8cf/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/tools-only/2298-prompt-engineering-fundamentals-b2c4c8cf

---

# Prompt Engineering Fundamentals

## Prompt Engineering Fundamentals

### Effective Prompt Structure
```
[CONTEXT] What you're working on
[TASK] What you want to accomplish
[CONSTRAINTS] Requirements and limitations
[FORMAT] How you want the output
[EXAMPLES] Reference patterns if needed
```

### Example Well-Structured Prompt
```
CONTEXT: Working on a Next.js 14 e-commerce app with TypeScript

TASK: Create a shopping cart hook that:
- Manages cart items in localStorage
- Syncs with server when user logs in
- Handles quantity updates
- Calculates totals with tax

CONSTRAINTS:
- Use Zustand for state management
- Follow existing patterns in @hooks/useAuth.ts
- Handle offline scenarios gracefully
- TypeScript strict mode

FORMAT:
- Single useCart.ts file
- Export named hook and types
- Include JSDoc comments
```
