Goal
- You are an expert in the Python ecosystem and in technical writing.
- Given a dir
<DIR>, create or update the file
<DIR>/related_python_packages.md, which lists all the Python packages related to
the content of <DIR>
- Follow the rules
.claude/skills/related_python_packages.rules.md - Follow the template
.claude/templates/related_python_packages.template.md - Say in the file how it was generated, with the line
```markdown
- Generated by
.claude/skills/related_python_packages.create/SKILL.md
```
Workflow
Pick the Mode
- If
<DIR>/related_python_packages.mdexists, update it - Read it, and keep every package section that is still valid
- If it does not exist, create it
- If
<DIR>has a file in an old format, merge its packages into the new file - E.g.,
packages.md,package_list.md,package_list.tsv,related_packages.md,
<NAME>.packages.md
- Rename the old file with
git mvwhen it is the main one - Delete the other old files with
git rm, only after every package of the old
file is in the new file
Read the Content of the Dir
- List the lectures, slides (
*.smd), notebooks (*.ipynb), markdown files, code,
requirements.txt files, and Dockerfiles of <DIR>
- Write down:
- The topics of the content
- The lesson tags, e.g.,
03.2, taken from the names of the lecture files - The packages that the content names or imports
Find the Candidate Packages
- Start from the packages that the content names or imports
- For each topic, search the web for the main Python packages
- Prefer packages with public docs and a GitHub repo
- Keep a package only if a lesson or a project in
<DIR>can use it - Drop a package that is not Python, unless it has a Python interface that the content
uses
Group the Packages
- Group the packages by primary function into clusters
- Name each cluster with a short noun phrase
- Write the function of the cluster in one line
- Put each package in exactly one cluster
- Use 3 to 10 clusters
Collect the Fields
- Fill all the fields of a package, in the order of the rules
- Collect the stars and the status of each repo:
```bash
> gh repo view <OWNER>/<REPO> --json stargazerCount,isArchived,pushedAt
```
- If
ghis not available, keep the old count with the prefix~, or writeN/A - Check each URL with
gh repo vieworcurl -sI <URL> - Take the labels of
Categoryfrom
class_project/project_descriptions/all_projects.md
- If the repo has no such file, reuse the labels of the other
related_python_packages.md files
- Take the
Featuresfrom the README or the docs of the package - Set the
Alternativesfrom the packages of the same cluster
Write the File
- Write the header: the title, the
Generated byline,Scope, andStars as of - Write the sections of the clusters and of the packages in the order of the rules
- Write the table
Functionality Clusterslast, from the sections - Wrap the prose at 85 characters, and keep the URLs on one line
- Do not run
lint_text.pyon the file - It capitalizes the package names in the headers and in the
Alternatives
bullets, e.g., z3-solver becomes Z3-solver
Update an Existing File
- Refresh
StarsandStatusfor every package - Add the new packages, and place them in the right cluster and position
- Keep the
FeaturesandAlternativesthat are correct - Do not delete a package without a reason
- If a package is gone from the content, say so in the report and leave it
- Report the changes: the packages added, the packages with a changed status, and the
fields fixed
Check the File
- Run the checks of the
# Verificationsection - Fix every failed check
Constraints
- Do not modify any file other than
<DIR>/related_python_packages.md - Exception: the old-format files that are merged into it
- Do not invent a URL, a star count, a feature, or a package
- Do not commit the changes
- Do not use emojis or the em-dash
Examples
- A filled file:
book_springer/related_python_packages.md - A filled file with lessons:
msml610/tutorials/L03_knowledge_representation/related_python_packages.md
Verification
- [ ] The file is named
<DIR>/related_python_packages.md - [ ] The first bullet after the title is
`- Generated by .claude/skills/related_python_packages.create/SKILL.md `
- [ ] The file has one
#header - [ ] Every package has all the fields, in the order of the rules
- [ ] Every package appears in exactly one cluster
- [ ] The packages are ordered by stars inside each cluster
- [ ] The clusters are ordered by the stars of their top package
- [ ] The table
Functionality Clusterslists exactly the packages of the sections - [ ] Every name in
Alternativesmatches a###header, or has a URL - [ ] Every
Statusis one ofactive,maintenance,archived,not used,
N/A
- [ ] Every
Categoryis a label ofall_projects.md, or a justified new label - [ ] No old-format file is left in
<DIR>with packages that are not in the new file - [ ] No other file of
<DIR>changed