Skip to content

Latest commit

 

History

History
214 lines (130 loc) · 33.9 KB

SKILL.md

File metadata and controls

214 lines (130 loc) · 33.9 KB
name code-journal
description Shared project memory and work tracking through the cj command. Read the project brief at session start, search before investigating known behavior, and record durable discoveries and completed work.

Code Journal

Code Journal is shared across agents working on the same Git repository. The cj executable connects to the user's hosted journal. It detects the project from the Git remote and can queue writes while offline. Never include secrets or private source content in journal entries.

Where it applies

Code Journal records belong to physical projects: a Git repository, or a plain folder the user registered with cj project init, including its subfolders. Anywhere else, such as a browser chat workspace, a temporary directory, or the home directory, there is no journal: the session hook says so, and cj refuses project commands. Do not use Code Journal in that session. Run cj project init in a plain folder only when the user asks to register it, and never for temporary or scratch directories; you may ask the user when the folder is clearly a real project.

Start

For a user-requested delegation to another provider, use the installed code-journal-delegation skill or read cj delegation guide. The broker, supervisor, six provider adapters and MCP tools ship in cj; do not invoke external broker scripts. A guest identified by CJ_DELEGATION_ID follows code-journal-guest or cj delegation guide --guest. cj setup agents --refresh refreshes these embedded skills alongside this one.

The CLI repository and installation guide are at https://github.com/illegalstudio/codejournal-cli. Check the installed release with cj --version. Every API request identifies that release; the server can require a newer version.

Install with brew install illegalstudio/tap/codejournal-cli or mise use -g github:illegalstudio/codejournal-cli@latest. Direct downloads and checksum instructions are at https://github.com/illegalstudio/codejournal-cli/releases.

If a command or session hook reports client_upgrade_required, client_version_required, or an unsupported client, tell the user the installed and minimum versions and that an update is required. Do not hide the notice, repeatedly retry the rejected request, spoof the version header, or present cached data or queued writes as synchronized. Preserve the local outbox.

Use the installation's own updater: Homebrew uses brew update && brew upgrade illegalstudio/tap/codejournal-cli; mise uses mise use -g github:illegalstudio/codejournal-cli@VERSION with the required release, or @latest; direct installations use cj update. An explicit mise version avoids its default release-age delay. After updating, run cj --version, cj setup agents --refresh, and cj sync. Follow the user's installation permissions; do not run an installer automatically merely because the server requested an upgrade.

The client checks for a newer release in the background at most once every 24 hours. When a brief or cj status shows Update available (update_available in JSON), tell the user once, with the command it names, and continue the task: this update is optional and nothing is blocked. Do not install it unless the user asks.

Run cj brief before exploring a repository unless the session hook already injected the brief. Follow its project rules, active plans, and open tasks for the whole session. If the rules are empty, summarize the repository's instruction files with cj rules set and tell the user. A Duplicate journal line means another project is registered for this same checkout and its history is hidden here: read it with cj brief --project SLUG, tell the user, and merge or remove a registration only with their confirmation.

Search before rediscovering a behavior or debugging a known failure:

cj search "keyword"
cj search "keyword" --all-projects
cj search "liveness" --literal
cj search "repl" --whole-word
cj show ENTRY_ID
cj topics

cj browse is interactive and should be suggested to the user, not run by an agent. cj open opens the hosted dashboard for this project.

Full-text search requires every term by default; use --any to match at least one. Empty multi-term results explain this in text and JSON notices. Add --relaxed to explicitly retry an empty strict search with ranked any-term matching. Empty results include bounded related document excerpts; dotted identifiers such as IPv4 addresses, versions and file names stay whole in both entry matching and document suggestions, which also ignore bare one- or two-digit numbers next to more specific words. Use cj search --ref owner/repo#12 for an exact qualified issue/PR reference across entries and current docs, avoiding unrelated body numbers. Use cj topics find TERM to discover up to 50 literal topic-name matches, optionally with --all-projects. Use --whole-word for a literal word or phrase with boundaries (letters, digits and underscores count as word characters), such as repl without replacement. It requires an updated server and conflicts with --any and --prefix.

When an entry search is empty, use its suggested cj doc list --grep QUERY command to find current docs. The suggestion preserves the selected project or explicit all-projects scope; a relevant doc can exist even if no knowledge entry matches.

When the server cannot be reached, a search first reuses the cached response of the identical request and states when it was saved (cached_at). Without one, it answers from the entries earlier searches and cj show reads saw on this machine: the notice and JSON local_index give how many entries are remembered and between which times they were seen. Such results are incomplete by construction, cannot filter by --path or --ref, and may show outdated statuses; repeat the search online before concluding that something is undocumented. A cached brief names when it was saved and, unless that was moments ago, withholds other sessions and delegations because they may have ended.

Search results include a short matching excerpt in text and JSON. Full-text results also label matches: (stemmed words only) marks entries where a query word matched only an inflected form, and when most results are such matches a notice suggests --literal, --whole-word or --topic. If stemming returns unrelated words, use --literal for a case-insensitive phrase in titles, bodies or refs, preserving punctuation. It requires a query and cannot combine with --any or --prefix.

Archived projects

A brief with archived: true, an Archived: read-only notice, or a project_archived error means the project is intentionally inactive. Do not initialize it again, write missing rules, run maintenance or record work there. Do not restore it automatically to satisfy a journal instruction. Tell the user and restore only when they explicitly ask, using cj project restore --project SLUG while online. Explicit history reads remain available; default project lists, discovery and briefs hide archived context.

Use cj project archive --project SLUG when the user asks to archive a completed project, cj projects --archived to find archives, and cj projects --all to inspect every project. Finish or cancel its active watches first. Preserve queued writes after an archive rejection; the user can restore the project before retrying synchronization.

Record knowledge

Add one verifiable, non-obvious fact per entry. Write entries in English, reuse existing topics, and reference the affected path or commit:

cj add --durable --kind gotcha --title "The migration needs a special role" \
  --topics database --ref path:database/migrations/example.php \
  --body "What failed, why, and how to run it correctly."

Repository refs use path:relative/file. For files outside the checkout use file:/absolute/path or file:~/path for this machine, and host:HOST:/absolute/path for a remote machine. These become url:file://HOST/path refs, retaining the host and encoded path without triggering repository staleness checks or reading remote files. Verify them manually on the named host. Do not cite credentials or personal files.

For scripts, confirmed cj add --json writes expose the UUID at resource_id, id and entry.id, with queued=false. Prefer resource_id: queued writes leave it null while their legacy id remains the request ID. Resolve queued creation with cj outbox receipt REQUEST_ID after synchronization before using it in supersede or another resource command.

Agent-authored project observations (discovery, gotcha, howto) expire after 30 days by default. Use cj add --temporary when attribution is unavailable and --durable for knowledge already worth keeping. --temporary accepts only those three kinds and fails before any request for the others. When a note helps with actual work, record it with cj entry use ID task TASK_ID, cj entry use ID log LOG_ID or cj entry use ID pr owner/repo#42. This promotes a temporary note. Use cj entry promote ID for an explicit promotion. Garden prioritizes notes with active successors and surfaces older observations without useful signals. Treat this as one signal because briefs and dashboard views may leave no entry-use record. Move a retired entry or closed work record to the 90-day trash only on the user's instruction, using cj entry|task|plan|doc trash ID. The matching restore action clears its deletion deadline.

Use --global only for facts that apply beyond this repository. To replace a fact, record the corrected entry with cj add --supersedes OLD_ID: one request stores it and marks the old entry as superseded, and the title may stay the same. For reference-only corrections, read entry.refs_version and use cj entry refs ID --base HASH --ref path:correct/path; this replaces the full reference list while preserving the fact. --clear-refs explicitly clears it. A failed cj show lookup can suggest the typed reader when the ID belongs to another record type. When cj show ends with newer environment facts (newer_environment in JSON), read them before relying on hosts, access paths or commands in the older entry, and supersede the entry if they contradict it. Correct stale knowledge with cj supersede OLD --by NEW, cj obsolete ID, or cj entry flag ID --wrong --note "...". Answer open questions with cj answer ID.

Log work

At the end of a turn that changed anything durable, record one log with the goal, result, and remaining work:

cj log add --title "Implemented the device flow" --status done \
  --plan PLAN_ID --body "What changed, what passed, what remains."

The client links session commits where possible. Automatic attribution fills the remaining slots within the 30-reference limit, oldest first; excess captured commits remain pending for the next log. Inspect the explicit notice and JSON commit_tracking. Use --no-auto-commits when the log must not cite them.

Move an existing work log with cj log move ID --to SLUG, preserving its ID, timestamp, content, attribution, refs and plan link. Preview with --dry-run while online; previews never queue. cj plan move ID --to SLUG --with-logs transfers the plan and all linked live logs atomically, including logs left in earlier projects. Without that option, only the plan moves. Every affected project must be writable. The hosted service deletes work logs and other activity 12 months after they are recorded, so an older log ID returns not found; knowledge, docs, plans and tasks are kept.

Read a previous work log with cj log show LOG_ID, or add --body for its body alone. cj show reads knowledge entries. For automatic commit linking, run the commit and the log in separate tool calls with enabled, trusted commit-tracking hooks so the post-tool hook can record the commit first. In one shell invocation, supply --ref commit:HEAD (resolved immediately to a full SHA) or an explicit SHA. An uncaptured HEAD change produces a notice without blocking log creation or inferring ownership. If it belongs to this session, use an explicit commit ref. cj log add names every commit it links automatically (short SHA, subject and the checkout that captured them); when the warning appears, those are earlier captures, not the new HEAD. Captured commit output is required for automatic attribution; a dry run or successful command alone does not establish ownership. A queued log reserves its commit refs too, avoiding duplicate automatic links. Add a reference to an existing log with cj log update LOG_ID --add-ref commit:SHA (log edit is an alias), which keeps the stored ones. --ref replaces all refs, so include paths or URLs you want to retain, and --clear-refs removes them. The confirmation states how many refs there were before and after. Archived logs are read-only.

Amend a work log using cj log update ID --base REVISION --body-file FILE --status done after reading its current revision through cj log show ID. Body/status edits require the base; omitted refs and other content stay intact. An explicit empty body clears it. Ref-only changes retain the existing command, with an optional --base for protection. Amendments require the updated server. Offline requests keep their original base and conflicts remain pending; read the current log and review the difference instead of silently changing that base. Existing timestamps and attribution are preserved. Mutation JSON explicitly reports body_omitted and a readback_command; read the stored log to verify its canonical body. Archived activity and archived projects remain read-only.

Track tasks and plans

Start a matching open task before doing it, then close it with a useful note:

cj task start ID
cj task done ID --note "What changed"
cj task add --title "Follow-up" --body "Why it matters"
cj plan show ID
cj plan show ID --json
cj plan update ID --body-file PLAN.md
cj plan step ID 2 --done --note "Validated"
cj plan step ID 2 --undone

Use cj task add --to PROJECT to forward work to another project. Keep longer plans and subsystem documentation in Code Journal and in repository files when the repository requires them.

cj task show ID returns the current task with its latest five events, in text and JSON; events_total and events_omitted report the rest, and --history returns every event. Reading resolves a task in any project, changing one is scoped: when the task belongs to another project, the output adds a scope: line and change_scope in JSON with the ready cj task edit ID --project SLUG --base BODY_VERSION command. Task descriptions can be edited with cj task edit ID --body TEXT or --body-file FILE, requiring --base BODY_VERSION from cj task show ID. Conflicts preserve the current body and task identity. Confirmed content amendments of a log created in this session satisfy its Stop reminder; unrelated log and refs-only edits do not.

When the current project depends on an existing upstream task, register it with cj task follow ID. Use --project SLUG for an explicit consumer and cj task unfollow ID to remove the relation. The task keeps its original source and closure results appear in the briefs of all following projects with cross-project access.

Use cj task edit ID --append-body TEXT --base BODY_VERSION to append context atomically without replacing existing text. Priorities are low, normal, high, and critical. Link a plan with cj task link ID plan:PLAN_ID or task edit ID --plan PLAN_ID; use --no-plan to unlink. task edit --ref REF replaces refs, and --clear-refs removes them. Forwarded tasks must use qualified URLs for source repository paths, commits or branches, since bare refs belong to the destination project; add --destination-refs when the bare refs name files, commits or branches of the destination repository, so they stay real refs with staleness checks. cj entry show ID is an alias for cj show ID.

Checklist items are numbered from one in Markdown order, excluding fenced examples. Both - [ ] and 1. [ ] (including 1) [ ]) are supported online and offline. Steps validate the requested checkbox before writing and require a fresh online revision; failed online reads do not fall back to cached revisions. Use --offline explicitly for cached or pending content. Updates send an atomic change with the base revision; a concurrent edit returns a conflict instead of replacing the body. Read the plan again and retry after reviewing it.

Plan statuses are draft, active, done, and abandoned; doc statuses are draft, current, and outdated. Help lists accepted statuses and feedback categories, and invalid values fail before an API request. Plan/doc show returns current content and lightweight revision counts by default, including JSON. Use --revision N for one specific version, --history for a paged index without old bodies, or --all-revisions to explicitly fetch all content within the server response budget. --current-only remains compatible. Add references to a plan or doc with --add-ref, which keeps the stored ones. --ref replaces the entire ref list; omit both flags to retain existing refs. The confirmation states how many refs there were before and after, and show lists them. When an existing doc already covers a busy topic the brief lists under doc candidates, declare it with cj doc update ID --topics NAME[,NAME] (or --topics on doc create) instead of writing a duplicate; the names must be existing topics, the list replaces the declared one, and --clear-topics empties it.

Plan/doc content reads and mutation confirmations show body_size in JSON and human-readable character counts. The cap is 100,000 Unicode characters; at 90,000, warnings suggest compacting current state while retaining historical numbered revisions. Measure the current or locally projected content, not the serialized JSON byte size. show --body remains plain Markdown; historical reads show size without urging edits to that old snapshot.

For a large doc or plan use show ID --section "Heading" --max-lines 80, or --max-lines N alone. Selection excludes history, defaults to 200 lines, caps content at 16000 characters, and exposes line ranges, full size and truncation in body_selection. It requires an updated server. Body updates trim outer whitespace and remove duplicate leading title headings; compare confirmed canonical content.

Reminders

When the user asks to revisit something later, save a reminder instead of relying on conversation memory. Convert natural dates to an explicit calendar date/time and IANA timezone, preserve why the follow-up matters, and confirm the exact schedule. A date without a time means 09:00 in that timezone.

cj reminder add --title "Revisit the cache choice" --at 2026-11-28T09:00 --timezone Europe/Rome --body "Review the feedback before deciding."
cj reminder add --global --title "Review project priorities" --at 2026-11-28 --timezone Europe/Rome
cj reminder list --state due
cj reminder show ID
cj reminder reschedule ID --at 2026-12-12T09:00 --timezone Europe/Rome
cj reminder close ID

Reminders retain their source project but default to announcements across authorized projects in the same workspace. Use add --project-only when explicitly requested. list covers the workspace; list --project-only limits it to the current project. Open reminders are the default; use --state closed or --all for history, and --verbose for full context. An optional --reference-url links a related task, plan, or other HTTP(S) page. The dashboard's Reminders page supports creation, rescheduling, closing and reopening.

When a brief contains due reminders, the agent speaking directly to the user must mention them in its first useful response. Before announcing one, run cj reminder claim ID --json. Announce only if claimed=true, using the returned current reminder and its source project. Then run cj reminder presented ID --delivery-token TOKEN with that claim's delivery_token. This records delivery without resolving the reminder and suppresses repeated announcements for 24 hours across sessions. Claims expire after ten minutes if the agent stops. Claim and presentation require an online response and never queue. Cached briefs alone do not authorize an announcement. Delegated guests and background agents leave reminders for the agent talking to the user.

Do not close a reminder because it appeared in a brief, was read on the site, or was announced. Keep it open until the user asks to close or reschedule it. If the user decides to do the work, create or start an appropriate task and close the reminder only as part of that explicit decision. A due reminder alone never authorizes starting its work. Creation, rescheduling and closure use the normal durable offline queue; queued writes are not confirmed changes. Rescheduling and closure preserve their original content revision and report a conflict if another session changed it.

Active discovery and detail

Source-project briefs also retain up to ten forwarded tasks closed in the last 30 days, including the destination project. Reading them never consumes or acknowledges them. Use forwarded_results_info to inspect empty-window or plan suppression reasons, and cj brief --all for older closures within the same bound.

Default discovery in text and JSON returns current docs, active plans, open/in-progress tasks, open feedback, active knowledge and watches, and unread notifications. Recent work logs remain useful context, including completed work. Draft or terminal records require an explicit lifecycle flag. Use cj doc list --status outdated, cj plan list --status draft, cj task list --status done, or list --all for every status. Knowledge search accepts --all-statuses (alias --all), and notifications accept --read or --all.

Lists and normal briefs return summaries without record bodies. Request --verbose for content and full metadata, or deliberately read a chosen ID. Visibility and detail are independent: --all still uses summaries. --global, --local and --all-projects change scope without widening lifecycle visibility. cj brief --all opts into inactive records; --verbose supplies full JSON content. Hooks and cached briefs preserve complete rules, active coordination and recent work while following the same defaults. Exports and backups preserve all data.

Use cj task list --grep TEXT for a case-insensitive literal match on titles or bodies before the result limit, preserving lifecycle and project filters. Add --whole-word for acronyms such as INI without matching initialization. An already absent checkout removal succeeds with an explicit reason. After a repository move, cj checkouts remove /old/absolute/path [--host HOST] forgets that exact registration and Live observation without resolving symlinks or changing files. cj project path-remove is equivalent. cj refs move accepts bare paths or path:OLD path:NEW.

Use cj feedback show ID to retrieve just one complete report, including resolved feedback and reports from archived projects. It accepts a full ID or a unique prefix of at least eight hexadecimal characters and supports --json; no checkout or list download is needed.

Incremental maintenance

When the brief lists stored reviews, open a small batch with cj garden --pending --limit 2. Use cj garden to refresh all evidence when maintenance is due. Use --scan-pages N to bound the reference scan and --scan-from PAGE to resume at scan_next_page. Bounded runs skip full maintenance. Full scans emit page progress on stderr and preserve JSON on stdout. The default output is five findings prioritized by severity. Before recording an outcome, read the target and verify the cited code in its owning checkout. Running a scan or applying repairs does not acknowledge a manual finding.

Duplicate candidates require the same normalized title terms, including subject names and identifiers. Reordered words and inflections can match; shared title templates with different subjects do not suffice. This conservative detector does not find every paraphrase.

Fix inaccurate content with its normal update, supersede or obsolete command, then record the finding's outcome with evidence:

cj garden review FINDING_ID --outcome verified --note "Checked the cited code and regression."
cj garden review FINDING_ID --outcome corrected --note "Updated doc DOC_ID to match the implementation."
cj garden review FINDING_ID --outcome deferred --until 2026-10-14T00:00:00Z --note "Awaiting the migration."

Use verified, corrected, superseded, obsolete, dismissed or deferred to describe the actual result. Notes are required; deferral needs a future timestamp. A review records a decision without changing its underlying content. Never acknowledge unverified findings or mass-dismiss a long queue. Leave unrelated items pending when the current task does not justify their review.

Use --after FINDING_UUID to continue the stored queue without another scan, --limit N for 1 to 25 items, and --all only when the complete pending report is needed. --dry-run writes nothing; --dry-run --all explicitly previews every finding. Preview IDs become reviewable after a matching online scan. Offline previews are cached and may be stale; record outcomes online. Older servers explicitly report that persistent reviews are unavailable.

Reviewed evidence stays suppressed across sessions, unrelated commits and committing already reviewed changes. A relevant content or cited-file change creates a new finding. The brief keeps pending counts visible, and scan/review timestamps remain separate. Preserve existing pending requests and let cj sync retry review writes safely.

Notifications and offline work

Use cj outbox retry REQUEST_ID to retry only the oldest queued write for the current server, workspace and credentials. The command preserves the original request ID and honors retry delays. It accepts a full UUID or an unambiguous prefix of at least eight hexadecimal characters. Writes in one account and workspace are delivered in order, so one write the server rejects for good (for example a 409 on an outdated base) keeps every later one queued. A queued receipt then says so instead of promising a retry: read queued_behind in JSON (request_id, ahead, rejected, error, repair) and do not treat it as a transient outage. cj status shows the same request under blocked by. To repair it, read the current record, merge what changed if the write replaces a body, then run cj outbox rebase REQUEST_ID --base VERSION and cj sync. Rebase changes only that write's base, keeps its request ID and queue position, and sends nothing. Use cj outbox drop REQUEST_ID only for a write you decide to abandon; never drop unrelated requests to unblock the queue.

Online commands and hooks automatically resume credential-scoped writes and hook events in a detached worker. Transient failures back off and honor server retry delays; the next online command/hook restarts recovery after a machine restart. cj status shows separate write/event counts, age, last success, next retry and blockers. New writes join older pending requests in order. Explicit --offline does not wake a worker; CODE_JOURNAL_AUTO_SYNC=off prevents automatic startup. Existing workers continue independently. Unbound older requests require explicit cj sync under their original account. Permanent rejections, required upgrades and expired retry windows stay pending and need attention. Background delivery never runs watched commands; their explicit recovery protocol below remains required.

On an updated server, compatible queued writes can finish synchronization from a compact confirmation after the full response expires. Older replies can still produce idempotency_response_evicted and stay queued for verification. Use cj outbox receipt REQUEST_ID to resolve supported resource IDs in that case. Ordinary queued writes stop retrying automatically after 90 days.

Unbound hook events are distinct from older requests: neither background delivery nor cj sync sends them. Status separates current-account, other-account, unbound and unknown hook scopes. Inspect them without authentication with cj outbox hooks list; --body adds redacted payloads. Verify the original account before explicitly binding one event with cj outbox hooks bind ID --to-current-account, then run cj sync. Binding never reassigns already-bound events. cj outbox hooks drop ID permanently discards only that hook, without authentication. Both mutations require a full ID or unique prefix of at least eight hexadecimal characters and respect the delivery lock. Preserve events when their original account is uncertain. Unbound events are removed automatically 48 hours after they were queued; bound events for other accounts are never removed this way.

Use cj watch output ID [--lines N] for a bounded snapshot of stdout/stderr (40 lines by default, at most 200). It reads verified local output on the original host and credential scope, or a stored server tail. Output source, verified runner PID and local file update time are explicit. Lease renewal is contact, not command progress. Offline reads require a cached detail lookup for the same ID or prefix; cached metadata may accompany fresh local output. Do not discover private state paths to inspect progress.

Ask for human decisions directly in the agent conversation. Use cj notify --important --kind info|done|error only for exceptional updates worth interrupting the user, such as a material failure or a requested milestone. Explain the impact in the body. Keep routine status in the agent conversation or the work log. Use cj watch start --title "..." -- COMMAND when asked to report when a long command ends. cj status shows pending writes by server; cj sync replays only the configured server's writes. Other servers' queues remain intact. Use cj outbox list without authentication to inspect request IDs, servers, methods and paths; --body includes redacted bodies and --server URL filters them. cj outbox drop REQUEST_ID permanently discards one pending write. It never removes hook events. Transport errors, 5xx responses, deferred writes and invalid JSON success responses keep the same durable ID for replay, including project-bootstrap retries. Rejected writes explicitly say they were not queued. Offline doc moves require cached source details and destination project details; fetch them online first. Use --to @global, not global, for tenant-global docs. The session-start hook surfaces unavailable authentication before the first write. The session hook records activity without prompt text or file contents. It never creates notifications: end-of-turn, permission and question prompts stay session activity in the agent's terminal.

New queued plans and docs return a reserved resource UUID, distinct from the request ID. Use that resource UUID for dependent commands. cj plan show ID --offline projects ordered pending edits over the queued creation or cached current revision, with local_pending=true and synced=false; queued request bodies and IDs remain unchanged. cj plan step uses that projected revision. A remote revision conflict stays pending for explicit review. Historical revision reads require confirmed server data.

The repository's AGENTS.md and the user's instructions take precedence over this skill.

Watch startup succeeds only after the local command actually starts. A queued start exits nonzero with queued=true, started=false, watch_id and request_id; recover it with cj sync under the original account on the original host. Synchronization consumes unused local authorization once and never reruns an already started command. starting means awaiting the runner, running means it renews a lease, and lost means contact expired and the outcome is unknown. Startup failures identify a private runner log. Cancel by full UUID or unique prefix with cj watch cancel ID; cancellation uses direct retrieval and works without local PID metadata or a complete history download.

Shared documentation

Global docs belong to the current tenant and are available from every project with cross-project access. They are agent-facing documentation, not project rules. The full brief lists current global docs separately; compact briefs include only docs with refs matching current Git changes. Open relevant docs with cj doc show ID.

cj doc create --global --title "Shared runbook" --body-file RUNBOOK.md --ref path:src
cj doc list --global
cj doc list --grep "runbook"
cj doc list --local --grep "runbook"
cj doc list --all-projects --grep "runbook"
cj doc move ID --to @global
cj doc move ID --to PROJECT_SLUG

--global creation conflicts with explicit --project. Default doc creation stays local to the project. Default doc listing and search include the current project's docs and the tenant's global docs. Use --local to exclude shared docs, --global for shared docs only, or --all-projects for every project plus global docs. Shared docs are labelled GLOBAL. Moves retain the ID and history; plans cannot move to global scope. Offline writes and cached reads follow the normal journal queue behavior.

Use cj entry move ID --to SLUG --dry-run to preview a selected knowledge transfer, then omit --dry-run to apply it. --path-prefix OLD --replace-prefix NEW rebases repository paths, with an empty NEW removing the prefix. The entry keeps its ID, date, author, topics and usage history; a source-project provenance log retains the old refs. Both projects must be writable. Never recreate entries just to move them.

Topic similarity defaults to the current project and relevant visible global knowledge. cj topics similar --all-projects requests workspace-wide analysis explicitly. Garden JSON separates topic_analysis_partial from review_queue_complete; a finished review queue does not mean exhaustive topic analysis. Plain prose words do not identify project dependencies; cite a project slug, qualified repository/package, or exact backticked identifier.

Automatic commit linking requires the current checkout and ancestry of its HEAD, in addition to the session's captured commit. Use explicit commit refs for work done in another checkout. cj --version and cj status show the build revision and dirty marker while the release remains the API compatibility version.