✨ Add subagent frontmatter to agent action definitions - #84
Merged
Conversation
Adopts a Claude Code subagent-style YAML frontmatter on each *_SYSTEM_PROMPT.md template so per-action tool surface, model, and reasoning effort are declarative rather than uniform. - AgentConfig gains optional fields: tools, disallowed_tools, model, effort, max_thinking_tokens, max_turns - Stdlib-only frontmatter parser (no new runtime deps); validates enum fields (model, effort) at load time with clear errors - load_agent_config splits frontmatter from body; templates without frontmatter continue to work unchanged (back-compat) - ClaudeRunner emits --model, --allowedTools, --disallowedTools, --max-turns from AgentConfig - CLI precedence (highest wins): explicit CLI > env > frontmatter > built-in default - Per-action defaults match the issue's table; permission_mode is intentionally not exposed since askcc runs unattended with --dangerously-skip-permissions (the tools allowlist is the per-action safety boundary) - Bumps version to 0.2.6
Closed
10 tasks
This was referenced May 16, 2026
Closed
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.
Closes via review: refs #80
Summary
Adopts a Claude Code subagent–style YAML frontmatter on each
*_SYSTEM_PROMPT.mdtemplate so per-action tool surface, model, and reasoning effort are declarative instead of uniform.AgentConfiggains optional fields:tools,disallowed_tools,model,effort,max_thinking_tokens,max_turnsmodel,effort) at load time with clear errorsload_agent_configsplits frontmatter from body; templates without frontmatter continue to work unchanged (back-compat)ClaudeRunnertranslatesAgentConfigfields into--model,--allowedTools,--disallowedTools,--max-turnsprepareRead, Grep, Glob, Bash(gh:*)sonnetmediumplanRead, Grep, Glob, Bash(gh:*)opushighdevelopRead, Write, Edit, Bash, Grep, Globopusmaxissue-reviewRead, Grep, Glob, Bash(gh:*)sonnetmediumpr-reviewRead, Grep, Glob, Bash(gh:*,git:*)opushighexploreRead, Grep, Glob, Bash(gh:*)sonnethighdiagnoseRead, Grep, Glob, Bash(gh:*,git:*)sonnethighfix-ciRead, Write, Edit, Bash, Grep, Globsonnethigh0.2.6Notes
permission_modeis intentionally not exposed inAgentConfigor per-action defaults. askcc runsclaudewith--dangerously-skip-permissionsso the one-shot subprocess can execute unattended; if any permission check were to trigger, the run would deadlock with no human to answer the prompt. The per-actiontoolsallowlist is the safety boundary instead.DEVELOP_AGENT_PROMPTandFIXCI_AGENT_PROMPTexplains why those write-capable agents specifically need the broadEdit/Write/Bashallowlist.dependencies = []stance preserved.Key Flows
flowchart TD A[load_agent_config action] --> B[load_template *_SYSTEM_PROMPT.md] B --> C{starts with '---'?} C -- no --> D[return AgentConfig with body as system_prompt] C -- yes --> E[parse_frontmatter] E --> F{valid model/effort?} F -- no --> G[raise ValueError with allowed values] F -- yes --> H[override AgentConfig fields] H --> I[return AgentConfig with body and frontmatter overrides]flowchart TD A[CLI arg --effort] --> B{explicit?} B -- yes --> Z[use CLI value] B -- no --> C{env ASKCC_CLAUDE_EFFORT_LEVEL set and valid?} C -- yes --> Y[use env value] C -- no --> D{frontmatter effort set?} D -- yes --> X[use frontmatter value] D -- no --> W[use DEFAULT_EFFORT_LEVEL]Verification
TestParseFrontmatter,TestLoadAgentConfigFrontmatter,TestEffortPrecedence,TestRunnerFrontmatterFlags)Test plan
load_agent_config: default templates yield frontmatter fields, no-frontmatter back-compat, user-frontmatter override, invalid frontmatter raises at load--model,--allowedTools,--disallowedTools,--max-turnsfromAgentConfig; no flags emitted when fields unset