Skip to content

[WIP] Create C++ competitive programming repository setup#2

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/setup-repository-for-cpp-competitive-programming
Closed

[WIP] Create C++ competitive programming repository setup#2
Copilot wants to merge 1 commit intomainfrom
copilot/setup-repository-for-cpp-competitive-programming

Conversation

Copy link

Copilot AI commented Feb 1, 2026

  • Create folder structure (src/, include/, templates/, scripts/, tests/)
  • Create setup.sh script for cross-platform tool installation
  • Create cf CLI command script for template generation and code execution
  • Create template.cpp with competitive programming boilerplate
  • Create Makefile for building and running C++ files
  • Create comprehensive README.md with usage instructions
  • Add .gitignore to exclude build artifacts
  • Test all scripts on current platform
  • Verify compilation and execution workflow
Original prompt

You are a GitHub automation agent with full coding and repository setup skills. I want you to create a new GitHub repository for C++ competitive programming that works cross-platform on Linux (Ubuntu), macOS (ARM/x86), and WSL. The repo must be fully ready-to-use for Codeforces-style problem solving, and everything should be installable and configured automatically with a single setup script.

Repository requirements:

  1. Folder structure:

    • src/ : for source code files
    • include/ : for headers
    • templates/ : ready-to-use problem templates
    • scripts/ : setup and helper scripts
    • tests/ : optional input/output test cases
  2. Setup script (scripts/setup.sh) that:

    • Detects OS (Linux/macOS) and installs required tools
    • Installs latest g++ (14.x or 23.x) and clang++ if missing
    • Installs make, gdb or lldb, and other standard build tools
    • Configures fast I/O defaults for C++ (ios::sync_with_stdio(false); cin.tie(nullptr);)
    • Optionally installs or configures editors: nvim and VS Code extensions for C++/competitive programming
    • Ensures all scripts, commands, and template compilation work cross-platform
  3. cf CLI command script (scripts/cf) that:

    • Can be run as cf template "name" to:
      • Create a folder with the given name inside src/
      • Create a .cpp file inside with the Codeforces template
      • Compile it once to verify setup works
    • Can be run as cf "name" {inputfile.txt} to:
      • Find the .cpp file in the current directory or folder matching name
      • Compile it with proper g++ flags (-std=c++23 -O2 -Wall) or clang++
      • Run it with the given input file or input string
      • Display output immediately with no buffering issues
    • Is idempotent, robust, and fully commented
  4. Template source (src/template.cpp):

    • Standard C++ headers included
    • Fast I/O setup
    • Handy macros for competitive programming
    • Example input/output harness
    • Fully compilable out-of-the-box
  5. Build system:

    • Include a Makefile or build.sh script that compiles any .cpp file in src/ and runs it
    • Works automatically on Linux and macOS
  6. README.md:

    • Explains how to clone the repository
    • How to run scripts/setup.sh
    • How to use cf template and cf commands
    • How to solve problems immediately with minimal setup
  7. Additional requirements:

    • Scripts must be portable, robust, and idempotent
    • All code and scripts fully commented and easy to understand
    • Initial commit message: "Initial setup for cross-platform C++ competitive programming environment with cf commands"

Output:

  • A complete GitHub repository structure with all files, scripts, templates, and setup instructions ready to clone and run on Linux/macOS/WSL. All setup, compilation, and execution should work automatically and consistently.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@mbn-code mbn-code closed this Feb 1, 2026
Copilot AI requested a review from mbn-code February 1, 2026 19:30
Copilot stopped work on behalf of mbn-code due to an error February 1, 2026 19:30
@mbn-code mbn-code deleted the copilot/setup-repository-for-cpp-competitive-programming branch February 1, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants