@dv.nghiem/flowdeck 0.4.9 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,9 @@ export interface ConfirmationResponse {
2
2
  success: boolean;
3
3
  message: string;
4
4
  status: "AWAITING_CONFIRM";
5
- confirm_mode: "y/n";
5
+ confirm_mode: "y/n" | "multi-choice";
6
6
  operation: string;
7
+ choices?: string[];
7
8
  [key: string]: unknown;
8
9
  }
9
10
  /**
@@ -12,6 +13,13 @@ export interface ConfirmationResponse {
12
13
  * @param message - User-facing prompt message
13
14
  */
14
15
  export declare function confirmPrompt(operation: string, message: string): ConfirmationResponse;
16
+ /**
17
+ * Generate AWAITING_CONFIRM response for multi-choice prompt.
18
+ * @param operation - Short identifier for the operation
19
+ * @param message - User-facing prompt message
20
+ * @param choices - Array of choice strings (e.g., ["show conflict", "attempt resolution", "abort"])
21
+ */
22
+ export declare function multiChoiceConfirm(operation: string, message: string, choices: string[]): ConfirmationResponse;
15
23
  /**
16
24
  * Generate skip response when user says "no".
17
25
  * @param operation - Short identifier for the operation
@@ -1 +1 @@
1
- {"version":3,"file":"confirmation.d.ts","sourceRoot":"","sources":["../../src/lib/confirmation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,kBAAkB,CAAA;IAC1B,YAAY,EAAE,KAAK,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,oBAAoB,CAQtF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOvE"}
1
+ {"version":3,"file":"confirmation.d.ts","sourceRoot":"","sources":["../../src/lib/confirmation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,kBAAkB,CAAA;IAC1B,YAAY,EAAE,KAAK,GAAG,cAAc,CAAA;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,oBAAoB,CAQtF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAS9G;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOvE"}
@@ -10,7 +10,15 @@
10
10
  * Local stdio MCPs (when installed):
11
11
  * - codegraph codegraph serve --mcp (code knowledge graph — symbol search, call graphs, impact analysis)
12
12
  *
13
- * Disable individual MCPs with: FLOWDECK_DISABLE_MCP=context7,websearch,grep_app,github,codegraph
13
+ * Additional local stdio MCPs (enabled by default):
14
+ * - memory npx -y @modelcontextprotocol/server-memory
15
+ * - omega-memory uvx omega-memory serve
16
+ * - sequential-thinking npx -y @modelcontextprotocol/server-sequential-thinking
17
+ * - magic npx -y @magicuidesign/mcp@latest
18
+ * - playwright npx -y @playwright/mcp --browser chrome
19
+ * - token-optimizer npx -y token-optimizer-mcp
20
+ *
21
+ * Disable individual MCPs with: FLOWDECK_DISABLE_MCP=context7,websearch,grep_app,github,codegraph,memory,omega-memory,sequential-thinking,magic,playwright,token-optimizer
14
22
  */
15
23
  type RemoteMcp = {
16
24
  type: "remote";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAOD,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC,CA+DzE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAoBD,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC,CA+GzE"}
@@ -12,7 +12,10 @@ export interface ToolEvent {
12
12
  }
13
13
  export declare function getCurrentAgent(): string | null;
14
14
  export declare function setCurrentAgent(agent: string | null): void;
15
+ export declare function isEventLogHealthy(): boolean;
16
+ export declare function getLastPersistenceError(): string | null;
17
+ export declare function resetEventLogHealth(): void;
15
18
  export declare function sanitizeArgs(args: unknown): Record<string, unknown>;
16
- export declare function logEvent(directory: string, event: ToolEvent, log?: (msg: string) => void): void;
19
+ export declare function logEvent(directory: string, event: ToolEvent, log?: (msg: string) => void): boolean;
17
20
  export declare function formatEventForStderr(event: ToolEvent): string;
18
21
  //# sourceMappingURL=event-logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-logger.d.ts","sourceRoot":"","sources":["../../src/services/event-logger.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,cAAc,GAAG,eAAe,CAAA;IACzF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAE1D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,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,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CA+BlG;AAwBD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAqD7D"}
@@ -0,0 +1,47 @@
1
+ export type LoopResult = {
2
+ action: "allow";
3
+ } | {
4
+ action: "block";
5
+ reason: string;
6
+ escalationMessage: string;
7
+ } | {
8
+ action: "warn";
9
+ message: string;
10
+ };
11
+ export interface LoopDetectorConfig {
12
+ enabled: boolean;
13
+ maxRepeats: number;
14
+ similarityThreshold: number;
15
+ historySize: number;
16
+ }
17
+ export interface ActionRecord {
18
+ toolName: string;
19
+ normalizedKey: string;
20
+ args: Record<string, unknown>;
21
+ outputHash: string;
22
+ outputPreview: string;
23
+ status: "success" | "error" | "blocked";
24
+ timestamp: number;
25
+ callCount: number;
26
+ consecutiveSameResultCount: number;
27
+ }
28
+ export declare function normalizeAction(toolName: string, args: Record<string, unknown>): string;
29
+ export declare class LoopDetector {
30
+ private config;
31
+ private appLog?;
32
+ private history;
33
+ private persistenceHealthy;
34
+ private persistenceWarningLogged;
35
+ constructor(config?: Partial<LoopDetectorConfig>, appLog?: (msg: string) => void);
36
+ setPersistenceHealthy(healthy: boolean): void;
37
+ getHistory(sessionId: string): ActionRecord[];
38
+ clearSession(sessionId: string): void;
39
+ checkBefore(toolName: string, args: Record<string, unknown>, sessionId: string): LoopResult;
40
+ recordAfter(toolName: string, args: Record<string, unknown>, output: unknown, sessionId: string, status?: "success" | "error" | "blocked"): void;
41
+ private getSessionRecord;
42
+ private setSessionRecord;
43
+ private evictOldest;
44
+ private isNoProgressMarker;
45
+ private buildEscalationMessage;
46
+ }
47
+ //# sourceMappingURL=loop-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loop-detector.d.ts","sourceRoot":"","sources":["../../src/services/loop-detector.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAClB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,G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C,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIrC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU;IAiE3F,WAAW,CACT,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,SAAS,GAAG,OAAO,GAAG,SAAqB,GAClD,IAAI;IAiEP,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,sBAAsB;CAU/B"}
@@ -0,0 +1,54 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ export interface MergeAssistSession {
3
+ id: string;
4
+ targetBranch: string;
5
+ sourceBranch: string;
6
+ featureDescription: string;
7
+ integrationBranch?: string;
8
+ status: "clarifying" | "inspecting" | "planning" | "awaiting_confirmation" | "executing" | "conflict" | "completed" | "aborted";
9
+ candidateCommits: CandidateCommit[];
10
+ selectedCommits: string[];
11
+ dependentCommits: string[];
12
+ mergePlan?: MergePlan;
13
+ confirmations: ConfirmationRecord[];
14
+ conflicts?: ConflictInfo[];
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ }
18
+ export interface CandidateCommit {
19
+ sha: string;
20
+ subject: string;
21
+ author: string;
22
+ date: string;
23
+ files: string[];
24
+ isLikelyFeature: boolean;
25
+ confidence: "high" | "medium" | "low";
26
+ }
27
+ export interface MergePlan {
28
+ targetBranch: string;
29
+ sourceBranch: string;
30
+ integrationBranch: string;
31
+ selectedCommits: string[];
32
+ method: "cherry-pick" | "cherry-pick-range" | "manual-port" | "abort";
33
+ risks: string[];
34
+ recommendedCommands: string[];
35
+ dryRun: boolean;
36
+ }
37
+ export interface ConfirmationRecord {
38
+ step: string;
39
+ prompt: string;
40
+ status: "pending" | "approved" | "rejected";
41
+ requestedAt: string;
42
+ resolvedAt?: string;
43
+ }
44
+ export interface ConflictInfo {
45
+ file: string;
46
+ commitSha: string;
47
+ description: string;
48
+ }
49
+ export declare function findCandidateCommits(cwd: string, sourceBranch: string, targetBranch: string): CandidateCommit[];
50
+ export declare function detectDependencies(candidateCommits: CandidateCommit[]): string[];
51
+ export declare function recommendMethod(candidateCommits: CandidateCommit[], selectedCommits: string[]): MergePlan["method"];
52
+ export declare function generateRecommendedCommands(plan: MergePlan): string[];
53
+ export declare const mergeAssistTool: ToolDefinition;
54
+ //# sourceMappingURL=merge-assist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-assist.d.ts","sourceRoot":"","sources":["../../src/tools/merge-assist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAW/D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,MAAM,EAAE,YAAY,GAAG,YAAY,GAAG,UAAU,GAAG,uBAAuB,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAA;IAC/H,gBAAgB,EAAE,eAAe,EAAE,CAAA;IACnC,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,aAAa,EAAE,kBAAkB,EAAE,CAAA;IACnC,SAAS,CAAC,EAAE,YAAY,EAAE,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,eAAe;IA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ED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,CAqCrE;AA8CD,eAAO,MAAM,eAAe,EAAE,cA2N5B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dv.nghiem/flowdeck",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "FlowDeck — structured planning and execution workflows for OpenCode",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,6 +44,12 @@ If research is stale or missing:
44
44
  - Log which sources were consulted and what evidence was gathered
45
45
 
46
46
  > **MCP integration:** When implementation requires external library knowledge, invoke configured MCP tools as part of the research pass.
47
+ > - **context7** — library docs lookup (first choice for API/docs questions)
48
+ > - **sequential-thinking** — break down complex implementation steps
49
+ > - **memory / omega-memory** — retrieve prior context from planning or earlier phases
50
+ > - **magic** — UI/design system reference for frontend tasks
51
+ > - **playwright** — verify browser behavior for frontend implementations
52
+ > - **token-optimizer** — compress large context when passing research to implementation agents
47
53
 
48
54
  ### Step 1: Guard Check
49
55
 
@@ -60,7 +60,13 @@ If research is stale or missing:
60
60
  - Persist results to STATE.md for future reuse
61
61
  - Log which sources were consulted and what evidence was gathered
62
62
 
63
- > **MCP integration:** When the bug involves external APIs or libraries, invoke configured MCP tools (websearch, docs MCP) to research known failure modes.
63
+ > **MCP integration:** When the bug involves external APIs or libraries, invoke configured MCP tools to research known failure modes.
64
+ > - **context7** — library docs lookup (first choice for API/docs questions)
65
+ > - **sequential-thinking** — stepwise root cause analysis for complex bugs
66
+ > - **memory / omega-memory** — retrieve prior bug fixes or related context
67
+ > - **magic** — design system issues for UI bugs
68
+ > - **playwright** — reproduce and verify browser-specific bugs
69
+ > - **token-optimizer** — compress large stack traces or logs before analysis
64
70
 
65
71
  ### Steps 1-2: Explore & Research
66
72
 
@@ -0,0 +1,180 @@
1
+ ---
2
+ description: Start a human-in-the-loop selective merge workflow to bring a specific feature from one branch to another
3
+ argument-hint: [feature description or source branch]
4
+ ---
5
+
6
+ # Merge Assist
7
+
8
+ Bring a specific feature from one branch to another using selective cherry-pick or manual port, with mandatory human confirmation at every gate.
9
+
10
+ **Input:** $ARGUMENTS — feature description, source branch name, or both (e.g., "OAuth login from feature/oauth")
11
+
12
+ ## Pre-flight
13
+
14
+ 1. Verify this is a git repository. If not, error:
15
+ > "This command requires a git repository."
16
+
17
+ 2. Parse $ARGUMENTS to identify:
18
+ - **Feature description** — what is being moved
19
+ - **Source branch** — where it currently lives
20
+ - **Target branch** — where it should land (default: current branch or `main`)
21
+
22
+ If $ARGUMENTS is ambiguous, ask:
23
+ > "Which branch contains the feature you want to bring?"
24
+ > "Which branch should it land on?"
25
+
26
+ ## Credential Safety
27
+
28
+ The agent MUST NOT ask for GitHub tokens, passwords, SSH keys, or any authentication secrets.
29
+
30
+ If a step requires remote authentication (e.g., `git push`, `gh pr create`):
31
+ 1. Explain that the step requires authentication
32
+ 2. Offer three options:
33
+ - **Stop** — end the workflow here; the human can finish manually
34
+ - **Defer** — complete local steps only; skip remote steps
35
+ - **Manual** — the human runs the remote step themselves
36
+ 3. Do NOT ask for credentials, tokens, or passwords
37
+
38
+ ## Process
39
+
40
+ ### Step 1: Start Session
41
+
42
+ Use the `merge-assist` tool with action `start`:
43
+ ```json
44
+ {
45
+ "action": "start",
46
+ "targetBranch": "<target>",
47
+ "sourceBranch": "<source>",
48
+ "featureDescription": "<description>"
49
+ }
50
+ ```
51
+
52
+ If branches do not exist, report the error and stop.
53
+
54
+ ### Step 2: Branch Selection Gate
55
+
56
+ Present the session details and ask for confirmation:
57
+ > "Merge Assist: bring '<description>' from `<source>` → `<target>`.
58
+ > Confirm these branches? (y/n)"
59
+
60
+ Use `merge-assist` action `confirm` with `step: "branch_selection"` and `approved: true/false`.
61
+
62
+ If rejected, offer to abort or correct branch names.
63
+
64
+ ### Step 3: Inspect Commits
65
+
66
+ Use `merge-assist` action `inspect` with the session ID.
67
+
68
+ Present candidate commits:
69
+ ```
70
+ Found <N> candidate commit(s) on <source> not in <target>:
71
+
72
+ SHA | Subject | Author | Files | Confidence
73
+ ----------|-------------------------|--------|-------|------------
74
+ <sha-1> | feat: add OAuth | alice | 3 | high
75
+ <sha-2> | refactor: extract auth | alice | 2 | medium
76
+ ```
77
+
78
+ Highlight dependent commits if detected.
79
+
80
+ ### Step 4: Commit Selection Gate
81
+
82
+ Ask the user to select commits:
83
+ > "Which commits represent the feature? Provide SHAs (space-separated) or say 'all'.
84
+ > Include dependent commits? (y/n)"
85
+
86
+ Record the selection. Use `merge-assist` action `confirm` with `step: "commit_selection"`.
87
+
88
+ ### Step 5: Build Plan
89
+
90
+ Use `merge-assist` action `plan` with `selectedCommits`.
91
+
92
+ Present the plan:
93
+ ```
94
+ Merge Plan
95
+ ----------
96
+ Integration branch: <branch-name>
97
+ Method: <cherry-pick | cherry-pick-range | manual-port>
98
+ Commits: <sha-1> <sha-2> ...
99
+ Risks:
100
+ - <risk-1>
101
+ - <risk-2>
102
+ ```
103
+
104
+ ### Step 6: Planning Gates
105
+
106
+ Confirm each planning detail:
107
+
108
+ 1. Integration branch name:
109
+ > "Use integration branch `<branch>`? (y/n)"
110
+ → `confirm` with `step: "integration_branch"`
111
+
112
+ 2. Merge method:
113
+ > "Use method `<method>`? (y/n)"
114
+ → `confirm` with `step: "method_selection"`
115
+
116
+ 3. Dependencies:
117
+ > "Include dependent commits? (y/n)"
118
+ → `confirm` with `step: "dependency_inclusion"`
119
+
120
+ If any gate is rejected, offer to revise or abort.
121
+
122
+ ### Step 7: Execute Gate
123
+
124
+ Present the recommended commands:
125
+ ```bash
126
+ Recommended commands:
127
+ git fetch origin
128
+ git checkout -b <branch> <target>
129
+ git cherry-pick <sha-1> <sha-2>
130
+ git push -u origin <branch>
131
+ gh pr create --base <target> --head <branch> ...
132
+ ```
133
+
134
+ Ask:
135
+ > "Execute these commands? (y/n)"
136
+ → `confirm` with `step: "execute_plan"`
137
+
138
+ **Important:** The agent MUST NOT execute these commands. Only the human should run them.
139
+
140
+ ### Step 8: Handle Conflicts (if any)
141
+
142
+ If the human reports a conflict:
143
+
144
+ 1. Stop the workflow.
145
+ 2. Explain which file/commit caused the conflict.
146
+ 3. Use `multiChoiceConfirm` to offer options:
147
+ - "Show conflict details"
148
+ - "Attempt resolution"
149
+ - "Switch to manual port"
150
+ - "Abort session"
151
+ 4. Wait for human decision.
152
+
153
+ ### Step 9: Push / PR Gate
154
+
155
+ After successful execution:
156
+ > "Push the branch and open a PR? This step requires GitHub authentication. (y/n)"
157
+
158
+ If the user is unsure about authentication or says no:
159
+ > "Remote push/PR requires authentication. Options:
160
+ > 1. Stop here — the integration branch is ready locally
161
+ > 2. Defer — skip push/PR for now
162
+ > 3. Manual — run `git push` and `gh pr create` yourself when ready"
163
+
164
+ → `confirm` with `step: "push_pr"`
165
+
166
+ ### Step 10: Complete
167
+
168
+ If `push_pr` is approved, mark the session complete:
169
+ > "Merge Assist complete. Branch `<branch>` pushed. PR created."
170
+
171
+ ## Aborting
172
+
173
+ At any point, the user can abort. Use `merge-assist` action `abort` with the session ID.
174
+
175
+ ## Error Handling
176
+
177
+ - Branch not found: report which branch is missing, offer to list branches
178
+ - No candidate commits: report that the source branch has no unique commits vs target
179
+ - No commits selected: error "At least one commit must be selected"
180
+ - Session not found: error "Session <id> not found. Start a new session with `start`"
@@ -46,7 +46,13 @@ If research is stale or missing:
46
46
  - Persist results to STATE.md for future reuse
47
47
  - Log which sources were consulted and what evidence was gathered
48
48
 
49
- > **MCP integration:** When library, API, or external knowledge is needed, invoke configured MCP tools (websearch, docs MCP, code search MCP) as part of the research pass.
49
+ > **MCP integration:** When library, API, or external knowledge is needed, invoke configured MCP tools as part of the research pass.
50
+ > - **context7** — library docs lookup (first choice for API/docs questions)
51
+ > - **sequential-thinking** — stepwise planning for complex or ambiguous tasks
52
+ > - **memory / omega-memory** — retrieve prior context when available
53
+ > - **magic** — UI/design system research
54
+ > - **playwright** — verify browser behavior for frontend tasks
55
+ > - **token-optimizer** — compress large research context before planning
50
56
 
51
57
  ### Step 1: Guard Check
52
58
 
@@ -0,0 +1,232 @@
1
+ ---
2
+ name: merge-assist
3
+ description: Human-in-the-loop selective branch integration. Helps bring a specific feature from one branch to another using cherry-pick or manual port, with mandatory confirmation gates.
4
+ origin: FlowDeck
5
+ ---
6
+
7
+ # Merge Assist Skill
8
+
9
+ Selective, human-approved branch integration. Never auto-merge. Never auto-push.
10
+
11
+ ## When to Activate
12
+
13
+ Activate when:
14
+ - The user wants to move a specific feature from one branch to another
15
+ - The user asks to cherry-pick selectively from a branch
16
+ - The user wants to avoid merging an entire branch (e.g., avoid bringing in unrelated changes)
17
+ - The user needs help porting commits across diverged branches
18
+ - The user says things like "bring this feature to main", "cherry-pick these changes", "port this PR"
19
+
20
+ ## Core Principles
21
+
22
+ 1. **Human approval is mandatory** — Every gate requires explicit y/n confirmation. No silent execution.
23
+ 2. **Never assume feature boundaries** — Ask the user which commits represent the feature. Do not guess.
24
+ 3. **Prefer selective methods** — Cherry-pick over full merge. Manual port over blind cherry-pick when conflicts are likely.
25
+ 4. **Ask on every ambiguity** — If commit history is unclear, stop and ask. Do not proceed on assumptions.
26
+ 5. **No autonomous merge authority** — The agent MUST NOT run `git merge`, `git cherry-pick`, `git push`, `git commit`, `git checkout`, `git branch -D`, `git reset`, or `git revert` without human confirmation.
27
+ 6. **Never ask for credentials** — The agent MUST NOT ask for GitHub tokens, passwords, SSH keys, or any authentication secrets. If a remote action requires authentication, explain this and offer options: stop, defer, or let the human perform that step manually.
28
+
29
+ ## Workflow Steps
30
+
31
+ ### Step 1: Clarification
32
+
33
+ Ask the user to confirm:
34
+ - **Target branch** — where the feature should land (e.g., `main`)
35
+ - **Source branch** — where the feature currently lives (e.g., `feature/auth-refactor`)
36
+ - **Feature description** — one-sentence summary of what is being moved
37
+
38
+ If the user only provides a branch name, infer the other branch from context or ask.
39
+
40
+ Use the `merge-assist` tool with action `start` to create the session.
41
+
42
+ ### Step 2: Branch Verification
43
+
44
+ The tool verifies both branches exist. If not, report the error and stop.
45
+
46
+ Confirmation gate: `branch_selection`
47
+
48
+ Prompt example:
49
+ > "Confirm: integrate feature 'OAuth login' from `feature/oauth` into `main`? (y/n)"
50
+
51
+ ### Step 3: Inspection
52
+
53
+ Use the `merge-assist` tool with action `inspect` to analyze the source branch history.
54
+
55
+ The tool returns:
56
+ - Candidate commits (SHA, subject, author, date, files)
57
+ - Heuristic confidence for whether each commit is part of the feature
58
+ - Dependent commits detected via shared files or message keywords
59
+
60
+ Present the candidate commits to the user in a clear table:
61
+
62
+ ```
63
+ SHA | Subject | Author | Confidence | Feature?
64
+ --------|----------------------------|-----------|------------|----------
65
+ abc1234 | feat(auth): add OAuth flow | alice | high | yes
66
+ def5678 | refactor(auth): extract | alice | medium | maybe
67
+ ```
68
+
69
+ ### Step 4: Commit Selection
70
+
71
+ Ask the user to identify which commits represent the feature.
72
+
73
+ Confirmation gate: `commit_selection`
74
+
75
+ Prompt example:
76
+ > "Which commits represent the OAuth feature? Provide SHAs (space-separated) or say 'all'.
77
+ > Dependent commits detected: def5678. Include them? (y/n)"
78
+
79
+ ### Step 5: Plan Creation
80
+
81
+ Use the `merge-assist` tool with action `plan` with the selected commits.
82
+
83
+ The tool builds a merge plan including:
84
+ - Recommended method: `cherry-pick`, `cherry-pick-range`, `manual-port`, or `abort`
85
+ - Integration branch name (default: `merge-assist/<source>-to-<target>`)
86
+ - Risk assessment
87
+ - Recommended commands (as strings — NOT executed)
88
+
89
+ ### Step 6: Planning Confirmations
90
+
91
+ Three gates must be confirmed before proceeding:
92
+
93
+ 1. **integration_branch** — Confirm the integration branch name
94
+ 2. **method_selection** — Confirm the merge method
95
+ 3. **dependency_inclusion** — Confirm whether to include dependent commits
96
+
97
+ Prompt example:
98
+ > "Integration branch: `merge-assist/feature-oauth-to-main`. OK? (y/n)"
99
+ > "Method: cherry-pick-range (commits abc1234..def5678). OK? (y/n)"
100
+ > "Include dependent commit def5678 (refactor prep)? (y/n)"
101
+
102
+ ### Step 7: Execute Confirmation
103
+
104
+ Confirmation gate: `execute_plan`
105
+
106
+ Present the recommended commands to the user. Do NOT run them.
107
+
108
+ Prompt example:
109
+ > "Ready to execute. Recommended commands:
110
+ > ```
111
+ > git fetch origin
112
+ > git checkout -b merge-assist/feature-oauth-to-main main
113
+ > git cherry-pick abc1234^..def5678
114
+ > git push -u origin merge-assist/feature-oauth-to-main
115
+ > ```
116
+ > Execute these commands? (y/n)"
117
+
118
+ ### Step 8: Human Execution
119
+
120
+ If approved, the human (or agent with explicit permission) runs the commands.
121
+
122
+ **The agent MUST NOT run these commands autonomously.**
123
+
124
+ ### Step 9: Push / PR Confirmation
125
+
126
+ After successful execution, confirm pushing and PR creation.
127
+
128
+ Confirmation gate: `push_pr`
129
+
130
+ Prompt example:
131
+ > "Push branch and open PR? (y/n)"
132
+
133
+ ## Confirmation Gates
134
+
135
+ Every gate requires human approval. The tool tracks each gate in the session state.
136
+
137
+ | # | Gate | Trigger | Prompt Style |
138
+ |---|------|---------|-------------|
139
+ | 1 | `branch_selection` | After start | y/n |
140
+ | 2 | `commit_selection` | After inspect | Provide SHAs + y/n on deps |
141
+ | 3 | `integration_branch` | During plan | y/n |
142
+ | 4 | `method_selection` | During plan | y/n |
143
+ | 5 | `dependency_inclusion` | During plan | y/n |
144
+ | 6 | `execute_plan` | After plan approved | y/n |
145
+ | 7 | `push_pr` | After execute | y/n |
146
+
147
+ If any gate is rejected:
148
+ - Stop the workflow
149
+ - Offer to `abort` the session or revise the selection
150
+
151
+ ## Conflict Handling
152
+
153
+ If a conflict occurs during human execution:
154
+
155
+ 1. **Stop immediately** — Do not proceed past the conflict.
156
+ 2. **Explain the conflict** — File path, commit SHA, and what changed.
157
+ 3. **Propose options** — Use `multiChoiceConfirm` with choices like:
158
+ - "Show conflict details"
159
+ - "Attempt resolution"
160
+ - "Abort and try manual port"
161
+ - "Abort session"
162
+ 4. **Wait for human decision** — Do not auto-resolve. Do not guess.
163
+
164
+ Update the session with conflict info if available:
165
+ ```
166
+ conflicts: [
167
+ { file: "src/auth.ts", commitSha: "abc1234", description: "Both branches modified login() signature" }
168
+ ]
169
+ ```
170
+
171
+ ## Anti-Patterns
172
+
173
+ The following are explicitly forbidden:
174
+
175
+ - **Auto-merge** — Never run `git merge` without confirmation
176
+ - **Auto-push** — Never run `git push` without confirmation
177
+ - **Assume commits** — Never guess which commits belong to a feature
178
+ - **Silent cherry-pick** — Never cherry-pick without showing the user what will happen
179
+ - **Ignore conflicts** — Never proceed past a conflict without human input
180
+ - **Skip confirmation gates** — Every gate must be explicitly approved or rejected
181
+ - **Execute state-changing git commands in the tool** — The tool only READS git history
182
+ - **Ask for credentials** — Never request GitHub tokens, passwords, SSH keys, or other secrets from the user
183
+
184
+ ## Examples
185
+
186
+ ### Example 1: Simple cherry-pick
187
+
188
+ User: "Bring the OAuth feature from feature/oauth to main"
189
+
190
+ Agent:
191
+ > "Starting merge-assist workflow. Target: `main`, Source: `feature/oauth`, Feature: OAuth login.
192
+ > Confirm: integrate from `feature/oauth` into `main`? (y/n)"
193
+
194
+ [User confirms]
195
+
196
+ Agent:
197
+ > "Found 3 candidate commits:
198
+ > - abc1234 feat(auth): add OAuth flow (high confidence)
199
+ > - def5678 refactor(auth): extract auth module (medium — shared files)
200
+ > - ghi9012 test(auth): add OAuth tests (medium — test only)
201
+ > Which commits represent the feature? (provide SHAs or 'all')"
202
+
203
+ [User selects abc1234 def5678]
204
+
205
+ Agent:
206
+ > "Plan: cherry-pick-range `abc1234^..def5678` into `merge-assist/feature-oauth-to-main`.
207
+ > Risks: refactor prep commit included.
208
+ > Execute? (y/n)"
209
+
210
+ ### Example 2: Conflict detected
211
+
212
+ User: "It conflicted on src/auth.ts"
213
+
214
+ Agent:
215
+ > "Conflict detected in `src/auth.ts` during cherry-pick of `abc1234`.
216
+ > Options:
217
+ > 1. Show conflict details
218
+ > 2. Attempt resolution
219
+ > 3. Abort and try manual port
220
+ > 4. Abort session
221
+ > What would you like to do?"
222
+
223
+ ## Tool Reference
224
+
225
+ Use the `merge-assist` tool with these actions:
226
+ - `start` — Initialize session
227
+ - `inspect` — Analyze git history
228
+ - `plan` — Build merge plan from selected commits
229
+ - `confirm` — Record approval/rejection for a step
230
+ - `abort` — Abort session
231
+ - `status` — Get current session state
232
+ - `list` — List all sessions