feat: content-types tool and WordPress integration
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -13,8 +13,12 @@ use LIT\MCP\Integrations\IntegrationRegistry;
|
||||
*/
|
||||
final class InstructionsBuilder
|
||||
{
|
||||
public function __construct(private IntegrationRegistry $registry)
|
||||
/** @var (callable(): list<string>)|null */
|
||||
private $postTypeNames;
|
||||
|
||||
public function __construct(private IntegrationRegistry $registry, ?callable $postTypeNames = null)
|
||||
{
|
||||
$this->postTypeNames = $postTypeNames;
|
||||
}
|
||||
|
||||
public function build(): string
|
||||
@@ -24,17 +28,27 @@ final class InstructionsBuilder
|
||||
$this->registry->available()
|
||||
));
|
||||
|
||||
return implode("\n", [
|
||||
$lines = [
|
||||
'LIT MCP pflegt diese WordPress-Website (Inhalte, Medien, Divi 5, Pods).',
|
||||
'Aktive Integrationen: ' . $active . '.',
|
||||
];
|
||||
|
||||
if ($this->postTypeNames !== null) {
|
||||
$lines[] = 'Inhaltstypen: ' . implode(', ', ($this->postTypeNames)())
|
||||
. ' (Felder und Taxonomien: lit-content-types).';
|
||||
}
|
||||
|
||||
return implode("\n", array_merge($lines, [
|
||||
'Regeln:',
|
||||
'- Vor dem ersten Arbeitsschritt lit-guide (ohne Topic) aufrufen; Details je Thema über lit-guide '
|
||||
. 'mit topic.',
|
||||
'- Änderungen erzeugen native Divi-Module; Variablen und Presets vor festen Werten; Code-Modul nur, '
|
||||
. 'wenn kein natives Modul passt.',
|
||||
'- Den Status (Entwurf/veröffentlicht) nie ändern, außer der Nutzer verlangt es ausdrücklich.',
|
||||
'- Schreib-Tools verlangen den aktuellen rev-Wert aus dem letzten Lesevorgang.',
|
||||
'- Den Status (Entwurf/veröffentlicht) nie ändern, außer der Nutzer verlangt es ausdrücklich; '
|
||||
. 'neue Inhalte entstehen als Entwurf.',
|
||||
'- Beim Bearbeiten immer den rev-Wert aus dem letzten Lesevorgang mitgeben (Pflicht).',
|
||||
'- Löschen und Ersetzen erst nach Rückfrage beim Nutzer (confirm: true).',
|
||||
'- Fehler enthalten einen hint – ihm folgen, statt blind zu wiederholen.',
|
||||
]);
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user