Skip to content

Add CLI, MCP, and skill surfaces#157

Merged
simongonzalezdc merged 1 commit into
mainfrom
codex/add-agent-surfaces
Jun 3, 2026
Merged

Add CLI, MCP, and skill surfaces#157
simongonzalezdc merged 1 commit into
mainfrom
codex/add-agent-surfaces

Conversation

@simongonzalezdc
Copy link
Copy Markdown
Member

@simongonzalezdc simongonzalezdc commented Jun 3, 2026

Summary

  • add a local Innerscape CLI and stdio MCP server
  • add public skill metadata under skills/innerscape
  • document the agent surfaces in README and AGENTS

Verification

  • node --check tools/innerscape-cli.mjs
  • node --check tools/innerscape-mcp.mjs
  • npm run cli -- plan --focus "weekly review" --energy low

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced "Innerscape" skill for reflective organization and project workflows
    • Added new CLI command-line entrypoints for project briefs, module management, and planning prompts
    • Enabled MCP server integration support for use with AI tools and applications
  • Documentation

    • Added comprehensive guides documenting available interaction entry points and usage patterns

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces Innerscape, a new agent skill for reflective project organization. It adds a Node.js CLI tool and MCP server that expose three capabilities: project brief generation, module map listing, and planning prompts. These are registered as package executables and documented in the skill definition, README, and agent surfaces guide.

Changes

Innerscape Agent Implementation

Layer / File(s) Summary
CLI Tool Implementation
tools/innerscape-cli.mjs
Exports modules array with scope and agent-use metadata; provides projectBrief(), moduleMap(), and planningPrompt() functions that return structured JSON; implements main() with command dispatch for brief, modules, and plan commands and flag parsing for --focus, --energy, --horizon.
MCP Server Implementation
tools/innerscape-mcp.mjs
Defines MCP tool registry mapping innerscape_project_brief, innerscape_module_map, and innerscape_planning_prompt to CLI handlers; implements handleToolCall() for tool invocation and handleMessage() for JSON-RPC dispatch of initialize, tools/list, and tools/call requests; reads line-delimited JSON from stdin and writes responses to stdout with proper error codes.
Package Configuration & Executables
package.json, .mcp.json
Adds bin.innerscape and bin.innerscape-mcp executables pointing to CLI and MCP tools; adds cli and mcp npm scripts; .mcp.json configures innerscape server to launch via npm run mcp.
Skill Definition & Documentation
skills/innerscape/SKILL.md, skills/innerscape/agents/openai.yaml, AGENTS.md, README.md
Documents Innerscape skill with usage guidance, CLI examples, and MCP setup; defines agent configuration with display name, description, and implicit invocation policy; updates agent surfaces and README to list the three entry points.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It lacks the required Empower Orchestrator checklist that is specified in the repository's PR template. Add the Empower Orchestrator checklist section with all required items checked or explicitly addressed, as specified in the repository template.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main additions: CLI, MCP, and skill surfaces are the primary changes across multiple files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-agent-surfaces

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.

❤️ Share

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a857d053f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/innerscape-cli.mjs
process.exitCode = 2;
}

const invokedPath = process.argv[1] ? fileURLToPath(import.meta.url) === process.argv[1] : false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Run the CLI through installed bin symlinks

When the package bin entry is used via npm link, npx, or a workspace .bin shim, Node starts this file through a symlink path, so process.argv[1] is the symlink while import.meta.url resolves to the real file. In that installed-command scenario innerscape brief exits successfully with no output, even though the skill and projectBrief() advertise innerscape as the CLI surface; use a symlink-aware check or invoke main() for this CLI entry point.

Useful? React with 👍 / 👎.

