zytedata/skills

scrape-add-page-object

Add an empty web-poet page object to a Scrapy project

First seen Jun 26, 2026

Installation

$ npx skills add zytedata/skills --skill scrape-add-page-object

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from zytedata/skills · top by installs.

npx skills add zytedata/skills

Browse all from zytedata/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 8
License LICENSE.md
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsBash, Read, Write

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,811 B
  • docs SUMMARY.md 83 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 157 installs

SKILL.md

You are adding an empty web-poet page object to a Scrapy project.

Read ${CLAUDESKILLDIR}/../scrape/references/python-environments.md.

Input

The raw argument string is $ARGUMENTS. Split it into up to 6 whitespace-separated positional arguments:

  1. filepath: path to the .py file to create or append to (e.g. booksproject/pages/bookstoscrapecom.py)
  2. class_name: page object class name (e.g. ProductPage)
  3. domain: domain for @handle_urls (e.g. books.toscrape.com)
  4. baseclass: base class import path (e.g. webpoet.WebPage)
  5. itemclass: item class import path (e.g. booksproject.items.ProductItem)
  6. fields: optional, comma-separated field names (e.g. name,price,rating)

Process

Run from the project root (the directory containing pyproject.toml) so the item class is importable for auto-detecting required fields:

uv run --project . --with libcst ${CLAUDE_SKILL_DIR}/scripts/add_page_object.py \
    FILE_PATH CLASS_NAME DOMAIN BASE_CLASS ITEM_CLASS

Required fields (those with no default in the item class) are detected automatically via itemadapter and get @field stubs. If all fields have defaults the class body is pass. Pass --fields name,price to override auto-detection.

The script uses libcst for correct AST manipulation:

  • Creates the file if it doesn't exist
  • Appends to existing files with proper import merging
  • Multiple page objects can share a module (e.g., ProductPage and CategoryPage)

Common base classes:

  • web_poet.WebPage — for pages using HTTP responses (most common)