agentleFS
Cogni-AI-OUCogni-AI-OU/cogni-ai-agent-skills/ai-prompt-writer/SKILL.md

ai-prompt-writer

Skill4 starsChanged 6 months agoMITView on GitHub

Design, review, and optimize secure AI prompts using advanced prompt engineering patterns, safety frameworks, and injection mitigation strategies.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Secure Construction: Never directly interpolate untrusted input.

    line 24
  2. Distinctive:

    Document prompt purpose, scope, assumptions, and limitations.

    line 46
  3. Distinctive:

    When writing strict procedural code (like Python or Bash scripts) where natural language ambiguity is unacceptable.

    line 50
  4. Very specific:

    When generating general project documentation without targeting an AI consumer (use docs-writer instead).

    line 52
  5. Distinctive:

    Ignoring Artifacts: Don't refine prompts based on error feedback.

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: AI Prompt Writer

<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->

Design, review, and optimize secure AI prompts using advanced prompt engineering patterns, safety frameworks, and injection mitigation strategies.

Core Process

  1. Contextualize: Define explicit tasks, target audience, and precise constraints (format, length, tone).
  2. Pattern Selection: Apply Zero-Shot for simple tasks, Few-Shot for formats, Chain-of-Thought for reasoning, and Role Prompting for specialized contexts.
  3. Harden: Sanitize all dynamic inputs to prevent prompt injection and data leakage.
  4. Validate: Red-team against bias, harmful outputs, and edge cases.

Core Principles

  • Clarity over Verbosity: Issue concise, unambiguous directives. Drop conversational filler.
  • Strict Constraints: Dictate exact output structures (JSON, markdown) and scope boundaries.
  • Secure Construction: Never directly interpolate untrusted input. Use parameterization or robust sanitization (e.g., Translate this text: [SANITIZED_USER_INPUT]).
  • Data Minimization: Exclude sensitive, personal, or proprietary data from prompts.
  • Neutrality: Enforce inclusive language; eliminate demographic or contextual assumptions.

When to Use

  • Engineering system prompts, LLM templates, or Copilot instructions.
  • Auditing existing prompts for injection vulnerabilities or data leakage risks.
  • Defining automated prompt evaluation metrics or safety checklists.

Commands / Usage Patterns

  • Role Setup: You are a <role> with <years> experience in <domain>. Review <target> and identify <issues>.
  • Chain-of-Thought: Solve this step-by-step: 1. <step 1> ...
  • Few-Shot Validation: Input: <example_in> \n Output: <example_out>
  • Injection Defense: Replace `Text: ${userInput}` with `Text: ${sanitizeInput(userInput)}`.

Best Practices

  • Standardize inputs using clear delimiters (e.g., """, ###, <tag>).
  • Implement content moderation pre/post-processing for user-facing AI pipelines.
  • Establish A/B testing and automated evaluation for continuous prompt refinement.
  • Document prompt purpose, scope, assumptions, and limitations.

When Not to Use

  • When writing strict procedural code (like Python or Bash scripts) where natural language ambiguity is unacceptable.
  • For managing low-level hardware or infrastructure where strict, deterministic APIs should be used instead of LLMs.
  • When generating general project documentation without targeting an AI consumer (use docs-writer instead).

Common Pitfalls

  • Too Vague: "Make the code better" → Specify exactly what "better" means.
  • Too Restrictive: Over-constraining can prevent useful optimizations.
  • Missing Context: Include relevant domain knowledge and terminology.
  • No Examples: Concrete examples guide an LLM better than abstract descriptions.
  • Ignoring Artifacts: Don't refine prompts based on error feedback.

What to Avoid

  • Unbounded Inputs: Permitting raw user input to override system instructions.
  • Overfitting: Hardcoding constraints tied to specific training data examples.
  • Echoing Secrets: Designing prompts that inadvertently reflect sensitive inputs.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.