AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How Do Software Engineers Create Custom Slash Commands in Continue Using Markdown Prompt Files and Dynamic Context?

Solène Génard · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Typing the exact same fifty-word prompt into an AI chat sidebar fifteen times a day is developer purgatory. Software engineers refactoring legacy code, formatting Conventional Commits, drafting API contracts, or diagnosing stack traces waste thousands of keystrokes explaining the exact same operational boundaries to their local models. For a long time, the only alternative in Continue was cramming escaped strings into a personal, unversioned config.json buried in ~/.continue/. It was fragile, solitary, and impossible to scale across an engineering squad.

Continue fixed this fundamental friction by introducing native Markdown prompt files and dynamic context providers. At 365Finds, we consider project-level prompt files to be one of the cleanest architectural shifts in open-source AI tooling: they turn team conventions into executable Git-tracked slash commands (/commit, /review, /doc) without requiring external SaaS registries or proprietary runtime lock-in.


The Architecture: Why Prompt Files Replace Global Configs

Legacy Continue configurations required custom commands to live inside a user-level configuration file as raw JSON strings. Every newline had to be escaped with \n, multiline instructions turned into unreadable blocks of escaped text, and sharing a command with a teammate meant pasting JSON snippets over Slack. Even worse, backend teams working on Go microservices and frontend teams writing Next.js had to share the same monolithic global file.

Modern Continue solves this by treating prompts as first-class Markdown documents (.md). Continue scans two specific directory levels:

  1. Workspace Level (<project-root>/.continue/prompts/): Prompts placed here are project-specific. When committed to Git, every engineer who clones the repository instantly inherits the exact same slash commands inside VS Code or JetBrains.
  2. Global Level (~/.continue/prompts/): Prompts placed in the user home directory apply across all projects on that local machine, ideal for personal utility workflows.

When Continue initializes or detects a change in these folders, it parses the YAML frontmatter at the top of each .md file. If the file declares invokable: true, Continue registers the prompt name directly into its slash command autocompletion menu in Chat, Plan, and Agent modes.


Anatomy of an Invokable Prompt File

A valid Continue prompt file requires a YAML frontmatter block followed by the prompt template body. The frontmatter controls discovery, naming, and command behavior:

---
name: review
description: Review staged or selected code for security vulnerabilities, edge cases, and style conventions
invokable: true
---

You are a senior staff engineer conducting a thorough code review.

Evaluate the provided code changes with high skepticism. Focus specifically on:
1. **Security Vulnerabilities:** Injection risks, improper authentication checks, unhandled edge cases, and exposed secrets.
2. **Performance Regressions:** Unnecessary allocations, unbounded queries, $N+1$ loops, and thread-safety hazards.
3. **Idiomatic Cleanliness:** Consistency with our repository's existing abstractions and error-handling paradigms.

Structure your feedback:
- **Blockers:** Issues that must be addressed before merging.
- **Suggestions:** Opportunities for elegance or performance improvements.
- **Nitpicks:** Purely stylistic remarks.

Code context under review:
{{{ input }}}

Key Frontmatter Fields


Injecting Dynamic Context: @diff, @file, and @codebase

Static instructions solve only half the battle. High-value prompts require precise runtime context from the developer's working environment. Continue solves this through built-in context providers accessed via @ mentions, which can be injected dynamically during chat invocation or embedded directly into team prompt designs.

Context ProviderRuntime MechanismPrimary Engineering Use Case
@diffExtracts uncommitted or staged Git branch modifications.Automated Conventional Commits, pre-PR security audits, pull request summaries.
@fileIngests the entire contents of a specified workspace file.Interface documentation, architectural conformance checks, refactoring scripts.
@codebasePerforms semantic retrieval and keyword indexing across workspace files.Feature impact analysis, cross-package dependency checks, finding reference implementations.
@terminalCaptures the output buffer of the active IDE integrated terminal.Build failure triage, compiler error diagnosis, test trace analysis.
@problemsPulls linter, type-checker, and compiler diagnostics from the IDE panel.Batch fixing ESLint, Pyright, or Rust analyzer warnings.

Practical Scenario 1: The Zero-Friction Commit Message Generator

Every engineering team wants standardized commit messages, yet manually drafting Conventional Commits often leads to vague messages like fix bug or update api.

Create <project-root>/.continue/prompts/commit.md:

---
name: commit
description: Draft a Conventional Commit message from current git changes
invokable: true
---

You are an automated Git commit assistant for our production repository.

Review the staged Git changes provided below and generate a single, professional commit message adhering strictly to Conventional Commits (v1.0.0):

Format:
<type>(<optional scope>): <short description in imperative mood>

[optional body explaining 'why', not 'how']

[optional breaking change / issue reference footer]

Rules:
- Allowed types: `feat`, `fix`, `docs`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`.
- Description must not start with a capital letter and must not end with a period.
- Do not invent changes not present in the diff.
- Return only the commit message inside a raw code fence for quick copy-pasting.

Git Diff Context:
@diff
{{{ input }}}

When an engineer stages their changes (git add .) and types /commit in the Continue sidebar, Continue grabs the working tree diff through @diff, resolves any optional flags supplied by the developer, and outputs a ready-to-use commit message within seconds.

Practical Scenario 2: High-Precision API Contract & Documentation

When developing backend microservices, keeping OpenAPI specifications and Markdown documentation aligned with handler signatures is notoriously prone to drift.

Create <project-root>/.continue/prompts/doc-endpoint.md:

---
name: doc-endpoint
description: Generate comprehensive API documentation for the active endpoint handler
invokable: true
---

Analyze the selected endpoint controller code and generate standardized internal documentation:

Context:
- Primary file under inspection: @file
- Additional developer notes: {{{ input }}}

Output Requirements:
1. **Endpoint Overview:** Method, route path, authentication requirements, and rate limit tiers.
2. **Payload Schema:** Request body parameters, JSON data types, optionality, and validation constraints.
3. **Response Matrix:** HTTP status codes (`200`, `400`, `401`, `404`, `500`) with representative JSON payloads.
4. **Error Handling:** Explicit error codes returned by domain services.

An engineer can highlight a Go Gin handler or a FastAPI route, invoke /doc-endpoint, and receive a fully formatted documentation block ready to drop directly into repository wiki docs or Postman collections.


Version Controlling Slash Commands Across the Team

The defining advantage of Continue's file-based prompt architecture is repository cohesion. At 365Finds, we strongly recommend establishing a team workflow around .continue/prompts/:

my-project-repo/
├── .continue/
│   ├── prompts/
│   │   ├── commit.md
│   │   ├── review.md
│   │   ├── refactor.md
│   │   └── test-suite.md
│   └── config.yaml
├── src/
├── tests/
└── package.json

Implementation Workflow

  1. Commit Prompts Directly to Git: Add .continue/prompts/ to version control (git add .continue/prompts/). Do not add .continue/prompts/ to .gitignore. Keep sensitive credentials or personal API keys in environment variables or user-level ~/.continue/config.yaml.
  2. Review Prompts via Pull Requests: When updating repository conventions—such as migrating from Jest to Vitest, or enforcing a new error-handling pattern—update the corresponding prompt file in a pull request. The team reviews prompt modifications using the exact same code review standards applied to production logic.
  3. Zero Configuration for New Hires: When an onboarding engineer clones the repo and installs the Continue extension in VS Code or JetBrains, their editor immediately recognizes the repository's .continue/prompts/ directory. They type / and have access to identical slash commands calibrated to the codebase's specific standards on day one.

365Finds Strategic Evaluation

Workflow DimensionLegacy config.json CommandsContinue Markdown Prompt FilesProprietary Cloud Extensions
Team SynchronizationManual snippet copying; high driftNative Git tracking; instant sync on git pullCentralized web dashboard; cloud sync
Authoring ExperiencePainful escaped JSON strings (\n)Clean native Markdown formattingGUI web form builder
Vendor IndependenceLocal open-source runtimeLocal open-source runtimeProprietary platform lock-in
Dynamic Context HookingLimited string substitutionDirect integration with @diff, @file, @codebaseCloud-dependent indexers
Maintenance CostHigh individual overheadLow, shared repository maintenanceMonthly SaaS per-seat subscription

365Finds views Continue's Markdown prompt architecture as a decisive win for developer autonomy. Many enterprise AI tools attempt to lock engineering organizations into proprietary web portals and expensive per-seat subscription models simply to manage prompt libraries. By anchoring slash commands to simple Markdown files in the project root, Continue proves that effective prompt engineering belongs inside version control, alongside the code it manipulates.


References