Configuration System for Defaults (No-Prompt Execution)
Overview
Add a repository-level configuration system (.superpowers-config.json) that stores default preferences, eliminating repetitive prompts for workflow decisions that should only be asked once per repository.
Core principle: One-time configuration + subagent-based reading = consistent defaults without context pollution.
Store specs as issues. No local file storage.
Problem Statement
Currently, two skills prompt the user on every invocation:
- writing-plans - Asks which execution method to use (subagent vs inline) after writing each plan
- using-git-worktrees - Asks where to create worktrees (project-local vs global) when setting up worktrees
These are repository-level preferences that should be configured once, not prompted repeatedly. Additionally, a third setting (workflowMode) is needed for future git workflow configuration.
Goals
- Eliminate repetitive prompts - Ask once, save preference, never ask again for that repository
- Scale without context pollution - As config grows, skills only receive values they need, not full config
- Team consistency - Configuration is version controlled, shared across team
- Extensibility - Design allows future settings to be added easily
Architecture
Components
.superpowers-config.json - Repository-level configuration file (version controlled, committed to repo)
skills/shared/config-reader.md - Shared module that skills invoke via subagent
- Skill integration - Skills dispatch config-reader subagents to read config, receiving minimal context
Flow
Skill needs config value
↓
Dispatch subagent with config-reader module
↓
Subagent checks for .superpowers-config.json
↓
If missing: Prompt user → create file → return value
If exists: Read file → extract requested values → return value
↓
Skill continues with minimal context (just the values it needs)
Configuration Schema
{
"defaultExecutionMethod": "subagent" | "inline",
"defaultWorktreeLocation": "project-local" | "global",
"workflowMode": "placeholder"
}
Field Definitions
defaultExecutionMethod (required)
- Values:
"subagent" | "inline"
- Controls: writing-plans execution handoff section
- Behavior:
"subagent" - Use subagent-driven-development skill (no prompt)
"inline" - Use executing-plans skill (no prompt)
- Default (if missing):
"subagent"
defaultWorktreeLocation (required)
- Values:
"project-local" | "global"
- Controls: using-git-worktrees directory selection section
- Behavior:
"project-local" - Use .worktrees/ directory (verify it's gitignored)
"global" - Use ~/.config/superpowers/worktrees/<project-name>/
- Default (if missing):
"project-local"
workflowMode (required, placeholder)
- Values: Currently
"placeholder" only
- Purpose: Reserved for future git workflow settings (develop/main branching, deployment targets, review requirements, etc.)
- Note: "Will be implemented in future session" - no user prompt for this field
Schema Validation Rules
- All three fields must be present
defaultExecutionMethod must be "subagent" or "inline"
defaultWorktreeLocation must be "project-local" or "global"
workflowMode must be "placeholder" (future: additional enum values)
- Invalid values → Error message, skill stops execution
Config-Reader Module
Location: skills/shared/config-reader.md
Purpose
Subagent module that handles all configuration operations. Skills dispatch this module via the Task tool with subagent_type: "general", receiving minimal structured data in return.
Responsibilities
- Check if
.superpowers-config.json exists
- If missing: Run first-run prompt sequence (one question at a time)
- If exists: Read and validate file
- Extract only requested values (apply defaults for missing optional fields)
- Return minimal context to calling skill
Interface
Calling skill dispatches:
[Task tool invocation]
subagent_type: "general"
description: "Read config for execution method"
prompt: "Use skills/shared/config-reader to get config values: defaultExecutionMethod, defaultWorktreeLocation"
Config-reader subagent returns:
{
"defaultExecutionMethod": "subagent",
"defaultWorktreeLocation": "project-local"
}
Critical: Subagent returns only the requested values, not the full config file, not file paths, not extra context.
Module Structure
File: skills/shared/config-reader.md
Sections:
- Purpose & Interface - What it does, how skills invoke it
- Config Schema - Full JSON schema with field descriptions
- First-Run Sequence - Prompt flow when config is missing
- Read Operations - How to extract and return requested values
- Validation - Schema validation, applying defaults
- Error Handling - Malformed config, missing fields, invalid values
Module Design Principle
- Invoked via Task tool with
subagent_type: "general"
- Returns structured data (JSON object), not prose
- Never returns the full config file contents
- Only returns what the calling skill explicitly requested
- Single responsibility: configuration reading and first-run setup
First-Run Prompt Sequence
When: .superpowers-config.json doesn't exist
Trigger: Any skill needing config dispatches config-reader subagent
Sequence:
1. Subagent checks for .superpowers-config.json
↓ Not found
2. Subagent prompts:
"Superpowers needs to configure default settings for this repository.
Which execution method should be used for plan implementation?
1. Subagent-driven (recommended) - Fresh subagent per task with two-stage review
2. Inline execution - Execute tasks in current session
Which approach?"
↓ User selects
3. Subagent prompts:
"Where should git worktrees be created by default?
1. .worktrees/ (project-local, hidden, version controlled gitignore)
2. ~/.config/superpowers/worktrees/<project-name>/ (global, outside project)
Which location?"
↓ User selects
4. Subagent creates .superpowers-config.json with:
{
"defaultExecutionMethod": "<user-choice>",
"defaultWorktreeLocation": "<user-choice>",
"workflowMode": "placeholder"
}
5. Subagent creates git commit:
git add .superpowers-config.json
git commit -m "Add superpowers config with default settings"
6. Subagent returns the requested values to calling skill
One commit: Config file is created with all three initial values in a single commit.
Note: workflowMode does NOT get a prompt - saved as "placeholder" automatically, no user interaction for this field.
Skill Integration
writing-plans Integration
Current behavior (lines 180-186):
- After creating plan issue, offer execution choice with two options
- Wait for user response
- Proceed to chosen skill
New behavior:
After creating the plan issue:
1. Use Task tool to dispatch config-reader subagent
Prompt: "Use skills/shared/config-reader to get config value: defaultExecutionMethod"
2. Config-reader subagent:
- Checks for .superpowers-config.json
- If missing: Runs first-run sequence, returns user's choice
- If exists: Reads file, validates, returns value
3. Receive response: { "defaultExecutionMethod": "subagent" } or { "defaultExecutionMethod": "inline" }
4. Proceed without prompting:
- If "subagent": Invoke subagent-driven-development skill
- If "inline": Invoke executing-plans skill
5. Continue with chosen execution approach
Removed: The "Which approach?" question and user prompt.
using-git-worktrees Integration
Current behavior (lines 20-48):
- Check for existing worktree directories (.worktrees or worktrees)
- Check CLAUDE.md for preference
- If no existing directory and no CLAUDE.md preference, ask user
- Proceed with chosen location
New behavior:
Before worktree creation:
1. Use Task tool to dispatch config-reader subagent
Prompt: "Use skills/shared/config-reader to get config value: defaultWorktreeLocation"
2. Config-reader subagent:
- Checks for .superpowers-config.json
- If missing: Runs first-run sequence, returns user's choice
- If exists: Reads file, validates, returns value
3. Receive response: { "defaultWorktreeLocation": "project-local" } or { "defaultWorktreeLocation": "global" }
4. Proceed without prompting:
- If "project-local": Use .worktrees/ (verify it's gitignored)
- If "global": Use ~/.config/superpowers/worktrees/<project-name>/
5. Continue with worktree creation
Removed: The directory priority check for CLAUDE.md and the "Where should I create worktrees?" question.
Kept: Safety verification - for project-local, still verify .worktrees/ is ignored in .gitignore.
Other Skills
Future skills that need configuration will use the same pattern:
- Dispatch config-reader subagent via Task tool
- Specify which values they need
- Receive minimal context
- Proceed without prompting
Error Handling & Edge Cases
Scenario 1: Malformed JSON
Situation: Config file exists but has syntax errors (JSON.parse fails)
Response:
Configuration file has syntax errors.
File: .superpowers-config.json
Error: [line number, unexpected token, etc.]
Fix the invalid JSON and try again.
Behavior: Calling skill stops execution. User must manually fix the config file.
Scenario 2: Missing Required Field
Situation: Config exists but missing defaultExecutionMethod
Response: Config-reader applies schema default ("subagent"), includes warning in returned data:
{
"defaultExecutionMethod": "subagent",
"warning": "Config missing field [defaultExecutionMethod], using default: subagent"
}
Behavior: Calling skill continues with default value. Warning logged but doesn't block execution.
Scenario 3: Invalid Enum Value
Situation: defaultExecutionMethod is "parallel" (not valid option)
Response:
Invalid configuration value.
Field: defaultExecutionMethod
Value: "parallel"
Valid values: "subagent" or "inline"
Fix the configuration and try again.
Behavior: Calling skill stops execution. User must manually fix the config file.
Scenario 4: Config File Not in Git
Situation: First-run creates .superpowers-config.json, git shows it as untracked
Behavior:
- Config-reader commits the file during first-run setup
- If user removes it from git after commit, that's their choice
- Git operations remain separate concern - config-reader doesn't force-add later
Scenario 5: First-Run Interrupted
Situation: User starts first-run prompt, answers question 1, then ends session before completing
Behavior:
- Config file doesn't exist (wasn't created)
- Next session: Config-reader detects missing config
- Restarts first-run sequence from beginning (not resume from where stopped)
- Answers from previous session are not saved
Rationale: Simpler implementation. Resumable first-run would require partial state tracking.
File Changes
New Files to Create
skills/shared/config-reader.md
- Purpose: Subagent module for configuration reading and first-run setup
- Sections: Purpose, Schema, First-Run, Read Ops, Validation, Error Handling
Files to Modify
skills/writing-plans/SKILL.md
- Lines 180-186 (Execution Handoff section): Replace prompt-based choice with config-reader subagent dispatch
- Add integration note: "Uses superpowers:config-reader for execution method default"
skills/using-git-worktrees/SKILL.md
- Lines 20-48 (Directory Selection Process section): Replace priority check + prompt with config-reader subagent dispatch
- Remove CLAUDE.md check (superceded by config file)
- Keep safety verification (gitignore check for project-local)
- Add integration note: "Uses superpowers:config-reader for worktree location default"
Testing Strategy
Unit Testing
Config-reader module tests:
- First-run sequence creates valid config file
- First-run prompts appear in correct order (one at a time)
- Config file is committed to git
- Missing config triggers first-run, not error
- Valid config returns requested values
- Missing field uses default value
- Invalid enum value returns error
- Malformed JSON returns error with details
Integration Testing
writing-plans integration:
- Config exists with "subagent" → Invokes subagent-driven-development without prompt
- Config exists with "inline" → Invokes executing-plans without prompt
- Config missing → First-run prompts appear, then correct skill invoked
- Malformed config → Skill stops with error, doesn't proceed
using-git-worktrees integration:
- Config exists with "project-local" → Uses .worktrees/ without prompt
- Config exists with "global" → Uses global directory without prompt
- Config missing → First-run prompts appear, then correct location used
- project-local still verifies .gitignore
End-to-End Scenarios
Scenario A: Fresh repository, first run
- User invokes writing-plans or using-git-worktrees
- Config missing → First-run sequence starts
- User answers prompts
- Config file created and committed
- Skill proceeds with chosen defaults
- Later calls use config, no prompts
Scenario B: Existing repository with config
- User invokes writing-plans or using-git-worktrees
- Config exists → Config-reader reads and validates
- Values returned to calling skill
- Skill proceeds without prompts
- Fast execution, no repeated questions
Scenario C: Team member clones repo with existing config
- Config is committed to repo
- Team member pulls → config already exists
- No first-run prompts for them
- They use team's shared defaults
Security Considerations
Config File Content
Risks: Config file could contain:
- Unexpected fields from manual editing
- Malicious JSON (excessive nesting, large strings)
Mitigations:
- Config-reader validates schema strictly
- Rejects unknown fields
- Limits nesting depth (2 levels max)
- Limits file size (1KB max)
Path Injection
Risks: defaultWorktreeLocation could contain path traversal (../)
Mitigations:
- Config-reader validates enum values
- Only "project-local" and "global" allowed
- Paths are constructed by skill, not from config
Subagent Trust
Risks: Config-reader subagent could return unexpected data
Mitigations:
- Calling skill validates response structure
- Missing required keys → Error
- Unexpected keys → Ignored
Migration Path
Existing Repositories
Migration is automatic: On first invocation of writing-plans or using-git-worktrees after upgrade:
- Config missing → First-run sequence triggers
- User sets preferences once
- Config file created
- Future invocations use config
No manual migration required. CLAUDE.md preferences are no longer checked (superseded by config file).
Breaking Changes
Removed behaviors:
- writing-plans no longer prompts for execution method
- using-git-worktrees no longer checks CLAUDE.md for preferences
- using-git-worktrees no longer prompts for worktree location
If users relied on CLAUDE.md: They must create .superpowers-config.json manually or let first-run create it.
If users want different behavior: They must edit .superpowers-config.json directly.
Future Extensions
Adding New Settings
Process:
- Add field to config schema with default value
- Update config-reader validation
- Update skills that need the new setting
- Document in schema section
Example: Adding preferredModel for subagent dispatch
{
"defaultExecutionMethod": "subagent",
"defaultWorktreeLocation": "project-local",
"workflowMode": "placeholder",
"preferredModel": "auto"
}
- Config-reader reads, validates, returns to requesting skill
- Skill uses value for subagent model selection
- No first-run prompt (field has default)
- Users can manually edit if needed
Workflow Mode Implementation
When workflowMode is implemented in future session:
- Add enum values to schema:
"placeholder" | "gitflow" | "trunk" | etc.
- Replace
"placeholder" default with "gitflow" (or appropriate default)
- Add prompt to first-run sequence (between executionMethod and worktreeLocation)
- Update relevant skills to use workflowMode value
- Document workflow behaviors in schema
Team Overrides
Future consideration: Allow .superpowers-config.local.json for developer-specific overrides (not committed to repo)
- Would be gitignored
- Merged with base config
- Useful for individual preference (e.g., preferred editor)
Not in initial implementation. Can be added later if needed.
Success Criteria
- No repetitive prompts - writing-plans and using-git-worktrees never prompt for preferences more than once per repository
- Fast execution - Config lookup via subagent is fast, doesn't block skill execution
- Team consistency - Committed config file ensures all team members use same defaults
- Extensibility - New settings can be added without touching core skill logic
- Clean separation - Config-reader module handles all config operations, skills stay focused
- Error resilience - Invalid configs produce clear errors, don't crash skills
- First-run UX - Clear prompts, one question at a time, automatic commit
Configuration System for Defaults (No-Prompt Execution)
Overview
Add a repository-level configuration system (
.superpowers-config.json) that stores default preferences, eliminating repetitive prompts for workflow decisions that should only be asked once per repository.Core principle: One-time configuration + subagent-based reading = consistent defaults without context pollution.
Store specs as issues. No local file storage.
Problem Statement
Currently, two skills prompt the user on every invocation:
These are repository-level preferences that should be configured once, not prompted repeatedly. Additionally, a third setting (
workflowMode) is needed for future git workflow configuration.Goals
Architecture
Components
.superpowers-config.json- Repository-level configuration file (version controlled, committed to repo)skills/shared/config-reader.md- Shared module that skills invoke via subagentFlow
Configuration Schema
{ "defaultExecutionMethod": "subagent" | "inline", "defaultWorktreeLocation": "project-local" | "global", "workflowMode": "placeholder" }Field Definitions
defaultExecutionMethod(required)"subagent"|"inline""subagent"- Use subagent-driven-development skill (no prompt)"inline"- Use executing-plans skill (no prompt)"subagent"defaultWorktreeLocation(required)"project-local"|"global""project-local"- Use.worktrees/directory (verify it's gitignored)"global"- Use~/.config/superpowers/worktrees/<project-name>/"project-local"workflowMode(required, placeholder)"placeholder"onlySchema Validation Rules
defaultExecutionMethodmust be"subagent"or"inline"defaultWorktreeLocationmust be"project-local"or"global"workflowModemust be"placeholder"(future: additional enum values)Config-Reader Module
Location:
skills/shared/config-reader.mdPurpose
Subagent module that handles all configuration operations. Skills dispatch this module via the Task tool with
subagent_type: "general", receiving minimal structured data in return.Responsibilities
.superpowers-config.jsonexistsInterface
Calling skill dispatches:
Config-reader subagent returns:
{ "defaultExecutionMethod": "subagent", "defaultWorktreeLocation": "project-local" }Critical: Subagent returns only the requested values, not the full config file, not file paths, not extra context.
Module Structure
File:
skills/shared/config-reader.mdSections:
Module Design Principle
subagent_type: "general"First-Run Prompt Sequence
When:
.superpowers-config.jsondoesn't existTrigger: Any skill needing config dispatches config-reader subagent
Sequence:
One commit: Config file is created with all three initial values in a single commit.
Note:
workflowModedoes NOT get a prompt - saved as"placeholder"automatically, no user interaction for this field.Skill Integration
writing-plans Integration
Current behavior (lines 180-186):
New behavior:
Removed: The "Which approach?" question and user prompt.
using-git-worktrees Integration
Current behavior (lines 20-48):
New behavior:
Removed: The directory priority check for CLAUDE.md and the "Where should I create worktrees?" question.
Kept: Safety verification - for project-local, still verify
.worktrees/is ignored in.gitignore.Other Skills
Future skills that need configuration will use the same pattern:
Error Handling & Edge Cases
Scenario 1: Malformed JSON
Situation: Config file exists but has syntax errors (JSON.parse fails)
Response:
Behavior: Calling skill stops execution. User must manually fix the config file.
Scenario 2: Missing Required Field
Situation: Config exists but missing
defaultExecutionMethodResponse: Config-reader applies schema default (
"subagent"), includes warning in returned data:{ "defaultExecutionMethod": "subagent", "warning": "Config missing field [defaultExecutionMethod], using default: subagent" }Behavior: Calling skill continues with default value. Warning logged but doesn't block execution.
Scenario 3: Invalid Enum Value
Situation:
defaultExecutionMethodis"parallel"(not valid option)Response:
Behavior: Calling skill stops execution. User must manually fix the config file.
Scenario 4: Config File Not in Git
Situation: First-run creates
.superpowers-config.json, git shows it as untrackedBehavior:
Scenario 5: First-Run Interrupted
Situation: User starts first-run prompt, answers question 1, then ends session before completing
Behavior:
Rationale: Simpler implementation. Resumable first-run would require partial state tracking.
File Changes
New Files to Create
skills/shared/config-reader.mdFiles to Modify
skills/writing-plans/SKILL.mdskills/using-git-worktrees/SKILL.mdTesting Strategy
Unit Testing
Config-reader module tests:
Integration Testing
writing-plans integration:
using-git-worktrees integration:
End-to-End Scenarios
Scenario A: Fresh repository, first run
Scenario B: Existing repository with config
Scenario C: Team member clones repo with existing config
Security Considerations
Config File Content
Risks: Config file could contain:
Mitigations:
Path Injection
Risks:
defaultWorktreeLocationcould contain path traversal (../)Mitigations:
Subagent Trust
Risks: Config-reader subagent could return unexpected data
Mitigations:
Migration Path
Existing Repositories
Migration is automatic: On first invocation of writing-plans or using-git-worktrees after upgrade:
No manual migration required. CLAUDE.md preferences are no longer checked (superseded by config file).
Breaking Changes
Removed behaviors:
If users relied on CLAUDE.md: They must create
.superpowers-config.jsonmanually or let first-run create it.If users want different behavior: They must edit
.superpowers-config.jsondirectly.Future Extensions
Adding New Settings
Process:
Example: Adding
preferredModelfor subagent dispatch{ "defaultExecutionMethod": "subagent", "defaultWorktreeLocation": "project-local", "workflowMode": "placeholder", "preferredModel": "auto" }Workflow Mode Implementation
When
workflowModeis implemented in future session:"placeholder"|"gitflow"|"trunk"| etc."placeholder"default with"gitflow"(or appropriate default)Team Overrides
Future consideration: Allow
.superpowers-config.local.jsonfor developer-specific overrides (not committed to repo)Not in initial implementation. Can be added later if needed.
Success Criteria