| name | speclite-brownfield-python-backend-tech-stack-digger |
| description | Analyze brownfield Python backend projects to derive technology stack from code facts and write a Markdown report to a user-specified output directory. Use when user mentions 'Python tech stack', 'FastAPI stack', 'Django stack', 'requirements audit', 'Python 后端技术栈', 'FastAPI 技术栈', 'Django 技术栈', 'Python 依赖分析', '基于代码事实', or asks to generate a Python backend stack inventory. Capable of Python packaging detection, lockfile/requirements version resolution, runtime evidence extraction, ASGI/WSGI framework detection, and evidence-linked Markdown generation. |
| allowed-tools | ["Read","Write","Bash","Grep","Glob","Agent"] |
| metadata | {"version":"1.0.0","author":"fancyliu","catalog":"speclite"} |
Speclite Brownfield Python Backend Tech Stack Digger
[Overview(技能说明)]
Speclite Brownfield Python Backend Tech Stack Digger 是 1-analysis 阶段的 Python 后端技术栈挖掘工作流。它继承 speclite-brownfield-backend-tech-stack-digger 的通用报告契约,并专门处理 pyproject.toml、Poetry、uv、pip、Pipenv、Conda、FastAPI、Django、Flask、ASGI / WSGI、ORM、任务队列、缓存、安全认证和测试等 Python 生态事实。
[Core Capabilities(核心能力)]
- Python 项目发现:识别 package layout、monorepo service、src/ layout、ASGI / WSGI app、manage.py、Procfile、Docker / gunicorn / uvicorn 启动命令。
- 依赖版本解析:优先读取 poetry.lock、uv.lock、Pipfile.lock、pinned requirements*.txt、Conda lock 和 pip freeze / pipdeptree 结果。
- 运行时识别:提取 Python 版本来源,包括 requires-python、.python-version、runtime image、tox/nox、CI setup、Conda environment。
- 框架识别:识别 FastAPI、Django、Django REST Framework、Flask、Starlette、Tornado、Sanic、Celery worker 和 server entrypoints。
- 数据与中间件分析:识别 SQLAlchemy、Django ORM、Tortoise ORM、Peewee、Alembic、psycopg、asyncpg、Celery、RQ、Redis、对象存储和 HTTP client。
- 安全与工程能力分类:识别 Django auth、PyJWT、python-jose、Authlib、OAuthlib、Pydantic、OpenAPI、pytest、tox、coverage、logging 和 observability。
- 证据化 Markdown 输出:按 assets/python-tech-stack-report-template.md 生成编号清单、证据摘要、未确认项和核验命令。
[Workflow(执行流程)]
本 Skill 使用 Python 专属顺序分析工作流。详细 packaging 矩阵、框架探测和版本解析规则见 references/python-tech-stack-workflow.md。
1. 解析用户输入,确认 `{project-root}`、`{output-dir}` 和 `{report-name}`。若 `{output-dir}` 缺失,必须先询问。
2. 读取通用报告契约:输出必须兼容 `speclite-brownfield-backend-tech-stack-digger` 的章节结构和证据原则。
3. 扫描 Python 项目入口:`pyproject.toml`、lockfile、`requirements*.txt`、`Pipfile`、`environment.yml`、runtime version file、Dockerfile、CI pipeline 和 service package。
4. 可执行解析优先:根据工具运行 `poetry show`、`uv pip list`、`pip freeze`、`pipdeptree` 或 `conda list`;失败时记录原因并退回 lockfile / manifest 静态解析。
5. 读取 runtime config 与源码入口,补充框架、ASGI/WSGI server、database、Redis、MQ、scheduler、storage、auth、API docs、observability 和 test facts。
6. 合并事实并标注来源。`pyproject.toml` 的 version spec 不等于实际安装版本;外部服务端版本必须来自 deploy evidence。
7. 写入 `{output-dir}/{report-name}`,默认 `python-backend-tech-stack.md`;最终回复给出路径、关键版本和未确认项。
[Notes(注意事项)]
- 本 Skill 只分析 Python 后端技术栈;Java / Spring Boot、Node.js、Go、.NET 等生态应使用各自专属 Skill 或通用后端契约。
- lockfile / pinned requirements 是依赖实际版本的最高优先级来源;pyproject.toml、setup.cfg、setup.py 中的版本范围只能作为声明事实。
- Python runtime 版本不能由依赖版本推断,必须来自 requires-python、runtime file、Docker image、Conda、tox/nox、CI 或用户提供证据。
- FastAPI / Starlette 需要 ASGI app 或 route evidence;Django 需要 settings / urls / manage.py / ASGI / WSGI evidence。
- PostgreSQL Server、Redis Server、RabbitMQ Broker、S3 / MinIO Server 等外部服务端版本不能由 Python client 版本反推。
- 生成报告必须包含 Generated By(生成来源) 标注:speclite-brownfield-python-backend-tech-stack-digger。
[Generation Metadata(生成信息)]
本 Skill 由 skills-creator 从通用后端技术栈报告契约中拆分 Python 生态规则生成。后续修改必须同步更新 SKILL.md、SKILL.en.md、CHANGELOG.md,并同步 forge/ 与 SpecLite assets 源目录。