Skip to content

chore: clean up - #78

Merged
fum4 merged 3 commits into
masterfrom
chore/clean-up
Mar 16, 2026
Merged

fum4 merged 3 commits into
masterfrom
chore/clean-up

Conversation

@fum4

@fum4 fum4 commented Mar 16, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Comprehensive CLI for agent workflows (hooks, notifications, git ops, worktrees, issues, context) and a server endpoint exposing git policy.
  • Documentation

    • Added CLI design spec, implementation plan, agent guidance, and a new PR-review skill doc; updated docs for portability and usage.
  • Chores

    • Updated local dev start command and discovered ports; expanded allowed shell permissions (echo, find, grep).

@fum4 fum4 self-assigned this Mar 16, 2026
@vercel

vercel Bot commented Mar 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
openkit Ignored Ignored Preview Mar 16, 2026 9:45pm

@coderabbitai

coderabbitai Bot commented Mar 16, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Adds CLI-agent infrastructure and scaffolding (shared server-client utilities, new subcommands, tests, and a git-policy endpoint), updates configuration for desktop dev start and ports, expands allowed Bash permissions in settings, and adds/duplicates documentation guidance and a new skill doc.

Changes

Cohort / File(s) Summary
Configuration
​.claude/settings.json, ​.openkit/config.json
Expanded allowed Bash permissions (echo, find, grep, plus gh api:*, gh pr:*) and updated startCommand to pnpm dev:desktop-app with discovered ports [5173, 6969].
Documentation Guidance
AGENTS.md, CLAUDE.md
Added duplicated guidance requiring spec/plan files to live at repo root and to use repo-relative/project-relative paths (no absolute/user-specific paths).
CLI design & plans
docs/superpowers/specs/2026-03-16-cli-agent-commands-design.md, docs/superpowers/plans/2026-03-16-cli-agent-commands.md
New comprehensive CLI design and plan: command surface, JSON/error contracts, worktree rules, command groups, testing strategy, and notes on GET /api/worktrees/:id/git-policy.
CLI implementation scaffold
apps/cli/...
Adds server-client.ts utilities, new command modules (hooks, notify, git-ops, worktree-cmd, issues, context, etc.), tests, refactors activity.ts to use shared utilities, and registers subcommands.
Skills & docs examples
​.claude/skills/address-pr-review/SKILL.md, docs/superpowers/plans/2026-03-12-vertical-web-app-tests.md
Adds address-pr-review skill documentation; replaces per-user cd commands with pnpm invocations in docs examples.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI (user)
    participant SC as server-client util
    participant Server as OpenKit Server
    participant Git as Git / git-policy resolver

    CLI->>SC: inferWorktreeIdFromCwd() / parseFlag(...)
    SC->>Server: GET /api/worktrees/:id/git-policy
    Server->>Git: resolveGitPolicy(worktreeId)
    Git-->>Server: git policy
    Server-->>SC: 200 OK + policy
    SC-->>CLI: outputResult / serverJson response
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • LunatiqueCoder

Poem

🐰 I hopped through docs and spun a plan,
New CLI commands traced by my tiny paw,
Servers hum and worktrees sing,
Policies fetched on nimble spring,
Reviewers, nibble a carrot—ta-da! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore: clean up' is vague and generic, failing to convey meaningful information about the substantial changes across multiple configuration files, documentation, and new CLI agent infrastructure. Consider using a more descriptive title that summarizes the main changes, such as 'chore: expand CLI agent infrastructure with server-client utilities and design specs' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/clean-up
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

Clode Review

🔴 Major

  1. context.ts runContextCmd has a bug in worktree ID parsing (2026-03-16-cli-agent-commands.md ~line 1540)
    runContextCmd uses args.find() with a callback that computes args.indexOf("--worktree") internally — but find() returns the element for which the callback is truthy, not the computed value. Since indexOf returns a number (truthy unless -1), find will return the first element of args when --worktree is present, not the actual flag value. Should use requireWorktreeId(parseFlag(args, "worktree")) like every other command does. Unfixed from previous review.

🟠 Medium

  1. .claude/settings.json — overly broad shell permissions
    Bash(echo:*), Bash(find:*), Bash(grep:*) bypass the dedicated tools (Read, Glob, Grep) that CLAUDE.md explicitly requires. Unfixed from previous review.

  2. .openkit/config.json — hardcoded discovered ports committed to repo
    "discovered": [5173, 6969] and "startCommand": "pnpm dev:desktop-app" look like local development state that shouldn't be checked in. The previous empty array and pnpm dev command were the correct repo defaults. Unfixed from previous review.

  3. issues.ts silently swallows errors in listIssues and getIssue
    Both functions have bare catch {} blocks (plan lines ~1267, ~1285). Per CLAUDE.md: "Silent catch {} blocks are never acceptable." At minimum, log at debug/warn level so connection failures vs. "integration not configured" can be distinguished. Unfixed from previous review.

  4. notify.ts test assertion is brittle
    Tests use expect.stringContaining('"title":"Build started"') which depends on JSON key ordering. Consider parsing the body and asserting on the parsed object. Unfixed from previous review.

  5. Spec/plan inconsistency on worktree create flags
    The spec (specs/...design.md:120) documents openkit worktree create --name <name> [--branch <branch>], but the plan's implementation only uses --branch with no --name flag. These should be aligned. Unfixed from previous review.

  6. Plan embeds full implementation code (~1730 lines)
    Plans should capture the how/order per CLAUDE.md, not serve as a code dump. The spec already captures the design. Unfixed from previous review.

  7. Plan has duplicate Step 3 labels in Tasks 7 and 8 — both have two steps labeled "Step 3". Minor but could cause confusion when tracking progress. Unfixed from previous review.

🟡 Minor

  1. Spec lists filename as worktree.ts but plan uses worktree-cmd.ts
    The spec's command module table (specs/...design.md:166) says worktree.ts but the plan correctly uses worktree-cmd.ts. The spec should be updated to match. Unfixed from previous review.

  2. server-client.ts parseFlag clarity — args[i].slice(name.length + 3) for --name=value is correct but args[i].split("=").slice(1).join("=") would handle edge cases with = in values. Unfixed from previous review.

  3. context.ts printHelp mentions local as a source but neither the spec nor tests cover a local source for notes. Unfixed from previous review.

  4. address-pr-review/SKILL.md skips Step 4 — numbering jumps from Step 3 to Step 5 (line 48 → 52). Wait — let me recheck. Steps are: 1, 2, 3, 4, 5, 6. This is now correct — resolved.

🟢 Resolved

  1. Plan references hardcoded local path — The plan file (2026-03-16-cli-agent-commands.md) uses relative worktree path (.openkit/worktrees/mcp-fixes/) instead of absolute paths. The older plan (2026-03-12-vertical-web-app-tests.md) also had all its cd /Users/fum4/_work/dawg && ... commands replaced with just pnpm nx run ....

  2. CLAUDE.md and AGENTS.md now include portable-path guidelines — Both files gained the "Always create spec and plan files in the root project directory" and "Never use absolute or user-specific paths" rules, and they remain in sync with each other.

  3. address-pr-review/SKILL.md step numbering — Steps are now numbered 1–6 sequentially. Previously reported as skipping Step 4.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
AGENTS.md (1)

1-1: ⚠️ Potential issue | 🔴 Critical

Fix the file header.

The file header shows # CLAUDE.md but this file is AGENTS.md. The header should be # AGENTS.md. While the content of these files must stay in sync per coding guidelines, each should have its own correct header identifying the file.

🔧 Proposed fix
-# CLAUDE.md
+# AGENTS.md

As per coding guidelines: CLAUDE.md and AGENTS.md must stay in sync. Any change made to one must be applied to the other in the same update.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` at line 1, Update the top-level header in the AGENTS.md file so it
correctly identifies the file: replace the incorrect header text "# CLAUDE.md"
with "# AGENTS.md" (keep the rest of the content the same to stay in sync with
CLAUDE.md per guidelines).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/superpowers/plans/2026-03-16-cli-agent-commands.md`:
- Around line 1549-1567: The fenced code block that starts with the line
"Commands:" is missing a language identifier; update the opening fence to
include a language (for example change "```" to "```text") so the block is
marked consistently with the rest of the document and keep the closing fence
unchanged.

In `@docs/superpowers/specs/2026-03-16-cli-agent-commands-design.md`:
- Around line 38-43: Several fenced code blocks in the document are missing
language identifiers; update each block that contains CLI examples (e.g., the
blocks containing "openkit hooks run [--worktree <id>] [--trigger <trigger>]
[--step <stepId>]", "openkit hooks status [--worktree <id>]", the report/config
blocks, and the other similar command blocks) to include a language tag such as
```text or ```bash at the opening fence so they render with consistent
highlighting; apply this change to every occurrence noted in the review (the
blocks around those command examples).

---

Outside diff comments:
In `@AGENTS.md`:
- Line 1: Update the top-level header in the AGENTS.md file so it correctly
identifies the file: replace the incorrect header text "# CLAUDE.md" with "#
AGENTS.md" (keep the rest of the content the same to stay in sync with CLAUDE.md
per guidelines).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb366891-53a0-4690-8ba5-227275c5be2c

📥 Commits

Reviewing files that changed from the base of the PR and between f424643 and 8cc0636.

📒 Files selected for processing (6)
  • .claude/settings.json
  • .openkit/config.json
  • AGENTS.md
  • CLAUDE.md
  • docs/superpowers/plans/2026-03-16-cli-agent-commands.md
  • docs/superpowers/specs/2026-03-16-cli-agent-commands-design.md

Comment on lines +1549 to +1567
```
Commands:
(default) Start the server and open the UI
init Interactive setup wizard to create .openkit/config.json
add [name] Set up an integration (github, linear, jira)
ui Manage optional UI components (web/desktop)
activity Emit workflow activity events (for agent/user coordination)
task Manage task resolution and worktree creation
hooks Run and manage verification hooks
notify Send activity notifications
commit Stage and commit worktree changes
push Push worktree branch
pr Create a pull request
policy Check git operation permissions
worktree Manage worktrees (list, create, start, stop, remove)
issues Browse Jira/Linear issues
context Read task context for a worktree
notes Read issue notes and todos
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add language identifier to fenced code block.

The fenced code block at line 1549 is missing a language identifier. Add a language identifier (e.g., text or leave it as code block content) for consistency with the rest of the document.

📝 Proposed fix
-```
+```text
 Commands:
   (default)     Start the server and open the UI
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 1549-1549: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/plans/2026-03-16-cli-agent-commands.md` around lines 1549 -
1567, The fenced code block that starts with the line "Commands:" is missing a
language identifier; update the opening fence to include a language (for example
change "```" to "```text") so the block is marked consistently with the rest of
the document and keep the closing fence unchanged.

Comment on lines +38 to +43
```
openkit hooks run [--worktree <id>] [--trigger <trigger>] [--step <stepId>]
openkit hooks status [--worktree <id>]
openkit hooks report [--worktree <id>] --skill <name> --trigger <trigger> --success|--failed [--summary <text>] [--file <path>]
openkit hooks config [--worktree <id>]
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add language identifiers to fenced code blocks.

Multiple fenced code blocks are missing language identifiers (lines 38, 54, 64, 78, 94, 104). Add language identifiers (e.g., text or bash) for consistency and proper syntax highlighting.

📝 Example fix for one block
-```
+```text
 openkit hooks run [--worktree <id>] [--trigger <trigger>] [--step <stepId>]
 openkit hooks status [--worktree <id>]

Apply the same pattern to all other fenced code blocks missing language identifiers throughout the file.

Also applies to: 54-56, 64-69, 78-84, 94-97, 104-107

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 38-38: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/specs/2026-03-16-cli-agent-commands-design.md` around lines
38 - 43, Several fenced code blocks in the document are missing language
identifiers; update each block that contains CLI examples (e.g., the blocks
containing "openkit hooks run [--worktree <id>] [--trigger <trigger>] [--step
<stepId>]", "openkit hooks status [--worktree <id>]", the report/config blocks,
and the other similar command blocks) to include a language tag such as ```text
or ```bash at the opening fence so they render with consistent highlighting;
apply this change to every occurrence noted in the review (the blocks around
those command examples).

