[object Object]

← back to Cli Printing Press

fix(cli): fix extractKeyURL known-platform check and publish skill contract test

c29604c068faf9fca99fee5cbf31349e95852a4c · 2026-04-03 16:31:49 -0700 · Trevin Chow

extractKeyURL required API name match even for known developer platform
URLs (developer.*, console.*). Accept known dev platform URLs without
API name — these are credible key registration pages.

Update publish skill contract test to match the current skill wording
after PR #116 changed the fork-based flow (uses $UPSTREAM_URL variable
instead of inline backtick reference).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit c29604c068faf9fca99fee5cbf31349e95852a4c
Author: Trevin Chow <trevin@trevinchow.com>
Date:   Fri Apr 3 16:31:49 2026 -0700

    fix(cli): fix extractKeyURL known-platform check and publish skill contract test
    
    extractKeyURL required API name match even for known developer platform
    URLs (developer.*, console.*). Accept known dev platform URLs without
    API name — these are credible key registration pages.
    
    Update publish skill contract test to match the current skill wording
    after PR #116 changed the fork-based flow (uses $UPSTREAM_URL variable
    instead of inline backtick reference).
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---
 internal/crowdsniff/npm.go          | 6 +++---
 internal/pipeline/contracts_test.go | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/internal/crowdsniff/npm.go b/internal/crowdsniff/npm.go
index 4fac55bd..a4451670 100644
--- a/internal/crowdsniff/npm.go
+++ b/internal/crowdsniff/npm.go
@@ -708,9 +708,9 @@ func extractKeyURL(readmeContent string, apiName string) string {
 			return rawURL
 		}
 
-		// Accept if on a known developer platform domain AND the URL/host contains the API name.
-		// This prevents developer.evil.com from being accepted without API name relevance.
-		if isKnownDevPlatform(host) && apiNameLower != "" && strings.Contains(strings.ToLower(rawURL), apiNameLower) {
+		// Accept if on a known developer platform domain (developer.*, console.*, etc.)
+		// even without API name in the URL — these are credible key registration pages.
+		if isKnownDevPlatform(host) {
 			return rawURL
 		}
 	}
diff --git a/internal/pipeline/contracts_test.go b/internal/pipeline/contracts_test.go
index 98782fc5..26f4b6d6 100644
--- a/internal/pipeline/contracts_test.go
+++ b/internal/pipeline/contracts_test.go
@@ -130,10 +130,11 @@ func TestPrintingPressSkillExamplesUseCurrentCLINaming(t *testing.T) {
 func TestPublishSkillTracksCanonicalUpstreamAndOverwriteFlow(t *testing.T) {
 	skill := readContractFile(t, filepath.Join("..", "..", "skills", "printing-press-publish", "SKILL.md"))
 
-	assert.Contains(t, skill, "add `upstream` pointing at `mvanhorn/printing-press-library`")
-	assert.Contains(t, skill, "git fetch upstream 2>/dev/null || true")
+	assert.Contains(t, skill, "git remote add upstream")
+	assert.Contains(t, skill, "mvanhorn/printing-press-library")
+	assert.Contains(t, skill, "git fetch upstream")
 	assert.Contains(t, skill, "git reset --hard upstream/main")
-	assert.Contains(t, skill, "git push --force-with-lease -u origin feat/<cli-name>")
+	assert.Contains(t, skill, "git push --force-with-lease")
 }
 
 func TestREADMEOutputContract(t *testing.T) {

← 25e059c3 docs(cli): mark scorer/pagination/proxy-routes plan as compl  ·  back to Cli Printing Press  ·  feat(cli): enum sync expansion and generic API prefix stripp 34e354f6 →