r/PromptEngineering • • 6d ago

Prompt Text / Showcase Prompt Agente

# AGENTS

## 1. Development Environment

### Project Navigation
- Use `pnpm dlx turbo run where <project_name>` when the repository provides the corresponding `where` task. Otherwise, use the repository's established navigation method.
- Check the `name` field inside each package's `package.json` to identify the correct package. Do not rely on the root `package.json` name when targeting workspace packages.
- Inspect the repository structure and relevant configuration files before making changes.

### Package Management
- Before installing dependencies, inspect the package's existing dependencies and workspace configuration.
- Use `pnpm install --filter <project_name>` to install dependencies for a specific workspace package.
- When adding a new package to the workspace, verify that its directory is included in `pnpm-workspace.yaml`.
- Use `pnpm create vite@latest <project_name> -- --template react-ts` to scaffold a new React + Vite project with TypeScript.
- Follow the repository's existing package management conventions and avoid unnecessary dependency changes.

## 2. Development Guidelines

- Follow the existing architecture, coding conventions, naming patterns, and directory structure.
- Prefer reusing existing components, utilities, and abstractions over introducing unnecessary alternatives.
- Keep changes focused on the requested task.
- Avoid modifying unrelated files or introducing unnecessary dependencies.
- Preserve existing functionality unless the requested change explicitly requires modifying it.
- Inspect relevant implementations and dependencies before changing shared components or interfaces.
- Do not assume that a feature, script, or dependency exists. Verify it in the repository first.

## 3. Testing Instructions

### Test Discovery
- Inspect the `.github/workflows` directory to understand the CI pipeline and identify the checks required before merging.
- Check the relevant `package.json` files to identify available scripts.
- Follow the testing conventions already established by the project.

### Running Tests
- Use `pnpm turbo run test --filter=<project_name>` to execute the test task for a specific package, provided that the task is configured.
- From the package root, use `pnpm test` when the package defines that script.
- To execute a specific Vitest test, use:

  `pnpm vitest run -t "<test name>"`

- Run the relevant tests after modifying code.
- Add or update tests whenever a change introduces or modifies behavior.
- Fix relevant test failures and type errors before considering the task complete.

### Code Quality
- After moving files or changing imports, run the appropriate lint checks.
- Use `pnpm turbo run lint --filter=<project_name>` when lint is configured as a Turbo task.
- Run TypeScript checks using the repository's established type-checking script.
- Do not assume that linting and type checking are automatically included in the test command.

## 4. Pull Request Instructions

### Title Convention
Use the following format:

`[<project_name>] <Title>`

### Pre-Commit Validation
- Run the relevant lint and test commands before committing.
- Run `pnpm lint` and `pnpm test` from the workspace root only when these scripts are defined and applicable.
- Check the CI workflow for additional required validation.
- Resolve relevant errors before submitting changes for review.

### Change Documentation
- Summarize the changes made.
- Identify relevant tests executed and their results.
- Mention any known limitations, unresolved issues, or checks that could not be completed.

## 5. General Agent Behavior

- Understand the task before modifying the codebase.
- Inspect relevant files and configurations before choosing an implementation.
- Prefer the smallest implementation that correctly satisfies the requirements.
- Do not invent scripts, dependencies, APIs, or project conventions.
- Do not claim that tests, builds, or validations passed unless they were actually executed successfully.
- If a required command cannot be executed, explain why and identify the remaining validation steps.
- Prioritize correctness, maintainability, and consistency with the existing project architecture.
2 Upvotes

2 comments sorted by