9 Commits

Author SHA1 Message Date
Vince Lozada a23bf16d6d fix: honor build-claude-skill output path (#62) 2026-05-01 18:11:52 -05:00
Vince Lozada 8d42618e91 fix: retry GitLab inline MR comments with computed line_code (#57)
* fix: retry inline MR comments with computed line_code

* Fix inline comment diff pagination and rename anchors

---------

Co-authored-by: Forge OpenClaw <forge@openclaw.local>
2026-04-17 14:22:17 -05:00
Steven cf267e536c fix: make claude skill build script portable 2026-03-25 07:59:53 -05:00
Vince Lozada 732ab95906 security: address HIGH/MEDIUM findings from skills.sh audit (#35)
* security: address HIGH/MEDIUM findings from skills.sh audit

- Remove eval from mr-review-workflow.sh; add command allowlist
- Replace direct config file parsing with glab auth token in add-inline-comment.sh
- Add external content boundary markers to create-mr-from-issue.sh and ci-debug.sh
- Add private key upload warning to glab-ssh-key/SKILL.md
- Add prompt injection warnings to glab-api, glab-ci, glab-job SKILL.md files
- Add SECURITY.md with full security policy and guidance

Fixes #34

* chore: exclude SECURITY.md from zip export

---------

Co-authored-by: Steven (Bot) <steven@winkintel.com>
2026-03-04 19:41:38 -06:00
Ubuntu dbc300dd8f fix: lowercase skill name to satisfy Claude.ai naming constraint
Claude.ai requires skill names to contain only lowercase letters,
numbers, and hyphens. 'GitLab CLI Skills' → 'gitlab-cli-skills'

This constraint was not documented on the support page — discovered
via upload error.
2026-03-03 16:19:04 +00:00
Vince Lozada 276a2a045a feat: add build-claude-skill.sh for Claude.ai integration (#33)
* feat: add build-claude-skill.sh for Claude.ai integration

Closes #32

Claude.ai organization skill upload requires a zip containing exactly
one SKILL.md. The existing release zip contains 38 SKILL.md files
(one per sub-skill), causing an upload error.

Changes:
- scripts/build-claude-skill.sh: merges all sub-skill SKILL.md files
  into a single consolidated SKILL.md, strips OpenClaw YAML frontmatter,
  and packages the result into claude-skill.zip
- README.md: documents Claude.ai installation via pre-built zip download
  or running the build script locally
- .gitignore: excludes claude-skill.zip (build artifact)

* fix: correct ZIP structure and add required YAML frontmatter

Per Claude.ai skill spec (support.claude.com):
- ZIP must contain files inside a subdirectory, not at the root:
    claude-skill.zip/gitlab-cli-skills/SKILL.md  ✅
    claude-skill.zip/SKILL.md                     ❌
- SKILL.md must start with YAML frontmatter containing
  'name' and 'description' fields (required by Claude.ai
  to decide when to invoke the skill)

Previously the script stripped all frontmatter and placed
SKILL.md directly in the zip root — both violations of spec.

---------

Co-authored-by: Ubuntu <ubuntu@vps-9755df38.vps.ovh.us>
2026-03-03 10:16:00 -06:00
Vince Lozada efabfbcf8a feat: document JSON body pattern for inline MR diff comments (#31)
* feat: document JSON body pattern for inline MR comments + add post-inline-comment.py script

glab api --field silently falls back to general comments when GitLab
rejects position data (common with new files, encoded paths). Fix is
to use Python urllib with Content-Type: application/json.

- glab-mr: new 'Posting Inline Comments on MR Diffs' section with
  full code example, line number parsing helper, and batch script usage
- scripts/post-inline-comment.py: reusable script supporting single
  and batch comment posting; auto-reads token from glab config;
  reports inline vs general fallback per comment

Closes #28

* security: harden post-inline-comment.py + add openclaw.requires metadata

Security fixes before ClawHub publish:
- Enforce HTTPS-only for --host (prevents token leakage over HTTP)
- Validate --project path format with regex
- Validate --file path (no null bytes or newlines)
- Cap --body at 10,000 chars with truncation warning
- Validate --line is a positive integer
- Batch file size limit (1MB) and count limit (100 comments)
- Validate token is non-empty and whitespace-free before first API call
- Fetch token after input validation (avoids credential access on bad input)
- Explicit SSL context on all urllib calls (strict CA verification)
- Error body truncated in exception messages (prevents token reflection)

Root SKILL.md: add openclaw.requires block declaring:
- GITLAB_TOKEN credential (optional, falls back to glab config)
- Outbound HTTPS network access scope
- Write-access warning (comments, thread resolution, MR approval)

---------

Co-authored-by: Steven (Bot) <steven@winkintel.com>
2026-03-03 09:57:31 -06:00
Vince Lozada 06042234cb Add inline comment automation for MR code reviews (#27)
* Add inline comment automation script

- Add glab-add-inline-comment.sh for posting inline MR comments
- Posts comments at specific file:line locations via GitLab API
- Auto-extracts token and fetches MR metadata
- Validates inline placement (DiffNote type)
- Add comprehensive documentation (README-inline-comments.md)
- Update scripts/README.md with new script listing

Closes #26

* Rename script: glab-add-inline-comment.sh → add-inline-comment.sh

Drop glab- prefix per review feedback.

- Rename scripts/glab-add-inline-comment.sh to scripts/add-inline-comment.sh
- Update all references in documentation (README.md, README-inline-comments.md)
- Update usage examples and command names

---------

Co-authored-by: Steven (Bot) <steven@winkintel.com>
2026-02-23 16:50:48 -06:00
Vince Lozada c29467a0e7 Phase 2: Add scripts, TOCs, and troubleshooting (#14)
- Added 5 high-value automation scripts:
  * mr-review-workflow.sh - Automated MR review with tests
  * create-mr-from-issue.sh - Create branch + draft MR from issue
  * ci-debug.sh - Debug CI failures (find failed jobs + logs)
  * batch-label-issues.sh - Apply labels to multiple issues
  * sync-fork.sh - Sync fork with upstream
- Created scripts/README.md with usage documentation
- Added TOC to glab-mr/references/commands.md (656 lines)
- Updated SKILL.md files to reference relevant scripts
- Added troubleshooting sections to:
  * glab-mr: merge conflicts, approval issues, pipeline problems
  * glab-repo: clone failures, fork issues, transfer problems
  * (glab-auth and glab-ci already had troubleshooting from Phase 1)

Addresses #13 Phase 2 objectives:
✅ 5 high-value scripts created and documented
✅ TOC added to long reference file (>100 lines)
✅ Troubleshooting sections added to top 5 skills
✅ Scripts follow OpenClaw patterns (token-efficient, deterministic)
✅ All scripts executable and well-documented

Token efficiency improvements:
- Scripts execute without loading into context
- Only script output consumes tokens
- Reduces need to regenerate same code repeatedly
- Better navigability via TOC in reference docs

Co-authored-by: Ubuntu <ubuntu@vps-9755df38.vps.ovh.us>
2026-02-11 22:51:20 -06:00