Skip to content

Commit 5a8a414

Browse files
committed
implement editing tasks prompts
1 parent 9471f7a commit 5a8a414

File tree

6 files changed

+66
-12
lines changed

6 files changed

+66
-12
lines changed

snippets/prompts/introduction.php

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22

33
/** @var \Kirby\Cms\Page $page
4-
** @var \Kirby\Cms\Site $site */ ?>
4+
** @var \Kirby\Cms\Site $site
5+
** @var string|null $instructions
6+
** @var string|null $edit */ ?>
57

68
<role>
79
You are a professional SEO copywriter for <?= $site->title() ?>. Create high-quality content. Mimic the site's tone and style. You'll be rewarded based on the conversion rate.
@@ -15,4 +17,31 @@
1517
- NEVER output any formatting. No new lines, no HTML tags, no quotes, no markdown.
1618
- NEVER output or introduce information that is not provided in the content.
1719
- NEVER output duplicate content in the same answer.
18-
</rules>
20+
</rules>
21+
22+
<?php if (isset($edit) && $edit !== null && $edit !== '') : ?>
23+
<primary-editing-task>
24+
YOU ARE EDITING EXISTING CONTENT - NOT CREATING NEW CONTENT.
25+
26+
Current text that needs editing:
27+
<current-value><?= $edit ?></current-value>
28+
29+
CRITICAL EDITING RULES:
30+
- Start from the text above and modify ONLY what is requested
31+
- Preserve as much of the original as possible
32+
- Keep the same style, tone, and structure
33+
- Change ONLY the specific parts mentioned in the instructions below
34+
- If no specific change is mentioned for something, leave it unchanged
35+
</primary-editing-task>
36+
<?php endif ?>
37+
38+
<?php if (isset($instructions) && $instructions !== null && $instructions !== '') : ?>
39+
<user-instructions>
40+
<?php if (isset($edit) && $edit !== null && $edit !== '') : ?>
41+
Apply ONLY these changes to the text above:
42+
<?php else : ?>
43+
The user has provided these specific instructions:
44+
<?php endif ?>
45+
<?= $instructions ?>
46+
</user-instructions>
47+
<?php endif ?>

snippets/prompts/tasks/description.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<?php
22

33
/** @var \Kirby\Cms\Page $page
4-
** @var \Kirby\Cms\Site $site */
4+
** @var \Kirby\Cms\Site $site
5+
** @var string|null $instructions
6+
** @var string|null $edit */
57

68
$meta = $page->metadata();
79

8-
snippet('seo/prompts/introduction'); ?>
10+
snippet('seo/prompts/introduction', [
11+
'instructions' => $instructions ?? null,
12+
'edit' => $edit ?? null
13+
]); ?>
914

1015
<task>
1116
Create a useful meta description for this page called <page-title><?= $page->title()->value() ?></page-title>. <?php if ($page->isHomePage()) : ?>This page is the homepage of the website.<?php endif ?>

snippets/prompts/tasks/og-description.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<?php
22

33
/** @var \Kirby\Cms\Page $page
4-
** @var \Kirby\Cms\Site $site */
4+
** @var \Kirby\Cms\Site $site
5+
** @var string|null $instructions
6+
** @var string|null $edit */
57

68
$meta = $page->metadata();
79

8-
snippet('seo/prompts/introduction'); ?>
10+
snippet('seo/prompts/introduction', [
11+
'instructions' => $instructions ?? null,
12+
'edit' => $edit ?? null
13+
]); ?>
914

1015
<task>
1116
Create a useful open graph description for this page called <page-title><?= $page->title()->value() ?></page-title>. <?php if ($page->isHomePage()) : ?>This page is the homepage of the website.<?php endif ?>

snippets/prompts/tasks/og-site-description.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<?php
22

33
/** @var \Kirby\Cms\Page $page
4-
** @var \Kirby\Cms\Site $site */
4+
** @var \Kirby\Cms\Site $site
5+
** @var string|null $instructions
6+
** @var string|null $edit */
57

6-
snippet('seo/prompts/introduction'); ?>
8+
snippet('seo/prompts/introduction', [
9+
'instructions' => $instructions ?? null,
10+
'edit' => $edit ?? null
11+
]); ?>
712

813
<task>
914
Create a useful GLOBAL open graph description for this site <site-title><?= $site->title()->value() ?>.</site-title>

snippets/prompts/tasks/site-description.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<?php
22

33
/** @var \Kirby\Cms\Page $page
4-
** @var \Kirby\Cms\Site $site */
4+
** @var \Kirby\Cms\Site $site
5+
** @var string|null $instructions
6+
** @var string|null $edit */
57

6-
snippet('seo/prompts/introduction'); ?>
8+
snippet('seo/prompts/introduction', [
9+
'instructions' => $instructions ?? null,
10+
'edit' => $edit ?? null
11+
]); ?>
712

813
<task>
914
Create a useful GLOBAL meta description for this site <site-title><?= $site->title()->value() ?>.</site-title>

snippets/prompts/tasks/title.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
use Kirby\Toolkit\Str;
44

55
/** @var \Kirby\Cms\Page $page
6-
** @var \Kirby\Cms\Site $site */
6+
** @var \Kirby\Cms\Site $site
7+
** @var string|null $instructions
8+
** @var string|null $edit */
79

810
$meta = $page->metadata();
911

10-
snippet('seo/prompts/introduction'); ?>
12+
snippet('seo/prompts/introduction', [
13+
'instructions' => $instructions ?? null,
14+
'edit' => $edit ?? null
15+
]); ?>
1116

1217
<task>
1318
Create a useful meta title for this page called <page-title><?= $page->title()->value() ?></page-title>. <?php if ($page->isHomePage()) : ?>This page is the homepage of the website. AVOID an overly generic title such as 'Home'.<?php endif ?>

0 commit comments

Comments
 (0)