Comment thread .mcp.json
"mcpServers": {
"innerscape": {
"command": "npm",
"args": ["run", "mcp"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a silent command for the MCP server

With this .mcp.json command, an MCP host starts the server through npm run mcp, and npm writes its lifecycle banner to stdout before the JSON-RPC response. The MCP stdio transport requires stdout to contain only valid protocol messages; I confirmed printf '{"jsonrpc":"2.0","id":1,"method":"tools/list"}\n' | npm run mcp emits the > innerscape@0.1.0 mcp banner on stdout first, so clients using the checked-in config will fail to parse the stream. Point the config at node tools/innerscape-mcp.mjs or add npm's silent flag.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
skills/innerscape/SKILL.md (1)

33-43: ⚡ Quick win

Consider clarifying when to use this MCP config vs the README example.

This example assumes innerscape-mcp is in PATH (e.g., after npm install -g or npm link). The README.md (lines 58-67) shows a different approach using npm run mcp with --prefix, which works for local development without installation.

Both are valid, but users might benefit from a note explaining which context each applies to.

📝 Optional clarification
 ## MCP Setup
 
+For installed packages (after `npm link` or global install):
+
 ```json
 {
   "mcpServers": {
     "innerscape": {
       "command": "innerscape-mcp"
     }
   }
 }

+For local development, see the README.md example using npm run mcp --prefix.

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @skills/innerscape/SKILL.md around lines 33 - 43, Add a short clarifying note
under the "MCP Setup" example explaining that the shown mcpServers -> innerscape
-> command "innerscape-mcp" assumes the binary is in PATH (installed globally
via npm install -g or npm link), and reference the README.md example (the npm run mcp --prefix approach) as the recommended option for local development;
update the SKILL.md section near the "MCP Setup" block to include this
distinction so users know when to use the PATH-based "innerscape-mcp" vs the
local npm run mcp workflow.


</details>

</blockquote></details>
<details>
<summary>tools/innerscape-cli.mjs (2)</summary><blockquote>

`72-75`: _💤 Low value_

**Consider validating flag values.**

The `getValue` helper silently falls back to the default when a flag is present but has no value (e.g., `--focus` at the end of arguments), and it doesn't prevent capturing another flag as a value (e.g., `--focus --energy low` would set `focus` to `"--energy"`).

While the current fallback behavior may be acceptable for this CLI, consider adding validation to improve the user experience.




<details>
<summary>🛡️ Optional enhancement for flag value validation</summary>

```diff
  const getValue = (flag, fallback) => {
    const index = rest.indexOf(flag);
-   return index >= 0 && rest[index + 1] ? rest[index + 1] : fallback;
+   if (index < 0) return fallback;
+   const value = rest[index + 1];
+   if (!value || value.startsWith('--')) return fallback;
+   return value;
  };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/innerscape-cli.mjs` around lines 72 - 75, The getValue helper currently
returns a fallback when a flag is present but the next token is missing or may
be another flag; update getValue to validate the next token by checking that
rest[index + 1] exists and does not start with '-' (or is not another recognized
flag), and if invalid either return the fallback or surface a user-friendly
error message; reference the getValue function and the rest array to locate the
change, and consider also supporting "--flag=value" parsing if desired.

100-103: 💤 Low value

Consider simplifying the direct invocation check.

The current pattern with the ternary is defensive but slightly verbose. The standard ESM pattern is more direct.

♻️ Optional simplification
-const invokedPath = process.argv[1] ? fileURLToPath(import.meta.url) === process.argv[1] : false;
-if (invokedPath) {
+if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
   main();
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/innerscape-cli.mjs` around lines 100 - 103, The direct-invocation check
is overly verbose; replace the ternary expression around invokedPath with a
simple equality comparison using fileURLToPath(import.meta.url) ===
process.argv[1] and call main() when that evaluates true. Locate the invokedPath
variable and the subsequent if (invokedPath) { main(); } and simplify by
computing the boolean directly from fileURLToPath(import.meta.url) ===
process.argv[1] (or by inlining that comparison into the if) so the script uses
the standard ESM direct-invocation pattern with main().
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@skills/innerscape/SKILL.md`:
- Around line 33-43: Add a short clarifying note under the "MCP Setup" example
explaining that the shown mcpServers -> innerscape -> command "innerscape-mcp"
assumes the binary is in PATH (installed globally via npm install -g or npm
link), and reference the README.md example (the `npm run mcp --prefix` approach)
as the recommended option for local development; update the SKILL.md section
near the "MCP Setup" block to include this distinction so users know when to use
the PATH-based "innerscape-mcp" vs the local `npm run mcp` workflow.

In `@tools/innerscape-cli.mjs`:
- Around line 72-75: The getValue helper currently returns a fallback when a
flag is present but the next token is missing or may be another flag; update
getValue to validate the next token by checking that rest[index + 1] exists and
does not start with '-' (or is not another recognized flag), and if invalid
either return the fallback or surface a user-friendly error message; reference
the getValue function and the rest array to locate the change, and consider also
supporting "--flag=value" parsing if desired.
- Around line 100-103: The direct-invocation check is overly verbose; replace
the ternary expression around invokedPath with a simple equality comparison
using fileURLToPath(import.meta.url) === process.argv[1] and call main() when
that evaluates true. Locate the invokedPath variable and the subsequent if
(invokedPath) { main(); } and simplify by computing the boolean directly from
fileURLToPath(import.meta.url) === process.argv[1] (or by inlining that
comparison into the if) so the script uses the standard ESM direct-invocation
pattern with main().

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 868084eb-f9d6-4da3-8007-71b21c967bab

📥 Commits

Reviewing files that changed from the base of the PR and between 74ad119 and a857d05.

📒 Files selected for processing (8)
  • .mcp.json
  • AGENTS.md
  • README.md
  • package.json
  • skills/innerscape/SKILL.md
  • skills/innerscape/agents/openai.yaml
  • tools/innerscape-cli.mjs
  • tools/innerscape-mcp.mjs

@simongonzalezdc simongonzalezdc merged commit 3f5a777 into main Jun 3, 2026
4 checks passed
@simongonzalezdc simongonzalezdc deleted the codex/add-agent-surfaces branch June 3, 2026 17:26
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