diff --git a/70_templates/bmad_post_install/claude/leadtech-capitalisation.mdfrag b/70_templates/bmad_post_install/claude/leadtech-capitalisation.mdfrag deleted file mode 100644 index cbb06d6..0000000 --- a/70_templates/bmad_post_install/claude/leadtech-capitalisation.mdfrag +++ /dev/null @@ -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 : - - -Proposition : - -``` - -Règle : écrire dans `95_a_capitaliser.md` uniquement. Jamais directement dans les fichiers Lead_tech validés. diff --git a/70_templates/bmad_post_install/config/producer_agents.tsv b/70_templates/bmad_post_install/config/producer_agents.tsv deleted file mode 100644 index 32f4e63..0000000 --- a/70_templates/bmad_post_install/config/producer_agents.tsv +++ /dev/null @@ -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 diff --git a/70_templates/bmad_post_install/memories/analyst.txt b/70_templates/bmad_post_install/memories/analyst.txt deleted file mode 100644 index 2899212..0000000 --- a/70_templates/bmad_post_install/memories/analyst.txt +++ /dev/null @@ -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: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/memories/architect.txt b/70_templates/bmad_post_install/memories/architect.txt deleted file mode 100644 index 16df743..0000000 --- a/70_templates/bmad_post_install/memories/architect.txt +++ /dev/null @@ -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: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/memories/core_bmad_master.txt b/70_templates/bmad_post_install/memories/core_bmad_master.txt deleted file mode 100644 index 147fce8..0000000 --- a/70_templates/bmad_post_install/memories/core_bmad_master.txt +++ /dev/null @@ -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: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/memories/dev_implementation.txt b/70_templates/bmad_post_install/memories/dev_implementation.txt deleted file mode 100644 index ccd177d..0000000 --- a/70_templates/bmad_post_install/memories/dev_implementation.txt +++ /dev/null @@ -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: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/memories/pm.txt b/70_templates/bmad_post_install/memories/pm.txt deleted file mode 100644 index 97d788c..0000000 --- a/70_templates/bmad_post_install/memories/pm.txt +++ /dev/null @@ -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: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/memories/qa.txt b/70_templates/bmad_post_install/memories/qa.txt deleted file mode 100644 index e0e11e3..0000000 --- a/70_templates/bmad_post_install/memories/qa.txt +++ /dev/null @@ -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: / Pourquoi: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/memories/sm.txt b/70_templates/bmad_post_install/memories/sm.txt deleted file mode 100644 index 2dca19b..0000000 --- a/70_templates/bmad_post_install/memories/sm.txt +++ /dev/null @@ -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: / Pourquoi: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/memories/tech_writer.txt b/70_templates/bmad_post_install/memories/tech_writer.txt deleted file mode 100644 index 093283f..0000000 --- a/70_templates/bmad_post_install/memories/tech_writer.txt +++ /dev/null @@ -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: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/memories/ux_designer.txt b/70_templates/bmad_post_install/memories/ux_designer.txt deleted file mode 100644 index 91bdbe1..0000000 --- a/70_templates/bmad_post_install/memories/ux_designer.txt +++ /dev/null @@ -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: / Proposition: . Never write directly to Lead_tech validated files. diff --git a/70_templates/bmad_post_install/workflows/code-review-capitalisation.xmlfrag b/70_templates/bmad_post_install/workflows/code-review-capitalisation.xmlfrag deleted file mode 100644 index a753463..0000000 --- a/70_templates/bmad_post_install/workflows/code-review-capitalisation.xmlfrag +++ /dev/null @@ -1,8 +0,0 @@ - - You MUST output this section — do NOT skip it silently - ## 🧠 Capitalisation Lead_tech - - Review all findings for: anti-patterns found, recurring issues, architecture decisions confirmed or invalidated during this review. - - 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>" - Output explicitly: "Rien à capitaliser pour cette review." — do NOT skip silently diff --git a/70_templates/bmad_post_install/workflows/code-review-checklist.mdfrag b/70_templates/bmad_post_install/workflows/code-review-checklist.mdfrag deleted file mode 100644 index 2907b1d..0000000 --- a/70_templates/bmad_post_install/workflows/code-review-checklist.mdfrag +++ /dev/null @@ -1 +0,0 @@ -- [ ] Capitalisation Lead_tech outputted — proposals written to `95_a_capitaliser.md` OR explicit "Rien à capitaliser" stated diff --git a/70_templates/bmad_post_install/workflows/create-story-parallelization.xmlfrag b/70_templates/bmad_post_install/workflows/create-story-parallelization.xmlfrag deleted file mode 100644 index 0d4d12e..0000000 --- a/70_templates/bmad_post_install/workflows/create-story-parallelization.xmlfrag +++ /dev/null @@ -1,6 +0,0 @@ - - Every created story must explicitly define its parallelization metadata. - Set `Parallel-safe`, `Depends-on`, and `Can-run-with` in the story header based on real technical dependencies, not optimism. - If the story depends on non-merged code from another story, set `Parallel-safe: false` and fill `Depends-on` explicitly. - Use `Can-run-with` only for stories that can be developed in parallel without merge or logic conflicts. - If multiple stories are technically linked, keep them on the same branch until they are independently testable, reviewable, and mergeable. diff --git a/70_templates/bmad_post_install/workflows/dev-story-capitalisation.xmlfrag b/70_templates/bmad_post_install/workflows/dev-story-capitalisation.xmlfrag deleted file mode 100644 index bb1bac8..0000000 --- a/70_templates/bmad_post_install/workflows/dev-story-capitalisation.xmlfrag +++ /dev/null @@ -1,8 +0,0 @@ - - You MUST output this section — do NOT skip it silently - ## 🧠 Capitalisation Lead_tech - - Review the full implementation for: reusable patterns, difficult bug fixes, anti-patterns, architecture decisions, or subtle nuances discovered during this story. - - 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>" - Output explicitly: "Rien à capitaliser pour cette story." — do NOT skip silently diff --git a/70_templates/bmad_post_install/workflows/dev-story-checklist.mdfrag b/70_templates/bmad_post_install/workflows/dev-story-checklist.mdfrag deleted file mode 100644 index 6d06498..0000000 --- a/70_templates/bmad_post_install/workflows/dev-story-checklist.mdfrag +++ /dev/null @@ -1 +0,0 @@ -- [ ] **Capitalisation Lead_tech:** Section "🧠 Capitalisation Lead_tech" outputted — proposals written to `95_a_capitaliser.md` OR explicit "Rien à capitaliser" stated diff --git a/70_templates/bmad_post_install/workflows/dev-story-parallelization-check.xmlfrag b/70_templates/bmad_post_install/workflows/dev-story-parallelization-check.xmlfrag deleted file mode 100644 index 8c86f16..0000000 --- a/70_templates/bmad_post_install/workflows/dev-story-parallelization-check.xmlfrag +++ /dev/null @@ -1,3 +0,0 @@ - - Before implementation, read `Parallel-safe`, `Depends-on`, and `Can-run-with` from the story file. - If metadata conflicts with the actual code state or branch reality, stop and reconcile the story before coding. diff --git a/70_templates/bmad_post_install/workflows/story-template-frontmatter.mdfrag b/70_templates/bmad_post_install/workflows/story-template-frontmatter.mdfrag deleted file mode 100644 index 1834999..0000000 --- a/70_templates/bmad_post_install/workflows/story-template-frontmatter.mdfrag +++ /dev/null @@ -1,3 +0,0 @@ -Parallel-safe: false -Depends-on: ~ -Can-run-with: ~ diff --git a/scripts/aliases.sh b/scripts/aliases.sh index e2c1bfb..87c53c5 100644 --- a/scripts/aliases.sh +++ b/scripts/aliases.sh @@ -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' \ No newline at end of file diff --git a/scripts/post-bmad-install.sh b/scripts/post-bmad-install.sh deleted file mode 100755 index 2d867b9..0000000 --- a/scripts/post-bmad-install.sh +++ /dev/null @@ -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" ' - /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" ' - // { - 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" \ - "" \ - "$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."