Add skern init --no-instructions explicit opt-out (#104) - #110
Merged
Merged
Conversation
init already never prompts when stdin is not a TTY or --json is set, but that contract was undocumented, so installers had to rely on the prompt defaulting to "no". Add --no-instructions as an explicit opt-out that writes nothing and never prompts, reject it with a validation error (exit 2) when combined with any opt-in flag, and document the non-interactive contract in --help and the docs. Closes #104 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot reads project skills from .github/skills, .claude/skills, or .agents/skills, so skern's value is a valid Copilot path and the shared cross-agent convention, not a bug. Record that with the GitHub docs citation on the Copilot page and the shared-directory section, and note the one-body-per-name limitation that #47/#101 track. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…gs silence prompts - isTerminal uses golang.org/x/term: /dev/null is a character device but not a terminal, so `skern init < /dev/null` printed the prompt. - Flag conflicts are rejected before .skern/ is created; values (not Changed state) are compared so `--instructions=false --no-instructions` is accepted. - Any instruction flag disables both prompts; `init --instructions` on a terminal no longer blocks on the tool-forming question. - isTerminalFn is injectable; new tests prove no prompt text and no stdin read under --no-instructions / any flag with a simulated terminal, and that the no-flag path really prompts. tests/manual/setup.sh passes --no-instructions. Docs/CHANGELOG state the contract precisely. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #107, which GitHub closed when its stacked base branch was deleted after #106 merged. Same branch, same commits, now rebased onto
main; review findings and fixes are in #107's thread and summarized below.Summary
Fixes #104.
--no-instructionsflag onskern init: writes nothing, never prompts, regardless of TTY state. Combining it with--instructions,--print-instructions,--target, or--tool-forming-loopis a validation error (exit 2), matching the CLI's convention for bad input.--help,docs/reference/commands.md, and the agent-setup guide: when stdin is not a TTY or--jsonis set, skern never prompts and never blocks on input — both questions resolve to "no". This was already the behavior (resolveInstructionChoicesgates onisTerminal(stdin)), so the issue's worry about a future blocking read is covered by making it a stated guarantee plus the explicit flag.Issue DoD
--no-instructionsinit --helpAlso in this PR (docs only)
Addresses claim 1 of #101: GitHub Copilot reads project skills from
.github/skills/,.claude/skills/, or.agents/skills/(GitHub docs), so skern's.agents/skills/value is valid and no path change is needed. The Copilot platform page and the shared-directory concept section now say so with the citation (mirrors what #105 put in AGENTS.md), and note the one-body-per-name limitation tracked by #47/#101. #101 stays open for claim 2.Test plan
TestInit_NoInstructions_WritesNothing(AGENTS.md present and untouched,instructions: null),TestInit_NoInstructions_TextMode,TestInit_NoInstructions_ConflictsWithOptIn(all four opt-in flags →ValidationError, nothing written)go test ./...,make lintgreenskern init --no-instructionsin a dir withAGENTS.md→ exit 0, file untouched, no prompt;--no-instructions --instructions→ exit 2🤖 Generated with Claude Code
Review (adversarial pass against #104, and #101 claim 1)
#104 DoD: flag ✅; documented non-TTY behavior — the documentation was right in spirit but the code had a real hole, now fixed (
196d7a8):isTerminalusedModeCharDevice;/dev/nullis a character device, soskern init < /dev/null(installer / cron /docker runwithout-i) still printed the prompt (EOF → "no", so it never blocked — but "never prompts" was false)golang.org/x/term(+TestIsTerminal_NonTTYInputs).skern/was created.skern/absent--instructionsto run non-interactively", but on a TTY--instructionsstill stopped to ask about the tool-forming loop--jsonalready gated prompts)isTerminalFnis injectable; new tests simulate a terminal and prove no prompt text / no stdin read under--no-instructionsand under every flag, and that the no-flag path really prompts--instructions=false --no-instructionsrejected (comparedChanged, not value)tests/manual/setup.shraninit --quiet(would hang on a TTY)--no-instructions#101 claim 1: verified against GitHub's page (project skills in
.github/skills,.claude/skills, or.agents/skills; personal in~/.copilot/skillsor~/.agents/skills) — docs statement is accurate, DoD item 1 met via "documented with rationale".