Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 1, 2025

Adds optional persona files that render first in prompt.md output, before memories and tasks. Personas define the AI agent's role or character.

Changes

  • CLI usage: Persona is specified as an optional positional argument after task name: coding-context <task-name> [persona-name]
  • CLI flag: Added -r <path> for persona directories
  • Default directories: .prompts/personas, ~/.config/prompts/personas, /var/local/prompts/personas
  • Processing order: Persona (if specified) → Memories → Task
  • No template expansion: Personas are included as-is without variable substitution
  • Error handling: If persona is requested but not found, returns an error
  • Tests: Added 3 integration tests covering basic usage, optional usage, and error cases

Usage

# Define persona (no template variables - included as-is)
cat > .prompts/personas/expert.md << 'EOF'
# Expert Developer
You are an expert software engineer with deep knowledge of best practices.
EOF

# Use with task (persona as optional positional argument)
coding-context add-feature expert

Output order in prompt.md:

# Expert Developer (persona first, no variable expansion)
# Project Context (memories)
# Task: Add Feature (task last)

Persona is fully optional - omitting the persona argument produces identical output to current behavior.

Original prompt

I need to support an optional persona too. This should operate in a similar fashion to the task. The persona should be the first output.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits November 1, 2025 02:46
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for optional persona functionality Add optional persona support with first-position output Nov 1, 2025
Copilot AI requested a review from alexec November 1, 2025 02:57
@alexec
Copy link
Contributor

alexec commented Nov 1, 2025

@copilot Use "-r" for the personas. Requesting a persona is optional, but if one is requested, and it in not found, that is an error. Make persona on optional argument after the taskName. Persona don't need expanded variables or filters.

Copy link
Contributor Author

Copilot AI commented Nov 1, 2025

@copilot Use "-r" for the personas. Requesting a persona is optional, but if one is requested, and it in not found, that is an error. Make persona on optional argument after the taskName. Persona don'...

Done. Changes made in commit 168d6ad:

  1. ✅ Changed flag from -P to -r for persona directories
  2. ✅ Made persona an optional positional argument after taskName: coding-context <task-name> [persona-name]
  3. ✅ Removed template variable expansion from personas - they're now included as-is
  4. ✅ Error handling already in place - if persona is requested but not found, returns error

New usage:

coding-context add-feature expert  # with persona
coding-context add-feature         # without persona

@alexec alexec marked this pull request as ready for review November 1, 2025 03:20
@alexec alexec merged commit 54734fa into main Nov 1, 2025
2 checks passed
@alexec alexec deleted the copilot/add-optional-persona-support branch November 1, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants