---
title: "ADR-069: Remove the unusable PromptTemplate stack"
manual: "TYPO3 LLM Extension"
version: "0.35"
permalink: "https://docs.typo3.org/permalink/netresearch/nr-llm:adr-069@0.35"
source: "Adr/Adr069RemovePromptTemplateStack.rst"
modified: "2026-09-16T22:09:16+00:00"
---

# ADR-069: Remove the unusable PromptTemplate stack

-   *Status:* Accepted
-   *Date:* 2026-07-16
-   *Authors:* Netresearch DTT GmbH

## Context

The extension shipped a `PromptTemplate` domain stack from an early
design phase: the `DomainModelPromptTemplate` entity, its
`DomainRepositoryPromptTemplateRepository`, the
`ServicePromptTemplateService` (+ `PromptTemplateServiceInterface`),
the `ExceptionPromptTemplateNotFoundException`, and the
`tx_nrllm_prompttemplate` table in `ext_tables.sql`.

The stack was never usable at runtime and had no production consumers:

-   **No TCA.** `Configuration/TCA/` has no
    `tx_nrllm_prompttemplate.php` and
    `Configuration/Extbase/Persistence/Classes.php` has no
    `PromptTemplate` mapping. Without either, Extbase cannot map the
    table, so every `PromptTemplateRepository` method fails at
    runtime.
-   **Zero consumers.** Nothing injected
    `PromptTemplateServiceInterface` or the repository. The only
    `PromptTemplate` references elsewhere were the unrelated
    `Task::getPromptTemplate()` / `prompt_template` **string**
    column and ADR-031's contrast with `PromptSnippet`.
-   **No coverage.** No functional test loaded the `PromptTemplates.csv`
    fixture; the repository had 0% coverage from every suite. The service
    was unit-tested only against a mocked repository, so the runtime gap
    never surfaced. This was found while closing zero-coverage gaps
    (GitHub issue #399).

The stack was superseded twice: ADR-031 introduced the lightweight
`PromptSnippet` library for reusable prompt fragments, and the
`Task` entity (with its `prompt_template` string field) covers
predefined, editor-managed prompts. Adding TCA plus functional tests to
resurrect the stack would invest in a surface no code uses.

## Decision

Remove the dormant PromptTemplate stack in full:

-   the `DomainModelPromptTemplate` entity and
    `DomainRepositoryPromptTemplateRepository`;
-   the `ServicePromptTemplateService` and
    `ServicePromptTemplateServiceInterface`, including the public
    interface alias in `Configuration/Services.yaml`;
-   the `ExceptionPromptTemplateNotFoundException` (used solely by
    the removed service);
-   the `tx_nrllm_prompttemplate` `CREATE TABLE` block in
    `ext_tables.sql`;
-   the unit tests and the `PromptTemplates.csv` functional fixture that
    covered only the removed classes.

`Task`'s unrelated `prompt_template` string field,
`PromptSnippet`, and ADR-031 are untouched.

## Consequences

-   **BREAKING (public API).** `ServicePromptTemplateService` and
    `ServicePromptTemplateServiceInterface` are removed from the DI
    container. Any external caller resolving them would have failed at
    runtime already (no TCA), so no working integration can break; the
    removal is nonetheless a public-surface change and is called out for
    completeness. Pre-1.0, this is acceptable.
-   **Orphaned database table.** `tx_nrllm_prompttemplate` is no longer
    declared. TYPO3 does not drop tables automatically; on existing
    installations the table becomes orphaned. Operators remove it via the
    database analyzer (**Admin Tools > Maintenance > Analyze
    Database Structure**). No upgrade wizard is provided — the table held
    no data any code ever wrote.
-   **Public-service count: 27 → 26.** Removing the
    `PromptTemplateServiceInterface` alias drops the audited
    `public: true` count from 27 (ADR-065) to 26. This ADR is the new
    count authority, superseding ADR-065's count exactly as ADR-065
    superseded ADR-028's. The breakdown is now
    14 + 5 + 1 + 4 + 2 = **26**: ADR-065's Category B (supporting-service
    interface aliases) drops from 6 to 5. The
    `TestsUnitConfigurationPublicServicesPolicyTest`
    `EXPECTED_PUBLIC_TRUE_COUNT` constant and this ADR are the audit
    trail. ADR-065 remains the record of the 45 → 27 reduction.
-   **One prompt surface, not two.** ADR-031's "two prompt-related
    entities now coexist" no longer holds: `PromptSnippet`
    (fragments) and `Task` (predefined prompts) are the remaining
    surfaces.
