{"id":37071153,"url":"https://github.com/chigwell/webdev-pitfall-analyzer","last_synced_at":"2026-01-14T08:18:56.090Z","repository":{"id":329747420,"uuid":"1120562681","full_name":"chigwell/webdev-pitfall-analyzer","owner":"chigwell","description":"This package helps users identify and avoid common pitfalls in web and HTML development by analyzing text-based input—like code snippets, design descriptions, or technical discussions—and returning a ","archived":false,"fork":false,"pushed_at":"2025-12-21T13:38:37.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T04:51:50.737Z","etag":null,"topics":["accessibility-issueskeywordaccessibility-issues","ai-powered-suggestionskeywordai-powered-suggestion","best-practice-recommendationskeywordbest-practice-","code-analysis","code-snippets-reviewkeywordcode-snippets-review","developer-supportkeyworddeveloper-support","html-validationkeywordhtml-validation","manual-research-reductionkeywordmanual-research-re","performance-optimizationkeywordperformance-optimiz","risk-detectionkeywordrisk-detection","security-vulnerabilitieskeywordsecurity-vulnerabil","static-text-analysiskeywordstatic-text-analysis","web-developmentkeywordweb-development"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/webdev-pitfall-analyzer/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chigwell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-21T13:38:19.000Z","updated_at":"2025-12-21T13:38:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chigwell/webdev-pitfall-analyzer","commit_stats":null,"previous_names":["chigwell/webdev-pitfall-analyzer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chigwell/webdev-pitfall-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwebdev-pitfall-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwebdev-pitfall-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwebdev-pitfall-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwebdev-pitfall-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chigwell","download_url":"https://codeload.github.com/chigwell/webdev-pitfall-analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwebdev-pitfall-analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessibility-issueskeywordaccessibility-issues","ai-powered-suggestionskeywordai-powered-suggestion","best-practice-recommendationskeywordbest-practice-","code-analysis","code-snippets-reviewkeywordcode-snippets-review","developer-supportkeyworddeveloper-support","html-validationkeywordhtml-validation","manual-research-reductionkeywordmanual-research-re","performance-optimizationkeywordperformance-optimiz","risk-detectionkeywordrisk-detection","security-vulnerabilitieskeywordsecurity-vulnerabil","static-text-analysiskeywordstatic-text-analysis","web-developmentkeywordweb-development"],"created_at":"2026-01-14T08:18:55.352Z","updated_at":"2026-01-14T08:18:56.083Z","avatar_url":"https://github.com/chigwell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webdev-pitfall-analyzer\n[![PyPI version](https://badge.fury.io/py/webdev-pitfall-analyzer.svg)](https://badge.fury.io/py/webdev-pitfall-analyzer)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://static.pepy.tech/badge/webdev-pitfall-analyzer)](https://pepy.tech/project/webdev-pitfall-analyzer)\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)\n\n\n**webdev-pitfall-analyzer** helps developers quickly spot common web‑development pitfalls—security issues, accessibility problems, performance bottlenecks, outdated patterns, and more—by analysing short text inputs such as code snippets, design questions, or discussion fragments. The package uses an LLM (by default **ChatLLM7** from `langchain_llm7`) to return a concise, structured list of warnings and best‑practice recommendations.\n\n---\n\n## 📦 Installation\n\n```bash\npip install webdev_pitfall_analyzer\n```\n\n---\n\n## 🚀 Quick start\n\n```python\nfrom webdev_pitfall_analyzer import webdev_pitfall_analyzer\n\n# Example HTML/JS snippet\nsnippet = \"\"\"\n\u003cinput type=\"text\" onblur=\"doBadThing()\" /\u003e\n\u003cscript\u003e\n  function doBadThing() {\n    eval(userInput);   // \u003c- unsafe!\n  }\n\u003c/script\u003e\n\"\"\"\n\nwarnings = webdev_pitfall_analyzer(user_input=snippet)\nprint(warnings)\n```\n\n**Output (example)**\n\n```\n[\n  \"⚠️ Use of `eval` can lead to XSS vulnerabilities. Consider safer alternatives.\",\n  \"⚠️ Missing `label` element for the input; this hurts accessibility.\",\n  \"⚠️ Inline event handlers (`onblur`) are discouraged; attach listeners via JavaScript instead.\"\n]\n```\n\n---\n\n## 🛠️ Function signature\n\n```python\ndef webdev_pitfall_analyzer(\n    user_input: str,\n    api_key: Optional[str] = None,\n    llm: Optional[BaseChatModel] = None,\n) -\u003e List[str]:\n```\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `user_input` | `str` | The text (code, question, description, etc.) you want analysed. |\n| `api_key` | `Optional[str]` | API key for **ChatLLM7**. If omitted, the function will look for the `LLM7_API_KEY` environment variable; if still not found it falls back to an unauthenticated request (may be rate‑limited). |\n| `llm` | `Optional[BaseChatModel]` | Any LangChain‑compatible LLM instance. If not supplied, the default `ChatLLM7` (from `langchain_llm7`) is used. |\n\nThe function returns a list of warning/recommendation strings. If the underlying LLM call fails, a `RuntimeError` is raised.\n\n---\n\n## 🔧 Using a custom LLM\n\nYou can pass any LangChain chat model that follows the `BaseChatModel` interface.\n\n### OpenAI\n\n```python\nfrom langchain_openai import ChatOpenAI\nfrom webdev_pitfall_analyzer import webdev_pitfall_analyzer\n\nmy_llm = ChatOpenAI(model=\"gpt-4o-mini\")\nresult = webdev_pitfall_analyzer(user_input=\"...\", llm=my_llm)\n```\n\n### Anthropic\n\n```python\nfrom langchain_anthropic import ChatAnthropic\nfrom webdev_pitfall_analyzer import webdev_pitfall_analyzer\n\nmy_llm = ChatAnthropic(model=\"claude-3-haiku-20240307\")\nresult = webdev_pitfall_analyzer(user_input=\"...\", llm=my_llm)\n```\n\n### Google GenAI\n\n```python\nfrom langchain_google_genai import ChatGoogleGenerativeAI\nfrom webdev_pitfall_analyzer import webdev_pitfall_analyzer\n\nmy_llm = ChatGoogleGenerativeAI(model=\"gemini-1.5-flash\")\nresult = webdev_pitfall_analyzer(user_input=\"...\", llm=my_llm)\n```\n\n---\n\n## 🔑 API key for ChatLLM7\n\n*The default free tier of LLM7 is sufficient for most occasional analyses.*\n\n- Set the key once in your environment:\n\n```bash\nexport LLM7_API_KEY=\"your_llm7_key\"\n```\n\n- Or pass it directly:\n\n```python\nresult = webdev_pitfall_analyzer(user_input=\"...\", api_key=\"your_llm7_key\")\n```\n\nObtain a free key by registering at \u003chttps://token.llm7.io/\u003e.\n\n---\n\n## 📚 What the analyzer looks for\n\n- **Security** – unsafe functions (`eval`, `innerHTML`, etc.), injection risks.\n- **Accessibility** – missing ARIA attributes, improper heading structure, unlabeled form controls.\n- **Performance** – blocking synchronous XHR, large inline assets, unnecessary reflows.\n- **Modern best practices** – deprecated APIs, outdated HTML5 elements, inefficient CSS selectors.\n\nThe underlying prompt (`human_prompt`, `system_prompt`) can be customised by forking the repository.\n\n---\n\n## 📂 Repository\n\n🛠️ Issues \u0026 feature requests: \u003chttps://github.com/chigwell/webdev_pitfall_analyzer/issues\u003e\n\n---\n\n## 👤 Author\n\n**Eugene Evstafev**  \nEmail: \u003chi@eugene.plus\u003e  \nGitHub: \u003chttps://github.com/chigwell\u003e\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MIT License**. See the `LICENSE` file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fwebdev-pitfall-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchigwell%2Fwebdev-pitfall-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fwebdev-pitfall-analyzer/lists"}