# Pbe String Transformation

> Programming-by-Example String Transformation

- Skill: `siddhu1716/pbe-string-transformation` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add siddhu1716/pbe-string-transformation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/siddhu1716/pbe-string-transformation/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: siddhu1716 (https://skillmd.com/u/siddhu1716)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/siddhu1716/pbe-string-transformation

---

# Programming-by-Example String Transformation

## When to use this skill
Solve Programming-by-Example (PBE) tasks by finding an ordered sequence of Python `replace(A, B)` calls to transform input strings to output strings.

## Approach
1. **Analyze Patterns**: Identify character transformations by comparing the exact inputs and outputs.
2. **Order by Specificity**: Place replacements for longer strings first. If you replace a single character first, it may destroy the context needed for replacing longer strings containing that character later (known as bleeding).
3. **Trace Sequential Execution**: Evaluate how the output of the first replace call affects subsequent replace calls (known as feeding).
4. **Enclose output**: Format the final program sequence strictly as a Python list of strings inside a ```python ``` markdown block, e.g. `["replace('a', 'b')"]`.

## Known constraints
- Arguments A and B in `replace(A, B)` must have length <= 3.
- Predicate A must have length >= 1.
- Maximum of 5 programs per sequence.

## Examples
### Good output pattern
```python
["replace('bc', 'dc')", "replace('ad', 'ed')"]
```

