Skip to content

Prompt Engineering

jos edited this page Jan 31, 2026 · 1 revision

Prompt-Engineering

This project was designed from the start as an experiment in Prompt-Engineered development using Roo and GPT-5.1.

Cross-links: Home · Architecture · Prompt-Engineering · Development-Workflow · API · Doxygen-Integration · Roadmap

Project Creation via Prompts

The Ping repository does not originate from a hand-written specification or initial code skeleton. Instead, the human role was to:

  1. Define high-level goals and constraints (e.g., "C++ CLI ping tool with testable architecture and Doxygen docs").
  2. Encode these goals as structured prompts to Roo.
  3. Review, execute, and refine GPT-5.1 outputs iteratively.

All major artifacts were generated this way:

  • CMake build configuration and layout
  • Core C++ modules (session, backends, statistics, exporters)
  • Unit and integration tests
  • Doxygen configuration files
  • Scripts for building, testing, and generating documentation
  • This Wiki and other documentation

Workflow with Roo and GPT-5.1

The typical loop for adding or changing functionality is:

  1. Clarify the task in natural language (bug, feature, or refactor).
  2. Create a focused prompt in Roo that:
    • Describes the current behavior
    • Provides relevant file paths or code excerpts
    • States constraints (e.g., C++17, no external dependencies beyond standard library)
  3. Run GPT-5.1 to generate or modify code based on this prompt.
  4. Review and execute: build, run tests, and inspect behavior.
  5. Refine via follow-up prompts that reference diffs, compiler errors, test failures, or design adjustments.

Example Prompts

Initial Architecture Prompt (Excerpt)

Design a C++ project named "Ping" that provides a CLI tool and reusable library
for sending ICMP echo requests. Use CMake, modern C++ practices, and a clean
separation between platform-specific ping backends and a generic session layer.
Include unit tests, integration tests, and a Doxygen configuration.

Backend Implementation Prompt (Excerpt)

Implement the Windows-specific ping backend that satisfies the existing
platform_ping_backend interface. Use Win32 APIs and keep the implementation
isolated in platform_ping_backend_windows.*. Add tests or mocks where practical.

Documentation & Wiki Prompt (Excerpt)

Generate a GitHub Wiki for the Ping project. Document architecture, the
Prompt-Engineering-based workflow, public APIs, Doxygen integration, and
future roadmap. Use clean Markdown and cross-link all pages.

Lessons Learned

  • Prompt specificity is critical:

    • Clear constraints (platform, standards, testing requirements) greatly improve first-pass quality.
    • Referencing file paths and existing symbols helps GPT-5.1 stay consistent.
  • Iterative refinement works best:

    • Complex changes are safer when decomposed into smaller prompts.
    • Using diffs and compiler/test output in follow-up prompts leads to faster convergence.
  • Architecture matters even with AI:

    • A modular, testable design (session vs. backends vs. exporters) makes AI-assisted modifications easier.
    • Stable interfaces (e.g., statistics aggregator, exporter contracts) let GPT-5.1 extend behavior without large rewrites.
  • Documentation-first prompts pay off:

    • Requesting comments, Doxygen blocks, and usage examples up front reduces later cleanup work.

These practices are reflected across the project and should guide future evolution as described in Development-Workflow and Roadmap.

Clone this wiki locally