Skip to content

fix: Windows install 404s, skill list duplication, Python frontend false positives - #172

Open
Pitchfork-and-Torch wants to merge 6 commits into
midudev:mainfrom
Pitchfork-and-Torch:fix/windows-install-and-detect-bugs
Open

fix: Windows install 404s, skill list duplication, Python frontend false positives#172
Pitchfork-and-Torch wants to merge 6 commits into
midudev:mainfrom
Pitchfork-and-Torch:fix/windows-install-and-detect-bugs

Conversation

@Pitchfork-and-Torch

@Pitchfork-and-Torch Pitchfork-and-Torch commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Fixes three high-impact open bugs that block real installs and confuse detection:

Issue Problem Fix
#124 Windows installs fail with download failed … 404 for every skill Stop attaching Authorization: Bearer to raw.githubusercontent.com. Invalid/expired GITHUB_TOKEN/GH_TOKEN values make GitHub 404 public raw files (reproduced with a dead fine-grained PAT). Also normalize CRLF→LF when hashing/copying local registry text so Windows core.autocrlf checkouts still verify.
#126 Skill multi-select list visually duplicates when pressing ↑/↓ Track exact newlines drawn; clear that many rows before re-render. Parse batched CSI sequences so Warp/etc. arrow keys each move once. Footer now ends with a newline for stable line counts.
#48 Python backends classified as “Web frontend” from stray .html/.css File-based frontend detection is ignored when non-JS backends are present (Python, Java, Go, PHP, Rails, …). Package-based frontend signals still win (e.g. React + FastAPI monorepo).

Related

Test plan

Summary by CodeRabbit

  • Correcciones
    • Mejorada la descarga desde GitHub: autenticación más precisa y mensaje de rate limit actualizado con “Retry after…”.
    • Normalización CRLF→LF al verificar e instalar desde el registro local, evitando desajustes de hashes en Windows.
    • Ajustada la detección de frontend para reducir falsos positivos y distinguir señales por paquetes vs. por archivos.
    • Mejoras en el selector de terminal: limpieza/renderizado con restauración de cursor ANSI y mejor manejo de secuencias CSI combinadas.
  • Nuevas funciones
    • multiSelect ahora permite inyectar una función writeFn para redirigir la salida.
  • Pruebas
    • Nuevos casos para descargas sin autorización, rate limit anónimo, compatibilidad CRLF y validación TTY/ANSI.

… positives

