packwise-skills 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursorrules +23 -23
- package/CLAUDE.md +25 -25
- package/LICENSE +21 -0
- package/README.md +404 -295
- package/audit.md +224 -224
- package/bin/packwise.js +322 -155
- package/install.sh +123 -0
- package/package.json +32 -31
- package/skill.md +944 -719
- package/sub-skills/ai/local-llm.md +183 -183
- package/sub-skills/ai/python-ml.md +164 -164
- package/sub-skills/backend/go-server.md +184 -184
- package/sub-skills/backend/java-spring.md +241 -241
- package/sub-skills/backend/node-server.md +164 -164
- package/sub-skills/backend/php-laravel.md +175 -175
- package/sub-skills/backend/python-server.md +164 -164
- package/sub-skills/backend/rust-backend.md +118 -118
- package/sub-skills/cli/python-cli.md +236 -236
- package/sub-skills/cli/sdk-library.md +497 -497
- package/sub-skills/cloud/ci-cd-pipelines.md +350 -350
- package/sub-skills/cloud/docker.md +191 -191
- package/sub-skills/cloud/kubernetes.md +277 -277
- package/sub-skills/cloud/payment-integration.md +307 -307
- package/sub-skills/cross-platform/multiplatform.md +252 -252
- package/sub-skills/desktop/electron.md +783 -783
- package/sub-skills/desktop/game-dev.md +443 -443
- package/sub-skills/desktop/native-app.md +123 -123
- package/sub-skills/desktop/scenarios.md +443 -443
- package/sub-skills/desktop/smart-platforms.md +324 -324
- package/sub-skills/desktop/tauri.md +428 -428
- package/sub-skills/desktop/vr-ar.md +252 -252
- package/sub-skills/desktop/web-to-desktop.md +153 -153
- package/sub-skills/embedded/car-infotainment.md +129 -129
- package/sub-skills/embedded/esp32.md +184 -184
- package/sub-skills/embedded/ros.md +150 -150
- package/sub-skills/embedded/stm32.md +160 -160
- package/sub-skills/mobile/android.md +322 -322
- package/sub-skills/mobile/capacitor.md +232 -232
- package/sub-skills/mobile/flutter-mobile.md +138 -138
- package/sub-skills/mobile/harmonyos.md +150 -150
- package/sub-skills/mobile/ios.md +245 -245
- package/sub-skills/mobile/react-native.md +443 -443
- package/sub-skills/mobile/wearables.md +230 -230
- package/sub-skills/plugins/browser-extension.md +308 -308
- package/sub-skills/plugins/jetbrains-plugin.md +226 -226
- package/sub-skills/plugins/vscode-extension.md +204 -204
- package/sub-skills/security/security-tools.md +174 -174
- package/sub-skills/web/monorepo.md +274 -274
- package/sub-skills/web/pwa.md +220 -220
- package/sub-skills/web/serverless-edge.md +295 -295
- package/sub-skills/web/spa.md +266 -266
- package/sub-skills/web/ssr.md +228 -228
- package/sub-skills/web/wasm.md +243 -243
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
# Go Backend Build Sub-Skill
|
|
2
|
-
|
|
3
|
-
Build Go backend services (Gin/Echo/Fiber/Axum-like stdlib).
|
|
4
|
-
|
|
5
|
-
**Current version**: Go 1.24+ / 1.25 / 1.26 (2025-2026)
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
- High-performance REST/gRPC API services
|
|
10
|
-
- CLI tools with embedded server
|
|
11
|
-
- Microservices requiring low memory footprint
|
|
12
|
-
- Network services (proxy, gateway, load balancer)
|
|
13
|
-
- Concurrent/parallel processing services
|
|
14
|
-
|
|
15
|
-
## Framework Quick Start
|
|
16
|
-
|
|
17
|
-
### Gin (Most Popular)
|
|
18
|
-
|
|
19
|
-
```go
|
|
20
|
-
package main
|
|
21
|
-
|
|
22
|
-
import "github.com/gin-gonic/gin"
|
|
23
|
-
|
|
24
|
-
func main() {
|
|
25
|
-
r := gin.Default()
|
|
26
|
-
r.GET("/health", func(c *gin.Context) { c.JSON(200, gin.H{"status": "ok"}) })
|
|
27
|
-
r.GET("/api/users", getUsers)
|
|
28
|
-
r.Run(":8080")
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Echo (Lightweight)
|
|
33
|
-
|
|
34
|
-
```go
|
|
35
|
-
package main
|
|
36
|
-
|
|
37
|
-
import "github.com/labstack/echo/v4"
|
|
38
|
-
|
|
39
|
-
func main() {
|
|
40
|
-
e := echo.New()
|
|
41
|
-
e.GET("/health", func(c echo.Context) error { return c.JSON(200, map[string]string{"status": "ok"}) })
|
|
42
|
-
e.Logger.Fatal(e.Start(":8080"))
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Fiber (Express-like, fastest)
|
|
47
|
-
|
|
48
|
-
```go
|
|
49
|
-
package main
|
|
50
|
-
|
|
51
|
-
import "github.com/gofiber/fiber/v3"
|
|
52
|
-
|
|
53
|
-
func main() {
|
|
54
|
-
app := fiber.New()
|
|
55
|
-
app.Get("/health", func(c fiber.Ctx) error { return c.JSON(map[string]string{"status": "ok"}) })
|
|
56
|
-
app.Listen(":8080")
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### net/http (Standard Library, Zero Dependencies)
|
|
61
|
-
|
|
62
|
-
```go
|
|
63
|
-
package main
|
|
64
|
-
|
|
65
|
-
import (
|
|
66
|
-
"encoding/json"
|
|
67
|
-
"net/http"
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
func main() {
|
|
71
|
-
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
|
|
72
|
-
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
|
|
73
|
-
})
|
|
74
|
-
http.ListenAndServe(":8080", nil)
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Framework Comparison
|
|
79
|
-
|
|
80
|
-
| Framework | Performance | Middleware | Ecosystem | Best For |
|
|
81
|
-
|-----------|------------|-----------|-----------|----------|
|
|
82
|
-
| Gin | High | Rich | Largest | General-purpose APIs |
|
|
83
|
-
| Echo | High | Rich | Large | Clean API design |
|
|
84
|
-
| Fiber | Highest | Rich | Growing | Express-style, max performance |
|
|
85
|
-
| net/http | High | Manual | Stdlib | Zero-dependency, simple APIs |
|
|
86
|
-
| Chi | High | Composable | Moderate | RESTful APIs, middleware chains |
|
|
87
|
-
|
|
88
|
-
## Build
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
# Standard build
|
|
92
|
-
go build -o myapp .
|
|
93
|
-
|
|
94
|
-
# Optimized release build
|
|
95
|
-
CGO_ENABLED=0 go build -ldflags="-s -w" -o myapp .
|
|
96
|
-
|
|
97
|
-
# With version embedding
|
|
98
|
-
go build -ldflags="-s -w \
|
|
99
|
-
-X main.version=$(git describe --tags --always) \
|
|
100
|
-
-X main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
101
|
-
-o myapp .
|
|
102
|
-
|
|
103
|
-
# Cross-compile
|
|
104
|
-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o myapp-linux .
|
|
105
|
-
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o myapp.exe .
|
|
106
|
-
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o myapp-mac .
|
|
107
|
-
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o myapp-mac-intel .
|
|
108
|
-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o myapp-linux-arm64 .
|
|
109
|
-
|
|
110
|
-
# Build all platforms at once
|
|
111
|
-
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o dist/myapp-linux-amd64 .
|
|
112
|
-
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o dist/myapp-linux-arm64 .
|
|
113
|
-
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o dist/myapp-darwin-arm64 .
|
|
114
|
-
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o dist/myapp-darwin-amd64 .
|
|
115
|
-
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o dist/myapp-windows-amd64.exe .
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Docker
|
|
119
|
-
|
|
120
|
-
```dockerfile
|
|
121
|
-
FROM golang:1.23-alpine AS builder
|
|
122
|
-
WORKDIR /app
|
|
123
|
-
COPY go.* ./
|
|
124
|
-
RUN go mod download
|
|
125
|
-
COPY . .
|
|
126
|
-
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o myapp .
|
|
127
|
-
|
|
128
|
-
FROM alpine:latest
|
|
129
|
-
RUN apk add --no-cache ca-certificates tzdata && \
|
|
130
|
-
addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
131
|
-
COPY --from=builder /app/myapp /myapp
|
|
132
|
-
USER appuser
|
|
133
|
-
EXPOSE 8080
|
|
134
|
-
HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:8080/health || exit 1
|
|
135
|
-
CMD ["/myapp"]
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Embed Static Files
|
|
139
|
-
|
|
140
|
-
```go
|
|
141
|
-
package main
|
|
142
|
-
|
|
143
|
-
import "embed"
|
|
144
|
-
|
|
145
|
-
//go:embed static/*
|
|
146
|
-
var staticFiles embed.FS
|
|
147
|
-
|
|
148
|
-
func main() {
|
|
149
|
-
http.Handle("/", http.FileServer(http.FS(staticFiles)))
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## gRPC Build
|
|
154
|
-
|
|
155
|
-
```protobuf
|
|
156
|
-
// proto/service.proto
|
|
157
|
-
syntax = "proto3";
|
|
158
|
-
package myservice;
|
|
159
|
-
service MyService {
|
|
160
|
-
rpc GetUser(GetUserRequest) returns (User);
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
# Generate Go code
|
|
166
|
-
protoc --go_out=. --go-grpc_out=. proto/service.proto
|
|
167
|
-
|
|
168
|
-
# Build server and client
|
|
169
|
-
go build -o server ./cmd/server
|
|
170
|
-
go build -o client ./cmd/client
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## Common Pitfalls
|
|
174
|
-
|
|
175
|
-
| Issue | Fix |
|
|
176
|
-
|-------|-----|
|
|
177
|
-
| CGO dependency fails cross-compile | Use `CGO_ENABLED=0`; or use `cross` Docker image |
|
|
178
|
-
| Timezone issues in container | Install `tzdata` package in Alpine image |
|
|
179
|
-
| Static files not included | Use `//go:embed` directive (Go 1.16+) |
|
|
180
|
-
| Binary too large | Use `ldflags="-s -w"`; strip debug symbols |
|
|
181
|
-
| `go.sum` mismatch in CI | Run `go mod tidy`; commit both `go.mod` and `go.sum` |
|
|
182
|
-
| Import cycle | Restructure packages; use interfaces to break cycles |
|
|
183
|
-
| Race condition | Run with `-race` flag during testing |
|
|
184
|
-
| Memory leak in long-running | Use `pprof` for profiling; check goroutine leaks |
|
|
1
|
+
# Go Backend Build Sub-Skill
|
|
2
|
+
|
|
3
|
+
Build Go backend services (Gin/Echo/Fiber/Axum-like stdlib).
|
|
4
|
+
|
|
5
|
+
**Current version**: Go 1.24+ / 1.25 / 1.26 (2025-2026)
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- High-performance REST/gRPC API services
|
|
10
|
+
- CLI tools with embedded server
|
|
11
|
+
- Microservices requiring low memory footprint
|
|
12
|
+
- Network services (proxy, gateway, load balancer)
|
|
13
|
+
- Concurrent/parallel processing services
|
|
14
|
+
|
|
15
|
+
## Framework Quick Start
|
|
16
|
+
|
|
17
|
+
### Gin (Most Popular)
|
|
18
|
+
|
|
19
|
+
```go
|
|
20
|
+
package main
|
|
21
|
+
|
|
22
|
+
import "github.com/gin-gonic/gin"
|
|
23
|
+
|
|
24
|
+
func main() {
|
|
25
|
+
r := gin.Default()
|
|
26
|
+
r.GET("/health", func(c *gin.Context) { c.JSON(200, gin.H{"status": "ok"}) })
|
|
27
|
+
r.GET("/api/users", getUsers)
|
|
28
|
+
r.Run(":8080")
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Echo (Lightweight)
|
|
33
|
+
|
|
34
|
+
```go
|
|
35
|
+
package main
|
|
36
|
+
|
|
37
|
+
import "github.com/labstack/echo/v4"
|
|
38
|
+
|
|
39
|
+
func main() {
|
|
40
|
+
e := echo.New()
|
|
41
|
+
e.GET("/health", func(c echo.Context) error { return c.JSON(200, map[string]string{"status": "ok"}) })
|
|
42
|
+
e.Logger.Fatal(e.Start(":8080"))
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Fiber (Express-like, fastest)
|
|
47
|
+
|
|
48
|
+
```go
|
|
49
|
+
package main
|
|
50
|
+
|
|
51
|
+
import "github.com/gofiber/fiber/v3"
|
|
52
|
+
|
|
53
|
+
func main() {
|
|
54
|
+
app := fiber.New()
|
|
55
|
+
app.Get("/health", func(c fiber.Ctx) error { return c.JSON(map[string]string{"status": "ok"}) })
|
|
56
|
+
app.Listen(":8080")
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### net/http (Standard Library, Zero Dependencies)
|
|
61
|
+
|
|
62
|
+
```go
|
|
63
|
+
package main
|
|
64
|
+
|
|
65
|
+
import (
|
|
66
|
+
"encoding/json"
|
|
67
|
+
"net/http"
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
func main() {
|
|
71
|
+
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
|
|
72
|
+
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
|
|
73
|
+
})
|
|
74
|
+
http.ListenAndServe(":8080", nil)
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Framework Comparison
|
|
79
|
+
|
|
80
|
+
| Framework | Performance | Middleware | Ecosystem | Best For |
|
|
81
|
+
|-----------|------------|-----------|-----------|----------|
|
|
82
|
+
| Gin | High | Rich | Largest | General-purpose APIs |
|
|
83
|
+
| Echo | High | Rich | Large | Clean API design |
|
|
84
|
+
| Fiber | Highest | Rich | Growing | Express-style, max performance |
|
|
85
|
+
| net/http | High | Manual | Stdlib | Zero-dependency, simple APIs |
|
|
86
|
+
| Chi | High | Composable | Moderate | RESTful APIs, middleware chains |
|
|
87
|
+
|
|
88
|
+
## Build
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Standard build
|
|
92
|
+
go build -o myapp .
|
|
93
|
+
|
|
94
|
+
# Optimized release build
|
|
95
|
+
CGO_ENABLED=0 go build -ldflags="-s -w" -o myapp .
|
|
96
|
+
|
|
97
|
+
# With version embedding
|
|
98
|
+
go build -ldflags="-s -w \
|
|
99
|
+
-X main.version=$(git describe --tags --always) \
|
|
100
|
+
-X main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
101
|
+
-o myapp .
|
|
102
|
+
|
|
103
|
+
# Cross-compile
|
|
104
|
+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o myapp-linux .
|
|
105
|
+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o myapp.exe .
|
|
106
|
+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o myapp-mac .
|
|
107
|
+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o myapp-mac-intel .
|
|
108
|
+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o myapp-linux-arm64 .
|
|
109
|
+
|
|
110
|
+
# Build all platforms at once
|
|
111
|
+
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o dist/myapp-linux-amd64 .
|
|
112
|
+
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o dist/myapp-linux-arm64 .
|
|
113
|
+
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o dist/myapp-darwin-arm64 .
|
|
114
|
+
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o dist/myapp-darwin-amd64 .
|
|
115
|
+
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o dist/myapp-windows-amd64.exe .
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Docker
|
|
119
|
+
|
|
120
|
+
```dockerfile
|
|
121
|
+
FROM golang:1.23-alpine AS builder
|
|
122
|
+
WORKDIR /app
|
|
123
|
+
COPY go.* ./
|
|
124
|
+
RUN go mod download
|
|
125
|
+
COPY . .
|
|
126
|
+
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o myapp .
|
|
127
|
+
|
|
128
|
+
FROM alpine:latest
|
|
129
|
+
RUN apk add --no-cache ca-certificates tzdata && \
|
|
130
|
+
addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
131
|
+
COPY --from=builder /app/myapp /myapp
|
|
132
|
+
USER appuser
|
|
133
|
+
EXPOSE 8080
|
|
134
|
+
HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:8080/health || exit 1
|
|
135
|
+
CMD ["/myapp"]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Embed Static Files
|
|
139
|
+
|
|
140
|
+
```go
|
|
141
|
+
package main
|
|
142
|
+
|
|
143
|
+
import "embed"
|
|
144
|
+
|
|
145
|
+
//go:embed static/*
|
|
146
|
+
var staticFiles embed.FS
|
|
147
|
+
|
|
148
|
+
func main() {
|
|
149
|
+
http.Handle("/", http.FileServer(http.FS(staticFiles)))
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## gRPC Build
|
|
154
|
+
|
|
155
|
+
```protobuf
|
|
156
|
+
// proto/service.proto
|
|
157
|
+
syntax = "proto3";
|
|
158
|
+
package myservice;
|
|
159
|
+
service MyService {
|
|
160
|
+
rpc GetUser(GetUserRequest) returns (User);
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Generate Go code
|
|
166
|
+
protoc --go_out=. --go-grpc_out=. proto/service.proto
|
|
167
|
+
|
|
168
|
+
# Build server and client
|
|
169
|
+
go build -o server ./cmd/server
|
|
170
|
+
go build -o client ./cmd/client
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Common Pitfalls
|
|
174
|
+
|
|
175
|
+
| Issue | Fix |
|
|
176
|
+
|-------|-----|
|
|
177
|
+
| CGO dependency fails cross-compile | Use `CGO_ENABLED=0`; or use `cross` Docker image |
|
|
178
|
+
| Timezone issues in container | Install `tzdata` package in Alpine image |
|
|
179
|
+
| Static files not included | Use `//go:embed` directive (Go 1.16+) |
|
|
180
|
+
| Binary too large | Use `ldflags="-s -w"`; strip debug symbols |
|
|
181
|
+
| `go.sum` mismatch in CI | Run `go mod tidy`; commit both `go.mod` and `go.sum` |
|
|
182
|
+
| Import cycle | Restructure packages; use interfaces to break cycles |
|
|
183
|
+
| Race condition | Run with `-race` flag during testing |
|
|
184
|
+
| Memory leak in long-running | Use `pprof` for profiling; check goroutine leaks |
|