---
title: "Claude Extended Context - Práce s 200K Kontextem - AI Prompt"
description: "Naučte se efektivně využívat Claudeho rozšířené kontextové okno 200K tokenů pro analýzu velkých kódových bází, dokumentů a komplexních projektů."
image: "https://zacinamsai.cz/images/og-default.jpg"
---

Programování  Expert  Claude 

# Claude Extended Context - Práce s 200K Kontextem

Naučte se efektivně využívat Claudeho rozšířené kontextové okno 200K tokenů pro analýzu velkých kódových bází, dokumentů a komplexních projektů.

  ##   Prompt text 

 **Délka:** Dlouhý 

Jsi expert na efektivní využívání Claude AI s extended context window. Pomoz mi optimálně využít 200K kontextové okno pro moji specifickou úlohu.  

Moje úloha a kontext:  
- Typ úlohy: [TYP ÚLOHY - např. "analýza kódové báze", "review dlouhého dokumentu", "refactoring projektu"]  
- Velikost vstupních dat: [VELIKOST - např. "50 souborů / ~30K řádků kódu", "PDF dokument 150 stran", "API dokumentace 5 služeb"]  
- Cíl analýzy: [CÍL - např. "najít security vulnerabilities", "identifikovat duplicitní kód", "vytvořit migration plan"]  
- Časový rámec: [RÁMEC - např. "jednorázová analýza", "průběžné code reviews", "iterativní refactoring"]  

Specifické požadavky:  
- Co potřebuji z analýzy: [VÝSTUP - např. "konkrétní doporučení s odkazy na kód", "prioritizovaný seznam problémů", "step-by-step implementační plán"]  
- Omezení/kontext: [OMEZENÍ - např. "legacy kódová báze bez testů", "musí být kompatibilní s Python 3.8", "nesmíme měnit public API"]  

