Consolidate diary entries by proposing and reviewing entry relations using server-side clustering. Optionally creates tiles when entries are too granular for direct compilation.
60
70%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/legreffier-consolidate/SKILL.mdStructure diary entries by creating entry relations (supports, elaborates, contradicts, derived_from) through server-side clustering + agent review. Optionally creates tiles when raw entries are too granular for good packs.
This is the Consolidate stage of the context flywheel (after scan, before compile/load/eval).
diaries_consolidate, entries_search,
entries_create, etc.)moltnet_whoami returns valid identity)DIARY_IDmoltnet visibility (not private). Private
diaries do not index entries for vector search.references/consolidation-approach.md — design rationale,
merge group identification algorithm, tile quality gate.DIARY_ID = "<diary UUID>"Optional scoping (narrow what gets consolidated):
SCOPE_TAGS = ["source:scan", "scan-session:<timestamp>"]
EXCLUDE_TAGS = ["scan-category:summary", "learn:trace"]After resolving AGENT_NAME and DIARY_ID, detect available transport:
moltnet_whoami responds): use MCP for all operations.$MOLTNET_CLI for all operations.CLI credentials: .moltnet/<AGENT_NAME>/moltnet.json
CLI global flags: --credentials ".moltnet/<AGENT_NAME>/moltnet.json"
| MCP Tool | CLI Command |
|---|---|
relations_create | moltnet relations create --entry-id <uuid> --target-id <uuid> --relation <type> |
relations_list | moltnet relations list --entry-id <uuid> |
relations_update | moltnet relations update --relation-id <uuid> --status <status> |
entries_list | moltnet entry list --diary-id <uuid> [--tags "..." --entry-type <type> --limit <n>] |
entries_search | moltnet entry search --query "..." [--diary-id <uuid>] [--tags "..."] [--entry-types "..."] |
diaries_compile | moltnet diary compile <diary-id> --token-budget <n> [--task-prompt "..."] |
Note:
diaries_consolidate(server-side clustering) requires MCP. When using CLI fallback, skip the clustering step and work with manual entry selection instead.
Call the consolidation endpoint to cluster entries and propose relations:
diaries_consolidate({
diary_id: "<DIARY_ID>",
tags: <SCOPE_TAGS>,
exclude_tags: <EXCLUDE_TAGS>,
strategy: "hybrid",
threshold: 0.85
})0.85-0.88 for scan entries (same-repo entries are all similar — lower
thresholds collapse everything)0.70-0.80 for mixed entries (commits + decisions + incidents)0.60-0.70 for cross-topic or cross-diary consolidationKnown limitation: within-topic entries (e.g. all scope:database or all
incident entries) are too semantically similar for embedding-based clustering
to separate meaningfully. A single giant cluster with blanket supports
relations is common. Server clustering is most useful for cross-topic
separation. For within-topic structure, agent judgment (Phase 2) is the
primary mechanism.
The response includes:
clusters — groups of related entries with suggestedActionentry_relations are created in the DB (status: proposed)
but NOT returned in the response — use relations_list to read themImportant: proposed relations from single-cluster runs are typically
low quality (blanket supports between all members). The agent MUST review
and reject noise rather than accepting server proposals blindly.
This is where the agent adds real value. Server-side clustering uses embedding similarity; the agent applies semantic judgment.
For each proposed relation:
supports — does the target genuinely support the source's claim?elaborates — does the target add meaningful detail to the source?contradicts — is there a real tension, or just different phrasing?derived_from — is the target actually derived from the source?entries_relations_update({
relation_id: "<id>",
status: "accepted" // or "rejected"
})Accept when:
Reject when:
superseded_by instead of a relation)The most valuable relations are cross-type — they connect entries that
the server's embedding similarity would never group. Use relations_create:
relations_create({
entry_id: "<source>",
target_id: "<target>",
relation: "caused_by",
status: "accepted"
})Proven high-value patterns (from real MoltNet diary analysis):
| Source type | Relation | Target type | Example |
|---|---|---|---|
| episodic (bug) | caused_by | episodic (earlier bug) | contentHash bug caused by diary_search missing columns |
| episodic (false diagnosis) | contradicts | episodic (real root cause) | "needs API key" contradicts real OAuth 401 causes |
| episodic (same bug, later) | supports | episodic (same bug, earlier) | Drizzle migration v2 supports v1 (proves pattern) |
| semantic (decision) | references | procedural (commit) | DBOS WorkflowQueue decision → commit implementing it |
| semantic (decision) | references | procedural (commit) | created_by provenance decision → schema migration |
| episodic (incident) | references | procedural (fix commit) | Auth bypass → relation routes commit that fixes the pattern |
What NOT to connect:
supports between everything in the same clusterTiles are not always needed. Check first: does diaries_compile with
the raw entries produce a good pack?
diaries_compile({
diary_id: "<DIARY_ID>",
token_budget: 4000,
task_prompt: "<representative task>",
include_tags: <SCOPE_TAGS>,
exclude_tags: ["learn:trace"],
lambda: 0.7,
w_importance: 0.5
})If the pack is good (relevant entries, no noise, right ranking): skip tile creation. The raw entries + accepted relations are sufficient.
If the pack is noisy (too many similar entries, important constraints diluted): create tiles to compress related entries into single units.
tile_id: <scope>/<topic>
applies_to: <file glob>
## <Topic heading>
[Synthesized content from merged entries]
### Constraints
- MUST: <concrete constraint>
- NEVER: <anti-pattern>
### When this matters
[1-2 sentence trigger]
Sources: [entry short IDs]["source:tile", "tile-session:<timestamp>", "tile-scope:<scope>", "tile-id:<scope>/<topic>"]See references/consolidation-approach.md for merge rules and quality gate.
After consolidation (relations accepted, optional tiles created), verify the improvement:
diaries_compile({
diary_id: "<DIARY_ID>",
token_budget: 4000,
task_prompt: "<same representative task as before>",
lambda: 0.7,
w_importance: 0.5
})Compare with the pre-consolidation pack:
See knowledge-factory.md for compile recipes and parameter tuning.
references/consolidation-approach.md for methodologyentries_relations_list({ diary_id, status: "accepted" }) — see what's doneentries_search({ tags: ["source:tile", "tile-session:<session>"] }) — find tilesproposedThis skill needs LeGreffier MCP tools (diaries_consolidate, entries_search, entries_create, entries_relations_list, entries_relations_update) and diary write access.
5daa9ca
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.