Skip to content

docs: fix spec audit — add Public API, Usage Examples, and Dependencies to 17 packages#30155

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-specification-audit-issues
May 4, 2026
Merged

docs: fix spec audit — add Public API, Usage Examples, and Dependencies to 17 packages#30155
pelikhan merged 3 commits intomainfrom
copilot/fix-specification-audit-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

Automated spec audit flagged 47 issues across 22 packages: missing ## Public API sections, missing ## Usage Examples, and incomplete/absent ## Dependencies documentation.

Section renames (17 packages)

  • ## Functions## Public API: fileutil, gitutil, repoutil, sliceutil, testutil, timeutil, tty, typeutil
  • ## Types## Public API (with ### Types subsection): types, semverutil, agentdrain
  • ## Core Components### Core Components under new ## Public API: agentdrain
  • ## Semantic Types## Public API + ### Semantic Types: constants
  • ## Usage (containing API docs) → ## Public API + separate ## Usage Examples: envutil
  • Added ## Public API summary tables: console, logger, stringutil, styles

Usage Examples added (17 packages)

Idiomatic code snippets added to all 17 packages. envutil, logger, and styles had ## Usage renamed; the rest received new sections.

Dependencies added (10 packages)

All packages with internal pkg/ imports were missing dependency docs: agentdrain, console, envutil, fileutil, gitutil, logger, repoutil, semverutil, stringutil, typeutil.

Dependencies corrected (3 packages)

  • cli: 9 missing internal packages added (agentdrain, envutil, semverutil, sliceutil, stats, styles, timeutil, tty, types)
  • parser: jsonschema version corrected v5 → v6; added github.com/cli/go-gh/v2 and github.com/modelcontextprotocol/go-sdk/mcp; removed go.yaml.in/yaml/v3 (not imported)
  • workflow: fixed goccy/go-yamlgithub.com/goccy/go-yaml; added github.com/cli/go-gh/v2 and github.com/santhosh-tekuri/jsonschema/v6

Copilot AI linked an issue May 4, 2026 that may be closed by this pull request
5 tasks
Copilot AI and others added 2 commits May 4, 2026 14:11
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0eb250f6-a1e9-4e26-a498-f96203f95352

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…7 packages

- Renamed ## Functions/## Types/## Core Components to ## Public API in 17 packages
- Added ## Usage Examples (or renamed ## Usage) in 17 packages
- Added ## Dependencies to 10 packages with internal deps
- Updated ## Dependencies in cli (9 missing pkgs), parser (wrong/missing external), workflow (missing external)

Closes #1308

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0eb250f6-a1e9-4e26-a498-f96203f95352

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix naming and structure violations in package specifications docs: fix spec audit — add Public API, Usage Examples, and Dependencies to 17 packages May 4, 2026
Copilot AI requested a review from gh-aw-bot May 4, 2026 14:24
@pelikhan pelikhan marked this pull request as ready for review May 4, 2026 17:24
Copilot AI review requested due to automatic review settings May 4, 2026 17:24
@pelikhan pelikhan merged commit 96e88ee into main May 4, 2026
21 checks passed
@pelikhan pelikhan deleted the copilot/fix-specification-audit-issues branch May 4, 2026 17:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates package specifications to satisfy an automated spec audit by standardizing section structure and improving completeness of exported API, usage, and dependency documentation across multiple packages.

Changes:

  • Renamed/standardized exported API sections to ## Public API across affected package specs.
  • Added ## Usage Examples sections to 17 package READMEs.
  • Added/corrected ## Dependencies sections (including internal pkg/ dependencies and corrected external module paths/versions) and updated a locked workflow allowlist.
Show a summary per file
File Description
pkg/workflow/README.md Corrects/extends external dependency list (go-yaml module path, adds go-gh and jsonschema v6).
pkg/typeutil/README.md Renames API section to Public API; adds usage examples and internal dependency docs.
pkg/types/README.md Renames API section to Public API; adds usage examples.
pkg/tty/README.md Renames API section to Public API; adds usage examples.
pkg/timeutil/README.md Renames API section to Public API; adds usage examples.
pkg/testutil/README.md Renames API section to Public API; adds usage examples.
pkg/styles/README.md Adds Public API summary table; renames Usage to Usage Examples.
pkg/stringutil/README.md Reframes top-level section to Public API; adds usage examples and dependency docs.
pkg/sliceutil/README.md Renames API section to Public API; adds usage examples.
pkg/semverutil/README.md Consolidates types/functions under Public API; adds usage examples and dependency docs.
pkg/repoutil/README.md Renames API section to Public API; adds usage examples and dependency docs.
pkg/parser/README.md Corrects external dependencies (jsonschema v6, go-yaml module path) and documents additional external deps.
pkg/logger/README.md Adds Public API section/table; renames Usage to Usage Examples; adds dependency docs.
pkg/gitutil/README.md Renames API section to Public API; adds usage examples and dependency docs.
pkg/fileutil/README.md Renames API section to Public API; adds usage examples and dependency docs.
pkg/envutil/README.md Splits API docs into Public API + Usage Examples; adds dependency docs.
pkg/constants/README.md Moves semantic types under Public API; adds usage examples.
pkg/console/README.md Adds Public API summary table; adds usage examples and dependency docs.
pkg/cli/README.md Expands internal dependency list to include missing pkg/ packages.
pkg/agentdrain/README.md Consolidates under Public API; adds usage examples and dependency docs.
.github/workflows/daily-model-inventory.lock.yml Adds shell(playwright-cli:*) to the allow-tool list for the Copilot execution step.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

pkg/styles/README.md:95

  • The ## Usage Examples snippet uses fmt.Println and lipgloss.NewStyle() but only imports pkg/styles. Consider adding the required imports (e.g., fmt and charm.land/lipgloss/v2) or simplifying the example so it doesn’t reference undeclared identifiers/packages.
## Usage Examples

```go
import "github.com/github/gh-aw/pkg/styles"

// Use pre-configured styles
fmt.Println(styles.Error.Render("Something went wrong"))
fmt.Println(styles.Success.Render("Operation completed"))
fmt.Println(styles.Command.Render("gh aw compile"))

// Use adaptive colors for custom styles
customStyle := lipgloss.NewStyle().
    Foreground(styles.ColorInfo).
    Bold(true)
fmt.Println(customStyle.Render("Custom styled text"))
</details>


- **Files reviewed:** 21/21 changed files
- **Comments generated:** 5


Comment thread pkg/types/README.md
Comment on lines +118 to +126
// HTTP MCP server with OIDC auth
cfg := types.BaseMCPServerConfig{
Type: "http",
URL: "https://my-mcp-server.example.com",
Auth: &types.MCPAuthConfig{
Type: "github-oidc",
Audience: "https://my-mcp-server.example.com",
},
}
Comment thread pkg/sliceutil/README.md
Comment on lines +85 to +88
// Map a slice
names := []string{"alice", "bob"}
upper := sliceutil.Map(names, strings.ToUpper)
// upper = ["ALICE", "BOB"]
Comment thread pkg/timeutil/README.md
Comment on lines +60 to +66
```go
import "github.com/github/gh-aw/pkg/timeutil"

// Format a time.Duration
timeutil.FormatDuration(500 * time.Millisecond) // "500ms"
timeutil.FormatDuration(2500 * time.Millisecond) // "2.5s"
timeutil.FormatDuration(90 * time.Second) // "1.5m"
Comment thread pkg/testutil/README.md
Comment on lines +61 to +73
import "github.com/github/gh-aw/pkg/testutil"

func TestMyFunction(t *testing.T) {
// Create an isolated temp directory for test artifacts
dir := testutil.TempDir(t, "my-test-*")
// dir is cleaned up automatically when the test ends

// Capture output written to os.Stderr
output := testutil.CaptureStderr(t, func() {
myFunction() // function that writes to os.Stderr
})
assert.Contains(t, output, "expected message")
}
Comment thread pkg/constants/README.md
Comment on lines +448 to +459
```go
import "github.com/github/gh-aw/pkg/constants"

// Engine constants
engine := constants.CopilotEngine // EngineName("copilot")
fmt.Println(engine.String()) // "copilot"
fmt.Println(engine.IsValid()) // true

// Resolve an engine option for display and secret info
opt := constants.GetEngineOption("copilot")
fmt.Println(opt.Label) // "GitHub Copilot"
fmt.Println(opt.SecretName) // "COPILOT_GITHUB_TOKEN"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specification Audit — 2026-05-04 — 47 issues found

4 participants