File Tree

Project structure with selected files highlighted

The file tree shows your project structure with markers for selected files and those with code maps.

πŸ“src/

πŸ“„App.tsx

selectedcodemap

πŸ“„utils.ts

selected

πŸ“„config.json

Project root β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ App.tsx * + β”‚ β”œβ”€β”€ utils.ts * β”‚ └── config.json └── package.json

(* = selected, + = has codemap)

File Contents

Full content of selected files

Complete source code for all selected files, providing full context for the AI.

3

Selected Files

247

Lines of Code

8.5k

Tokens

File: src/App.tsx

import React from 'react';
import { useState } from 'react';

export function App() {
    const [count, setCount] = useState(0);

return (
        <div>
            <h1>Hello RepoPrompt</h1>
            <button onClick={() => setCount(c => c + 1)}>
                Count: {count}
            </button>
        </div>
    );
}

File: src/utils.ts

export function formatDate(date: Date): string {
    return date.toLocaleDateString();
}

Git Diff

Recent changes and modifications

Shows what's changed in your working directory, helping the AI understand recent modifications.

diff --git a/src/utils.ts b/src/utils.ts index 1a2b3c..4d5e6f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,9 @@ -export function formatDate(date: Date): string {

  • return date.toLocaleDateString();

-} +export function formatDate(date: Date, locale = 'en-US'): string {

  • return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: '2-digit' });

+} + +export function clamp(value: number, min: number, max: number): number {

  • return Math.min(Math.max(value, min), max);

+}

Code Maps

High-level structure without implementation details

Code maps provide class structures, method signatures, and interfaces without full implementations. This gives AI architectural understanding while saving tokens.

File: src/services/AuthService.ts Imports:

  • import { User } from '../types/User'
  • import { api } from '../utils/api'

Classes:

  • AuthService Methods:
  • async login(email: string, password: string): Promise Properties:
  • private currentUser: User | null
  • private tokenExpiry: Date

Meta Prompts

System instructions and behavioral guidelines

Meta prompts set the AI's behavior, coding style, and constraints. They act as system-level instructions.

  • Use TypeScript with strict mode enabled

  • Prefer functional components with hooks

  • Add comprehensive error handling

  • Include JSDoc comments for public APIs

  • Follow existing project patterns

  • Write unit tests for all new functions

  • Maintain >80% code coverage

  • Use React Testing Library for components

User Instructions

Your specific task or question

Please refactor the authentication logic to use JWT tokens instead of session cookies. Make sure to:

  1. Update the AuthService to handle JWT tokens
  2. Add token refresh logic
  3. Update the API client to include the Authorization header
  4. Maintain backward compatibility during the transition
Project root β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ App.tsx \* + β”‚ β”œβ”€β”€ utils.ts \* β”‚ └── config.json └── package.json File: src/services/AuthService.ts Classes: - AuthService Methods: - async login(email: string, password: string): Promise File: src/App.tsx ``` // ... full implementation ``` diff --git a/src/utils.ts b/src/utils.ts index 1a2b3c..4d5e6f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,9 @@ -export function formatDate(date: Date): string { - return date.toLocaleDateString(); -} +export function formatDate(date: Date, locale = "en-US"): string { + return date.toLocaleDateString(locale, { year: "numeric", month: "short", day: "2-digit" }); +} + +export function clamp(value: number, min: number, max: number): number { + return Math.min(Math.max(value, min), max); +} - Use TypeScript with strict mode - Follow existing project patterns Please refactor the authentication logic...