← Zurück zu Team für Electron und Vue

Skill · Version 1.0.0

Open-Source-Code mit Herkunft anpassen

Übernimmt kleine stabile Algorithmen bei geprüfter freizügiger Lizenz und sinnvoll begrenzten Abhängigkeiten.

oss-code-adaptation-attribution

Teammitglieder mit diesem Skill

Entdecke, wie der Skill hilft

Wann ist der Skill hilfreich?

Nutze diesen Skill für eine benötigte Funktion innerhalb eines unverhältnismäßig großen Pakets.

Wobei hilft er dir?

  • Prüft genaue Lizenz, Hinweise und Änderungspflichten.
  • Dokumentiert Quellstand, ursprüngliche Urheberschaft und Anpassungen.
  • Erhält Tests und vermeidet Kopien ständig sicherheitskritisch gepflegter Funktionen.

Das könntest du fragen

Bewerte die Übernahme dieser Zyklenerkennung mit Herkunft, nötigen Hinweisen und Verhaltenstests. Bewahre Upstream-Revision und Hinweise beim angepassten Modul. Teste zyklische und azyklische Graphen und dokumentiere jede beabsichtigte Abweichung vom Original.

Ausführliche Dokumentation

Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.

Details…Weniger anzeigen

Open-Source Code Adaptation & Attribution

Sometimes a 15,000-line open-source package contains one 120-line algorithm (e.g., a graph cycle detector, fuzzy matcher, token estimator, or retry backoff scheduler) that is exactly what we need, while the rest of the package brings 40 transitive dependencies and incompatible framework assumptions.

When to Adapt / Vendor Instead of Installing

Recommend adapting a focused subset when all of the following hold:

  1. License is permissive: The source project is explicitly licensed under MIT, ISC, BSD-2-Clause, BSD-3-Clause, 0BSD, or Apache-2.0. (Never copy code from unlicensed, GPL/AGPL, or proprietary repos.)
  2. The target logic is self-contained and stable: The algorithm has clear inputs/outputs and does not require ongoing security patches (unlike TLS, auth, or HTML sanitizers, which should remain managed dependencies).
  3. Adapting eliminates disproportionate baggage: Extracting 100–300 lines avoids pulling in heavy transitive trees, native build steps, or CommonJS/ESM conflicts.

Workflow for Clean, Compliant Adaptation

  1. Verify license and NOTICE requirements:
    • Read the upstream LICENSE and NOTICE files at the exact commit being adapted.
    • For Apache-2.0, check whether a NOTICE file exists and preserve its required attributions alongside the license terms.
  2. Record explicit provenance in the file header:
    • Place a clear header comment at the top of the adapted file containing:
      • Upstream repository name and URL.
      • Exact version tag and commit SHA (Adapted from owner/repo@<commit-sha> (path/to/file)).
      • Original copyright notice and license identifier (SPDX-License-Identifier: MIT).
      • A brief note summarizing what was modified for our codebase (e.g., converted to strict TypeScript, removed Node-specific fs calls).
  3. Port and strengthen tests:
    • Port the relevant unit test cases and edge-case fixtures from the upstream repository into our test suite so the adapted logic is verified to the same or higher standard.

Enthaltene Dateien 1

  • SKILL.md