From e1e60fbc6db9cd137d6e294384f64e0bc6e6224c Mon Sep 17 00:00:00 2001 From: Sebastien Taggart Date: Thu, 9 Apr 2026 18:21:17 -0400 Subject: [PATCH] Fix awkward TICKET_LABEL_CREATION_ALLOWED substitutions in start skill --- .agents/skills/start/SKILL.md | 11 +++-------- .agents/skills/submit-for-review/SKILL.md | 4 ++-- .claude/commands/start.md | 11 +++-------- .claude/commands/submit-for-review.md | 4 ++-- .cursor/rules/start.mdc | 11 +++-------- .cursor/rules/submit-for-review.mdc | 4 ++-- .gemini/skills/start/SKILL.md | 11 +++-------- .gemini/skills/submit-for-review/SKILL.md | 4 ++-- skills/start.md | 15 ++++++++++++--- skills/submit-for-review.md | 2 +- sync.sh | 6 +++++- 11 files changed, 38 insertions(+), 45 deletions(-) diff --git a/.agents/skills/start/SKILL.md b/.agents/skills/start/SKILL.md index a84d3e8..caa34c3 100644 --- a/.agents/skills/start/SKILL.md +++ b/.agents/skills/start/SKILL.md @@ -40,12 +40,7 @@ After parsing flags, determine the active labels in this order: 2. **Pool-based selection** — the allowed label pool is: `bug, documentation, enhancement, chore` (comma-separated). Select 1–3 labels from this pool that genuinely fit the task description and implementation approach. Do not apply labels mechanically — pick only what fits. If no pool label fits the task, fall through to step 3. - If any selected label name contains a space (e.g. `good first issue`), quote the entire `--label` value. 3. **No label / creation** — if the pool is empty or no pool label fits: - - If label creation is allowed (`false` = `true`, case-insensitive): the agent **may** create a new label before applying it: - ```bash - gh label create "" --color "" --description "" - ``` - Use judgment — only create a label with clear reuse value. Do not create near-duplicates of existing pool labels. - - Otherwise (`false` = `false` or unset): omit `--label` entirely. Proceed silently; do not inform the user. + - Label creation is not allowed in this project. Omit `--label` entirely. Proceed silently; do not inform the user. **Milestone resolution (three-tier, Case A only):** @@ -228,6 +223,6 @@ When done, say: **"The code is ready for review. Please run `make dev` and test - If already on a feature branch when `/start` is invoked, warn the user before creating another branch. - `gh issue create` must use `--title` and `--body` flags. Never open an interactive editor. - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit --remove-assignee @me`. -- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit (or, when `false` = `true`, create). Never apply a label outside `bug, documentation, enhancement, chore` unless `false` = `true`. +- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit `--label` entirely. Never apply a label outside `bug, documentation, enhancement, chore`. - Milestone resolution order: per-invocation flag → auto-detected from GitHub open milestones. Never prompt for a milestone more than once per invocation. - + diff --git a/.agents/skills/submit-for-review/SKILL.md b/.agents/skills/submit-for-review/SKILL.md index 35afd88..c7ed607 100644 --- a/.agents/skills/submit-for-review/SKILL.md +++ b/.agents/skills/submit-for-review/SKILL.md @@ -236,7 +236,7 @@ EOF [--label ""] ``` -Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `bug, documentation, enhancement, chore` that genuinely fit the finding. If `bug, documentation, enhancement, chore` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and do not create new labels regardless of `false`. +Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `bug, documentation, enhancement, chore` that genuinely fit the finding. If `bug, documentation, enhancement, chore` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and never create new labels from follow-ups, even if label creation is enabled for the project. Do **not** pass `--milestone` — follow-ups are future work and should not inherit the current sprint. @@ -259,4 +259,4 @@ If a single `gh issue create` call fails, report the failure for that finding an - `/submit-for-review` merges only to `dev` — never directly to `main`. - If `make merge` fails for any reason, report it and stop — do not attempt workarounds. - The follow-up issue offer in Step 9 runs only after a successful merge and only when the review produced non-blocking findings. Never prompt the user for follow-ups when the review blocked the merge — those findings should be fixed, not ticketed. - + diff --git a/.claude/commands/start.md b/.claude/commands/start.md index ccd7f07..043ad93 100644 --- a/.claude/commands/start.md +++ b/.claude/commands/start.md @@ -35,12 +35,7 @@ After parsing flags, determine the active labels in this order: 2. **Pool-based selection** — the allowed label pool is: `bug, documentation, enhancement, chore` (comma-separated). Select 1–3 labels from this pool that genuinely fit the task description and implementation approach. Do not apply labels mechanically — pick only what fits. If no pool label fits the task, fall through to step 3. - If any selected label name contains a space (e.g. `good first issue`), quote the entire `--label` value. 3. **No label / creation** — if the pool is empty or no pool label fits: - - If label creation is allowed (`false` = `true`, case-insensitive): the agent **may** create a new label before applying it: - ```bash - gh label create "" --color "" --description "" - ``` - Use judgment — only create a label with clear reuse value. Do not create near-duplicates of existing pool labels. - - Otherwise (`false` = `false` or unset): omit `--label` entirely. Proceed silently; do not inform the user. + - Label creation is not allowed in this project. Omit `--label` entirely. Proceed silently; do not inform the user. **Milestone resolution (three-tier, Case A only):** @@ -223,6 +218,6 @@ When done, say: **"The code is ready for review. Please run `make dev` and test - If already on a feature branch when `/start` is invoked, warn the user before creating another branch. - `gh issue create` must use `--title` and `--body` flags. Never open an interactive editor. - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit --remove-assignee @me`. -- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit (or, when `false` = `true`, create). Never apply a label outside `bug, documentation, enhancement, chore` unless `false` = `true`. +- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit `--label` entirely. Never apply a label outside `bug, documentation, enhancement, chore`. - Milestone resolution order: per-invocation flag → auto-detected from GitHub open milestones. Never prompt for a milestone more than once per invocation. - + diff --git a/.claude/commands/submit-for-review.md b/.claude/commands/submit-for-review.md index 585ce7d..d0d0e18 100644 --- a/.claude/commands/submit-for-review.md +++ b/.claude/commands/submit-for-review.md @@ -231,7 +231,7 @@ EOF [--label ""] ``` -Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `bug, documentation, enhancement, chore` that genuinely fit the finding. If `bug, documentation, enhancement, chore` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and do not create new labels regardless of `false`. +Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `bug, documentation, enhancement, chore` that genuinely fit the finding. If `bug, documentation, enhancement, chore` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and never create new labels from follow-ups, even if label creation is enabled for the project. Do **not** pass `--milestone` — follow-ups are future work and should not inherit the current sprint. @@ -254,4 +254,4 @@ If a single `gh issue create` call fails, report the failure for that finding an - `/submit-for-review` merges only to `dev` — never directly to `main`. - If `make merge` fails for any reason, report it and stop — do not attempt workarounds. - The follow-up issue offer in Step 9 runs only after a successful merge and only when the review produced non-blocking findings. Never prompt the user for follow-ups when the review blocked the merge — those findings should be fixed, not ticketed. - + diff --git a/.cursor/rules/start.mdc b/.cursor/rules/start.mdc index 7e2f615..6566199 100644 --- a/.cursor/rules/start.mdc +++ b/.cursor/rules/start.mdc @@ -41,12 +41,7 @@ After parsing flags, determine the active labels in this order: 2. **Pool-based selection** — the allowed label pool is: `bug, documentation, enhancement, chore` (comma-separated). Select 1–3 labels from this pool that genuinely fit the task description and implementation approach. Do not apply labels mechanically — pick only what fits. If no pool label fits the task, fall through to step 3. - If any selected label name contains a space (e.g. `good first issue`), quote the entire `--label` value. 3. **No label / creation** — if the pool is empty or no pool label fits: - - If label creation is allowed (`false` = `true`, case-insensitive): the agent **may** create a new label before applying it: - ```bash - gh label create "" --color "" --description "" - ``` - Use judgment — only create a label with clear reuse value. Do not create near-duplicates of existing pool labels. - - Otherwise (`false` = `false` or unset): omit `--label` entirely. Proceed silently; do not inform the user. + - Label creation is not allowed in this project. Omit `--label` entirely. Proceed silently; do not inform the user. **Milestone resolution (three-tier, Case A only):** @@ -229,6 +224,6 @@ When done, say: **"The code is ready for review. Please run `make dev` and test - If already on a feature branch when `/start` is invoked, warn the user before creating another branch. - `gh issue create` must use `--title` and `--body` flags. Never open an interactive editor. - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit --remove-assignee @me`. -- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit (or, when `false` = `true`, create). Never apply a label outside `bug, documentation, enhancement, chore` unless `false` = `true`. +- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit `--label` entirely. Never apply a label outside `bug, documentation, enhancement, chore`. - Milestone resolution order: per-invocation flag → auto-detected from GitHub open milestones. Never prompt for a milestone more than once per invocation. - + diff --git a/.cursor/rules/submit-for-review.mdc b/.cursor/rules/submit-for-review.mdc index 0645d89..378a674 100644 --- a/.cursor/rules/submit-for-review.mdc +++ b/.cursor/rules/submit-for-review.mdc @@ -237,7 +237,7 @@ EOF [--label ""] ``` -Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `bug, documentation, enhancement, chore` that genuinely fit the finding. If `bug, documentation, enhancement, chore` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and do not create new labels regardless of `false`. +Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `bug, documentation, enhancement, chore` that genuinely fit the finding. If `bug, documentation, enhancement, chore` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and never create new labels from follow-ups, even if label creation is enabled for the project. Do **not** pass `--milestone` — follow-ups are future work and should not inherit the current sprint. @@ -260,4 +260,4 @@ If a single `gh issue create` call fails, report the failure for that finding an - `/submit-for-review` merges only to `dev` — never directly to `main`. - If `make merge` fails for any reason, report it and stop — do not attempt workarounds. - The follow-up issue offer in Step 9 runs only after a successful merge and only when the review produced non-blocking findings. Never prompt the user for follow-ups when the review blocked the merge — those findings should be fixed, not ticketed. - + diff --git a/.gemini/skills/start/SKILL.md b/.gemini/skills/start/SKILL.md index 74c21a3..e62aaa3 100644 --- a/.gemini/skills/start/SKILL.md +++ b/.gemini/skills/start/SKILL.md @@ -40,12 +40,7 @@ After parsing flags, determine the active labels in this order: 2. **Pool-based selection** — the allowed label pool is: `bug, documentation, enhancement, chore` (comma-separated). Select 1–3 labels from this pool that genuinely fit the task description and implementation approach. Do not apply labels mechanically — pick only what fits. If no pool label fits the task, fall through to step 3. - If any selected label name contains a space (e.g. `good first issue`), quote the entire `--label` value. 3. **No label / creation** — if the pool is empty or no pool label fits: - - If label creation is allowed (`false` = `true`, case-insensitive): the agent **may** create a new label before applying it: - ```bash - gh label create "" --color "" --description "" - ``` - Use judgment — only create a label with clear reuse value. Do not create near-duplicates of existing pool labels. - - Otherwise (`false` = `false` or unset): omit `--label` entirely. Proceed silently; do not inform the user. + - Label creation is not allowed in this project. Omit `--label` entirely. Proceed silently; do not inform the user. **Milestone resolution (three-tier, Case A only):** @@ -228,6 +223,6 @@ When done, say: **"The code is ready for review. Please run `make dev` and test - If already on a feature branch when `/start` is invoked, warn the user before creating another branch. - `gh issue create` must use `--title` and `--body` flags. Never open an interactive editor. - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit --remove-assignee @me`. -- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit (or, when `false` = `true`, create). Never apply a label outside `bug, documentation, enhancement, chore` unless `false` = `true`. +- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit `--label` entirely. Never apply a label outside `bug, documentation, enhancement, chore`. - Milestone resolution order: per-invocation flag → auto-detected from GitHub open milestones. Never prompt for a milestone more than once per invocation. - + diff --git a/.gemini/skills/submit-for-review/SKILL.md b/.gemini/skills/submit-for-review/SKILL.md index 7d074ba..2ca4f1d 100644 --- a/.gemini/skills/submit-for-review/SKILL.md +++ b/.gemini/skills/submit-for-review/SKILL.md @@ -236,7 +236,7 @@ EOF [--label ""] ``` -Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `bug, documentation, enhancement, chore` that genuinely fit the finding. If `bug, documentation, enhancement, chore` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and do not create new labels regardless of `false`. +Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `bug, documentation, enhancement, chore` that genuinely fit the finding. If `bug, documentation, enhancement, chore` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and never create new labels from follow-ups, even if label creation is enabled for the project. Do **not** pass `--milestone` — follow-ups are future work and should not inherit the current sprint. @@ -259,4 +259,4 @@ If a single `gh issue create` call fails, report the failure for that finding an - `/submit-for-review` merges only to `dev` — never directly to `main`. - If `make merge` fails for any reason, report it and stop — do not attempt workarounds. - The follow-up issue offer in Step 9 runs only after a successful merge and only when the review produced non-blocking findings. Never prompt the user for follow-ups when the review blocked the merge — those findings should be fixed, not ticketed. - + diff --git a/skills/start.md b/skills/start.md index 3003ca3..169a2de 100644 --- a/skills/start.md +++ b/skills/start.md @@ -48,12 +48,16 @@ After parsing flags, determine the active labels in this order: 2. **Pool-based selection** — no label pool is configured. Fall through to step 3. {{/if}} 3. **No label / creation** — if the pool is empty or no pool label fits: - - If label creation is allowed (`{{TICKET_LABEL_CREATION_ALLOWED}}` = `true`, case-insensitive): the agent **may** create a new label before applying it: +{{#if TICKET_LABEL_CREATION_ALLOWED}} + - Label creation is allowed in this project. The agent **may** create a new label before applying it: ```bash gh label create "" --color "" --description "" ``` Use judgment — only create a label with clear reuse value. Do not create near-duplicates of existing pool labels. - - Otherwise (`{{TICKET_LABEL_CREATION_ALLOWED}}` = `false` or unset): omit `--label` entirely. Proceed silently; do not inform the user. +{{/if}} +{{#if !TICKET_LABEL_CREATION_ALLOWED}} + - Label creation is not allowed in this project. Omit `--label` entirely. Proceed silently; do not inform the user. +{{/if}} {{#if !TICKET_LABELS}} > **Tip:** Run `/setup` to populate TICKET_LABELS from your repo's existing GitHub labels. @@ -295,7 +299,12 @@ When done, say: **"The code is ready for review. Please run `{{DEV_CMD}}` and te - `gh issue create` must use `--title` and `--body` flags. Never open an interactive editor. - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit --remove-assignee @me`. {{#if TICKET_LABELS}} -- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `{{TICKET_LABELS}}` → omit (or, when `{{TICKET_LABEL_CREATION_ALLOWED}}` = `true`, create). Never apply a label outside `{{TICKET_LABELS}}` unless `{{TICKET_LABEL_CREATION_ALLOWED}}` = `true`. +{{#if TICKET_LABEL_CREATION_ALLOWED}} +- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `{{TICKET_LABELS}}` → create a new label when nothing in the pool fits. Labels outside `{{TICKET_LABELS}}` may only be created when no pool label is a good fit. +{{/if}} +{{#if !TICKET_LABEL_CREATION_ALLOWED}} +- Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `{{TICKET_LABELS}}` → omit `--label` entirely. Never apply a label outside `{{TICKET_LABELS}}`. +{{/if}} {{/if}} {{#if !TICKET_LABELS}} - Apply labels only when explicitly provided via `--label`. No label pool is configured. diff --git a/skills/submit-for-review.md b/skills/submit-for-review.md index 92a8ce4..f011345 100644 --- a/skills/submit-for-review.md +++ b/skills/submit-for-review.md @@ -276,7 +276,7 @@ EOF [--label ""] ``` -Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `{{TICKET_LABELS}}` that genuinely fit the finding. If `{{TICKET_LABELS}}` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and do not create new labels regardless of `{{TICKET_LABEL_CREATION_ALLOWED}}`. +Label resolution for each follow-up issue: use the pool-based selection tier from `/start` — pick 1–3 labels from `{{TICKET_LABELS}}` that genuinely fit the finding. If `{{TICKET_LABELS}}` is empty or no pool label fits, omit `--label`. Do not attempt per-invocation flag resolution (there is no flag here) and never create new labels from follow-ups, even if label creation is enabled for the project. Do **not** pass `--milestone` — follow-ups are future work and should not inherit the current sprint. diff --git a/sync.sh b/sync.sh index 253ddb8..238ee57 100755 --- a/sync.sh +++ b/sync.sh @@ -146,7 +146,11 @@ def apply_conditionals(text, values): m = _IF_OPEN.match(lines[open_idx]) negated = m.group(1) == '!' key = m.group(2) - truthy = bool(values.get(key, '').strip()) + raw_value = values.get(key, '').strip() + # Empty string and boolean-like falsy strings ('false', 'no', '0') + # are treated as falsy so config values like 'false' behave intuitively + # in conditional blocks. + truthy = bool(raw_value) and raw_value.lower() not in ('false', 'no', '0') keep = (not truthy) if negated else truthy if keep: