From 915e97ffe10b602579ab13441c6560f1556dcc69 Mon Sep 17 00:00:00 2001 From: starmen1265 Date: Wed, 11 Mar 2026 13:01:52 +0800 Subject: [PATCH] feat(02-03): add prompt template files - prompts/__init__.py: Package marker - context_recovery.md: Session context recovery prompt - command_mapping.md: User input to GSD command mapping - error_recovery.md: User-friendly error message generation All templates use {{variable}} syntax for substitution. Co-Authored-By: Claude Opus 4.6 --- .../src/gsd_openclaw/prompts/__init__.py | 1 + .../gsd_openclaw/prompts/command_mapping.md | 21 +++++++++++++++++++ .../gsd_openclaw/prompts/context_recovery.md | 15 +++++++++++++ .../gsd_openclaw/prompts/error_recovery.md | 17 +++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 gsd-openclaw/src/gsd_openclaw/prompts/__init__.py create mode 100644 gsd-openclaw/src/gsd_openclaw/prompts/command_mapping.md create mode 100644 gsd-openclaw/src/gsd_openclaw/prompts/context_recovery.md create mode 100644 gsd-openclaw/src/gsd_openclaw/prompts/error_recovery.md diff --git a/gsd-openclaw/src/gsd_openclaw/prompts/__init__.py b/gsd-openclaw/src/gsd_openclaw/prompts/__init__.py new file mode 100644 index 0000000..6411239 --- /dev/null +++ b/gsd-openclaw/src/gsd_openclaw/prompts/__init__.py @@ -0,0 +1 @@ +# Prompt templates for GSD-OpenClaw diff --git a/gsd-openclaw/src/gsd_openclaw/prompts/command_mapping.md b/gsd-openclaw/src/gsd_openclaw/prompts/command_mapping.md new file mode 100644 index 0000000..48ab0ac --- /dev/null +++ b/gsd-openclaw/src/gsd_openclaw/prompts/command_mapping.md @@ -0,0 +1,21 @@ +# Command Mapping + +Map the following user input to a GSD slash command. + +## User Input +{{user_input}} + +## Available Commands +- /gsd:new-project - Create a new project +- /gsd:use - Switch to a project +- /gsd:status - Show current status +- /gsd:plan - Run planning phase +- /gsd:ship - Ship current phase +- /gsd:help - Show help + +## Current Context +- Project: {{current_project}} +- Phase: {{current_phase}} + +## Instructions +Determine the most appropriate command based on the user input and context. diff --git a/gsd-openclaw/src/gsd_openclaw/prompts/context_recovery.md b/gsd-openclaw/src/gsd_openclaw/prompts/context_recovery.md new file mode 100644 index 0000000..729d1b1 --- /dev/null +++ b/gsd-openclaw/src/gsd_openclaw/prompts/context_recovery.md @@ -0,0 +1,15 @@ +# Context Recovery + +You are resuming a GSD session that was interrupted. + +## Session Information +- **Project**: {{project_name}} +- **Last Active**: {{last_active_at}} +- **Current Phase**: {{current_phase}} +- **Commands Executed**: {{command_count}} + +## Last Known State +{{last_output_snapshot}} + +## Instructions +Continue from where the session left off. Do not repeat completed steps. diff --git a/gsd-openclaw/src/gsd_openclaw/prompts/error_recovery.md b/gsd-openclaw/src/gsd_openclaw/prompts/error_recovery.md new file mode 100644 index 0000000..e353b12 --- /dev/null +++ b/gsd-openclaw/src/gsd_openclaw/prompts/error_recovery.md @@ -0,0 +1,17 @@ +# Error Recovery + +An error occurred while processing a GSD command. + +## Error Details +**Command**: {{command}} +**Error**: {{error_message}} + +## Context +- Project: {{project_name}} +- Phase: {{current_phase}} + +## Instructions +Generate a user-friendly error message in Chinese that: +1. Explains what went wrong +2. Suggests possible solutions +3. Offers next steps the user can take