Skip to content

skills: add pre-main-push gate#52

Merged
VinciGit00 merged 2 commits intomainfrom
docs/add-pre-main-push-skill
Apr 22, 2026
Merged

skills: add pre-main-push gate#52
VinciGit00 merged 2 commits intomainfrom
docs/add-pre-main-push-skill

Conversation

@VinciGit00
Copy link
Copy Markdown
Member

@VinciGit00 VinciGit00 commented Apr 22, 2026

Summary

  • Adds .claude/skills/pre-main-push.md, a Claude Code skill that blocks direct pushes to main and enforces: (1) user-supplied API key per session, (2) 5-URL validation of the chosen v2 endpoint, (3) PR-only workflow.
  • Encodes the v1→v2 endpoint mapping (markdownify→scrape, smartscraper→extract, searchscraper→search, smartcrawler→crawl.start) and pins the v2 host v2-api.scrapegraphai.com/api/*.
  • Hard-stops if the key is missing, any URL fails, or gh isn't authenticated. Forbids logging the key or bypassing with --force/--no-verify.

Validation

Endpoint extract tested against 5 live websites via tests/python-v2.1.0/test_extract.py5/5 returned status=success (example.com, scrapegraphai.com, iana.org, example.org, httpbin.org/html). API key supplied by user at PR creation time; not stored or logged.

Test plan

  • Skill triggers on "push to main" / "merge to main" / /pre-main-push
  • Key is requested each invocation; never read from .env
  • 5/5 endpoint calls pass before PR is opened; any failure aborts
  • Branch is created off main (no direct push to origin/main)

🤖 Generated with Claude Code

VinciGit00 and others added 2 commits April 22, 2026 09:08
Blocks direct pushes to main: requires a user-supplied ScrapeGraph API
key, validates the chosen v2 endpoint against 5 live sites, and only
then opens a PR. Enforces the v1→v2 endpoint mapping and forbids
logging the key.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After opening the PR, the skill now instructs the agent to post the
5-URL validation output (status + elapsed_ms, keys only) as a PR
comment via `gh pr comment`, with explicit guardrails: never paste
the API key, headers, or raw response bodies.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@VinciGit00
Copy link
Copy Markdown
Member Author

Endpoint validation — extract (5/5 passed)

Run via tests/python-v2.1.0/test_extract.py against scrapegraph-py>=2.1.0. API key supplied by the user at PR time; not stored, logged, or echoed. Response payloads omitted — key names only.

[extract 1/5] https://example.com          -> status=success elapsed_ms=534  keys=['page_title', 'main_heading']
[extract 2/5] https://scrapegraphai.com    -> status=success elapsed_ms=1529 keys=['answer', 'description']
[extract 3/5] https://www.iana.org/        -> status=success elapsed_ms=1234 keys=['main_purpose']
[extract 4/5] https://example.org          -> status=success elapsed_ms=348  keys=['title', 'description']
[extract 5/5] https://httpbin.org/html     -> status=success elapsed_ms=1421 keys=['summary']

Demonstrates the new step 4 added in 099594e.

@VinciGit00 VinciGit00 merged commit 00f8f5b into main Apr 22, 2026
2 checks passed
@VinciGit00 VinciGit00 deleted the docs/add-pre-main-push-skill branch April 22, 2026 07:10
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