feat(kb,okf): OKF init viewer and script fixes - #82
Conversation
kb gains an `init` skill/command that scaffolds a self-contained, OKF v0.1-conformant shared-brain folder (AGENTS.md/DREAM.md/MEMORY.md, memory/, raw/inbox/, and a vendored bin/kb CLI) — idempotent, and never touches anything outside the target folder without explicit confirmation. okf gains render_okf_viewer.py: a generic self-contained HTML graph viewer for any OKF bundle, reading edges from related: frontmatter, [[wikilinks]], and OKF's own [text](path.md) markdown links. kb's scaffold vendors a copy so a generated kb keeps working standalone. Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>
scripts/install-antigravity.sh: replace unquoted command-substitution array assignment (SC2207) with a portable read loop — avoids word splitting/globbing and stays bash 3.2 compatible (macOS default). kb/skills/init/templates/scripts/wire.sh: silence SC2088 with an explicit disable comment — the "~/kb" there is an intentional literal display string, not a path meant to expand. Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>
render_okf_viewer.py (okf canonical + kb vendored copy, kept in sync): - Skip hidden directories (.git, .obsidian, .agent) when walking for concepts and when listing subdirs, so stray .md files and vault config never leak into the bundle or the graph. - Fix a dead-link bug: "Groups" links in a generated index.md could point at a child directory that itself had no concepts and no index.md. Recompute index-worthiness bottom-up so a directory is only linked if it (or a descendant) actually has content. - Warn (not silently corrupt) on duplicate slugs across directories, since build_bundle() uses the bare slug as the Cytoscape node id. - Read notes with utf-8-sig so a UTF-8 BOM doesn't break frontmatter parsing. - Escape text fields (label/type/description/tags/backlinks) before building the viewer's innerHTML, restrict the "source" link to http(s) URLs, and neutralize <, >, & in the embedded JSON bundle so a note's content can't break out of the <script> tag. Documented the remaining trust boundary: a concept's markdown body is still rendered via marked.parse unsanitized, same as opening a vault in Obsidian — this tool assumes the bundle itself is trusted content. kb templates: - sync.sh: don't swallow a failed rebase with `|| true` — a conflict must stop the script before it commits/pushes conflict markers. - bin/kb: quote the cron path (spaces in $KB_DIR), add an xdg-open fallback for `kb viz` on Linux. - wire.sh: `wire off` no longer creates a target file that didn't already exist. - AGENTS.md: fix the frontmatter example to include the `<type>-` prefix, matching the naming rule described just above it. - SKILL.md / README.md: markdownlint fixes (blank lines around a fenced block, language tag on the directory tree fence). Addresses review feedback from CodeRabbit and Gemini Code Assist on PR #80. Skipped: "open files without a context manager" (flagged low-value by the bot itself, not worth the churn on a short-lived CLI); full sanitization of rendered markdown body content (heavy lift, documented as an explicit trust boundary instead — see render_okf_viewer.py's module docstring). Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>
Reformat every shell script touched in this branch with shfmt (default
style, matching the repo's Lint job) and every markdown file with
prettier — whitespace/structure only, no behavior change. Also:
- bin/kb: quote ${f#"$KB_DIR"/} per shellcheck SC2295.
- AGENTS.md: fix the memory-types table's column alignment (MD060).
Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>
Skill + /command-code:dispatch command + cmd-dispatcher agent to drive the Command Code CLI (cmd) and orchestrate it as a headless sub-agent. Standard dispatch invocation: cmd -p --yolo --max-turns 100000 --skip-onboarding across isolated git worktrees, one branch per worker. Registered in both marketplaces.
…ssions Resuming reloads the entire prior conversation; on a big multi-file run this can exceed the model context window and fail immediately. Prefer a fresh scoped cmd -p for small leftover tasks. Learned from a real dispatch this session.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Reviewer's GuideAdds an OKF bundle HTML graph viewer script and wires it into the kb/init and okf plugins, documents new kb init and Command Code cmd-dispatch functionality, and fixes the Antigravity plugin installer script to correctly collect plugin names. Sequence diagram for OKF bundle viewer renderingsequenceDiagram
actor User
participant render_okf_viewer_py as render_okf_viewer.py
participant FileSystem
participant Browser
User->>render_okf_viewer_py: python3 render_okf_viewer.py bundle_dir --title name --out viz.html
render_okf_viewer_py->>FileSystem: collect(bundle_dir)
render_okf_viewer_py->>FileSystem: write_indexes(bundle_dir, concepts, title)
render_okf_viewer_py->>render_okf_viewer_py: build_bundle(bundle_dir, concepts)
render_okf_viewer_py->>FileSystem: write viz.html
User->>Browser: open viz.html
Browser->>Browser: window.BUNDLE = bundle_json
Browser->>Browser: cytoscape(...) layout using nodes and edges
Browser->>User: interactive graph viewer (click node → detail pane)
Sequence diagram for kb init scaffolding with OKF viewersequenceDiagram
actor User
participant init_skill as kb_init_skill
participant scaffold_sh as scaffold.sh
participant Templates
participant render_okf_viewer_py as render_okf_viewer.py
User->>init_skill: init [target_path]
init_skill->>init_skill: resolve target (arg | KB_DIR | ~/kb)
init_skill->>scaffold_sh: bash scaffold.sh target
scaffold_sh->>Templates: read AGENTS.md, README.md, scripts/*, memory/_TEMPLATE.md
scaffold_sh->>scaffold_sh: put(src, dest) for missing files
scaffold_sh->>scaffold_sh: create starter dirs (memory/*, raw/inbox, .agent)
scaffold_sh->>render_okf_viewer_py: python3 render_okf_viewer.py memory --title basename(target) --out viz.html
render_okf_viewer_py->>scaffold_sh: generated index.md + viz.html
scaffold_sh->>init_skill: report created vs skipped files
init_skill->>User: summarize scaffold + suggest PATH/git/wire follow-ups
Sequence diagram for Command Code headless dispatch workflowsequenceDiagram
actor User
participant cmd_dispatcher as cmd_dispatcher_agent
participant Git
participant Cmd as cmd_cli
User->>cmd_dispatcher: /command-code:dispatch "$ARGUMENTS"
cmd_dispatcher->>Cmd: which cmd && cmd status
cmd_dispatcher->>cmd_dispatcher: parse $ARGUMENTS into tasks/issues
loop per task
cmd_dispatcher->>Git: git worktree add -b feat/slug /path/to/wt/slug base_branch
cmd_dispatcher->>Cmd: cmd -p "spec for task" --yolo --max-turns 100000 --skip-onboarding > wt.log &
Cmd-->>Git: implement, test, git commit
end
cmd_dispatcher->>Git: git -C /path/to/wt/slug diff --stat base_branch..HEAD
cmd_dispatcher->>User: report per-branch changes, completion, and merge recommendations
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # marketplace.json
Merges kb-okf-init-viewer into master.
https://claude.ai/code/session_01Np7fmVH3ihQc483DEVJBzi
Summary by Sourcery
Add an OKF bundle graph viewer script and integrate it into the kb init scaffolding and OKF skill documentation, while improving Antigravity plugin installation and introducing Command Code dispatch orchestration materials.
New Features:
Enhancements:
Documentation: