Claude Code/Codex Beginners के लिए 5 Practical Prompt Patterns
Claude Code/Codex beginners के लिए scope, repo context, acceptance criteria, verification और handoff prompt patterns.
पहले यह समझें: अच्छा prompt एक clear work brief है
जब Claude Code या Codex messy output देता है, तो वजह अक्सर यह नहीं होती कि agent code नहीं लिख सकता। असली समस्या यह होती है कि prompt ने काम की boundaries साफ नहीं दीं। Prompt कोई magic sentence नहीं है। यह AI coding agent के लिए work brief है: क्या बदलना है, क्या नहीं छूना है, कब काम complete माना जाएगा, कौन सा verification proof चाहिए, और अगले session को क्या बताना है।
इस beginner guide में 5 practical prompt patterns हैं: scope, repository context, acceptance criteria, verification evidence, और handoff. इन्हें bug fix, small feature, article generation, repository audit, और code review में इस्तेमाल किया जा सकता है। लक्ष्य clever AI wording नहीं है। लक्ष्य है guesswork कम करना।
Official references हमेशा साथ रखें, क्योंकि product behavior बदल सकता है। Claude Code के लिए Claude Code overview, Claude Code memory, और Claude Code settings देखें। Codex और OpenAI coding workflow के लिए OpenAI code generation guide अच्छा starting point है। अगर tool नया है, तो Claude Code getting started guide और CLAUDE.md best practices भी पढ़ें।
5 patterns का overview
| Pattern | आसान मतलब | अगर missing हो तो क्या होता है |
|---|---|---|
| Scope | काम की सीमा | Agent unrelated files edit कर देता है |
| Repository context | existing rules और examples | Output project style से match नहीं करता |
| Acceptance criteria | done की definition | User और agent के “done” अलग हो जाते हैं |
| Verification evidence | check का proof | काम “implemented” पर रुक जाता है |
| Handoff | next session के लिए note | बाद में reason समझ नहीं आता |
Acceptance criteria यानी वे concrete conditions जिनके बाद आप change accept करेंगे। Verification evidence यानी receipt: कौन से commands चले, कौन सा screen check हुआ, कौन सा manual flow देखा गया, और क्या verify नहीं हो पाया। Handoff वह short note है जिससे कल आप, teammate, या दूसरा agent पूरी conversation दुबारा पढ़े बिना continue कर सके।
Pattern 1: scope छोटा रखें
Weak prompt बहुत broad होता है।
इस app को improve कर दो और बेहतर बना दो।
इससे agent को पता नहीं चलता कि UI, API, tests, copy, database schema, dependencies या deployment settings में क्या बदलना allowed है। Claude Code/Codex infer कर सकता है, लेकिन हर inference risk बढ़ाता है।
बेहतर prompt:
सिर्फ site/src/content/blog-hi/5-tips-for-better-prompts.mdx edit करें।
Goal: article को Claude Code/Codex beginners के लिए practical बनाना।
Allowed:
- frontmatter में title, description, updatedDate, tags
- article body
Do not change:
- heroImage
- slug
- other articles
- build configuration
Monetized site में यह बहुत जरूरी है। बड़ा rewrite internal links, product CTA, या analytics attributes गलती से हटा सकता है। Clear scope agent को काम करने की जगह देता है, लेकिन एक article update को full-site refactor नहीं बनने देता।
Exploration task में और साफ लिखें:
Related files पढ़कर सिर्फ edit plan दें। अभी कोई file edit न करें।
कौन सी files change करनी होंगी, क्यों, और हर change का verification command list करें।
Common failure यह है कि आप “पहले देखो” कहते हैं, लेकिन edit permission भी दे देते हैं। Unknown repository में discovery और implementation अलग रखें।
Pattern 2: repository context दें
Claude Code/Codex files पढ़ सकता है, लेकिन आपका business priority, writing style, या previous failures अपने आप नहीं जानता। Repository context बताता है कि इस project में सही तरीका क्या है।
यह site Astro content collections से localized MDX articles manage करती है।
Quality reference: site/src/content/blog-hi/claude-code-productivity-tips.mdx.
Project context:
- Articles practical evergreen tutorials होने चाहिए, thin AI summaries नहीं।
- 3 या अधिक concrete use cases शामिल करें।
- Official external links और internal links दोनों शामिल करें।
- Conversion path बचाएं: /hi/thanks/, /en/products/, /en/training/.
- Frontmatter valid रहना चाहिए।
Context के बिना आपको साफ text मिल सकता है, पर वह ClaudeCodeLab के लिए सही नहीं होगा। यहाँ reader को copy-paste prompts, failure examples, verification habits, और cheatsheet, products या training की natural next step चाहिए।
अगर यही context बार-बार लिखना पड़ता है, तो stable rules CLAUDE.md में रखें। Claude Code productivity tips में project memory, safe commands, और verification habits का useful pattern है।
Pattern 3: acceptance criteria पहले लिखें
Acceptance criteria vague “better बना दो” loop रोकते हैं। Weak prompt:
इस article को readable और SEO-friendly बना दो।
Readable और SEO-friendly important हैं, लेकिन check करना मुश्किल है। इन्हें concrete conditions में बदलें:
Acceptance criteria:
- सिर्फ target file बदलती है।
- description 120 characters या कम है।
- 5 patterns में हर एक के लिए Before/After prompt example है।
- Bug fix, new feature, और article generation templates हैं।
- Concrete pitfalls और उनसे बचने के तरीके हैं।
- Official external links, internal links, और clear CTA है।
- अंत में verification results और remaining risks report होते हैं।
Feature task में criteria technical होंगे:
Acceptance criteria:
- Existing UI layout नहीं टूटता।
- TypeScript type errors नहीं हैं।
- Validation और user-facing error states add हैं।
- कम से कम एक relevant test add या update है।
- npm test और npm run build results report हैं।
Rule simple है: हर item checkable होना चाहिए। अगर agent prove नहीं कर सकता, तो उसे clearly “not checked” कहना चाहिए।
Pattern 4: verification evidence मांगें
“Implemented” काफी नहीं है। Verification receipt मांगें।
End में verification receipt दें:
- Changed files:
- Commands run:
- Results:
- Manual checks:
- Not checked:
- Remaining risks:
यह habit beginner mistakes पकड़ती है। अगर dependency missing है, test suite slow है, या local service available नहीं है, तो agent साफ बता सकता है कि क्या verify नहीं हुआ। फिर आप risk accept करना है या नहीं, decide कर सकते हैं।
Error को बहुत छोटा मत करें। यह weak है:
Build fail हो गया। Fix करो।
यह useful है:
Command:
npm run build
Error:
Type error: Property 'name' does not exist on type 'User | undefined'.
File: src/components/Profile.tsx:15:22
Request:
Likely cause explain करें, smallest safe fix करें, फिर npm run build दोबारा चलाएं।
Detail workflow के लिए verification receipt workflow पढ़ें। Format बदल सकता है, लेकिन principle same है: proof के बिना task close न करें।
Pattern 5: handoff note मांगें
AI agent का काम अक्सर एक session में खत्म नहीं होता। Handoff note next session को फिर से सब खोजने से बचाता है।
End में handoff note लिखें:
- Goal
- What changed
- What did not change
- Verification results
- Files to inspect next
- Open risks or decisions
Article, SEO, checkout flow, और team repositories में यह बहुत useful है। Diff दिखाता है क्या बदला, लेकिन अक्सर यह नहीं बताता कि CTA वहाँ क्यों रखा गया या small fix बड़े refactor से बेहतर क्यों था।
Team usage के लिए इसे Claude Code team handoff rules से जोड़ें। Consistent handoff format AI sessions को reviewable बनाता है।
Copy-paste templates
Bug fix template
Goal:
Bug को smallest safe diff से fix करना।
Symptom:
क्या हो रहा है:
Expected behavior:
Actual behavior:
Reproduction steps:
1.
2.
3.
Scope:
Files you may edit:
Files you must not edit:
Repository context:
Similar implementation to follow:
Local rules to preserve:
Acceptance criteria:
Edit से पहले likely causes explain करें।
Root cause fix करें, सिर्फ visible symptom नहीं।
Feasible हो तो relevant test add/update करें।
Verification evidence और remaining risk return करें।
New feature template
Goal:
एक small feature safely add करना।
Feature:
User-visible change:
API/database/config changes:
Constraints:
Existing UI style preserve करें।
Current naming और file patterns follow करें।
अगर larger design change चाहिए, implementation से पहले explain करें।
Acceptance criteria:
Implementation, types, error states, tests, और verification receipt शामिल हों।
Article generation template
Goal:
इसे beginner-friendly evergreen article में improve करना।
Reader:
Solo developer या small team जो Claude Code/Codex शुरू कर रही है।
Required elements:
3 या अधिक concrete use cases.
Before/After prompt examples.
Specific pitfalls और fixes.
Copy-paste templates.
Official links, internal links, और CTA.
Acceptance criteria:
Description 120 characters या कम.
Frontmatter valid.
Code fences balanced.
Short self-review के साथ finish.
3 practical use cases
पहला use case है login के बाद blank screen. “Dashboard fix करो” मत लिखें। Reproduction steps, expected result, actual console error, editable files, और verification commands दें। इससे agent symptom hide करने के बजाय root cause की तरफ जाता है।
दूसरा use case है lead form में “consultation type” field add करना। अच्छा prompt options जैसे training, consulting, other, validation rule, API contract, analytics event, और test expectation लिखता है। इससे monetization path सुरक्षित रहता है और diff छोटा रहता है।
तीसरा use case article generation है। ClaudeCodeLab article के लिए prompt में body depth, concrete examples, failure modes, official links, internal links, CTA, और final “मैंने इसे try किया तो क्या हुआ” paragraph होना चाहिए। इससे generic AI summary नहीं, बल्कि beginner के काम आने वाला article बनता है।
Prompt QA rubric
Prompt भेजने से पहले 10 में score दें।
| Points | Area | Question |
|---|---|---|
| 0-2 | Scope | Editable और protected files clear हैं? |
| 0-2 | Context | Local examples, reader, business purpose शामिल है? |
| 0-2 | Acceptance | Agent को पता है task कब done है? |
| 0-2 | Verification | Commands या manual checks named हैं? |
| 0-2 | Handoff | End में क्या report करना है clear है? |
8 या ज्यादा score usually ready है। 5 या कम score का मतलब है कि agent को missing human context compensate करना पड़ेगा।
Runnable task brief generator
“इसे बेहतर कर दो” लिखने के बजाय हर बार same brief shape बनाइए। यह script prompt-brief.md बनाती है। File path और acceptance criteria बदलकर इसे Claude Code या Codex को दें, ताकि scope, constraints और verification पहले turn से साफ रहें।
cat > prompt-brief.md <<'EOF'
# Task brief for Claude Code / Codex
Goal:
- Improve one article or feature without changing unrelated files.
Scope:
- May edit: site/src/content/blog/example.mdx
- Do not edit: hero images, routes, unrelated articles, billing code.
Context to read first:
- AGENTS.md
- A similar high-quality article
- The target file
Acceptance criteria:
- The intro explains who the reader is and why this matters.
- The draft includes at least three concrete examples.
- Code or prompt templates are copy-pasteable.
- Pitfalls and verification steps are explicit.
- Internal links and a natural CTA are included.
Verification:
- npm run build
- node scripts/check-code-fences.mjs
- Read the changed file once as a reviewer.
Return:
- What changed
- Checks run
- Remaining risks
EOF
CTA: pattern को अपने workflow में fix करें
इन patterns को हर दिन scratch से लिखने की जरूरत नहीं है। पहले free Claude Code cheatsheet से daily commands और safe habits देखें। Ready-to-use prompt packs और setup material चाहिए तो ClaudeCodeLab products देखें। अगर आपकी team को CLAUDE.md, permissions, review policy, verification receipts और rollout training चाहिए, तो Claude Code training and consultation से शुरू करें।
ClaudeCodeLab के real article और site tasks में इस workflow को आज़माने के बाद सबसे बड़ा improvement scope, acceptance criteria और verification evidence को edit से पहले लिखने से आया। Handoff notes ने next-day review भी faster बनाया, क्योंकि हर CTA और link के पीछे का reason visible रहा।
मुफ़्त PDF: Claude Code cheatsheet
Email डालें और commands, review habits तथा safe workflow वाली एक-page PDF पाएँ.
हम आपका data सुरक्षित रखते हैं और spam नहीं भेजते.
लेखक के बारे में
Masa
Claude Code workflow और team adoption पर काम करने वाला engineer.
संबंधित लेख
Claude Code permission safety ladder: access धीरे-धीरे बढ़ाएं
read-only से limited edits, proof commands और deploy checks तक permission बढ़ाने की सुरक्षित ladder.
Claude Code Small PR Proof Pack: छोटे PR को review-ready बनाना
Claude Code PR के लिए diff, checks, public URL, CTA path और rollback वाला practical proof pack.
Claude Code Review Gate Before Commit: diff, test, public URL और CTA जांच
Claude Code से commit से पहले review gate बनाएं: diff, build, public URL, Gumroad, consultation, tests और unrelated files।