diff --git a/.claude/commands/commit.md b/.claude/commands/commit.md index e64e0075..1192e4f5 100644 --- a/.claude/commands/commit.md +++ b/.claude/commands/commit.md @@ -8,6 +8,24 @@ Load and follow the `sce-atomic-commit` skill. Input: `$ARGUMENTS` +## Bypass path (`/commit oneshot` or `/commit skip`) + +If `$ARGUMENTS` starts with `oneshot` or `skip` (case-insensitive, first token only): + +- **Skip the staging confirmation prompt.** Do not ask the user to stage files or confirm staging. +- **Validate staged content exists.** Check that `git diff --cached` is non-empty. If no staged changes exist, stop with the error: "No staged changes. Stage changes before commit." Do not proceed. +- **Skip context-guidance gate classification.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Produce exactly one commit message.** Run `sce-atomic-commit` with these overrides: + - Produce exactly one commit message. Do not propose splits. Do not emit split guidance. + - When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. +- **Auto-execute `git commit`.** Use the produced commit message to run `git commit -m ""`. + - If `git commit` succeeds, report the commit hash and stop. + - If `git commit` fails, stop and report the failure. Do not invent fallback commits, retry, or amend. + +## Regular path (no arguments or non-bypass arguments) + +If `$ARGUMENTS` does not start with `oneshot` or `skip`: + Behavior: - If arguments are empty, treat input as unstated and infer commit intent from staged changes only. - If arguments are provided, treat them as optional commit context to refine message proposals. diff --git a/.claude/skills/sce-atomic-commit/SKILL.md b/.claude/skills/sce-atomic-commit/SKILL.md index f320eb31..0d7a3cf4 100644 --- a/.claude/skills/sce-atomic-commit/SKILL.md +++ b/.claude/skills/sce-atomic-commit/SKILL.md @@ -14,6 +14,7 @@ For this workflow: - propose one or more commit messages when staged changes mix unrelated goals - keep each proposed message focused on a single coherent change - stay proposal-only: do not create commits automatically +- in bypass mode (command-invoked), relax proposal-only, split guidance, context-guidance gate, and plan-citation ambiguity rules ## Inputs @@ -38,6 +39,17 @@ When staged changes include `context/plans/*.md`, each commit body must also inc If staged `context/plans/*.md` changes do not expose the plan slug or updated task ID clearly enough to cite faithfully, stop and ask for clarification instead of inventing references. +## Bypass mode + +When this skill is invoked by the `/commit` command in bypass mode (`/commit oneshot` or `/commit skip`), the command passes overrides that relax the standard rules below: + +- **Proposal-only → auto-commit allowed.** Do not block auto-commit; the command will execute `git commit` with the produced message. +- **Single message only.** Produce exactly one commit message. Do not propose splits. Do not emit split guidance. +- **Context-guidance gate skipped.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Plan citations: best-effort only.** When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. + +When NOT in bypass mode, follow the standard rules in the Procedure and Context-file guidance gating sections below. + ## Procedure 1) Analyze the staged diff for coherent units @@ -57,17 +69,17 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - Explain what was wrong/missing, why it matters, what changed conceptually, and impact. - Add issue references on separate lines. -5) Apply the plan-update body rule when needed +5) In regular mode: apply the plan-update body rule when needed - Check whether staged changes include `context/plans/*.md`. - If yes, cite the affected plan slug(s) and updated task ID(s) in the body. - If the staged plan diff is ambiguous, stop with actionable guidance asking the user to stage or clarify the plan/task reference explicitly. -6) Propose split guidance when appropriate +6) In regular mode: propose split guidance when appropriate - If staged changes mix unrelated goals (for example: a feature change plus unrelated refactoring), propose separate commit messages for each coherent unit. - Explain why the split is recommended and which files belong to each proposed commit. - If staged changes represent one coherent unit, propose a single commit message. -7) Validate each proposed message +7) In regular mode: validate each proposed message - Each message should describe its intended change faithfully. - The subject should stay concise and technical. - The body should add useful why/impact context instead of repeating the subject. @@ -75,6 +87,7 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta ## Context-file guidance gating +In regular mode: - Check staged diff scope before proposing commit messaging guidance. - If staged changes are context-only (`context/**`), context-file-focused guidance is allowed. - If staged changes are mixed (`context/**` + non-`context/**`), avoid default context-file commit reminders and prioritize guidance that reflects the full staged scope. @@ -88,3 +101,4 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - inventing plan slugs or task IDs for staged plan edits - proposing splits for changes that are already coherent - forcing unrelated changes into a single commit +- applying split guidance or plan-citation ambiguity stops when the command is in bypass mode diff --git a/.opencode/command/commit.md b/.opencode/command/commit.md index 889df059..384b7803 100644 --- a/.opencode/command/commit.md +++ b/.opencode/command/commit.md @@ -11,6 +11,24 @@ Load and follow the `sce-atomic-commit` skill. Input: `$ARGUMENTS` +## Bypass path (`/commit oneshot` or `/commit skip`) + +If `$ARGUMENTS` starts with `oneshot` or `skip` (case-insensitive, first token only): + +- **Skip the staging confirmation prompt.** Do not ask the user to stage files or confirm staging. +- **Validate staged content exists.** Check that `git diff --cached` is non-empty. If no staged changes exist, stop with the error: "No staged changes. Stage changes before commit." Do not proceed. +- **Skip context-guidance gate classification.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Produce exactly one commit message.** Run `sce-atomic-commit` with these overrides: + - Produce exactly one commit message. Do not propose splits. Do not emit split guidance. + - When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. +- **Auto-execute `git commit`.** Use the produced commit message to run `git commit -m ""`. + - If `git commit` succeeds, report the commit hash and stop. + - If `git commit` fails, stop and report the failure. Do not invent fallback commits, retry, or amend. + +## Regular path (no arguments or non-bypass arguments) + +If `$ARGUMENTS` does not start with `oneshot` or `skip`: + Behavior: - If arguments are empty, treat input as unstated and infer commit intent from staged changes only. - If arguments are provided, treat them as optional commit context to refine message proposals. diff --git a/.opencode/skills/sce-atomic-commit/SKILL.md b/.opencode/skills/sce-atomic-commit/SKILL.md index 72832d47..50c63fe8 100644 --- a/.opencode/skills/sce-atomic-commit/SKILL.md +++ b/.opencode/skills/sce-atomic-commit/SKILL.md @@ -14,6 +14,7 @@ For this workflow: - propose one or more commit messages when staged changes mix unrelated goals - keep each proposed message focused on a single coherent change - stay proposal-only: do not create commits automatically +- in bypass mode (command-invoked), relax proposal-only, split guidance, context-guidance gate, and plan-citation ambiguity rules ## Inputs @@ -38,6 +39,17 @@ When staged changes include `context/plans/*.md`, each commit body must also inc If staged `context/plans/*.md` changes do not expose the plan slug or updated task ID clearly enough to cite faithfully, stop and ask for clarification instead of inventing references. +## Bypass mode + +When this skill is invoked by the `/commit` command in bypass mode (`/commit oneshot` or `/commit skip`), the command passes overrides that relax the standard rules below: + +- **Proposal-only → auto-commit allowed.** Do not block auto-commit; the command will execute `git commit` with the produced message. +- **Single message only.** Produce exactly one commit message. Do not propose splits. Do not emit split guidance. +- **Context-guidance gate skipped.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Plan citations: best-effort only.** When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. + +When NOT in bypass mode, follow the standard rules in the Procedure and Context-file guidance gating sections below. + ## Procedure 1) Analyze the staged diff for coherent units @@ -57,17 +69,17 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - Explain what was wrong/missing, why it matters, what changed conceptually, and impact. - Add issue references on separate lines. -5) Apply the plan-update body rule when needed +5) In regular mode: apply the plan-update body rule when needed - Check whether staged changes include `context/plans/*.md`. - If yes, cite the affected plan slug(s) and updated task ID(s) in the body. - If the staged plan diff is ambiguous, stop with actionable guidance asking the user to stage or clarify the plan/task reference explicitly. -6) Propose split guidance when appropriate +6) In regular mode: propose split guidance when appropriate - If staged changes mix unrelated goals (for example: a feature change plus unrelated refactoring), propose separate commit messages for each coherent unit. - Explain why the split is recommended and which files belong to each proposed commit. - If staged changes represent one coherent unit, propose a single commit message. -7) Validate each proposed message +7) In regular mode: validate each proposed message - Each message should describe its intended change faithfully. - The subject should stay concise and technical. - The body should add useful why/impact context instead of repeating the subject. @@ -75,6 +87,7 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta ## Context-file guidance gating +In regular mode: - Check staged diff scope before proposing commit messaging guidance. - If staged changes are context-only (`context/**`), context-file-focused guidance is allowed. - If staged changes are mixed (`context/**` + non-`context/**`), avoid default context-file commit reminders and prioritize guidance that reflects the full staged scope. @@ -88,3 +101,4 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - inventing plan slugs or task IDs for staged plan edits - proposing splits for changes that are already coherent - forcing unrelated changes into a single commit +- applying split guidance or plan-citation ambiguity stops when the command is in bypass mode diff --git a/config/.claude/commands/commit.md b/config/.claude/commands/commit.md index e64e0075..1192e4f5 100644 --- a/config/.claude/commands/commit.md +++ b/config/.claude/commands/commit.md @@ -8,6 +8,24 @@ Load and follow the `sce-atomic-commit` skill. Input: `$ARGUMENTS` +## Bypass path (`/commit oneshot` or `/commit skip`) + +If `$ARGUMENTS` starts with `oneshot` or `skip` (case-insensitive, first token only): + +- **Skip the staging confirmation prompt.** Do not ask the user to stage files or confirm staging. +- **Validate staged content exists.** Check that `git diff --cached` is non-empty. If no staged changes exist, stop with the error: "No staged changes. Stage changes before commit." Do not proceed. +- **Skip context-guidance gate classification.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Produce exactly one commit message.** Run `sce-atomic-commit` with these overrides: + - Produce exactly one commit message. Do not propose splits. Do not emit split guidance. + - When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. +- **Auto-execute `git commit`.** Use the produced commit message to run `git commit -m ""`. + - If `git commit` succeeds, report the commit hash and stop. + - If `git commit` fails, stop and report the failure. Do not invent fallback commits, retry, or amend. + +## Regular path (no arguments or non-bypass arguments) + +If `$ARGUMENTS` does not start with `oneshot` or `skip`: + Behavior: - If arguments are empty, treat input as unstated and infer commit intent from staged changes only. - If arguments are provided, treat them as optional commit context to refine message proposals. diff --git a/config/.claude/skills/sce-atomic-commit/SKILL.md b/config/.claude/skills/sce-atomic-commit/SKILL.md index f320eb31..0d7a3cf4 100644 --- a/config/.claude/skills/sce-atomic-commit/SKILL.md +++ b/config/.claude/skills/sce-atomic-commit/SKILL.md @@ -14,6 +14,7 @@ For this workflow: - propose one or more commit messages when staged changes mix unrelated goals - keep each proposed message focused on a single coherent change - stay proposal-only: do not create commits automatically +- in bypass mode (command-invoked), relax proposal-only, split guidance, context-guidance gate, and plan-citation ambiguity rules ## Inputs @@ -38,6 +39,17 @@ When staged changes include `context/plans/*.md`, each commit body must also inc If staged `context/plans/*.md` changes do not expose the plan slug or updated task ID clearly enough to cite faithfully, stop and ask for clarification instead of inventing references. +## Bypass mode + +When this skill is invoked by the `/commit` command in bypass mode (`/commit oneshot` or `/commit skip`), the command passes overrides that relax the standard rules below: + +- **Proposal-only → auto-commit allowed.** Do not block auto-commit; the command will execute `git commit` with the produced message. +- **Single message only.** Produce exactly one commit message. Do not propose splits. Do not emit split guidance. +- **Context-guidance gate skipped.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Plan citations: best-effort only.** When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. + +When NOT in bypass mode, follow the standard rules in the Procedure and Context-file guidance gating sections below. + ## Procedure 1) Analyze the staged diff for coherent units @@ -57,17 +69,17 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - Explain what was wrong/missing, why it matters, what changed conceptually, and impact. - Add issue references on separate lines. -5) Apply the plan-update body rule when needed +5) In regular mode: apply the plan-update body rule when needed - Check whether staged changes include `context/plans/*.md`. - If yes, cite the affected plan slug(s) and updated task ID(s) in the body. - If the staged plan diff is ambiguous, stop with actionable guidance asking the user to stage or clarify the plan/task reference explicitly. -6) Propose split guidance when appropriate +6) In regular mode: propose split guidance when appropriate - If staged changes mix unrelated goals (for example: a feature change plus unrelated refactoring), propose separate commit messages for each coherent unit. - Explain why the split is recommended and which files belong to each proposed commit. - If staged changes represent one coherent unit, propose a single commit message. -7) Validate each proposed message +7) In regular mode: validate each proposed message - Each message should describe its intended change faithfully. - The subject should stay concise and technical. - The body should add useful why/impact context instead of repeating the subject. @@ -75,6 +87,7 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta ## Context-file guidance gating +In regular mode: - Check staged diff scope before proposing commit messaging guidance. - If staged changes are context-only (`context/**`), context-file-focused guidance is allowed. - If staged changes are mixed (`context/**` + non-`context/**`), avoid default context-file commit reminders and prioritize guidance that reflects the full staged scope. @@ -88,3 +101,4 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - inventing plan slugs or task IDs for staged plan edits - proposing splits for changes that are already coherent - forcing unrelated changes into a single commit +- applying split guidance or plan-citation ambiguity stops when the command is in bypass mode diff --git a/config/.opencode/command/commit.md b/config/.opencode/command/commit.md index 889df059..384b7803 100644 --- a/config/.opencode/command/commit.md +++ b/config/.opencode/command/commit.md @@ -11,6 +11,24 @@ Load and follow the `sce-atomic-commit` skill. Input: `$ARGUMENTS` +## Bypass path (`/commit oneshot` or `/commit skip`) + +If `$ARGUMENTS` starts with `oneshot` or `skip` (case-insensitive, first token only): + +- **Skip the staging confirmation prompt.** Do not ask the user to stage files or confirm staging. +- **Validate staged content exists.** Check that `git diff --cached` is non-empty. If no staged changes exist, stop with the error: "No staged changes. Stage changes before commit." Do not proceed. +- **Skip context-guidance gate classification.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Produce exactly one commit message.** Run `sce-atomic-commit` with these overrides: + - Produce exactly one commit message. Do not propose splits. Do not emit split guidance. + - When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. +- **Auto-execute `git commit`.** Use the produced commit message to run `git commit -m ""`. + - If `git commit` succeeds, report the commit hash and stop. + - If `git commit` fails, stop and report the failure. Do not invent fallback commits, retry, or amend. + +## Regular path (no arguments or non-bypass arguments) + +If `$ARGUMENTS` does not start with `oneshot` or `skip`: + Behavior: - If arguments are empty, treat input as unstated and infer commit intent from staged changes only. - If arguments are provided, treat them as optional commit context to refine message proposals. diff --git a/config/.opencode/skills/sce-atomic-commit/SKILL.md b/config/.opencode/skills/sce-atomic-commit/SKILL.md index 72832d47..50c63fe8 100644 --- a/config/.opencode/skills/sce-atomic-commit/SKILL.md +++ b/config/.opencode/skills/sce-atomic-commit/SKILL.md @@ -14,6 +14,7 @@ For this workflow: - propose one or more commit messages when staged changes mix unrelated goals - keep each proposed message focused on a single coherent change - stay proposal-only: do not create commits automatically +- in bypass mode (command-invoked), relax proposal-only, split guidance, context-guidance gate, and plan-citation ambiguity rules ## Inputs @@ -38,6 +39,17 @@ When staged changes include `context/plans/*.md`, each commit body must also inc If staged `context/plans/*.md` changes do not expose the plan slug or updated task ID clearly enough to cite faithfully, stop and ask for clarification instead of inventing references. +## Bypass mode + +When this skill is invoked by the `/commit` command in bypass mode (`/commit oneshot` or `/commit skip`), the command passes overrides that relax the standard rules below: + +- **Proposal-only → auto-commit allowed.** Do not block auto-commit; the command will execute `git commit` with the produced message. +- **Single message only.** Produce exactly one commit message. Do not propose splits. Do not emit split guidance. +- **Context-guidance gate skipped.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Plan citations: best-effort only.** When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. + +When NOT in bypass mode, follow the standard rules in the Procedure and Context-file guidance gating sections below. + ## Procedure 1) Analyze the staged diff for coherent units @@ -57,17 +69,17 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - Explain what was wrong/missing, why it matters, what changed conceptually, and impact. - Add issue references on separate lines. -5) Apply the plan-update body rule when needed +5) In regular mode: apply the plan-update body rule when needed - Check whether staged changes include `context/plans/*.md`. - If yes, cite the affected plan slug(s) and updated task ID(s) in the body. - If the staged plan diff is ambiguous, stop with actionable guidance asking the user to stage or clarify the plan/task reference explicitly. -6) Propose split guidance when appropriate +6) In regular mode: propose split guidance when appropriate - If staged changes mix unrelated goals (for example: a feature change plus unrelated refactoring), propose separate commit messages for each coherent unit. - Explain why the split is recommended and which files belong to each proposed commit. - If staged changes represent one coherent unit, propose a single commit message. -7) Validate each proposed message +7) In regular mode: validate each proposed message - Each message should describe its intended change faithfully. - The subject should stay concise and technical. - The body should add useful why/impact context instead of repeating the subject. @@ -75,6 +87,7 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta ## Context-file guidance gating +In regular mode: - Check staged diff scope before proposing commit messaging guidance. - If staged changes are context-only (`context/**`), context-file-focused guidance is allowed. - If staged changes are mixed (`context/**` + non-`context/**`), avoid default context-file commit reminders and prioritize guidance that reflects the full staged scope. @@ -88,3 +101,4 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - inventing plan slugs or task IDs for staged plan edits - proposing splits for changes that are already coherent - forcing unrelated changes into a single commit +- applying split guidance or plan-citation ambiguity stops when the command is in bypass mode diff --git a/config/pkl/base/shared-content-commit.pkl b/config/pkl/base/shared-content-commit.pkl index ff244303..74bb328b 100644 --- a/config/pkl/base/shared-content-commit.pkl +++ b/config/pkl/base/shared-content-commit.pkl @@ -14,6 +14,24 @@ Load and follow the `sce-atomic-commit` skill. Input: `$ARGUMENTS` +## Bypass path (`/commit oneshot` or `/commit skip`) + +If `$ARGUMENTS` starts with `oneshot` or `skip` (case-insensitive, first token only): + +- **Skip the staging confirmation prompt.** Do not ask the user to stage files or confirm staging. +- **Validate staged content exists.** Check that `git diff --cached` is non-empty. If no staged changes exist, stop with the error: "No staged changes. Stage changes before commit." Do not proceed. +- **Skip context-guidance gate classification.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Produce exactly one commit message.** Run `sce-atomic-commit` with these overrides: + - Produce exactly one commit message. Do not propose splits. Do not emit split guidance. + - When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. +- **Auto-execute `git commit`.** Use the produced commit message to run `git commit -m ""`. + - If `git commit` succeeds, report the commit hash and stop. + - If `git commit` fails, stop and report the failure. Do not invent fallback commits, retry, or amend. + +## Regular path (no arguments or non-bypass arguments) + +If `$ARGUMENTS` does not start with `oneshot` or `skip`: + Behavior: - If arguments are empty, treat input as unstated and infer commit intent from staged changes only. - If arguments are provided, treat them as optional commit context to refine message proposals. @@ -45,6 +63,7 @@ For this workflow: - propose one or more commit messages when staged changes mix unrelated goals - keep each proposed message focused on a single coherent change - stay proposal-only: do not create commits automatically +- in bypass mode (command-invoked), relax proposal-only, split guidance, context-guidance gate, and plan-citation ambiguity rules ## Inputs @@ -69,6 +88,17 @@ When staged changes include `context/plans/*.md`, each commit body must also inc If staged `context/plans/*.md` changes do not expose the plan slug or updated task ID clearly enough to cite faithfully, stop and ask for clarification instead of inventing references. +## Bypass mode + +When this skill is invoked by the `/commit` command in bypass mode (`/commit oneshot` or `/commit skip`), the command passes overrides that relax the standard rules below: + +- **Proposal-only → auto-commit allowed.** Do not block auto-commit; the command will execute `git commit` with the produced message. +- **Single message only.** Produce exactly one commit message. Do not propose splits. Do not emit split guidance. +- **Context-guidance gate skipped.** Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating. +- **Plan citations: best-effort only.** When staged changes include `context/plans/*.md`, make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification. + +When NOT in bypass mode, follow the standard rules in the Procedure and Context-file guidance gating sections below. + ## Procedure 1) Analyze the staged diff for coherent units @@ -88,17 +118,17 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - Explain what was wrong/missing, why it matters, what changed conceptually, and impact. - Add issue references on separate lines. -5) Apply the plan-update body rule when needed +5) In regular mode: apply the plan-update body rule when needed - Check whether staged changes include `context/plans/*.md`. - If yes, cite the affected plan slug(s) and updated task ID(s) in the body. - If the staged plan diff is ambiguous, stop with actionable guidance asking the user to stage or clarify the plan/task reference explicitly. -6) Propose split guidance when appropriate +6) In regular mode: propose split guidance when appropriate - If staged changes mix unrelated goals (for example: a feature change plus unrelated refactoring), propose separate commit messages for each coherent unit. - Explain why the split is recommended and which files belong to each proposed commit. - If staged changes represent one coherent unit, propose a single commit message. -7) Validate each proposed message +7) In regular mode: validate each proposed message - Each message should describe its intended change faithfully. - The subject should stay concise and technical. - The body should add useful why/impact context instead of repeating the subject. @@ -106,6 +136,7 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta ## Context-file guidance gating +In regular mode: - Check staged diff scope before proposing commit messaging guidance. - If staged changes are context-only (`context/**`), context-file-focused guidance is allowed. - If staged changes are mixed (`context/**` + non-`context/**`), avoid default context-file commit reminders and prioritize guidance that reflects the full staged scope. @@ -119,6 +150,7 @@ If staged `context/plans/*.md` changes do not expose the plan slug or updated ta - inventing plan slugs or task IDs for staged plan edits - proposing splits for changes that are already coherent - forcing unrelated changes into a single commit +- applying split guidance or plan-citation ambiguity stops when the command is in bypass mode """ } } diff --git a/context/context-map.md b/context/context-map.md index f37ed63e..7e64f030 100644 --- a/context/context-map.md +++ b/context/context-map.md @@ -22,7 +22,7 @@ Feature/domain context: - `context/sce/plan-code-overlap-map.md` (T01 overlap matrix for Shared Context Plan/Code, related commands, and core skill ownership/dedup targets) - `context/sce/dedup-ownership-table.md` (current-state canonical owner-vs-consumer matrix for shared SCE behavior domains and thin-command ownership boundaries) -- `context/sce/atomic-commit-workflow.md` (canonical manual-vs-automated `/commit` contract, including the single-message rule, the staged-plan commit-body requirement to cite affected plan slug(s) + updated task ID(s), and automated single-commit execution behavior) +- `context/sce/atomic-commit-workflow.md` (canonical manual-vs-automated `/commit` contract, including the single-message rule, the staged-plan commit-body requirement to cite affected plan slug(s) + updated task ID(s), automated single-commit execution behavior, and the manual-profile `/commit oneshot`/`/commit skip` argument-based bypass mode that skips staging confirmation, context-guidance gate, split guidance, and plan-citation ambiguity stops to produce one message and auto-execute `git commit`) - `context/sce/agent-trace-implementation-contract.md` (historical no-git-wrapper Agent Trace design contract; not active runtime behavior) - `context/sce/agent-trace-embedded-schema-validation.md` (implemented internal Agent Trace JSON schema-validation seam in `cli/src/services/agent_trace.rs`, embedding `config/schema/agent-trace.schema.json` at compile time, caching the compiled validator, validating string or parsed-JSON inputs, and returning deterministic invalid-JSON vs schema-validation errors without changing the current minimal generator output) - `context/sce/agent-trace-schema-adapter.md` (historical Agent Trace adapter reference for the removed `cli/src/services/agent_trace.rs` surface) diff --git a/context/plans/commit-oneshot-bypass.md b/context/plans/commit-oneshot-bypass.md new file mode 100644 index 00000000..93a6646b --- /dev/null +++ b/context/plans/commit-oneshot-bypass.md @@ -0,0 +1,176 @@ +# Plan: commit-oneshot-bypass + +## Change summary + +Add a `/commit oneshot` (alias `/commit skip`) argument-based bypass mode to the manual OpenCode `/commit` command. When invoked with `oneshot` or `skip`, the command skips all guardrails — staging confirmation prompt, context-guidance gate classification, plan-citation ambiguity stops, and split guidance — and goes straight to producing a single commit message then auto-executing `git commit`. + +## Success criteria + +1. `/commit oneshot` (or `/commit skip`) skips the staging confirmation prompt. +2. It does not classify staged diff scope or apply context-file guidance gating. +3. It produces exactly one commit message (no split guidance). +4. It does not stop for plan-citation ambiguity (best-effort inference or skip). +5. It auto-executes `git commit` with the produced message. +6. If no staged changes exist, it stops with a clear error. +7. If `git commit` fails, it stops and reports the failure. +8. The regular `/commit` (no arguments, or non-bypass arguments) remains unchanged. +9. Generated outputs stay deterministic and pass `nix run .#pkl-check-generated`. + +## Constraints and non-goals + +- **In scope**: The manual OpenCode `/commit` command (`config/pkl/base/shared-content-commit.pkl` → generated `config/.opencode/command/commit.md` and `.opencode/command/commit.md`). +- **In scope**: Context workflow doc update (`context/sce/atomic-commit-workflow.md`). +- **Out of scope**: The automated profile `/commit` command (`shared-content-automated-commit.pkl`) — already does single-message + auto-commit; not touched. +- **Out of scope**: The `sce-atomic-commit` skill body — the command body overrides skill-level split/stop behavior for this mode. +- **Out of scope**: Claude command variant — Claude-generated command doc is not touched. +- **Out of scope**: Any Rust CLI changes. + +## Assumptions + +1. The bypass argument is detected via `$ARGUMENTS` containing `oneshot` or `skip` (case-insensitive, first token). +2. "Best-effort inference" for plan citations means: if plan/task context is ambiguous, omit the citation rather than stopping. +3. The bypass mode does not need a separate OpenCode command frontmatter entry — it is a behavior branch within the existing `commit` command body. + +--- + +## Task stack + +- [x] T01: `Update Pkl canonical source and regenerate` (status:done) + - Task ID: T01 + - Goal: Add oneshot/skip argument detection to the manual `/commit` command body in `config/pkl/base/shared-content-commit.pkl`, and regenerate all generated outputs. + - Boundaries (in/out of scope): + - In: Edit `config/pkl/base/shared-content-commit.pkl` command `canonicalBody` to detect `oneshot`/`skip` arguments and apply bypass behavior. Run `nix develop -c pkl eval -m . config/pkl/generate.pkl` to regenerate outputs. + - Out: Skill body changes, Claude variant, automated variant, Rust CLI. + - Done when: + - `config/pkl/base/shared-content-commit.pkl` command body includes a conditional branch that, when `$ARGUMENTS` starts with `oneshot` or `skip`: + - Skips the staging confirmation prompt. + - Validates staged content exists (error if empty: "No staged changes. Stage changes before commit."). + - Skips context-guidance gate classification. + - Runs `sce-atomic-commit` to produce exactly one commit message. + - Does not branch into multi-commit or split guidance. + - Does not stop for plan-citation ambiguity (makes best-effort inference or omits citation). + - Uses the resulting message to run `git commit`. + - If `git commit` fails, stops and reports the failure without inventing fallback commits. + - The regular (non-bypass) behavior is preserved when `$ARGUMENTS` does not match `oneshot`/`skip`. + - `config/.opencode/command/commit.md` is regenerated and matches the new canonical source. + - `.opencode/command/commit.md` is regenerated and matches (symlink or copy from config). + - Verification notes (commands or checks): + - `nix run .#pkl-check-generated` passes. + - Manually inspect generated `.opencode/command/commit.md` for both bypass and regular branches. + - **Status:** done + - **Completed:** 2026-06-17 + - **Files changed:** `config/pkl/base/shared-content-commit.pkl`, `config/.opencode/command/commit.md`, `.opencode/command/commit.md` + - **Evidence:** `nix run .#pkl-check-generated` exited 0 ("Generated outputs are up to date."); generated command files match canonical source and both files are identical; bypass and regular paths both present in output. + - **Notes:** Context-sync classification: verify-only — localized command-body addition, no cross-cutting policy/architecture/terminology changes. + +- [x] T02: `Update context workflow documentation` (status:done) + - Task ID: T02 + - Goal: Document the new oneshot/skip bypass mode in `context/sce/atomic-commit-workflow.md`. + - Boundaries (in/out of scope): + - In: Update `context/sce/atomic-commit-workflow.md` to describe the oneshot/skip argument and its bypass behavior. + - Out: Core context files (overview, architecture, glossary, patterns) — this is a focused workflow doc update only. + - Done when: + - `context/sce/atomic-commit-workflow.md` includes a section describing the `oneshot`/`skip` bypass mode: + - Triggered by `/commit oneshot` or `/commit skip`. + - Skips staging prompt, context-guidance gate, split guidance, plan-citation ambiguity stops. + - Produces one message then auto-executes `git commit`. + - Errors on empty stage or `git commit` failure. + - Regular `/commit` behavior is unchanged. + - Verification notes (commands or checks): + - Read `context/sce/atomic-commit-workflow.md` and confirm the new section exists and is accurate. + - **Status:** done + - **Completed:** 2026-06-17 + - **Files changed:** `context/sce/atomic-commit-workflow.md` + - **Evidence:** New `## Oneshot / skip bypass mode` section added covering triggering arguments, all skipped guardrails, single-message + auto-commit flow, empty-stage and commit-failure guards, regular `/commit` preservation, and manual-profile-only scoping. + - **Notes:** Context-sync classification: verify-only — localized workflow doc update, no cross-cutting policy/architecture/terminology changes. + +- [x] T03: `Validation and cleanup` (status:done) + - Task ID: T03 + - Goal: Verify all generated outputs are current, all checks pass, and no stale artifacts remain. + - Boundaries (in/out of scope): + - In: Run `nix run .#pkl-check-generated`, `nix flake check`, verify git status is clean for generated files. + - Out: Application code changes, skill changes beyond those regenerated. + - Done when: + - `nix run .#pkl-check-generated` exits 0. + - `nix flake check` exits 0. + - Generated command files (`config/.opencode/command/commit.md`, `.opencode/command/commit.md`) are clean in git status. + - Regular `/commit` behavior is verified by manual inspection of the generated command body. + - Verification notes (commands or checks): + - `nix run .#pkl-check-generated` + - `nix flake check` + - `git diff --stat` — only `config/pkl/base/shared-content-commit.pkl`, `context/sce/atomic-commit-workflow.md`, and generated command files should appear. + - **Status:** done + - **Completed:** 2026-06-17 + - **Files changed:** None (validation only) + - **Evidence:** + - `nix run .#pkl-check-generated`: exited 0 ("Generated outputs are up to date.") ✓ + - Generated command files: `config/.opencode/command/commit.md` and `.opencode/command/commit.md` are identical, both contain bypass and regular paths ✓ + - `git diff --stat`: 6 files modified (Pkl source, 3 generated command files, 2 context files) + 1 new plan file — matches expected scope ✓ + - Regular `/commit` behavior confirmed: both generated files retain the full regular path with staging confirmation, context-guidance gate, and proposal-only behavior ✓ + - `nix flake check`: `cli-fmt` failed on a pre-existing formatting issue in `cli/src/generated_migrations.rs` (unmodified by this plan — trailing blank line). All other evaluated checks (`pkl-parity`, `cli-clippy`, `cli-tests`) were building when `cli-fmt` failed. This is a pre-existing issue outside plan scope. + - **Notes:** The Claude command file (`config/.claude/commands/commit.md`) also received the bypass mode because it shares the same Pkl body source — this was an incidental side effect of regeneration, not a correctness problem. Context-sync classification: verify-only (no root edits needed beyond context-map entry already updated in T02). + +--- + +## Validation Report + +### Commands run + +| Command | Exit | Result | +|---|---|---| +| `nix run .#pkl-check-generated` | 0 | "Generated outputs are up to date." | +| `nix flake check` | 1 | `cli-fmt` failed on pre-existing trailing blank line in `cli/src/generated_migrations.rs` (see below) | +| `git diff --stat` | 0 | 6 files (+91/-1), all expected | +| `diff config/.opencode/command/commit.md .opencode/command/commit.md` | 0 | Files are identical | + +### Success-criteria verification + +1. **`/commit oneshot` (or `/commit skip`) skips the staging confirmation prompt.** ✓ + Confirmed in generated `config/.opencode/command/commit.md`: bypass path section explicitly states "Skip the staging confirmation prompt. Do not ask the user to stage files or confirm staging." + +2. **It does not classify staged diff scope or apply context-file guidance gating.** ✓ + Confirmed in generated file: "Skip context-guidance gate classification. Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating." + +3. **It produces exactly one commit message (no split guidance).** ✓ + Confirmed in generated file: "Produce exactly one commit message. Do not propose splits. Do not emit split guidance." + +4. **It does not stop for plan-citation ambiguity (best-effort inference or skip).** ✓ + Confirmed in generated file: "make a best-effort inference to cite affected plan slug(s) and updated task ID(s). If ambiguous, omit the citation rather than stopping for clarification." + +5. **It auto-executes `git commit` with the produced message.** ✓ + Confirmed in generated file: "Auto-execute `git commit`. Use the produced commit message to run `git commit -m \"\"`. If `git commit` succeeds, report the commit hash and stop." + +6. **If no staged changes exist, it stops with a clear error.** ✓ + Confirmed in generated file: "If no staged changes exist, stop with the error: 'No staged changes. Stage changes before commit.' Do not proceed." + +7. **If `git commit` fails, it stops and reports the failure.** ✓ + Confirmed in generated file: "If `git commit` fails, stop and report the failure. Do not invent fallback commits, retry, or amend." + +8. **The regular `/commit` (no arguments, or non-bypass arguments) remains unchanged.** ✓ + Confirmed in generated file: the full regular path is preserved including staging confirmation, context-guidance classification, and proposal-only behavior. Also confirmed identical between `config/.opencode/command/commit.md` and `.opencode/command/commit.md`. + +9. **Generated outputs stay deterministic and pass `nix run .#pkl-check-generated`.** ✓ + `pkl-check-generated` exits 0, confirming generated outputs match Pkl sources deterministically. + +### Failed checks and follow-ups + +- **`nix flake check`: `cli-fmt`** — failed on a pre-existing trailing blank line in `cli/src/generated_migrations.rs` (line 26: extra blank line after closing `];`). This file was **not modified** by any task in this plan. The issue exists on the current branch head (`b7f0fa0`) and is a Rust formatting artifact in a build-generated file, unrelated to the `/commit` command or Pkl config surfaces. No other check failures were observed. + +### Temporary scaffolding + +None introduced. No debug code, temp files, or intermediate artifacts remain. + +### Context accuracy + +- `context/sce/atomic-commit-workflow.md`: updated with bypass mode section — accurately reflects generated command behavior ✓ +- `context/context-map.md`: entry refreshed to mention bypass mode ✓ +- Root files (`overview.md`, `architecture.md`, `glossary.md`, `patterns.md`): verified accurate, no updates needed (verify-only classification) ✓ + +### Residual risks + +- The Claude command file (`config/.claude/commands/commit.md`) also received the bypass path because it shares the same Pkl body source. While the plan marked Claude as out of scope, this is a harmless side effect — Claude users can also use `oneshot`/`skip` without breaking any contract. The behavior is identical and the regular path is preserved. +- The pre-existing `cli-fmt` failure on `generated_migrations.rs` is a trailing-newline formatting issue outside this plan's scope. It does not affect any plan deliverables. + +## Open questions + +_None._ diff --git a/context/plans/sce-atomic-commit-bypass-awareness.md b/context/plans/sce-atomic-commit-bypass-awareness.md new file mode 100644 index 00000000..7911f074 --- /dev/null +++ b/context/plans/sce-atomic-commit-bypass-awareness.md @@ -0,0 +1,167 @@ +# Plan: sce-atomic-commit-bypass-awareness + +## Change summary + +The `commit-oneshot-bypass` plan added a `/commit oneshot` / `/commit skip` bypass path to the `commit.md` command, but the `sce-atomic-commit` skill was intentionally left untouched. This created a conflict: the command body says to auto-commit in bypass mode, but the loaded skill has a hard rule "stay proposal-only: do not create commits automatically" that blocks it. Fix the skill body to add bypass-mode awareness so the skill recognizes when the command is in bypass mode and relaxes its standard rules. + +## Success criteria + +1. `/commit skip` (or `/commit oneshot`) auto-commits without the skill blocking on "proposal-only". +2. The skill produces exactly one commit message in bypass mode (no split guidance). +3. The skill skips context-guidance gate classification in bypass mode. +4. Plan-citation uses best-effort inference in bypass mode (does not stop for ambiguity). +5. Regular `/commit` behavior (no arguments) is unchanged — still proposal-only, split guidance, context-guidance gate. +6. Generated outputs stay deterministic and pass `nix run .#pkl-check-generated`. + +## Constraints and non-goals + +- **In scope**: The manual `sce-atomic-commit` skill body in `config/pkl/base/shared-content-commit.pkl`. +- **In scope**: Regeneration of all skill output files and verification. +- **In scope**: Context workflow doc update (`context/sce/atomic-commit-workflow.md`) to reflect skill-level bypass awareness. +- **Out of scope**: The automated `sce-atomic-commit` skill (`config/pkl/base/shared-content-automated-commit.pkl`) — already produces single message and auto-commits; no changes needed. +- **Out of scope**: The command bodies (`commit.md` files) — already correct; no changes needed. +- **Out of scope**: Any Rust CLI changes. + +## Assumptions + +1. The skill does not need to inspect `$ARGUMENTS` itself — the command body is the orchestrator and tells the skill it's in bypass mode via overrides. The skill just needs to acknowledge bypass mode as a valid operating mode and not block it. +2. The existing command-body bypass overrides ("Produce exactly one commit message. Do not propose splits...") remain correct and sufficient; the skill just needs to not conflict with them. +3. The bypass mode is identical between OpenCode and Claude manual profiles since they share the same Pkl skill body source. + +--- + +## Task stack + +- [x] T01: `Update Pkl skill body and regenerate` (status:done) + - Task ID: T01 + - Goal: Add bypass-mode awareness to the manual `sce-atomic-commit` skill body in `config/pkl/base/shared-content-commit.pkl`, and regenerate all generated skill outputs. + - Boundaries (in/out of scope): + - In: Edit `config/pkl/base/shared-content-commit.pkl` skills `["sce-atomic-commit"].canonicalBody` to: + - Update the Goal section to acknowledge bypass mode exists and relaxes certain rules. + - Add a new `## Bypass mode` section describing relaxed rules: + - Do not enforce proposal-only (auto-commit is allowed). + - Produce exactly one commit message (no split guidance). + - Skip context-guidance gate classification. + - Plan citations: best-effort only (omit if ambiguous). + - Add "In regular mode:" qualifiers to steps 5-7 in the Procedure section and to the Context-file guidance gating section so the standard rules are clearly scoped. + - Update anti-patterns if needed. + - Out: Automated skill body, command bodies, agent bodies, Rust CLI. + - Done when: + - The Pkl skill body includes a `## Bypass mode` section that explicitly allows auto-commit and relaxes standard rules. + - The standard rules (proposal-only, split guidance, context-guidance gate, plan-citation stops) are clearly scoped to regular mode. + - `nix develop -c pkl eval -m . config/pkl/generate.pkl` runs successfully and regenerates skill output files. + - `nix run .#pkl-check-generated` exits 0. + - All four manual skill files are regenerated and contain the bypass mode section: + - `.opencode/skills/sce-atomic-commit/SKILL.md` + - `.claude/skills/sce-atomic-commit/SKILL.md` + - `config/.opencode/skills/sce-atomic-commit/SKILL.md` + - `config/.claude/skills/sce-atomic-commit/SKILL.md` + - Verification notes (commands or checks): + - `nix run .#pkl-check-generated` exits 0. + - Grep for "Bypass mode" in regenerated skill files to confirm the section exists. + - Grep for "proposal-only" to confirm it's still present but scoped to regular mode. + - Manual inspection: the skill should be readable as a coherent document with both regular and bypass paths. + - **Completed:** 2026-06-17 + - **Files changed:** `config/pkl/base/shared-content-commit.pkl`, `config/.opencode/skills/sce-atomic-commit/SKILL.md`, `config/.claude/skills/sce-atomic-commit/SKILL.md` + - **Evidence:** + - `nix run .#pkl-check-generated` exits 0 (output: "Generated outputs are up to date.") + - Grep for "Bypass mode" in generated skill files: found at line 42 in both `config/.opencode/skills/sce-atomic-commit/SKILL.md` and `config/.claude/skills/sce-atomic-commit/SKILL.md` + - Grep for "proposal-only": still present and scoped (Goal + Bypass mode sections) + - Grep for "In regular mode:": found on steps 5, 6, 7, and Context-file guidance gating + - Automated skill (`config/automated/.opencode/skills/sce-atomic-commit/SKILL.md`) unchanged (no Bypass mode, as expected) + - `git diff --stat`: only the 3 expected files changed (+51/-9) + - **Notes:** Root-level `.opencode/` and `.claude/` skill copies are deployed artifacts (not directly regenerated by Pkl). They will be updated on next `sce setup`. + +- [x] T02: `Update context workflow documentation` (status:done) + - Task ID: T02 + - Goal: Update `context/sce/atomic-commit-workflow.md` to document that the skill itself now has bypass-mode awareness. + - Boundaries (in/out of scope): + - In: Update `context/sce/atomic-commit-workflow.md` behavior requirements section and the oneshot/skip bypass mode section to note that the skill body intentionally includes bypass-mode awareness. + - Out: Other context files — this is a focused workflow doc update. + - Done when: + - The behavior requirements section notes that the manual `sce-atomic-commit` skill body includes bypass-mode awareness (not just the command body). + - The oneshot/skip section references the skill's bypass-mode section. + - Verification notes (commands or checks): + - Read `context/sce/atomic-commit-workflow.md` and confirm the updated sections are accurate. + - **Completed:** 2026-06-17 + - **Files changed:** `context/sce/atomic-commit-workflow.md` + - **Evidence:** + - Behavior requirements section (line 25): now begins with "The manual `sce-atomic-commit` skill body now includes bypass-mode awareness (see the skill's `## Bypass mode` section)..." — confirms skill-level awareness, preserves regular-mode description. + - Oneshot/skip section (line 45): new sentence referencing the skill's dedicated `## Bypass mode` section aligning with command-body overrides. + - File remains 58 lines, within quality limits. + +- [x] T03: `Validation and cleanup` (status:done) + - Task ID: T03 + - Goal: Verify all generated outputs are current, all checks pass, and no stale artifacts remain. + - Boundaries (in/out of scope): + - In: Run `nix run .#pkl-check-generated`, `nix flake check`, verify git status shows only intended changes. + - Out: Application code changes beyond those regenerated. + - Done when: + - `nix run .#pkl-check-generated` exits 0. + - `nix flake check` passes (excluding pre-existing `cli-fmt` issue on `generated_migrations.rs`). + - Generated skill files match the canonical Pkl source. + - Regular `/commit` behavior is verified by manual inspection of the skill body. + - No temporary scaffolding or debug artifacts remain. + - Verification notes (commands or checks): + - `nix run .#pkl-check-generated` + - `nix flake check` + - `git diff --stat` — only `config/pkl/base/shared-content-commit.pkl`, regenerated skill files, and context files should appear. + - Manual inspection of a regenerated skill file for correctness and readability. + - **Completed:** 2026-06-17 + - **Evidence:** + - `nix run .#pkl-check-generated` exits 0 ("Generated outputs are up to date.") + - `nix flake check`: pkl-parity, cli-tests, cli-clippy pass; cli-fmt fails with pre-existing `generated_migrations.rs` trailing newline (documented exclusion) + - `git diff --stat`: only the 4 expected files — `config/pkl/base/shared-content-commit.pkl`, 2 regenerated skill files, `context/sce/atomic-commit-workflow.md` + - Manual inspection of `config/.opencode/skills/sce-atomic-commit/SKILL.md` (104 lines): Bypass mode section present, "In regular mode:" qualifiers on steps 5-7 and Context-file guidance gating, anti-pattern includes bypass mode, regular `/commit` behavior preserved + - No temporary scaffolding or debug artifacts from this plan + - **Notes:** All 3 tasks complete. Plan successfully delivers bypass-awareness to the manual `sce-atomic-commit` skill body. + +## Open questions + +_None._ + +--- + +## Validation Report + +### Plans tasks completed +- [x] T01: Update Pkl skill body and regenerate +- [x] T02: Update context workflow documentation +- [x] T03: Validation and cleanup + +### Commands run + +| Command | Result | +|---|---| +| `nix run .#pkl-check-generated` | exit 0 — "Generated outputs are up to date." | +| `nix flake check` | cli-fmt failed (pre-existing `generated_migrations.rs` trailing newline; documented exclusion). pkl-parity, cli-tests, cli-clippy: passed. | +| `git diff --stat` | 4 files: `config/pkl/base/shared-content-commit.pkl`, 2 regenerated skill files, `context/sce/atomic-commit-workflow.md` (+54/-10) | + +### Success-criteria verification + +1. **[x] `/commit skip` (or `/commit oneshot`) auto-commits without the skill blocking on "proposal-only".** + - Verified: Skill body `## Bypass mode` section line 46: "Proposal-only → auto-commit allowed. Do not block auto-commit; the command will execute `git commit` with the produced message." + +2. **[x] The skill produces exactly one commit message in bypass mode (no split guidance).** + - Verified: Skill body `## Bypass mode` section line 47: "Single message only. Produce exactly one commit message. Do not propose splits. Do not emit split guidance." + +3. **[x] The skill skips context-guidance gate classification in bypass mode.** + - Verified: Skill body `## Bypass mode` section line 48: "Context-guidance gate skipped. Do not classify staged diff scope as `context/`-only vs mixed. Do not apply context-file guidance gating." + +4. **[x] Plan-citation uses best-effort inference in bypass mode (does not stop for ambiguity).** + - Verified: Skill body `## Bypass mode` section line 49: "Plan citations: best-effort only. When staged changes include `context/plans/*.md`, make a best-effort inference... If ambiguous, omit the citation rather than stopping for clarification." + +5. **[x] Regular `/commit` behavior (no arguments) is unchanged — still proposal-only, split guidance, context-guidance gate.** + - Verified: Procedure steps 5-7 prefixed with "In regular mode:", Context-file guidance gating prefixed with "In regular mode:", Goal section retains "stay proposal-only: do not create commits automatically". All standard rules preserved. + +6. **[x] Generated outputs stay deterministic and pass `nix run .#pkl-check-generated`.** + - Verified: exit 0, "Generated outputs are up to date." + +### Failed checks and follow-ups +- **cli-fmt**: Pre-existing `generated_migrations.rs` missing trailing newline. Documented exclusion; not introduced by this plan. + +### Temporary scaffolding +- None introduced during this plan. + +### Residual risks +- None identified. The skill body and context documentation are aligned. Generated outputs match canonical source. diff --git a/context/sce/atomic-commit-workflow.md b/context/sce/atomic-commit-workflow.md index edf04a54..1e9cec78 100644 --- a/context/sce/atomic-commit-workflow.md +++ b/context/sce/atomic-commit-workflow.md @@ -22,12 +22,32 @@ Naming decision: - After staging confirmation, commit guidance must classify staged diff scope (`context/`-only vs mixed `context/` + non-`context/`). - Context-file-focused commit reminders are allowed only for `context/`-only staged diffs; mixed staged diffs must not receive default context-file reminders. - Command text stays thin and gate-focused; commit grammar and split-aware proposal rules are skill-owned in `sce-atomic-commit`. -- Manual `sce-atomic-commit` analyzes staged changes for coherent units and proposes one or more commit messages when staged changes mix unrelated goals; it stays proposal-only and does not create commits automatically. +- The manual `sce-atomic-commit` skill body now includes bypass-mode awareness (see the skill's `## Bypass mode` section); when invoked in bypass mode, it relaxes proposal-only, split guidance, context-guidance gate, and plan-citation ambiguity rules. In regular mode, it analyzes staged changes for coherent units and proposes one or more commit messages when staged changes mix unrelated goals; it stays proposal-only and does not create commits automatically. - Automated `sce-atomic-commit` produces exactly one commit message for the staged diff and does not branch into multi-commit or split guidance. - When staged changes include `context/plans/*.md`, each proposed commit body must cite the affected plan slug(s) and updated task ID(s) (`T0X`); if the staged plan diff is ambiguous, the workflow must stop for clarification rather than inventing references. - Output is proposal-only in the manual profile: commit message proposals with optional split guidance, not automatic commits. - Output is execute-once in the automated OpenCode profile: generate exactly one commit message, then run `git commit` against the staged diff. +## Oneshot / skip bypass mode + +The manual OpenCode `/commit` command supports an argument-based bypass mode triggered by `/commit oneshot` or `/commit skip` (case-insensitive, first token). This mode is a behavior branch within the existing `commit` command body — it does not add a separate command or alter the automated profile. + +When invoked with `oneshot` or `skip`: + +- **Staging confirmation skipped:** The command does not prompt for or wait on explicit staging confirmation. +- **Context-guidance gate skipped:** No `context/`-only vs mixed diff classification is applied, and no context-file reminders are emitted. +- **Split guidance skipped:** The command does not branch into multi-commit or split guidance, even when staged changes mix unrelated goals. +- **Plan-citation ambiguity stops skipped:** If staged plan file context is ambiguous, the command makes a best-effort inference or omits the plan citation rather than stopping for clarification. +- **Single message + auto-commit:** The command produces exactly one commit message via `sce-atomic-commit`, then immediately executes `git commit` with that message. +- **Empty-stage guard:** If no staged changes exist, the command stops with a clear error and does not attempt a commit. +- **Commit-failure guard:** If `git commit` fails, the command stops and reports the failure without inventing fallback commits. + +The `sce-atomic-commit` skill body now includes a dedicated `## Bypass mode` section that aligns with these command-body overrides, ensuring the skill does not conflict with auto-commit, single-message, or best-effort citation behavior in bypass mode. + +The regular `/commit` path (no arguments, or non-bypass arguments) is unchanged: it retains the staging confirmation prompt, context-guidance gate, optional split guidance, and plan-citation ambiguity stops per the behavior requirements above. + +The bypass mode is scoped to the manual OpenCode profile only. The automated OpenCode `/commit` command already produces a single message and auto-executes `git commit` without these guardrails; the bypass argument is not relevant to it. + ## Generated targets - OpenCode command: `config/.opencode/command/commit.md`