Skip to content
Back to skills

521 2026 02 01 19 43 34 Prompt Engineer Remnants D5f4364e

ASecurity

**Date:** 2026-02-01 **Owner:** agent **Phase:** Research **Git Commit:** 35aa99e2

  • 9 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 1, 2026
developmentpythongogitdocumentation

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 1, 2026

npx -y skills add tools-only/X-Skills --skill 521-2026-02-01_19-43-34_prompt-engineer-remnants_d5f4364e --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 521 2026 02 01 19 43 34 Prompt Engineer Remnants D5f4364e?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 521 2026 02 01 19 43 34 Prompt Engineer Remnants D5f4364e
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-521-2026-02-01-19-43-34-prompt-engineer-remnants-d/badge)](https://www.skillsdirectory.com/skills/tools-only-521-2026-02-01-19-43-34-prompt-engineer-remnants-d)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Research - Prompt Engineer Remnants Removal

**Date:** 2026-02-01
**Owner:** agent
**Phase:** Research
**Git Commit:** 35aa99e2

## Goal

Identify all remnants of the "prompt engineer" feature that can be removed now that the codebase has returned to a simple prompt system. Exclude toolprompts from consideration.

## Findings

### Dead Code (Safe to Remove)

| File | Location | Description |
|------|----------|-------------|
| `src/tunacode/core/prompting/prompting_engine.py` | Lines 82-98 | `compose_prompt()` function - never called, not exported, not used |

### Over-Engineered Code (Consider Simplifying)

| File | Location | Description |
|------|----------|-------------|
| `src/tunacode/core/prompting/prompting_engine.py` | Lines 33-40 | `register()` method - tested but never used in production |
| `src/tunacode/core/prompting/prompting_engine.py` | Lines 65-74 | Singleton pattern (`_engine`, `get_prompting_engine()`) - only used internally |
| `src/tunacode/core/prompting/prompting_engine.py` | Lines 10-62 | `PromptingEngine` class - could be replaced with a simple function |

### What IS Used (Do Not Remove)

- `resolve_prompt()` - Called from `agent_config.py:225` to resolve `{{CWD}}`, `{{OS}}`, `{{DATE}}` placeholders
- Built-in placeholder providers (CWD, OS, DATE) - Used in `system_prompt.md:124-127`

### Test File

| File | Notes |
|------|-------|
| `tests/unit/core/test_prompting_engine.py` | Tests for unused features (custom provider, singleton) will need removal/update |

### Documentation

| File | Notes |
|------|-------|
| `docs/codebase-map/modules/core-prompting.md` | Describes unused extension points (lines 56-66) |
| `docs/codebase-map/modules/00-overview.md` | Line 18 mentions "prompt engineering" |

## Recommended Removal Strategy

### Option A: Minimal (Remove Dead Code Only)

1. Delete `compose_prompt()` function (lines 82-98)
2. Keep everything else as-is

### Option B: Simplify (Flatten the Abstraction)

Replace the entire `PromptingEngine` class with a simple function:

```python
"""Prompting engine for resolving {{placeholder}} syntax in prompts."""

import os
import platform
import re
from datetime import datetime

_PLACEHOLDER_PATTERN = re.compile(r"\{\{(.+?)\}\}")

_PROVIDERS = {
    "CWD": os.getcwd,
    "OS": platform.system,
    "DATE": lambda: datetime.now().isoformat(),
}

def resolve_prompt(template: str) -> str:
    """Resolve all placeholders in the template."""
    if not template:
        return template

    def replace_match(match: re.Match[str]) -> str:
        name = match.group(1).strip()
        provider = _PROVIDERS.get(name)
        return provider() if provider else match.group(0)

    return _PLACEHOLDER_PATTERN.sub(replace_match, template)
```

This removes:
- `PromptingEngine` class
- `compose_prompt()` function
- `register()` method
- Singleton pattern
- ~50 lines of code

### Option C: Complete Removal (Inline Everything)

If placeholders are rarely changed, inline the resolution directly in `agent_config.py:load_system_prompt()`:

```python
def load_system_prompt(base_path: Path, model: str | None = None) -> str:
    prompt_file = base_path / "prompts" / "system_prompt.md"
    if not prompt_file.exists():
        raise FileNotFoundError(f"Required prompt file not found: {prompt_file}")

    content = prompt_file.read_text(encoding="utf-8")

    # Inline placeholder resolution
    replacements = {
        "{{CWD}}": os.getcwd(),
        "{{OS}}": platform.system(),
        "{{DATE}}": datetime.now().isoformat(),
    }
    for placeholder, value in replacements.items():
        content = content.replace(placeholder, value)

    return content
```

This would allow deleting the entire `src/tunacode/core/prompting/` directory.

## Files Affected by Each Option

### Option A
- `src/tunacode/core/prompting/prompting_engine.py` - Remove lines 82-98

### Option B
- `src/tunacode/core/prompting/prompting_engine.py` - Replace entirely
- `tests/unit/core/test_prompting_engine.py` - Update tests (remove class-based tests)

### Option C
- `src/tunacode/core/prompting/` - Delete entire directory
- `src/tunacode/core/agents/agent_components/agent_config.py` - Update import, inline logic
- `tests/unit/core/test_prompting_engine.py` - Delete file or move tests
- `docs/codebase-map/modules/core-prompting.md` - Delete file

## Knowledge Gaps

- Confirm whether custom placeholder registration was ever planned for future use
- Verify no other files import from `prompting_engine` besides `agent_config.py`

## References

- [`src/tunacode/core/prompting/prompting_engine.py`](https://github.com/alchemiststudiosDOTai/tunacode/blob/35aa99e2/src/tunacode/core/prompting/prompting_engine.py)
- [`src/tunacode/core/prompting/__init__.py`](https://github.com/alchemiststudiosDOTai/tunacode/blob/35aa99e2/src/tunacode/core/prompting/__init__.py)
- [`tests/unit/core/test_prompting_engine.py`](https://github.com/alchemiststudiosDOTai/tunacode/blob/35aa99e2/tests/unit/core/test_prompting_engine.py)
- [`docs/codebase-map/modules/core-prompting.md`](https://github.com/alchemiststudiosDOTai/tunacode/blob/35aa99e2/docs/codebase-map/modules/core-prompting.md)

Files in this skill

  • README.md1019 B
  • skill.md5.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.