feat: Phase 1 — src/ layout migration, pyproject.toml fixes, CI/CD, entry points#5
feat: Phase 1 — src/ layout migration, pyproject.toml fixes, CI/CD, entry points#5
Conversation
Summary of ChangesHello @nsalvacao, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request represents 'Phase 1' of project setup and pre-launch blockers, primarily focusing on modernizing the project's structure and build process. It involves migrating the main application logic into a Highlights
Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly refactors the project by migrating to a src/ layout, modernizing pyproject.toml with hatchling, and introducing proper CLI entry points, alongside adding a CI/CD pipeline and ruff linting for improved quality. However, critical security vulnerabilities were identified, specifically OS command injection risks on Windows due to unsafe PowerShell command construction and path traversal vulnerabilities in the crawler output and plugin generator, arising from user-supplied CLI names and external JSON map data. General code issues also include a critical problem in a generated script using outdated file paths, minor issues in generated documentation, a configuration mistake in pyproject.toml, and style improvements for local imports in new entry point functions. Addressing these security and general code concerns is crucial to ensure the new structure is consistently and securely implemented.
f0dd507 to
1678fec
Compare
…ntry points Phase 1: Setup + Pre-Launch Blockers complete (T001-T005, T032, T038, T039, T066) Changes: - Migrate crawler/ → src/crawler/ via git mv (preserves history) - Migrate scripts/generate_plugin.py → src/generator/plugin_generator.py - Fix pyproject.toml: classifiers, readme path, add [build-system] with hatchling - Add hatch.build.targets.wheel config for src/ layout with explicit packages - Register cli-crawler and generate-plugin entry points with argparse + --version - Configure ruff linting and pytest markers in pyproject.toml - Create CI/CD pipeline (.github/workflows/ci.yml) with Python 3.11/3.12 matrix - Fix pre-existing UnicodeDecodeError in load_cli_map and test_pipeline (Windows) - Fix test_generate_plugin.py import path for new package structure - Add real-world smoke test: ruff CLI → CLIMap JSON → Plugin (12 cmds, 127 flags) Verification: 100/100 tests pass, cli-crawler 0.1.0, generate-plugin 0.1.0
1678fec to
2c2fec5
Compare
There was a problem hiding this comment.
Pull request overview
Phase-1 groundwork for the cli-plugins project: migrates core code into a src/ layout, formalizes packaging/entry points, expands parsers and pipeline CLI behavior, and adds CI plus spec-kit scaffolding/docs to support spec-driven development.
Changes:
- Introduces
src/package structure forcrawler/andgenerator/, with new CLI entry points (cli-crawler,generate-plugin) and--version. - Improves cross-platform robustness (UTF-8 file reads) and parser/pipeline refactors (typing updates, new usage/version parsing).
- Adds CI workflow and spec-kit templates/scripts/docs plus a sample generated plugin (
plugins/cli-ruff/).
Reviewed changes
Copilot reviewed 103 out of 109 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_pipeline_integration.py | Fixes JSON reading to use UTF-8; minor formatting cleanup. |
| tests/test_parser_sections.py | Import ordering + formatting adjustments for readability. |
| tests/test_parser_flags.py | Import ordering + minor formatting; extra blank lines for clarity. |
| tests/test_parser_commands.py | Minor import ordering/formatting. |
| tests/test_generate_plugin.py | Updates imports for new module layout; skips when gitignored inputs absent. |
| tests/conftest.py | Import ordering cleanup. |
| tests/capture_fixtures.py | Formats subprocess.run args more readably (keeps UTF-8). |
| src/lib/init.py | Adds lib package marker/docstring. |
| src/generator/init.py | Adds generator package marker/docstring. |
| src/generator/plugin_generator.py | Updates typing import, UTF-8 JSON load, adds CLI --version, misc formatting. |
| src/crawler/init.py | Adds crawler package marker/docstring. |
| src/crawler/version.py | Adds version detection/parsing helper. |
| src/crawler/pipeline.py | Adds cli-crawler CLI entrypoint + refactors/typing updates; uses UTC timestamps. |
| src/crawler/parsers/init.py | Adds parsers package marker/docstring. |
| src/crawler/parsers/usage.py | Adds usage extraction helper. |
| src/crawler/parsers/sections.py | Refactors typing + formatting; keeps section segmentation logic. |
| src/crawler/parsers/manpage.py | Formatting/refactor of regex/constants + Flag construction formatting. |
| src/crawler/parsers/flags.py | Typing modernization + formatting; minor logic refactor in _build_flag. |
| src/crawler/parsers/examples.py | Formatting-only change to long condition. |
| src/crawler/parsers/envvars.py | Regex formatting simplification. |
| src/crawler/parsers/commands.py | Typing modernization + formatting; no functional changes apparent. |
| src/crawler/parser.py | Import ordering + formatting; minor formatting in logging and args parsing. |
| src/crawler/models.py | Typing modernization (PEP 604 unions). |
| src/crawler/formatter.py | Import ordering + formatting of serialization expressions. |
| src/crawler/executor.py | Typing modernization + formatting of PowerShell command building. |
| src/crawler/discovery.py | Formatting + typing modernization; no functional changes apparent. |
| src/crawler/detector.py | Import ordering + formatting of ExecutionResult construction. |
| src/crawler/config.py | Typing modernization + formatting in scalar parsing condition. |
| src/config/init.py | Adds config package marker/docstring. |
| specs/001-cli-plugins-base/spec.md | Adds Phase 1 spec doc for project goals/requirements. |
| specs/001-cli-plugins-base/research.md | Adds research summary (none required). |
| specs/001-cli-plugins-base/quickstart.md | Adds quickstart doc (setup/run/test guidance). |
| specs/001-cli-plugins-base/plan.md | Adds implementation plan doc (structure + constraints). |
| specs/001-cli-plugins-base/data-model.md | Adds data model doc (entities + rules). |
| specs/001-cli-plugins-base/contracts/plugin-contract.md | Adds plugin contract doc. |
| specs/001-cli-plugins-base/checklists/requirements.md | Adds spec-quality checklist. |
| pyproject.toml | Adds hatchling build-system, scripts entry points, Ruff/Pytest config, dev extras. |
| plugins/cli-ruff/.claude-plugin/plugin.json | Adds sample generated plugin metadata for ruff. |
| plugins/cli-ruff/skills/cli-ruff/SKILL.md | Adds generated skill file for ruff. |
| plugins/cli-ruff/skills/cli-ruff/references/examples.md | Adds generated examples placeholder for ruff. |
| plugins/cli-ruff/commands/scan-cli.md | Adds generated scan command for ruff plugin. |
| plugins/cli-ruff/scripts/rescan.sh | Adds generated rescan wrapper script for ruff plugin. |
| .vscode/settings.json | Adds chat prompt/tool auto-approve configuration. |
| .specify/templates/vision-brief-template.md | Adds spec-kit template. |
| .specify/templates/tasks-template.md | Adds spec-kit template. |
| .specify/templates/spec-template.md | Adds spec-kit template. |
| .specify/templates/plan-template.md | Adds spec-kit template. |
| .specify/templates/ideas-backlog-template.md | Adds spec-kit template. |
| .specify/templates/idea-selection-template.md | Adds spec-kit template. |
| .specify/templates/g0-validation-report-template.md | Adds spec-kit template. |
| .specify/templates/checklist-template.md | Adds spec-kit template. |
| .specify/templates/ai-vision-canvas-template.md | Adds spec-kit template. |
| .specify/templates/agent-file-template.md | Adds spec-kit template. |
| .specify/scripts/bash/validate-scamper.sh | Adds spec-kit validator script. |
| .specify/scripts/bash/validate-g0.sh | Adds spec-kit validator script. |
| .specify/scripts/bash/validate-canvas.sh | Adds spec-kit validator script. |
| .specify/scripts/bash/validate-airice.sh | Adds spec-kit validator script. |
| .specify/scripts/bash/test-e2e-validate.sh | Adds spec-kit E2E test script. |
| .specify/scripts/bash/test-e2e-structure.sh | Adds spec-kit E2E test script. |
| .specify/scripts/bash/test-e2e-select.sh | Adds spec-kit E2E test script. |
| .specify/scripts/bash/test-e2e-phase0.sh | Adds spec-kit E2E driver script. |
| .specify/scripts/bash/test-e2e-ideate.sh | Adds spec-kit E2E test script. |
| .specify/scripts/bash/sync-upstream.sh | Adds upstream-sync helper. |
| .specify/scripts/bash/state-update.sh | Adds state update helper. |
| .specify/scripts/bash/state-reconstruct.sh | Adds state reconstruction helper. |
| .specify/scripts/bash/state-log-violation.sh | Adds state logging helper. |
| .specify/scripts/bash/state-init.sh | Adds state init helper. |
| .specify/scripts/bash/state-check.sh | Adds state check helper. |
| .specify/scripts/bash/setup-plan.sh | Adds plan setup helper. |
| .specify/scripts/bash/common.sh | Adds shared helper functions. |
| .specify/scripts/bash/check-prerequisites.sh | Adds consolidated prerequisites checker. |
| .specify/memory/constitution.md | Adds project constitution doc. |
| .repo-audit-2026-02-12.md | Adds repo audit report. |
| .gitignore | Adds ignores for local files and Node artifacts. |
| .github/workflows/ci.yml | Adds CI matrix + lint job. |
| .github/prompts/speckit.validate.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.taskstoissues.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.tasks.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.structure.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.specify.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.select.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.plan.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.implement.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.ideate.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.constitution.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.clarify.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.checklist.prompt.md | Adds prompt stub. |
| .github/prompts/speckit.analyze.prompt.md | Adds prompt stub. |
| .github/agents/speckit.validate.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.taskstoissues.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.tasks.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.structure.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.specify.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.select.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.plan.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.implement.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.ideate.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.constitution.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.clarify.agent.md | Adds agent workflow doc. |
| .github/agents/speckit.analyze.agent.md | Adds agent workflow doc. |
| .agent/workflows/verify-and-ship.md | Adds local workflow doc. |
| .agent/workflows/smoke-test.md | Adds local workflow doc. |
| .agent/workflows/push-pr.md | Adds local workflow doc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Phase 1: Setup + Pre-Launch Blockers
Tasks Completed (T001-T005, T032, T038, T039, T066)
crawler/→src/crawler/viagit mv(preserves history)pyproject.toml— classifiers, readme path,[build-system]with hatchling, explicitpackagescli-crawlerandgenerate-pluginentry points with argparse +--versionconfig.yaml, ruff linting, pytest markers.github/workflows/ci.yml) — Python 3.11/3.12 matrix + lint job--versionflag on both entry points viaimportlib.metadataPre-existing Bugs Fixed
UnicodeDecodeErroron Windows inload_cli_mapandtest_pipeline(missingencoding='utf-8')test_generate_plugin.pyupdated for new package structureReal-World Smoke Test
cli-crawler ruff→ 12 commands, 127 flags, 0.4s ✅generate-plugin output/ruff.json→ 6 plugin files generated ✅plugins/cli-ruff/Verification
pip install -e '.[dev]'✅pytest tests/→ 100/100 passed ✅cli-crawler --version→cli-crawler 0.1.0✅generate-plugin --version→generate-plugin 0.1.0✅