---
phase: 08-coherence-engine
plan: 03
type: execute
wave: 3
depends_on: ["08-02"]
files_modified:
  - .claude/skills/create-track/steps/01-collect-inputs.md
  - .claude/skills/create-track/steps/03-verify-and-save.md
autonomous: true

must_haves:
  truths:
    - "System warns when recent tracks over-index on a single emotion from the artist's palette"
    - "System detects thematic and lyrical repetition across previous tracks and flags duplicates"
    - "System suggests narrative progression ideas based on the artist's lore and track history"
    - "Cross-track analysis is skipped gracefully when insufficient history (< 2-3 tracks depending on check)"
    - "Early warnings in Step 01 guide creative direction BEFORE lyrics are written"
    - "Formal cross-track report in Step 03 documents findings BEFORE save"
  artifacts:
    - path: ".claude/skills/create-track/steps/01-collect-inputs.md"
      provides: "Cross-track analysis section with early warnings and narrative suggestions"
      contains: "Analyse Cross-Track"
    - path: ".claude/skills/create-track/steps/03-verify-and-save.md"
      provides: "Formal cross-track coherence report table"
      contains: "Coherence Cross-Track"
  key_links:
    - from: ".claude/skills/create-track/steps/01-collect-inputs.md"
      to: "artists/[name]/discography.md"
      via: "Reading discography stats for drift detection"
      pattern: "discography|Distribution emotionnelle|Emotions non-explorees"
    - from: ".claude/skills/create-track/steps/01-collect-inputs.md"
      to: "artists/[name]/tracks/*.md"
      via: "Reading last 5 track files for lyrical repetition"
      pattern: "tracks.*md|5 derniers"
    - from: ".claude/skills/create-track/steps/01-collect-inputs.md"
      to: "artists/[name]/bible.md"
      via: "Reading lore arc narratif for progression suggestions"
      pattern: "Arc narratif|Lore"
---

<objective>
Add cross-track analysis to the track creation workflow (COH-06, COH-07, COH-08).

Purpose: Beyond single-track bible alignment (Plan 08-01), the system must analyze the artist's body of work to detect patterns: emotional over-indexing (drift), thematic/lyrical repetition, and narrative progression opportunities. Early warnings in Step 01 guide creative direction before writing. Formal reporting in Step 03 documents findings before saving.

Output: Updated `01-collect-inputs.md` with cross-track analysis section. Updated `03-verify-and-save.md` with formal cross-track report table.
</objective>

<execution_context>
@C:/Users/zekho/.claude/get-shit-done/workflows/execute-plan.md
@C:/Users/zekho/.claude/get-shit-done/templates/summary.md
</execution_context>

<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/08-coherence-engine/08-RESEARCH.md
@.planning/phases/08-coherence-engine/08-01-SUMMARY.md
@.planning/phases/08-coherence-engine/08-02-SUMMARY.md
@.claude/skills/create-track/steps/01-collect-inputs.md
@.claude/skills/create-track/steps/03-verify-and-save.md
@.claude/skills/create-artist/examples/example-bible.md
@reference/templates/discography-template.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Add cross-track analysis to Step 01 (early warnings)</name>
  <files>.claude/skills/create-track/steps/01-collect-inputs.md</files>
  <action>
Add a new section "## Analyse Cross-Track" to Step 01, positioned AFTER the existing step 3 ("Lire la discographie") and BEFORE step 4 ("Identifier le template de structure"). This section leverages the discography data already read in step 3.

Renumber existing steps 4-6 to 5-7 to accommodate the new step 4.

**New step 4 content:**

