# AI Coding Context Pack Builder

Create a compact, reliable context pack that helps an AI coding assistant understand an existing app before making changes.

## Prompt

You are a senior software maintainer who specializes in preparing codebase context for AI-assisted development.

Inputs:
1. App purpose and target users: {{app_context}}
2. Technology stack and repository structure: {{stack_and_structure}}
3. Requested change or current objective: {{requested_change}}
4. Relevant files, schemas, interfaces, and conventions: {{technical_evidence}}
5. Constraints, prohibited changes, and validation commands: {{constraints}}

Do the following:
1. Identify the minimum files, interfaces, data flows, configuration, and conventions the coding assistant must understand before changing anything.
2. Summarize the current behavior and trace the requested change through UI, state, API, database, authentication, and deployment layers where relevant.
3. Separate confirmed codebase facts from assumptions and unresolved questions, and flag missing evidence that could cause the assistant to edit the wrong layer.
4. Define invariants, scope boundaries, reusable patterns, files that must not change, and commands for tests, linting, type checks, builds, or migrations.
5. Produce a paste-ready context pack with repository map, change objective, relevant excerpts list, dependency notes, acceptance criteria, and a pre-edit checklist. Keep it concise enough to fit the model context without omitting safety-critical details.

## Best for

Vibe coders working in an existing repository who need to give an AI assistant enough context to make a targeted change safely.

## Compatible tools

- Claude
- ChatGPT

## How to use

- Describe one concrete change at a time.
- Include relevant file paths and interfaces.
- State invariants and prohibited edits explicitly.
- Provide the exact validation commands used by the project.

## Customization tips

- Include representative code excerpts rather than the whole repository.
- Name an existing implementation pattern to copy.
- Mark assumptions that require inspection.
- Add a token budget when the repository is large.

## Example input

App: Volunteer shift scheduler for neighborhood food banks. Stack: Next.js 15, TypeScript, Supabase, Tailwind, and Playwright. Change: let coordinators duplicate a weekly shift while excluding volunteer assignments. Evidence: shifts table, assignments table, server action patterns, coordinator role check, and existing duplicate-event utility. Constraints: do not change the database schema, preserve row-level security, use existing toast patterns, and run npm test, npm run lint, and the scheduling Playwright suite.

## Example output

The context pack identifies the schedule page, shift server actions, role guard, duplicate-event utility, and assignment relationship as the minimum relevant surface. It states that only shift metadata should copy, while IDs, assignments, attendance, and audit fields must not. It flags recurrence handling as an unresolved question, defines permission and rollback invariants, lists validation commands, and instructs the assistant to propose a file plan before editing.
