| name | promptcontext |
| description | Write the context section of an agent prompt — runtime facts the agent needs to orient itself, such as working directory, platform, and date. Use when the agent operates on files, runs commands, or reasons about time. |
| license | MIT |
Promptcontext
Output: a ## Context section (Markdown, default) or <context> block (XML) written to prompts/{slug}.context.md.
Context
Define what the agent knows about its runtime environment: where it is operating, on what platform, and what project or session-level facts bear on its work. Context is static per session — it does not change between tasks.
Tradeoff: Under-specifying context produces vague, decontextualized output. Over-specifying restricts flexibility and dilutes the prompt budget. Include only fields the agent will reason about for this task; omit everything it can infer or ignore.
Scope: This skill covers runtime environment facts only. Agent identity belongs in promptrole. Operational rules belong in promptbehavior. The immediate task belongs in prompttask. Tool definitions are separate.
Task
Apply to the User's Input
The user invokes this skill with a description of the agent or its operating environment. Specialize every step below to that input.
- Derive which fields are needed from what the agent will actually do.
- If the agent reads or writes files → include working directory.
- If the agent runs shell commands or output depends on OS → include platform.
- If the agent reasons about time, recency, or schedules → include date.
- If the agent performs version control operations → include git state.
- If the agent refers to the project by name or needs to understand its scope → include project name or description.
- Omit any field the agent has no reason to act on.
- If the input does not indicate what operations the agent will perform, ask one clarifying question before drafting.
- If the user says "xml", "as xml", or "xml format", produce XML output; otherwise default to Markdown.
Part A: Select Fields
Choose from the canonical set. Include only what the agent will act on.
| Field | Include when |
|---|
| Working directory | Agent reads, writes, or references files or paths |
| Platform / OS | Commands or path syntax are OS-sensitive |
| Date | Agent reasons about time, recency, or schedules |
| Git state | Agent performs version control operations |
| Project name / description | Agent refers to the project by name or needs scope awareness |
NEVER include tool definitions, behavioral rules, or task content in this section — those belong in their own sections.
Part B: Draft the Block
Write a concise environment block.
- Static values (platform, OS) go as plain text literals.
- Dynamic values that change per session (working directory, date, git branch) go as
{placeholder} names — concrete and unambiguous (e.g. {working_directory}, {current_date}, {git_branch}).
- Keep each entry to one line: field name and value, nothing else.
Part C: Format the Output
Markdown (default) — open with ## Context, then the content:
## Context
Working directory: {working_directory}
Platform: macOS
Date: {current_date}
XML — wrap content in <context> tag, no heading:
<context>
Working directory: {working_directory}
Platform: macOS
Date: {current_date}
</context>
Verification
- Every field listed is one the agent will reason about for this task type.
- No tool definitions, behavioral rules, or task content appears in the block.
- Dynamic fields use named placeholders, not dummy values.
- Placeholder names are unambiguous (not
{value} or {x}).
- Format matches user's request:
## Context heading for Markdown, <context> wrapper for XML.
Derive a slug: kebab-case of the 2–3 most distinctive words in the agent description (e.g. "Python file refactoring agent" → python-refactor). Create the prompts/ directory if it does not exist. Write the file to prompts/{slug}.context.md. Confirm the file path. No other output.