feat: add Writing Instructions setting for LLM system prompt (v0.4.4)

New textarea in Content settings lets admins provide custom instructions
appended to the writer's system prompt. Steers style, structure, voice,
and formatting without editing code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-19 17:01:54 +07:00
parent 65560ea0b5
commit b0cc93669d
6 changed files with 66 additions and 19 deletions

View File

@@ -25,7 +25,8 @@ class ContentRequestTest extends BaseTestCase {
1000,
2500,
'Technology and innovation',
[ 'politics', 'religion' ]
[ 'politics', 'religion' ],
'Always open with a hook question.'
);
$this->assertSame( $idea, $request->get_idea() );
@@ -35,6 +36,7 @@ class ContentRequestTest extends BaseTestCase {
$this->assertSame( 2500, $request->get_max_word_count() );
$this->assertSame( 'Technology and innovation', $request->get_niche_description() );
$this->assertSame( [ 'politics', 'religion' ], $request->get_topic_exclusions() );
$this->assertSame( 'Always open with a hook question.', $request->get_writing_instructions() );
}
/**
@@ -63,6 +65,25 @@ class ContentRequestTest extends BaseTestCase {
$this->assertIsArray( $request->get_topic_exclusions() );
}
/**
* Test writing_instructions defaults to empty string when omitted.
*/
public function test_writing_instructions_defaults_to_empty(): void {
$idea_data = $this->get_article_idea_fixture();
$idea = new \PRAutoBlogger_Article_Idea( $idea_data );
$request = new \PRAutoBlogger_Content_Request(
$idea,
'auto',
'professional',
1000,
2500,
'Tech'
);
$this->assertSame( '', $request->get_writing_instructions() );
}
/**
* Test with empty topic exclusions.
*/