Vytvořte:  
1. Strukturu, jak rozdělit a prezentovat data Claudovi pro maximální efektivitu  
2. Konkrétní prompt strategie pro moji úlohu s využitím extended context  
3. Techniky pro organizaci velkého množství informací v jednom promptu  
4. Způsob, jak požádat Clauda o specifické odkazy zpět na zdrojový kód/dokument  
5. Best practices pro iterativní práci s velkým kontextem

  [  Interaktivní tvůrce ](https://zacinamsai.cz/prompts/claude-extended-context-prace-s-200k-kontextem/builder) 

 ##   Příklad použití 

### Vstup:

Typ úlohy: Analýza bezpečnosti e-commerce aplikace (React frontend + Node.js backend)  
Velikost vstupních dat: 85 souborů / ~45K řádků kódu  
 - Frontend: 50 React komponent, 15 custom hooks, Redux store  
 - Backend: 20 Express routes, 15 database models, middleware  
 - Konfigurace: Docker, Nginx, CI/CD pipelines  

Cíl analýzy: Identifikovat security vulnerabilities, zejména:  
 - XSS a CSRF rizika  
 - SQL injection možnosti  
 - Authentication/authorization chyby  
 - API endpoint security  
 - Sensitive data handling  

Časový rámec: Jednorázový comprehensive security audit před production launch  

Specifické požadavky:  
- Co potřebuji: Prioritizovaný seznam vulnerabilities s severity ratings, konkrétní odkazy na problémový kód, doporučení jak opravit  
- Omezení: Aplikace musí zůstat kompatibilní s existující MySQL databází, nemůžeme měnit authentication flow (používáme OAuth2)

### Výstup:

\# Komplexní Průvodce: Claude Extended Context pro Security Audit  

\## Část 1: Příprava Dat pro 200K Context Window  

\### Struktura Pro Maximální Efektivitu  

Claude může efektivně pracovat s ~200,000 tokeny (přibližně 150,000 slov nebo 600 stran textu). Pro bezpečnostní audit e-commerce aplikace:  

**Kalkulace velikosti:**  
&#96;&#96;&#96;  
Frontend (50 React komponent, 15 hooks): ~20,000 tokenů  
Backend (20 routes, 15 models): ~15,000 tokenů  
Middleware &amp; auth logic: ~5,000 tokenů  
Database schemas &amp; queries: ~3,000 tokenů  
Configuration files (Docker, Nginx): ~2,000 tokenů  
API documentation: ~5,000 tokenů  
Authentication flow diagram: ~1,000 tokenů  
Instruction prompt: ~3,000 tokenů  
-----------------------------------------------------------  
CELKEM: ~54,000 tokenů (✅ v rámci limitu)  
&#96;&#96;&#96;  

\### Doporučená Struktura Promptu  

&#96;&#96;&#96;markdown  
\# E-Commerce Security Audit Request  

\## Project Overview  
- **Type:** Full-stack e-commerce application  
- **Stack:** React (frontend) + Node.js/Express (backend) + MySQL  
- **Authentication:** OAuth2 (Google, Facebook)  
- **Payment:** Stripe integration  
- **Scale:** ~5,000 active users, ~1M requests/month  

\## Audit Scope  
Comprehensive security review focusing on:  
1. XSS and CSRF vulnerabilities  
2. SQL injection risks  
3. Authentication and authorization flaws  
4. API endpoint security  
5. Sensitive data handling (PII, payment info)  
6. File upload security  
7. Rate limiting and DDoS protection  

\## Output Format Requirements  
For each finding, provide:  
- **Severity:** CRITICAL / HIGH / MEDIUM / LOW  
- **Category:** XSS / SQLi / Auth / API / Data Handling / etc.  
- **Location:** Exact file path and line numbers  
- **Vulnerable Code:** Quote the problematic code snippet  
- **Exploitation Scenario:** How attacker could exploit  
- **Fix Recommendation:** Specific code changes with secure example  
- **Priority:** Fix immediately / Before launch / Post-launch improvement  

\## Constraints  
- Must remain compatible with MySQL 5.7  
- Cannot modify OAuth2 authentication flow (used by mobile app too)  
- Must maintain backward compatibility with API v1 (mobile app users)  

---  

\# FRONTEND CODE  

\## File: src/components/ProductReview.jsx  
\### Purpose: User product reviews with rich text editor  
&#96;&#96;&#96;javascript  
import React, { useState } from 'react';  
import { useDispatch } from 'react-redux';  
import { submitReview } from '../actions/reviewActions';  

function ProductReview({ productId }) {  
 const [reviewText, setReviewText] = useState('');  
 const [rating, setRating] = useState(5);  
 const dispatch = useDispatch();  

 const handleSubmit = (e) =&gt; {  
 e.preventDefault();  

 // Submit review  
 dispatch(submitReview({  
 productId,  
 rating,  
 reviewText // ⚠️ Potentially problematic - no sanitization  
 }));  

 setReviewText('');  
 };  

 return (  
 &lt;form onSubmit={handleSubmit}&gt;  
 &lt;div&gt;  
 &lt;label&gt;Rating:&lt;/label&gt;  
 &lt;input  
 type="number"  
 min="1"  
 max="5"  
 value={rating}  
 onChange={(e) =&gt; setRating(e.target.value)}  
 /&gt;  
 &lt;/div&gt;  

 &lt;div&gt;  
 &lt;label&gt;Review:&lt;/label&gt;  
 {/* ⚠️ Using dangerouslySetInnerHTML */}  
 &lt;div  
 contentEditable  
 dangerouslySetInnerHTML={{ __html: reviewText }}  
 onBlur={(e) =&gt; setReviewText(e.target.innerHTML)}  
 /&gt;  
 &lt;/div&gt;  

 &lt;button type="submit"&gt;Submit Review&lt;/button&gt;  
 &lt;/form&gt;  
 );  
}  

export default ProductReview;  
&#96;&#96;&#96;  

\## File: src/components/SearchBar.jsx  
\### Purpose: Product search with suggestions  
&#96;&#96;&#96;javascript  
import React, { useState, useEffect } from 'react';  
import { useHistory } from 'react-router-dom';  

function SearchBar() {  
 const [query, setQuery] = useState('');  
 const [suggestions, setSuggestions] = useState([]);  
 const history = useHistory();  

 useEffect(() =&gt; {  
 if (query.length &gt; 2) {  
 // Fetch suggestions from API  
 fetch(&#96;/api/search/suggestions?q=${query}&#96;) // ⚠️ No URL encoding  
 .then(res =&gt; res.json())  
 .then(data =&gt; setSuggestions(data));  
 }  
 }, [query]);  

 const handleSearch = () =&gt; {  
 // ⚠️ Query parameter not sanitized  
 history.push(&#96;/search?q=${query}&#96;);  
 };  

 return (  
 &lt;div className="search-bar"&gt;  
 &lt;input  
 type="text"  
 value={query}  
 onChange={(e) =&gt; setQuery(e.target.value)}  
 onKeyPress={(e) =&gt; e.key === 'Enter' &amp;&amp; handleSearch()}  
 placeholder="Search products..."  
 /&gt;  

 {suggestions.length &gt; 0 &amp;&amp; (  
 &lt;ul className="suggestions"&gt;  
 {suggestions.map((item, idx) =&gt; (  
 /* ⚠️ Using dangerouslySetInnerHTML with API data */  
 &lt;li  
 key={idx}  
 dangerouslySetInnerHTML={{ __html: item.highlighted }}  
 onClick={() =&gt; history.push(&#96;/product/${item.id}&#96;)}  
 /&gt;  
 ))}  
 &lt;/ul&gt;  
 )}  
 &lt;/div&gt;  
 );  
}  

export default SearchBar;  
&#96;&#96;&#96;  

\## File: src/components/UserProfile.jsx  
\### Purpose: User profile display and edit  
&#96;&#96;&#96;javascript  
import React, { useState, useEffect } from 'react';  
import axios from 'axios';  

function UserProfile() {  
 const [user, setUser] = useState(null);  
 const [isEditing, setIsEditing] = useState(false);  

 useEffect(() =&gt; {  
 // ⚠️ No CSRF token  
 axios.get('/api/user/profile')  
 .then(res =&gt; setUser(res.data))  
 .catch(err =&gt; console.error(err));  
 }, []);  

 const handleUpdate = async (userData) =&gt; {  
 try {  
 // ⚠️ No CSRF protection  
 await axios.put('/api/user/profile', userData);  
 setIsEditing(false);  
 } catch (error) {  
 console.error('Update failed:', error);  
 }  
 };  

 if (!user) return &lt;div&gt;Loading...&lt;/div&gt;;  

 return (  
 &lt;div className="user-profile"&gt;  
 {/* ⚠️ Displaying user.bio without sanitization */}  
 &lt;div className="bio" dangerouslySetInnerHTML={{ __html: user.bio }} /&gt;  

 {isEditing &amp;&amp; (  
 &lt;form onSubmit={(e) =&gt; {  
 e.preventDefault();  
 const formData = new FormData(e.target);  
 handleUpdate(Object.fromEntries(formData));  
 }}&gt;  
 &lt;input name="name" defaultValue={user.name} /&gt;  
 &lt;input name="email" defaultValue={user.email} /&gt;  
 &lt;textarea name="bio" defaultValue={user.bio} /&gt;  
 &lt;button type="submit"&gt;Save&lt;/button&gt;  
 &lt;/form&gt;  
 )}  
 &lt;/div&gt;  
 );  
}  

export default UserProfile;  
&#96;&#96;&#96;  

[... další 47 React komponent ...]  

---  

\# BACKEND CODE  

\## File: routes/productRoutes.js  
\### Purpose: Product CRUD operations  
&#96;&#96;&#96;javascript  
const express = require('express');  
const router = express.Router();  
const { authenticateUser } = require('../middleware/auth');  
const db = require('../config/database');  

// Get products with filters  
router.get('/products', async (req, res) =&gt; {  
 const { category, minPrice, maxPrice, search } = req.query;  

 // ⚠️ SQL injection vulnerability - string concatenation  
 let query = 'SELECT * FROM products WHERE 1=1';  

 if (category) {  
 query += &#96; AND category = '${category}'&#96;; // ⚠️ Unescaped  
 }  

 if (minPrice) {  
 query += &#96; AND price &gt;= ${minPrice}&#96;; // ⚠️ No validation  
 }  

 if (maxPrice) {  
 query += &#96; AND price &lt;= ${maxPrice}&#96;;  
 }  

 if (search) {  
 query += &#96; AND name LIKE '%${search}%'&#96;; // ⚠️ CRITICAL: SQLi vector  
 }  

 try {  
 const results = await db.query(query);  
 res.json(results);  
 } catch (error) {  
 res.status(500).json({ error: error.message }); // ⚠️ Leaking error details  
 }  
});  

// Get single product  
router.get('/products/:id', async (req, res) =&gt; {  
 const { id } = req.params;  

 // ⚠️ No input validation  
 const query = &#96;SELECT * FROM products WHERE id = ${id}&#96;;  

 try {  
 const result = await db.query(query);  
 res.json(result[0]);  
 } catch (error) {  
 res.status(500).json({ error: error.message });  
 }  
});  

// Create product review  
router.post('/products/:id/reviews', authenticateUser, async (req, res) =&gt; {  
 const { id } = req.params;  
 const { rating, reviewText } = req.body;  
 const userId = req.user.id;  

 // ⚠️ No XSS sanitization on reviewText  
 // ⚠️ No validation on rating range  
 const query = &#96;  
 INSERT INTO reviews (product_id, user_id, rating, review_text, created_at)  
 VALUES (${id}, ${userId}, ${rating}, '${reviewText}', NOW())  
 &#96;; // ⚠️ SQL injection vulnerability  

 try {  
 await db.query(query);  
 res.json({ success: true });  
 } catch (error) {  
 res.status(500).json({ error: error.message });  
 }  
});  

module.exports = router;  
&#96;&#96;&#96;  

\## File: routes/userRoutes.js  
\### Purpose: User account management  
&#96;&#96;&#96;javascript  
const express = require('express');  
const router = express.Router();  
const bcrypt = require('bcrypt');  
const jwt = require('jsonwebtoken');  
const db = require('../config/database');  

// User registration  
router.post('/register', async (req, res) =&gt; {  
 const { email, password, name } = req.body;  

 // ⚠️ Weak password validation  
 if (password.length &lt; 6) {  
 return res.status(400).json({ error: 'Password too short' });  
 }  

 // ⚠️ No email validation  
 const hashedPassword = await bcrypt.hash(password, 10);  

 // ⚠️ SQL injection possible  
 const query = &#96;  
 INSERT INTO users (email, password, name, created_at)  
 VALUES ('${email}', '${hashedPassword}', '${name}', NOW())  
 &#96;;  

 try {  
 await db.query(query);  
 res.json({ success: true });  
 } catch (error) {  
 // ⚠️ Leaking whether email exists  
 if (error.code === 'ER_DUP_ENTRY') {  
 return res.status(400).json({ error: 'Email already registered' });  
 }  
 res.status(500).json({ error: error.message });  
 }  
});  

// User login  
router.post('/login', async (req, res) =&gt; {  
 const { email, password } = req.body;  

 // ⚠️ SQL injection  
 const query = &#96;SELECT * FROM users WHERE email = '${email}'&#96;;  
 const users = await db.query(query);  

 if (users.length === 0) {  
 // ⚠️ Information leakage - different message for non-existent user  
 return res.status(401).json({ error: 'User not found' });  
 }  

 const user = users[0];  
 const passwordMatch = await bcrypt.compare(password, user.password);  

 if (!passwordMatch) {  
 // ⚠️ Information leakage - different message for wrong password  
 return res.status(401).json({ error: 'Incorrect password' });  
 }  

 // ⚠️ No rate limiting - brute force possible  
 const token = jwt.sign(  
 { id: user.id, email: user.email },  
 process.env.JWT_SECRET,  
 { expiresIn: '7d' } // ⚠️ Long expiration  
 );  

 res.json({  
 token,  
 user: {  
 id: user.id,  
 email: user.email,  
 name: user.name,  
 isAdmin: user.is_admin // ⚠️ Exposing admin status to client  
 }  
 });  
});  

// Get user profile  
router.get('/profile', authenticateUser, async (req, res) =&gt; {  
 const userId = req.user.id;  

 // ⚠️ Returning sensitive data  
 const query = &#96;SELECT * FROM users WHERE id = ${userId}&#96;;  
 const user = await db.query(query);  

 // ⚠️ Sending password hash to client  
 res.json(user[0]);  
});  

// Update user profile  
router.put('/profile', authenticateUser, async (req, res) =&gt; {  
 const userId = req.user.id;  
 const { name, bio, email } = req.body;  

 // ⚠️ No CSRF protection  
 // ⚠️ Mass assignment vulnerability - user can change anything  
 const query = &#96;  
 UPDATE users  
 SET name = '${name}', bio = '${bio}', email = '${email}'  
 WHERE id = ${userId}  
 &#96;;  

 try {  
 await db.query(query);  
 res.json({ success: true });  
 } catch (error) {  
 res.status(500).json({ error: error.message });  
 }  
});  

module.exports = router;  
&#96;&#96;&#96;  

\## File: routes/paymentRoutes.js  
\### Purpose: Payment processing with Stripe  
&#96;&#96;&#96;javascript  
const express = require('express');  
const router = express.Router();  
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);  
const { authenticateUser } = require('../middleware/auth');  
const db = require('../config/database');  

// Create payment intent  
router.post('/create-payment-intent', authenticateUser, async (req, res) =&gt; {  
 const { amount, orderId } = req.body;  
 const userId = req.user.id;  

 // ⚠️ No validation that user owns this order  
 // ⚠️ No validation of amount  

 try {  
 const paymentIntent = await stripe.paymentIntents.create({  
 amount: amount * 100, // ⚠️ Client-controlled amount!  
 currency: 'usd',  
 metadata: { orderId, userId }  
 });  

 res.json({ clientSecret: paymentIntent.client_secret });  
 } catch (error) {  
 res.status(500).json({ error: error.message });  
 }  
});  

// Webhook for payment confirmation  
router.post('/webhook', express.raw({ type: 'application/json' }), async (req, res) =&gt; {  
 const sig = req.headers['stripe-signature'];  

 let event;  
 try {  
 event = stripe.webhooks.constructEvent(  
 req.body,  
 sig,  
 process.env.STRIPE_WEBHOOK_SECRET  
 );  
 } catch (err) {  
 // ⚠️ No logging of failed webhook verification  
 return res.status(400).send(&#96;Webhook Error: ${err.message}&#96;);  
 }  

 if (event.type === 'payment_intent.succeeded') {  
 const paymentIntent = event.data.object;  
 const { orderId } = paymentIntent.metadata;  

 // ⚠️ No transaction - race condition possible  
 await db.query(&#96;  
 UPDATE orders  
 SET status = 'paid', payment_id = '${paymentIntent.id}'  
 WHERE id = ${orderId}  
 &#96;);  
 }  

 res.json({ received: true });  
});  

module.exports = router;  
&#96;&#96;&#96;  

[... dalších 17 route souborů ...]  

---  

\# MIDDLEWARE  

\## File: middleware/auth.js  
\### Purpose: JWT authentication middleware  
&#96;&#96;&#96;javascript  
const jwt = require('jsonwebtoken');  
const db = require('../config/database');  

async function authenticateUser(req, res, next) {  
 const token = req.headers.authorization?.split('\1')[1]; // Bearer &lt;token&gt;  

 if (!token) {  
 return res.status(401).json({ error: 'No token provided' });  
 }  

 try {  
 const decoded = jwt.verify(token, process.env.JWT_SECRET);  

 // ⚠️ Trusting JWT payload without database check  
 // ⚠️ No validation if user was deleted or banned  
 req.user = decoded;  
 next();  
 } catch (error) {  
 // ⚠️ Exposing JWT errors  
 res.status(401).json({ error: error.message });  
 }  
}  

function requireAdmin(req, res, next) {  
 // ⚠️ Checking isAdmin from JWT - client could tamper  
 if (!req.user.isAdmin) {  
 return res.status(403).json({ error: 'Admin access required' });  
 }  
 next();  
}  

module.exports = { authenticateUser, requireAdmin };  
&#96;&#96;&#96;  

\## File: middleware/cors.js  
\### Purpose: CORS configuration  
&#96;&#96;&#96;javascript  
const cors = require('cors');  

const corsOptions = {  
 // ⚠️ Wildcard origin in production  
 origin: '*',  
 credentials: true,  
 methods: ['GET', 'POST', 'PUT', 'DELETE'],  
 allowedHeaders: ['Content-Type', 'Authorization']  
};  

module.exports = cors(corsOptions);  
&#96;&#96;&#96;  

[... další middleware ...]  

---  

\# DATABASE MODELS  

\## File: models/User.js  
\### Purpose: User model and methods  
&#96;&#96;&#96;javascript  
const db = require('../config/database');  

class User {  
 static async findByEmail(email) {  
 // ⚠️ SQL injection if used with unsanitized input  
 const query = &#96;SELECT * FROM users WHERE email = '${email}'&#96;;  
 const results = await db.query(query);  
 return results[0];  
 }  

 static async create(userData) {  
 const { email, password, name } = userData;  

 // ⚠️ No input validation  
 // ⚠️ SQL injection vulnerability  
 const query = &#96;  
 INSERT INTO users (email, password, name, created_at)  
 VALUES ('${email}', '${password}', '${name}', NOW())  
 &#96;;  

 const result = await db.query(query);  
 return result.insertId;  
 }  

 static async updateProfile(userId, updates) {  
 // ⚠️ Mass assignment - accepting any field  
 const setClause = Object.entries(updates)  
 .map(([key, value]) =&gt; &#96;${key} = '${value}'&#96;)  
 .join(', ');  

 // ⚠️ SQL injection  
 const query = &#96;UPDATE users SET ${setClause} WHERE id = ${userId}&#96;;  
 await db.query(query);  
 }  
}  

module.exports = User;  
&#96;&#96;&#96;  

[... dalších 14 model souborů ...]  

---  

\# CONFIGURATION  

\## File: config/database.js  
\### Purpose: MySQL database connection  
&#96;&#96;&#96;javascript  
const mysql = require('mysql2/promise');  

const pool = mysql.createPool({  
 host: process.env.DB_HOST,  
 user: process.env.DB_USER,  
 password: process.env.DB_PASSWORD,  
 database: process.env.DB_NAME,  
 // ⚠️ No connection pool limits  
 // ⚠️ No connection timeout  
 waitForConnections: true,  
 connectionLimit: 10,  
 queueLimit: 0  
});  

module.exports = {  
 query: async (sql, params) =&gt; {  
 const [results] = await pool.execute(sql, params);  
 return results;  
 }  
};  
&#96;&#96;&#96;  

\## File: .env (example - not actual production values)  
&#96;&#96;&#96;env  
\# Database  
DB_HOST=localhost  
DB_USER=root  
DB_PASSWORD=password123 # ⚠️ Weak password  
DB_NAME=ecommerce  

\# JWT  
JWT_SECRET=mysecretkey123 # ⚠️ Weak secret  
JWT_EXPIRATION=7d  

\# Stripe  
STRIPE_SECRET_KEY=sk_test_...  
STRIPE_WEBHOOK_SECRET=whsec_...  

\# OAuth  
GOOGLE_CLIENT_ID=...  
GOOGLE_CLIENT_SECRET=... # ⚠️ In repository  
FACEBOOK_APP_ID=...  
FACEBOOK_APP_SECRET=... # ⚠️ In repository  

\# Server  
PORT=3000  
NODE_ENV=production  

\# ⚠️ Debug mode enabled in production  
DEBUG=true  
VERBOSE_ERRORS=true  
&#96;&#96;&#96;  

\## File: docker-compose.yml  
\### Purpose: Docker services configuration  
&#96;&#96;&#96;yaml  
version: '3.8'  

services:  
 web:  
 build: .  
 ports:  
 - "3000:3000" # ⚠️ Exposing directly without reverse proxy  
 environment:  
 - NODE_ENV=production  
 # ⚠️ Running as root  
 # ⚠️ No resource limits  

 mysql:  
 image: mysql:5.7  
 ports:  
 - "3306:3306" # ⚠️ Exposing MySQL to public  
 environment:  
 MYSQL_ROOT_PASSWORD: password123 # ⚠️ Hardcoded password  
 MYSQL_DATABASE: ecommerce  
 # ⚠️ No volume for data persistence in this example  
&#96;&#96;&#96;  

---  

\# API DOCUMENTATION EXCERPT  

\## Authentication Endpoints  

**POST /api/login**  
- Body: &#96;{ email, password }&#96;  
- Returns: &#96;{ token, user }&#96;  
- ⚠️ No rate limiting documented  

**POST /api/register**  
- Body: &#96;{ email, password, name }&#96;  
- Returns: &#96;{ success: true }&#96;  

\## Product Endpoints  

**GET /api/products?search={query}&amp;category={cat}**  
- Public endpoint  
- Returns: Array of products  
- ⚠️ Search parameter not sanitized  

**POST /api/products/:id/reviews**  
- Requires authentication  
- Body: &#96;{ rating, reviewText }&#96;  
- ⚠️ No mention of XSS prevention  

---  

\# ANALYSIS INSTRUCTIONS  

Based on the above codebase:  

1. **Identify ALL security vulnerabilities** across frontend, backend, and configuration  
2. **Prioritize findings** by exploitability and business impact  
3. **Provide specific line-by-line references** for each vulnerability  
4. **Include exploitation scenarios** showing exactly how attacker could exploit each issue  
5. **Give concrete fix recommendations** with secure code examples  
6. **Consider the constraints:**  
 - Must maintain MySQL compatibility  
 - Cannot change OAuth2 flow  
 - Must support existing API for mobile app  

For each finding, use this format:  

\## [SEVERITY] [Category]: [Brief Title]  

**Location:** &#96;path/to/file.js:123-145&#96;  

**Vulnerable Code:**  
&#96;&#96;&#96;javascript  
// Exact code snippet  
&#96;&#96;&#96;  

**Exploitation Scenario:**  
[Step-by-step how to exploit]  

**Business Impact:**  
[What attacker gains]  

**Fix Recommendation:**  
&#96;&#96;&#96;javascript  
// Secure code example  
&#96;&#96;&#96;  

**References:**  
- [OWASP guideline link]  
- [CWE number]  

Begin the comprehensive security audit now.  
&#96;&#96;&#96;  

---  

\## Proč Tato Struktura Funguje?  

\### 1. **Explicitní Instrukce na Začátku**  
&#96;&#96;&#96;markdown  
\## Output Format Requirements  
For each finding, provide:  
- **Severity:** CRITICAL / HIGH / MEDIUM / LOW  
- **Location:** Exact file path and line numbers  
...  
&#96;&#96;&#96;  

Tím zajistíte, že Claude:**  
- Ví přesně, jaký formát výstupu očekáváte  
- Bude poskytovat strukturované, konzistentní odpovědi  
- Zahrne všechny požadované informace  

\### 2. **Kompletní Kontext v Jednom Promptu**  

Místo postupného nahrávání souborů:  
&#96;&#96;&#96;  
❌ Špatný přístup:  
"Přečti si tento soubor... OK, teď tento... Teď analyzuj..."  
&#96;&#96;&#96;  

Použijte jeden velký prompt:  
&#96;&#96;&#96;  
✅ Správný přístup:  
"Zde je celý projekt (85 souborů). Analyzuj vše najednou."  
&#96;&#96;&#96;  

**Výhody:**  
- Claude vidí celý obraz, nejen jednotlivé části  
- Může identifikovat cross-file vulnerabilities  
- Poskytuje kontextuální analýzu (např. "tato XSS na frontendu je problém, protože backend nevaliduje")  

\### 3. **Komentáře ⚠️ Jako Vodítka**  

V kódu jsem přidal &#96;⚠️&#96; komentáře u problematických částí:  
&#96;&#96;&#96;javascript  
const query = &#96;SELECT * FROM products WHERE name LIKE '%${search}%'&#96;; // ⚠️ SQLi vector  
&#96;&#96;&#96;  

**Účel:**  
- Usnadňují Claudovi identifikaci problémů  
- Slouží jako "cheat sheet" pro rychlejší analýzu  
- Nejsou nutné, ale výrazně zrychlují analýzu (Claude najde problémy i bez nich)  

\### 4. **Strukturované Sekce**  

Rozdělení do jasných sekcí:  
&#96;&#96;&#96;markdown  
\# FRONTEND CODE  
[všechny React komponenty]  

\# BACKEND CODE  
[všechny Express routes]  

\# MIDDLEWARE  
[authentication, CORS, etc.]  

\# DATABASE MODELS  
[Sequelize/mongoose models]  

\# CONFIGURATION  
[.env, docker-compose, nginx]  
&#96;&#96;&#96;  

**Proč to pomáhá:**  
- Claude může odkazovat na sekce: "V sekci BACKEND CODE, soubor userRoutes.js:45..."  
- Snadnější navigace ve velkém kontextu  
- Lepší organizace výstupu  

---  

\## Část 2: Prompt Strategie Pro Extended Context  

\### Strategie 1: "Dump Everything" Approach  

**Kdy použít:** Jednorázové comprehensive audity, analýzy celých projektů  

**Jak:**  
1. Zkompilujte všechny soubory do jednoho Markdown dokumentu  
2. Přidejte jasné sekční rozdělení  
3. Na začátek dejte instrukce a očekávaný výstupní formát  
4. Na konec dejte explicitní "Begin analysis now"  

**Příklad:**  
&#96;&#96;&#96;markdown  
\# Comprehensive Codebase Analysis  

\## Instructions  
[Co má Claude dělat]  

\## Expected Output Format  
[Jak má vypadat výstup]  

---  

\# CODEBASE  

\## Frontend (React)  
[všechny komponenty]  

\## Backend (Node.js)  
[všechny routes, modely]  

\## Tests  
[test soubory]  

\## Configuration  
[config soubory]  

---  

\## Analysis Request  
Begin comprehensive analysis focusing on:  
1. [specific aspect]  
2. [specific aspect]  
3. [specific aspect]  
&#96;&#96;&#96;  

\### Strategie 2: "Annotated Context" Approach  

**Kdy použít:** Code reviews, refactoring guidance, debugging složitých issues  

**Jak:**  
1. Přidejte anotace k důležitým částem kódu:  
 - &#96;// NOTE: This is important because...&#96;  
 - &#96;// QUESTION: Should we change this?&#96;  
 - &#96;// CONTEXT: This was added in PR #123 to fix...&#96;  
2. Zvýrazněte oblasti zájmu  
3. Poskytněte historický kontext  

**Příklad:**  
&#96;&#96;&#96;javascript  
// FILE: src/components/PaymentForm.jsx  
// CONTEXT: Originally used Stripe Elements v1, migrated to v2 in PR #456  
// QUESTION: Can we simplify this with Stripe's new Payment Element?  

function PaymentForm() {  
 const [clientSecret, setClientSecret] = useState(null);  

 useEffect(() =&gt; {  
 // NOTE: We fetch clientSecret on mount to prevent CSRF  
 // See security review doc: docs/security/payment-flow.md  
 fetch('/api/create-payment-intent', {  
 method: 'POST',  
 headers: {  
 'Content-Type': 'application/json',  
 'X-CSRF-Token': getCsrfToken() // NOTE: Required for POST requests  
 },  
 body: JSON.stringify({ orderId })  
 })  
 .then(res =&gt; res.json())  
 .then(data =&gt; setClientSecret(data.clientSecret));  
 }, [orderId]);  

 // ... rest of component  
}  
&#96;&#96;&#96;  

**Claude pak může odpovědět:**  
&#96;&#96;&#96;markdown  
\## PaymentForm Simplification Opportunities  

\### Question: Can we simplify with Payment Element?  

**Yes, significant simplification possible.**  

Current implementation (src/components/PaymentForm.jsx:15-45) uses separate  
Card Number, Card Expiry, and Card CVC elements. Stripe's Payment Element  
consolidates this into single component.  

**Before (current):**  
[váš current kód]  

**After (with Payment Element):**  
&#96;&#96;&#96;jsx  
// Simplified with Payment Element  
function PaymentForm() {  
 const stripe = useStripe();  
 const elements = useElements();  

 // SECURITY NOTE: clientSecret fetching preserved from original (line 18-29)  
 const [clientSecret, setClientSecret] = useState(null);  

 useEffect(() =&gt; {  
 // Keep existing CSRF-protected fetch logic  
 fetch('/api/create-payment-intent', ...)  
 }, [orderId]);  

 return (  
 &lt;form onSubmit={handleSubmit}&gt;  
 {/* Single component replaces 3 separate elements */}  
 &lt;PaymentElement /&gt;  
 &lt;button type="submit"&gt;Pay&lt;/button&gt;  
 &lt;/form&gt;  
 );  
}  
&#96;&#96;&#96;  

**Benefits:**  
- 40% less code (150 lines → 90 lines)  
- Built-in validation  
- Automatic support for new payment methods (Apple Pay, Google Pay)  
- Maintains existing CSRF protection (line 24-26)  

**Migration Path:**  
1. Update Stripe.js dependency to v3+ (package.json)  
2. Replace CardElement components with PaymentElement (PaymentForm.jsx:30-60)  
3. Update E2E tests (tests/e2e/payment.spec.js:45-120)  
4. No backend changes required ✓  

**Constraints Check:**  
✓ Compatible with existing /api/create-payment-intent endpoint  
✓ CSRF protection maintained  
✓ No breaking changes for mobile app (backend unchanged)  
&#96;&#96;&#96;  

\### Strategie 3: "Focused Context + Reference" Approach  

**Kdy použít:** Debugging specific issue s potřebou širšího kontextu  

**Jak:**  
1. Na začátek dejte focused problém  
2. Pod to dejte relevant context  
3. Na konec přidejte full codebase jako referenci  

**Příklad:**  
&#96;&#96;&#96;markdown  
\# Bug Report: Duplicate Orders Created on Payment  

\## Problem  
Users occasionally get charged twice for the same order. Database shows duplicate  
order records with same items but different IDs.  

\## Reproduction Steps  
1. User adds items to cart  
2. Proceeds to checkout  
3. Clicks "Pay Now"  
4. Stripe webhook fires twice within 100ms  
5. Both webhooks create separate order records  

\## Suspicious Code  

\### File: routes/paymentRoutes.js:45-67 (Webhook Handler)  
&#96;&#96;&#96;javascript  
router.post('/webhook', async (req, res) =&gt; {  
 const event = stripe.webhooks.constructEvent(req.body, sig, secret);  

 if (event.type === 'payment_intent.succeeded') {  
 const { orderId } = event.data.object.metadata;  

 // ⚠️ Potential race condition - no locking mechanism  
 await db.query(&#96;  
 UPDATE orders SET status = 'paid' WHERE id = ${orderId}  
 &#96;);  

 // ⚠️ This might run twice if webhook is retried  
 await createInvoice(orderId);  
 await sendConfirmationEmail(orderId);  
 }  

 res.json({ received: true });  
});  
&#96;&#96;&#96;  

\### File: models/Order.js:120-145 (Order Creation)  
&#96;&#96;&#96;javascript  
static async create(orderData) {  
 const orderId = generateOrderId();  

 await db.query(&#96;  
 INSERT INTO orders (id, user_id, items, total, status)  
 VALUES (${orderId}, ${orderData.userId}, '${JSON.stringify(orderData.items)}',  
 ${orderData.total}, 'pending')  
 &#96;);  

 return orderId;  
}  
&#96;&#96;&#96;  

\## Question  
What's causing the duplicate orders and how do we fix it with:  
1. Zero data loss (all orders must be recorded)  
2. Zero duplicate charges (no double billing)  
3. Minimal changes to existing flow (mobile app compatibility)  

---  

\# FULL CODEBASE FOR REFERENCE  

[... celý codebase follows ...]  
&#96;&#96;&#96;  

**Claude pak analyzuje:**  
1. Identifikuje root cause (race condition v webhook handleru)  
2. Navrhne řešení (idempotency keys, database locks)  
3. Ukáže jak implementovat s ohledem na constraints  
4. Použije kontext z celého codebase k identifikaci všech souvisejících míst, která je třeba změnit  

---  

\## Část 3: Techniky Pro Organizaci Informací  

\### Technika 1: Hierarchické Nadpisy  

Používejte Markdown hierarchii pro snadnou navigaci:  
&#96;&#96;&#96;markdown  
\# PROJECT OVERVIEW (level 1)  

\## Frontend (level 2)  

\### Components (level 3)  

\#### Authentication (level 4)  

\##### LoginForm.jsx (level 5)  
&#96;&#96;&#96;  

Claude pak může odkazovat: "In **Frontend → Components → Authentication → LoginForm.jsx**"  

\### Technika 2: Inline Documentation  

Dokumentujte účel každého souboru na jeho začátku:  
&#96;&#96;&#96;javascript  
// FILE: src/services/PaymentService.js  
// PURPOSE: Handles Stripe payment processing and webhook verification  
// DEPENDENCIES: stripe, database, email-service  
// USED BY: PaymentController, WebhookHandler  
// SECURITY: Contains sensitive Stripe API key - never log  
// LAST MODIFIED: 2025-01-05 (PR #456 - Added retry logic)  

class PaymentService {  
 // ...  
}  
&#96;&#96;&#96;  

\### Technika 3: Cross-Reference Markers  

Přidejte reference mezi souvisejícími soubory:  
&#96;&#96;&#96;javascript  
// FILE: frontend/src/components/CheckoutForm.jsx  

function CheckoutForm() {  
 const handleSubmit = async () =&gt; {  
 // BACKEND REFERENCE: See backend/routes/paymentRoutes.js:34-56  
 // API DOCS: See docs/api/payments.md#create-payment-intent  
 const response = await fetch('/api/create-payment-intent', {  
 method: 'POST',  
 body: JSON.stringify({ orderId, amount })  
 });  
 };  
}  
&#96;&#96;&#96;  

&#96;&#96;&#96;javascript  
// FILE: backend/routes/paymentRoutes.js  

// FRONTEND CALLERS:  
// - frontend/src/components/CheckoutForm.jsx:45  
// - frontend/src/pages/OrderSummary.jsx:120  

router.post('/create-payment-intent', async (req, res) =&gt; {  
 // ...  
});  
&#96;&#96;&#96;  

\### Technika 4: Dependency Graph  

Na začátek promptu dejte dependency graph:  
&#96;&#96;&#96;markdown  
\# Dependency Graph  

\## High-Level Architecture  
&#96;&#96;&#96;  
Frontend (React)  
 ↓ HTTP requests  
Backend API (Express)  
 ↓ queries  
Database (MySQL)  
 ↓ events  
Webhook Handler  
 ↓ notifications  
Email Service  
&#96;&#96;&#96;  

\## File-Level Dependencies  

\### PaymentFlow  
&#96;&#96;&#96;  
CheckoutForm.jsx  
 → calls → paymentRoutes.js:/create-payment-intent  
 → calls → PaymentService.js:createIntent()  
 → calls → Stripe API  
 → stores → Database:orders table  
 → triggers → OrderModel.afterCreate hook  
 → calls → EmailService.sendConfirmation()  
&#96;&#96;&#96;  
&#96;&#96;&#96;  

Claude pak rozumí celému flow a může identifikovat problémy na kterémkoliv místě v řetězci.  

---  

\## Část 4: Získání Specifických Odkazů  

\### Problém: Vágní Odpovědi  

**Špatný výstup od Clauda:**  
"V komponentě PaymentForm máte security issue s XSS."  

\### Řešení: Explicit Output Format  

V instrukčních části promptu specifikujte:  
&#96;&#96;&#96;markdown  
\## Required Output Format  

For EVERY finding, you MUST include:  

1. **Exact Location**  
 - Format: &#96;path/to/file.js:startLine-endLine&#96;  
 - Example: &#96;src/components/PaymentForm.jsx:45-67&#96;  

2. **Vulnerable Code Snippet**  
 - Quote the EXACT code (copy-paste from the input)  
 - Include 2-3 lines of context before/after  

3. **Specific Line Reference in Explanation**  
 - When explaining, reference: "On line 52, the variable..."  
 - NOT: "The code does..."  

Example of GOOD output:  

\## [CRITICAL] XSS: Unescaped User Input in Review Display  

**Location:** &#96;src/components/ProductReview.jsx:45-67&#96;  

**Vulnerable Code (lines 45-50):**  
&#96;&#96;&#96;jsx  
function ProductReview({ review }) {  
 return (  
 &lt;div className="review"&gt;  
 &lt;div dangerouslySetInnerHTML={{ __html: review.text }} /&gt;  
 &lt;/div&gt;  
 );  
}  
&#96;&#96;&#96;  

**Issue:** On **line 47**, the &#96;review.text&#96; is rendered with &#96;dangerouslySetInnerHTML&#96;  
without sanitization, allowing stored XSS attacks.  

[... rest of finding ...]  
&#96;&#96;&#96;  

\### Jak Claude Zajistí Přesné Reference?  

**1. Explicitně požadujte čísla řádků:**  
&#96;&#96;&#96;markdown  
When referencing code:  
- ALWAYS include the file path AND line numbers  
- Format: path/to/file.js:123 or path/to/file.js:123-145 for ranges  
- Quote the actual code from those lines  
&#96;&#96;&#96;  

**2. Poskytněte číslované řádky v inputu:**  

V Bash scriptu pro přípravu:  
&#96;&#96;&#96;bash  
\#!/bin/bash  

OUTPUT_FILE="full-codebase.md"  

echo "# Full Codebase with Line Numbers" &gt; $OUTPUT_FILE  
echo "" &gt;&gt; $OUTPUT_FILE  

find src -name "*.js" -o -name "*.jsx" &#124; while read file; do  
 echo "## File: $file" &gt;&gt; $OUTPUT_FILE  
 echo '&#96;&#96;&#96;javascript' &gt;&gt; $OUTPUT_FILE  
 # Add line numbers  
 cat -n "$file" &gt;&gt; $OUTPUT_FILE  
 echo '&#96;&#96;&#96;' &gt;&gt; $OUTPUT_FILE  
 echo "" &gt;&gt; $OUTPUT_FILE  
done  
&#96;&#96;&#96;  

Výstup:  
&#96;&#96;&#96;javascript  
\## File: src/components/PaymentForm.jsx  
&#96;&#96;&#96;javascript  
 1 import React, { useState } from 'react';  
 2 import { useStripe } from '@stripe/react-stripe-js';  
 3  
 4 function PaymentForm() {  
 5 const [amount, setAmount] = useState(0);  
 6  
 7 const handleSubmit = async () =&gt; {  
 8 // Vulnerable: no validation  
 9 await fetch('/api/payment', {  
 10 method: 'POST',  
 11 body: JSON.stringify({ amount }) // ⚠️ Client-controlled  
 12 });  
 13 };  
&#96;&#96;&#96;  

Claude pak může přesně říct: "Na řádku 11 v src/components/PaymentForm.jsx..."  

**3. Request Code Locations in Output:**  
&#96;&#96;&#96;markdown  
\## Output Template (use this EXACT format for every finding):  

\### [SEVERITY] [Category]: [Title]  

**File:** &#96;exact/path/to/file.js&#96;  
**Lines:** 123-145  
**Function/Class:** &#96;functionName()&#96; or &#96;ClassName&#96;  

**Vulnerable Code:**  
&#96;&#96;&#96;[language]  
[quote exact lines from input, including line numbers]  
&#96;&#96;&#96;  

**Issue Description:**  
[Explain what's wrong, referencing specific line numbers]  

**How to Exploit:**  
[Step-by-step with examples]  

**Fix:**  
&#96;&#96;&#96;[language]  
[secure code replacement for the same lines]  
&#96;&#96;&#96;  

**References:**  
- OWASP: [link]  
- CWE: [number]  
&#96;&#96;&#96;  

---  

\## Část 5: Best Practices  

\### ✅ DO: Structure Your Context  

&#96;&#96;&#96;markdown  
\# PROJECT: E-Commerce Security Audit  

\## 1. EXECUTIVE SUMMARY  
[2-3 sentences about the project]  

\## 2. AUDIT SCOPE  
[What you want analyzed]  

\## 3. TECHNICAL CONTEXT  
[Stack, versions, architecture]  

\## 4. CONSTRAINTS  
[What cannot be changed]  

\## 5. OUTPUT REQUIREMENTS  
[Exact format you want]  

\## 6. PRIORITY AREAS  
[Where to focus most attention]  

---  

\# CODE  

[... structured code with clear sections ...]  

---  

\# REFERENCES  

\## Architecture Diagrams  
[Mermaid diagrams of system flow]  

\## API Documentation  
[Swagger/OpenAPI specs]  

\## Previous Audit Findings  
[Any known issues]  

---  

\# ANALYSIS REQUEST  

Begin comprehensive analysis now, following the output requirements in section 5.  
&#96;&#96;&#96;  

\### ✅ DO: Use Semantic Markers  

&#96;&#96;&#96;javascript  
// 🔴 CRITICAL SECURITY ISSUE  
const query = &#96;SELECT * FROM users WHERE email = '${email}'&#96;;  

// 🟡 TODO: Refactor to use prepared statements  
// 🟢 FIXED: Now using parameterized queries (as of 2025-01-05)  

// 💭 CONTEXT: This was added to handle edge case from issue #123  

// 🔗 RELATED: See PaymentService.js:45-67 for similar pattern  
&#96;&#96;&#96;  

Claude pak může používat stejné markery v odpovědích.  

\### ✅ DO: Provide Example Output  

Ukažte Claudovi přesně, jak má výstup vypadat:  
&#96;&#96;&#96;markdown  
\## Example of Expected Output  

Here's EXACTLY the format I want:  

\### [CRITICAL] SQL Injection: Unparameterized Query in User Login  

**Location:** &#96;backend/routes/authRoutes.js:23-29&#96;  

**Vulnerable Code:**  
&#96;&#96;&#96;javascript  
// Line 23-29  
router.post('/login', async (req, res) =&gt; {  
 const { email } = req.body;  
 const query = &#96;SELECT * FROM users WHERE email = '${email}'&#96;; // ⚠️ SQLi  
 const results = await db.query(query);  
});  
&#96;&#96;&#96;  

**Exploitation:**  
Attacker sends email: &#96;' OR '1'='1' --&#96;  
Result: &#96;SELECT * FROM users WHERE email = '' OR '1'='1' --'&#96;  
Bypasses authentication, returns all users.  

**Fix:**  
&#96;&#96;&#96;javascript  
// Use parameterized query  
router.post('/login', async (req, res) =&gt; {  
 const { email } = req.body;  
 const query = 'SELECT * FROM users WHERE email = ?';  
 const results = await db.query(query, [email]); // ✅ Parameterized  
});  
&#96;&#96;&#96;  

**References:**  
- OWASP SQL Injection: https://owasp.org/www-community/attacks/SQL_Injection  
- CWE-89: SQL Injection  

---  

Now provide ALL findings in this exact format.  
&#96;&#96;&#96;  

\### ✅ DO: Number Everything  

Numbering pomáhá v navigaci:  
&#96;&#96;&#96;markdown  
\# CODEBASE  

\## 1. Frontend  

\### 1.1 React Components  

\#### 1.1.1 Authentication  

\##### 1.1.1.1 LoginForm.jsx  

\#### 1.1.2 Payment  

\##### 1.1.2.1 CheckoutForm.jsx  

\### 1.2 Redux Store  

\#### 1.2.1 Actions  

\##### 1.2.1.1 authActions.js  

\## 2. Backend  

\### 2.1 Routes  

\#### 2.1.1 authRoutes.js  

\#### 2.1.2 paymentRoutes.js  
&#96;&#96;&#96;  

Claude pak může říct: "See section 1.1.2.1 (CheckoutForm.jsx) and section 2.1.2 (paymentRoutes.js)"  

\### ❌ DON'T: Dump Unstructured Code  

&#96;&#96;&#96;javascript  
// ❌ ŠPATNĚ  
// Just pasting random files without context  

class User {}  
function login() {}  
router.post('/payment', ...)  
...  
&#96;&#96;&#96;  

\### ❌ DON'T: Mix Languages in Code Blocks  

&#96;&#96;&#96;javascript  
// ❌ ŠPATNĚ - mělo by být &#96;&#96;&#96;jsx  
&lt;Component prop="value" /&gt;  
&#96;&#96;&#96;  

&#96;&#96;&#96;jsx  
// ✅ SPRÁVNĚ  
&lt;Component prop="value" /&gt;  
&#96;&#96;&#96;  

\### ❌ DON'T: Forget to Update Context  

Pokud děláte iterativní work, aktualizujte kontext:  
&#96;&#96;&#96;markdown  
\## Iteration 2: After Fixing SQL Injection Issues  

\### Changes Made Since Last Analysis  
1. All queries now use parameterized statements (backend/models/*.js)  
2. Added input validation middleware (backend/middleware/validation.js)  
3. Updated database queries in routes (backend/routes/*.js)  

\### Remaining Issues to Address  
[list from previous analysis]  

\### New Code for Review  
[updated code with changes marked]  

\### Request  
Review the updated code and:  
1. Confirm SQL injection issues are properly fixed  
2. Identify any NEW issues introduced by changes  
3. Check for any remaining vulnerabilities  
&#96;&#96;&#96;  

---  

\## Závěr  

**Claude Extended Context (200K tokenů) je mocný nástroj**, ale efektivita závisí na struktuře vašeho inputu.  

**Klíčové Takeaways:**  

1. **Struktura je vše:** Markdown hierarchie, jasné sekce, numbered outline  
2. **Explicitní instrukce:** Řekněte přesně, co chcete a v jakém formátu  
3. **Poskytněte kontext:** Annotations, comments, dependency graphs  
4. **Očekávejte přesnost:** Vyžadujte file paths a line numbers v každém outputu  
5. **Používejte markers:** ⚠️ 🔴 🟡 🟢 💭 🔗 pro sémantické zvýraznění  
6. **Ukažte příklady:** Example output template zajistí konzistenci  
7. **Iterujte:** Update context, track changes, build on previous analyses  

**S těmito technikami můžete Claude efektivně využít pro:**  
- ✅ Comprehensive security audits (jako náš příklad)  
- ✅ Large-scale refactoring planning  
- ✅ Complex debugging s wide-ranging root causes  
- ✅ Architecture reviews a redesigns  
- ✅ Documentation generation from code  
- ✅ Test coverage analysis  
- ✅ Performance bottleneck identification  

Extended context není jen o množství dat - **je o inteligentní organizaci informací** tak, aby Claude mohl efektivně najít patterns, identifikovat problémy a poskytovat actionable recommendations.

### Kde použít tento prompt?

Najděte vhodné AI nástroje pro použití tohoto promptu a maximalizujte jeho efektivitu.

 [ 🔧 Vhodné nástroje ](https://zacinamsai.cz/tools?category=programov%C3%A1n%C3%AD) [ 📖 Návody ](https://zacinamsai.cz/articles?search=Claude) [ 📚 Slovník ](https://zacinamsai.cz/glossary?search=Programov%C3%A1n%C3%AD) 

### Podobné prompty

 [  

  Expert  

####  Advanced AI Features - Deep Dive do Pokročilých Funkcí 

Komplexní průvodce pokročilými funkcemi AI nástrojů - od extended context a multimodality po tool use, streaming, a fine-tuning. Naučte se využívat plný potenciál moderních AI systémů.

  Programování  Zobrazit  

 ](https://zacinamsai.cz/prompts/advanced-ai-features-deep-dive-pokrocilych-funkci) [  

  Expert  

####  Algoritmus optimalizace 

Optimalizace algoritmu z O(n²) na O(n log n) nebo lepší.

  Programování  Zobrazit  

 ](https://zacinamsai.cz/prompts/algoritmus-optimalizace) [  

  Pokročilý  

####  API design s REST best practices 

Návrh RESTful API s dokumentací a error handling.

  Programování  Zobrazit  

 ](https://zacinamsai.cz/prompts/api-design-rest) [  

  Pokročilý  

####  Architekt komplexní SaaS aplikace 

Generování kompletní struktury a UI komponent pro SaaS aplikaci na platformě Lovable.

  Programování  Zobrazit  

 ](https://zacinamsai.cz/prompts/lovable-architekt-komplexni-saas-aplikace) 

### Objevte další AI prompty

 Prozkoumejte naši sbírku Programování promptů a najděte ty, které vám pomohou dosáhnout lepších výsledků.

 [ Další Programování prompty ](https://zacinamsai.cz/prompts?category=coding) [ Všechny prompty ](https://zacinamsai.cz/prompts)

```json
{
        "@context": "https://schema.org",
        "@type": "WebSite",
        "name": "Začínám s AI",
        "alternateName": "zacinamsai.cz",
        "url": "https://zacinamsai.cz",
        "description": "Průvodce světem umělé inteligence - Katalog AI nástrojů, články, prompty a slovník pojmů",
        "inLanguage": "cs",
        "potentialAction": {
            "@type": "SearchAction",
            "target": {
                "@type": "EntryPoint",
                "urlTemplate": "https://zacinamsai.cz/search?q={search_term_string}"
            },
            "query-input": {
                "@type": "PropertyValueSpecification",
                "valueRequired": true,
                "valueName": "search_term_string"
            }
        },
        "publisher": {
            "@type": "Organization",
            "name": "Začínám s AI",
            "url": "https://zacinamsai.cz",
            "logo": {
                "@type": "ImageObject",
                "url": "https://zacinamsai.cz/images/zacinamsai_logo.png"
            }
        }
    }
```
