adk-core:mode-contract
Source
plugins/adk-core/skills/mode-contract/SKILL.md
Skill Body
mode-contract — universal —auto / -i / —fix definition
Reference-only skill that documents the mode contract and ships a tiny shell helper at scripts/parse-mode.sh that other skills source to normalize flags into env vars.
When to use
- Authoring a new adk skill — read this to understand the contract.
- Debugging “which mode is active right now?” — invoke
--explainto dump the parsed mode. - The user asks “what does
--fixdo?” — point them here.
When NOT to use
- Execute work — this skill is documentation + a tiny shell helper, not an executor.
- Override the contract for one skill — overrides happen at the per-skill SKILL.md level, and must be documented as deviations.
The contract
| Flag | Default? | Meaning |
|---|---|---|
--auto |
yes | End-to-end. Skip per-phase approval gates. Still stops before destructive shared-state actions (push, post, delete, merge). |
-i / --interactive |
no | Per-phase approval gates. Show the plan, ask for approval, allow edits. Mutually exclusive with --auto. |
--fix |
no | Apply changes locally, validate, push. Only on skills where mutation is the goal. |
--auto --fix |
no | Compose: auto-apply changes AND skip per-phase approval. Still NEVER auto-merges, force-pushes, or deletes branches. |
Hard rules across all skills
--fixis only available where mutation is the skill’s purpose:review-pr,review-code-changes,review-feedback,docs-review,audit-pr. Other skills that have--fixsemantics use it for “apply suggested changes” — same rule.- Push to a remote branch is a “shared-state” action and ALWAYS asks before the first push, even under
--auto --fix. Subsequent pushes within the same session may proceed without re-asking. - Posting a comment on a PR is a shared-state action; same rule as push.
- Merging a PR is NEVER auto. Always asks.
- Deleting a branch is NEVER auto. Always asks.
- Force-pushing to
main/master/develop/ any branch in~/.config/adk/github.md.forbid_force_push_branchesis BLOCKED, even under--auto --fix. --autoand-iare mutually exclusive.--auto -iis a parse error.
Parsing helpers
Phase 1 — preflight - Verify `scripts/parse-mode.sh` exists before offering --parse output. - No MCP or connector is required for this reference-only skill.Phase 2 — explain or parse - For --explain, print the contract table. - For --parse, source the helper and print normalized env vars.scripts/parse-mode.sh exports normalized env vars after sourcing:
source "${CLAUDE_PLUGIN_ROOT}/skills/mode-contract/scripts/parse-mode.sh"parse_mode "$@"echo "$ADK_MODE" # auto | interactiveecho "$ADK_FIX" # 0 | 1The function emits an error and returns non-zero if --auto -i are both passed.
Persona
Contract documenter. Single source of truth for mode semantics across the marketplace.
See references/persona.md.
Constitution
Must do:
- Document the contract once; every other skill links here.
- Keep
parse-mode.shminimal — flag parsing only, no side effects beyond exporting env vars.
Must not do:
- Execute any user-visible work.
- Add new modes without a marketplace-wide migration plan.
- Change the contract without updating every skill’s SKILL.md.
Anti-patterns
See references/anti-patterns.md. Highlights:
- Re-defining the contract in each skill (refer here instead).
- Adding a new mode for one skill’s convenience.
- Treating
--auto --fixas license to merge.
Output
--explain: prints the contract as a markdown table.
--parse <flags>: prints the resulting env vars (debug aid).
References shipped with this skill
| File | Purpose |
|---|---|
references/persona.md |
Contract documenter |
references/contract.md |
The full contract (longer prose) |
references/parse-mode-spec.md |
What parse-mode.sh does + edge cases |
references/anti-patterns.md |
What NOT to do |
references/examples.md |
Mode combinations + behavior table |
references/modes.md |
Trivially: this skill itself supports only --auto |
references/interaction-contract.md |
Canonical interaction contract |
scripts/parse-mode.sh |
Shell helper — source from other skills |