mirror of
https://github.com/MaksTinyWorkshop/_Assistant_Lead_Tech
synced 2026-04-06 13:31:43 +02:00
feat: carcasse BMAD centralisée avec symlinks + nettoyage post-install
- Ajout de 80_bmad/base/ : carcasse BMAD centralisée (agents, workflows, skills) - bmad-init-project.sh : symlinke core/bmm/cis/tea/_config/.agents/.claude, copie _memory localement, crée _bmad-output/ - BMAD_BASE résolu via SCRIPT_DIR (compatible Mac/NUC sans chemin hardcodé) - Suppression de post-bmad-install.sh et ses templates (obsolètes avec la carcasse centralisée) - Nettoyage aliases.sh : suppression post-bmad-install et bmad-install
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
|
||||
---
|
||||
|
||||
# Capitalisation vers Lead_tech
|
||||
|
||||
Quand un apprentissage émerge (bug difficile, pattern réutilisable, anti-pattern, décision d'archi),
|
||||
l'écrire dans la zone tampon Lead_tech :
|
||||
|
||||
```
|
||||
~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md
|
||||
```
|
||||
|
||||
Sur le NUC : `/srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md`
|
||||
|
||||
Format :
|
||||
|
||||
```
|
||||
DATE — __PROJECT_NAME__
|
||||
|
||||
FILE_UPDATE_PROPOSAL
|
||||
Fichier cible : <10_backend_patterns_valides.md | 10_frontend_patterns_valides.md | 10_ux_patterns_valides.md | 10_backend_risques_et_vigilance.md | 10_frontend_risques_et_vigilance.md | 10_ux_risques_et_vigilance.md | 40_decisions_et_archi.md | 90_debug_et_postmortem.md>
|
||||
|
||||
Pourquoi :
|
||||
<raison en 1-2 phrases>
|
||||
|
||||
Proposition :
|
||||
<contenu suggéré>
|
||||
```
|
||||
|
||||
Règle : écrire dans `95_a_capitaliser.md` uniquement. Jamais directement dans les fichiers Lead_tech validés.
|
||||
@@ -1,11 +0,0 @@
|
||||
bmm-dev dev_implementation
|
||||
bmm-architect architect
|
||||
bmm-sm sm
|
||||
bmm-qa qa
|
||||
bmm-quick-flow-solo-dev dev_implementation
|
||||
bmm-analyst analyst
|
||||
bmm-pm pm
|
||||
bmm-tech-writer tech_writer
|
||||
bmm-ux-designer ux_designer
|
||||
tea-tea qa
|
||||
core-bmad-master core_bmad_master
|
||||
|
@@ -1 +0,0 @@
|
||||
When a reusable analysis pattern, requirements anti-pattern, or domain insight emerges, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <10_product_patterns_valides.md | 10_backend_patterns_valides.md | 40_decisions_et_archi.md> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1 +0,0 @@
|
||||
When a reusable pattern, difficult bug fix, anti-pattern, or architecture decision emerges during architecture or technical design, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <40_decisions_et_archi.md | 10_backend_patterns_valides.md | 10_backend_risques_et_vigilance.md> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1 +0,0 @@
|
||||
As the orchestrating agent, when any cross-cutting pattern, process improvement, recurring friction, or architectural decision emerges across the project, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <10_backend_patterns_valides.md | 10_frontend_patterns_valides.md | 10_product_patterns_valides.md | 10_ux_patterns_valides.md | 10_backend_risques_et_vigilance.md | 10_frontend_risques_et_vigilance.md | 40_decisions_et_archi.md | 90_debug_et_postmortem.md> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1 +0,0 @@
|
||||
When a reusable pattern, difficult bug fix, anti-pattern, or architecture decision emerges during implementation, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <10_backend_patterns_valides.md | 10_frontend_patterns_valides.md | 10_backend_risques_et_vigilance.md | 10_frontend_risques_et_vigilance.md | 90_debug_et_postmortem.md> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1 +0,0 @@
|
||||
When a product decision, prioritization pattern, or recurring friction is identified, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <10_product_patterns_valides.md | 40_decisions_et_archi.md> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1 +0,0 @@
|
||||
When a reusable test pattern, tricky bug, or quality anti-pattern is identified, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <target file> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1 +0,0 @@
|
||||
When a process improvement, recurring friction, or architecture decision emerges during sprint work, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <target file> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1 +0,0 @@
|
||||
When a reusable documentation pattern, writing convention, or recurring documentation friction emerges, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <10_conventions_redaction.md | 40_decisions_et_archi.md> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1 +0,0 @@
|
||||
When a reusable UX/UI pattern, interaction anti-pattern, or UX decision emerges, write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md (NUC: /srv/projects/_Assistant_Lead_Tech/95_a_capitaliser.md). Format: DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <10_ux_patterns_valides.md | 10_ux_risques_et_vigilance.md | 40_decisions_et_archi.md> / Pourquoi: <reason> / Proposition: <content>. Never write directly to Lead_tech validated files.
|
||||
@@ -1,8 +0,0 @@
|
||||
<!-- Capitalisation Lead_tech -->
|
||||
<critical>You MUST output this section — do NOT skip it silently</critical>
|
||||
<output>## 🧠 Capitalisation Lead_tech
|
||||
|
||||
Review all findings for: anti-patterns found, recurring issues, architecture decisions confirmed or invalidated during this review.
|
||||
</output>
|
||||
<action>For EACH candidate (aim for 1-3): write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md ONLY — NEVER inside the project repo. FORMAT = "DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <target> / Pourquoi: <reason> / Proposition: <content>"</action>
|
||||
<action if="nothing worth capitalizing">Output explicitly: "Rien à capitaliser pour cette review." — do NOT skip silently</action>
|
||||
@@ -1 +0,0 @@
|
||||
- [ ] Capitalisation Lead_tech outputted — proposals written to `95_a_capitaliser.md` OR explicit "Rien à capitaliser" stated
|
||||
@@ -1,6 +0,0 @@
|
||||
<!-- Story parallelization metadata -->
|
||||
<critical>Every created story must explicitly define its parallelization metadata.</critical>
|
||||
<action>Set `Parallel-safe`, `Depends-on`, and `Can-run-with` in the story header based on real technical dependencies, not optimism.</action>
|
||||
<action>If the story depends on non-merged code from another story, set `Parallel-safe: false` and fill `Depends-on` explicitly.</action>
|
||||
<action>Use `Can-run-with` only for stories that can be developed in parallel without merge or logic conflicts.</action>
|
||||
<action>If multiple stories are technically linked, keep them on the same branch until they are independently testable, reviewable, and mergeable.</action>
|
||||
@@ -1,8 +0,0 @@
|
||||
<!-- Capitalisation Lead_tech -->
|
||||
<critical>You MUST output this section — do NOT skip it silently</critical>
|
||||
<output>## 🧠 Capitalisation Lead_tech
|
||||
|
||||
Review the full implementation for: reusable patterns, difficult bug fixes, anti-patterns, architecture decisions, or subtle nuances discovered during this story.
|
||||
</output>
|
||||
<action>For EACH candidate (aim for 1-3): write a proposal to ~/AI_RULES/_Assistant_Lead_Tech/95_a_capitaliser.md ONLY — NEVER inside the project repo. FORMAT = "DATE — __PROJECT_NAME__ / FILE_UPDATE_PROPOSAL / Fichier cible: <target> / Pourquoi: <reason> / Proposition: <content>"</action>
|
||||
<action if="nothing worth capitalizing">Output explicitly: "Rien à capitaliser pour cette story." — do NOT skip silently</action>
|
||||
@@ -1 +0,0 @@
|
||||
- [ ] **Capitalisation Lead_tech:** Section "🧠 Capitalisation Lead_tech" outputted — proposals written to `95_a_capitaliser.md` OR explicit "Rien à capitaliser" stated
|
||||
@@ -1,3 +0,0 @@
|
||||
<!-- Story parallelization check -->
|
||||
<action>Before implementation, read `Parallel-safe`, `Depends-on`, and `Can-run-with` from the story file.</action>
|
||||
<action>If metadata conflicts with the actual code state or branch reality, stop and reconcile the story before coding.</action>
|
||||
@@ -1,3 +0,0 @@
|
||||
Parallel-safe: false
|
||||
Depends-on: ~
|
||||
Can-run-with: ~
|
||||
@@ -25,14 +25,5 @@ alias sync-ai='~/AI_RULES/_Assistant_Lead_Tech/scripts/sync-ai-instructions.sh 2
|
||||
# Initialiser la structure BMAD dans un projet existant
|
||||
alias bmad-init='"$LEADTECH/scripts/bmad-init-project.sh"'
|
||||
|
||||
# Post-install BMAD : injecte la capitalisation Lead_tech dans les agents du projet courant
|
||||
alias post-bmad-install='"$LEADTECH/scripts/post-bmad-install.sh"'
|
||||
|
||||
# Install BMAD + injection Lead_tech automatique
|
||||
# Remplace npx bmad-method install dans les projets Lead_tech
|
||||
bmad-install() {
|
||||
npx bmad-method install && "$LEADTECH/scripts/post-bmad-install.sh"
|
||||
}
|
||||
|
||||
# Aller dans projets
|
||||
alias projects='cd ~/Volumes/TeraSSD/Projets_Dev 2>/dev/null || cd /srv/projects'
|
||||
@@ -1,362 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# post-bmad-install.sh
|
||||
# À lancer après `npx bmad-method install` dans un projet BMAD.
|
||||
# Injecte la memory de capitalisation Lead_tech dans les agents producteurs.
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
TEMPLATES_DIR="$SCRIPT_DIR/../70_templates/bmad_post_install"
|
||||
|
||||
# Projet courant
|
||||
PROJECT_ROOT="$(pwd)"
|
||||
PROJECT_NAME="$(basename "$PROJECT_ROOT")"
|
||||
AGENTS_DIR="$PROJECT_ROOT/_bmad/_config/agents"
|
||||
CLAUDE_MD="$PROJECT_ROOT/CLAUDE.md"
|
||||
|
||||
DEV_STORY_XML="$PROJECT_ROOT/_bmad/bmm/workflows/4-implementation/dev-story/instructions.xml"
|
||||
CODE_REVIEW_XML="$PROJECT_ROOT/_bmad/bmm/workflows/4-implementation/code-review/instructions.xml"
|
||||
DEV_STORY_CHECKLIST="$PROJECT_ROOT/_bmad/bmm/workflows/4-implementation/dev-story/checklist.md"
|
||||
CODE_REVIEW_CHECKLIST="$PROJECT_ROOT/_bmad/bmm/workflows/4-implementation/code-review/checklist.md"
|
||||
STORY_TEMPLATE_MD="$PROJECT_ROOT/_bmad/bmm/workflows/4-implementation/create-story/template.md"
|
||||
CREATE_STORY_XML="$PROJECT_ROOT/_bmad/bmm/workflows/4-implementation/create-story/instructions.xml"
|
||||
|
||||
PRODUCER_AGENTS_CONFIG="$TEMPLATES_DIR/config/producer_agents.tsv"
|
||||
MEMORIES_DIR="$TEMPLATES_DIR/memories"
|
||||
WORKFLOWS_DIR="$TEMPLATES_DIR/workflows"
|
||||
CLAUDE_FRAGMENTS_DIR="$TEMPLATES_DIR/claude"
|
||||
|
||||
CAPITALIZE_MARKER="95_a_capitaliser.md"
|
||||
CAPITALIZE_MARKER_XML="Capitalisation Lead_tech"
|
||||
PARALLELIZATION_MARKER_XML="Story parallelization check"
|
||||
CREATE_STORY_PARALLELIZATION_MARKER_XML="Story parallelization metadata"
|
||||
|
||||
if [ ! -d "$AGENTS_DIR" ]; then
|
||||
echo "Erreur : dossier _bmad/_config/agents/ introuvable dans $PROJECT_ROOT" >&2
|
||||
echo "Lance ce script depuis la racine d'un projet BMAD installé." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
require_file() {
|
||||
local file="$1"
|
||||
if [ ! -f "$file" ]; then
|
||||
echo "Erreur : fichier requis introuvable : $file" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
escape_sed_replacement() {
|
||||
printf '%s' "$1" | sed -e 's/[\/&]/\\&/g'
|
||||
}
|
||||
|
||||
render_template() {
|
||||
local file="$1"
|
||||
require_file "$file"
|
||||
sed "s/__PROJECT_NAME__/$(escape_sed_replacement "$PROJECT_NAME")/g" "$file"
|
||||
}
|
||||
|
||||
render_template_to_temp_file() {
|
||||
local file="$1"
|
||||
local output
|
||||
output="$(mktemp)"
|
||||
render_template "$file" > "$output"
|
||||
printf '%s\n' "$output"
|
||||
}
|
||||
|
||||
patch_line_after_match() {
|
||||
local file="$1"
|
||||
local match="$2"
|
||||
local fragment_file="$3"
|
||||
|
||||
if [ ! -f "$file" ]; then
|
||||
echo " [skip] $(basename "$file") — fichier absent"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if grep -q "$CAPITALIZE_MARKER_XML" "$file"; then
|
||||
echo " [skip] $(basename "$file") — capitalisation déjà présente"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local rendered_fragment
|
||||
rendered_fragment="$(render_template_to_temp_file "$fragment_file")"
|
||||
|
||||
awk -v match="$match" -v fragfile="$rendered_fragment" '
|
||||
index($0, match) {
|
||||
print
|
||||
while ((getline line < fragfile) > 0) print line
|
||||
close(fragfile)
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
rm -f "$rendered_fragment"
|
||||
|
||||
echo " [ok] $(basename "$file") — capitalisation injectée"
|
||||
}
|
||||
|
||||
patch_block_before_match() {
|
||||
local file="$1"
|
||||
local match="$2"
|
||||
local fragment_file="$3"
|
||||
|
||||
if [ ! -f "$file" ]; then
|
||||
echo " [skip] $(basename "$file") — fichier absent"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if grep -q "$CAPITALIZE_MARKER_XML" "$file"; then
|
||||
echo " [skip] $(basename "$file") — capitalisation déjà présente"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local rendered_fragment
|
||||
rendered_fragment="$(render_template_to_temp_file "$fragment_file")"
|
||||
|
||||
awk -v match="$match" -v fragfile="$rendered_fragment" '
|
||||
index($0, match) {
|
||||
while ((getline line < fragfile) > 0) print line
|
||||
close(fragfile)
|
||||
}
|
||||
{ print }
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
rm -f "$rendered_fragment"
|
||||
|
||||
echo " [ok] $(basename "$file") — capitalisation injectée"
|
||||
}
|
||||
|
||||
patch_create_story_parallelization() {
|
||||
local file="$CREATE_STORY_XML"
|
||||
local fragment_file="$WORKFLOWS_DIR/create-story-parallelization.xmlfrag"
|
||||
|
||||
if [ ! -f "$file" ]; then
|
||||
echo " [skip] $(basename "$file") — fichier absent"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if grep -q "$CREATE_STORY_PARALLELIZATION_MARKER_XML" "$file"; then
|
||||
echo " [skip] $(basename "$file") — parallélisation create-story déjà présente"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local rendered_fragment
|
||||
rendered_fragment="$(render_template_to_temp_file "$fragment_file")"
|
||||
|
||||
awk -v fragfile="$rendered_fragment" '
|
||||
/<template-output file="\{default_output_file\}">story_header<\/template-output>/ {
|
||||
print
|
||||
while ((getline line < fragfile) > 0) print line
|
||||
close(fragfile)
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
rm -f "$rendered_fragment"
|
||||
|
||||
echo " [ok] $(basename "$file") — règle create-story injectée"
|
||||
}
|
||||
|
||||
patch_story_template() {
|
||||
local file="$STORY_TEMPLATE_MD"
|
||||
local fragment_file="$WORKFLOWS_DIR/story-template-frontmatter.mdfrag"
|
||||
|
||||
if [ ! -f "$file" ]; then
|
||||
echo " [skip] $(basename "$file") — fichier absent"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if grep -q "^Parallel-safe:" "$file"; then
|
||||
echo " [skip] $(basename "$file") — parallélisation déjà présente"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local rendered_fragment
|
||||
rendered_fragment="$(render_template_to_temp_file "$fragment_file")"
|
||||
|
||||
awk -v fragfile="$rendered_fragment" '
|
||||
/^Status:/ {
|
||||
print
|
||||
while ((getline line < fragfile) > 0) print line
|
||||
close(fragfile)
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
rm -f "$rendered_fragment"
|
||||
|
||||
echo " [ok] $(basename "$file") — frontmatter de parallélisation injecté"
|
||||
}
|
||||
|
||||
patch_dev_story_parallelization() {
|
||||
local file="$DEV_STORY_XML"
|
||||
local fragment_file="$WORKFLOWS_DIR/dev-story-parallelization-check.xmlfrag"
|
||||
|
||||
if [ ! -f "$file" ]; then
|
||||
echo " [skip] $(basename "$file") — fichier absent"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if grep -q "$PARALLELIZATION_MARKER_XML" "$file"; then
|
||||
echo " [skip] $(basename "$file") — parallélisation déjà présente"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local rendered_fragment
|
||||
rendered_fragment="$(render_template_to_temp_file "$fragment_file")"
|
||||
|
||||
awk -v fragfile="$rendered_fragment" '
|
||||
/<step n="5" goal="Implement task following red-green-refactor cycle">/ {
|
||||
while ((getline line < fragfile) > 0) print line
|
||||
close(fragfile)
|
||||
print
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
rm -f "$rendered_fragment"
|
||||
|
||||
echo " [ok] $(basename "$file") — règle de parallélisation injectée"
|
||||
}
|
||||
|
||||
patch_agent() {
|
||||
local agent="$1"
|
||||
local template_name="$2"
|
||||
local file="$AGENTS_DIR/${agent}.customize.yaml"
|
||||
local template_file="$MEMORIES_DIR/${template_name}.txt"
|
||||
|
||||
if [ ! -f "$file" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
require_file "$template_file"
|
||||
|
||||
if grep -q "$CAPITALIZE_MARKER" "$file"; then
|
||||
echo " [skip] $agent — memory déjà présente"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! grep -q "^memories: \[\]" "$file"; then
|
||||
echo " [warn] $agent — format memories: inattendu, patch manuel requis"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local memory
|
||||
memory="$(render_template "$template_file")"
|
||||
|
||||
awk -v mem="$memory" '
|
||||
/^memories: \[\]/ { print "memories:"; print " - \"" mem "\""; next }
|
||||
{ print }
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
|
||||
echo " [ok] $agent — memory injectée"
|
||||
}
|
||||
|
||||
patch_agents() {
|
||||
require_file "$PRODUCER_AGENTS_CONFIG"
|
||||
|
||||
while IFS=$'\t' read -r agent template_name; do
|
||||
if [ -z "${agent:-}" ] || [ "${agent#\#}" != "$agent" ]; then
|
||||
continue
|
||||
fi
|
||||
patch_agent "$agent" "$template_name"
|
||||
done < "$PRODUCER_AGENTS_CONFIG"
|
||||
}
|
||||
|
||||
patch_dev_story() {
|
||||
patch_block_before_match \
|
||||
"$DEV_STORY_XML" \
|
||||
"<!-- Final validation gates -->" \
|
||||
"$WORKFLOWS_DIR/dev-story-capitalisation.xmlfrag"
|
||||
}
|
||||
|
||||
patch_code_review() {
|
||||
local file="$CODE_REVIEW_XML"
|
||||
local fragment_file="$WORKFLOWS_DIR/code-review-capitalisation.xmlfrag"
|
||||
|
||||
if [ ! -f "$file" ]; then
|
||||
echo " [skip] $(basename "$file") — fichier absent"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if grep -q "$CAPITALIZE_MARKER_XML" "$file"; then
|
||||
echo " [skip] $(basename "$file") — capitalisation déjà présente"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local rendered_fragment
|
||||
rendered_fragment="$(render_template_to_temp_file "$fragment_file")"
|
||||
|
||||
awk -v fragfile="$rendered_fragment" '
|
||||
/✅ Review Complete!/ { in_review_complete = 1 }
|
||||
in_review_complete && /<\/output>/ {
|
||||
print
|
||||
print ""
|
||||
while ((getline line < fragfile) > 0) print line
|
||||
close(fragfile)
|
||||
in_review_complete = 0
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
rm -f "$rendered_fragment"
|
||||
|
||||
echo " [ok] $(basename "$file") — capitalisation injectée"
|
||||
}
|
||||
|
||||
patch_dev_story_checklist() {
|
||||
patch_line_after_match \
|
||||
"$DEV_STORY_CHECKLIST" \
|
||||
"**User Communication Ready**" \
|
||||
"$WORKFLOWS_DIR/dev-story-checklist.mdfrag"
|
||||
}
|
||||
|
||||
patch_code_review_checklist() {
|
||||
patch_line_after_match \
|
||||
"$CODE_REVIEW_CHECKLIST" \
|
||||
"Story saved successfully" \
|
||||
"$WORKFLOWS_DIR/code-review-checklist.mdfrag"
|
||||
}
|
||||
|
||||
patch_claude_md() {
|
||||
local fragment_file="$CLAUDE_FRAGMENTS_DIR/leadtech-capitalisation.mdfrag"
|
||||
|
||||
if [ ! -f "$CLAUDE_MD" ]; then
|
||||
echo " [skip] CLAUDE.md — fichier absent"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if grep -q "$CAPITALIZE_MARKER" "$CLAUDE_MD"; then
|
||||
echo " [skip] CLAUDE.md — section capitalisation déjà présente"
|
||||
return 0
|
||||
fi
|
||||
|
||||
render_template "$fragment_file" >> "$CLAUDE_MD"
|
||||
echo " [ok] CLAUDE.md — section capitalisation ajoutée"
|
||||
}
|
||||
|
||||
# --- Main ---
|
||||
echo ""
|
||||
echo "post-bmad-install — injection Lead_tech capitalisation"
|
||||
echo "Projet : $PROJECT_NAME ($PROJECT_ROOT)"
|
||||
echo "Agents : $AGENTS_DIR"
|
||||
echo "Templates : $TEMPLATES_DIR"
|
||||
echo ""
|
||||
|
||||
echo "Patch agents :"
|
||||
patch_agents
|
||||
|
||||
echo ""
|
||||
echo "Patch workflows :"
|
||||
patch_story_template
|
||||
patch_create_story_parallelization
|
||||
patch_dev_story_parallelization
|
||||
patch_dev_story
|
||||
patch_code_review
|
||||
patch_dev_story_checklist
|
||||
patch_code_review_checklist
|
||||
|
||||
echo ""
|
||||
echo "Patch CLAUDE.md :"
|
||||
patch_claude_md
|
||||
|
||||
echo ""
|
||||
echo "Terminé. Lance 'git diff' pour vérifier les changements."
|
||||
Reference in New Issue
Block a user