```markdown
4. **Analyser l'historique cross-track.** Si la discographie contient des tracks precedents, executer l'analyse cross-track pour guider la direction creative.

   ### Drift Emotionnel (COH-06)

   **Condition :** la discographie contient >= 3 tracks.

   - Lire la section Stats > Distribution emotionnelle de la discographie
   - Lire la section Stats > Emotions non-explorees de la discographie
   - SI une emotion apparait dans > 50% des 3 derniers tracks (colonne Emotions des 3 dernieres lignes) :
     "ATTENTION DRIFT : Les [N] derniers tracks explorent tous [emotion]. Envisager [emotions non-explorees] pour varier."
   - Sinon : "Distribution emotionnelle equilibree."
   - SI < 3 tracks : ne pas executer cette analyse. Passer directement a la detection de repetition.

   ### Repetition Thematique et Lyrique (COH-07)

   **Condition :** la discographie contient >= 2 tracks.

   - Comparer le concept/mood du nouveau track avec la colonne Themes des tracks precedents dans le tableau
   - SI un theme identique ou tres similaire est deja explore :
     "ATTENTION REPETITION : Le theme [X] a deja ete explore dans le track [##] [titre]. Suggestions : aborder sous un angle different -- [proposer 2-3 angles alternatifs]."
   - Lire les fichiers des 5 derniers tracks (`artists/[name]/tracks/[##]-*.md`) pour comparaison lyrique
   - Pour chaque fichier track lu, extraire les images, metaphores et phrases-cles des lyrics
   - SI des phrases ou images similaires sont detectees entre le concept du nouveau track et les lyrics existantes :
     "ATTENTION REPETITION LYRIQUE : L'image/metaphore [X] a ete utilisee dans le track [##]. Varier le vocabulaire visuel."
   - SI < 2 tracks : "Premier ou deuxieme track -- pas de risque de repetition." Ne pas lire de fichiers tracks.

   ### Suggestions de Progression Narrative (COH-08)

   **Condition :** toujours executer (meme avec 0 tracks precedents).

   - Lire `Lore > Arc narratif` depuis la bible (deja lue en step 2)
   - SI l'artiste a des tracks precedents :
     - Mapper les themes et emotions des tracks existants sur l'arc narratif
     - Identifier ou en est l'artiste dans sa progression narrative
     - "PROGRESSION : L'arc narratif de [artiste] prevoit [description de l'arc]. Les tracks precedents couvrent [phase de l'arc deja exploree]. Le prochain track pourrait explorer [suggestion basee sur la phase suivante de l'arc]."
   - SI aucun track precedent :
     - "PROGRESSION : Premier track de [artiste]. L'arc narratif prevoit [description]. Suggestion de point de depart : [debut de l'arc -- premiere phase narrative]."
   - SI aucun arc narratif defini dans la bible :
     - Baser les suggestions sur le lore general et les themes non-explores
     - "PROGRESSION : Pas d'arc narratif defini. Basees sur le lore : [2-3 directions narratives coherentes]."
   - Proposer 2-3 directions narratives coherentes dans tous les cas
```

**Integrate cross-track findings into the resume de direction creative.** Update the existing step (now step 7, previously step 6) "Presenter le resume de direction creative" to include cross-track warnings after the existing summary block:

```
   Artiste : [nom] ([genre])
   Concept : [concept fourni par l'utilisateur]
   Langue : [langue choisie]
   Structure : [template selectionne + notation]
   Emotions a explorer : [emotions de la palette qui matchent le concept]
   Track # : [prochain numero]

   [SI analyses cross-track executees :]
   --- Analyse Cross-Track ---
   [Drift emotionnel : resultat ou "N/A (< 3 tracks)"]
   [Repetition : resultat ou "N/A (< 2 tracks)"]
   [Progression narrative : suggestion]
```

**Update the Validation checklist** at the bottom to add a new checkbox:
```
- [ ] L'analyse cross-track est executee (ou N/A si premier track)
```
  </action>
  <verify>
Read `01-collect-inputs.md` and confirm:
1. "Analyse Cross-Track" content exists as step 4
2. Steps are correctly renumbered (original 4-6 became 5-7)
3. Three analysis subsections present: Drift Emotionnel (>= 3 tracks), Repetition (>= 2 tracks), Progression Narrative (always)
4. 5-file reading limit specified for lyrical repetition
5. Resume de direction creative includes cross-track findings
6. Validation checklist includes cross-track checkbox
7. All existing content is preserved (artist verification, bible reading, discography reading, genre-template mapping, input collection)
  </verify>
  <done>Step 01 includes cross-track analysis with emotion drift detection, thematic/lyrical repetition warnings, and narrative progression suggestions, all with conditional thresholds based on discography size</done>
</task>

<task type="auto">
  <name>Task 2: Add formal cross-track report to Step 03</name>
  <files>.claude/skills/create-track/steps/03-verify-and-save.md</files>
  <action>
Add a "### Coherence Cross-Track" subsection inside the "## Verification de Coherence" section (added by Plan 08-01), positioned AFTER the existing coherence table (the bible alignment table with Genre/Vocal/Theme/Emotion/Regles checks).

This subsection formalizes the cross-track findings from Step 01 into a structured report table for the production brief:

```markdown
### Coherence Cross-Track

SI la discographie contient des tracks precedents, inclure le rapport cross-track :

| Controle | Resultat | Detail |
|----------|----------|--------|
| Drift emotionnel | [OK/ATTENTION/N/A] | [detail -- emotions sur-representees et non-explorees, ou "< 3 tracks"] |
| Repetition thematique | [OK/ATTENTION/N/A] | [detail -- themes similaires detectes, ou "< 2 tracks"] |
| Repetition lyrique | [OK/ATTENTION/N/A] | [detail -- phrases ou images reutilisees, ou "< 2 tracks"] |
| Progression narrative | [INFO] | [suggestion -- prochaine direction narrative] |

SI premier track de l'artiste : "Coherence cross-track : N/A (premier track)."
```

Also add this cross-track report table to the production brief file template (inside "### Format du Fichier"), after the "### Verification de Coherence" table added by Plan 08-01:

```
### Coherence Cross-Track

| Controle | Resultat | Detail |
|----------|----------|--------|
| Drift emotionnel | [OK/ATTENTION/N/A] | [detail] |
| Repetition thematique | [OK/ATTENTION/N/A] | [detail] |
| Repetition lyrique | [OK/ATTENTION/N/A] | [detail] |
| Progression narrative | [INFO] | [suggestion] |
```

Note: Cross-track findings are INFORMATIONAL (not blocking). They complement the bible alignment checks. The post-verification interaction only triggers on ALERTE from bible alignment, NOT from cross-track ATTENTION flags. Cross-track warnings were already surfaced in Step 01 and guided the creative process.

Do NOT modify any other section of Step 03. The Verification de Coherence bible alignment table from Plan 08-01 and the discography update instructions from Plan 08-02 must remain intact.
  </action>
  <verify>
Read `03-verify-and-save.md` and confirm:
1. "### Coherence Cross-Track" subsection exists inside "## Verification de Coherence"
2. Cross-track report table has 4 rows: drift emotionnel, repetition thematique, repetition lyrique, progression narrative
3. Conditional handling for first track (N/A)
4. The production brief template includes the cross-track report table
5. No other sections are modified (bible alignment table, discography update, linguistic verification all preserved)
  </verify>
  <done>Step 03 contains a formal cross-track report table documenting emotion drift, repetition, and narrative progression findings in the production brief</done>
</task>

</tasks>

<verification>
1. Read `01-collect-inputs.md` end to end -- verify cross-track analysis section with all 3 checks and conditional thresholds
2. Read `03-verify-and-save.md` end to end -- verify cross-track report table and production brief template update
3. Verify the flow: Step 01 analyzes history and surfaces early warnings -> Step 02 writes with awareness -> Step 03 reports cross-track findings formally
4. Verify conditional thresholds: drift >= 3 tracks, repetition >= 2 tracks, progression always
5. Verify 5-file reading limit for lyrical repetition in Step 01
6. Verify no regression on existing content in both files
</verification>

<success_criteria>
- Step 01 reads discography stats + last 5 track files and produces early warnings about drift, repetition, and narrative direction
- Step 03 includes formal cross-track report table in both procedure and production brief template
- Cross-track analysis has conditional thresholds (skip when insufficient history)
- Narrative progression suggestions work even with 0 previous tracks (based on lore alone)
- No regression on existing Step 01 content (artist verification, bible reading, discography reading, genre mapping, input collection, validation)
- No regression on existing Step 03 content (Suno constraints, linguistic verification, bible coherence, discography update)
</success_criteria>

<output>
After completion, create `.planning/phases/08-coherence-engine/08-03-SUMMARY.md`
</output>
