LLM Workspace Management
Maintain a
global view and cross-wiki orchestration for a local multi-wiki workspace — single-wiki ingest / query / lint operations go to the
skill. This skill sits above all wikis and handles tasks requiring cross-wiki judgment.
Two deliverables:
- SKILL.md (this document) — workflows + boundaries
- Deterministic execution is handled by llmw CLI — this skill is zero-code, converged into two commands; refer to the detector for inconsistencies:
- : Only detect (output drift report, no disk writes)
- : Workspace skeleton + per-wiki aggregated deterministic upgrade (dry-run by default)
Input / Output
Information Required at Startup
| Information | Source | Notes |
|---|
| Workspace path | or default or interactive query | CLI usually sets the variable on enter |
| Operation type | User natural language | scan / query / link / lint / upgrade |
| Query scope (query only) | User natural language or explicitly specified wiki names | Use global INDEX routing if not specified |
Operation Products
- scan → Write + (format A2/A3)
- query → Provide answers in conversation (with per-wiki references); optional archive to
<workspace>/cross_queries/<slug>.md
(format A4)
- link → Add cross-wiki links in involved wikis via the ingest process
- lint → Write (format A5) + conversation summary
- upgrade → Run (dry-run by default; add to write to disk); 3 final-state JSON outputs from CLI; see §6 for details
Execution Principles / Boundaries
Boundary with Workspace CLI
When this skill is active, it can call
— directly execute read / detect / upgrade commands (see
for subcommands and parameters, no enumeration); for commands that modify workspace/wiki metadata or affect running sessions, provide the complete command to the user for confirmation before execution.
Do not write toml manually — Metadata writes must go through CLI (schema validation / atomic writes / uniqueness constraints guaranteed by CLI). Commands involving api_key must always be executed by the user personally (secrets do not pass through the agent).
Boundary with yzr-llm-wiki-management
All single-wiki operations (ingest / query / lint / write files within a wiki) are delegated to
— this skill
does not directly edit
(maintain invariants such as log.md synchronization and frontmatter). This skill only handles workspace-level tasks: scan aggregation / routing / cross-wiki synthesis and comparison / cross-wiki link suggestions / workspace lint / cross-wiki memory.
Products This Skill Can Write (Invariants, Mandatory)
| File / Directory | Writer | Boundary |
|---|
| This skill | Aggregated write during scan |
| This skill | Aggregated write during scan |
<workspace>/cross_queries/
| This skill | Archive for cross-wiki synthetic Q&A |
| This skill | Workspace-level lint report |
| in + synchronized index | This skill | Only cross-wiki experience (single-wiki experience belongs to ) |
Violating ownership = bug. Complete ownership table + quadrant table can be found in the "Boundaries of This Workspace" + "Discipline of This File Itself" sections (byte-owned template rendering) of
.
Workflows / Steps
0. Startup Check
Every time this skill is entered:
- Locate workspace path: → default → interactive query
- Verify that
<workspace>/workspace.toml
exists — if not, prompt the user "Workspace not initialized yet, run to initialize" (do not run it for the user)
- Load cross-wiki MEMORY index: Automatically loaded via import in when working in the workspace root; if working in a non-root directory / reading AGENTS.md natively without expanding agents → explicitly
Read <$LLMW_WORKSPACE>/MEMORY/MEMORY.md
to supplement
- Load scope boundaries: When the agent's cwd is within a subdirectory and switches to running , this skill's discipline does not take over; instead, the single-wiki discipline in takes effect
- Do not run automatically — wait for user's operation intent
1. Scan / refresh-index
Triggers: "Scan workspace" / "Update INDEX.md" / User says "Workspace needs to be refreshed".
Process:
- Read
<workspace>/workspace.toml
to get the registry
- For each wiki:
- Read
<wiki>/wiki_metadata.toml
(maintained by CLI)
- Read the "Boundaries of This Wiki" section in (get boundaries)
- Read (existing content + paragraph skeleton)
- Scan
<wiki>/wiki/{entities,concepts,sources,comparisons,syntheses}/
to get page counts
- Recursively scan to count raw materials (only count, do not read content)
- Read the last entry in to get last activity
- Read to count memory files (only file names)
- Read the
<workspace>/MEMORY/MEMORY.md
index, aggregate according to A2 sorting rules, write INDEX.md + STATS.md (format A2/A3)
- Atomic write (POSIX )
- Report in conversation: "INDEX.md / STATS.md refreshed, X wikis, Y pages, Z raw materials"
When not to scan: If the user only wants to perform a query → use the existing INDEX.md first; if INDEX.md is missing or obviously outdated (does not cover newly added wikis), prompt to scan first.
2. Query (Cross-wiki Q&A)
Triggers: "Summarize content about X across all my wikis" / "Compare A and B on Y" / "Which wiki should I check for X".
4 modes + priority: local > compare > route > synthesis:
| Mode | Trigger Keywords | Process |
|---|
| local | "Only look at wiki X" / "Search Y in X" | Delegate query to |
| compare | "Compare A and B" / "Differences between A and B" | Read both wiki/index.md → query → diff-style comparison |
| route | "Which wiki should I check" / "Which wiki does this belong to" | Read INDEX.md → match by topic / tag / description → return 1-3 candidate wikis |
| synthesis | "Summarize all" / "Synthesize all wikis" / fallback | Route → query each candidate wiki → merge + label per-wiki sources |
Good queries must include an "archive or not" step — archive location:
- If the answer involves a single wiki →
<wiki>/wiki/syntheses/<slug>.md
(via )
- If the answer involves multiple wikis →
<workspace>/cross_queries/<slug>.md
(directly written by this skill, format A4)
When archiving content that references upstream volatile facts, pass perception tests — SSOT rules can be found in the "Stability of Body References" section of
's
references/ingest-workflow.md
.
3. Link (Cross-wiki Cross-referencing)
Triggers: "Entity X in wiki A also exists in wiki B, add a link" / "Scan for cross-wiki duplicate entities".
Process:
- Scan: For each wiki's + , extract all entity names (frontmatter or filename slug)
- Deduplicate and aggregate: Collect cross-wiki entities with the same name / similar meaning (compared by description) as candidate pairs
- Suggest: List candidate pairs in conversation and let the user select which ones need cross-wiki links
- Write: After user confirmation, for each involved wiki, call the ingest process of to update the corresponding entity / concept page — append a "Cross-wiki References" section (xref format see the "Cross-wiki Agreements" section of )
4. Lint (Workspace-level)
Triggers: "Workspace lint" / "Workspace health check" / Periodically (e.g., alongside each scan).
Process:
- Workspace-level deterministic checks (inline in agent):
- Cross-wiki duplicate entities (pairs with same name but different slugs)
- Invalid cross-wiki links (paths in of cross_queries/*.md do not exist; paths in do not exist)
- Unregistered wiki subdirectories ( exists on disk but not registered in workspace.toml)
- Wikis registered in workspace.toml but not present on disk (orphaned registrations)
- Consistency between wiki lists in STATS.md and INDEX.md
- MEMORY index consistency: Scan (excluding ), if any file is not listed in index → report (severity = info)
- Semi-qualitative checks:
- Whether wikis with overlapping topics need to be merged
- Whether the tag system is chaotic (same tag with different meanings / same meaning with different tag names)
- What this skill does not do: Single-wiki internal lint — delegate to
- Output: Write (format A5) + report in conversation
When not to lint: If the user only asks a query → do not lint; if the user says "Scan" → perform scan instead of lint.
5. Memory (Cross-wiki Agent Private Memory)
Triggers: Actively write when identifying cross-wiki information worth preserving during scan / query / link / lint processes.
One-line judgment:
Cross-wiki preferences/associations/patterns/experiences → write;
Single-wiki observations → delegate to
;
Cross-wiki synthetic answers themselves → archive to
;
One-time observations → directly chat.
The complete "when to write/not write" + judgment scale canonical = "Memory Discipline" section (byte-owned template rendering) of
, not repeated in this appendix.
Process:
- Identify observations worth preserving → self-check scope to confirm cross-wiki
- Determine entry format (full / short)
- Write to (full entry) or append a short entry line directly to
- Synchronize one line in MEMORY.md index (missing write = unreadable next time, lint as fallback)
Do not modify /
/
/ any
.
6. Upgrade (Upgrade Workspace Skeleton)
Triggers: "Upgrade workspace / Check workspace version / Format upgrade".
(CLI) = All deterministic operations — workspace skeleton + per-wiki aggregated two-stage processing, handled according to the "Discipline of This File Itself" section (including skeleton ownership quadrant table) of
.
only detects (no disk writes). Agent = run command + interpret output.
Process:
- defaults to dry-run → output workspace + processing plan for each wiki + 3 final-state JSON (add for machine-readable)
- Interpret 3 final states:
- → Wrap up, prompt user "Workspace upgrade completed, X wikis upgraded"
- → Move custom content to according to the field, then re-run
llmw upgrade --apply --yes
- → Report to user, escalate to manual processing
- Subsequent content migration for each wiki uses the workflow — this skill does not run it on behalf of the user
Do not write to
/
/
(upgrade is not a scan / lint event). Upgrade only modifies byte/block/header-owned files, does not touch confidential configurations.
Reference Examples
Example 1: Cross-wiki Synthetic Q&A
User: "What records do I have about RAID across all my wikis?"
- Skill reads → finds that 's description contains "storage"
- Mode = synthesis
- Delegates query "RAID" to for
- Gets answer (with source page references), provides it to user in conversation, and asks "This only involves 1 wiki, should we archive it to
huawei_storage_wiki/wiki/syntheses/raid-overview.md
?"
- User confirms → uses to write synthesis page + log entry
Example 2: Routing
User: "I just downloaded an LLM inference paper, which wiki should I put it in?"
- Skill reads INDEX.md + reads description / tags of each wiki
- Mode = route
- Returns: " focuses on storage, not relevant; wiki focuses on test, not relevant; recommend creating a new wiki (
llmw wiki --name=llm-inference add ...
)"
- Offers to run
llmw wiki --name=llm-inference add
on behalf of the user — execute after user confirmation (skill handles routing and closes the loop)
Reference Documents
- Required Reading: (= rendered from
workspace-agents-md-template.md
template, byte-owned) — canonical workspace-level contract
- Single-wiki Contract: SKILL.md + references/ (this skill reads wiki files according to its contract, does not write directly)
- CLI Documentation: Workspace CLI (command , maintained in the same repo as this skill) — reference for commands like
init / add / remove / config / enter / model ...
here
Appendix: Product Format Contracts and Reading Contracts
This appendix carries format contracts for files written to disk by the skill. Reading contracts and instance ownership can be found in
.
A1. workspace.toml Reading Contract
- Path:
<workspace-root>/workspace.toml
- Complete schema authority is in CLI code;
workspace-toml-reads-satisfied
check verifies reading contract integrity
Fields actually read by the skill (used in
/
):
| Field | Purpose |
|---|
| version comparison + automatic bump (includes / dual components) |
| Skill traverses wiki subdirectories |
[wikis.<name>].created_at
| Wiki sorting within INDEX |
A2. INDEX.md
-
Maintainer:
Skill writes during
; CLI does not write
-
Required frontmatter (A7) +
;
recommended as
;
recommended as
-
Body skeleton:
markdown
# <Workspace Display Name> — Workspace Index
> Workspace entry document. One section per wiki, sorted alphabetically by wiki name; sorted by `created_at` ascending within the same alphabetical group.
## Wikis
### <wiki-name>
- **display_name**: ...
- **topic**: ...
- **description**: ...
- **tags**: [...]
- **created**: YYYY-MM-DD
- **last activity**: YYYY-MM-DD (log entry kind)
- **page counts**: 0 entities / 0 concepts / ...
- **key entities**: [...]
- **one-line summary**: ...
## Cross-wiki Links
...(short description)
## Recent Activity (across all wikis)
...
A3. STATS.md
- Maintainer: Skill writes alongside ; difference from INDEX.md: structured (table)
- Required frontmatter (A7) +
- Body skeleton:
# <Workspace> — Workspace Stats
+ summary table + section with per-wiki sub-tables (pages / entities / concepts / sources / comparisons / syntheses / raw_files / last_log_entry / tags / memory_files)
- Skill write scenario: (same refresh as INDEX.md)
A4. cross_queries/
- Maintainer: Skill writes when query output is suitable for archiving
- File naming: , kebab-case (A8)
- Required frontmatter (A7) + ; recommended as
[workspace, cross-query, <tags of involved wikis>...]
; required (array of paths to wiki pages referenced, relative to workspace root) + (array of involved wiki names)
- Skill write scenario: When user confirms archiving of query output
A5. LINT.md
- Maintainer: Skill writes the latest report during (does not accumulate, overwrites each time, is a snapshot)
- Required frontmatter (A7) +
- Body skeleton:
# <Workspace> — Lint Report (<YYYY-MM-DD>)
+ (one section per wiki, single-wiki lint goes to yzr-llm-wiki-management) + ## Workspace-level Issues
(cross-wiki duplicate entities / unregistered subdirectories / outdated STATS / MEMORY index consistency / ...)
- Skill write scenario: (overwrites each time)
A6. workspace MEMORY/
- Maintainer: CLI creates empty directory and writes index placeholder during init; subsequent entries are written by skill + synchronized to append one line to MEMORY.md index. Humans do not write; CLI does not write
- MEMORY is not mandatory to be listed in INDEX.md (private agent entry)
- Entry format (full / short) + when to write/not write + index line format canonical = "Memory Discipline" section (byte-owned template rendering) of , not repeated in this appendix
A6.1 MEMORY/MEMORY.md (Index)
No frontmatter (loaded inline via
in
); body: 1 introductory paragraph at the top +
section (coexistence of full/short entry formats).
A6.2 MEMORY/*.md (excluding MEMORY.md)
Only
is required in frontmatter;
can be fixed as
(aligned with wiki-side MEMORY decoupling specification);
/
/
/
/
are all optional. Lint
as fallback; no mandatory inbound links, not listed in INDEX.md.
A7. General Frontmatter Field Rules
5 general required fields (workspace-level markdown, except MEMORY/*.md — see A6.2):
| Field | Type | Description |
|---|
| string | Without file extension |
| enum | See table below |
| array | Can be empty |
| date | |
| date | |
values (workspace-level markdown):
| Notes |
|---|
| (unique) |
| (unique) |
| (unique) |
| <workspace>/cross_queries/<slug>.md
|
| (if type is written; optional) |
Type-specialized fields:
| Field | Applicable type | Required | Meaning |
|---|
| | Yes | Array of paths to referenced wiki pages (relative to workspace root) |
| / | Required for / recommended for | List of involved wiki names |
| All | Recommended | One-sentence description |
Semantic writing rules for fields (how to write good
/
/
) SSOT = §1 of
page-templates.md.
A8. Naming Constraints
This table only carries naming constraints for
files written to disk by the skill (these files are not read/written by CLI, no mechanical gate; the only constraint carrier = this section). Wiki names (validated when created via
) and CLI internal identifiers belong to CLI; recommended wiki naming style can be found in the "Cross-wiki Agreements" section of
.
| Dimension | Rule | Applicable Object |
|---|
| cross_query slug | kebab-case | |
| MEMORY filename | kebab-case | (except MEMORY.md) |
| frontmatter field name | Strict lowercase + underscore | All workspace-level markdown |
| frontmatter value | Strict lowercase + hyphen (e.g., / ) | All workspace-level markdown |