Vibe Coding - Four Ways to Structure Prompts

1. Custom Instructions

  • The first step to using AI effectively is to ‘write good prompts’.
    • The quality of an AI model’s responses is heavily influenced by prompt design.
  • Custom Instructions is a feature that lets you predefine the default instructions AI should always refer to when responding.
  • In other words, it is a setting that continuously applies recurring instructions such as the user’s language and work style, making it a personalization feature.
    • This makes it possible to maintain a consistent style without repeating the same prompt every time.

1.1. GitHub Copilot

In GitHub Copilot, instructions that are automatically loaded for a project are written in the file at the following path.

.github/copilot-instructions.md

1.2. Gemini Code Assist

In Gemini Code Assist, project instructions are stored using the following filename.

GEMINI.md

1.3. Example

The purpose of Custom Instructions is not to make prompts better, but to predefine requests that are used repeatedly.


## Instructions
* Write responses to questions in Korean.
* Write code comments, output messages, and explanations in English.


2. Three File System

  • Three File System is a simple yet highly effective method proposed by Ryan Carson, an entrepreneur and developer, for structurally managing and documenting prompts.

2.1. Core Concept

  • To reduce the complexity of project management, all projects are simplified into three core files.
  • This structure allows projects to be started quickly while minimizing maintenance work and the burden of AI learning.
  • Rather than being a method for writing prompts well, it is a method for managing prompts well.

2.2. Components

It is a structure that separately records the background, the method, and what will be done this time.


prompts/
├── readme.md
├── notes.md
└── examples
    ├── exam1.py
    └── exam2.js

2.2.1. readme

  • It briefly summarizes the project’s purpose, overview, and usage.
    • It serves as documentation that helps AI understand the project.

2.2.2. examples

  • A folder containing examples of the core execution code (MVP: Minimum Viable Product).
    • ex) main.py, index.js ...
  • It is the part that shows in the simplest way how the project actually works.
    • Providing examples to AI helps it generate more accurate and consistent output.

2.2.3. notes

  • This is a file where ideas, lessons learned, impressions, and TODO lists can be recorded freely.
  • It is used to organize thoughts that arise during development and to preserve the project’s context.
    • It helps AI understand what has been done and what needs to be done next.

2.3. Three File System Extend

  • Later, based on Ryan Carson’s system, it proposes fixing the flow of "PRD → Task List → Task Execution" into three rule files.
    • This can be seen as a framework that systematizes the AI collaborative development workflow.

[Source] YouTube - A 3-step AI coding workflow for solo founders. Ryan Carson (5x founder)


3. Skills

  • Claude Skills bundle recurring prompts into skill units based on SKILL.md and organize prompts into reusable modules.
  • Frequently used prompts can be saved together as a single skill, and can be loaded automatically or manually when needed.

3.1. Skill Structure

A Skill begins with a SKILL.md file that contains only metadata and instructions.


[Source] Claude API Docs - Best Practices for Writing Skills


pdf/
├── SKILL.md              # Main instructions (loaded when triggered)
├── FORMS.md              # Form writing guide (loaded as needed)
├── reference.md          # API reference (loaded as needed)
├── examples.md           # Usage examples (loaded as needed)
└── scripts/
    ├── analyze_form.py   # Utility script (executed, not loaded)
    ├── fill_form.py      # Form filling script
    └── validate.py       # Validation script

3.2. How to Use Skills

Category Claude Copilot
Skill Invocation Method @skill:name /skill-name
Auto-load Target SKILL.md .github/copilot-instructions.md


4. Harness

  • Harness is an execution framework for operating AI agents safely and predictably.
  • It makes AI operate within an allowed scope, tracks the results, and continuously improves issues over time.

4.1. Harness Example

4.1.1. Example of Applying a Harness

# PDF Analysis Harness
 
## Purpose
Verify consistent output quality when AI analyzes a PDF and generates a summary.
 
## Input
- INPUT/sample.pdf
 
## Output Format
- JSON format (including title, summary, and key_points fields)
 
## Procedure
1. Extract the text from sample.pdf.
2. Summarize 3 to 5 key points in bullet form.
3. Organize the result as JSON.
4. Compare it with EXPECTED/sample.json using validate.py.

4.1.2. Comparison: Without vs. With Harness

Without With
Processes different inputs every time Ensures consistency with fixed inputs
Output results and formats vary every time Maintains a fixed format (JSON, etc.)
Work sequence is unstable Always follows the same procedure in RUN.md
Manual checking required Automatically validated by script
Even the same request can produce different results Produces the same result whenever it is run
Difficult to share the testing method Can be rerun with the same workflow

4.2. Harness Engineering

  • Harness Engineering is a method for controlling the uncertainty of AI models and repeatedly evaluating them so the model can reliably produce the desired results.

4.2.1. Example of Project Structure

The suggested structure is only one example and is not fixed as a single required format.


project-root/
├─ README.md                    # Project overview and usage
├─ harness.yaml                 # Global Harness settings
├─ harness/                    
│   ├─ state_manager.md         # State management and isolation
│   ├─ evaluator_engine.md      # Evaluation loop
│   ├─ iteration_loop.md        # Iterative improvement loop
│   ├─ guardrail_engine.md      # Input/output validation
│   └─ router.md                # Model selection
│
└─ data/

4.2.2. Core Design Principles (Harness Design)

  1. State Management & Isolation:
    Ensure that a problem in one part does not affect other parts.
  2. Guardrails and Control:
    Put safeguards in place beforehand so the AI model does not behave in unintended ways.
  3. Feedback Loops and Iteration:
    Maintain a structure in which the model checks and revises its own results, while allowing human intervention when needed to guide the direction.
  4. Evaluation Frameworks:
    Continuously monitor performance even during execution so quality does not degrade.

4.2.3. Separation and Iteration of Evaluation

  • Separate the model that handles the actual work from the model that evaluates the result.
  • Continuously repeat evaluation and steadily improve the system until it reaches the target quality.

Popular posts from this blog

C Language - The Grammar of a Programming Language

Vibe Coding - Creating Code with Natural Language

Computer Operations Explained with Gate Circuits