diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..326fef0 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,4 @@ +# For more information, see [docs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax) + +# This repository is maintained by: +* @chrisreddington \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..8bba2a6 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at . All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], + version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7c655f8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,195 @@ +# Contributing to gh-game + +Thank you for your interest in contributing to gh-game! We love your input and welcome contributions from everyone, whether it's: + +- Reporting a bug +- Discussing the current state of the code +- Submitting a fix +- Proposing new features +- Implementing a new game +- Improving documentation + +## Table of Contents + +- [Getting Started](#getting-started) + - [Fork the Repository](#fork-the-repository) + - [Clone Your Fork](#clone-your-fork) + - [Set Up GitHub Codespaces](#set-up-github-codespaces) + - [Local Development Setup](#local-development-setup) +- [Development Workflow](#development-workflow) + - [Creating a Branch](#creating-a-branch) + - [Make Your Changes](#make-your-changes) + - [Development Commands](#development-commands) + - [Adding a New Game](#adding-a-new-game) +- [Pull Request Process](#pull-request-process) + - [Create a Pull Request](#create-a-pull-request) + - [Code Review Process](#code-review-process) +- [Contribution Standards](#contribution-standards) + - [Code Style](#code-style) + - [Documentation](#documentation) + - [Testing](#testing) +- [Non-Code Contributions](#non-code-contributions) +- [Community](#community) +- [License](#license) + +## Getting Started + +### Fork the Repository + +Start by forking the repository on GitHub by clicking the "Fork" button at the top-right of the repository page. This creates a copy of the repository in your own GitHub account. + +### Clone Your Fork + +Clone your fork to your local machine or continue with GitHub Codespaces: + +```bash +git clone https://github.com/YOUR-USERNAME/gh-game.git +cd gh-game +git remote add upstream https://github.com/ORIGINAL-OWNER/gh-game.git +``` + +### Set Up GitHub Codespaces + +The easiest way to start contributing is by using GitHub Codespaces, which comes pre-configured with all the dependencies needed for gh-game: + +1. Navigate to your fork on GitHub +2. Click the "Code" button +3. Select "Open with Codespaces" +4. Click "New codespace" + +This will create a development environment in the cloud with all the necessary tools installed, including the GitHub CLI (`gh`). + +### Local Development Setup + +If you prefer to develop locally, make sure you have: + +1. Go 1.23 or later installed +2. GitHub CLI (`gh`) installed +3. All project dependencies: + ```bash + go mod download + ``` +4. Any other tools: + ```bash + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + ``` + +## Development Workflow + +### Creating a Branch + +Create a branch for your contributions: + +```bash +git checkout -b feature/your-feature-name +# or +git checkout -b fix/your-bugfix-name +``` + +### Make Your Changes + +Now you're ready to make your changes to the codebase. + +### Development Commands + +Here are the important commands to use during development: + +- **Build the project**: + ```bash + go build + ``` + +- **Run the CLI extension**: + ```bash + ./gh-game + # For example: + ./gh-game cointoss + ./gh-game tictactoe + ``` + +- **Run tests**: + ```bash + go test ./... + ``` + +- **Format code** (required before commit): + ```bash + go fmt ./... + ``` + +- **Run linter** (required before commit): + ```bash + golangci-lint run + ``` + +### Adding a New Game + +If you're adding a new game: + +1. Create game logic in `/internal//` +2. Add command implementation in `/cmd/.go` +3. Follow the patterns established in existing games +4. Update documentation to include the new game +5. Add comprehensive tests + +## Pull Request Process + +### Create a Pull Request + +1. Push your branch to your fork: + ```bash + git push origin feature/your-feature-name + ``` + +2. Go to the original repository and create a pull request: + - Click "New Pull Request" + - Select your branch from your fork + - Fill out the PR template with details about your changes + +### Code Review Process + +1. Maintainers will review your PR +2. Address any feedback or requested changes +3. Make sure all CI checks pass +4. Once approved, a maintainer will merge your PR + +## Contribution Standards + +### Code Style + +- Follow standard Go idioms and best practices +- Use meaningful variable and function names +- Keep functions small and focused +- Write GoDoc comments for all exported functions, types, and packages + +### Documentation + +- Update README.md when adding new features +- Document new commands and options +- Include usage examples +- Document complex algorithms or design decisions + +### Testing + +- Write unit tests for game logic +- Include integration tests for command behavior +- Mock external dependencies when testing +- All tests must pass before submitting a PR + +## Non-Code Contributions + +Your contributions don't have to be code! We also welcome: + +- **Bug reports**: Create a detailed GitHub issue explaining the bug +- **Feature requests**: Submit ideas through GitHub issues +- **Documentation improvements**: Corrections or additions to docs +- **UI/UX suggestions**: Ideas to improve game interactions +- **User testing**: Provide feedback on game usability + +When submitting issues, please use the provided issue templates and include as much detail as possible. + +## Community + +Our community is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. + +Thank you for taking the time to contribute to gh-game! We look forward to your contributions! \ No newline at end of file diff --git a/LICENSE b/LICENSE index 3bfa7ac..28a50fa 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Chris Reddington +Copyright GitHub, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 35c0514..9cafc32 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,46 @@ A GitHub CLI extension that allows you to play games through the GitHub CLI. +## Features + +- **Multiple Games**: Play coin toss, higher or lower, rock paper scissors, tic tac toe, and word guess games +- **Terminal-Based**: Fully playable through your terminal using GitHub CLI +- **Interactive UI**: User-friendly terminal interfaces for all games +- **Score Tracking**: Keep track of your scores and streaks in supported games + +## Background + +The gh-game extension serves as both a fun diversion and a showcase of GitHub CLI extension capabilities. + +### Roadmap + +- Additional games to be added in the future + ## Installation ```sh -gh extension install chrisreddington/gh-game +gh extension install github-samples/gh-game ``` +## Requirements + +- Go 1.23 or newer +- GitHub CLI installed +- Terminal with Unicode support for optimal experience + +### Setting Up Development Environment + +1. Clone the repository +2. Run `go build` to build the extension +3. Run `go test ./...` to run the tests + +### Development Container + +This project includes a [development container configuration](.devcontainer/devcontainer.json) for VS Code, which provides a consistent development environment with: +- Go 1.23 +- GitHub CLI +- Several VS Code extensions for GitHub + ## Commands ### Coin Toss @@ -70,30 +104,14 @@ gh game wordguess The game selects a random GitHub-related term, and you need to guess it by suggesting one letter at a time. Each correct letter is revealed in its position. Each incorrect guess reduces your remaining guesses. You win by guessing the complete word before making 6 incorrect guesses. -## Development - -### Prerequisites - -- Go 1.23 or newer -- GitHub CLI installed - -### Building from source - -1. Clone the repository -2. Run `go build` to build the extension -3. Run `go test ./...` to run the tests +## Contributing -### Development Container +Contributions are welcome! Please feel free to submit a Pull Request. Check out our [contributing guidelines](CONTRIBUTING.md) for more details on how to get involved. -This project includes a [development container configuration](.devcontainer/devcontainer.json) for VS Code, which provides a consistent development environment with: -- Go 1.23 -- GitHub CLI -- Several VS Code extensions for GitHub - -## Contributing +## Maintainers -Contributions are welcome! Please feel free to submit a Pull Request. +This project is maintained by the GitHub Developer Relations team. See [CODEOWNERS](CODEOWNERS) file for specific maintainers. ## License -This project is available as open source under the terms of the [MIT License](LICENSE). \ No newline at end of file +This project is available as open source under the terms of the [MIT License](LICENSE). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..c176aa9 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,31 @@ +# Security + +Thanks for helping make GitHub safe for everyone. + +GitHub takes the security of our software products and services seriously, including all of the open source code repositories managed through our GitHub organizations, such as [GitHub](https://github.com/GitHub). + +Even though [open source repositories are outside of the scope of our bug bounty program](https://bounty.github.com/index.html#scope) and therefore not eligible for bounty rewards, we will ensure that your finding gets passed along to the appropriate maintainers for remediation. + +## Reporting Security Issues + +If you believe you have found a security vulnerability in any GitHub-owned repository, please report it to us through coordinated disclosure. + +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** + +Instead, please send an email to opensource-security[@]github.com. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + + * The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Policy + +See [GitHub's Safe Harbor Policy](https://docs.github.com/en/site-policy/security-policies/github-bug-bounty-program-legal-safe-harbor#1-safe-harbor-terms) \ No newline at end of file diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 0000000..11834bb --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,20 @@ +# Support + +## How to file issues and get help + +This project uses GitHub issues to track bugs and feature requests. +Please search the existing issues before filing new issues to avoid duplicates. +For new issues, file your +bug or feature request as a new issue. + +For help or questions about using this project, + please follow the [README](README.md). + +**gh-game** is under active development + and maintained by GitHub +staff **AND THE COMMUNITY**. We will do our best to respond to support, feature +requests, and community questions in a timely manner. + +## GitHub Support Policy + +Support for this project is limited to the resources listed above. \ No newline at end of file