- Do not send GITHUB_TOKEN/GH_TOKEN to raw.githubusercontent.com (midudev#124):
  invalid Bearer tokens make GitHub return 404 for public skill files.
- Normalize CRLF→LF when verifying/copying local registry text so Windows
  autocrlf checkouts still match manifest SHA-256 hashes.
- multiSelect: track exact drawn lines + parse batched CSI keys so arrow
  navigation no longer leaves duplicate skill rows (midudev#126).
- Suppress file-based frontend detection when non-JS backends are present
  (Python/Java/Go/etc.) so HTML/CSS docs/templates do not force a11y/SEO
  skills (midudev#48). Package-based frontend detection still wins.

Closes midudev#124
Closes midudev#126
Closes midudev#48
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62e608cf-843f-41df-9d53-18deee866a19

📥 Commits

Reviewing files that changed from the base of the PR and between 8638bef and 3fe8c5c.

📒 Files selected for processing (1)
  • packages/autoskills/ui.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/autoskills/ui.ts

📝 Walkthrough

Walkthrough

Se actualizan el instalador, la detección de frontend y la UI de terminal. El instalador restringe la autorización por host y normaliza archivos de texto; la detección separa señales por origen; la UI admite salida configurable, limpieza por cursor guardado y secuencias CSI agrupadas.

Changes

Instalador y registro local

Layer / File(s) Summary
Integridad y copia normalizada
packages/autoskills/installer.ts, packages/autoskills/tests/installer.test.ts
Los hashes y las copias del registro normalizan CRLF a LF para archivos de texto, manteniendo los archivos binarios sin cambios; se añade cobertura para registros con CRLF.
Autenticación y rate limit
packages/autoskills/installer.ts, packages/autoskills/tests/installer.test.ts
El token se obtiene desde GITHUB_TOKEN o GH_TOKEN y Authorization solo se envía a api.github.com; el mensaje de rate limit indica reintentar tras el reinicio y se prueba este comportamiento.

Detección de frontend

Layer / File(s) Summary
Clasificación por señales
packages/autoskills/lib.ts
Se separan las señales de frontend por paquetes y archivos, y las tecnologías backend suprimen la clasificación basada únicamente en archivos.
Casos de detección
packages/autoskills/tests/detect.test.ts
Se cubren proyectos Python y .NET, sitios HTML puros y proyectos React que también contienen dependencias Python.

UI de terminal

Layer / File(s) Summary
Renderizado y limpieza
packages/autoskills/ui.ts
La UI admite un escritor configurable, renderiza con saltos controlados y limpia el frame restaurando la posición de un cursor guardado.
Procesamiento de teclado
packages/autoskills/ui.ts, packages/autoskills/tests/collect.test.ts
La entrada agrupada procesa secuencias CSI como eventos completos y valida la limpieza asociada a ellas.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Poem

Soy conejo y salto sobre el código,
LF deja el camino florido.
GitHub guarda su token con cuidado,
el frontend queda bien clasificado.
La terminal dibuja sin confusión,
¡y procesa teclas de un tirón!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed El título resume bien los tres cambios principales del PR y es claro para el historial.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/autoskills/ui.ts (1)

147-193: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Cuenta también las filas envueltas al calcular linesDrawn
newlines solo suma los saltos “duros”; si una línea se parte por el ancho de la terminal, clearRendered() sube menos filas de las que ocupó y quedan restos del frame anterior, sobre todo con labels/hints largos o el footer. Conviene contar el alto visual real del bloque, no solo los \n.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/autoskills/ui.ts` around lines 147 - 193, Actualiza la función draw
para que linesDrawn contabilice la altura visual de cada línea envuelta según el
ancho disponible de la terminal, incluyendo labels, hints, grupos y el footer.
Sustituye o complementa el contador newlines con el cálculo de filas
renderizadas, manteniendo el salto adicional entre grupos y el comportamiento de
clearRendered.
🧹 Nitpick comments (1)
packages/autoskills/ui.ts (1)

205-230: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Parsing de secuencias CSI agrupadas: correcto, pero sin cobertura de tests.

La lógica de onData (normalizar CRLF, detectar ESC [ + dígitos/; + byte final como una sola tecla, y saltar ESC sueltos/incompletos) despacha correctamente varias secuencias de flecha concatenadas en un mismo data, resolviendo el caso descrito en el comentario (#126). El PR indica que la validación manual de navegación con flechas sigue pendiente; dado que ya existe infraestructura de tests para multiSelect con stdin simulado (ver collect.test.ts), valdría la pena añadir un test que envíe un data con múltiples secuencias \x1b[A/\x1b[B concatenadas y verifique que el cursor avanza una vez por secuencia (no una vez por todo el chunk).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/autoskills/ui.ts` around lines 205 - 230, Add automated coverage for
the onData parsing in the multiSelect stdin test infrastructure, following the
existing patterns in collect.test.ts. Send concatenated \x1b[A and \x1b[B
sequences through one data chunk and assert that each CSI sequence moves the
cursor exactly once, preserving the current handling of CRLF and incomplete or
bare ESC input.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/autoskills/lib.ts`:
- Around line 565-592: Update the FILE_FRONTEND_SUPPRESS_TECH_IDS set by
replacing "aspnet-core" with "aspnetcore" and "blazor" with "aspnet-blazor",
matching the IDs returned by detection while preserving all other entries.

---

Outside diff comments:
In `@packages/autoskills/ui.ts`:
- Around line 147-193: Actualiza la función draw para que linesDrawn contabilice
la altura visual de cada línea envuelta según el ancho disponible de la
terminal, incluyendo labels, hints, grupos y el footer. Sustituye o complementa
el contador newlines con el cálculo de filas renderizadas, manteniendo el salto
adicional entre grupos y el comportamiento de clearRendered.

---

Nitpick comments:
In `@packages/autoskills/ui.ts`:
- Around line 205-230: Add automated coverage for the onData parsing in the
multiSelect stdin test infrastructure, following the existing patterns in
collect.test.ts. Send concatenated \x1b[A and \x1b[B sequences through one data
chunk and assert that each CSI sequence moves the cursor exactly once,
preserving the current handling of CRLF and incomplete or bare ESC input.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0122bb16-4052-435d-9c91-22abe619125b

📥 Commits

Reviewing files that changed from the base of the PR and between 7ebf5ce and fb3ba34.

📒 Files selected for processing (5)
  • packages/autoskills/installer.ts
  • packages/autoskills/lib.ts
  • packages/autoskills/tests/detect.test.ts
  • packages/autoskills/tests/installer.test.ts
  • packages/autoskills/ui.ts

Comment thread packages/autoskills/lib.ts

@eoinmcgee1993 eoinmcgee1993 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eoinmcgee1993 eoinmcgee1993 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eoinmcgee1993 eoinmcgee1993 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/autoskills/tests/detect.test.ts (1)

384-392: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Verifica explícitamente la detección de Python.

La aserción python || fastapi permite que el test pase aunque python no se detecte. Como este caso valida específicamente backends Python, comprueba ambas señales o, como mínimo, exige python.

Propuesta
-    ok(detected.some((t) => t.id === "python" || t.id === "fastapi"));
+    ok(detected.some((t) => t.id === "python"));
+    ok(detected.some((t) => t.id === "fastapi"));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/autoskills/tests/detect.test.ts` around lines 384 - 392, Update the
test case around detectTechnologies to explicitly require Python detection,
replacing the permissive python-or-fastapi assertion with a direct assertion for
the python technology signal while preserving the isFrontend false check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/autoskills/ui.ts`:
- Around line 237-242: Update the Ctrl+C branch identified by the key check to
exit with status code 130 instead of 0 after cleanup and cursor restoration,
preserving the existing interruption flow.

---

Outside diff comments:
In `@packages/autoskills/tests/detect.test.ts`:
- Around line 384-392: Update the test case around detectTechnologies to
explicitly require Python detection, replacing the permissive python-or-fastapi
assertion with a direct assertion for the python technology signal while
preserving the isFrontend false check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7b0afa8c-536c-4c8b-9fc2-6960527c2524

📥 Commits

Reviewing files that changed from the base of the PR and between fb3ba34 and 8638bef.

📒 Files selected for processing (6)
  • packages/autoskills/installer.ts
  • packages/autoskills/lib.ts
  • packages/autoskills/tests/collect.test.ts
  • packages/autoskills/tests/detect.test.ts
  • packages/autoskills/tests/installer.test.ts
  • packages/autoskills/ui.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/autoskills/lib.ts
  • packages/autoskills/tests/installer.test.ts
  • packages/autoskills/installer.ts

Comment thread packages/autoskills/ui.ts
CodeRabbit: process.exit(0) on interrupt looks like success to shell
scripts. Use 130 (128+SIGINT) for standard interrupt status.
@Pitchfork-and-Torch

Copy link
Copy Markdown
Author

Addressed CodeRabbit on Ctrl+C: skill-selection abort now uses process.exit(130) (128+SIGINT) instead of 0, so shell callers do not treat an interrupt as success.

@Pitchfork-and-Torch

Copy link
Copy Markdown
Author

Review follow-up

Wrap-height / linesDrawn (CodeRabbit major): already addressed on this branch by clearing via DECSC/DECRC (\x1b[s save, \x1b[u\x1b[J restore + erase) instead of counting hard newlines. Soft-wrapped rows do not leave ghosts because erase runs from the saved start cursor to end of screen.

Covered by packages/autoskills/tests/collect.test.ts (handles concatenated CSI arrows and clears wrapped frames from a saved cursor) which asserts a single save and multiple restore+erase clears with long labels/hints.

Ctrl+C exit code: fixed to process.exit(130) so shell callers see SIGINT, not success.

Happy to adjust further if maintainers prefer hard-wrap-to-columns as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants