Skip to content

docs: add gcpath agent skill#31

Merged
tardigrde merged 3 commits intomainfrom
feat/gcpath-agent-skill
Mar 30, 2026
Merged

docs: add gcpath agent skill#31
tardigrde merged 3 commits intomainfrom
feat/gcpath-agent-skill

Conversation

@tardigrde
Copy link
Copy Markdown
Owner

@tardigrde tardigrde commented Mar 30, 2026

Summary

  • Adds skills/gcpath/ following the Agent Skills spec, so AI agents can install and use gcpath natively
  • SKILL.md covers when-to-use triggers, all CLI commands with examples, 7 common workflow recipes, API modes, caching, and gotchas
  • references/commands.md is a compact per-command flag table for quick agent lookup

Install

Once merged, agents can install the skill via:

bunx skills add github:tardigrde/gcpath --skill gcpath

Test plan

  • bunx skills add github:tardigrde/gcpath --skill gcpath --list shows the skill
  • SKILL.md frontmatter description accurately describes when an agent should activate the skill
  • All commands in references/commands.md match the actual CLI flags in src/gcpath/cli.py

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive gcpath documentation covering installation/run options, authentication and required permissions, core concepts and path/resource formats, common workflows and example commands, global flags, machine-readable output, caching behavior, and operational gotchas.
    • Added a complete command reference detailing each gcpath subcommand, flags, behaviors, and examples.
    • Expanded README with an “Agent Skill” section and install/use guidance for the gcpath skill.

Adds a skills/gcpath/ directory following the Agent Skills spec
(agentskills.io), enabling agents to install and use gcpath via:

  bunx skills add github:tardigrde/gcpath --skill gcpath

Includes SKILL.md (when-to-use guidance, all commands with examples,
common workflows, gotchas) and references/commands.md (compact flag
reference per command).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5fcfe48b-d684-4c70-ab13-3f3584581bbc

📥 Commits

Reviewing files that changed from the base of the PR and between a3e354e and c9e7b2b.

📒 Files selected for processing (1)
  • skills/gcpath/SKILL.md

📝 Walkthrough

Walkthrough

Adds documentation for a new Agent Skill gcpath: a read-only CLI for navigating GCP resource hierarchies, including installation, auth/permissions, command reference, usage examples, output formats, caching behavior, and operational gotchas.

Changes

Cohort / File(s) Summary
gcpath Skill Documentation
skills/gcpath/SKILL.md
New skill doc describing scope, installation/run modes, authentication and required roles, core concepts (resource-name and human path formats), entrypoint configuration, per-command workflows (ls, tree, diagram, stats, name, path, find, ancestors, cache, config), global flags, output formats, and gotchas.
gcpath Command Reference
skills/gcpath/references/commands.md
New command reference enumerating global flags, each subcommand's flags/behavior, examples, and accepted resource/path formats.
README Update
README.md
Added "Agent Skill" section explaining how to install gcpath as a skill (bunx/npx skills add --skill gcpath), summary of coverage, and links to the skill and command reference docs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 I hopped through docs to map the sky,

From org to project, each path I spy.
ls and tree, a carrot-lined trail,
I counted folders down the vale.
A rabbit's cheer for gcpath's tale.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: add gcpath agent skill' clearly and concisely summarizes the main change: adding documentation for the gcpath agent skill following the Agent Skills spec.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/gcpath-agent-skill

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.29%. Comparing base (29b2d81) to head (c9e7b2b).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #31   +/-   ##
=======================================
  Coverage   87.29%   87.29%           
=======================================
  Files           9        9           
  Lines        1786     1786           
=======================================
  Hits         1559     1559           
  Misses        227      227           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces documentation for gcpath, a CLI tool for navigating GCP resource hierarchies, including a main skill guide and a command reference. The review feedback identifies several missing flags and examples in the SKILL.md file for the tree, diagram, and find commands, and suggests clarifying the global API selection flags to ensure the documentation accurately reflects the tool's capabilities.

Comment thread skills/gcpath/SKILL.md Outdated
Comment on lines +86 to +93
```bash
gcpath tree # full hierarchy tree
gcpath tree folders/123 # subtree from a folder
gcpath tree folders/123 -L 3 # limit depth
gcpath tree folders/123 -i # show resource names alongside display names
gcpath tree folders/123 --type project # only show projects
gcpath tree -y # skip confirmation for large loads
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The documentation for the tree command is missing some available flags. According to src/gcpath/cli.py and references/commands.md, the tree command also supports --show-labels, --show-tags, --label KEY=VALUE, and --tag KEY=VALUE for displaying and filtering by metadata. It would be beneficial to include these in the examples to showcase the full capabilities of the command.

Suggested change
```bash
gcpath tree # full hierarchy tree
gcpath tree folders/123 # subtree from a folder
gcpath tree folders/123 -L 3 # limit depth
gcpath tree folders/123 -i # show resource names alongside display names
gcpath tree folders/123 --type project # only show projects
gcpath tree -y # skip confirmation for large loads
```
gcpath tree # full hierarchy tree
gcpath tree folders/123 # subtree from a folder
gcpath tree folders/123 -L 3 # limit depth
gcpath tree folders/123 -i # show resource names alongside display names
gcpath tree folders/123 --type project # only show projects
gcpath tree -y # skip confirmation for large loads
gcpath tree --label env=prod --show-labels # filter by label and show them

Comment thread skills/gcpath/SKILL.md Outdated
Comment on lines +97 to +103
```bash
gcpath diagram # Mermaid diagram of full hierarchy
gcpath diagram folders/123 # diagram of a subtree
gcpath diagram -f d2 # D2 format instead of Mermaid
gcpath diagram -o hierarchy.mmd # write to file
gcpath diagram folders/123 -L 2 # limit depth
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The documentation for the diagram command is missing the --ids (-i) and --yes (-y) flags, which are available according to src/gcpath/cli.py and references/commands.md. Please add examples for these flags to provide complete documentation.

Suggested change
```bash
gcpath diagram # Mermaid diagram of full hierarchy
gcpath diagram folders/123 # diagram of a subtree
gcpath diagram -f d2 # D2 format instead of Mermaid
gcpath diagram -o hierarchy.mmd # write to file
gcpath diagram folders/123 -L 2 # limit depth
```
gcpath diagram # Mermaid diagram of full hierarchy
gcpath diagram folders/123 # diagram of a subtree
gcpath diagram -f d2 # D2 format instead of Mermaid
gcpath diagram -o hierarchy.mmd # write to file
gcpath diagram folders/123 -L 2 # limit depth
gcpath diagram folders/123 -i # include resource names in diagram
gcpath diagram -y # skip confirmation for large loads

Comment thread skills/gcpath/SKILL.md Outdated
Comment on lines +131 to +136
```bash
gcpath find "data-*" # glob pattern, case-insensitive
gcpath find "*team*" folders/123 # scoped to a subtree
gcpath find "prod-*" --type project
gcpath find "*" --label env=production # find all labeled resources
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The documentation for the find command is missing the --tag flag for filtering by GCP tags. This flag is available according to src/gcpath/cli.py and references/commands.md. Please add an example for it to ensure the documentation is complete.

Suggested change
```bash
gcpath find "data-*" # glob pattern, case-insensitive
gcpath find "*team*" folders/123 # scoped to a subtree
gcpath find "prod-*" --type project
gcpath find "*" --label env=production # find all labeled resources
```
gcpath find "data-*" # glob pattern, case-insensitive
gcpath find "*team*" folders/123 # scoped to a subtree
gcpath find "prod-*" --type project
gcpath find "*" --label env=production # find all labeled resources
gcpath find "*" --tag cost-center=eng # find all tagged resources

Comment thread skills/gcpath/SKILL.md Outdated
| `--json` | | Output as JSON |
| `--yaml` | | Output as YAML |
| `--force-refresh` | `-F` | Bypass cache, re-fetch from GCP API |
| `--no-use-asset-api` | `-U` | Use Resource Manager API instead of Cloud Asset API |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The documentation for the API selection flag could be more precise. The flag is a toggle: --use-asset-api (default) and --no-use-asset-api. The short forms are -u and -U respectively. The current documentation only mentions --no-use-asset-api and -U. While the "API Modes" table clarifies this, making the "Global Flags" table more complete would improve clarity.

Suggested change
| `--no-use-asset-api` | `-U` | Use Resource Manager API instead of Cloud Asset API |
| `--use-asset-api / --no-use-asset-api` | `-u / -U` | Use Cloud Asset API (default) or Resource Manager API |

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
skills/gcpath/references/commands.md (1)

37-42: Add language specifier to code block.

The fenced code block should specify a language (e.g., bash or shell) for proper syntax highlighting and better rendering. This applies to all example code blocks in this file.

📝 Proposed fix for this block
-```
+```bash
 gcpath ls
 gcpath ls folders/123

As per static analysis hints, markdownlint MD040 rule requires language specifiers on fenced code blocks.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/gcpath/references/commands.md` around lines 37 - 42, Add a language
specifier (e.g., bash or shell) to the fenced code blocks containing the example
gcpath commands so they comply with markdownlint MD040; locate the example
block(s) that show commands like "gcpath ls", "gcpath ls folders/123", "gcpath
ls folders/123 -R -L 2 --type project", and "gcpath ls -R --label env=prod
--show-labels --json" and update the opening fence from ``` to ```bash (or
```shell) for each block.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/gcpath/references/commands.md`:
- Around line 5-15: Add the missing global flag entry for --force-refresh (-F)
to the "Global Flags" table so it matches usages elsewhere and SKILL.md; update
the table row to include the flag name `--force-refresh / -F`, the short form
`-F`, a sensible default (false), and a concise description like "force refresh
/ bypass caches" so readers know it's available for all commands referenced in
commands.md.

In `@skills/gcpath/SKILL.md`:
- Around line 160-172: Update the global flags table to document both the
positive and negative forms of the asset-api flag consistently with commands.md:
replace the single `--no-use-asset-api` / `-U` entry with an entry that shows
both `--use-asset-api / --no-use-asset-api` and both short forms `-u / -U`, and
ensure the description matches the intent ("Use Resource Manager API instead of
Cloud Asset API" or inverse as appropriate). Edit the `--no-use-asset-api` /
`-U` row in the SKILL.md Global Flags table so it mirrors the flags and short
aliases shown in commands.md (`--use-asset-api / --no-use-asset-api` with `-u /
-U`) and keep the description aligned.

---

Nitpick comments:
In `@skills/gcpath/references/commands.md`:
- Around line 37-42: Add a language specifier (e.g., bash or shell) to the
fenced code blocks containing the example gcpath commands so they comply with
markdownlint MD040; locate the example block(s) that show commands like "gcpath
ls", "gcpath ls folders/123", "gcpath ls folders/123 -R -L 2 --type project",
and "gcpath ls -R --label env=prod --show-labels --json" and update the opening
fence from ``` to ```bash (or ```shell) for each block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed08be71-789e-460b-b9bc-d9603810716c

📥 Commits

Reviewing files that changed from the base of the PR and between 29b2d81 and 545d357.

📒 Files selected for processing (2)
  • skills/gcpath/SKILL.md
  • skills/gcpath/references/commands.md

Comment on lines +5 to +15
## Global Flags

Apply to every command (place before the subcommand):

| Flag | Short | Default | Description |
|------|-------|---------|-------------|
| `--entrypoint RESOURCE` | `-e` | config/none | Scope all commands to this resource |
| `--json` | | false | JSON output |
| `--yaml` | | false | YAML output |
| `--use-asset-api / --no-use-asset-api` | `-u / -U` | true (asset) | API backend |
| `--debug` | | false | Debug logging |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing --force-refresh in global flags table.

The --force-refresh / -F flag appears in multiple command sections (lines 33, 60, 83, 101, 120, 157) but is not listed in the global flags table. According to SKILL.md line 169, --force-refresh / -F is documented as a global flag. This inconsistency may confuse users about the flag's availability.

📝 Proposed fix to add --force-refresh to global flags
 | `--use-asset-api / --no-use-asset-api` | `-u / -U` | true (asset) | API backend |
+| `--force-refresh` | `-F` | false | Bypass cache |
 | `--debug` | | false | Debug logging |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/gcpath/references/commands.md` around lines 5 - 15, Add the missing
global flag entry for --force-refresh (-F) to the "Global Flags" table so it
matches usages elsewhere and SKILL.md; update the table row to include the flag
name `--force-refresh / -F`, the short form `-F`, a sensible default (false),
and a concise description like "force refresh / bypass caches" so readers know
it's available for all commands referenced in commands.md.

Comment thread skills/gcpath/SKILL.md Outdated
Comment on lines +160 to +172
## Global Flags

These apply to any command:

| Flag | Short | Description |
|------|-------|-------------|
| `--entrypoint RESOURCE` | `-e` | Default scope for this invocation |
| `--json` | | Output as JSON |
| `--yaml` | | Output as YAML |
| `--force-refresh` | `-F` | Bypass cache, re-fetch from GCP API |
| `--no-use-asset-api` | `-U` | Use Resource Manager API instead of Cloud Asset API |
| `--debug` | | Enable debug logging |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent flag documentation between files.

Line 170 documents --no-use-asset-api / -U but does not mention the positive form --use-asset-api / -u. However, commands.md line 14 documents both forms: --use-asset-api / --no-use-asset-api with -u / -U. For consistency, both files should document the flag the same way.

📝 Proposed fix to align with commands.md
 | `--force-refresh` | `-F` | Bypass cache, re-fetch from GCP API |
-| `--no-use-asset-api` | `-U` | Use Resource Manager API instead of Cloud Asset API |
+| `--use-asset-api / --no-use-asset-api` | `-u / -U` | Choose API backend (Asset API is default) |
 | `--debug` | | Enable debug logging |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Global Flags
These apply to any command:
| Flag | Short | Description |
|------|-------|-------------|
| `--entrypoint RESOURCE` | `-e` | Default scope for this invocation |
| `--json` | | Output as JSON |
| `--yaml` | | Output as YAML |
| `--force-refresh` | `-F` | Bypass cache, re-fetch from GCP API |
| `--no-use-asset-api` | `-U` | Use Resource Manager API instead of Cloud Asset API |
| `--debug` | | Enable debug logging |
## Global Flags
These apply to any command:
| Flag | Short | Description |
|------|-------|-------------|
| `--entrypoint RESOURCE` | `-e` | Default scope for this invocation |
| `--json` | | Output as JSON |
| `--yaml` | | Output as YAML |
| `--force-refresh` | `-F` | Bypass cache, re-fetch from GCP API |
| `--use-asset-api / --no-use-asset-api` | `-u / -U` | Choose API backend (Asset API is default) |
| `--debug` | | Enable debug logging |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/gcpath/SKILL.md` around lines 160 - 172, Update the global flags table
to document both the positive and negative forms of the asset-api flag
consistently with commands.md: replace the single `--no-use-asset-api` / `-U`
entry with an entry that shows both `--use-asset-api / --no-use-asset-api` and
both short forms `-u / -U`, and ensure the description matches the intent ("Use
Resource Manager API instead of Cloud Asset API" or inverse as appropriate).
Edit the `--no-use-asset-api` / `-U` row in the SKILL.md Global Flags table so
it mirrors the flags and short aliases shown in commands.md (`--use-asset-api /
--no-use-asset-api` with `-u / -U`) and keep the description aligned.

tardigrde and others added 2 commits March 30, 2026 08:12
Adds a dedicated section explaining the bundled agent skill and how to
install it via bunx/npx, plus a one-liner callout in the "Why use gcpath"
bullet list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add allowed-tools: Bash(gcpath:*) Bash(uvx gcpath:*)
- Add compatibility, license, and metadata fields
- Trim SKILL.md from 258 to 143 lines: collapse verbose commands
  section into common workflows + key flags table, move full flag
  reference to references/commands.md with explicit load trigger
- Keep gotchas inline per best-practices guidance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@tardigrde tardigrde merged commit 531d4d5 into main Mar 30, 2026
7 of 8 checks passed
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.

1 participant