Configuration Management
Configuration File Hierarchy
yaml
# .specify/extensions/jira/jira-config.yml (Project config)
project:
key: "MSATS"
hierarchy:
issue_type: "subtask"
defaults:
epic:
labels: ["spec-driven", "typescript"]yaml
# .specify/extensions/jira/jira-config.local.yml (Local overrides - gitignored)
project:
key: "MYTEST" # Override for local testingbash
# Environment variables (highest precedence)
export SPECKIT_JIRA_PROJECT_KEY="DEVTEST"Config Loading Function
Location: Extension command (e.g., commands/specstoissues.md)
markdown
## Load Configuration
1. Run helper script to load and merge config:
```bash
config_json=$(bash .specify/extensions/jira/scripts/parse-jira-config.sh)
echo "$config_json"
```
1. Parse JSON and use in subsequent stepsScript: .specify/extensions/jira/scripts/parse-jira-config.sh
bash
#!/usr/bin/env bash
set -euo pipefail
EXT_DIR=".specify/extensions/jira"
CONFIG_FILE="$EXT_DIR/jira-config.yml"
LOCAL_CONFIG="$EXT_DIR/jira-config.local.yml"
# Start with defaults from extension.yml
defaults=$(yq eval '.defaults' "$EXT_DIR/extension.yml" -o=json)
# Merge project config
if [ -f "$CONFIG_FILE" ]; then
project_config=$(yq eval '.' "$CONFIG_FILE" -o=json)
defaults=$(echo "$defaults $project_config" | jq -s '.[0] * .[1]')
fi
# Merge local config
if [ -f "$LOCAL_CONFIG" ]; then
local_config=$(yq eval '.' "$LOCAL_CONFIG" -o=json)
defaults=$(echo "$defaults $local_config" | jq -s '.[0] * .[1]')
fi
# Apply environment variable overrides
if [ -n "${SPECKIT_JIRA_PROJECT_KEY:-}" ]; then
defaults=$(echo "$defaults" | jq ".project.key = \"$SPECKIT_JIRA_PROJECT_KEY\"")
fi
# Output merged config as JSON
echo "$defaults"Config Validation
In command file:
markdown
## Validate Configuration
1. Load config (from previous step)
2. Validate against schema from extension.yml:
```python
import jsonschema
schema = load_yaml(".specify/extensions/jira/extension.yml")['config_schema']
config = json.loads(config_json)
try:
jsonschema.validate(config, schema)
except jsonschema.ValidationError as e:
print(f"❌ Invalid jira-config.yml: {e.message}")
print(f" Path: {'.'.join(str(p) for p in e.path)}")
exit(1)
```
1. Proceed with validated config