scrapy-build
Use when the user wants a Scrapy project created, a domain or spider added, or page objects written.
How do I install this agent skill?
npx skills add https://github.com/p-severin/skills --skill scrapy-buildIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides a structured framework for building production-grade Scrapy projects using page objects and test-driven development with fixtures. It includes advanced features for bot-bypass and platform-specific API probing. Security analysis indicates the skill follows safe practices for secret management and local data processing, with no evidence of malicious patterns.
- Socketpass
No alerts
- Snykwarn
Risk: MEDIUM · 1 issue
What does this agent skill do?
Scrapy Build
Scrapy is the default production implementation path. This skill follows the
JWR method from zytelabs/scrapy-openspec. Each rule below fixed a real
mistake, so follow it even when another way looks shorter.
Inputs
Collect these before you write code:
- Start URLs for every domain.
- Record fields per domain. Ask the user; never guess the schema.
- Browser backend:
patchright(default) orcamoufoxwhen the user asks. - Zyte API: off unless the user asks. Read
references/fetching.md. - Production layer: off unless the user asks. Read
references/production.md.
Creation flow
Run the steps in this order. Each step needs the output of the previous one.
- Create the project,
.gitignore, and pytest config. Copyscripts/clean_fixture.pyfrom this skill into the project'sscripts/. Readreferences/project-setup.md. - Replace the
startprojecttemplates. Configuresettings.pyfor tier 1 of the fetch ladder only. - Write
items.py: one record item and one list item per record type. Readreferences/page-objects.md. - Generate the spider scaffold with
scrapy genspider. - Create
base/pages/__init__.py. Write page object stubs withpassbodies, one file per domain. - For sites that sell products, probe platform APIs first
(
references/platform-apis.md). Save and clean one fixture per page object. Take detail URLs from the saved list fixture: links or inline script JSON. Raise a domain's fetch tier only in this step. Readreferences/fixtures.mdandreferences/fetching.md. - Spawn one subagent per page object, in parallel. Each subagent writes
output.json, writes selectors, and makes its fixture tests pass. Then runruff check --fix base/pagesandpytest. - Write the spider body. Read
references/spider.md. - Verify:
ruff check,ruff format,pyright,pytest, sample crawl.
Hard rules
- Get page HTML only from
scrapy savefixtureduring the build. Do not use curl, httpx, fetch tools, or a browser. Why: fixtures are the test input, so selectors match what the spider receives. - If
savefixturefails, fix the cause: missing stub, settings, URL, or key. Do not write a download script. Why: a workaround hides a broken project. - Write selectors against the raw
<Response>-body.html, never the-clean.html. Why: clear-html dropsclass/idand renames tags. - Use
@fieldandReturns[Item]. Never@propertyorto_item(). Why: scrapy-poet builds items only from@fieldmethods. - Type spider callbacks with items, never page objects. Why: the spider stays domain-agnostic, so a new domain needs no spider change.
- Raise a domain's fetch tier only after its raw fixture shows the problem. Pick the lowest tier that fixes that problem. Why: each tier costs speed, money, or stability.
- If a fixture contradicts what the user described, tell the user before you choose a workaround. Example: the listing has no links to details.
- Copy expected values into
output.jsonexactly as selectors return them. Why: a shortened value fails the test. - Append new
pyproject.tomlsections at the end of the file. Why: an insert inside[project]duplicates a header and breaks the TOML.
References
references/project-setup.md: layout, dependencies, settings, pytest.references/page-objects.md: items, naming,handle_urls, stubs.references/spider.md: async spider,urls, new domains.references/fixtures.md: savefixture, cleaning, subagent brief.references/fetching.md: fetch ladder, Playwright, curl_cffi, Zyte API.references/platform-apis.md: Shopify and Ecwid JSON APIs.references/production.md: sample/full mode, outputs, structlog, SQLite.
Boundaries
- Docker, scheduling, monitoring, alerts: use
scrapy-deploy. - Click, scroll, or stateful UI flows: use
crawlee-build. - Feasibility proof only: use
web-scraping-simple. - Broken existing spider: use
web-scraping-ops.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/p-severin/skills/scrapy-build">View scrapy-build on skillZs</a>