go-pr-description
Go PR — Affected Endpoints Generator
Produce the Affected endpoints block for a Go backend pull request description — nothing more.
Output only the formatted list, ready to paste into a PR body.
Target output format
Affected endpoints:
- GET `/ms/studio/v1/gen-ai-requests`
- POST `/ms/studio/v1/gen-ai-requests`
- POST `/ms/studio/svc/v1/gen-ai-requests`
- CMD `genai video`
- CMD `genai music` (NEW)
Append (NEW) to any item that originated from an added file (A status in git diff).
Step 1 — Get changed files with status
git diff --name-status origin/master...HEAD
Each line is <status>\t<path>. Status codes:
A= added → mark as(NEW)M/R/C= modified/renamed/copied → no suffix
Keep a set of "new" paths for later annotation.
Step 2 — Classify paths into buckets
| Bucket | Path prefix |
|---|---|
api-public |
app/api/public/ |
api-cms |
app/api/cms/ |
api-svc |
app/api/svc/ |
cmd-genai |
app/cmd/genai/ |
cmd-image |
app/cmd/image/ |
cmd-credit |
app/cmd/credit/ |
service |
app/service/ |
repository |
app/repository/ |
util-or-other |
everything else |
Adapt these prefixes to the actual repo structure if different.
Step 3 — Resolve each bucket
API buckets
For every changed file under app/api/{variant}/v1/:
-
Identify the domain from the file path. Examples:
app/api/public/v1/api/genairequestapi/list.go→ domaingenairequestapiapp/api/cms/v1/router/gen_ai_style.go→ domaingen_ai_style
-
Find the router file for this domain in
app/api/{variant}/v1/router/. If the changed file is the router file, use it directly. Otherwise look for a router file whose name matches the domain (e.g.gen_ai_request.goforgenairequestapi).ls app/api/{variant}/v1/router/ -
Read the router file and extract:
- The base path suffix from the
http.NewHttpRoutercall:router := http.NewHttpRouter(app, prefixUrl+"/gen-ai-requests", accessType) - Every HTTP method + sub-path registered afterward:
router.Get("", ...) // → GET <base> router.Post("", ...) // → POST <base> router.Put("/{id}", ...) // → PUT <base>/{id} router.Delete("/{id}", ...) // → DELETE <base>/{id}
- The base path suffix from the
-
Get the variant's root URL prefix by reading the routes registration file once per variant:
app/api/public/routes.go→ look forrootUrlV1 :=(typically/ms/studio/v1)app/api/cms/routes.go→ similar (typically/ms/studio/cms/v1)app/api/svc/routes.go→ similar (typically/ms/studio/svc/v1)
-
Compose the full path:
rootUrl + baseSuffix + subPath
If only a specific handler method changed (e.g. list.go was modified but create.go was not),
list only the route(s) that call the changed handler — not every route in the file.
Command buckets
Read app/cmd/{name}/root.go and the changed subcommand files. Find the Use field of each
cobra.Command struct or AddCommand registration:
var videoCmd = &cobra.Command{Use: "video", ...}
rootCmd.AddCommand(videoCmd)
Format as: CMD \genai video`(directory name as parent,Use` value as subcommand).
Parent names: cmd/genai → genai, cmd/image → image, cmd/credit → credit.
If root.go itself changed, include every registered subcommand.
Service bucket
Services are called by API handlers and commands — trace one level up:
# Example: changed file is app/service/videogenerationsvc/video_generation.go
# Extract package name: "videogenerationsvc"
grep -rl "videogenerationsvc" app/api/ app/cmd/ --include="*.go"
For each file the grep returns, apply the API or command resolution logic above.
Repository bucket
Repos are called by services — trace two levels up:
# Example: changed file is app/repository/db/genairequests/list.go
# Package name: "genairequests"
grep -rl "genairequests" app/service/ --include="*.go"
# → finds affected services
# Then for each service, run the service-bucket trace above
util-or-other bucket
Grep broadly for the package or type name across all api and cmd files, then apply the appropriate bucket resolution on each match:
grep -rl "<package-name>" app/api/ app/cmd/ --include="*.go"
If the grep returns too many files (a broadly shared utility), list the most clearly affected routes based on which handlers actually call the changed function, or note the scope inline rather than listing every route.
Step 4 — Deduplicate, sort, and emit
Collect all resolved entries. Remove exact duplicates. Sort order:
- HTTP endpoints — public variant first, then cms, then svc; within each variant sort by path
- CMD entries — alphabetically by command string
Output only this block, with no preamble or explanation:
Affected endpoints:
- METHOD `/full/path`
- CMD `parent sub` (NEW)
If nothing can be resolved (e.g. only config or doc files changed), output:
Affected endpoints:
- (no direct API or command surface affected)
Accuracy over completeness
When uncertain whether a route is truly affected, omit it rather than guess. A short accurate list is more useful in a PR than a long speculative one. If you genuinely cannot trace a file to a specific route, add a brief inline comment:
- CMD `genai video` <!-- indirect: shared utility change -->
More from sultanfarizbythen/skills
go-test-gen
Generate Go unit tests following project standards - table-driven tests with mockery mocks, explicit expectations with call counts, specific error objects, concrete structs. Use when writing unit tests for Go service layer or repository layer (NOT handler/API layer).
10go-code-review
Reviews Go backend PRs for bugs, potential bugs, anomalies, and redundant code. Specialized for Bythen repos (platform-svc, go-core) using wire DI, custom query builder, layered architecture (handler/service/repository). Use when reviewing Go PRs, diffs, or code changes.
10sql-query-generator
Generate and execute SQL queries for databases using the Kalysta MCP server. Use when the user needs to query database information, analyze data patterns, explore table contents, generate reports, or investigate data. Supports any database accessible via Kalysta MCP.
10create-devops-task
Creates draft tasks on the Bythen Devops GitHub Project board (https://github.com/orgs/tanookiai/projects/2/views/1). Always assigns novahariyabythen. Use when asked to add tasks, to-dos, or action items to the devops board.
5update-scientia-ip
Update the Scientia WiFi IP whitelist in Jenkins. Ensures WiFi connection, disconnects VPN, captures the current public IP, connects OpenVPN, triggers the Jenkins `change-ip-wifi-scientia` job with the captured IP, then disconnects VPN. Use when your WiFi IP has changed and you need to regain Scientia access.
5be-jenkins-deploy
Deploy a backend (BE) branch to a non-production Jenkins job and notify when done. Use this skill whenever the user says "deploy to staging", "deploy to jenkins", "trigger jenkins build", "deploy branch", "push to jenkins", or any variation of deploying/releasing a backend service via Jenkins CI/CD. Also trigger when the user asks to redeploy or check a Jenkins deployment in progress. Do NOT use this skill if the user mentions "prod", "production", or "beta" — those environments require manual confirmation and are out of scope.
4