Desktop app that records your on-screen work session and uses the GitHub Copilot SDK to reconstruct it as an intent + ordered steps, then builds a reusable Skill or Automation for Microsoft Autopilots like Scout, Microsoft Copilot Cowork, or Copilot Studio.
TypeScript agent-skillsai-agentsautomationcopilotcopilot-clicopilot-coworkcopilot-studioelectronmicrosoft-scoutscreen-recording
Simplify skill flow: drop approve stage, make refining optional
adilei2ec2017123e3
diff --git a/common/ipc.ts b/common/ipc.tsindex 0212f3b..b9a9993 100644--- a/common/ipc.ts+++ b/common/ipc.ts@@ -19,6 +19,8 @@ export interface SessionSummary {/** True once post-processing produced a bundle. */processed: boolean;hasVideo: boolean;+ /** True once a skill has been built and persisted for this session. */+ hasSkill: boolean;/** Present once the describer has produced an analysis for this session. */analysis: {revision: number;@@ -26,7 +28,6 @@ export interface SessionSummary {intent: string;intentConfidence: Confidence;stepCount: number;- approved: boolean;} | null;}@@ -76,7 +77,7 @@ export interface SkillBuildProgress {message: string;}-/** Start a build (or refine one) for a session's approved analysis. */+/** Start a build (or refine one) for a session's analysis. */export interface SkillBuildInput {sessionId: string;/** Target architecture (only "scout" is enabled today). */@@ -164,7 +165,6 @@ export const IPC = {analyze: "analyze:start",analyzeFeedback: "analyze:feedback",getAnalysis: "analyze:get",- approveAnalysis: "analyze:approve",updateAnalysis: "analyze:update",cancelAnalysis: "analyze:cancel",analyzeProgress: "analyze:progress",@@ -197,8 +197,6 @@ export interface SkillRecorderApi {analyzeFeedback(input: AnalysisFeedbackInput): Promise<AnalyzeResult>;/** Load the persisted analysis for a session, if any. */getAnalysis(sessionId: string): Promise<Analysis | null>;- /** Mark an analysis as accepted/correct — the artifact a Skill is built from. */- approveAnalysis(sessionId: string): Promise<AnalyzeResult>;/** Edit the title/intent text directly (no re-analysis). */updateAnalysis(input: AnalysisEditInput): Promise<AnalyzeResult>;/** Abort an in-flight analysis. */@@ -209,7 +207,7 @@ export interface SkillRecorderApi {/** Permanently delete a saved recording and all its artifacts from disk. */deleteSession(sessionId: string): Promise<DeleteSessionResult>;/**- * Propose (or refine) a skill from an approved analysis. Pass `feedback` to+ * Propose (or refine) a skill from a recording's analysis. Pass `feedback` to* revise the current plan in the same multi-turn conversation.*/buildSkill(input: SkillBuildInput): Promise<SkillPlanResult>;diff --git a/electron/describer/describer.ts b/electron/describer/describer.tsindex 32fbeab..1c274c1 100644--- a/electron/describer/describer.ts+++ b/electron/describer/describer.ts@@ -119,16 +119,6 @@ export class Describer {}}- /** Accept an analysis as correct. Persists `approved` so a Skill can be built from it. */- async approve(sessionId: string): Promise<Analysis> {- if (this.active.has(sessionId)) throw new Error("Wait for the current analysis to finish before saving.");- const prior = loadPersistedAnalysis(sessionId);- if (!prior) throw new Error("There is no analysis to approve yet.");- const approved: Analysis = { ...prior, approved: true, approvedAt: Date.now() };- this.persist(sessionDir(sessionId), approved);- return approved;- }-/*** Apply a direct text edit to the title and/or intent — a user correction, NOT a* re-analysis. Steps and evidence are untouched; the agent is not invoked. Blankdiff --git a/electron/ipc.ts b/electron/ipc.tsindex 47fa99e..71e8e5c 100644--- a/electron/ipc.ts+++ b/electron/ipc.ts@@ -93,18 +93,6 @@ export function registerIpc(isValidSessionId(sessionId) ? loadPersistedAnalysis(sessionId) : null,);- ipcMain.handle(IPC.approveAnalysis, async (_event, sessionId: string): Promise<AnalyzeResult> => {- if (!isValidSessionId(sessionId)) return { ok: false, error: "Unknown session." };- try {- const analysis = await describer.approve(sessionId);- return { ok: true, analysis };- } catch (err) {- const error = err instanceof Error ? err.message : String(err);- log.warn("approve failed:", error);- return { ok: false, error };- }- });-ipcMain.handle(IPC.updateAnalysis, async (_event, input: AnalysisEditInput): Promise<AnalyzeResult> => {if (!isValidSessionId(input?.sessionId)) return { ok: false, error: "Unknown session." };try {diff --git a/electron/preload.cjs b/electron/preload.cjsindex dda96b3..191f987 100644--- a/electron/preload.cjs+++ b/electron/preload.cjs@@ -15,7 +15,6 @@ const IPC = {analyze: "analyze:start",analyzeFeedback: "analyze:feedback",getAnalysis: "analyze:get",- approveAnalysis: "analyze:approve",updateAnalysis: "analyze:update",cancelAnalysis: "analyze:cancel",analyzeProgress: "analyze:progress",@@ -48,7 +47,6 @@ contextBridge.exposeInMainWorld("skillRecorder", {analyze: (sessionId) => ipcRenderer.invoke(IPC.analyze, sessionId),analyzeFeedback: (input) => ipcRenderer.invoke(IPC.analyzeFeedback, input),getAnalysis: (sessionId) => ipcRenderer.invoke(IPC.getAnalysis, sessionId),- approveAnalysis: (sessionId) => ipcRenderer.invoke(IPC.approveAnalysis, sessionId),updateAnalysis: (input) => ipcRenderer.invoke(IPC.updateAnalysis, input),cancelAnalysis: (sessionId) => ipcRenderer.invoke(IPC.cancelAnalysis, sessionId),onAnalyzeProgress: (cb) => {diff --git a/electron/sessions.ts b/electron/sessions.tsindex cd2615c..b90ccd0 100644--- a/electron/sessions.ts+++ b/electron/sessions.ts@@ -44,10 +44,11 @@ async function summarize(root: string, name: string): Promise<SessionSummary | n}if (!meta?.id) return null;- const [analysis, processed, hasVideo] = await Promise.all([+ const [analysis, processed, hasVideo, hasSkill] = await Promise.all([loadAnalysis(dir),exists(path.join(dir, "bundle.json")),exists(path.join(dir, "video.json")),+ exists(path.join(dir, "skill.json")),]);return {@@ -57,6 +58,7 @@ async function summarize(root: string, name: string): Promise<SessionSummary | ndurationMs: meta.startedAt && meta.stoppedAt ? meta.stoppedAt - meta.startedAt : null,processed,hasVideo,+ hasSkill,analysis: analysis? {revision: analysis.revision,@@ -64,7 +66,6 @@ async function summarize(root: string, name: string): Promise<SessionSummary | nintent: analysis.intent,intentConfidence: analysis.intentConfidence,stepCount: analysis.steps.length,- approved: analysis.approved ?? false,}: null,};diff --git a/electron/skillbuilder/builder.ts b/electron/skillbuilder/builder.tsindex cd6cbea..58f95e9 100644--- a/electron/skillbuilder/builder.ts+++ b/electron/skillbuilder/builder.ts@@ -74,7 +74,7 @@ export function loadPersistedSkill(sessionId: string): BuiltSkill | null {}/**- * Drives the multi-turn GitHub Copilot CLI agent that turns an *approved* analysis+ * Drives the multi-turn GitHub Copilot CLI agent that turns a recording's analysis* into a generalized, native-tool-first skill for a target architecture. Owns one* shared {@link CopilotClient}; keeps one live conversation per recording so the* plan → refine → build flow stays in a single session. Streams progress out via a@@ -98,7 +98,6 @@ export class SkillBuilder {}const analysis = loadPersistedAnalysis(sessionId);if (!analysis) throw new Error("There is no analysis for this recording yet.");- if (!analysis.approved) throw new Error("Approve the analysis before building a skill from it.");this.active.add(sessionId);try {@@ -116,7 +115,7 @@ export class SkillBuilder {}}- /** Finalize the approved plan into a SKILL.md and export it. */+ /** Finalize the proposed plan into a SKILL.md and export it. */async create(sessionId: string): Promise<{ skill: BuiltSkill; path: string }> {if (this.active.has(sessionId)) throw new Error("Wait for the current step to finish.");const live = this.live.get(sessionId);diff --git a/src/Library.tsx b/src/Library.tsxindex 7f82c9f..519dc55 100644--- a/src/Library.tsx+++ b/src/Library.tsx@@ -138,8 +138,8 @@ function SessionsList({><div className="sess-top"><span className="sess-when">{formatWhen(s.startedAt)}</span>- {s.analysis?.approved ? (- <span className="tag ok">approved</span>+ {s.hasSkill ? (+ <span className="tag ok">skill</span>) : s.analysis ? (<span className="tag an">analyzed</span>) : !s.processed ? (@@ -280,13 +280,6 @@ function AnalysisWorkspace({void onChanged();}, [notes, overall, sessionId, onChanged]);- const approve = useCallback(async () => {- const res = await window.skillRecorder.approveAnalysis(sessionId);- if (res.ok && res.analysis) setAnalysis(res.analysis);- else setError(res.error ?? "Could not save");- void onChanged();- }, [sessionId, onChanged]);-const startEdit = useCallback(() => {if (!analysis) return;setDraftTitle(analysis.title ?? "");@@ -314,8 +307,6 @@ function AnalysisWorkspace({setNotes((prev) => ({ ...prev, [stepId]: note }));}, []);- const approved = analysis?.approved ?? false;-if (building && analysis) {return (<SkillBuilderView@@ -427,7 +418,6 @@ function AnalysisWorkspace({{analysis.intentRationale && (<p className="summary-why">{analysis.intentRationale}</p>)}- {approved && <span className="tag ok">approved</span>}</>)}</div>@@ -464,31 +454,27 @@ function AnalysisWorkspace({{analysis && !analyzing && (<div className="ws-foot">- <span className="foot-status">{approved ? "Saved" : ""}</span>+ <span className="foot-status">{summary.hasSkill ? "Skill created" : ""}</span><div className="ws-foot-actions">{hasFeedback && (<button className="secondary" onClick={sendFeedback}>Send feedback & re-analyze</button>)}- {approved ? (- <button- className="record-cta"- onClick={() => setBuilding(true)}- title="Turn this recording into a reusable skill"- >- Create skill →- </button>- ) : (- <button- className="record-cta"- onClick={approve}- disabled={hasFeedback}- title={hasFeedback ? "Send or clear your feedback first" : "Save as correct"}- >- Looks good, save- </button>- )}+ <button+ className="record-cta"+ onClick={() => setBuilding(true)}+ disabled={hasFeedback}+ title={+ hasFeedback+ ? "Send or clear your feedback first"+ : summary.hasSkill+ ? "Open the skill built from this recording"+ : "Turn this recording into a reusable skill"+ }+ >+ {summary.hasSkill ? "Open skill →" : "Create skill →"}+ </button></div></div>)}@@ -524,6 +510,15 @@ function SkillBuilderView({const [exportedPath, setExportedPath] = useState("");const [builtName, setBuiltName] = useState("");const canceled = useRef(false);+ const inFlight = useRef(false);++ // Leaving the builder (session switch or Close) discards an in-progress plan —+ // we don't save drafts — so stop any run that's still going in the background.+ useEffect(() => {+ return () => {+ if (inFlight.current) void window.skillRecorder.cancelSkill(sessionId);+ };+ }, [sessionId]);// Reopen straight to the exported state if this recording already has a skill.useEffect(() => {@@ -550,10 +545,12 @@ function SkillBuilderView({const runPlan = useCallback(async (note?: string) => {canceled.current = false;+ inFlight.current = true;setError(null);setStatusLine(note ? "Refining the plan…" : "Planning the skill…");setPhase("planning");const res = await window.skillRecorder.buildSkill({ sessionId, architecture, feedback: note });+ inFlight.current = false;if (res.ok && res.plan) {setPlan(res.plan);setFeedback("");@@ -568,10 +565,12 @@ function SkillBuilderView({const create = useCallback(async () => {canceled.current = false;+ inFlight.current = true;setError(null);setStatusLine("Writing the skill…");setPhase("creating");const res = await window.skillRecorder.createSkill(sessionId);+ inFlight.current = false;if (res.ok && res.skill) {setBuiltName(res.skill.name);setExportedPath(res.path ?? res.skill.exportedPath ?? "");@@ -584,6 +583,7 @@ function SkillBuilderView({const cancelRun = useCallback(async () => {canceled.current = true;+ inFlight.current = false;setStatusLine("Stopping…");await window.skillRecorder.cancelSkill(sessionId);setPhase(plan ? "plan" : "arch");@@ -745,8 +745,7 @@ function SkillBuilderView({<buttonclassName="record-cta"onClick={() => void create()}- disabled={feedback.trim().length > 0}- title={feedback.trim() ? "Refine or clear your notes first" : "Create and export the skill"}+ title="Create and export the skill">Create & export skill</button>