Skip to content

BobcatProgrammer/agent-mode-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Mode Demo - Calculator

This is a simple calculator app running in CLI. It supports basic arithmetic operations like addition, subtraction, multiplication, and division. It works by parsing user input and performing the requested operation.

🚀 Features

  • ➕ Addition
  • ➖ Subtraction
  • ✖️ Multiplication
  • ➗ Division

🛠️ Usage

Each operation is now its own command. Run the application as follows:

python calculator.py add 5 3
# Result: 8
python calculator.py subtract 10 4
# Result: 6
python calculator.py multiply 2 3
# Result: 6
python calculator.py divide 8 2
# Result: 4.0

🧪 Running Tests

python -m unittest test_calculator.py

🧩 Technology Stack

  • Python 3.x
  • Typer for CLI
  • Unit tests to verify
  • Easy to use CLI interface

💡 Prompts to try

Division by Zero Handling

I want to update our calculator.py so that the divide function handles division by zero gracefully (by returning None instead of raising an exception). Also, update the corresponding unit test in test_calculator.py to check this new behavior.

Linting and Formatting

Run a linter and formatter across all Python files. Automatically fix issues, commit the changes, and provide a summary of what was fixed.

This really shows the power of agent mode, as it can directly interact with VS Code and the codebase to make changes, run tests, and commit updates.

Find all TODOs

Check the codebase for any todos and get them done.

Create a makefile

I want to create a Makefile for this project that includes targets for running the application, running tests, and cleaning up temporary files.

Add a new operation

I want to add a new operation to our calculator.py that calculates the modulus of two numbers. Update the CLI to support this operation and add a corresponding unit test in test_calculator.py. Update docs

Fraction support

I want the program to handle input values such as 1/3.

Updates

Setup a github action workflow that runs the tests and linters on every pr. Enable Dependabot for python and github actions. Update the README to reflect these changes.

Update README with Windows Local Development instructions

I also want developers to easily set up the project for local development in Windows, not only Linux. Use GitHub's MarkDown syntax to make it look pretty.

Local Development

  1. Clone the repository:
git clone https://github.com/BobcatProgrammer/agent-mode-demo
cd agent-mode-demo
  1. Create a virtual environment (recommended):
python -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python calculator.py calculate add 5 3
  1. Run tests:
python -m unittest test_calculator.py

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages