Skip to content

Commit a159327

Browse files
Merge pull request #1 from github-samples/samples-publish-update
Add community health files, update docs as needed.
2 parents b6b0e64 + 9ce0b73 commit a159327

File tree

7 files changed

+365
-23
lines changed

7 files changed

+365
-23
lines changed

CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 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)
2+
3+
# This repository is maintained by:
4+
* @chrisreddington

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <[email protected]>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
71+
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# Contributing to gh-game
2+
3+
Thank you for your interest in contributing to gh-game! We love your input and welcome contributions from everyone, whether it's:
4+
5+
- Reporting a bug
6+
- Discussing the current state of the code
7+
- Submitting a fix
8+
- Proposing new features
9+
- Implementing a new game
10+
- Improving documentation
11+
12+
## Table of Contents
13+
14+
- [Getting Started](#getting-started)
15+
- [Fork the Repository](#fork-the-repository)
16+
- [Clone Your Fork](#clone-your-fork)
17+
- [Set Up GitHub Codespaces](#set-up-github-codespaces)
18+
- [Local Development Setup](#local-development-setup)
19+
- [Development Workflow](#development-workflow)
20+
- [Creating a Branch](#creating-a-branch)
21+
- [Make Your Changes](#make-your-changes)
22+
- [Development Commands](#development-commands)
23+
- [Adding a New Game](#adding-a-new-game)
24+
- [Pull Request Process](#pull-request-process)
25+
- [Create a Pull Request](#create-a-pull-request)
26+
- [Code Review Process](#code-review-process)
27+
- [Contribution Standards](#contribution-standards)
28+
- [Code Style](#code-style)
29+
- [Documentation](#documentation)
30+
- [Testing](#testing)
31+
- [Non-Code Contributions](#non-code-contributions)
32+
- [Community](#community)
33+
- [License](#license)
34+
35+
## Getting Started
36+
37+
### Fork the Repository
38+
39+
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.
40+
41+
### Clone Your Fork
42+
43+
Clone your fork to your local machine or continue with GitHub Codespaces:
44+
45+
```bash
46+
git clone https://github.com/YOUR-USERNAME/gh-game.git
47+
cd gh-game
48+
git remote add upstream https://github.com/ORIGINAL-OWNER/gh-game.git
49+
```
50+
51+
### Set Up GitHub Codespaces
52+
53+
The easiest way to start contributing is by using GitHub Codespaces, which comes pre-configured with all the dependencies needed for gh-game:
54+
55+
1. Navigate to your fork on GitHub
56+
2. Click the "Code" button
57+
3. Select "Open with Codespaces"
58+
4. Click "New codespace"
59+
60+
This will create a development environment in the cloud with all the necessary tools installed, including the GitHub CLI (`gh`).
61+
62+
### Local Development Setup
63+
64+
If you prefer to develop locally, make sure you have:
65+
66+
1. Go 1.23 or later installed
67+
2. GitHub CLI (`gh`) installed
68+
3. All project dependencies:
69+
```bash
70+
go mod download
71+
```
72+
4. Any other tools:
73+
```bash
74+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
75+
```
76+
77+
## Development Workflow
78+
79+
### Creating a Branch
80+
81+
Create a branch for your contributions:
82+
83+
```bash
84+
git checkout -b feature/your-feature-name
85+
# or
86+
git checkout -b fix/your-bugfix-name
87+
```
88+
89+
### Make Your Changes
90+
91+
Now you're ready to make your changes to the codebase.
92+
93+
### Development Commands
94+
95+
Here are the important commands to use during development:
96+
97+
- **Build the project**:
98+
```bash
99+
go build
100+
```
101+
102+
- **Run the CLI extension**:
103+
```bash
104+
./gh-game <subcommand>
105+
# For example:
106+
./gh-game cointoss
107+
./gh-game tictactoe
108+
```
109+
110+
- **Run tests**:
111+
```bash
112+
go test ./...
113+
```
114+
115+
- **Format code** (required before commit):
116+
```bash
117+
go fmt ./...
118+
```
119+
120+
- **Run linter** (required before commit):
121+
```bash
122+
golangci-lint run
123+
```
124+
125+
### Adding a New Game
126+
127+
If you're adding a new game:
128+
129+
1. Create game logic in `/internal/<gamename>/`
130+
2. Add command implementation in `/cmd/<gamename>.go`
131+
3. Follow the patterns established in existing games
132+
4. Update documentation to include the new game
133+
5. Add comprehensive tests
134+
135+
## Pull Request Process
136+
137+
### Create a Pull Request
138+
139+
1. Push your branch to your fork:
140+
```bash
141+
git push origin feature/your-feature-name
142+
```
143+
144+
2. Go to the original repository and create a pull request:
145+
- Click "New Pull Request"
146+
- Select your branch from your fork
147+
- Fill out the PR template with details about your changes
148+
149+
### Code Review Process
150+
151+
1. Maintainers will review your PR
152+
2. Address any feedback or requested changes
153+
3. Make sure all CI checks pass
154+
4. Once approved, a maintainer will merge your PR
155+
156+
## Contribution Standards
157+
158+
### Code Style
159+
160+
- Follow standard Go idioms and best practices
161+
- Use meaningful variable and function names
162+
- Keep functions small and focused
163+
- Write GoDoc comments for all exported functions, types, and packages
164+
165+
### Documentation
166+
167+
- Update README.md when adding new features
168+
- Document new commands and options
169+
- Include usage examples
170+
- Document complex algorithms or design decisions
171+
172+
### Testing
173+
174+
- Write unit tests for game logic
175+
- Include integration tests for command behavior
176+
- Mock external dependencies when testing
177+
- All tests must pass before submitting a PR
178+
179+
## Non-Code Contributions
180+
181+
Your contributions don't have to be code! We also welcome:
182+
183+
- **Bug reports**: Create a detailed GitHub issue explaining the bug
184+
- **Feature requests**: Submit ideas through GitHub issues
185+
- **Documentation improvements**: Corrections or additions to docs
186+
- **UI/UX suggestions**: Ideas to improve game interactions
187+
- **User testing**: Provide feedback on game usability
188+
189+
When submitting issues, please use the provided issue templates and include as much detail as possible.
190+
191+
## Community
192+
193+
Our community is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
194+
195+
Thank you for taking the time to contribute to gh-game! We look forward to your contributions!

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Chris Reddington
3+
Copyright GitHub, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,46 @@
22

33
A GitHub CLI extension that allows you to play games through the GitHub CLI.
44

5+
## Features
6+
7+
- **Multiple Games**: Play coin toss, higher or lower, rock paper scissors, tic tac toe, and word guess games
8+
- **Terminal-Based**: Fully playable through your terminal using GitHub CLI
9+
- **Interactive UI**: User-friendly terminal interfaces for all games
10+
- **Score Tracking**: Keep track of your scores and streaks in supported games
11+
12+
## Background
13+
14+
The gh-game extension serves as both a fun diversion and a showcase of GitHub CLI extension capabilities.
15+
16+
### Roadmap
17+
18+
- Additional games to be added in the future
19+
520
## Installation
621

722
```sh
8-
gh extension install chrisreddington/gh-game
23+
gh extension install github-samples/gh-game
924
```
1025

26+
## Requirements
27+
28+
- Go 1.23 or newer
29+
- GitHub CLI installed
30+
- Terminal with Unicode support for optimal experience
31+
32+
### Setting Up Development Environment
33+
34+
1. Clone the repository
35+
2. Run `go build` to build the extension
36+
3. Run `go test ./...` to run the tests
37+
38+
### Development Container
39+
40+
This project includes a [development container configuration](.devcontainer/devcontainer.json) for VS Code, which provides a consistent development environment with:
41+
- Go 1.23
42+
- GitHub CLI
43+
- Several VS Code extensions for GitHub
44+
1145
## Commands
1246

1347
### Coin Toss
@@ -70,30 +104,14 @@ gh game wordguess
70104

71105
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.
72106

73-
## Development
74-
75-
### Prerequisites
76-
77-
- Go 1.23 or newer
78-
- GitHub CLI installed
79-
80-
### Building from source
81-
82-
1. Clone the repository
83-
2. Run `go build` to build the extension
84-
3. Run `go test ./...` to run the tests
107+
## Contributing
85108

86-
### Development Container
109+
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.
87110

88-
This project includes a [development container configuration](.devcontainer/devcontainer.json) for VS Code, which provides a consistent development environment with:
89-
- Go 1.23
90-
- GitHub CLI
91-
- Several VS Code extensions for GitHub
92-
93-
## Contributing
111+
## Maintainers
94112

95-
Contributions are welcome! Please feel free to submit a Pull Request.
113+
This project is maintained by the GitHub Developer Relations team. See [CODEOWNERS](CODEOWNERS) file for specific maintainers.
96114

97115
## License
98116

99-
This project is available as open source under the terms of the [MIT License](LICENSE).
117+
This project is available as open source under the terms of the [MIT License](LICENSE).

0 commit comments

Comments
 (0)