Managing an AI Agent with AsciiDoc: My Eager/Lazy Strategy for Leak-Free Opencode Sessions
Published on 24 April 2026
Summary
When working with an AI agent like Opencode on complex projects across multiple sessions, you face a fundamental problem:the context leak. The agent does not remember the previous session. Everything that was explained to them — the architecture, the conventions, the state of the backlog — is lost. Reconstructing this context each session is costly, slow, and a source of error.
This article sets out the artisanal strategy I built to solve this problem: a persistent governance system based on AsciiDoc files, with a dichotomyEager/Lazyto optimize context token consumption, and aessential end-of-session procedureto ensure continuity.
The Scene: Monday 21 April, 9:00
I reopen Opencode to resume my Gradle plugin.plantuml-plugin. Last night, I spent three hours discussing with the API key pool architecture agent — round-robin rotation, quota management, automatic fallback. This morning, the agent looks at me with goldfish eyes.
_ Hello, I am your Opencode assistant. How can I help you today? _
No — Ah yes, the API key pool, we were at the YAML structure. No — Attention,PlantumlManager`is a Kotlin singleton object, not a class. No — No, we decided yesterday that`SyntaxValidationResult`there remained a nested sealed class in`PlantumlService.
Everything has to be redone. Or rather: everything has to be re‑explained. I will spend the first twenty minutes of my session reconstructing a context that the agent already had in hand yesterday. Twenty minutes of burned tokens. Twenty minutes where I could be coding, but I am doing mandatory pedagogical work.
It’s not a bug in Opencode. It’s the very nature of conversational LLMs: between two sessions, the working memory iscompletely erased. The agent does not remember the previous mission, the decisions taken, the identified pitfalls, the code we wrote together.
I’ve experienced that dozens of times. On four simultaneous projects. With sessions that chain over weeks. I calculated: on average,30-40% of session timewas dedicated to recontextualizing the agent. At session 87 of the project`plantuml-plugin`, I cracked. I could no longer afford to explain for the tenth time that`AttemptEntry`is a top-level data class in`DiagramProcessor.kt`.
I needed a system. Not a hack. Real governance.
Genesis: From Chaos to Method
The Early Sessions: The Age of Darkness
My first project with Opencode,plantuml-plugin, started without any governance. I ask a question, the agent answers, we iterate, the session ends, and the next day we start from zero. It was session 1, then 2, then 3… up to session 62 where I realized I had lost cumulative hours re-explaining the same architecture.
At session 62, the numbers are there:198 unit tests pass, 42 functional tests validated, the plugin works. But the cognitive cost is unbearable. Each new session begins with a twenty-minute monologue on the project structure.
The Destroyed Episode of site.yml (Session 2, bakery-plugin)
The method also arises from a catastrophe. On the project`bakery-gradle`, at session 2, I ask the agent to modify the file`site.yml`. The agent, without checking whether the file is versioned, makes a`Write`complete that overwrites the content. Result: the real tokens (Firebase API keys, deployment secrets) are replaced with fake placeholders. The file wasn’t in git — it was in`.gitignore`to protect the secrets.
Without backup. Without`git restore`possible. I am stuck. I need to manually rebuild the configuration file, retrieve the tokens from my password managers, and put everything back together.
It is from this frustration that theAbsolute Rule 1b:
_ Never crusha config file with a`Write`complete when a`Edit`Partial suffices.Never replacesensitive values with dummy values.Check git check-ignore and `git ls-filesbefore any modification. _
This rule, now etched in stone in all my files`AGENT.adoc` et `INDEX.adoc`on four projects, was born from a real error that cost me an hour of manual work.
The Markdown → AsciiDoc Migration (Session 1, cheroliv.com)
On April 25, 2026, on`cheroliv.com`, I am making a radical decision: converting the entirety of Markdown governance to AsciiDoc. It’s not aesthetic. It’s functional. AsciiDoc offers a semantic structure that LLMs read better: hierarchical sections, typed tables, admonitions (NOTE, WARNING, CAUTION), machine-readable document attributes.
The session 1 of`cheroliv.com`formalize the structure :
-
Conversion of`AGENTS.md` en
AGENT.adoc -
Creating the specialized agents:`CODER.adoc`,
SCRUM_MASTER.adoc,PLANTUML_DESIGNER.adoc -
Creation of the Eager/Lazy structure:`INDEX.adoc`,
SESSIONS_HISTORY.adoc,AGENT_SESSION_MANAGER.adoc,SESSION_CHECKLIST.adoc,PROCEDURES.adoc
Only one commit:`90975e9 refactor: migrate agent governance from Markdown to AsciiDoc`. And the site continues to operate.
@startuml
skinparam backgroundColor #FEFEFE
skinparam handwritten false
title Evolution of Sessions — From Session 1 to 150+
legend top
|= Couleur |= Projet |
| <#4CAF50> | cheroliv.com |
| <#2196F3> | plantuml-plugin |
| <#FF9800> | bakery-plugin |
| <#9C27B0> | magic-stick |
endlegend
concise "Active Sessions" as S
@S
0 is "raw .md"
1 is "Migration\nAsciiDoc"
10 is "Eager/Lazy\nformalized"
62 is "Safety rule\n(site.yml)"
87 is "Cracking\ncontext"
109 is "Optimization\n-60% tokens"
133 is "133 sessions\n240 tests PASS"
S@0 -> S@1 : Session 1\n(cheroliv.com)
S@1 -> S@10
S@10 -> S@62 : Session 62\n(plantuml-plugin)
S@62 -> S@87 : Session 87\n(Cry 4 help)
S@87 -> S@109 : Session 109\n(API Key Pool)
S@109 -> S@133 : Session 133\n(Aujourd'hui)
@enduml
The timeline above illustrates the real progression. The tipping point is session 87: that’s where the frustration of repeated recontextualization exceeds the tolerance threshold, and the Eager/Lazy method ceases to be an idea and becomes an obligation.
The Strategy: Eager/Lazy in Depth
Philosophy : Computer Cache Applied to Cognition
My approach is directly inspired by computer cache management. Everything that iscritical and frequently usedmust be immediately accessibleEager). Everything that iscontextual or bulkymust be loaded on demandLazy).
Eager (Dashboard) |
Lazy (Owner’s Manual) |
Size |
< 100 lines, < 10k tokens |
Unlimited, detailed |
Loading |
Auto, at the beginning of the session |
At the request of the agent |
Content |
Absolute rules, current mission, critical state |
Session archives, complete history, detailed procedures, technical references |
Role |
Orient the agent immediately |
Answer deep context questions |
Eager Files: The Dashboard
These files live at the root of each project and are automatically loaded by the agent at the start of each session. They form thedashboard-- critical information, immediately accessible.
@startuml
skinparam defaultTextAlignment center
skinparam wrapWidth 200
package "Project Root (Eager - Auto-loaded)" {
component "<b>AGENT.adoc</b>\nR Absolute rules\nStructure & Conventions" as AGENT
component "<b>PROMPT_REPRISE.adoc</b>\nMission of session N\nRSummary N-1" as PROMPT
component "<b>INDEX.adoc</b>\nPoint entry\nRRules + Sessions" as INDEX
component "<b>*_ESSENTIALS.adoc</b>\nContexte business\ncritical" as ESS
}
package ".agents/ (Lazy - Loaded on demand)" {
component "<b>sessions/N-*.adoc</b>\nArchives detailed\nDDecisions & Output" as SESS
component "<b>SESSIONS_HISTORY.adoc</b>\nTableau summary\nDate/Type/Score" as HIST
component "<b>PROCEDURES.adoc</b>\nTemplates end of session\n6 steps\n" as PROC
component "<b>*_REFERENCE.adoc</b>\nArchitecture complete\nRTechnical references" as REF
component "<b>COMPLETED_TASKS_ARCHIVE</b>\nTCompleted tasks\nPar months" as ARCH
component "<b>AGENT_MODUS_OPERANDI.adoc</b>\nDocumentation strategy\nMMethodology" as MOD
component "<b>*_REFERENCE.adoc</b>\nBoot tests, A/B partition\nContextes specific" as SPEC
}
AGENT --> PROMPT : "References"
AGENT --> INDEX : "References"
INDEX --> SESS : "Index"
INDEX --> HIST : "Index"
INDEX --> PROC : "Reference"
INDEX --> ARCH : "Reference"
INDEX --> REF : "Reference"
PROMPT --> SESS : "Archive N-1"
PROMPT --> ESS : "Business context N"
@enduml
AGENT.adoc-- The master file. On`cheroliv.com`, it is 200 lines long and contains :
-
The absolute rules of the project (no commit without permission, no`rm`without confirmation)
-
The project structure and code conventions
-
The essential commands (
./gradlew serve,./gradlew test) -
The epics and the product backlog (prioritized user stories)
-
The cross-cutting quality criteria (accessibility, responsive, compatibility)
On`bakery-plugin`, Rule 0 is different :./gradlew -q publishToMavenLocal` mandatory after each source code change. Because testing the plugin without republishing the local JAR cost me an hour debugging code that wasn’t yet packaged.
PROMPT_REPRISE.adoc-- The mission of the current session. Updated at the end of each session, it contains:
-
The session number and the priority mission
-
The summary of the previous session (what has been done, what remains to be done)
-
The acceptance criteria of the current session
-
The specific technical reminders
.agents/INDEX.adocThe entry point. It summarizes the absolute rules, recent sessions, and especially theproject portfoliomanaged using the same methodology. To date, five projects are listed there:
----
----
----
----
| magic-stick | Session 23 | SCRIPT_VERIFICATION.adoc | 2026-04-27 |
| bakery-gradle | Session 11 | TEST_COVERAGE_ANALYSIS | 2026-04-27 |
| cheroliv.com | Session 9 | TEST_COVERAGE_ANALYSIS | 2026-04-27 |
| plantuml-gradle| Session 133| TEST_COVERAGE_ANALYSIS | 2026-04-23 |
| jhipster-gradle-plugins | Session 1 | TEST_COVERAGE_ANALYSIS | 2026-04-28 |
----
**`*_ESSENTIALS.adoc`** -- A recent addition (Session 109, plantuml-plugin) to further optimize the Eager context. Instead of loading 200 lines of business context on the API key pool, I load 50 lines of the essential, and the remaining 150 lines stay LAZY in`*_REFERENCE.adoc`.
Measured result: passage of**~25k tokens EAGER to ~10k tokens**(60% gain). The agent no longer needs energy-consuming reminders.
==== The Missing Link: `opencode.json
I must confess something I almost forgot to document. Above all these .adoc files, there is a tiny JSON file without which nothing works. It's called`opencode.json`and it is six lines. Literally six lines.
[source,json]
----
{
"$schema": "https://opencode.ai/config.json",
"instructions": [
"AGENT.adoc"
]
}
----
This file tells Opencode: "At startup, load`AGENT.adoc`Automatically. Without him, the agent is a blank page exactly as I described at the beginning of the article. With him, the agent already has in hand the absolute rules, the project architecture, and the essential commands — even before I say hello.
I discovered the importance of this file by chance. On`bakery-plugin`, it did not exist. I was wondering why the agent was systematically more 'lost' on this project than on the others. The absolute rules were well in`AGENT.adoc`— but`AGENT.adoc`It was never loaded. The agent only read what I told him to read, manually, each session. This was session 11 of`bakery-plugin`when I realized the absence of the`opencode.json`. I created it — and session 12 started like the others.
This file is so obvious to me now that I wasn't even thinking about it anymore. A classic mistake of a developer who knows their tool too well. Nowadays, I systematically create it *before`AGENT.adoc`. This is the first stone.
==== The Duality of `INDEX.adoc
Another subtlety that deserves to be clarified:`INDEX.adoc`lives in`.agents/`— a folder that I presented as LAZY. However, I list it as EAGER in all my tables. There is an apparent tension here.
The field reality: the files`.agents/INDEX.adoc`are automatically loaded correctly at the beginning of the session, just as`AGENT.adoc` et `PROMPT_REPRISE.adoc`. They are in`.agents/`for organizational reasons — not to invade the root — but their behavior is EAGER.
on`plantuml-plugin`, `INDEX.adoc`is 200 lines long and contains the absolute *complete* rules with their history (the lessons from past sessions), the EPICs with scores, and the project portfolio. It is the document the agent consults to know 'where we stand'. Sur`bakery-plugin`, it makes 150 lines with the roadmap and recent sessions.
The deliberate redundancy between`AGENT.adoc` et `INDEX.adoc`can be surprising. The absolute rules are present in both. Why? Because they fulfill two different roles: in`AGENT.adoc`, they are *explanatory* (the storytelling of the rule, the lesson learned) ; in`INDEX.adoc`, they are *executive* (the naked rule, without justification, for a quick consultation). The agent reads`AGENT.adoc`once to *understand*; he rereads`INDEX.adoc`for each session to *apply*. Two uses, two formats.
[plantuml, format=svg, id=diag-dualite-agent-index, alt="Comparaison entre AGENT.adoc (narratif) et INDEX.adoc (exécutif)"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
title Duality AGENT.adoc ←→ INDEX.adoc
left to right direction
rectangle "AGENT.adoc\n(Root — EAGER)" as AGENT #E3F2FD {
rectangle "📖 **Narrative Format**\nLe storytelling of the rule\nthe lesson learned, the context" as NARR
rectangle "🏗️ **Complete Architecture**\nStructure project, components\nBacklog detailed user stories" as ARCHI
rectangle "📋 **Explanatory Rules**\nPourquoi the rule exists\nHistorique of the incident" as EXPL
}
rectangle "INDEX.adoc\n(.agents/ — EAGER)" as INDEX #E8F5E9 {
rectangle "⚡ **Executive Format**\nLa bare rule, without justification\nConsultation quick" as EXEC
rectangle "📊 **Roadmap & EPICs**\nTableau summary\nProgression, Score, Priority" as ROAD
rectangle "🌐 **Project Portfolio**\nVue cross-cutting\n5 synchronized projects" as PORT
}
AGENT --> INDEX : "Agent reads AGENT.adoc\nonce to **understand**"
INDEX --> AGENT : "Agent rereads INDEX.adoc\neach session to **apply**"
note bottom of AGENT
Max size: 200 lines
end note
note bottom of INDEX
Max size: 200 lines
Source de vérité en cas de divergence
end note
@enduml
----
This assumed redundancy is a design choice. It consumes about 50 extra lines of EAGER tokens — but it ensures that the agent always has the rules in view, even in the concise format that facilitates immediate obedience.
=== The LAZY Files: The Owner's Manual
These files live in`.agents/`and are read only when the agent needs them. They constitute the true wealth of the method, because they accumulate the project's knowledge without polluting the current context.
[plantuml, format=svg, id=diag-agents-tree, alt="Arborescence complète du dossier .agents/"]
----
@startuml
skinparam folderBackgroundColor #E3F2FD
skinparam folderBorderColor #1565C0
skinparam fileBackgroundColor #FFF3E0
skinparam fileBorderColor #EF6C00
folder ".agents/" as ROOT {
file "INDEX.adoc\n(EAGER -- 200 lines)" as IDX #E8F5E9
file "AGENT_SESSION_MANAGER.adoc\n(Session template)" as ASM
file "SESSION_CHECKLIST.adoc\n(When to change)" as CHK
file "PROCEDURES.adoc\n(6 steps + LAZY/EAGER)" as PRO
file "SESSIONS_HISTORY.adoc\n(All sessions)" as HIS
folder "sessions/" as SESS {
file "1-chore-migration.adoc" as S1
file "109-formalisation-lazy.adoc" as S109 #FFECB3
file "133-epic11-article.adoc" as S133
file "... +130 others" as SMORE
}
folder "archives/" as ARCH {
file "COMPLETED_TASKS_2026-04.adoc" as CTA
file "SESSIONS_HISTORY_83-95.adoc" as SHIST
folder "sessions_summaries/" as SUM {
file "SESSION_64_SUMMARY.adoc" as SU64
file "SESSION_73_SUMMARY.adoc" as SU73
file "..." as SUMORE
}
folder "prompts_archive/" as PARCH {
file "PROMPT_REPRISE_S65.adoc" as PR65
file "PROMPT_REPRISE_S75.adoc" as PR75
file "..." as PMORE
}
}
}
IDX --> SESS : "Index"
IDX --> HIS : "Index"
IDX --> ARCH : "Reference"
note right of S109
Session 109 =
Strategy formalization
LAZY/EAGER
Token: ~25k → ~10k
end note
@enduml
----
The tree structure above shows the real structure of the folder`.agents/`on`plantuml-plugin`, the most mature project. Note the depth in three layers: root files (metadata), folder`sessions/`(chronological archives), and file`archives/`(aggregations and summaries). It is this depth that transforms governance from a simple TODO file into a**complete organizational memory**.
**.agents/sessions/{N}-{title}.adoc**-- The detailed archives of each session. Currently:
* `plantuml-plugin`:**133 archived sessions**(from session 1 to 133)
* `bakery-plugin`:**11 sessions**
* `magic-stick` : **23 sessions**
* `cheroliv.com` : **9 formal sessions**+ 7 pre-system sessions reconstructed retroactively
Each archive contains the full context of the session, the decisions made, the problems encountered and their resolution, the executed commands and their output.
**.agents/SESSIONS_HISTORY.adoc**-- A summary table of all sessions with a score. Example on`cheroliv.com`:
| -6 | 2025-05 | chore | Initialisation projet Gradle/JBake | 7/10 | 1 | 2026-04-25 | chore | Migration gouvernance agent | 8/10 | 7 | 2026-04-27 | debug/fix | Correction publishSite | 9/10 | 8 | 2026-04-27 | analyse | Analyse article 0108 | 7/10
**.agents/COMPLETED_TASKS_ARCHIVE_{mois}.adoc**-- Completed tasks archived by month, to avoid overloading the active backlog. When a user story is finished, it moves here. The backlog remains readable: maximum 10 active items.
**.agents/PROCEDURES.adoc**-- Detailed templates of the end-of-session procedure. Long, but read only once by the agent when learning the method. Then the procedure becomes mechanical.
**.agents/AGENT_MODUS_OPERANDI.adoc**-- The complete strategic documentation. On`plantuml-plugin`, this file does**900+ lines**and is actually called`AGENT_METHODOLOGIES.adoc`— I changed the name between writing this article and its effective implementation. This kind of naming divergence is inevitable in an evolving handmade system. The important thing is the naming convention: if the file documents the *method*, it starts with`AGENT_`or an explicit prefix. It documents the Eager/Lazy methodology, the patterns to follow, the anti-patterns to avoid. It is LAZY because an agent does not need to reread the entire strategy in each session, only when there is ambiguity.
**`*_REFERENCE.adoc`** -- Project specific technical references. Sur`magic-stick`, two dense LAZY files:
* `AB_PARTITION_REFERENCE.adoc`(147 lines) -- GPT A/B partition architecture, scripts`update-system.sh`, estimated sizes, rollback mechanism
* `BOOT_TEST_REFERENCE.adoc`(144 lines) -- QEMU + VNC procedure to test boot of the ISO without physical hardware, BIOS/UEFI checklist, CI/CD limitations
On`plantuml-plugin`(Empty output)
* `ARCHITECTURE.adoc`(134 lines) -- Structure of the 11 data classes, points of attention (pitfalls to avoid), optimized test commands
* `API_KEY_POOL_REFERENCE.adoc`-- Full details of the key pool (LAZY while`ESSENTIALS`is EAGER)
== Specialized Agents: A Virtual Team
Governance is not limited to passive files. I have formalized**roles of specialized agents**in dedicated LAZY files, which define the expected workflow according to the task type.
|===
|Agent |File |Role |Project |**to code** |`CODER.adoc` |Implementation FTL/CSS/JS, semantic tags, accessibility criteria |cheroliv.com |**Scrum Master** |`SCRUM_MASTER.adoc` |US planning, sub-task breakdown, dependency detection |cheroliv.com |**PlantUML Designer** |`PLANTUML_DESIGNER.adoc` |Diagram creation, PUML syntax, JBake integration |cheroliv.com
|===
The file`CODER.adoc`on`cheroliv.com`contains concrete rules: _one`<h1>`per page_, _Prefix paths with`${content.rootpath}`_, _Declare language`<html lang="${content.lang!"fr"}">`_. These conventions, written once, are automatically respected by the agent since session 1.
The file`SCRUM_MASTER.adoc`imposes a deliverable structure :**Objective**, **Tasks**(coordinates with assignment),**Acceptance criteria**, **Risks**. When I ask for an action plan, the agent produces this structure without me having asked for it. The governance**program**the agent.
==== When Specialized Agents Become Indispensable
The creation of specialized agents follows a natural curve. At the beginning of a project, you don't need them —`AGENT.adoc`is more than enough. But when the project grows (let's say, beyond 20 sessions), two signals must alert you :
1. The agent mixes the conventions of two distinct fields (e.g., PlantUML syntax and CSS rules)
2. You spend more time correcting the agent on conventions that you have already explained to him 5 times.
On`cheroliv.com`, it happened during the session... 1. Yes, right from the start. Because this project is a website with three languages (FTL, CSS, JS), AsciiDoc content, and PlantUML diagrams — three domains that have nothing to do with each other. The CODER agent needs to know font sizes and media queries; the PLANTUML_DESIGNER agent needs to know the`@startuml`. Without separation, the CODER agent was proposing diagrams to me, and vice versa. The chaos.
On`jhipster-gradle-plugins`, I created two specialized agents adapted for Gradle plugin development:`PLUGIN_DEVELOPER.adoc` et `BACKLOG_MANAGER.adoc`. The first encodes all Kotlin/Gradle conventions (no`!!`python import sys
def main(): data = sys.stdin.read() parts = data.split('`') for i in range(len(parts)): if i % 2 == 0: # outside backticks parts[i] = parts[i].replace("pour", "for").replace("les", "the").replace("modèles", "models") sys.stdout.write('`'.join(parts))
if __name__ == '__main__': main()`@TaskAction`for the tasks). The second knows that`persistence`must be stable before`assistant`doesn't start its development — a critical dependency in a monorepo.
The mistake not to make: create too many agents too early.`plantuml-plugin`It waited for session 108 before formalizing a specialized agent for the API key pool. Before that, the business context was contained in`AGENT.adoc`. The rule of thumb: a specialized agent is justified when its business domain exceeds 100 lines of documentation.
==== The Session Naming Convention
A detail that seems trivial but becomes critical when you reach 100 sessions. How to name the archive files?
I learned the hard way that a convention is necessary — four projects, four different formats at the start, and I got lost. Today, the convention I have settled on is:
{N}-{type}-{sujet-kebab-case}.adoc
Concrete examples :
* `1-chore-migration-gouvernance-agent.adoc`— session 1, type chore
* `10-solidification-tests.adoc`— session 10, without explicit type (the subject suffices)
* `036-debug-graphify-symlink-epic9.adoc`— session 36 with 3-digit number for sorting
The session number is the primary sorting criterion. Projects using three‑digit numbers (001, 036, 133) avoid lexical sorting problems when exceeding 99. This is what I now use on`magic-stick`:`001-init-projet.adoc`, `036-debug-graphify-symlink-epic9.adoc`.
[plantuml, format=svg, id=diag-naming-convention, alt="Arbre de décision pour le nommage des fichiers de session"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 200
title Session Naming Convention
start
:A session ends;
note right: Trigger "end of session"
if (Session antérieure\nà la gouvernance ?) then (oui)
:Number **NÉGATIF**\n-6, -5 ... 0;
note right: Reconstructed history
:Suffix: reconstruction;
else (non)
:Number **POSITIF**\nwith 3 digits if > 99;
note right: 001, 036, 133\nfor lexicographic sorting
:Detect the **TYPE**;
if (Mots-clés trouvés ?) then (oui)
:debug / feature / refactor\ndocs / chore / test;
else (non)
:Omit the type\n(the subject is enough);
endif
:Formulate the **SUJET** in kebab-case;
note right
E.g.: fix-timeout-integration-test
Must make it possible to find
without opening the file
end note
endif
:Final name: {N}-{type}-{sujet}.adoc;
note right
• 1-chore-migration-gouvernance.adoc
• 036-debug-graphify-symlink.adoc
• 124-fix-timeout-integration-test.adoc
• 133-epic11-article-blog-kg.adoc
end note
if (Session documentée ?) then (oui)
:Create archive in sessions/;
:Add line SESSIONS_HISTORY\nwith score X/10;
else (non)
:Add line SESSIONS_HISTORY\nwith score **?**\n**without archive**;
note right: Honesty\nrather than emptiness
endif
stop
@enduml
----
For reconstructed historical sessions (projects born before governance), I use negative numbers. On`cheroliv.com`, the sessions -6 to 0 cover the entire pre-governance history of the project. And for the "undocumented" or lost sessions, I create an entry in`SESSIONS_HISTORY.adoc`without a matching archive, with a score`?`. It's more honest than pretending.
[plantuml, format=svg, id=diag-naming-convention, alt="Arbre de décision pour le nommage des fichiers de session"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 200
title Session Naming Convention
start
:Une session se termine;
note right: Trigger "end of session"
if (Session antérieure\nà la gouvernance ?) then (oui)
:Numéro **NÉGATIF**\n-6, -5 ... 0;
note right: Historique\nreconstitué
:Suffixe : reconstitution;
else (non)
:Numéro **POSITIF**\nsur 3 chiffres si > 99;
note right: 001, 036, 133\npour le tri lexicographique
:Détecter le **TYPE**;
if (Mots-clés trouvés ?) then (oui)
:debug / feature / refactor\ndocs / chore / test;
else (non)
:Omettre le type\n(le sujet suffit);
endif
:Formuler le **SUJET** en kebab-case;
note right
Ex: fix-timeout-integration-test
Doit permettre de retrouver
sans ouvrir le fichier
end note
endif
:Nom final : {N}-{type}-{sujet}.adoc;
note right
• 1-chore-migration-gouvernance.adoc
• 036-debug-graphify-symlink.adoc
• 124-fix-timeout-integration-test.adoc
• 133-epic11-article-blog-kg.adoc
end note
if (Session documentée ?) then (oui)
:Créer archive dans sessions/;
:Ajouter ligne SESSIONS_HISTORY\navec score X/10;
else (non)
:Ajouter ligne SESSIONS_HISTORY\navec score **?**\n**sans archive**;
note right: L'honnêteté\nplutôt que le vide
endif
stop
@enduml
----
==== TEST_COVERAGE_ANALYSIS.adoc` — Step 5 Dissected
Step 5 of the session end procedure is the most mysterious. It says 'Update`TEST_COVERAGE_ANALYSIS.adoc`if tests have been added or modified. » But what does this file look like ?
on`plantuml-plugin`, it has evolved from a few lines to a complete structure. Here is its stabilized form:
[source]
----
= Analyse de Couverture de Tests
== Suivi des Tests
|===
| Classe de test | Type | Tests | Statut | Dernière MAJ
| PlantumlServiceTest | unit | 45/45 | ✅ PASS | 2026-04-23
| ApiKeyPoolTest | integration | 15/15 | ✅ PASS | 2026-04-20
|===
== Historique par Session
| Session | Tests ajoutés | Tests modifiés | Couverture
| 133 | 0 | 2 | 100%
| 132 | 5 | 0 | 100%
|===
----
The interest is not the file itself — it's the obligation to *note* what has changed. Without this step, after 50 sessions, you no longer know which tests cover what. The agent doesn't either. The file becomes the single source of truth for the project's test coverage.
[plantuml, format=svg, id=diag-session-flow, alt="Flux d'une session type avec Eager/Lazy et agents"]
----
@startuml
skinparam backgroundColor #FEFEFE
start
:Session start;
note right: The agent is a blank page
:Automatic EAGER loading;
note right
* AGENT.adoc (absolute rules)
* PROMPT_REPRISE.adoc (mission N)
* INDEX.adoc (project status)
end note
if (Mission claire ?) then (oui)
:Direct execution;
else (non)
:Load LAZY on request;
note right
* SESSIONS_HISTORY.adoc (past context)
* sessions/{N-1}-*.adoc (decisions)
* *_REFERENCE.adoc (architecture)
end note
endif
:Specialized agent delegation?;
if (CODER ?) then (oui)
:Bed CODER.adoc;
:Follows conventions FTL/CSS;
elseif (SCRUM Master ?) then (oui)
:Bed SCRUM_MASTER.adoc;
:Imposed deliverable structure;
elseif (PlantUML ?) then (oui)
:Bed PLANTUML_DESIGNER.adoc;
:Syntax PUML + integration;
else (non)
endif
:Session work;
:End of session (user trigger);
:6-step procedure;
note right
1. Archive sessions/N-*.adoc
2. Update PROMPT_REPRISE.adoc (N+1)
3. Update SESSIONS_HISTORY.adoc
4. Update INDEX.adoc
5. Update TEST_COVERAGE (if applicable)
6. Update COMPLETED_TASKS_ARCHIVE.adoc
end note
:Checklist [✅] x 6;
stop
@enduml
----
[plantuml, format=svg, id=diag-dualite-agent-index, alt="Comparaison entre AGENT.adoc (narratif) et INDEX.adoc (exécutif)"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
title Duality AGENT.adoc ←→ INDEX.adoc
left to right direction
rectangle "AGENT.adoc\n(Root — EAGER)" as AGENT #E3F2FD {
rectangle "📖 **Narrative Format**\nThe storytelling of the rule\nthe lesson learned, the context" as NARR
rectangle "🏗️ **Complete Architecture**\nProject structure, components\nDetailed US backlog" as ARCHI
rectangle "📋 **Explanatory Rules**\nWhy the rule exists\nHistory of the incident" as EXPL
}
rectangle "INDEX.adoc\n(.agents/ — EAGER)" as INDEX #E8F5E9 {
rectangle "⚡ **Executive Format**\nThe bare rule, without justification\nQuick consultation" as EXEC
rectangle "📊 **Roadmap & EPICs**\nSummary table\nProgress, Score, Priority" as ROAD
rectangle "🌐 **Project Portfolio**\nCross-functional view\n5 synchronized projects" as PORT
}
AGENT --> INDEX : "Agent reads AGENT.adoc\nonce to **understand**"
INDEX --> AGENT : "Agent rereads INDEX.adoc\neach session to **apply**"
note bottom of AGENT
Taille max : 200 lignes
end note
note bottom of INDEX
Taille max : 200 lignes
Source de vérité en cas de divergence
end note
@enduml
----
[plantuml, format=svg, id=diag-session-flow, alt="Flux d'une session type avec Eager/Lazy et agents"]
----
@startuml
skinparam backgroundColor #FEFEFE
start
:Début session;
note right: L'agent est une page blanche
:Chargement EAGER auto;
note right
* AGENT.adoc (règles absolues)
* PROMPT_REPRISE.adoc (mission N)
* INDEX.adoc (état projet)
end note
if (Mission claire ?) then (oui)
:Exécution directe;
else (non)
:Charge LAZY sur demande;
note right
* SESSIONS_HISTORY.adoc (contexte passé)
* sessions/{N-1}-*.adoc (décisions)
* *_REFERENCE.adoc (architechture)
end note
endif
:Délégation agent spécialisé ?;
if (CODER ?) then (oui)
:Lit CODER.adoc;
:Suit conventions FTL/CSS;
elseif (SCRUM Master ?) then (oui)
:Lit SCRUM_MASTER.adoc;
:Structure livrable imposée;
elseif (PlantUML ?) then (oui)
:Lit PLANTUML_DESIGNER.adoc;
:Syntaxe PUML + intégration;
else (non)
endif
:Travail de la session;
:Fin de session (trigger utilisateur);
:Procédure 6 étapes;
note right
1. Archive sessions/N-*.adoc
2. Maj PROMPT_REPRISE.adoc (N+1)
3. Maj SESSIONS_HISTORY.adoc
4. Maj INDEX.adoc
5. Maj TEST_COVERAGE (si applicable)
6. Maj COMPLETED_TASKS_ARCHIVE.adoc
end note
:Checklist [✅] x 6;
stop
@enduml
----
The diagram above shows the full lifecycle of a session. The key point is the split after the EAGER loading: either the mission is clear enough to execute directly (80% of cases), or the agent loads the LAZY to resolve an ambiguity (20% of cases). It is this discrimination that saves tokens.
== The End-of-Session Procedure: The Golden Rule
[plantuml, format=svg, id=diag-agents-tree, alt="Arborescence complète du dossier .agents/"]
----
@startuml
skinparam folderBackgroundColor #E3F2FD
skinparam folderBorderColor #1565C0
skinparam fileBackgroundColor #FFF3E0
skinparam fileBorderColor #EF6C00
folder ".agents/" as ROOT {
file "INDEX.adoc\n(EAGER -- 200 lines)" as IDX #E8F5E9
file "AGENT_SESSION_MANAGER.adoc\n(Template session)" as ASM
file "SESSION_CHECKLIST.adoc\n(When to change)" as CHK
file "PROCEDURES.adoc\n(6 steps + LAZY/EAGER)" as PRO
file "SESSIONS_HISTORY.adoc\n(All sessions)" as HIS
folder "sessions/" as SESS {
file "1-chore-migration.adoc" as S1
file "109-formalization-lazy.adoc" as S109 #FFECB3
file "133-epic11-article.adoc" as S133
file "... +130 others" as SMORE
}
folder "archives/" as ARCH {
file "COMPLETED_TASKS_2026-04.adoc" as CTA
file "SESSIONS_HISTORY_83-95.adoc" as SHIST
folder "sessions_summaries/" as SUM {
file "SESSION_64_SUMMARY.adoc" as SU64
file "SESSION_73_SUMMARY.adoc" as SU73
file "..." as SUMORE
}
folder "prompts_archive/" as PARCH {
file "PROMPT_REPRISE_S65.adoc" as PR65
file "PROMPT_REPRISE_S75.adoc" as PR75
file "..." as PMORE
}
}
}
IDX --> SESS : "Index"
IDX --> HIS : "Index"
IDX --> ARCH : "Reference"
note right of S109
Session 109 =
Formalisation stratégie
LAZY/EAGER
Token : ~25k → ~10k
end note
@enduml
----
Without this procedure, the Eager/Lazy strategy is useless. It is this that turns the session's work into persistent information. It executes**at the explicit request of the user**(keywords: "end of session", "I'm leaving", etc.), and it is**mandatory**-- no exception, no omission.
The file`SESSION_CHECKLIST.adoc`defines ideal session metrics:
* Duration: 15-30 minutes
* Modified files: 1-3 maximum
* LLM exchanges: 5-10 messages
* Context tokens: < 50k
[plantuml, format=svg, id=diag-end-session-flow, alt="Flux de la procédure de fin de session"]
----
@startuml
skinparam defaultTextAlignment center
skinparam wrapWidth 200
skinparam activityBackgroundColor #E3F2FD
start
:L'utilisateur dit "end of session";
note right: Trigger keywords
:Agent detects the trigger;
:Step 1\nCreate archive\n`.agents/sessions/N-*.adoc`;
note right: The entire session context
:Step 2\nMettre up to date\n`PROMPT_REPRISE.adoc`;
note right: Mission N + acceptance criteria N+1
:Step 3\nMettre up to date\n`SESSIONS_HISTORY.adoc`;
note right: Summary line: # / Date / Type / Subject / Score
:Step 4\nMettre up to date\n`INDEX.adoc`;
note right: Current status, roadmap, modified files
:Step 5\nMettre up to date\n`TEST_COVERAGE_ANALYSIS.adoc`;
note right: If tests added or modified
:Step 6\nMettre up to date\n`COMPLETED_TASKS_ARCHIVE.adoc`;
note right: Archive completed tasks
:View the confirmation checklist;
note right: Check that each [✅] is earned
stop
@enduml
----
=== The Flux of the 6 Steps (Quietly)
[plantuml, format=svg, id=diag-end-session-flow, alt="Flux de la procédure de fin de session"]
----
@startuml
skinparam defaultTextAlignment center
skinparam wrapWidth 200
skinparam activityBackgroundColor #E3F2FD
start
:L'utilisateur dit "end of session";
note right: Mots-clés déclencheurs
:Agent détecte le trigger;
:Étape 1\nCréer archive\n`.agents/sessions/N-*.adoc`;
note right: Tout le contexte de la session
:Étape 2\nMettre à jour\n`PROMPT_REPRISE.adoc`;
note right: Mission N + critères d'acceptation N+1
:Étape 3\nMettre à jour\n`SESSIONS_HISTORY.adoc`;
note right: Ligne récap : # / Date / Type / Sujet / Score
:Étape 4\nMettre à jour\n`INDEX.adoc`;
note right: État courant, roadmap, fichiers modifiés
:Étape 5\nMettre à jour\n`TEST_COVERAGE_ANALYSIS.adoc`;
note right: Si tests ajoutés ou modifiés
:Étape 6\nMettre à jour\n`COMPLETED_TASKS_ARCHIVE.adoc`;
note right: Archiver tâches terminées
:Afficher la checklist de confirmation;
note right: Vérifier que chaque [✅] est mérité
stop
@enduml
----
=== Results of 150+ Sessions
Here is what this procedure gives when applied systematically to my four projects:
**plantuml-plugin**(empty)
* **133 sessions**since the beginning of the project
* **240/240 tests PASS**(100% coverage) -- EPICs 1-7 completed
* **57 Cucumber BDD scenarios**validated
* Safety rule on config files born from a real error (Session 2 bakery-plugin)
**bakery-plugin**</think>
* **11 sessions**in two weeks
* Supabase → Firebase migration completed (9 tests fixed)
* EPIC 6 (publishProfile) functional in production
* Rule 0 created:`publishToMavenLocal`mandatory after each modification
**magic-stick**:
* **23 sessions**to build a live Xubuntu system with A/B partition
* First ISO generated at session 10
* Formalized QEMU + VNC boot tests (LAZY documentation of 144 lines)
* Functional CI/CD on SourceForge
**cheroliv.com**:
* **9 formal sessions**+ reconstitution of 7 pre-system sessions
* Article 0101 (OpenCode PATH) published
* Article 0108 (this one) rewritten after analysis of its shortcomings
* Complete governance migrated from Markdown to AsciiDoc
=== The Final Checklist
After silent execution of the 6 steps, the agent must display a confirmation checklist:
✅ Procédure de fin de session exécutée 📋 Checklist :
**Absolute rule**: no step can be marked`[✅]`if the file has not actually been modified and verified
== Bootstrap Guide: Day 1, Session 0
You're convinced by the method. You want to apply it to a new project. Where to start?
[plantuml, format=svg, id=diag-bootstrap, alt="Flux de bootstrap en 6 étapes pour initialiser la gouvernance agent sur un nouveau projet"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 250
skinparam activityBackgroundColor #E8F5E9
title Bootstrap Governance — Day 1, Session 0
start
:Step 0\nCréer **opencode.json**\n(6 lines, instructions: AGENT.adoc);
note right: The bridge that loads\nAGENT.adoc automatically
:Step 1\nCr create the folders\n**mkdir -p .agents/sessions/ .agents/archives/**;
note right: The empty containers\nbefore the agent writes in them
:Step 2\nCreate **AGENT.adoc**\n(200 lines, absolute rules);
note right: The minimal master file\nStructure v1
:Step 3\nCrcreate **PROMPT_REPRISE.adoc**\nMission session 1 (max 70 lines);
note right: What the agent must\ndo at the next session
:Step 4\nCreate **.agents/INDEX.adoc** executive \nRules + roadmap;
note right: Entry point EAGER\nin folder LAZY
:Step 5\nCrcreate the LAZY structuring files\n6 files: SESSIONS_HISTORY, CHECKLIST, etc.;
note right
• SESSIONS_HISTORY.adoc
• SESSION_CHECKLIST.adoc
• PROCEDURES.adoc
• AGENT_SESSION_MANAGER.adoc
• TEST_COVERAGE_ANALYSIS.adoc
• Specialized agents (if needed)
end note
:Step 6\nAjouter the project in the Portfolio\nMettre up to date TOUS the existing INDEX.adoc;
note right: Cross-functional maintenance`nObligatoire` but tedious
:✅ Bootstrap completed\nSession 1 ready;
note right: 20 minutes invested\nDes hundreds saved
stop
@enduml
----
Here is the exact procedure I followed, and that I will follow for any new project. Note well the order — it is important.
[plantuml, format=svg, id=diag-bootstrap, alt="Flux de bootstrap en 6 étapes pour initialiser la gouvernance agent sur un nouveau projet"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 250
skinparam activityBackgroundColor #E8F5E9
title Bootstrap Governance — Day 1, Session 0
start
:Étape 0\nCréer **opencode.json**\n(6 lignes, instructions: AGENT.adoc);
note right: Le pont qui charge\nAGENT.adoc automatiquement
:Étape 1\nCréer les dossiers\n**mkdir -p .agents/sessions/ .agents/archives/**;
note right: Les conteneurs vides\navant que l'agent écrive dedans
:Étape 2\nCréer **AGENT.adoc**\n(200 lignes, règles absolues);
note right: Le fichier maître\nStructure minimale v1
:Étape 3\nCréer **PROMPT_REPRISE.adoc**\nMission session 1 (max 70 lignes);
note right: Ce que l'agent doit\nfaire à la prochaine session
:Étape 4\nCréer **.agents/INDEX.adoc**\nRègles exécutives + roadmap;
note right: Point d'entrée EAGER\ndans le dossier LAZY
:Étape 5\nCréer les fichiers LAZY structurants\n6 fichiers : SESSIONS_HISTORY, CHECKLIST, etc.;
note right
• SESSIONS_HISTORY.adoc
• SESSION_CHECKLIST.adoc
• PROCEDURES.adoc
• AGENT_SESSION_MANAGER.adoc
• TEST_COVERAGE_ANALYSIS.adoc
• Agents spécialisés (si besoin)
end note
:Étape 6\nAjouter le projet au Portefeuille\nMettre à jour TOUS les INDEX.adoc existants;
note right: Maintenance transverse\nObligatoire mais fastidieuse
:✅ Bootstrap terminé\nSession 1 prête;
note right: 20 minutes investies\nDes centaines économisées
stop
@enduml
----
=== Step 0: Create `opencode.json
This is the first file. Not`AGENT.adoc`, not`INDEX.adoc`.`opencode.json`First, for a simple reason: if you create`AGENT.adoc`first, you will forget to create the bridge that loads it automatically. I did it on`bakery-plugin`, I know what I'm talking about.
=== Step 1: Create the Folders
[source,bash]
----
mkdir -p .agents/sessions .agents/archives
----
Two empty folders.`sessions/`will receive the archives of each session`archives/`will receive the monthly COMPLETED_TASKS_ARCHIVE. These folders must exist *before* the agent needs to write in them. An agent that must create the folder AND the file at the same time is an agent that can fail silently.
=== Step 2: Create `AGENT.adoc` — The Master File
Minimal structure for the first version (it will grow):
[source]
----
= {NOM_PROJET} — Directives Agent
[CAUTION]
----
[plantuml, format=svg, id=diag-naming-convention, alt="Arbre de décision pour le nommage des fichiers de session"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 200
title Session Naming Convention
start
:Une session se termine;
note right: Trigger "end of session"
if (Session antérieure\nà la gouvernance ?) then (oui)
:Numéro **NÉGATIF**\n-6, -5 ... 0;
note right: Historique\nreconstitué
:Suffixe : reconstitution;
else (non)
:Numéro **POSITIF**\nsur 3 chiffres si > 99;
note right: 001, 036, 133\npour le tri lexicographique
:Détecter le **TYPE**;
if (Mots-clés trouvés ?) then (oui)
:debug / feature / refactor\ndocs / chore / test;
else (non)
:Omettre le type\n(le sujet suffit);
endif
:Formuler le **SUJET** en kebab-case;
note right
Ex: fix-timeout-integration-test
Doit permettre de retrouver
sans ouvrir le fichier
end note
endif
:Nom final : {N}-{type}-{sujet}.adoc;
note right
• 1-chore-migration-gouvernance.adoc
• 036-debug-graphify-symlink.adoc
• 124-fix-timeout-integration-test.adoc
• 133-epic11-article-blog-kg.adoc
end note
if (Session documentée ?) then (oui)
:Créer archive dans sessions/;
:Ajouter ligne SESSIONS_HISTORY\navec score X/10;
else (non)
:Ajouter ligne SESSIONS_HISTORY\navec score **?**\n**sans archive**;
note right: L'honnêteté\nplutôt que le vide
endif
stop
@enduml
----
1. Read the entire file
2. VERIFY git ls-files
3. REQUEST confirmation
4. WAIT "yes
== Project
**Name**: ... **Stack**: ... **Documentation**: AsciiDoc
== Absolute Rules
=== 0. DEVELOPMENT ENVIRONMENT
Essential commands...
=== 1. COMMITS/GIT
[plantuml, format=svg, id=diag-session-flow, alt="Flux d'une session type avec Eager/Lazy et agents"]
----
@startuml
skinparam backgroundColor #FEFEFE
start
:Début session;
note right: L'agent est une page blanche
:Chargement EAGER auto;
note right
* AGENT.adoc (règles absolues)
* PROMPT_REPRISE.adoc (mission N)
* INDEX.adoc (état projet)
end note
if (Mission claire ?) then (oui)
:Exécution directe;
else (non)
:Charge LAZY sur demande;
note right
* SESSIONS_HISTORY.adoc (contexte passé)
* sessions/{N-1}-*.adoc (décisions)
* *_REFERENCE.adoc (architechture)
end note
endif
:Délégation agent spécialisé ?;
if (CODER ?) then (oui)
:Lit CODER.adoc;
:Suit conventions FTL/CSS;
elseif (SCRUM Master ?) then (oui)
:Lit SCRUM_MASTER.adoc;
:Structure livrable imposée;
elseif (PlantUML ?) then (oui)
:Lit PLANTUML_DESIGNER.adoc;
:Syntaxe PUML + intégration;
else (non)
endif
:Travail de la session;
:Fin de session (trigger utilisateur);
:Procédure 6 étapes;
note right
1. Archive sessions/N-*.adoc
2. Maj PROMPT_REPRISE.adoc (N+1)
3. Maj SESSIONS_HISTORY.adoc
4. Maj INDEX.adoc
5. Maj TEST_COVERAGE (si applicable)
6. Maj COMPLETED_TASKS_ARCHIVE.adoc
end note
:Checklist [✅] x 6;
stop
@enduml
----
=== 1b. CONFIGURATION FILES — ABSOLUTE SAFETY RULE
Never crush...
=== 2. End-of-Session Tests
Formal prohibition...
=== 3. END OF SESSION PROCEDURE
The 6 mandatory steps...
== Context Management — LAZY/EAGER
Files EAGER / Files LAZY...
[plantuml, format=svg, id=diag-end-session-flow, alt="Flux de la procédure de fin de session"]
----
@startuml
skinparam defaultTextAlignment center
skinparam wrapWidth 200
skinparam activityBackgroundColor #E3F2FD
start
:L'utilisateur dit "end of session";
note right: Mots-clés déclencheurs
:Agent détecte le trigger;
:Étape 1\nCréer archive\n`.agents/sessions/N-*.adoc`;
note right: Tout le contexte de la session
:Étape 2\nMettre à jour\n`PROMPT_REPRISE.adoc`;
note right: Mission N + critères d'acceptation N+1
:Étape 3\nMettre à jour\n`SESSIONS_HISTORY.adoc`;
note right: Ligne récap : # / Date / Type / Sujet / Score
:Étape 4\nMettre à jour\n`INDEX.adoc`;
note right: État courant, roadmap, fichiers modifiés
:Étape 5\nMettre à jour\n`TEST_COVERAGE_ANALYSIS.adoc`;
note right: Si tests ajoutés ou modifiés
:Étape 6\nMettre à jour\n`COMPLETED_TASKS_ARCHIVE.adoc`;
note right: Archiver tâches terminées
:Afficher la checklist de confirmation;
note right: Vérifier que chaque [✅] est mérité
stop
@enduml
----
=== Step 3: Create `PROMPT_REPRISE.adoc` — The Mission Session 1
A file that explicitly says: "This is session 1, mission to define." Maximum 70 lines, with a Session 0 section (bootstrap summary) and a Session 1 section (priorities to define with the user).
=== Step 4 : Create `.agents/INDEX.adoc` — The Entry Point
The file that will contain the absolute rules (executive version) and the session table. For the bootstrap, it lists rules 0 to 3 in their concise format, the project portfolio (including the new project with a 🆕 emoji), and the empty roadmap ready to be filled.
=== Step 5: Create the Structuring LAZY Files
In order:
1. `.agents/SESSIONS_HISTORY.adoc`— a table with only session 0
2. `.agents/SESSION_CHECKLIST.adoc`— the template « When to change session
3. `.agents/PROCEDURES.adoc`— the complete procedure of the 6 steps + EAGER/LAZY
4. `.agents/AGENT_SESSION_MANAGER.adoc`— the archive template
5. `.agents/TEST_COVERAGE_ANALYSIS.adoc`— the test tracking table, empty at first
If your project has a complex business domain (like`jhipster-gradle-plugins`with its mono-repo persistence/assistant), create the specialized agents now:
1. `.agents/PLUGIN_DEVELOPER.adoc`— code conventions and the dependency boundary (if plugin)
2. `.agents/BACKLOG_MANAGER.adoc`— the planning structure and the identified risks
Do not create agents that you will not use. An agent without concrete conventions to encode is a dead file that pollutes.`.agents/`.
=== Step 6: Add the Project to the Portfolio of ALL Projects
It's the step we systematically forget. Each`INDEX.adoc`Each project contains a "Project Portfolio" table that lists all projects using the same methodology. When you create a new project, you must:
1. Add a line to the new project's portfolio (logic)
2. Add a line in the portfolio of ALL existing projects — yes, all
[plantuml, format=svg, id=diag-portfolio-graph, alt="Graphe du portefeuille de projets — références croisées entre INDEX.adoc"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam nodeBackgroundColor #E3F2FD
title Project Portfolio — Cross-References INDEX.adoc
node "**magic-stick**\nSession 037\nSCRIPT_VERIFICATION" as MS #E1BEE7
node "**bakery-gradle**\nSession 11\nTEST_COVERAGE" as BG #FFE0B2
node "**cheroliv.com**\nSession 10\nTEST_COVERAGE" as CH #C8E6C9
node "**plantuml-gradle**\nSession 133\nTEST_COVERAGE" as PG #BBDEFB
node "**jhipster-gradle**\nSession 1 🆕\nTEST_COVERAGE" as JG #FFCDD2
MS --> BG : INDEX.adoc reference
MS --> CH : INDEX.adoc reference
MS --> PG : INDEX.adoc reference
MS --> JG : INDEX.adoc reference 🆕
BG --> MS : INDEX.adoc reference
BG --> CH : INDEX.adoc reference
BG --> PG : INDEX.adoc reference
BG --> JG : INDEX.adoc reference 🆕
CH --> MS : INDEX.adoc reference
CH --> BG : INDEX.adoc reference
CH --> PG : INDEX.adoc reference
CH --> JG : INDEX.adoc reference 🆕
PG --> MS : INDEX.adoc reference
PG --> BG : INDEX.adoc reference
PG --> CH : INDEX.adoc reference
PG --> JG : INDEX.adoc reference 🆕
JG --> MS : INDEX.adoc` reference
JG --> BG : INDEX.adoc reference
JG --> CH : INDEX.adoc reference
JG --> PG : INDEX.adoc reference
note bottom of JG
When adding a project:
• 4 INDEX.adoc to update
• 1 line per portfolio
• Cost: 5 minutes
end note
legend bottom
|= Couleur |= Projet |
| <#E1BEE7> | magic-stick — ISO Linux live |
| <#FFE0B2> | bakery-gradle — Plugin JBake |
| <#C8E6C9> | cheroliv.com — Site personnel |
| <#BBDEFB> | plantuml-gradle — Plugin IA |
| <#FFCDD2> | jhipster-gradle — Mono-repo JHipster |
endlegend
@enduml
----
It's tedious. It's manual. It's also the only way to guarantee that, no matter what project you're working on, the agent knows what other projects exist and their status. At session 012 of`magic-stick`, the agent detected two inconsistencies in the portfolio —`bakery-gradle`had its COMPLETED_TASKS_ARCHIVE overdue, and`plantuml-gradle`He had a mismatch between his procedure documentation (5 steps) and his INDEX (6 steps). Without this cross‑table, these inconsistencies would have remained invisible.
[plantuml, format=svg, id=diag-portfolio-graph, alt="Graphe du portefeuille de projets — références croisées entre INDEX.adoc"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam nodeBackgroundColor #E3F2FD
title Project Portfolio — Cross References INDEX.adoc
node "**magic-stick**\nSession 037\nSCRIPT_VERIFICATION" as MS #E1BEE7
node "**bakery-gradle**\nSession 11\nTEST_COVERAGE" as BG #FFE0B2
node "**cheroliv.com**\nSession 10\nTEST_COVERAGE" as CH #C8E6C9
node "**plantuml-gradle**\nSession 133\nTEST_COVERAGE" as PG #BBDEFB
node "**jhipster-gradle**\nSession 1 🆕\nTEST_COVERAGE" as JG #FFCDD2
MS --> BG : INDEX.adoc référence
MS --> CH : INDEX.adoc référence
MS --> PG : INDEX.adoc référence
MS --> JG : INDEX.adoc référence 🆕
BG --> MS : INDEX.adoc référence
BG --> CH : INDEX.adoc référence
BG --> PG : INDEX.adoc référence
BG --> JG : INDEX.adoc référence 🆕
CH --> MS : INDEX.adoc référence
CH --> BG : INDEX.adoc référence
CH --> PG : INDEX.adoc référence
CH --> JG : INDEX.adoc référence 🆕
PG --> MS : INDEX.adoc référence
PG --> BG : INDEX.adoc référence
PG --> CH : INDEX.adoc référence
PG --> JG : INDEX.adoc référence 🆕
JG --> MS : INDEX.adoc référence
JG --> BG : INDEX.adoc référence
JG --> CH : INDEX.adoc référence
JG --> PG : INDEX.adoc référence
note bottom of JG
Quand on ajoute un projet :
• 4 INDEX.adoc à mettre à jour
• 1 ligne par portefeuille
• Coût : 5 minutes
end note
legend bottom
|= Couleur |= Projet |
| <#E1BEE7> | magic-stick — ISO Linux live |
| <#FFE0B2> | bakery-gradle — Plugin JBake |
| <#C8E6C9> | cheroliv.com — Site personnel |
| <#BBDEFB> | plantuml-gradle — Plugin IA |
| <#FFCDD2> | jhipster-gradle — Mono-repo JHipster |
endlegend
@enduml
----
I can hear you from here: "But that's duplication!" Yes. It's intentional duplication. Each`INDEX.adoc`is autonomous. If you open a session on`magic-stick`, the agent must know that`plantuml-gradle`It is at session 133 without having to open a file in another directory. That's the price of project independence — and it is 5 lines per portfolio.
=== What Bootstrap Costs
[plantuml, format=svg, id=diag-bootstrap, alt="Flux de bootstrap en 6 étapes pour initialiser la gouvernance agent sur un nouveau projet"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 250
skinparam activityBackgroundColor #E8F5E9
title Bootstrap Governance — Day 1, Session 0
start
:Étape 0\nCréer **opencode.json**\n(6 lignes, instructions: AGENT.adoc);
note right: Le pont qui charge\nAGENT.adoc automatiquement
:Étape 1\nCréer les dossiers\n**mkdir -p .agents/sessions/ .agents/archives/**;
note right: Les conteneurs vides\navant que l'agent écrive dedans
:Étape 2\nCréer **AGENT.adoc**\n(200 lignes, règles absolues);
note right: Le fichier maître\nStructure minimale v1
:Étape 3\nCréer **PROMPT_REPRISE.adoc**\nMission session 1 (max 70 lignes);
note right: Ce que l'agent doit\nfaire à la prochaine session
:Étape 4\nCréer **.agents/INDEX.adoc**\nRègles exécutives + roadmap;
note right: Point d'entrée EAGER\ndans le dossier LAZY
:Étape 5\nCréer les fichiers LAZY structurants\n6 fichiers : SESSIONS_HISTORY, CHECKLIST, etc.;
note right
• SESSIONS_HISTORY.adoc
• SESSION_CHECKLIST.adoc
• PROCEDURES.adoc
• AGENT_SESSION_MANAGER.adoc
• TEST_COVERAGE_ANALYSIS.adoc
• Agents spécialisés (si besoin)
end note
:Étape 6\nAjouter le projet au Portefeuille\nMettre à jour TOUS les INDEX.adoc existants;
note right: Maintenance transverse\nObligatoire mais fastidieuse
:✅ Bootstrap terminé\nSession 1 prête;
note right: 20 minutes investies\nDes centaines économisées
stop
@enduml
----
on`jhipster-gradle-plugins`, this bootstrap took me exactly 18 minutes — of`mkdir .agents/`at the last`INDEX.adoc`updated in the portfolio of`magic-stick`. Session 1, which will follow, will start with an agent who already knows the structure of the mono-repo, the Gradle commands, and the critical boundary between`persistence/`(lightweight) and`assistant/`(heavy). Twenty minutes well spent.
== The 4 (now 5) Projects, 5 Governances, 1 Method
The Eager/Lazy system is not a copy‑paste boilerplate. Each project has adapted the method to its specificities.
=== cheroliv.com : The Personal Site
**Specificity**: editorial content, WCAG 2.1 AA accessibility, static JBake **Adaptation**: Six prioritized epics (P0-P4), specialized agents (CODER, SCRUM_MASTER, PLANTUML_DESIGNER), cross-cutting acceptance criteria on accessibility. **Iconic rule** : `./gradlew serve`mandatory, formal prohibition of the script`jbake.sh`external.
=== bakery-gradle : The Multi-Purpose Plugin
**Specificity**: Plugin Gradle with publishing tasks, Firebase code generation, YAML parsing. **Adaptation**: Rule 0 (publishToMavenLocal), safety rule on config files strengthened by the incident of`site.yml`, EPIC 9 and 10 on the multi-file configuration. **Emblematic rule**:`publishToMavenLocal`after each modification of the plugin's source code.
=== plantuml-gradle : the AI plugin
**Specificité**: LangChain4j integration, generation of PlantUML diagrams via LLM, tests with cloud API keys. **Adaptation**: Dense LAZY documentation (ARCHITECTURE, API_KEY_POOL_REFERENCE, DATASET_FINETUNING), numbered EPICs (1-11 completed, 107+ in progress), optimized EAGER/LAZY separation (60% token gain). **Emblematic rule**: Files`*_ESSENTIALS.adoc`(50 lines) vs`*_REFERENCE.adoc`(unlimited) for the API key pool.
=== magic-stick: The Live System
**Specificity**: Build of Linux live ISO (Xubuntu), GPT A/B partitioning, CI/CD with SourceForge. **Adaptation**: Complex technical LAZY references (AB_PARTITION, BOOT_TEST), SCRIPT_VERIFICATION.adoc as specific step 5 (no traditional tests, but verification of bash scripts). **Emblematic rule**:`isoTestAB`skipped in CI (non privileged runners), tests reserved for local environments with Docker`--privileged`.
== Absolute Cross Rules
Some critical rules that appear in the file`AGENT.adoc`Eager and apply to all sessions on all projects:
**Development environment**
* �✅ Use the project-specific command`./gradlew serve`, `./gradlew functionalTest`, etc.)
* �❌ Forbidden to use unversioned external scripts
**Git**
* �✅ Read-only allowed (`git status`, `git diff`, `git log`)
* �❌`git add`, `git commit`, `git push`forbidden without explicit permission
* ❌`git commit --amend`forbidden except meticulously respected conditions
**Configuration Files**
* �❌ Never overwrite a config file with a`Write`complete when a`Edit`partial is enough
* ❌ Never replace sensitive values with dummy values
* Check`git check-ignore` et `git ls-files`before any modification
**Tests**
* �❌ Never run tests in end-of-session procedure without explicit permission
**Forbidden Tools**
* ❌`TodoWrite` et `Task`-- governance is done via the AsciiDoc files, not via external tools
[plantuml, format=svg, id=diag-antipatterns, alt="Les 7 anti-patterns de la gouvernance agent — arbre des pièges à éviter"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 180
title The 7 Anti-Patterns — What 150+ Sessions Taught Me
left to right direction
rectangle "⚠️ ANTI-PATTERNS" as ROOT #FFCDD2 {
together {
card "**1. Agent without**\n**opencode.json**" as AP1 #FFEBEE {
(AGENT.adoc jamais chargé)
(→ 20 min perdues/session)
}
card "**2. Too Many Agents**\n**Too Early**" as AP2 #FFEBEE {
(5 agents stubs vides)
(→ L'agent hésite)
(→ Seuil : 100 lignes\nou 5 règles concrètes)
}
card "**3. Ghost**\n**PROMPT_REPRISE**" as AP3 #FFEBEE {
(Mission a dérivé)
(→ PROMPT_REPRISE\nne reflète pas la réalité)
}
}
together {
card "**4. Empty**\n**Archive**" as AP4 #FFEBEE {
(Template rempli de\nplaceholders "TODO")
(→ « à compléter plus tard »\nn'arrive jamais)
}
card "**5. Ghost**\n**Portfolio**" as AP5 #FFEBEE {
(Nouveau projet créé)
(→ Pas ajouté aux\n4 autres INDEX.adoc)
(→ Agent croit avoir\n4 projets, en fait 5)
}
card "**6. Hidden**\n**Redundancy**" as AP6 #FFEBEE {
(Même backlog copié-collé)
(→ AGENT.adoc et INDEX.adoc\ndivergent)
(→ Règle : INDEX.adoc\n= source de vérité)
}
}
card "**7. Session Too**\n**Long**" as AP7 #FFEBEE {
(2h, 85 messages, 12 fichiers)
(→ LLM répète erreurs corrigées)
(→ Aurait dû splitter il y a 45 min)
}
}
note right of AP7
**Golden Rule**
5 × 20 min
>
1 × 2 hours
Follow SESSION_CHECKLIST
end note
@enduml
----
In hindsight, some mistakes have become such predictable patterns that I can list them as anti‑patterns — traps into which any new project will likely fall. Here they are, ordered by frequency.
[plantuml, format=svg, id=diag-antipatterns, alt="Les 7 anti-patterns de la gouvernance agent — arbre des pièges à éviter"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 180
title The 7 Anti-Patterns — What 150+ Sessions Taught Me
left to right direction
rectangle "⚠️ ANTI-PATTERNS" as ROOT #FFCDD2 {
together {
card "**1. Agent without**\n**opencode.json**" as AP1 #FFEBEE {
(AGENT.adoc jamais chargé)
(→ 20 min perdues/session)
}
card "**2. Too Many Agents**\n**Too Early**" as AP2 #FFEBEE {
(5 agents stubs vides)
(→ L'agent hésite)
(→ Seuil : 100 lignes\nou 5 règles concrètes)
}
card "**3. PROMPT_REPRISE**\n**Ghost**" as AP3 #FFEBEE {
(Mission a dérivé)
(→ PROMPT_REPRISE\nne reflète pas la réalité)
}
}
together {
card "**4. Archive**\n**Empty**" as AP4 #FFEBEE {
(Template rempli de\nplaceholders "TODO")
(→ « à compléter plus tard »\nn'arrive jamais)
}
card "**5. Portfolio**\n**Ghost**" as AP5 #FFEBEE {
(Nouveau projet créé)
(→ Pas ajouté aux\n4 autres INDEX.adoc)
(→ Agent croit avoir\n4 projets, en fait 5)
}
card "**6. Redundancy**\n**Hidden**" as AP6 #FFEBEE {
(Même backlog copié-collé)
(→ AGENT.adoc et INDEX.adoc\ndivergent)
(→ Règle : INDEX.adoc\n= source de vérité)
}
}
card "7. Too Long Session" as AP7 #FFEBEE {
(2h, 85 messages, 12 fichiers)
(→ LLM répète erreurs corrigées)
(→ Aurait dû splitter il y a 45 min)
}
}
note right of AP7
**Règle d'Or**
5 × 20 min
>
1 × 2 heures
Respecter SESSION_CHECKLIST
end note
@enduml
----
=== Anti-Pattern 1 : The Agent without `opencode.json
It's the number one mistake. You wrote a magnificent`AGENT.adoc`of 200 lines, but it is never automatically loaded. The agent starts bare. You spend 20 minutes re‑contextualizing it — exactly what the method is supposed to avoid.
*Symptom* : The agent asks basic questions about the project structure while everything is in`AGENT.adoc`. *Correction* : Create`opencode.json`with the block`instructions: ["AGENT.adoc"]`. Check that the file exists in Opencode's working directory.
=== Anti-Pattern 2 : Too Many Agents Too Soon
In session 2 of your project, you create 5 specialized agents. None have real content, they are all stubs. Result:`.agents/`is cluttered with empty files, and the agent hesitates on which to load.
*Symptom*: Agent files containing only "To be defined" or an empty structure of 10 lines. *Correction*: A specialized agent is justified when its business domain exceeds 100 lines or it encodes at least 5 concrete rules. Below, the content fits in`AGENT.adoc`.
=== Anti-Pattern 3: The Ghost PROMPT_REPRISE
`PROMPT_REPRISE.adoc`is being updated... but only at the end of the session, when the agent runs the procedure. In the meantime, the session's actual mission has drifted — we fixed an unexpected bug instead of implementing the planned feature. the`PROMPT_REPRISE.adoc`end-of-session does not reflect what *really* happened.
*Symptom* : The "Priorities" section of`PROMPT_REPRISE.adoc`mentions a feature that hasn't been touched, while you spent the session on a critical bug. *Correction*: Update`PROMPT_REPRISE.adoc`in real time when the session deviates from its initial mission. Do not wait for the end-of-session procedure to document the change of direction. 30 seconds of editing during the session are worth more than a`PROMPT_REPRISE`lying.
=== Anti-Pattern 4 : The Empty Archive
The end-of-session procedure creates the archive... but the agent, eager to display their checklist, fills the template with placeholders.`{detail}`becomes « Detail to be completed later ». This « later » never arrives.
*Symptom*: Session archives containing the words "TODO", "to complete", or empty sections. *Correction*: The absolute rule says that no step can be marked [✅] if the file has not actually been modified. Apply it to yourself: reread the archive before displaying the checklist. If a section is empty, fill it in now.
=== Anti-Pattern 5 : The Ghost Portfolio
You are creating a new project with perfect governance. But you forget to add it to the portfolio of other projects. Three weeks later, you open a session on`magic-stick`and the agent tells you that you have 4 projects. You have 5. The agent doesn't know that.
*Symptom* : The counting of projects in portfolios does not match reality. *Correction* : Script the wallet update, or at minimum maintain a post-bootstrap checklist that includes 'Update the wallet for all existing projects'. This is the most tedious step of the method, and therefore the most often omitted.
[plantuml, format=svg, id=diag-portfolio-graph, alt="Graphe du portefeuille de projets — références croisées entre INDEX.adoc"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam nodeBackgroundColor #E3F2FD
title Project Portfolio — Cross-References INDEX.adoc
node "**magic-stick**\nSession 037\nSCRIPT_VERIFICATION" as MS #E1BEE7
node "**bakery-gradle**\nSession 11\nTEST_COVERAGE" as BG #FFE0B2
node "**cheroliv.com**\nSession 10\nTEST_COVERAGE" as CH #C8E6C9
node "**plantuml-gradle**\nSession 133\nTEST_COVERAGE" as PG #BBDEFB
node "**jhipster-gradle**\nSession 1 🆕\nTEST_COVERAGE" as JG #FFCDD2
MS --> BG : INDEX.adoc référence
MS --> CH : INDEX.adoc référence
MS --> PG : INDEX.adoc référence
MS --> JG : INDEX.adoc référence 🆕
BG --> MS : INDEX.adoc référence
BG --> CH : INDEX.adoc référence
BG --> PG : INDEX.adoc référence
BG --> JG : INDEX.adoc référence 🆕
CH --> MS : INDEX.adoc référence
CH --> BG : INDEX.adoc référence
CH --> PG : INDEX.adoc référence
CH --> JG : INDEX.adoc référence 🆕
PG --> MS : INDEX.adoc référence
PG --> BG : INDEX.adoc référence
PG --> CH : INDEX.adoc référence
PG --> JG : INDEX.adoc référence 🆕
JG --> MS : INDEX.adoc référence
JG --> BG : INDEX.adoc référence
JG --> CH : INDEX.adoc référence
JG --> PG : INDEX.adoc référence
note bottom of JG
Quand on ajoute un projet :
• 4 INDEX.adoc à mettre à jour
• 1 ligne par portefeuille
• Coût : 5 minutes
end note
legend bottom
|= Couleur |= Projet |
| <#E1BEE7> | magic-stick — ISO Linux live |
| <#FFE0B2> | bakery-gradle — Plugin JBake |
| <#C8E6C9> | cheroliv.com — Site personnel |
| <#BBDEFB> | plantuml-gradle — Plugin IA |
| <#FFCDD2> | jhipster-gradle — Mono-repo JHipster |
endlegend
@enduml
----
You copy-paste the same backlog of 50 lines in`AGENT.adoc` et `INDEX.adoc`. At the next session, you update one but not the other. Your two EAGER files conflict.
*Symptom*: differences between the EPICs listed in`AGENT.adoc`and those in`INDEX.adoc`. *Correction* : Redundancy must be *assumed and bounded*.`AGENT.adoc`contains the detailed backlog with user stories`INDEX.adoc`contains ONLY the summary table of EPICs (name, progress, priority). If the two diverge, it's`INDEX.adoc`which is considered authoritative — because it is the one that is updated at the end of each session. Document this rule in your`AGENT.adoc`In case of divergence between `AGENT.adoc` and `INDEX.adoc`, `INDEX.adoc` is the source of truth.
=== Anti-Pattern 7: The Overly Long Session
You ignore the signals of`SESSION_CHECKLIST.adoc`. 2 hours, 85 messages, 12 files modified. The agent is looping, as are you. You should have switched session 45 minutes ago.
*Symptom*: The LLM repeats errors already corrected, the context tokens exceed 80k, you have modified both`persistence/` et `assistant/`in the same session. *Correction* : the`SESSION_CHECKLIST.adoc`exists for a reason. Respect it. The golden rule is not a suggestion. 5 sessions of 20 minutes > 1 session of 2 hours.
== Why AsciiDoc ?
I chose AsciiDoc for several pragmatic reasons that have a direct impact on governance efficiency:
1. **Rich semantic structure**: sections, tables, admonitions, document attributes. An agent reads a structured document better than a block of text.
2. **Document attributes** (`:jbake-type:`, `:jbake-status:`) that allow defining machine- and human-readable metadata.
3. **Compatibility with JBake**: my static site is generated by JBake, which natively processes AsciiDoc. Governance files and blog posts share the same format. My blog post *on* governance is written in the same format as governance itself.
4. **Longevity**: AsciiDoc is a proven technical documentation format, with a stable specification.
== Result: A seamless continuity
Since I set up this system, switching from one Opencode session to another has become seamless. The agent picks up exactly where I left it, without me having to recontextualize anything.
The decisions made in session 3 are accessible in session 133. The backlog remains consistent across five simultaneous projects. Security rules (especially regarding git and configuration files) are respected because they are ubiquitous in the Eager file.
The numbers speak:
* **150+ archived sessions**in total
* **60% of EAGER tokens saved**after optimization (Session 109)
* **No recall needed**on the business context of the API key pool
* **100% of tests PASS**on plantuml-plugin (240/240)
* **A single catastrophe**(Session 2 bakery-plugin) which gave rise to the absolute safety rule
It's a**artisanal system**, built with the tools of the trade (AsciiDoc, git, Gradle), without dependence on a proprietary platform. It reflects my fundamental conviction:**A credible developer builds and uses his own tools**.
---
* My site : [cheroliv.com](https://cheroliv.com)
* The project`bakery-gradle`: [github.com/cheroliv/bakery-gradle-plugin](https://github.com/cheroliv/bakery-gradle-plugin)
* The project`plantuml-gradle`: [github.com/cheroliv/plantuml-gradle-plugin](https://github.com/cheroliv/plantuml-gradle-plugin)
* The project`magic-stick`: [github.com/cheroliv/magic-stick](https://github.com/cheroliv/magic-stick)
* The project`cheroliv.com`: [github.com/cheroliv/cheroliv.github.io](https://github.com/cheroliv/cheroliv.github.io)
----
I'll output nothing.`*_ESSENTIALS.adoc`-- A recent addition (Session 109, plantuml-plugin) to further optimize the eager context. Instead of loading 200 lines of business context on the API key pool, I load 50 essential lines, and the other 150 lines remain LAZY in`*_REFERENCE.adoc`.
Measured result: passage of**~25k tokens EAGER to ~10k tokens**(60% gain). The agent no longer needs energy‑intensive reminders.
==== Missing Link: `opencode.json
I must confess something I almost forgot to document. Above all these `.adoc` files there is a tiny JSON file without which nothing works. It's called`opencode.json`and it is six lines. Literally six lignes. Wait error: need English. Let's write:
` and it is six lines. Literally six lines.`
Yes.
</think>
and it is six lines. Literally six lines.
[source,json]
----
{
"$schema": "https://opencode.ai/config.json",
"instructions": [
"AGENT.adoc"
]
}
----
This is the file that tells Opencode : « At startup, load`AGENT.adoc`automatically." Without him, the agent is a blank page exactly as I described at the beginning of the article. With him, the agent already has in hand the absolute rules, the project architecture, and the essential commands—even before I say hello.
I discovered the importance of this file by chance. On`bakery-plugin`, it did not exist. I was wondering why the agent was systematically more 'lost' on this project than on the others. The absolute rules were well within`AGENT.adoc`— but`AGENT.adoc`it was never loaded. The agent read only what I told him to read, manually, at each session. it was session 11 of`bakery-plugin`when I realized the lack of`opencode.json`. I created it — and session 12 started like the others.
This file is so obvious to me now that I don’t even think about it anymore—a classic mistake made by developers who know their tools too well. Today I systematically create it *up front*.`AGENT.adoc`. It's the first stone.
==== The Duality of `INDEX.adoc
Another subtlety that deserves to be made explicit:`INDEX.adoc`lives in`.agents/`— A file that I presented as `LAZY`. Yet I list it as `EAGER` in all my tables. There is an apparent tension here.
The field reality: the files`.agents/INDEX.adoc`are automatically loaded correctly at the start of the session, just like`AGENT.adoc` et `PROMPT_REPRISE.adoc`. They are in`.agents/`for organizational reasons — not invading the root — but their behavior is EAGER.
on`plantuml-plugin`, `INDEX.adoc`It consists of 200 lines and contains the absolute rules complete with their history (the lessons from past sessions), the EPICs with scores, and the project portfolio. This is the document the agent consults to know 'where we stand'. on`bakery-plugin`, it makes 150 lines with the roadmap and the recent sessions.
Voluntary redundancy between`AGENT.adoc` et `INDEX.adoc`It can be surprising. The absolute rules are present in both. Why? Because they fulfill two different roles: in`AGENT.adoc`, they are *explanatory* (the storytelling of the rule, the lesson learned); in`INDEX.adoc`, they are *executive* (the naked rule, without justification, for a quick look‑up). The agent reads`AGENT.adoc`once for *understanding*; he rereads`INDEX.adoc`in each session to apply. Two uses, two formats.
[plantuml, format=svg, id=diag-dualite-agent-index, alt="Comparaison entre AGENT.adoc (narratif) et INDEX.adoc (exécutif)"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
title Duality AGENT.adoc ←→ INDEX.adoc
left to right direction
rectangle "AGENT.adoc\n(Racine — EAGER)" as AGENT #E3F2FD {
rectangle "📖 **Narrative Format**\nLe storytelling of the rule\n the lesson learned, the context" as NARR
rectangle "🏗️ **Complete Architecture**\nStructure project, components\nBacklog detailed US" as ARCHI
rectangle "📋 **Explanatory Rules**\nPourquoi the rule exists\nHistorique of the incident" as EXPL
}
rectangle "INDEX.adoc\n(.agents/ — EAGER)" as INDEX #E8F5E9 {
rectangle "⚡ **Executive Format**\nLa bare rule, without justification\nConsultation quick" as EXEC
rectangle "📊 **Roadmap & EPICs**\nTableau summary\nProgression, Score, Priority" as ROAD
rectangle "🌐 **Project Portfolio**\nVue cross-functional\n5 synchronized projects" as PORT
}
AGENT --> INDEX : "Agent reads AGENT.adoc\nonce to **understand**"
INDEX --> AGENT : "Agent rereads INDEX.adoc\neach session to **apply**"
note bottom of AGENT
Max size: 200 lines
end note
note bottom of INDEX
Max size: 200 lines
Source de vérité en cas de divergence
end note
@enduml
----
This assumed redundancy is a design choice. It consumes about 50 extra lines of EAGER tokens—but it ensures that the agent always has the rules in view, even in the concise format that facilitates immediate obedience.
=== The Lazy Files: The Owner's Manual
These files live in`.agents/`and are read only when the agent needs them. They constitute the true wealth of the method, because they accumulate the project's knowledge without polluting the current context.
[plantuml, format=svg, id=diag-agents-tree, alt="Arborescence complète du dossier .agents/"]
----
@startuml
skinparam folderBackgroundColor #E3F2FD
skinparam folderBorderColor #1565C0
skinparam fileBackgroundColor #FFF3E0
skinparam fileBorderColor #EF6C00
folder ".agents/" as ROOT {
file "INDEX.adoc\n(EAGER -- 200 lignes)" as IDX #E8F5E9
file "AGENT_SESSION_MANAGER.adoc\n(Template session)" as ASM
file "SESSION_CHECKLIST.adoc\n(Quand changer)" as CHK
file "PROCEDURES.adoc\n(6 étapes + LAZY/EAGER)" as PRO
file "SESSIONS_HISTORY.adoc\n(Toutes sessions)" as HIS
folder "sessions/" as SESS {
file "1-chore-migration.adoc" as S1
file "109-formalisation-lazy.adoc" as S109 #FFECB3
file "133-epic11-article.adoc" as S133
file "... +130 others" as SMORE
}
folder "archives/" as ARCH {
file "COMPLETED_TASKS_2026-04.adoc" as CTA
file "SESSIONS_HISTORY_83-95.adoc" as SHIST
folder "sessions_summaries/" as SUM {
file "SESSION_64_SUMMARY.adoc" as SU64
file "SESSION_73_SUMMARY.adoc" as SU73
file "..." as SUMORE
}
folder "prompts_archive/" as PARCH {
file "PROMPT_REPRISE_S65.adoc" as PR65
file "PROMPT_REPRISE_S75.adoc" as PR75
file "..." as PMORE
}
}
}
IDX --> SESS : "Indexes"
IDX --> HIS : "Indexes"
IDX --> ARCH : "Reference"
note right of S109
Session 109 =
Strategy formalization
LAZY/EAGER
Token: ~25k → ~10k
end note
@enduml
----
The hierarchy shown above reflects the actual structure of the folder.`.agents/`on`plantuml-plugin`, the most mature project. Note the depth in three layers: root files (metadata), folder`sessions/`(chronological archives), and file`archives/`(aggregations and summaries). It is this depth that transforms governance from a simple TODO file into a**complete organizational memory**.
**.agents/sessions/{N}-{titre}.adoc**Detailed archives of each session. Currently:
* `plantuml-plugin` : **133 archived sessions**\n (of the session 1 to 133)
* `bakery-plugin`:**11 sessions**
* `magic-stick`(Empty)**23 sessions**
* `cheroliv.com`:**9 formal sessions**+ 7 pre‑system sessions reconstructed retroactively
Each archive contains the full context of the session, the decisions made, the problems encountered and their resolution, the commands executed and their output.
**.agents/SESSIONS_HISTORY.adoc**A summary table of all sessions with a score. Example on`cheroliv.com` :
----
| -6 | 2025-05 | chore | Initialisation projet Gradle/JBake | 7/10 | 1 | 2026-04-25 | chore | Migration gouvernance agent | 8/10 | 7 | 2026-04-27 | debug/fix | Correction publishSite | 9/10 | 8 | 2026-04-27 | analyse | Analyse article 0108 | 7/10
**.agents/COMPLETED_TASKS_ARCHIVE_{mois}.adoc**Completed tasks archived by month, so as not to overload the active backlog. When a user story is completed, it migrates here. The backlog stays readable: maximum 10 active items.
**.agents/PROCEDURES.adoc**-- Detailed templates of the end-of-session procedure. Long, but read only once by the agent when learning the method. Then the procedure becomes mechanical.
**.agents/AGENT_MODUS_OPERANDI.adoc**-- The complete strategic documentation. About`plantuml-plugin`, this file does**900+ lines**and is actually called`AGENT_METHODOLOGIES.adoc`— I changed the name between writing this article and its actual implementation. This kind of naming divergence is inevitable in an evolving homemade system. The important thing is the naming convention: if the file documents the *method*, it starts with`AGENT_`or an explicit prefix. It documents the Eager/Lazy methodology, the patterns to follow, the anti-patterns to avoid. It is LAZY because an agent does not need to reread the whole strategy each session, only when there is ambiguity.
(No content)`*_REFERENCE.adoc`The project‑specific technical references.`magic-stick`, two dense LAZY files :
* `AB_PARTITION_REFERENCE.adoc`(147 lines) -- A/B partition architecture for GPT, scripts`update-system.sh`, estimated sizes, rollback mechanism
* `BOOT_TEST_REFERENCE.adoc`(144 lines) -- Procedure QEMU + VNC for testing the ISO boot without physical hardware, BIOS/UEFI checklist, CI/CD limitations
On`plantuml-plugin` :
* `ARCHITECTURE.adoc`(134 lines) -- Structure of the 11 data classes, attention points (pitfalls to avoid), optimized test commands
* `API_KEY_POOL_REFERENCE.adoc`-- Complete details of the key pool (LAZY while)`ESSENTIALS`is EAGER)
== The Specialized Agents: A Virtual Team
Governance is not limited to passive files. I've formalized some**roles of specialized agents**In dedicated LAZY files, which define the expected workflow according to the task type.
|===
|Agent |File |role |Project |**CODE** |`CODER.adoc` |Implementation FTL/CSS/JS, semantic tags, accessibility criteria |cheroliv.com |**Scrum Master** |`SCRUM_MASTER.adoc` |US planning, breaking down into sub‑tasks, dependency detection |cheroliv.com |**PlantUML Designer** |`PLANTUML_DESIGNER.adoc` |Creating diagrams, PUML syntax, JBake integration |cheroliv.com
|===
The file`CODER.adoc`on`cheroliv.com`contains concrete rules : _Un seul`<h1>`per page_, _Prefix paths with`${content.rootpath}`_, _Declare the language`<html lang="${content.lang!"fr"}">`_. These conventions, written once, are automatically respected by the agent since session 1.
The file`SCRUM_MASTER.adoc`imposes a deliverable structure:**Objective**, **Tasks**(assigned coordinates),**Acceptance criteria**, **Risks**. When I ask for an action plan, the agent produces this structure without my having requested it. Governance**program**the agent.
[plantuml, format=svg, id=diag-dualite-agent-index, alt="Comparaison entre AGENT.adoc (narratif) et INDEX.adoc (exécutif)"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
title Duality AGENT.adoc ←→ INDEX.adoc
left to right direction
rectangle "AGENT.adoc\n(Racine — EAGER)" as AGENT #E3F2FD {
rectangle "📖 **Narrative Format**\nLe storytelling of the rule\nthe lesson learned, the context" as NARR
rectangle "🏗️ **Complete Architecture**\nStructure project, components\nBacklog detailed user story" as ARCHI
rectangle "📋 **Explanatory Rules**\nPourquoi the rule exists\nHistorique from the incident" as EXPL
}
rectangle "INDEX.adoc\n(.agents/ — EAGER)" as INDEX #E8F5E9 {
rectangle "⚡ **Executive Format**\nLa bare rule, without justification\nConsultation quick" as EXEC
rectangle "📊 **Roadmap & EPICs**\nTableau summary\nProgression, Score, Priority" as ROAD
rectangle "🌐 **Project Portfolio**\nVue cross-functional\n5 synchronized projects" as PORT
}
AGENT --> INDEX : "Agent reads AGENT.adoc\nonce to **understand**"
INDEX --> AGENT : "Agent rereads INDEX.adoc\neach session to **apply**"
note bottom of AGENT
Max size: 200 lines
end note
note bottom of INDEX
Max size: 200 lines
Source de vérité en cas de divergence
end note
@enduml
----
The creation of specialized agents follows a natural curve. At the start of a project, you don't need them —`AGENT.adoc`is largely sufficient. But when the project grows (say, beyond 20 sessions), two signals should alert you:
1. The agent mixes the conventions of two distinct domains (e.g., PlantUML syntax and CSS rules)
2. You spend more time correcting the agent on conventions that you have already explained five times.
On`cheroliv.com`, it's arrived at the session... 1. Yes, right from the start. Because this project is a website with three languages (FTL, CSS, JS), AsciiDoc content, and PlantUML diagrams — three domains that have nothing to do with each other. The CODER agent needs to know font sizes and media queries ; the PLANTUML_DESIGNER agent needs to know the syntax`@startuml`. Without separation, the CODER agent proposed diagrams to me, and vice versa. Chaos.
[plantuml, format=svg, id=diag-agents-tree, alt="Arborescence complète du dossier .agents/"]
----
@startuml
skinparam folderBackgroundColor #E3F2FD
skinparam folderBorderColor #1565C0
skinparam fileBackgroundColor #FFF3E0
skinparam fileBorderColor #EF6C00
folder ".agents/" as ROOT {
file "INDEX.adoc\n(EAGER -- 200 lignes)" as IDX #E8F5E9
file "AGENT_SESSION_MANAGER.adoc\n(Template session)" as ASM
file "SESSION_CHECKLIST.adoc\n(Quand changer)" as CHK
file "PROCEDURES.adoc\n(6 étapes + LAZY/EAGER)" as PRO
file "SESSIONS_HISTORY.adoc\n(Toutes sessions)" as HIS
folder "sessions/" as SESS {
file "1-chore-migration.adoc" as S1
file "109-formalisation-lazy.adoc" as S109 #FFECB3
file "133-epic11-article.adoc" as S133
file "... +130 others" as SMORE
}
folder "archives/" as ARCH {
file "COMPLETED_TASKS_2026-04.adoc" as CTA
file "SESSIONS_HISTORY_83-95.adoc" as SHIST
folder "sessions_summaries/" as SUM {
file "SESSION_64_SUMMARY.adoc" as SU64
file "SESSION_73_SUMMARY.adoc" as SU73
file "..." as SUMORE
}
folder "prompts_archive/" as PARCH {
file "PROMPT_REPRISE_S65.adoc" as PR65
file "PROMPT_REPRISE_S75.adoc" as PR75
file "..." as PMORE
}
}
}
IDX --> SESS : "Indexes"
IDX --> HIS : "Indexes"
IDX --> ARCH : "Reference"
note right of S109
Session 109 =
Strategy formalization
LAZY/EAGER
Token: ~25k → ~10k
end note
@enduml
----
The mistake not to make: creating too many agents too early.`plantuml-plugin`waited for session 108 before formalizing a specialized agent for the API key pool. Before that, the business context fit in`AGENT.adoc`. Rule of thumb: a specialized agent is justified when its business domain exceeds 100 lines of documentation.
==== The Session Naming Convention
A detail that seems trivial but becomes critical when reaching 100 sessions. How should archive files be named?
I learned the hard way that a convention is necessary—four projects, four different formats at first, and I got lost. Today, the convention I have established is:
----
{N}-{type}-{sujet-kebab-case}.adoc
Concrete examples :
* `1-chore-migration-gouvernance-agent.adoc`— session 1, type chore
* `10-solidification-tests.adoc`— session 10, without explicit type (the subject suffices)
* `036-debug-graphify-symlink-epic9.adoc`— session 36 with a three-digit number for sorting
The session number is the primary sorting criterion. Projects using three-digit numbers (001, 036, 133) avoid lexical sorting problems when exceeding 99. This is what I now use on`magic-stick`:`001-init-projet.adoc`, `036-debug-graphify-symlink-epic9.adoc`.
The type is optional and derived from session keywords (debug, feature, refactor, docs, chore, test). The subject in kebab-case is the most important part: it should allow you to find a session without opening the file. If you're wondering “what session was that where we fixed the integration test timeout?” the answer is`124-fix-timeout-integration-test.adoc`.
For historically reconstructed sessions (projects born before governance), I use negative numbers. On`cheroliv.com`, the sessions -6 to 0 cover the entire pre-governance history of the project. And for the sessions « non documentée » or lost, I create an entry in`SESSIONS_HISTORY.adoc`without corresponding archive, with a score`?`. It's more honest than pretending.
[plantuml, format=svg, id=diag-naming-convention, alt="Arbre de décision pour le nommage des fichiers de session"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 200
title Session Naming Convention
start
:A session ends;
note right: Trigger "end of session"
if (Session antérieure\nà la gouvernance ?) then (oui)
:Number **NÉGATIF**\n-6, -5 ... 0;
note right: Reconstructed history
:Suffix: reconstruction;
else (non)
:Number **POSITIF**\nwith 3 digits if > 99;
note right: 001, 036, 133\nfor lexicographic sorting
:Detect the **TYPE**;
if (Mots-clés trouvés ?) then (oui)
:debug / feature / refactor\ndocs / chore / test;
else (non)
:Omit the type\n(le sujet suffit);
endif
:Formulate the **SUJET** in kebab-case;
note right
Ex: fix-timeout-integration-test
Should allow finding
without opening the file
end note
endif
:Final name: {N}-{type}-{sujet}.adoc;
note right
• 1-chore-migration-gouvernance.adoc
• 036-debug-graphify-symlink.adoc
• 124-fix-timeout-integration-test.adoc
• 133-epic11-article-blog-kg.adoc
end note
if (Session documentée ?) then (oui)
:Create archive in sessions/;
:Add line SESSIONS_HISTORY\nwith score X/10;
else (non)
:Add line SESSIONS_HISTORY\nwith score **?**\n**without archive**;
note right: Honesty\nrather than emptiness
endif
stop
@enduml
----
==== TEST_COVERAGE_ANALYSIS.adoc` — Step 5 Explained
Step 5 of the end‑of‑session procedure is the most mysterious. It says "Update`TEST_COVERAGE_ANALYSIS.adoc`si tests have been added or modified. » But what does this file look like?
On`plantuml-plugin`, it has evolved from a few lines to a complete structure. Here is its stabilized form:
[source]
----
= Analyse de Couverture de Tests
== Suivi des Tests
|===
| Classe de test | Type | Tests | Statut | Dernière MAJ
| PlantumlServiceTest | unit | 45/45 | ✅ PASS | 2026-04-23
| ApiKeyPoolTest | integration | 15/15 | ✅ PASS | 2026-04-20
|===
== Historique par Session
| Session | Tests ajoutés | Tests modifiés | Couverture
| 133 | 0 | 2 | 100%
| 132 | 5 | 0 | 100%
|===
----
The interest is not the file itself — it's the obligation to *note* what has changed. Without this step, after 50 sessions you no longer know which tests cover what. Neither does the agent. The file becomes the single source of truth for test coverage of the project.
For projects without traditional tests (like`magic-stick`who tests Bash scripts), step 5 is replaced epar`SCRIPT_VERIFICATION.adoc`. The mechanism is the same: a file that tracks the state of script validation. Adapt step 5 to your project, but never skip it. It is the safety net that prevents silent regression.
If your project has *no* tests — neither unit, nor functional, nor script — still create the empty file with a section « To-do: define a test strategy. » This is a bookmark that will remind your future self that this topic hasn’t been addressed.
[plantuml, format=svg, id=diag-session-flow, alt="Flux d'une session type avec Eager/Lazy et agents"]
----
@startuml
skinparam backgroundColor #FEFEFE
start
:Session start;
note right: The agent is a blank page
:Loading EAGER auto;
note right
* AGENT.adoc (absolute rules)
* PROMPT_REPRISE.adoc (mission N)
* INDEX.adoc (project status)
end note
if (Mission claire ?) then (oui)
:Direct execution;
else (non)
:Load LAZY on demand;
note right
* SESSIONS_HISTORY.adoc (past context)
* sessions/{N-1}-*.adoc (decisions)
* *_REFERENCE.adoc (architecture)
end note
endif
:Delegation to a specialized agent?;
if (CODER ?) then (oui)
:Bed CODER.adoc;
:Follows conventions FTL/CSS;
elseif (SCRUM Master ?) then (oui)
:Bed SCRUM_MASTER.adoc;
:Imposed deliverable structure;
elseif (PlantUML ?) then (oui)
:Bed `PLANTUML_DESIGNER.adoc;
:Syntax PUML + integration;
else (non)
endif
:Session work;
:End of session (user trigger);
:6-Step Procedure;
note right
1. Archive sessions/N-*.adoc
2. Update PROMPT_REPRISE.adoc (N+1)
3. Update SESSIONS_HISTORY.adoc
4. Update INDEX.adoc
5. Update TEST_COVERAGE (if applicable)
6. Update COMPLETED_TASKS_ARCHIVE.adoc
end note
:Checklist [✅] x 6;
stop
@enduml
----
The diagram above shows the full lifecycle of a session. The key point is the fork after EAGER loading: either the mission is clear enough to execute directly (80% of cases) or the agent loads LAZY to resolve an ambiguity (20% of cases). This discrimination is what saves tokens.
== The End-of-Session Procedure: The Golden Rule
=== Why she is essential
Without this procedure, the Eager/Lazy strategy is worthless. This is what turns the session’s work into persistent information. It is executed**On the explicit request of the user**(keywords: "end of session", "I quit", etc.), and she is**mandatory**-- no exception, no omission.
The file`SESSION_CHECKLIST.adoc`defines ideal session metrics:
* Duration: 15-30 minutes
* Modified files: 1-3 maximum
* LLM exchanges: 5-10 messages
* (No visible output)
And signs that it is necessary to change the session: _The LLM repeats already corrected errors_, _More than 3 files modified in parallel_, _Conversation > 50 messages_. The golden rule:**Better five 20‑minute sessions than a two‑hour session full of debugging chaos.**
=== The Flow of the 6 Steps (Quietly)
[plantuml, format=svg, id=diag-end-session-flow, alt="Flux de la procédure de fin de session"]
----
@startuml
skinparam defaultTextAlignment center
skinparam wrapWidth 200
skinparam activityBackgroundColor #E3F2FD
start
:L'utilisateur dit "end of session";
note right: Trigger keywords
:Agent detects the trigger;
:Step 1\nCréer archive\n`.agents/sessions/N-*.adoc`;
note right: The entire session context
:Step 2\nMettre up to date\n`PROMPT_REPRISE.adoc`;
note right: Mission N + acceptance criteria N+1
:Step 3\nMettre up to date\n`SESSIONS_HISTORY.adoc`;
note right: Summary line: # / Date / Type / Subject / Score
:Step 4\nMettre up to date\n`INDEX.adoc`;
note right: Current status, roadmap, modified files
:Step 5\nMettre up to date\n`TEST_COVERAGE_ANALYSIS.adoc`;
note right: If tests added or modified
:Step 6\nMettre up to date\n`COMPLETED_TASKS_ARCHIVE.adoc`;
note right: Archive completed tasks
:Display the confirmation checklist;
note right: Check that each [✅] is earned
stop
@enduml
----
=== The Results of 150+ Sessions
Here is what this procedure yields when applied systematically on my four projects:
**plantuml-plugin**:
* **133 sessions**Since the beginning of the project
* **240/240 tests PASS**(100% coverage) -- EPICs 1-7 completed
* **57 Cucumber BDD scenarios**validated
* Safety rule on configuration files born of a real error (Session 2 bakery-plugin)
**bakery-plugin**:
* **11 sessions**in two weeks
* Supabase → Firebase migration completed (9 tests fixed)
* EPIC 6 (publishProfile) functional in production
* Rule 0 created:`publishToMavenLocal`mandatory after each modification
**magic stick** :
* **23 sessions**to construct a live Xubuntu system with an A/B partition
* First ISO generated in session 10
* Formalized QEMU+VNC boot tests (LAZY documentation of 144 lines)
* Functional CI/CD for SourceForge
**cheroliv.com**:
* **9 formal sessions**+ reconstitution of 7 pre-system sessions
* Article 0101 (OpenCode PATH) published
* Article 0108 (this one) rewritten after analyzing its weaknesses
* Full governance migrated from Markdown to AsciiDoc
=== The Final Checklist
After silently executing the 6 steps, the agent must display a confirmation checklist:
✅ Procédure de fin de session exécutée 📋 Checklist :
**Absolute rule**: no step can be marked`[✅]`if the file has not actually been modified and verified
== The Bootstrap Guide: Day 1, Session 0
You are convinced by the method. You want to apply it to a new project. Where to start?
I experienced that moment on April 28, 2026. I am opening Opencode on`jhipster-gradle-plugins`, my two‑plugin Gradle JHipster mono-repo. It’s an existing project—the code is there, the Gradle tasks work. But governance agency? Zero. Blank page. Like`plantuml-plugin`at its session 1, it was several months ago.
Here is the exact procedure I followed, and that I will follow for any new project. Note well the order — it is important.
[plantuml, format=svg, id=diag-bootstrap, alt="Flux de bootstrap en 6 étapes pour initialiser la gouvernance agent sur un nouveau projet"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 250
skinparam activityBackgroundColor #E8F5E9
title Bootstrap Governance — Day 1, Session 0
start
:Step 0\nCreate **opencode.json**\n(6 lignes, instructions: AGENT.adoc);
note right: The bridge that loads\nAGENT.adoc automatically
:Step 1\nCreate the folders\n**mkdir -p .agents/sessions/ .agents/archives/**;
note right: The empty containers\nbefore the agent writes in them
:Step 2\nCreate **AGENT.adoc**\n(200 lignes, règles absolues);
note right: The minimal master file\nStructure v1
:Step 3\nCreate **PROMPT_REPRISE.adoc**\nMission session 1 (max 70 lines);
note right: What the agent must\ndo at the next session
:Step 4\nCreate **.agents/INDEX.adoc**\nRexecutive rules + roadmap;
note right: Entry point EAGER\nin the LAZY folder
:Step 5\nCreate the LAZY structuring files\n6 files: SESSIONS_HISTORY, CHECKLIST, etc.;
note right
• SESSIONS_HISTORY.adoc
• SESSION_CHECKLIST.adoc
• PROCEDURES.adoc
• AGENT_SESSION_MANAGER.adoc
• TEST_COVERAGE_ANALYSIS.adoc
• Specialized agents (if needed)
end note
:Step 6\nAjouter the project in the Portfolio\nMettre up to date TOUS the existing INDEX.adoc;
note right: Cross-functional maintenance\nObligatoire but tedious
:✅ Bootstrap completed\nSession 1 ready;
note right: 20 minutes invested\nDes hundreds saved
stop
@enduml
----
=== Step 0 : Create `opencode.json
It's the first file. Not`AGENT.adoc`, not`INDEX.adoc`.`opencode.json`First of all, for a simple reason: if you create`AGENT.adoc`First, you will forget to create the bridge that charges it automatically. I have done it on.`bakery-plugin`, I know what I'm talking about.
=== Step 1: Create the Folders
[source,bash]
----
mkdir -p .agents/sessions .agents/archives
----
Two empty folders.`sessions/`will receive the archives of each session.`archives/`will receive the monthly COMPLETED_TASKS_ARCHIVE. These folders must exist *before* the agent needs to write to them. An agent that must create both the folder and the file at the same time is an agent that can fail silently.
=== Step 2: Create `AGENT.adoc` — The Master File
Minimal structure for the first version (it will grow)
[source]
----
= {NOM_PROJET} — Directives Agent
[CAUTION]
----
**MANDATORY STOP**avant rm, Write, deletion :
1. READ the entire file
2. VERIFY git ls-files
3. REQUEST CONFIRMATION
4. WAIT "YES
== Project
**Name**: ... **Stack**(Note: As per your request, I'm outputting only the required result.) **documentation**: AsciiDoc
== Absolute Rules
=== 0. DEVELOPMENT ENVIRONMENT
Essential commands...
=== COMMITS/GIT
Formal prohibition...
=== 1b. CONFIGURATION FILES — ABSOLUTE SECURITY RULE
Never crush...
=== 2. End‑of‑Session Tests
Formal prohibition...
[plantuml, format=svg, id=diag-naming-convention, alt="Arbre de décision pour le nommage des fichiers de session"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 200
title Session Naming Convention
start
:A session ends;
note right: Trigger "end of session"
if (Session antérieure\nà la gouvernance ?) then (oui)
:Number **NÉGATIF**\n-6, -5 ... 0;
note right: History\nreconstructed
:Suffix: reconstitution;
else (non)
:Number **POSITIF**\nwith 3 digits if > 99;
note right: 001, 036, 133\nfor lexicographic sorting
:Detect the **TYPE**;
if (Mots-clés trouvés ?) then (oui)
:debug / feature / refactor\ndocs / chore / test;
else (non)
:Omit the type\n(le sujet suffit);
endif
:Formulate the **SUJET** in kebab-case;
note right
Ex: fix-timeout-integration-test
Must make it possible to find
without opening the file
end note
endif
:Final name: {N}-{type}-{sujet}.adoc;
note right
• 1-chore-migration-gouvernance.adoc
• 036-debug-graphify-symlink.adoc
• 124-fix-timeout-integration-test.adoc
• 133-epic11-article-blog-kg.adoc
end note
if (Session documentée ?) then (oui)
:Create archive in sessions/;
:Add line SESSIONS_HISTORY\nwith score X/10;
else (non)
:Add line SESSIONS_HISTORY\nwith score **?**\n**without archive**;
note right: Honesty\nrather than emptiness
endif
stop
@enduml
----
The 6 mandatory steps...
== Context Management — LAZY/EAGER
Eager files / Lazy files...
This minimal template allows the agent to start. The rich version—with the project structure, key components, EPICs, the backlog—will come in session 1, when the agent already has the basic rules in hand and can help you enrich the document.
=== Step 3: Create `PROMPT_REPRISE.adoc` — The Mission Session 1
A file that explicitly says: "This is session 1, mission to define." Maximum 70 lines, with a Section 0 (bootstrap summary) and a Section 1 (priorities to define with the user).
=== Step 4: Create `.agents/INDEX.adoc`—The Entry Point
[plantuml, format=svg, id=diag-session-flow, alt="Flux d'une session type avec Eager/Lazy et agents"]
----
@startuml
skinparam backgroundColor #FEFEFE
start
:Session start;
note right: The agent is a blank slate
:Loading EAGER auto;
note right
* AGENT.adoc (absolute rules)
* PROMPT_REPRISE.adoc (mission N)
* INDEX.adoc (project status)
end note
if (Mission claire ?) then (oui)
:Direct execution;
else (non)
:Load LAZY on request;
note right
* SESSIONS_HISTORY.adoc (past context)
* sessions/{N-1}-*.adoc (decisions)
* *_REFERENCE.adoc (architecture)
end note
endif
:Specialized agent delegation?;
if (CODER ?) then (oui)
:Reads CODER.adoc;
:Follows conventions FTL/CSS;
elseif (SCRUM Master ?) then (oui)
:Bed SCRUM_MASTER.adoc;
:Mandatory deliverable structure;
elseif (PlantUML ?) then (oui)
:Bed PLANTUML_DESIGNER.adoc;
:Syntax PUML + integration;
else (non)
endif
:Work of the session;
:End of session (user trigger);
:6-step procedure;
note right
1. Archive sessions/N-*.adoc
2. Update PROMPT_REPRISE.adoc (N+1)
3. Update SESSIONS_HISTORY.adoc
4. Update INDEX.adoc
5. Update TEST_COVERAGE (if applicable)
6. Update COMPLETED_TASKS_ARCHIVE.adoc
end note
:Checklist [✅] x 6;
stop
@enduml
----
=== Step 5: Create the structuring LAZY files
In order:
1. `.agents/SESSIONS_HISTORY.adoc`— a table with only session 0
2. `.agents/SESSION_CHECKLIST.adoc`— the template « When to change session
3. `.agents/PROCEDURES.adoc`— the complete procedure of the 6 steps + EAGER/LAZY
4. `.agents/AGENT_SESSION_MANAGER.adoc`— the archive template
5. `.agents/TEST_COVERAGE_ANALYSIS.adoc`— the test tracking table, initially empty
If your project has a complex business domain (like`jhipster-gradle-plugins`with its mono-repo persistence/assistant), create the specialized agents now:
1. `.agents/PLUGIN_DEVELOPER.adoc`— coding conventions and dependency boundaries (if plugin)
2. `.agents/BACKLOG_MANAGER.adoc`— planning structure and identified risks
Do not create agents that you will not use. An agent without concrete conventions to encode is a dead file that pollutes`.agents/`.
=== Step 6: Add the Project to the Portfolio of All Projects
It's the step we systematically forget. Each`INDEX.adoc`Each project's page contains a “Project Portfolio” table listing all projects using the same methodology. When you create a new project, you must:
[plantuml, format=svg, id=diag-end-session-flow, alt="Flux de la procédure de fin de session"]
----
@startuml
skinparam defaultTextAlignment center
skinparam wrapWidth 200
skinparam activityBackgroundColor #E3F2FD
start
:L'utilisateur dit "end of session";
note right: Trigger keywords
:Agent detects the trigger;
:Step 1\nCrcreate archive\n`.agents/sessions/N-*.adoc`;
note right: All the session context
:Step 2\nMettre up to date\n`PROMPT_REPRISE.adoc`;
note right: Mission N + acceptance criteria N+1
:Step 3\nMettre up to date\n`SESSIONS_HISTORY.adoc`;
note right: Summary line: # / Date / Type / Subject / Score
:Step 4\nMettre up to date\n`INDEX.adoc`;
note right: Current status, roadmap, modified files
:Step 5\nMettre up to date\n`TEST_COVERAGE_ANALYSIS.adoc`;
note right: If tests added or modified
:Step 6\nMettre up to date\n`COMPLETED_TASKS_ARCHIVE.adoc`;
note right: Archive completed tasks
:Show the confirmation checklist;
note right: Check that each [✅] is deserved
stop
@enduml
----
On my four (now five) projects, this means opening the`INDEX.adoc` de `magic-stick`, `bakery-gradle`, `cheroliv.com`, `plantuml-gradle`and add the line`jhipster-gradle-plugins | Session 1 | ... | 2026-04-28 🆕`.
It is tedious. It is manual. It is also the only way to ensure that, whatever project you are working on, the agent knows which other projects exist and what their status is. At session 012 of`magic-stick`, the agent detected two inconsistencies in the portfolio —`bakery-gradle`had its `COMPLETED_TASKS_ARCHIVE` overdue, and`plantuml-gradle`There was a discrepancy between his procedure documentation (5 steps) and its INDEX (6 steps). Without this cross‑reference table, these inconsistencies would have remained invisible.
[plantuml, format=svg, id=diag-portfolio-graph, alt="Graphe du portefeuille de projets — références croisées entre INDEX.adoc"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam nodeBackgroundColor #E3F2FD
title Project Portfolio — Cross-References INDEX.adoc
node "**magic-stick**\nSession 037\nSCRIPT_VERIFICATION" as MS #E1BEE7
node "**bakery-gradle**\nSession 11\nTEST_COVERAGE" as BG #FFE0B2
node "**cheroliv.com**\nSession 10\nTEST_COVERAGE" as CH #C8E6C9
node "**plantuml-gradle**\nSession 133\nTEST_COVERAGE" as PG #BBDEFB
node "**jhipster-gradle**\nSession 1 🆕\nTEST_COVERAGE" as JG #FFCDD2
MS --> BG : INDEX.adoc reference
MS --> CH : INDEX.adoc reference
MS --> PG : INDEX.adoc reference
MS --> JG : INDEX.adoc reference 🆕
BG --> MS : INDEX.adoc reference
BG --> CH : INDEX.adoc reference
BG --> PG : INDEX.adoc reference
BG --> JG : INDEX.adoc reference 🆕
CH --> MS : INDEX.adoc reference
CH --> BG : INDEX.adoc reference
CH --> PG : INDEX.adoc reference
CH --> JG : INDEX.adoc reference 🆕
PG --> MS : INDEX.adoc reference
PG --> BG : INDEX.adoc reference
PG --> CH : INDEX.adoc reference
PG --> JG : INDEX.adoc reference 🆕
JG --> MS : INDEX.adoc reference
JG --> BG : INDEX.adoc reference
JG --> CH : INDEX.adoc reference
JG --> PG : INDEX.adoc reference
note bottom of JG
When adding a project:
• 4 INDEX.adoc to update
• 1 line per portfolio
• Cost: 5 minutes
end note
legend bottom
|= Couleur |= Projet |
| <#E1BEE7> | magic-stick — ISO Linux live |
| <#FFE0B2> | bakery-gradle — Plugin JBake |
| <#C8E6C9> | cheroliv.com — Site personnel |
| <#BBDEFB> | plantuml-gradle — Plugin IA |
| <#FFCDD2> | jhipster-gradle — Mono-repo JHipster |
endlegend
@enduml
----
I hear you say it: “But that’s duplication!” Yes. It is intentional duplication. Each`INDEX.adoc`It is autonomous. If you open a session on`magic-stick`, the agent must know that`plantuml-gradle`It is at session 133 without having to open a file in another directory. That's the price of independence between projects — and it amounts to five lines per portfolio.
=== What Bootstrap Costs
All that takes 20 minutes. Twenty minutes once, so you never lose twenty at the start of each session again. The ROI is immediate: starting with session 2, the agent picks up where you left off in session 1.
On`jhipster-gradle-plugins`, this bootstrap took me exactly 18 minutes — of`mkdir .agents/`to the last`INDEX.adoc`updated in the portfolio of`magic-stick`. Session 1, which follows, will start with an agent who already knows the mono-repo structure, the Gradle commands, and the critical boundary between`persistence/`(lightweight) and`assistant/`(heavy). Twenty minutes well invested.
== The 4 (now 5) Projects, 5 Governances, 1 Method
The eager/lazy system is not a copied-pasted boilerplate. Each project has adapted the method to its own specifications.
=== cheroliv.com : Personal Website
**Specificity**Editorial content, WCAG 2.1 AA accessibility, Static JBake **Adaptation**: Six prioritized epics (P0-P4), specialized agents (CODER, SCRUM_MASTER, PLANTUML_DESIGNER), cross-cutting acceptance criteria on accessibility **Emblematic rule** : `./gradlew serve`mandatory, formal prohibition of the script`jbake.sh`external
=== bakery-gradle : The Multi-Purpose Plugin
**Specificity**Gradle plugin with publishing tasks, Firebase code generation, YAML parsing. **Adaptation**: Rule 0 (publishToMavenLocal), safety rule on the config files strengthened by the incident of`site.yml`, EPIC 9 and 10 on the multi-file configuration. **Iconic rule**:`publishToMavenLocal`after each modification of the plugin's source code
=== plantuml-gradle : The AI Plugin
**Specificity**: Integration LangChain4j, generation of PlantUML diagrams via LLM, tests with cloud API keys. **Adaptation**: Documentation LAZY dense (ARCHITECTURE, API_KEY_POOL_REFERENCE, DATASET_FINETUNING), numbered EPICs (1-11 completed, 107+ ongoing), separation EAGER/LAZY optimized (gain of 60% tokens). **Emblematic rule**: Files`*_ESSENTIALS.adoc`(50 lines) vs`*_REFERENCE.adoc`(unlimited) for the API key pool.
=== magic-stick : The Live System
**Specificity**Linux live ISO build (Xubuntu), GPT A/B partitioning, CI/CD with SourceForge. **Adaptation**: Complex technical LAZY references (AB_PARTITION, BOOT_TEST), SCRIPT_VERIFICATION.adoc as specific step 5 (no traditional tests, but verification of bash scripts). **Emblematic rule**:`isoTestAB`skipped in CI (non-privileged runners), tests reserved for local environments with Docker`--privileged`.
== Cross-Cutting Absolute Rules
[plantuml, format=svg, id=diag-bootstrap, alt="Flux de bootstrap en 6 étapes pour initialiser la gouvernance agent sur un nouveau projet"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 250
skinparam activityBackgroundColor #E8F5E9
title Bootstrap Governance — Day 1, Session 0
start
:Step 0\nCreate **opencode.json**\n(6 lignes, instructions: AGENT.adoc);
note right: The bridge that loads\nAGENT.adoc automatically
:Step 1\nCreate the folders\n**mkdir -p .agents/sessions/ .agents/archives/**;
note right: The empty containers\nbefore the agent writes in them
:Step 2\nCreate **AGENT.adoc**\n(200 lignes, règles absolues);
note right: The minimal master file\nStructure v1
:Step 3\nCreate **PROMPT_REPRISE.adoc**\nMission session 1 (max 70 lines);
note right: What the agent must\ndo at the next session
:Step 4\nCreate **.agents/INDEX.adoc** executive \nRules + roadmap;
note right: Entry point EAGER\nin the folder LAZY
:Step 5\nCreate the LAZY structuring files\n6 files: SESSIONS_HISTORY, CHECKLIST, etc.;
note right
• SESSIONS_HISTORY.adoc
• SESSION_CHECKLIST.adoc
• PROCEDURES.adoc
• AGENT_SESSION_MANAGER.adoc
• TEST_COVERAGE_ANALYSIS.adoc
• Specialized agents (if needed)
end note
:Step 6\nAjouter the project to the Portfolio\nMettre up to date TOUS the existing INDEX.adoc;
note right: Cross-functional maintenance\nObligatoire but tedious
:✅ Bootstrap completed\nSession 1 ready;
note right: 20 minutes invested\nDes hundreds saved
stop
@enduml
----
**Development environment**
* ✅ Use the project-specific command`./gradlew serve`, `./gradlew functionalTest`, etc.)
* ❌ Forbidden to use unversioned external scripts
**Git**
* Read‑only authorised`git status`, `git diff`, `git log`)
* ❌`git add`, `git commit`, `git push`forbidden without explicit permission
* ❌`git commit --amend`prohibited unless conditions are meticulously respected
**Configuration Files**
* ❌ Never overwrite a config file with a`Write`complete when a`Edit`Partial suffices
* ❌ Never replace sensitive values with dummy values
* ❌ Check`git check-ignore` et `git ls-files`Before any modification
**tests**
* ❌ Never run tests during the end-of-session procedure without explicit permission
**Forbidden Tools**
* ❌ `TodoWrite` et `Task`-- governance is handled through AsciiDoc files, not through external tools
== Anti-Patterns: What 150+ Sessions Taught Me
In hindsight, some mistakes have become such predictable patterns that I can list them as anti‑patterns—traps into which every new project will likely fall. Here they are, ordered by frequency.
[plantuml, format=svg, id=diag-antipatterns, alt="Les 7 anti-patterns de la gouvernance agent — arbre des pièges à éviter"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 180
title The 7 Anti-Patterns — What 150+ Sessions Taught Me
left to right direction
rectangle "⚠️ ANTI-PATTERNS" as ROOT #FFCDD2 {
together {
card "**1. Agent Without**\n**opencode.json**" as AP1 #FFEBEE {
(AGENT.adoc jamais chargé)
(→ 20 min perdues/session)
}
card "**2. Too Many Agents**\n**Too Soon**" as AP2 #FFEBEE {
(5 agents stubs vides)
(→ L'agent hésite)
(→ Seuil : 100 lignes\nou 5 règles concrètes)
}
card "**3. Ghost**\n**PROMPT_REPRISE**" as AP3 #FFEBEE {
(Mission a dérivé)
(→ PROMPT_REPRISE\nne reflète pas la réalité)
}
}
together {
card "**4. Empty**\n**Archive**" as AP4 #FFEBEE {
(Template rempli de\nplaceholders "TODO")
(→ « à compléter plus tard »\nn'arrive jamais)
}
card "**5. Ghost**\n**Portfolio**" as AP5 #FFEBEE {
(Nouveau projet créé)
(→ Pas ajouté aux\n4 autres INDEX.adoc)
(→ Agent croit avoir\n4 projets, en fait 5)
}
card "**6. Hidden**\n**Redundancy**" as AP6 #FFEBEE {
(Même backlog copié-collé)
(→ AGENT.adoc et INDEX.adoc\ndivergent)
(→ Règle : INDEX.adoc\n= source de vérité)
}
}
card "**7. Session Too**\n**Long**" as AP7 #FFEBEE {
(2h, 85 messages, 12 fichiers)
(→ LLM répète erreurs corrigées)
(→ Aurait dû splitter il y a 45 min)
}
}
note right of AP7
**Golden Rule**
5 × 20 min
>
1 × 2 hours
Respect SESSION_CHECKLIST
end note
@enduml
----
=== Anti-Pattern 1: The Agent without `opencode.json
It's mistake number one. You wrote a magnificent`AGENT.adoc`of 200 lines, but it is never loaded automatically. The agent starts bare. You spend 20 minutes re‑contextualizing it—exactly what the method is meant to avoid.
*Symptom* : The agent asks basic questions about the project structure while everything is in`AGENT.adoc`. *Correction* : Create`opencode.json`with the block`instructions: ["AGENT.adoc"]`. Check that the file exists in Opencode's working directory.
=== Anti-Pattern 2: Too Many Agents Too Early
At session 2 of your project, you create 5 specialized agents. None have real content—they are all stubs. Result:`.agents/`is polluted with empty files, and the agent hesitates over which one to load.
*Symptom*: Agent files containing only 'To be defined' or an empty structure of 10 lines. *Correction*: A specialized agent is justified when its business domain exceeds 100 lines or it encodes at least 5 concrete rules. Below, the content fits in`AGENT.adoc`.
=== Anti-Pattern 3: The Phantom PROMPT_REPRISE
`PROMPT_REPRISE.adoc`is updated... but only at the end of the session, when the agent executes the procedure. Meanwhile, the actual mission of the session has drifted — we fixed an unexpected bug instead of implementing the planned feature. The`PROMPT_REPRISE.adoc`end-of-session does not reflect what *actually* happened.
*Symptom* : The section « Priorities » of`PROMPT_REPRISE.adoc`It mentions a feature that hasn't been touched, while you've spent the session on a critical bug. *Correction* : Update`PROMPT_REPRISE.adoc`in real time when the session deviates from its original purpose. Do not wait for the end-of-session procedure to document the change of course. Thirty seconds of editing during the session is better than a`PROMPT_REPRISE`false
=== Anti‑Pattern 4 – The Empty Archive
The end-of-session procedure creates the archive… but the agent, pressed to display their checklist, fills the template with placeholders.`{detail}`becomes “Detail to fill in later”. This “later” never arrives.
*Symptom*: Session archives containing the words "TODO", "to be completed", or empty sections. *Correction*: The absolute rule states that no step can be marked [✅] if the file has not been actually modified. Apply it to yourself: review the archive before displaying the checklist. If a section is empty, fill it in now.
=== Anti-Pattern 5: The Ghost Wallet
You create a new project with perfect governance. But you forget to add it to the portfolio of other projects. Three weeks later, you open a session on`magic-stick`and the agent tells you that you have 4 projects. You have 5. The agent does not know.
*Symptom*: Project counting in portfolios does not match reality. *Correction*: Script the update of the portfolio, or at least maintain a post‑bootstrap checklist that includes “Update the wallet of all existing projects.” This is the most tedious step of the method, and therefore the most often omitted.
=== Anti-Pattern 6: Hidden Redundancy
You copy‑paste the same backlog of 50 lines into`AGENT.adoc` et `INDEX.adoc`. At the next session, you update one but not the other. Your two EAGER files contradict each other.
*Symptom* : Discrepancies between the EPICs listed in`AGENT.adoc`and those in`INDEX.adoc`. *Correction* : Redundancy must be *assumed and bounded*.`AGENT.adoc`contains the detailed backlog with user stories.`INDEX.adoc`contains ONLY the summary table of EPICs (name, progress, priority). If the two diverge, it is`INDEX.adoc`is authoritative — because it is the one that is updated at the end of each session. Document this rule in your`AGENT.adoc`In case of discrepancy between AGENT.adoc and INDEX.adoc, INDEX.adoc is the source of truth.
=== Anti-Pattern 7: The Too-Long Session
You are ignoring the signals of`SESSION_CHECKLIST.adoc`. 2 hours, 85 messages, 12 files modified. The agent is looping, you too. You should have changed session 45 minutes ago.
*Symptom* : The LLM repeats already corrected errors, the token context exceeds 80k, you have modified both`persistence/` et `assistant/`in the same session. *Correction*: The`SESSION_CHECKLIST.adoc`exists for a reason. Respect it. The golden rule is not a suggestion. 5 sessions of 20 minutes > 1 session of 2 hours.
== Why AsciiDoc ?
I chose AsciiDoc for several pragmatic reasons that have a direct impact on the efficiency of governance:
1. **Rich semantic structure**: sections, tables, warnings, document attributes. An agent reads a structured document better than a block of text.
2. **Document attributes**(`:jbake-type:`, `:jbake-status:`) which allow defining machine- and human-readable metadata.
3. **Compatibility with JBake**: my static site is generated by JBake, which natively processes AsciiDoc. Governance files and blog posts share the same format. My blog post *about* governance is written in the same format as governance itself.
4. **Longevity**AsciiDoc is a proven technical documentation format with a stable specification.
== Result: A seamless continuity
Since I implemented this system, moving between Opencode sessions is now smooth; the agent resumes exactly where I left off, without my having to re‑contextualize anything.
Decisions made at session 3 are accessible to session 133. The backlog remains coherent across five simultaneous projects. Security rules (particularly concerning Git and configuration files) are observed because they are ubiquitous throughout the Eager file.
The numbers speak:
[plantuml, format=svg, id=diag-portfolio-graph, alt="Graphe du portefeuille de projets — références croisées entre INDEX.adoc"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam nodeBackgroundColor #E3F2FD
title Project Portfolio — Cross-References INDEX.adoc
node "**magic-stick**\nSession 037\nSCRIPT_VERIFICATION" as MS #E1BEE7
node "**bakery-gradle**\nSession 11\nTEST_COVERAGE" as BG #FFE0B2
node "**cheroliv.com**\nSession 10\nTEST_COVERAGE" as CH #C8E6C9
node "**plantuml-gradle**\nSession 133\nTEST_COVERAGE" as PG #BBDEFB
node "**jhipster-gradle**\nSession 1 🆕\nTEST_COVERAGE" as JG #FFCDD2
MS --> BG : INDEX.adoc reference
MS --> CH : INDEX.adoc reference
MS --> PG : INDEX.adoc reference
MS --> JG : INDEX.adoc reference 🆕
BG --> MS : INDEX.adoc reference
BG --> CH : INDEX.adoc reference
BG --> PG : INDEX.adoc` reference
BG --> JG : INDEX.adoc reference 🆕
CH --> MS : INDEX.adoc reference
CH --> BG : INDEX.adoc reference
CH --> PG : INDEX.adoc reference
CH --> JG : INDEX.adoc reference 🆕
PG --> MS : INDEX.adoc` reference
PG --> BG : INDEX.adoc reference
PG --> CH : INDEX.adoc reference
PG --> JG : INDEX.adoc reference 🆕
JG --> MS : INDEX.adoc reference
JG --> BG : INDEX.adoc reference
JG --> CH : INDEX.adoc reference
JG --> PG : INDEX.adoc reference
note bottom of JG
When a project is added:
• 4 INDEX.adoc to update
• 1 line per portfolio
• Cost: 5 minutes
end note
legend bottom
|= Couleur |= Projet |
| <#E1BEE7> | magic-stick — ISO Linux live |
| <#FFE0B2> | bakery-gradle — Plugin JBake |
| <#C8E6C9> | cheroliv.com — Site personnel |
| <#BBDEFB> | plantuml-gradle — Plugin IA |
| <#FFCDD2> | jhipster-gradle — Mono-repo JHipster |
endlegend
@enduml
----
It's a**artisanal system**, constructed with the tools of the trade (AsciiDoc, git, Gradle), without dependence on a proprietary platform. It reflects my fundamental belief:**a credible developer builds and uses their own tools**. .
== Links
* My site : [cheroliv.com](https://cheroliv.com)
* The project`bakery-gradle`: [github.com/cheroliv/bakery-gradle-plugin](https://github.com/cheroliv/bakery-gradle-plugin)
* The project`plantuml-gradle`: [github.com/cheroliv/plantuml-gradle-plugin](https://github.com/cheroliv/plantuml-gradle-plugin)
* The project`magic-stick`: [github.com/cheroliv/magic-stick](https://github.com/cheroliv/magic-stick)
* The project`cheroliv.com`: [github.com/cheroliv/cheroliv.github.io](https://github.com/cheroliv/cheroliv.github.io)
---
The code that one writes for oneself is the laboratory of the code taught to others.
The eager/lazy system isn’t a copied‑and‑pasted boilerplate; each project has adapted the method to its own requirements.
=== cheroliv.com : The Personal Site
**Specificity**Editorial content, WCAG 2.1 AA accessibility, static JBake. **Adaptation**: Six prioritized epics (P0-P4), specialized agents (CODER, SCRUM_MASTER, PLANTUML_DESIGNER), cross-cutting acceptance criteria on accessibility. **Emblematic rule**:`./gradlew serve`obligatoire, formal prohibition of the script`jbake.sh` externe.
=== bakery-gradle : The Multi-Purpose Plugin
**Specificity**Gradle plugin with publish tasks, Firebase code generation, YAML parsing. **Adaptation**: Rule 0 (publishToMavenLocal), safety rule on configuration files strengthened by the incident of`site.yml`, EPIC 9 and 10 on the multi-file configuration. **Emblematic rule**:`publishToMavenLocal`after each change to the plugin's source code.
=== plantuml-gradle : The AI Plugin
**Specificity**LangChain4j integration, generation of PlantUML diagrams via LLM, testing with cloud API keys. **Adaptation**: Dense lazy documentation (ARCHITECTURE, API_KEY_POOL_REFERENCE, DATASET_FINETUNING), EPICs numbered (1-11 completed, 107+ in progress), optimized EAGER/LAZY separation (a 60% token gain). **Emblematic rule**: Files`*_ESSENTIALS.adoc`(50 lines) vs`*_REFERENCE.adoc`(unlimited) for the API key pool.
=== magic‑stick : The Live System
**Specificity**Building Linux live ISO (Xubuntu), GPT A/B partitioning, CI/CD with SourceForge. **Adaptation**Complex lazy technical references (AB_PARTITION, BOOT_TEST), SCRIPT_VERIFICATION.adoc as a specific step 5 (no traditional tests, but verification of bash scripts). **Emblematic rule**:`isoTestAB`skipped in CI (non‑privileged runners), tests reserved for local environments with Docker`--privileged`.
== Absolute transverse rules
Some critical rules that appear in the file`AGENT.adoc`Eager and apply to all sessions on all projects:
**Development environment**
* ✅ Use the project-specific command`./gradlew serve`, `./gradlew functionalTest`, etc.)
* Forbidden to use unversioned external scripts
**Git**
* Read-only authorized`git status`, `git diff`, `git log`)
* ❌ `git add`, `git commit`, `git push`forbidden without explicit permission
* ❌`git commit --amend`Forbidden except when the conditions are meticulously respected.
**Configuration Files**
* ❌ Never overwrite a config file with a`Write`complete when a`Edit`Partial is enough
* ❌ Never replace sensitive values with fake values
* Check`git check-ignore` et `git ls-files`Before any modification
**Tests**
* Never launch tests during an end-of-session procedure without explicit permission
**Forbidden Tools**
* ❌`TodoWrite` et `Task`-- governance is done via AsciiDoc files, not via external tools
== Anti-Patterns: What 150+ Sessions Have Taught Me
With hindsight, some mistakes have become so predictable that I can list them like anti‑patterns—traps into which every new project is likely to fall. Here they are, ordered by frequency.
[plantuml, format=svg, id=diag-antipatterns, alt="Les 7 anti-patterns de la gouvernance agent — arbre des pièges à éviter"]
----
@startuml
skinparam backgroundColor #FEFEFE
skinparam defaultTextAlignment center
skinparam wrapWidth 180
title The 7 Anti-Patterns — What 150+ Sessions Taught Me
left to right direction
rectangle "⚠️ ANTI-PATTERNS" as ROOT #FFCDD2 {
together {
card "**1. Agent without**\n**opencode.json**" as AP1 #FFEBEE {
(AGENT.adoc jamais chargé)
(→ 20 min perdues/session)
}
card "**2. Too Many Agents**\n**Too Early**" as AP2 #FFEBEE {
(5 agents stubs vides)
(→ L'agent hésite)
(→ Seuil : 100 lignes\nou 5 règles concrètes)
}
card "**3. PROMPT_REPRISE**\n**Ghost**" as AP3 #FFEBEE {
(Mission a dérivé)
(→ PROMPT_REPRISE\nne reflète pas la réalité)
}
}
together {
card "**4. Archive**\n**Empty**" as AP4 #FFEBEE {
(Template rempli de\nplaceholders "TODO")
(→ « à compléter plus tard »\nn'arrive jamais)
}
card "**5. Portfolio**\n**Ghost**" as AP5 #FFEBEE {
(Nouveau projet créé)
(→ Pas ajouté aux\n4 autres INDEX.adoc)
(→ Agent croit avoir\n4 projets, en fait 5)
}
card "**6. Redundancy**\n**Hidden**" as AP6 #FFEBEE {
(Même backlog copié-collé)
(→ AGENT.adoc et INDEX.adoc\ndivergent)
(→ Règle : INDEX.adoc\n= source de vérité)
}
}
card "**7. Session Too**\n**Long**" as AP7 #FFEBEE {
(2h, 85 messages, 12 fichiers)
(→ LLM répète erreurs corrigées)
(→ Aurait dû splitter il y a 45 min)
}
}
note right of AP7
**Golden Rule**
5 × 20 min
>
1 × 2 hours
Respect SESSION_CHECKLIST
end note
@enduml
----
=== Anti-Pattern 1: The Agent without `opencode.json
It's error number one. You wrote a magnificent`AGENT.adoc`of 200 lines, but it is never loaded automatically. The agent starts naked. You spend 20 minutes re‑contextualizing it—exactly what the method is supposed to avoid.
*Symptom*: The agent asks basic questions about the project structure while everything is in`AGENT.adoc`. *Correction* : Create`opencode.json`with the block`instructions: ["AGENT.adoc"]`. Check that the file exists in Opencode's working directory.
=== Anti-Pattern 2: Too Many Agents Too Early
During session 2 of your project, you create 5 specialized agents. None has real content; they're all stubs. Result:`.agents/`is polluted with empty files, and the agent hesitates on which one to load.
*Symptom*: Agent files containing only "To define" or an empty structure of 10 lines. *Correction* : A specialized agent is justified when its business domain exceeds 100 lines or it encodes at least 5 concrete rules. Below, the content fits within`AGENT.adoc`.
=== Anti-Pattern 3: the ghost PROMPT_REPRISE
`PROMPT_REPRISE.adoc`is being updated... but only at the end of the session, when the agent executes the procedure. In the meantime, the actual mission of the session drifted — they fixed an unexpected bug instead of implementing the planned feature. The`PROMPT_REPRISE.adoc`end-of-session does not reflect what has *actually* happened.
*Symptom*: The "Priorities" section of`PROMPT_REPRISE.adoc`He mentions a feature that hasn't been touched, despite having worked on a critical bug during the session. *Correction*: Update`PROMPT_REPRISE.adoc`in real time when the session diverges from its original purpose. Do not wait for the end‑of‑session procedure to document the course correction. Thirty seconds of editing during the session are worth more than one`PROMPT_REPRISE`false
=== Anti-Pattern 4: The Empty Archive
The end‑of‑session procedure creates the archive... but the agent, eager to display their checklist, fills the template with placeholders.`{detail}`becomes « detail to fill in later». This « later » never arrives.
*Symptom* : Session archives containing the words « TODO », « à compléter », or empty sections. *Correction* : The absolute rule says that no step can be marked [✅] if the file hasn’t actually been modified. Apply it to yourself: reread the archive before showing the checklist. If a section is empty, fill it in now.
=== Anti-Pattern 5 : The Phantom Wallet
You create a new project with perfect governance. But you forget to add it to the portfolio of other projects. Three weeks later, you open a session on`magic-stick`and the agent tells you that you have 4 projects. You have 5. The agent doesn't know that.
*Symptom* : Counting projects in portfolios does not match reality. *Correction*: Script updating the wallet, or at least maintain a post‑bootstrap checklist that includes “Update the wallet for all existing projects”. This is the most tedious step of the method, and therefore the most often omitted.
=== Anti-Pattern 6 : Hidden Redundancy
You copy-paste the same 50-line backlog into`AGENT.adoc` et `INDEX.adoc`. At the next session, you update one but not the other. Your two EAGER files contradict each other.
*Symptom* : Discrepancies between the listed EPICs in`AGENT.adoc`and those in`INDEX.adoc`. *Correction* : Redundancy must be *assumed and bounded*`AGENT.adoc`contains the detailed backlog with user stories`INDEX.adoc`contains **ONLY** the summary table of EPICs (name, progress, priority). If the two diverge, it is`INDEX.adoc`which is valid — because it is the one that is updated at the end of each session. Document this rule in your`AGENT.adoc`In case of discrepancy between AGENT.adoc and INDEX.adoc, INDEX.adoc is the source of truth.
=== Anti-Pattern 7 : The Session Too Long
You ignore the signals of`SESSION_CHECKLIST.adoc`. 2 hours, 85 messages, 12 files modified. The agent keeps looping, just like you. You should have switched sessions 45 minutes ago.
*Symptom* : The LLM repeats already corrected errors, token context exceeds 80k, you have modified both`persistence/` et `assistant/`in the same session. *Correction*:`SESSION_CHECKLIST.adoc`It exists for a reason. Respect it. The golden rule isn't a suggestion. 5 sessions of 20 minutes > 1 session of 2 hours.
== Why AsciiDoc?
I chose AsciiDoc for several pragmatic reasons that directly impact governance efficiency :
1. **Rich semantic structure**sections, tables, admonitions, document attributes. An agent reads a structured document better than a block of text.
2. **Document attributes**(`:jbake-type:`, `:jbake-status:`) which allow defining metadata readable by machines and humans.
3. **Compatibility with JBake**my static site is generated by JBake, which natively processes AsciiDoc. Governance files and blog posts share the same format. My blog post *about* governance is written in the same format as governance itself.
4. **Longevity**: AsciiDoc is an established technical documentation format, with a stable specification.
== Result: A Seamless Continuity
Since I put this system in place, switching between one Opencode session and another has become seamless. The agent picks up exactly where I left off, without me needing to re‑contextualize anything.
Decisions made at session 3 are accessible at session 133. The backlog remains consistent across five simultaneous projects. Security rules (particularly regarding git and configuration files) are respected because they are ubiquitous in the Eager file.
The numbers speak:
* **150+ sessions archived**in total
* **60% of EAGER tokens saved**after optimization (Session 109)
* **No reminder needed**on the business context of the API key pool
* **100% of tests PASS**on plantuml-plugin (240/240)
* **A single catastrophe**(Session 2 bakery-plugin) which gave rise to the absolute safety rule
It's a**artisanal system**, built with the tools of the trade (AsciiDoc, git, Gradle), without dependence on a proprietary platform. It reflects my fundamental belief:**a credible developer builds and uses his own tools**.
== Links
* My site : [cheroliv.com](https://cheroliv.com)
* The project`bakery-gradle`:[github.com/cheroliv/bakery-gradle-plugin](https://github.com/cheroliv/bakery-gradle-plugin)
* The project`plantuml-gradle`: [github.com/cheroliv/plantuml-gradle-plugin](https://github.com/cheroliv/plantuml-gradle-plugin)
* The project`magic-stick`: [github.com/cheroliv/magic-stick](https://github.com/cheroliv/magic-stick)
* The project`cheroliv.com`: [github.com/cheroliv/cheroliv.github.io](https://github.com/cheroliv/cheroliv.github.io)
---
*The code we write for ourselves is the laboratory of the code we teach others.*