Skip to content

Carry flow guidance in the catalogue instead of CLI skills - #1305

Merged
alexeyzimarev merged 16 commits into
mainfrom
capacitor/agent-1fc1e2252d0d41
Oct 5, 2026
Merged

alexeyzimarev merged 16 commits into
mainfrom
capacitor/agent-1fc1e2252d0d41

Conversation

@alexeyzimarev

Copy link
Copy Markdown
Member

Closes #1304 — AI-3468

What & why

Agents learned when to offer review flows and how to drive them from CLI skills, so a flow an operator publishes was never offered. The CLI now takes that from the catalogue:

  • list_flow_definitions shows when to use each flow.
  • get_flow_definition returns a flow's driver guide.
  • A SessionStart lane lists offer: proactive flows on every harness with kcap-flows registered.
  • agent-flows drives any flow; suggest-review-flow is retired.

The server half (guidance block, by-id endpoint, built-in guides) is planned in docs/superpowers/plans/2026-10-03-catalogue-flow-guidance-server.md.

Where to look

  • Against a server without guidance the lane injects nothing, so review is no longer offered proactively until the server ships. Running a named flow is unaffected.
  • The flows lane has its own opt-out: it still runs with memory and guidelines both off.
  • Installed kcap-suggest-review-flow folders are pruned on upgrade.

Verification

  • dotnet build Capacitor.slnx: 0 warnings. AOT publish: no IL2xxx/IL3xxx.
  • Core unit: 4133 pass. CLI unit: 5496/5522; the failing ClaudeHookCommandTests pass alone (87/87); the other two are repository-watcher timing tests.

🤖 Generated with Claude Code

alexeyzimarev and others added 13 commits October 3, 2026 12:42
Moves when-to-offer and how-to-drive knowledge from CLI skills into flow definitions, so operator-published flows are offered like the review built-ins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server plan is drafted here and executes on a kcap-server branch; the CLI plan works against old and new servers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude moves to the composite provider with guidelines off; its guidelines arrive with the SessionStart response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
suggest-review-flow is pruned from installed skill trees, so an upgraded user is not offered review twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T15:46:58.791591Z b02a65e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Offer and drive flows using catalogue guidance

✨ Enhancement 📝 Documentation 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Surface catalogue guidance so agents can discover when to offer and how to drive any flow.
• Add a registration-gated SessionStart flows lane across all nine harnesses, independent of memory
 and guidelines.
• Retire review-only offering, prune installed copies, and document the separately planned server
 support.
Diagram

graph TD
  A["SessionStart hooks"] --> B{"Flows registered?"} --> C["Flow catalogue"] --> D["Proactive flows lane"] --> E["Session context"] --> F["Agent-flows skill"] --> G["Definition guide"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Retain review-only guidance as an old-server fallback
  • ➕ Preserves proactive built-in review offers before the server rollout.
  • ➖ Maintains two sources of offer policy and risks duplicate or inconsistent suggestions.

Recommendation: Use catalogue-owned guidance as proposed: it lets operator-published flows participate without further CLI releases. Coordinate the server rollout, since an older server supplies no proactive offers; named flows still work.

Files changed (38) +3403 / -179

Enhancement (18) +327 / -131
SKILL.mdMake agent-flows the catalogue flow driver +30/-21

Make agent-flows the catalogue flow driver

• Adds consent-gated offering and a guide-before-start workflow while removing built-in-specific default selection and advice.

kcap/skills/agent-flows/SKILL.md

AgentsSkillsInstaller.csPrune the retired review-offer skill +12/-2

Prune the retired review-offer skill

• Stops installing suggest-review-flow and removes its previously installed folder during installation or removal.

src/Capacitor.Cli.Core/AgentsSkillsInstaller.cs

KcapAgentInstructions.csReplace review-specific offering instructions +5/-8

Replace review-specific offering instructions

• Tells agents to offer applicable flows from session context, obtain consent, and read the definition guide before starting.

src/Capacitor.Cli.Core/Instructions/KcapAgentInstructions.cs

AntigravityHookCommand.csEnable registered flows in Antigravity SessionStart +4/-2

Enable registered flows in Antigravity SessionStart

• Passes flows availability into the context request and permits a flows-only fetch.

src/Capacitor.Cli/Commands/Harness/AntigravityHookCommand.cs

ClaudeHookCommand.csAdd flows to Claude's session context +8/-5

Add flows to Claude's session context

• Switches Claude's memory task to the composite provider for memory and flows; guidelines continue arriving through the hook response.

src/Capacitor.Cli/Commands/Harness/ClaudeHookCommand.cs

CodexHookCommand.csEnable registered flows in Codex SessionStart +4/-2

Enable registered flows in Codex SessionStart

• Passes flows availability to the context request and preserves fetching when flows are the only enabled lane.

src/Capacitor.Cli/Commands/Harness/CodexHookCommand.cs

CopilotHookCommand.csEnable registered flows in Copilot SessionStart +4/-2

Enable registered flows in Copilot SessionStart

• Includes flows availability in the session-context request and its all-lanes-disabled guard.

src/Capacitor.Cli/Commands/Harness/CopilotHookCommand.cs

CursorHookCommand.csEnable registered flows in Cursor SessionStart +3/-2

Enable registered flows in Cursor SessionStart

• Adds an independent flows flag so disabling memory and guidelines does not suppress offers.

src/Capacitor.Cli/Commands/Harness/CursorHookCommand.cs

GeminiHookCommand.csEnable registered flows in Gemini SessionStart +4/-2

Enable registered flows in Gemini SessionStart

• Includes flows availability in the hook request and allows flows-only context delivery.

src/Capacitor.Cli/Commands/Harness/GeminiHookCommand.cs

KiroHookCommand.csEnable registered flows in Kiro SessionStart +4/-2

Enable registered flows in Kiro SessionStart

• Adds flows registration gating and retains the fetch when only flows remain enabled.

src/Capacitor.Cli/Commands/Harness/KiroHookCommand.cs

OpenCodeHookCommand.csEnable registered flows in OpenCode SessionStart +5/-3

Enable registered flows in OpenCode SessionStart

• Passes the independent flows flag into session context and updates the all-lanes-disabled shortcut.

src/Capacitor.Cli/Commands/Harness/OpenCodeHookCommand.cs

PiHookCommand.csEnable registered flows in Pi SessionStart +4/-2

Enable registered flows in Pi SessionStart

• Includes flows availability in the request and allows a flows-only session-context fetch.

src/Capacitor.Cli/Commands/Harness/PiHookCommand.cs

McpFlowsServer.csExpose catalogue offer text and definition guides +85/-0

Expose catalogue offer text and definition guides

• Renders when-to-use guidance in listings and adds a read-only get_flow_definition tool with bounded lookup, error handling, and an old-server notice.

src/Capacitor.Cli/Commands/McpFlowsServer.cs

SessionStartCompositeContextProvider.csCompose memory, guidelines, and flows independently +39/-59

Compose memory, guidelines, and flows independently

• Starts the flows lane before scope resolution, combines enabled results under one budget, and can deliver flows even when scope resolution fails.

src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs

SessionStartFlowsLane.csBuild bounded proactive-flow context +96/-0

Build bounded proactive-flow context

• Fetches definitions, selects proactive entries, sanitizes server text, and caps descriptions and overflow IDs. Missing old-server fields produce no offer block.

src/Capacitor.Cli/SessionStartMemory/SessionStartFlowsLane.cs

SessionStartMemoryContracts.csAdd an independent flows-lane opt-out +6/-5

Add an independent flows-lane opt-out

• Adds FlowsDisabled and a shared all-lanes-disabled check without changing memory-only request defaults.

src/Capacitor.Cli/SessionStartMemory/SessionStartMemoryContracts.cs

SessionStartMemoryHookSupport.csConstruct and gate the flows lane +12/-10

Construct and gate the flows lane

• Adds flows to the composite provider and checks whether kcap-flows is registered for the current harness.

src/Capacitor.Cli/SessionStartMemory/SessionStartMemoryHookSupport.cs

SessionStartMemoryOrchestrator.csKeep the lease available when only flows are enabled +2/-4

Keep the lease available when only flows are enabled

• Short-circuits only when memory, guidelines, and flows are all disabled.

src/Capacitor.Cli/SessionStartMemory/SessionStartMemoryOrchestrator.cs

Tests (13) +591 / -43
AgentsSkillsInstallerTests.csTest retired skill cleanup +26/-1

Test retired skill cleanup

• Verifies installation and removal prune stale suggest-review-flow folders and exclude the retired name from current sources.

test/Capacitor.Cli.Core.Tests.Unit/AgentsSkillsInstallerTests.cs

AgentInstructionsWriterTests.csPin catalogue-based offer instructions +6/-5

Pin catalogue-based offer instructions

• Checks that agent instructions reference session-context flows and guide lookup rather than the old review-only nudge.

test/Capacitor.Cli.Core.Tests.Unit/Instructions/AgentInstructionsWriterTests.cs

McpFlowsServerTests.csExpect the new MCP flow tool +2/-1

Expect the new MCP flow tool

• Updates the tool count and asserts that get_flow_definition is advertised.

test/Capacitor.Cli.Tests.Integration/McpFlowsServerTests.cs

AgentFlowsSkillConformanceTests.csPin generic flow-skill behavior +46/-0

Pin generic flow-skill behavior

• Tests the skill description limit, offered-flow trigger, guide-first instruction, and retirement of suggest-review-flow.

test/Capacitor.Cli.Tests.Unit/Commands/AgentFlowsSkillConformanceTests.cs

ClaudeHookCommandTests.csTest Claude flow offers and registration gate +52/-0

Test Claude flow offers and registration gate

• Covers registered and unregistered flows servers and verifies offers still arrive with memory disabled.

test/Capacitor.Cli.Tests.Unit/Commands/Harness/ClaudeHookCommandTests.cs

McpFlowsServerFlowDefinitionDetailTests.csTest guide lookup responses +135/-0

Test guide lookup responses

• Covers rendered guides, absent guides, unknown IDs, old servers, retryable catalogue errors, ID escaping, and read-only tool schema.

test/Capacitor.Cli.Tests.Unit/Commands/McpFlowsServerFlowDefinitionDetailTests.cs

McpFlowsServerFlowDefinitionsTests.csTest when-to-use listing output +36/-0

Test when-to-use listing output

• Distinguishes proactive and on-request guidance and checks that listings without guidance remain compatible.

test/Capacitor.Cli.Tests.Unit/Commands/McpFlowsServerFlowDefinitionsTests.cs

McpToolAnnotationsTests.csPin guide lookup as read-only +1/-0

Pin guide lookup as read-only

• Checks the new MCP tool's read-only annotation.

test/Capacitor.Cli.Tests.Unit/Commands/McpToolAnnotationsTests.cs

AntigravitySessionStartMemoryTests.csTest Antigravity flows-only delivery +25/-6

Test Antigravity flows-only delivery

• Updates the three-lane guards and verifies a proactive offer arrives with memory and guidelines disabled.

test/Capacitor.Cli.Tests.Unit/Harness/Antigravity/AntigravitySessionStartMemoryTests.cs

PiSessionStartMemoryTests.csUpdate Pi's three-lane guard tests +5/-5

Update Pi's three-lane guard tests

• Passes the flows flag through existing prerequisite and short-circuit cases.

test/Capacitor.Cli.Tests.Unit/Harness/Pi/PiSessionStartMemoryTests.cs

FlowsLaneTests.csExercise proactive-flow lane and composition +229/-0

Exercise proactive-flow lane and composition

• Tests sanitization, size limits, old-server behavior, registration, lane independence, memory preservation, and scope-failure delivery.

test/Capacitor.Cli.Tests.Unit/SessionStartMemory/FlowsLaneTests.cs

GuidelinesLaneAndCompositeTests.csAdapt composite tests to three lanes +2/-25

Adapt composite tests to three lanes

• Supplies the new, disabled-by-default flows dependency and moves shared test stubs into their own file.

test/Capacitor.Cli.Tests.Unit/SessionStartMemory/GuidelinesLaneAndCompositeTests.cs

SessionStartStubs.csShare session-start test doubles +26/-0

Share session-start test doubles

• Extracts the fixed scope resolver and HTTP handler for guidelines and flows-lane tests.

test/Capacitor.Cli.Tests.Unit/SessionStartMemory/SessionStartStubs.cs

Documentation (7) +2485 / -5
README.mdDocument catalogue-guided flow offers and tools +5/-3

Document catalogue-guided flow offers and tools

• Describes the by-id guide lookup, proactive SessionStart offers, old-server behavior, and the revised agent-flows skill.

README.md

2026-10-03-catalogue-flow-guidance-cli.mdPlan the CLI guidance migration +1344/-0

Plan the CLI guidance migration

• Details implementation tasks, compatibility constraints, tests, and verification for MCP tools, the flows lane, harnesses, and skills.

docs/superpowers/plans/2026-10-03-catalogue-flow-guidance-cli.md

2026-10-03-catalogue-flow-guidance-server.mdPlan the separate server guidance work +969/-0

Plan the separate server guidance work

• Specifies the proposed schema, built-in guides, admin-override fallback, API endpoint, and server tests. These server changes are planned, not implemented in this PR.

docs/superpowers/plans/2026-10-03-catalogue-flow-guidance-server.md

2026-10-03-catalogue-flow-guidance-design.mdSpecify catalogue-owned guidance +155/-0

Specify catalogue-owned guidance

• Defines guidance fields, offer behavior, compatibility, and the division of work between server and CLI.

docs/superpowers/specs/2026-10-03-catalogue-flow-guidance-design.md

SKILL.mdDirect other flows to agent-flows +2/-1

Direct other flows to agent-flows

• Points offered and other catalogue flows to the generic skill while retaining the review skill for existing aliases.

kcap/skills/review-flows/SKILL.md

help-mcp.txtExplain flow guidance in MCP help +9/-0

Explain flow guidance in MCP help

• Documents listing and guide tools and the registration-gated SessionStart offer block.

src/Capacitor.Cli.Core/Resources/help-mcp.txt

help-plugin.txtRemove retired skill from plugin help +1/-1

Remove retired skill from plugin help

• Removes suggest-review-flow from the documented installed-skill list.

src/Capacitor.Cli.Core/Resources/help-plugin.txt

@qodo-code-review

qodo-code-review Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Inline flows stall before they can start ✓ Resolved
Description
agent-flows says every flow must first call get_flow_definition(definition_id), without
exempting flows composed as definition_yaml. When no catalogue definition fits, that workflow has
no definition ID to pass to the required tool and conflicts with the skill's inline-flow start path.
Code

kcap/skills/agent-flows/SKILL.md[R174-179]

+Every flow starts the same way:
+
+```
+get_flow_definition(definition_id)
+  → read the driver guide; prepare the context it asks for
+```
Relevance

●●● Strong

The universal preflight conflicts directly with documented inline-flow inputs and is a concrete
workflow correctness issue.

PR-#1299
PR-#1236

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new universal preflight requires a definition ID, while the same skill says dynamic flows supply
definition_yaml instead of definition_id. The tool schema requires definition_id and rejects a
missing value.

kcap/skills/agent-flows/SKILL.md[88-94]
kcap/skills/agent-flows/SKILL.md[174-179]
src/Capacitor.Cli/Commands/McpFlowsServer.cs[473-476]
src/Capacitor.Cli/Commands/McpFlowsServer.cs[2659-2665]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The mandatory guide lookup requires an ID that inline dynamic flows do not have.
## Fix Focus Areas
- kcap/skills/agent-flows/SKILL.md[88-94]
- kcap/skills/agent-flows/SKILL.md[174-179]
## Recommended Fix
Specify that get_flow_definition precedes catalogue starts only; keep the inline-flow approval and start_flow(definition_yaml) path separate.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Flow offers can time out with memory off ✓ Resolved
Description
SessionStartCompositeContextProvider.GetAsync awaits scope resolution even when flows is the only
enabled lane, although SessionStartFlowsLane does not use scope. With memory and guidelines
disabled, slow repository or machine-scope resolution can exhaust the shared budget and cancel an
otherwise successful catalogue fetch.
Code

src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs[R23-24]

+        // The flows lane ignores scope, so it starts before scope resolves and survives its failure.
+        var flowsTask = request.FlowsDisabled ? null : RunLaneAsync(() => flows.FetchAsync(request, cts.Token));
Relevance

●●● Strong

Recent session-start precedents accept fixes preventing avoidable budget exhaustion and preserving
independent lane execution.

PR-#397
PR-#350

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The request allows both scoped lanes to be disabled independently of flows; the new composite starts
flows but still awaits scope resolution under the same cancellation budget. The flows fetch has no
scope input.

src/Capacitor.Cli/SessionStartMemory/SessionStartMemoryContracts.cs[49-57]
src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs[18-39]
src/Capacitor.Cli/SessionStartMemory/SessionStartFlowsLane.cs[20-23]
src/Capacitor.Cli/SessionStartMemory/SessionStartMemoryScopeResolver.cs[6-25]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Flow-only requests still wait for scope resolution and can lose their shared fetch budget.
## Fix Focus Areas
- src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs[23-39]
## Recommended Fix
When memory and guidelines are disabled, await and combine the flows result without resolving scope; retain scope resolution for lanes that need it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Flow offers stop memory and guidelines retrying ✓ Resolved
Description
Combine returns Ready whenever any lane has content, and the scope-failure branch now returns
combined instead of Retry when the flows lane is Ready. The flows lane returns content
whenever the catalogue has a proactive flow, which will be true for nearly every session once the
built-ins publish guidance. So when the memory or guidelines lane times out, gets a 429, gets a 5xx,
hits the guidelines 404 visibility race, or scope resolution fails, the orchestrator commits the
once-per-session lease. On repeat-callback harnesses (Kiro, OpenCode, Pi, Antigravity) a later
callback would have retried, but now that session never gets its team memory or guidelines.
Code

src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs[R63-64]

+        if (memoryFragment is not null || otherFragments.Count > 0)
+            return new SessionStartMemoryContextResult(SessionStartMemoryDisposition.Ready, Compose(memoryFragment, otherFragments));
Relevance

●●● Strong

Recent session-start precedents accept fixes preserving retry semantics when successful-looking
output masks incomplete or retryable lanes.

PR-#768
PR-#350

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The orchestrator treats only RetryableFailure as a reason to keep the lease. It commits on
Ready, and later callbacks then get null from TryBeginAsync. The guidelines lane deliberately
retries on 404, so its fragment arrives once the read model catches up. A flows fragment that is
always present now commits the lease before that retry can happen. Before this PR, the scope-failure
branch always returned Retry.

src/Capacitor.Cli/SessionStartMemory/SessionStartMemoryOrchestrator.cs[49-64]
src/Capacitor.Cli/SessionStartMemory/SessionStartGuidelinesLane.cs[39-46]
src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs[26-47]
src/Capacitor.Cli/Commands/Harness/KiroHookCommand.cs[113-117]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The composite SessionStart provider returns Ready whenever any lane has content. The flows lane has content on almost every session, so a memory or guidelines lane that failed retryably (or a scope-resolution failure) now commits the once-per-session lease, and that context is never retried.

## Fix Focus Areas
- src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs[26-47]
- src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs[59-75]

## Recommended Fix
Do not let flows-only content commit the lease while the memory or guidelines lane returned RetryableFailure, or while scope resolution failed with either of those lanes enabled. Return RetryableFailure, using the max Retry-After, in those cases. An alternative is to deliver the flows fragment with the retry, but only if the orchestrator API can carry a fragment alongside a retry; otherwise prefer retrying. Add tests: memory RetryableFailure plus flows Ready gives RetryableFailure, and scope failure with memory enabled plus flows Ready gives Retry.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (2)
4. Requested reviews skip their flow guides ✓ Resolved
Description
review-flows still routes explicitly requested review flows through its alias-tool workflow
without instructing the agent to call get_flow_definition. When a user requests a built-in review
flow, that path can start it without reading the catalogue's authored instructions for its context
and rounds.
Code

kcap/skills/review-flows/SKILL.md[R11-12]

+  review directly instead. For any other catalogue flow, or a flow offered
+  from your session context, use `agent-flows`.
Relevance

●●● Strong

Recent review-flow findings were accepted when routing instructions omitted required review behavior
or incorrectly excluded paths.

PR-#1299
PR-#389

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed skill description reserves agent-flows for other catalogue or offered flows, while the
retained review skill directs requested reviews to its alias tools. The guide preflight appears in
agent-flows, not that review workflow.

kcap/skills/review-flows/SKILL.md[3-16]
kcap/skills/review-flows/SKILL.md[43-58]
kcap/skills/agent-flows/SKILL.md[88-90]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Explicitly requested review flows can follow the retained review skill without reading their catalogue guides.
## Fix Focus Areas
- kcap/skills/review-flows/SKILL.md[3-16]
- kcap/skills/agent-flows/SKILL.md[88-90]
## Recommended Fix
Route requested built-in reviews to agent-flows, or require review-flows to fetch the selected definition's guide before starting.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Two test helpers share a mismatched file 📘 Rule violation ⚙ Maintainability
Description
SessionStartStubs.cs declares FixedScope and Handler as separate top-level types, but its
filename matches neither type. Both were added as reusable test helpers, and neither fits the rule’s
permitted enum, hierarchy, or registry exceptions.
Code

test/Capacitor.Cli.Tests.Unit/SessionStartMemory/SessionStartStubs.cs[8]

+sealed class FixedScope(string? repo, string? machine) : ISessionStartMemoryScopeResolver {
Relevance

●● Moderate

The rule is plausible, but available precedents address test-helper conventions rather than multiple
primary types specifically.

PR-#1138
PR-#976

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The added file declares two unrelated top-level classes, neither named SessionStartStubs. The
checklist requires one matching primary type per file unless a narrow exception applies.

Rule 3162234: One primary type per file, with only narrow documented exceptions
test/Capacitor.Cli.Tests.Unit/SessionStartMemory/SessionStartStubs.cs[8-13]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SessionStartStubs.cs contains two top-level test helpers and is named after neither.

## Fix Focus Areas
- test/Capacitor.Cli.Tests.Unit/SessionStartMemory/SessionStartStubs.cs[8-26]

## Recommended Fix
Move FixedScope and Handler into separate files named FixedScope.cs and Handler.cs, preserving their namespace and visibility.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Informational

6. Code-review drivers lose the no-tests rule ✗ Dismissed
Description
agent-flows replaces the unconditional code-review instruction not to ask participants to run
tests with a rule that depends on the flow's guide. When an explicitly named code-review
definition runs against a server that publishes no guides, the fallback to the skill's generic rules
contains no test restriction, so drivers can ask hosted reviewers to run tests that CI already
covers and waste review rounds.
Code

kcap/skills/agent-flows/SKILL.md[151]

+8. **Ask the participant only for what the flow's guide allows.** If the guide says CI covers tests, do not ask the participant to run them; participant feedback is on what the flow exists to judge.
Relevance

●●● Strong

Recent skill guidance findings show the team accepts precise behavioral corrections in flow
instructions.

PR-#389
PR-#1299

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The removed rule explicitly prohibited asking code-review participants to run tests, while its
replacement at line 151 makes that restriction depend on guide content. The tool returns
ServerPublishesNoGuides for servers without guides, and the skill directs agents in that case to
fall back to its own rules, which no longer include the prohibition.

kcap/skills/agent-flows/SKILL.md[151-151]
src/Capacitor.Cli/Commands/McpFlowsServer.cs[1627-1629]
kcap/skills/agent-flows/SKILL.md[88-90]
kcap/skills/agent-flows/SKILL.md[148-151]
src/Capacitor.Cli/Commands/McpFlowsServer.cs[488-492]
kcap/skills/review-flows/SKILL.md[142-142]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The agent-flows skill loses its code-review test restriction when the server does not publish a guide, allowing drivers to ask participants to run tests already covered by CI.

## Fix Focus Areas
- kcap/skills/agent-flows/SKILL.md[88-90]
- kcap/skills/agent-flows/SKILL.md[148-151]

## Recommended Fix
Keep the guide-first wording so available authored guides provide flow-specific directions. When the server reports that it publishes no guides and the definition is `code-review`, explicitly tell the driver not to ask the participant to run tests because CI covers them.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Cross-repo context — repo relationships
  Explored: repo: kurrent-io/cloud-meta (sha: 107e7601) — View relationship
  Explored: repo: kurrent-io/kcap-server (sha: 5fec582b) — View relationship
Review mode: 🧠 Deep: This cross-cutting CLI behavior change spans multiple harnesses, session-start orchestration, MCP flow APIs, installer cleanup, and skill contracts, creating many independent logic paths where subtle defects are easy to miss.

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo


namespace Capacitor.Cli.Tests.Unit.SessionStartMemory;

sealed class FixedScope(string? repo, string? machine) : ISessionStartMemoryScopeResolver {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

5. Two test helpers share a mismatched file 📘 Rule violation ⚙ Maintainability

SessionStartStubs.cs declares FixedScope and Handler as separate top-level types, but its
filename matches neither type. Both were added as reusable test helpers, and neither fits the rule’s
permitted enum, hierarchy, or registry exceptions.
Agent Prompt
## Issue description
SessionStartStubs.cs contains two top-level test helpers and is named after neither.

## Fix Focus Areas
- test/Capacitor.Cli.Tests.Unit/SessionStartMemory/SessionStartStubs.cs[8-26]

## Recommended Fix
Move FixedScope and Handler into separate files named FixedScope.cs and Handler.cs, preserving their namespace and visibility.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in bdd2dd6: split into FixedScope.cs and Handler.cs.

Comment thread src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs Outdated
Comment thread kcap/skills/review-flows/SKILL.md
Comment thread kcap/skills/agent-flows/SKILL.md Outdated
Comment thread src/Capacitor.Cli/SessionStartMemory/SessionStartCompositeContextProvider.cs Outdated
Comment thread kcap/skills/agent-flows/SKILL.md

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b02a65eda8

ℹ️ 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 kcap/skills/agent-flows/SKILL.md Outdated

## Read the flow's guide first

Call `get_flow_definition(definition_id)` before `start_flow`. The guide is written by whoever published the flow: what to put in `context`, which target to name, how to iterate on its results and when to close. Where it differs from the generic rules below, follow the guide. A server that does not publish guides says so; then work from the definition's description and the rules below.

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 Exempt inline definitions from the guide lookup

When the agent follows the documented dynamic-flow path immediately below this section, start_flow receives definition_yaml and there is no catalog definition_id that get_flow_definition can read. Requiring this call before every start therefore makes the skill instruct agents to issue an invalid lookup—or prevents them from starting a dynamic flow at all. Limit the requirement to catalog-backed starts and direct dynamic starts to use the guide embedded in their YAML/generic rules.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 8682ddb: get_flow_definition is required for catalogue starts only.

using var cts = CancellationTokenSource.CreateLinkedTokenSource(request.CancellationToken, expiry.Token);

// The flows lane ignores scope, so it starts before scope resolves and survives its failure.
var flowsTask = request.FlowsDisabled ? null : RunLaneAsync(() => flows.FetchAsync(request, cts.Token));

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 Bypass scope lookup for flows-only requests

When both memory and guidelines are disabled but flows remain enabled, this scope-independent request is started and then still waits for repository/machine scope resolution. If repository detection consumes the hook budget, the shared cancellation token expires and the outer bounded hook wait can discard the flow result, so the explicitly supported flows-only configuration emits no offers even when the definitions endpoint responds promptly. Return the flows task directly when the other two lanes are disabled instead of performing scope resolution.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 6a532c1: flows-only requests return the flows result without resolving scope.

alexeyzimarev and others added 3 commits October 3, 2026 18:02
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexeyzimarev
alexeyzimarev merged commit d50fe4a into main Oct 5, 2026
8 checks passed
@alexeyzimarev
alexeyzimarev deleted the capacitor/agent-1fc1e2252d0d41 branch October 5, 2026 07:07
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.

Carry flow guidance in the catalogue instead of CLI skills

1 participant