Skip to content

Commit 525316e

Browse files
committed
docs: revamp README with security focus and streamlined content
- Add CI badges and Go Report Card - Emphasize open source transparency and multi-layer security design - Provide three permission modes: strict, trust, and read-only - Simplify troubleshooting with table format - Remove developer-focused sections (project structure, supported operations) - Update CONTRIBUTING.md with correct Go version and project structure
1 parent fa6d72d commit 525316e

3 files changed

Lines changed: 479 additions & 235 deletions

File tree

CONTRIBUTING.md

Lines changed: 74 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ Thank you for your interest in contributing to Flashduty Runner! This document p
44

55
## Code of Conduct
66

7-
Please be respectful and constructive in all interactions. We aim to maintain a welcoming environment for all contributors.
7+
Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). We aim to maintain a welcoming environment for all contributors.
88

99
## Getting Started
1010

1111
### Prerequisites
1212

13-
- Go 1.22 or later
13+
- Go 1.24 or later
1414
- Make
1515
- golangci-lint (for linting)
1616
- gofumpt (for formatting)
17+
- gci (for import sorting)
1718

1819
### Setup
1920

@@ -67,7 +68,7 @@ import (
6768

6869
"github.com/gorilla/websocket"
6970

70-
"github.com/flashcatcloud/flashduty-runner/internal/config"
71+
"github.com/flashcatcloud/flashduty-runner/config"
7172
)
7273
```
7374

@@ -103,7 +104,7 @@ slog.Info("connected to server",
103104
make test
104105

105106
# Run specific package tests
106-
go test -v ./internal/workspace/...
107+
go test -v ./workspace/...
107108

108109
# Run with coverage
109110
go test -coverprofile=coverage.out ./...
@@ -152,46 +153,92 @@ docs(readme): add troubleshooting section
152153
```
153154
flashduty-runner/
154155
├── cmd/
155-
│ └── flashduty-runner/
156-
│ └── main.go # Entry point
157-
├── internal/
158-
│ ├── config/ # Configuration loading
159-
│ ├── auth/ # API Key authentication
160-
│ ├── ws/ # WebSocket client
161-
│ ├── workspace/ # Workspace operations
162-
│ ├── permission/ # Command permission check
163-
│ ├── mcp/ # MCP client manager
164-
│ └── update/ # Self-update logic
165-
├── pkg/
166-
│ └── protocol/ # WebSocket message protocol
156+
│ └── main.go # CLI entry point (cobra)
157+
├── config/
158+
│ ├── config.go # Configuration loading (viper)
159+
│ └── config_test.go # Config tests
160+
├── permission/
161+
│ ├── permission.go # Command permission checker
162+
│ └── permission_test.go # Permission tests
163+
├── protocol/
164+
│ └── messages.go # WebSocket message types
165+
├── workspace/
166+
│ ├── workspace.go # Workspace operations
167+
│ ├── workspace_test.go # Workspace tests
168+
│ ├── webfetch.go # Web page fetching
169+
│ └── large_output.go # Large output handling
170+
├── ws/
171+
│ ├── client.go # WebSocket client
172+
│ └── handler.go # Message handler
173+
├── mcp/
174+
│ ├── client.go # MCP client manager
175+
│ └── transport.go # MCP transport layer
167176
├── .github/
168-
│ └── workflows/ # CI/CD pipelines
169-
├── go.mod
170-
├── go.sum
171-
├── Makefile
177+
│ ├── workflows/ # CI/CD pipelines
178+
│ │ ├── go.yml # Go tests
179+
│ │ ├── lint.yml # Linting
180+
│ │ ├── goreleaser.yml # Release automation
181+
│ │ └── docker-publish.yml # Docker builds
182+
│ ├── ISSUE_TEMPLATE/ # Issue templates
183+
│ └── pull_request_template.md
184+
├── Dockerfile # Multi-stage Docker build
185+
├── Makefile # Build automation
186+
├── .goreleaser.yaml # Release configuration
187+
├── .golangci.yml # Linter configuration
172188
└── README.md
173189
```
174190

175191
## Adding New Features
176192

177193
### New Workspace Operation
178194

179-
1. Add method to `internal/workspace/workspace.go`
180-
2. Add message type to `pkg/protocol/messages.go`
181-
3. Add handler in `internal/ws/handler.go`
182-
4. Add tests in `internal/workspace/workspace_test.go`
195+
1. Add method to `workspace/workspace.go`
196+
2. Add message type to `protocol/messages.go`
197+
3. Add handler case in `ws/handler.go`
198+
4. Add tests in `workspace/workspace_test.go`
183199
5. Update README if user-facing
184200

185201
### New CLI Command
186202

187-
1. Add command file in `cmd/flashduty-runner/`
188-
2. Register in `cmd/flashduty-runner/root.go`
203+
1. Add command function in `cmd/main.go`
204+
2. Register with `rootCmd.AddCommand()`
189205
3. Add tests
190206
4. Update README
191207

208+
### New Configuration Option
209+
210+
1. Add field to `config.Config` struct in `config/config.go`
211+
2. Update `DefaultConfig()` if needed
212+
3. Add validation in `Validate()` if needed
213+
4. Document in README
214+
5. Add tests in `config/config_test.go`
215+
216+
## CI/CD
217+
218+
### Automated Checks
219+
220+
Every PR triggers:
221+
- **go.yml**: Runs `go test` with race detection
222+
- **lint.yml**: Runs golangci-lint
223+
- **code-scanning.yml**: Security scanning with CodeQL
224+
225+
### Release Process
226+
227+
Releases are automated via GoReleaser when a tag is pushed:
228+
229+
```bash
230+
git tag v1.0.0
231+
git push origin v1.0.0
232+
```
233+
234+
This triggers:
235+
1. Cross-platform binary builds (Linux, macOS, Windows × amd64, arm64)
236+
2. Docker image builds and push to GHCR
237+
3. GitHub release creation with changelog
238+
192239
## Questions?
193240

194-
- Open an issue for bugs or feature requests
241+
- Open an [issue](https://github.com/flashcatcloud/flashduty-runner/issues) for bugs or feature requests
195242
- Check existing issues before creating new ones
196243
- Join our community discussions
197244

0 commit comments

Comments
 (0)