From 8ce63d6141313f580f8d4feb7731edc2a43011d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Beteg=C3=B3n?= Date: Mon, 3 Aug 2026 18:25:10 +0200 Subject: [PATCH 1/3] docs(lore): persist the project-create colon-syntax decision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #1191 (merged as b421031dd) added the colon-only syntax for sentry project create — the space-separated form is invalid, with or without an explicit org. The background knowledge process distilled this decision (plus the teamAutoCreateSlug batch fix and the generate-skill-markdown.ts regex hardening) but it never made it into main because the branch had already been squash-merged and its remote ref deleted by the time the .lore.md commit landed. Persist it here so the decision survives in the repo. Co-Authored-By: Claude Sonnet 5 --- .lore.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.lore.md b/.lore.md index 14443f438..4394633f0 100644 --- a/.lore.md +++ b/.lore.md @@ -570,6 +570,9 @@ * **Prefers Bun-native APIs over Node**: prefer Bun-native APIs over Node. + +* **project create: explain product rationale before making code changes**: When discussing \`sentry project create\` (or similar command design), the user wants to finish explaining their product-level rationale before the assistant makes any code changes. User explicitly corrected mid-session: 'de producto hablo, no de código' — they were explaining the product idea when the assistant jumped to implementation. Always listen to the full product intent first, confirm understanding, then proceed to code. + * **Push branch and open PR immediately after committing fixes, then hand off to CI/follow-ups**: After making a fix on a fix/\* branch, the user pushes the branch to origin and opens a PR (often via gh CLI) without manually merging or waiting locally. The assistant is expected to then shift focus to: (1) monitoring/waiting for CI on the opened PR, (2) identifying follow-up work in dependent repos (e.g., filing issues in BYK/binpatch when an action diverges), and (3) flagging unintended changes in the branch (such as auto-generated files like .lore.md) before proceeding. The user does not request local verification gates beyond running tests; pushing and opening the PR is the natural completion step for a fix branch. @@ -579,6 +582,9 @@ * **Run full test suite plus lint after every code change**: After implementing or modifying code, the user consistently expects a verification cycle consisting of: (1) running the test suite to confirm all tests pass and noting any expected error messages, (2) running the lint check to confirm no issues, and (3) often a typecheck on modified files. Test output is reviewed carefully — expected warnings (skipped files, unsupported formats, Sentry CLI auth warnings) are explicitly called out as non-blocking, while actual failures are investigated. The assistant should proactively run lint and tests after changes, report pass/fail counts with timing, distinguish expected vs unexpected warnings, and suggest logical next steps (typecheck, commit, push) once verification is green. + +* **sentry project create: only colon forms valid — space forms removed entirely**: For \`sentry project create\`, only TWO valid input forms exist (PR #1191, \`fix/project-create-multiple\`): 1. \`proj:platform...\` — no-org colon form (org auto-detected; canonical/preferred — enables batch creation) 2. \`org/proj:platform...\` — with-org colon form Space-separated forms (\`proj platform\`, \`org/proj platform\`) are INVALID and removed entirely. Colon form preferred because it enables chaining: \`web:node api:python worker:node\`. Spaces are never valid in slugs — \`looksLikeDisplayName()\` uses space presence as display-name signal. Key implementation details: \`buildPlatformError()\` always shows only colon form in error messages. \`parsePairedProjectSpec()\` error: \`"must use \:\ syntax"\`. \`parseProjectSpecs()\` legacy two-positional branch removed entirely. Completions: bare positional never gets space-separated platform completions. \`teamAutoCreateSlug\` fix (commit \`13727f266\`): searches whole batch for first non-empty slug via \`parsed.map(p => slugify(p.name)).find(slug => slug !== "")\` — prevents one empty-slug name from blocking team auto-create for the entire batch. \`generate-skill-markdown.ts\` (NEW script): exports \`extractCommandPathFromHeading(heading)\` and \`matchExampleToCommand()\`, extracted from \`generate-skill.ts\` to fix a heading-parsing regex that broke on the new \`[/]\` bracket prefix and to make the parsing logic independently unit-testable. + * **Strict PR merge-readiness workflow**: Drive every PR to a clean merge-ready state: branch, commit with .lore.md, push, then wait for CI and bot reviews. Rebase onto latest main and resolve conflicts; take HEAD for auto-generated .lore.md. Investigate CI failures by reading logs and conflict categories before fixing. Resolve every inline review thread (Bugbot, Seer, Warden): verify against current code, reply to stale/false positives, then resolve. Run full local verification (install, typecheck, lint, build, tests) and confirm required CI checks pass. After CI turns green, re-fetch PR state before merging — auto-merge may already have merged; verify merge commit has one parent. Final sweep for new comments, then squash-merge only when mergeStateStatus=CLEAN. From a3212f728a57b4ac5f162eb0424d112f46fc3ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Beteg=C3=B3n?= Date: Mon, 3 Aug 2026 18:49:09 +0200 Subject: [PATCH 2/3] docs(lore): drop unrelated entry, keep only the colon-syntax decision The previous commit accidentally carried over an unrelated distilled entry (a Spanish-quote note about explaining product rationale before code) that has nothing to do with this PR. Keep only the actual semantic decision: sentry project create requires the platform to be attached with a colon (name:platform); there is no space-separated form. --- .lore.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/.lore.md b/.lore.md index 4394633f0..0284095bb 100644 --- a/.lore.md +++ b/.lore.md @@ -570,9 +570,6 @@ * **Prefers Bun-native APIs over Node**: prefer Bun-native APIs over Node. - -* **project create: explain product rationale before making code changes**: When discussing \`sentry project create\` (or similar command design), the user wants to finish explaining their product-level rationale before the assistant makes any code changes. User explicitly corrected mid-session: 'de producto hablo, no de código' — they were explaining the product idea when the assistant jumped to implementation. Always listen to the full product intent first, confirm understanding, then proceed to code. - * **Push branch and open PR immediately after committing fixes, then hand off to CI/follow-ups**: After making a fix on a fix/\* branch, the user pushes the branch to origin and opens a PR (often via gh CLI) without manually merging or waiting locally. The assistant is expected to then shift focus to: (1) monitoring/waiting for CI on the opened PR, (2) identifying follow-up work in dependent repos (e.g., filing issues in BYK/binpatch when an action diverges), and (3) flagging unintended changes in the branch (such as auto-generated files like .lore.md) before proceeding. The user does not request local verification gates beyond running tests; pushing and opening the PR is the natural completion step for a fix branch. From d404a3720120856659161bcbf52f5f1e74fced7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Beteg=C3=B3n?= Date: Mon, 3 Aug 2026 19:05:19 +0200 Subject: [PATCH 3/3] docs(lore): match house style and move entry to Architecture Rewrite as flowing prose with inline (1)/(2) enumeration, matching the rest of .lore.md instead of a bare numbered list. Also move it from the Preference section (where it landed by accident) to Architecture, since it documents a CLI syntax fact, not a user behavioral pattern. --- .lore.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.lore.md b/.lore.md index 0284095bb..4e0fc50c2 100644 --- a/.lore.md +++ b/.lore.md @@ -94,6 +94,9 @@ * **Sentry CLI resolve-target cascade has 5 priority levels with env var support**: Resolve-target cascade: (1) CLI flags, (2) SENTRY\_ORG/SENTRY\_PROJECT env vars, (3) SQLite defaults, (4) DSN auto-detection, (5) directory name inference. SENTRY\_PROJECT supports \`org/project\` combo — SENTRY\_ORG ignored if set. Schema v13 merged \`defaults\` table into \`metadata\` KV with keys \`defaults.{org,project,telemetry,url}\`; getters/setters in \`src/lib/db/defaults.ts\`. Prefer dedicated SQLite tables + migrations over \`metadata\` KV for non-trivial caches. Hidden global \`--org\`/\`--project\` flags: \`mergeGlobalFlags()\` in command.ts injects hidden flag shapes, \`applyOrgProjectFlags()\` writes to \`SENTRY\_ORG\`/\`SENTRY\_PROJECT\` before auth guard. No short aliases (\`-p\` conflicts). \`@sentry/api\` SDK: wrap types at \`src/lib/api/\*.ts\` with \`as unknown as SentryX\` casts; never leak to commands. \`unwrapResult\`/\`unwrapPaginatedResult\` must stay CLI-owned. \`apiRequestToRegion\` auto-sets JSON Content-Type; \`rawApiRequest\` preserves strings. + +* **sentry project create: the platform must always be attached with a colon**: \`sentry project create\` accepts only two forms, both with the platform joined to the name by \`:\` — there is no space-separated form, with or without an explicit org: (1) \`proj:platform...\` (org auto-detected) and (2) \`org/proj:platform...\` (org explicit); both support chaining multiple pairs in one call, e.g. \`web:node api:python worker:node\`. Spaces are never valid in slugs — \`looksLikeDisplayName()\` uses space presence as the display-name signal. \`buildPlatformError()\` only ever shows the colon form; \`parsePairedProjectSpec()\` rejects anything else with "must use \:\ syntax"; \`parseProjectSpecs()\`'s legacy two-positional branch was removed entirely; completions never offer space-separated platform completions for a bare positional. \`teamAutoCreateSlug\` (commit \`13727f266\`) searches the whole batch for the first non-empty slug via \`parsed.map(p => slugify(p.name)).find(slug => slug !== "")\`, so one project with a punctuation-only name doesn't block team auto-create for the rest of the batch. \`generate-skill-markdown.ts\` extracts \`extractCommandPathFromHeading()\` and \`matchExampleToCommand()\` out of \`generate-skill.ts\` to fix a heading-parsing regex that broke on the new \`\[/]\` bracket prefix, and to make the parsing logic independently unit-testable. + * **sentry-cli skill install paths: ~/.claude/ and ~/.agents/ only — OpenCode is never a target**: Skill source-of-truth: \`plugins/sentry-cli/skills/sentry-cli/SKILL.md\` (602 lines) + \`references/\` (28 per-command .md files). \`installAgentSkills()\` in \`src/lib/agent-skills.ts\` installs to \`~/.agents/skills/sentry-cli/\` and \`~/.claude/skills/sentry-cli/\` only — no OpenCode path. OpenCode IS detected via \`OPENCODE\_CLIENT\` env in \`src/lib/detect-agent.ts\` but only for telemetry, not skill installation. \`.opencode/\` and \`opencode.json\*\` are gitignored (lines 72–74). Cursor symlinks live at \`.cursor/skills/sentry-cli/\` pointing into \`plugins/\`. OpenCode scans \`~/.claude/skills/\*\*/SKILL.md\` and \`~/.agents/\*\*/SKILL.md\` — \`.cursor/\` is NOT scanned. \`installAgentSkills()\` never creates top-level agent roots — their presence is the detection signal that the user already has a compatible agent installed. Skills are updated on every version bump (write-if-changed optimization is unnecessary). Writes use atomic rename: temp file \`.\.\.\.tmp\` in same dir → \`rename()\` into place, guaranteeing readers never observe a partial file. @@ -579,9 +582,6 @@ * **Run full test suite plus lint after every code change**: After implementing or modifying code, the user consistently expects a verification cycle consisting of: (1) running the test suite to confirm all tests pass and noting any expected error messages, (2) running the lint check to confirm no issues, and (3) often a typecheck on modified files. Test output is reviewed carefully — expected warnings (skipped files, unsupported formats, Sentry CLI auth warnings) are explicitly called out as non-blocking, while actual failures are investigated. The assistant should proactively run lint and tests after changes, report pass/fail counts with timing, distinguish expected vs unexpected warnings, and suggest logical next steps (typecheck, commit, push) once verification is green. - -* **sentry project create: only colon forms valid — space forms removed entirely**: For \`sentry project create\`, only TWO valid input forms exist (PR #1191, \`fix/project-create-multiple\`): 1. \`proj:platform...\` — no-org colon form (org auto-detected; canonical/preferred — enables batch creation) 2. \`org/proj:platform...\` — with-org colon form Space-separated forms (\`proj platform\`, \`org/proj platform\`) are INVALID and removed entirely. Colon form preferred because it enables chaining: \`web:node api:python worker:node\`. Spaces are never valid in slugs — \`looksLikeDisplayName()\` uses space presence as display-name signal. Key implementation details: \`buildPlatformError()\` always shows only colon form in error messages. \`parsePairedProjectSpec()\` error: \`"must use \:\ syntax"\`. \`parseProjectSpecs()\` legacy two-positional branch removed entirely. Completions: bare positional never gets space-separated platform completions. \`teamAutoCreateSlug\` fix (commit \`13727f266\`): searches whole batch for first non-empty slug via \`parsed.map(p => slugify(p.name)).find(slug => slug !== "")\` — prevents one empty-slug name from blocking team auto-create for the entire batch. \`generate-skill-markdown.ts\` (NEW script): exports \`extractCommandPathFromHeading(heading)\` and \`matchExampleToCommand()\`, extracted from \`generate-skill.ts\` to fix a heading-parsing regex that broke on the new \`[/]\` bracket prefix and to make the parsing logic independently unit-testable. - * **Strict PR merge-readiness workflow**: Drive every PR to a clean merge-ready state: branch, commit with .lore.md, push, then wait for CI and bot reviews. Rebase onto latest main and resolve conflicts; take HEAD for auto-generated .lore.md. Investigate CI failures by reading logs and conflict categories before fixing. Resolve every inline review thread (Bugbot, Seer, Warden): verify against current code, reply to stale/false positives, then resolve. Run full local verification (install, typecheck, lint, build, tests) and confirm required CI checks pass. After CI turns green, re-fetch PR state before merging — auto-merge may already have merged; verify merge commit has one parent. Final sweep for new comments, then squash-merge only when mergeStateStatus=CLEAN.