…kill

- add CLAUDE.md/AGENTS.md rule prohibiting absolute paths in docs
  (hardcoded user paths make plans non-portable across machines)
- replace all /Users/fum4/_work/dawg/ references in plan files with
  repo-relative paths
- update address-pr-review skill to read Clode Review from issue
  comments instead of PR reviews API

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/address-pr-review/SKILL.md:
- Around line 37-49: The doc and logic currently search for the marker string
"Clode Review" in Step 3 (the gh api comment filtering and the subsequent stop
condition); update both places to use one canonical marker (e.g., "Claude
Review" or "Code Review") consistently so the fetch criteria and the existence
check match; ensure the search used in the API result filtering (the logic that
checks user.login === "github-actions[bot]" and comment body contains the
marker) and the conditional that informs the user "no Clode Review found" are
changed to reference the exact same corrected marker string.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 677f6633-535e-4ddc-905f-3b9d109cec5b

📥 Commits

Reviewing files that changed from the base of the PR and between 8cc0636 and e0f051b.

📒 Files selected for processing (5)
  • .claude/skills/address-pr-review/SKILL.md
  • AGENTS.md
  • CLAUDE.md
  • docs/superpowers/plans/2026-03-12-vertical-web-app-tests.md
  • docs/superpowers/plans/2026-03-16-cli-agent-commands.md
✅ Files skipped from review due to trivial changes (2)
  • docs/superpowers/plans/2026-03-12-vertical-web-app-tests.md
  • CLAUDE.md

Comment on lines +37 to +49
### Step 3: Fetch the Clode Review comment

The code review is posted as a **PR issue comment** (not a PR review) by `github-actions[bot]`, with a title containing "Clode Review".

```bash
gh api repos/{owner}/{repo}/issues/{number}/comments
```

From the results:

1. Find comments where `user.login` is `github-actions[bot]` **and** the body contains "Clode Review"
2. Among matching comments, pick the **latest** by `created_at`
3. If no Clode Review comment is found, inform the user and stop

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix review identifier typo to avoid false “no review found” outcomes.

The workflow keys off "Clode Review" in both fetch criteria and stop condition. If the actual marker is "Claude Review" (or "Code Review"), this flow will incorrectly stop without processing comments. Use one canonical string consistently.

💡 Proposed doc fix
-### Step 3: Fetch the Clode Review comment
+### Step 3: Fetch the Claude Review comment

-The code review is posted as a **PR issue comment** (not a PR review) by `github-actions[bot]`, with a title containing "Clode Review".
+The code review is posted as a **PR issue comment** (not a PR review) by `github-actions[bot]`, with a title containing "Claude Review".
@@
-1. Find comments where `user.login` is `github-actions[bot]` **and** the body contains "Clode Review"
+1. Find comments where `user.login` is `github-actions[bot]` **and** the body contains "Claude Review"
@@
-3. If no Clode Review comment is found, inform the user and stop
+3. If no Claude Review comment is found, inform the user and stop
🧰 Tools
🪛 LanguageTool

[grammar] ~37-~37: Ensure spelling is correct
Context: ...` for API calls. ### Step 3: Fetch the Clode Review comment The code review is post...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~49-~49: Ensure spelling is correct
Context: ...the latest by created_at 3. If no Clode Review comment is found, inform the use...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/address-pr-review/SKILL.md around lines 37 - 49, The doc and
logic currently search for the marker string "Clode Review" in Step 3 (the gh
api comment filtering and the subsequent stop condition); update both places to
use one canonical marker (e.g., "Claude Review" or "Code Review") consistently
so the fetch criteria and the existence check match; ensure the search used in
the API result filtering (the logic that checks user.login ===
"github-actions[bot]" and comment body contains the marker) and the conditional
that informs the user "no Clode Review found" are changed to reference the exact
same corrected marker string.

@fum4
fum4 merged commit aa969d2 into master Mar 16, 2026
18 checks passed
@fum4
fum4 deleted the chore/clean-up branch March 16, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant