Prompt-engineering and AI workflows hero image
"MIT Museum: Kismet the AI robot smiles at you" by Chris Devers is licensed under CC BY-NC-ND 2.0

Prompt-engineering and AI workflows

A personal dialogue related to using our LLM frenemies

Introduction

I haven't yet entirely come around on the ethics of the tools we are rapidly being exposed to in our day to day, though I certianly feel ass though it's necessary to ride the wave or jump on the bandwagon as it were - to ensure my future is secure.


Prompts

An efficient prompt is one that maximizes the AI’s ability to generate accurate, useful, and contextually relevant responses while minimizing unnecessary token consumption.

Key characteristics of effective prompts include123:

  • Clarity and Specificity: Prompts should be unambiguous, detailing exact inputs, expected outputs, and constraints. Vague or overly broad prompts lead to irrelevant or generalized responses, increasing token waste and requiring more user intervention.
  • Structured and Contextual: Breaking complex tasks into smaller, logical steps and providing relevant context (e.g., referencing specific files, previous code snippets, or architectural constraints) improves AI comprehension and response quality.

For example, instead of asking “How do I implement authentication?”, a well-crafted prompt would specify:

Implement OAuth2 authentication for Google and GitHub providers in a Node.js app. Use Passport.js with the following constraints:

- No use of `eval()`; only parameterized queries.
- Follow the conventional commits format for commit messages.
- Add environment variables for OAuth credentials in a `.env` file.

N.B. There's debate surronding the future of prompt engineering4 and how necessary it'll be into the future, however right now it has a large impact of the quota usage you'll be subject of.

When to Save Prompts

Prompts should be saved into a prompt library5 when they meet the following criteria:

  • Reusability: The prompt addresses a recurring task or workflow that multiple team members or projects will encounter.
  • Proven Effectiveness: The prompt has been tested and refined to reliably produce high-quality outputs.
  • Contextual Relevance: The prompt includes or references specific context (e.g., project files, build commands) that is stable and reusable across sessions.

Skills

Encapsulate a workflow which requires consistent quality and adherence to constraints. Enforce best practices and reduce reliance on individual prompt writers, enabling team-wide reuse and onboarding.

Custom Agents

Custom Agents are suited for tasks that require a separate workspace to avoid cluttering the main chat, such as planning, implementation, or security reviews. They enable parallel execution and are useful when tasks are large, complex, or require independent handling.


Prompts vs. Skills vs. Custom Agents

FeaturePromptsSkillsCustom Agents
ReusabilityLow; typically one-offHigh; designed for reuseModerate; reusable but task-specific
StructureFlexible, free-formStructured, defined inputs/outputsStructured, role-specific
Execution ContextRuns in current sessionRuns within main agent contextFlexible
Use CasesExploration, debugging, one-off tasksRepeated workflows, onboardingComplex, independent tasks
Maintenance OverheadMinimalRequires versioning and updatesModerate; needs context management
Token EfficiencyCan be inefficient if vagueOptimized for reuse, reduces token loadCan reduce token load by isolating tasks

Strategies for Optimizing Token Usage6 7

Token optimization is critical for cost-effective AI usage, especially under usage-based billing models. Key strategies include:

  • Model Selection: Use lighter models for simple tasks and reserve advanced models for complex reasoning and refactoring.
  • Separate Planning and Implementation: Plan first with a reasoning model, then implement with a cheaper/faster/lower reasoning model to reduce token consumption.
  • Context Management: Start new chat sessions for unrelated tasks, use an equivalent context compaction command to summarize long conversations, and exclude irrelevant files from context.
  • Disable Unused Tools: Prevent unnecessary tool calls that consume tokens without adding value.
  • Use Tools Over Thought: Try to ensure you're spending tokens on the 'thinking' side of the process or the creative implementation activity. Any repetitive 'deterministic' tasks should be offloaded to programmed solutions/plugins and wrapped in skills the LLM can make use of.
  • Custom Skills for Preprocessing: Use skills to preprocess prompts, stripping noise and redundancy before sending to the model. There are also tools that may aid in automatically processing prompts which could be implemented.
  • Monitoring and Debugging: Regularly review token usage via Agent Debug Logs and the Copilot status dashboard to identify and correct inefficient workflows.

Instruction Files

Strong instruction files are critical for guiding AI assistants within coding projects. They act as a centralized source of truth for project-specific information, significantly reducing the need for the AI to hunt through codebases or repeatedly ask for clarification. They provide the following benefits:

  • Context Preservation: Instruction files provide persistent context across sessions, eliminating the need to re-explain project conventions, coding standards, or architectural decisions.
  • Token Efficiency: By pre-loading the AI with relevant instructions, you prevent token waste from repetitive explanations or context-seeking questions.
  • Consistency: Ensures all team members and AI interactions adhere to the same standards without manual reinforcement.
  • Onboarding Acceleration: New developers (human or AI) can quickly understand project-specific requirements.

Instruction files should be:

  • Comprehensive: Cover all project-specific conventions (coding style, testing requirements, deployment processes).
  • Structured: Use clear sections and bullet points for easy parsing by both humans and AI.
  • Maintainable: Version-controlled and updated alongside the project.

Learning Materials

The citations on this page can act as good reference points for building understanding. However the following certifications/official training can also aid in growing confidence:

There are also many useful references for building skills and agents that appear successful here:

Citations

1

GitHub. "Prompt engineering for GitHub Copilot." GitHub Docs, 2024. https://docs.github.com/en/copilot/concepts/prompting/prompt-engineering

2

Beam.ai. "Stop Wasting Prompts: 10 AI Techniques That Actually Work". 2025. https://beam.ai/agentic-insights/stop-wasting-prompts-10-ai-techniques-that-actually-work

3

Google Cloud. Prompt engineering: overview and guide, 2026. https://cloud.google.com/discover/what-is-prompt-engineering

4

MIT Sloan Teaching & Learning Technologies. "Effective Prompts for AI: The Essentials" https://mitsloanedtech.mit.edu/ai/basics/effective-prompts

5

Ionos. What is a prompt library? Explanation, benefits, and best practicesk, 2026. https://www.ionos.com/digitalguide/websites/web-development/prompt-library

6

Visual Studio Code. Optimize AI credit usage in VS Code, 2026. https://code.visualstudio.com/docs/agents/guides/optimize-usage

7

Visual Studio Code. Best practices for using AI in VS Code, 2026. https://code.visualstudio.com/docs/agents/best-practices