feat(workflows): auto-copy learnings to global store at phase completion (#1828)

* feat(workflows): add auto-copy learnings to global store at phase completion

* fix(workflows): address review feedback for learnings auto-copy

- Replace shell-interpolated ${phase_dir} with agent context instruction
- Remove unquoted glob pattern in bash snippet
- Use gsd-tools learnings copy instead of manual file detection
- Document features.* dynamic namespace in config.cjs

* docs(config): add features.* namespace to CONFIGURATION.md schema
This commit is contained in:
Rezolv
2026-04-05 19:33:43 -04:00
committed by GitHub
parent e107b4e225
commit 12cdf6090c
3 changed files with 50 additions and 0 deletions

View File

@@ -222,6 +222,29 @@ node gsd-tools.cjs config-set agent_skills.gsd-executor '["skills/my-skill"]'
---
## Feature Flags
Toggle optional capabilities via the `features.*` config namespace. Feature flags default to `false` (disabled) — enabling a flag opts into new behavior without affecting existing workflows.
| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| `features.thinking_partner` | boolean | `false` | Enable thinking partner analysis at workflow decision points |
| `features.global_learnings` | boolean | `false` | Enable cross-project learnings pipeline (auto-copy at phase completion, planner injection) |
### Usage
```bash
# Enable a feature
node gsd-tools.cjs config-set features.global_learnings true
# Disable a feature
node gsd-tools.cjs config-set features.thinking_partner false
```
The `features.*` namespace is a dynamic key pattern — new feature flags can be added without modifying `VALID_CONFIG_KEYS`. Any key matching `features.<name>` is accepted by the config system.
---
## Parallelization Settings
| Setting | Type | Default | Description |

View File

@@ -43,6 +43,10 @@ function isValidConfigKey(keyPath) {
if (VALID_CONFIG_KEYS.has(keyPath)) return true;
// Allow agent_skills.<agent-type> with any agent type string
if (/^agent_skills\.[a-zA-Z0-9_-]+$/.test(keyPath)) return true;
// Allow features.<feature_name> — dynamic namespace for feature flags.
// Intentionally open-ended so new flags (e.g., features.global_learnings) work
// without updating VALID_CONFIG_KEYS each time.
if (/^features\.[a-zA-Z0-9_]+$/.test(keyPath)) return true;
return false;
}

View File

@@ -1080,6 +1080,29 @@ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs(phase-{X}): co
```
</step>
<step name="auto_copy_learnings">
**Auto-copy phase learnings to global store (when enabled).**
This step runs AFTER phase completion and SUMMARY.md is written. It copies any LEARNINGS.md
entries from the completed phase to the global learnings store at `~/.gsd/knowledge/`.
**Check config gate:**
```bash
GL_ENABLED=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get features.global_learnings --raw 2>/dev/null || echo "false")
```
**If `GL_ENABLED` is not `true`:** Skip this step entirely (feature disabled by default).
**If enabled:**
1. Check if LEARNINGS.md exists in the phase directory (use the `phase_dir` value from init context)
2. If found, copy to global store:
```bash
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" learnings copy 2>/dev/null || echo "⚠ Learnings copy failed — continuing"
```
Copy failure must NOT block phase completion.
</step>
<step name="update_project_md">
**Evolve PROJECT.md to reflect phase completion (prevents planning document drift — #956):**