Skip to content

Commit bd2ae48

Browse files
authored
OSDGCP-2 | feat: Improve AI-assisted development readiness: AGENTS.md, templates, .gitignore, pre-commit hooks [Generated by gurnben's Agent] (#1100)
* Add agent-readiness improvements: AGENTS.md, CLAUDE.md, PR/issue templates, .gitignore, pre-commit hooks * Add AGENTS.md (tool-agnostic AI coding assistant guidance) Adds the missing AGENTS.md file that was referenced in the PR description but not included. Content is derived from the existing CLAUDE.md already present on main, adapted to be tool-agnostic.
1 parent a6c501d commit bd2ae48

6 files changed

Lines changed: 187 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Describe the Bug
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
## Steps to Reproduce
14+
15+
1.
16+
2.
17+
3.
18+
19+
## Expected Behavior
20+
21+
<!-- What you expected to happen. -->
22+
23+
## Actual Behavior
24+
25+
<!-- What actually happened. -->
26+
27+
## Environment
28+
29+
- OS:
30+
- Version:
31+
- Go version (if applicable):
32+
33+
## Additional Context
34+
35+
<!-- Add any other context, logs, or screenshots. -->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Problem Statement
10+
11+
<!-- A clear description of what problem this feature would solve. -->
12+
13+
## Proposed Solution
14+
15+
<!-- Describe the solution you'd like. -->
16+
17+
## Alternatives Considered
18+
19+
<!-- Any alternative solutions or features you've considered. -->
20+
21+
## Additional Context
22+
23+
<!-- Add any other context or mockups. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Description
2+
3+
<!-- Briefly describe the change and its motivation. -->
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix (non-breaking change that fixes an issue)
8+
- [ ] New feature (non-breaking change that adds functionality)
9+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
10+
- [ ] Documentation update
11+
- [ ] Refactoring (no functional changes)
12+
- [ ] CI/CD or tooling change
13+
14+
## Testing
15+
16+
<!-- Describe the tests you ran and how to reproduce them. -->
17+
18+
- [ ] Unit tests pass (`make test`)
19+
- [ ] Integration tests pass (if applicable)
20+
- [ ] Manual verification completed
21+
22+
## Checklist
23+
24+
- [ ] My code follows the project's coding conventions
25+
- [ ] I have updated documentation as needed
26+
- [ ] I have added tests that prove my fix/feature works
27+
- [ ] All new and existing tests pass

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,40 @@
55
/ocm
66
/ocm-*
77
/.idea
8+
9+
# === Additional patterns for agent-readiness ===
10+
# Binaries
11+
*.exe
12+
*.exe~
13+
*.dll
14+
*.so
15+
*.dylib
16+
17+
# Test binary, built with `go test -c`
18+
*.test
19+
20+
# Output of the go coverage tool
21+
*.out
22+
*.prof
23+
24+
# Go workspace file
25+
go.work
26+
go.work.sum
27+
28+
# IDE and editor files
29+
.idea/
30+
.vscode/
31+
*.swp
32+
*.swo
33+
*~
34+
.project
35+
.settings/
36+
37+
# OS files
38+
.DS_Store
39+
Thumbs.db
40+
Desktop.ini
41+
42+
# Build output
43+
/bin/
44+
/dist/

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
args: ['--allow-multiple-documents']
9+
- id: check-added-large-files
10+
args: ['--maxkb=500']
11+
- id: check-merge-conflict
12+
- repo: https://github.com/golangci/golangci-lint
13+
rev: v2.1.2
14+
hooks:
15+
- id: golangci-lint

AGENTS.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# AGENTS.md
2+
3+
This file provides guidance to AI coding assistants when working with this repository.
4+
5+
## Project Overview
6+
7+
OCM CLI (`ocm`) is a command-line tool for interacting with the OpenShift Cluster Manager (OCM) API. Built in Go with Cobra for command structure and the OCM SDK (`ocm-sdk-go`) for type-safe API interactions.
8+
9+
## Build & Test Commands
10+
11+
```bash
12+
make # Build all command binaries
13+
make install # Install ocm binary to $GOPATH/bin
14+
make test # Run all tests (Ginkgo)
15+
make lint # Run golangci-lint via container
16+
make fmt # Format Go source code
17+
make clean # Remove build artifacts
18+
```
19+
20+
## Architecture
21+
22+
### Command Structure (`cmd/ocm/`)
23+
- **Core API**: `get`, `post`, `patch`, `delete` — direct API interaction
24+
- **Resource management**: `create`, `edit`, `describe`, `list` — higher-level operations
25+
- **Authentication**: `login`, `logout`, `token`, `whoami`
26+
- **Cluster operations**: `cluster/` subcommands for cluster lifecycle
27+
- **Account management**: `account/` subcommands for organizations, users, roles
28+
- **Utilities**: `config`, `completion`, `version`, `tunnel`
29+
30+
### Key Packages
31+
- **pkg/ocm/** — Core OCM SDK connection and authentication handling
32+
- **pkg/arguments/** — Command-line argument parsing and interactive prompts
33+
- **pkg/config/** — Configuration file management (`~/.config/ocm/ocm.json`)
34+
- **pkg/output/** — Output formatting (JSON, table) with YAML table definitions
35+
- **pkg/cluster/** — Cluster-specific operations and utilities
36+
- **pkg/plugin/** — Plugin discovery and execution (`ocm-` prefix binaries in PATH)
37+
38+
### Connection & Auth
39+
- OCM SDK connections built through `pkg/ocm/connection-builder/`
40+
- Multiple auth methods supported; environment variable `OCM_CONFIG` for alternate config
41+
- Keyring support via `OCM_KEYRING` for secure credential storage
42+
- Automatic token refresh and session management
43+
44+
## Key Conventions
45+
46+
- Module path: `github.com/openshift-online/ocm-cli`
47+
- Ginkgo/Gomega for testing (tests in `tests/` directory)
48+
- Use `podman` over `docker` (configurable via `container_runner` Make variable)
49+
- Static binaries (CGO disabled)
50+
- Plugin extensions use `ocm-` prefix naming convention

0 commit comments

Comments
 (0)