Rlm workflow

From SteelMorgan/1c-agent-based-dev-framework · View interactive version

Rlm workflow is an AI agent skill from the GitHub repository SteelMorgan/1c-agent-based-dev-framework. MUST use WHEN writing reusable knowledge into RLM (pattern / arch-solution / stable domain fact) OR reading it before a non-trivial task/solution in the domain. Provides a breakdown of native-push vs RLM-pull, RLM write and read tools, H-MEM levels, and hygiene.

How to use this skill

Skill file

RLM Workflow — writing and reading knowledge

RLM is a pull store of universal reusable knowledge: patterns, arch-solutions, 1С/БСП domain facts, findings across modules. It is retrieved by topic through semantic search (embeddings fine-tuned for 1С) and does NOT stay in context. The triggers for “when to write / when to read” are in the rlm-workflow rule; here is how to do it.

Memory layout

| Knowledge | Layer | Tool |

|---|---|---|

| Always-on core (safety, invariants, standing preferences) | native push | MEMORY.md + memory/*.md |

| Universal reusable knowledge (patterns, solutions, domain facts) | RLM pull | this skill |

| Transient task state (PENDING, next step, WIP) | agent-context | task_dir/.context/*.md |

Writing to RLM

Precondition (MUST): rlm_start_session() before any writes - otherwise a silent failure (you will only notice it via rlm_get_hierarchy_stats).

| What to write | Call |

|---|---|

| Universal pattern / anti-pattern | rlm_add_hierarchical_fact(content, level=1, domain="retrospective") |

| Detail of a specific module/file | rlm_add_hierarchical_fact(content, level=2, domain="<domain>", module="<path>", code_ref="<file:line>") |

| Temporary note / hypothesis | rlm_add_hierarchical_fact(content, level=3, ttl_days=7) - auto-consolidation |

| Decision with alternatives | rlm_record_causal_decision(decision, reasons, consequences, constraints, alternatives) |

Finish writing with rlm_sync_state().

H-MEM levels:

| level | Name | When |

|---|---|---|

| 0 | L0_PROJECT | Loaded always. Critical global knowledge, project pitfalls. Write rarely (bloats every startup) |

| 1 | L1_DOMAIN | By context. Stable patterns, session solutions |

| 2 | L2_MODULE | On demand. Implementation details, findings at the module level |

| 3 | L3_CODE | Temporary. Automatically collapses into L2/L1 via rlm_consolidate_facts |

Reading from RLM

At the edge of work (entering a non-trivial task / before an arch-solution / when a problem repeats) - one call, not a tool sweep:

| Goal | Call |

|---|---|

| Context on the topic (recommended, one-call) | rlm_enterprise_context(query="<domain/symptom>", max_tokens=3000) - auto-routing L0 + relevant L1/L2 + causal chains |

| Only relevant facts within budget | rlm_route_context(query, max_tokens=2000) - L0 always + L1/L2 by similarity |

| Targeted hybrid search | rlm_search_facts(query, semantic_weight, keyword_weight, recency_weight, top_k) |

Weights in rlm_search_facts: semantic query -> raise semantic_weight; search by exact term/identifier -> raise keyword_weight; “what changed recently” -> recency_weight.

Hygiene

Anti-patterns

| Anti-pattern | Consequence |

|---|---|

| Writing without rlm_start_session | Silent failure |

| Putting everything into L0 “just in case” | L0 loads always -> every startup gets more expensive |

| Keeping universal knowledge in the native always-on core | Bloats the context every turn - this belongs in RLM (pull) |

| Putting transient (PENDING, WIP) into RLM | Pollutes the knowledge store; transient -> agent-context |

| Reading RLM on every turn | Pull degenerates into push; read at the work boundary |


depends_on:

upstream:


Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.