1
placeholder system
Alexey Efimchik edited this page 2026-04-02 10:48:12 +07:00

🛠️ Placeholder System

📌 Introduction

This section describes the system for replacing placeholders in instrument setup files. This is useful when redefining prompts and other custom settings.

1. What are Placeholders

Placeholders are special markers in the format %NAME% that are automatically replaced with corresponding values during execution.

Example:

<!-- Before replacement -->
Repository: %REPOSITORY%, PR: #%PRID%, %SOURCE_BRANCH% → %TARGET_BRANCH%

<!-- After replacement -->
Repository: my-project, PR: 123, feature/new-login → main

This is used when creating new prompts and other customizations. See examples in the templates.


2. Available Placeholders

2.1. Common Placeholders (for all VCS)

Placeholder Description Example Value
%VCS% VCS system type Gitea
%SOURCE_BRANCH% Source branch (with changes) feature/add-auth
%TARGET_BRANCH% Target branch (merge destination) main
%REPOSITORY% Repository name backend-api
%PRID% Pull Request ID 456
%COMMIT% Commit SHA in source branch abc123def456789
%TARGETBRANCHCOMMIT% Commit SHA in target branch xyz789abc123456

2.2. Gitea-Specific Placeholders

Placeholder Description Example Value
%OWNER% Repository owner my-team
%BASEURL% Gitea server address https://code.example.io

2.3. Where Placeholders Work

Placeholders are supported if you use options_type with the values folder or arguments. This only works for CI/CD configuration and setting overrides.

File/Parameter Support Note
.review/PROMPT.md or cc_prompt Yes
.review/ALLOWED_TOOLS.md or cc_allowed_tool No Placeholders not supported
.review/DISALLOWED_TOOLS.md or cc_disallowed_tool No Placeholders not supported
.review/CONSTITUTION.md No Placeholders not supported

3. Usage Examples

Below is an example of using placeholders when overriding a prompt using .review/PROMPT.md file:

# AI Code Reviewer for %REPOSITORY%

## Repository Info
- VCS: %VCS%
- Server: %BASEURL%
- Owner: %OWNER%
- Repository: %REPOSITORY%

## Pull Request Context
- PR: #%PRID%
- Branch: %SOURCE_BRANCH% → %TARGET_BRANCH%
- Commits: %COMMIT% → %TARGETBRANCHCOMMIT%

## Your Role
Review PR #%PRID% for %REPOSITORY%, comparing %SOURCE_BRANCH% against %TARGET_BRANCH%.

After replacement it will look like this:

# AI Code Reviewer for backend-api

## Repository Info
- VCS: Gitea
- Server: https://code.example.io
- Owner: my-team
- Repository: backend-api

## Pull Request Context
- PR: #123
- Branch: feature/add-auth → main
- Commits: abc123def → xyz789abc

## Your Role
Review PR #123 for backend-api, comparing feature/add-auth against main.