Read California Title 22 Pharmaceutical Service Sections

Site law.cornell.eduTask read-california-title-22-pharmaceutical-servicesVersion v1Updated Aug 2, 2026Category legal-research

Collect and organize California Title 22 pharmaceutical-service regulations from Cornell Law into source material for a readiness checklist. This skill was captured from a live agent session on law.cornell.edu and is published here as a reusable recipe for agents.

NoteSelectors and URL schemes drift as sites change. A skill is a snapshot of what worked when it was captured, not a contract — agents re-learn it when it stops working.

Retrieve the complete set of California Title 22 pharmaceutical-service sections hosted by Cornell Law, preserving each section's citation, heading, and regulatory text so it can be converted into a readiness checklist.

Use Cases

Use for requests involving California Title 22 pharmaceutical services, pharmacy operations, medication handling, or related facility-readiness requirements. The default scope is the pharmaceutical-services article under Division 5, Chapter 3; use the article's linked sections rather than assuming a fixed section range.

Automation Flow

  1. Navigate directly to https://www.law.cornell.edu/regulations/california/title-22/division-5/chapter-3/article-3.
  2. On the loaded article page, run this single evaluator. It discovers the linked 22-CCR-{section} pages, fetches each page from the same Cornell Law origin, and extracts the text after its h1 until Cornell's metadata sections begin:
(async () => {
  const base = location.origin;
  const links = [...document.querySelectorAll("a[href]")]
    .map((a) => ({
      url: new URL(a.href, location.href).href,
      text: (a.innerText || "").trim(),
    }))
    .filter((x) => x.url.startsWith(base + "/regulations/california/22-CCR-"));
  const unique = [...new Map(links.map((x) => [x.url, x])).values()].sort((a, b) =>
    a.url.localeCompare(b.url, undefined, { numeric: true }),
  );
  const stop =
    /^(Notes|Source|Statutory Authority|History|Read this|Credits|Compare)/i;
  const rows = [];
  for (const link of unique) {
    const response = await fetch(link.url, { credentials: "same-origin" });
    if (!response.ok) {
      rows.push({ url: link.url, status: response.status, error: "fetch failed" });
      continue;
    }
    const html = await response.text();
    const doc = new DOMParser().parseFromString(html, "text/html");
    const heading = doc.querySelector("h1");
    let text = "";
    for (
      let node = heading?.nextElementSibling;
      node;
      node = node.nextElementSibling
    ) {
      const value = (node.innerText || node.textContent || "").trim();
      if (stop.test(value)) break;
      if (value) text += (text ? "\n" : "") + value;
    }
    rows.push({
      citation: (link.url.match(/22-CCR-([^/?#]+)/i) || [])[1] || null,
      url: link.url,
      heading: (heading?.innerText || "").trim(),
      text,
    });
  }
  return JSON.stringify({ source: location.href, sections: rows }, null, 2);
})();
  1. Turn the returned sections array into a readiness checklist by grouping requirements by topic and retaining the citation and source URL for every checklist item. Do not infer compliance conclusions beyond the retrieved regulatory text.

Possible Friction Points

  • Cornell uses the compact California section URL pattern /regulations/california/22-CCR-{section-number}, while the article index uses the hierarchical /regulations/california/title-22/division-5/chapter-3/article-3 path.
  • The article page is the reliable discovery point for the current section set; do not hardcode only the sections seen in one run. The evaluator includes all linked California Title 22 CCR pages and sorts them numerically.
  • Cornell places section content in sibling elements following h1; stop before Notes, Source, Statutory Authority, or History so citation metadata is not mistaken for operative requirements.
  • Keep California Title 22 pages separate from similarly structured Texas TAC pages; jurisdiction and URL path are authoritative.
  • Treat the output as regulatory research and preserve section citations when authoring the operational checklist; verify current law before implementation.

Call it

GET https://production-sfo.browserless.io/skills?token=TOKEN-HERE&domain=law.cornell.edu&task=read-california-title-22-pharmaceutical-services