Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ When deprecating features, commands, or flags:
3. **Public functionality**: Add comment `// DEPRECATED(semver:major): <description and migration path>`
4. **Internal functionality**: Add comment `// DEPRECATED: <description>`

## Style Guide

See [`.github/STYLE_GUIDE.md`](../.github/STYLE_GUIDE.md) for conventions on command inputs and outputs.

## Important Configuration Files

- `.golangci.yml` - Linter configuration with custom initialisms (CLI, API, SDK, etc.) and staticcheck rules
Expand Down
7 changes: 7 additions & 0 deletions .github/MAINTAINERS_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ Certain things are common during development and require a few commands.
- [Bumping the Golang version](#bumping-the-golang-version)
- [Bumping Go packages versions](#bumping-go-package-versions)
- [Bumping Goreleaser versions](#bumping-goreleaser-versions)
- [Designing](#designing)
- [Deprecating features and flags](#deprecating-features-and-flags)
- [Allowlist configuration](#allowlist-configuration)

Expand Down Expand Up @@ -632,6 +633,11 @@ updates in the following files on occasion:

Testing in our CI setup uses changes to these files when creating test builds.

### Designing

Conventions for how commands handle inputs and format outputs are documented in
the [style guide][style-guide].

### Deprecating features and flags

Many good things come to an end. This can sometimes include commands and flags.
Expand Down Expand Up @@ -926,6 +932,7 @@ When in doubt, find the other maintainers and ask.
[practical-go]: https://dave.cheney.net/practical-go/presentations/qcon-china.html
[scripts]: ../scripts
[semver]: https://semver.org/
[style-guide]: ./STYLE_GUIDE.md
[sync]: https://github.com/slackapi/slack-cli/blob/main/.github/workflows/sync-docs-from-cli-repo.yml
[vscode]: https://github.com/slackapi/slack-cli/blob/main/.vscode/settings.json
[wf-dependencies]: ./workflows/dependencies.yml
40 changes: 40 additions & 0 deletions .github/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Style Guide

A current suggestion for how Slack CLI inputs are handled and outputs are formatted.

- **Input**
- [Prompts are Flags with Forms](#prompts-are-flags-with-forms)
- **Output**
- [Format Sections with Command Details](#format-sections-with-command-details)

## Input

Customizations to commands are made through arguments, flags, environment variables, saved files, details from the Slack API itself, or sometimes just kept as "sensible" defaults.

### Prompts are Flags with Forms

When information is needed we can prompt for text, confirmation, or a selection.

These decisions can be made in an interactive terminal (TTY) or not, such as in a scripting environment.

A flag option should exist for each prompt with a form fallback. Either default values should be used if forms are attempted in a non-TTY setup or an error and remmediation to use a flag should be returned.

## Output

Results of a command go toward informing current happenings and suggesting next steps.

### Format Sections with Command Details

A command often prints information and details about the process happenings. We format this as a section:

```txt
πŸ“š App Install
Installing "focused-lamb-99" app to "devrelsandbox"
Finished in 2.0s
```

This example highlights some recommendations:

- An emoji is used with the section header.
- The section header text is the command name, with "Title Case" letters.
- Following details reveal progress of the process.
Loading