@dv.nghiem/flowdeck 0.3.6 → 0.3.8

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.
Files changed (67) hide show
  1. package/dist/agents/index.d.ts +2 -1
  2. package/dist/agents/index.d.ts.map +1 -1
  3. package/dist/agents/supervisor.d.ts +3 -0
  4. package/dist/agents/supervisor.d.ts.map +1 -0
  5. package/dist/config/schema.d.ts +36 -0
  6. package/dist/config/schema.d.ts.map +1 -1
  7. package/dist/dashboard/lib/state-reader.d.ts.map +1 -1
  8. package/dist/dashboard/server.mjs +789 -905
  9. package/dist/dashboard/types.d.ts +0 -2
  10. package/dist/dashboard/types.d.ts.map +1 -1
  11. package/dist/dashboard/views/index.ejs +0 -6
  12. package/dist/dashboard/views/partials/header.ejs +0 -4
  13. package/dist/hooks/command-ref-guard.d.ts +21 -0
  14. package/dist/hooks/command-ref-guard.d.ts.map +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +819 -12
  17. package/dist/lib/impact-radar.d.ts +2 -2
  18. package/dist/services/agent-contract-registry.d.ts.map +1 -1
  19. package/dist/services/command-validator.d.ts +50 -0
  20. package/dist/services/command-validator.d.ts.map +1 -0
  21. package/dist/services/command-validator.test.d.ts +2 -0
  22. package/dist/services/command-validator.test.d.ts.map +1 -0
  23. package/dist/services/quick-router.d.ts +118 -0
  24. package/dist/services/quick-router.d.ts.map +1 -0
  25. package/dist/services/quick-router.test.d.ts +13 -0
  26. package/dist/services/quick-router.test.d.ts.map +1 -0
  27. package/dist/services/supervisor-binding.d.ts +114 -0
  28. package/dist/services/supervisor-binding.d.ts.map +1 -0
  29. package/dist/services/supervisor.test.d.ts +14 -0
  30. package/dist/services/supervisor.test.d.ts.map +1 -0
  31. package/dist/services/telemetry.d.ts +1 -1
  32. package/dist/services/telemetry.d.ts.map +1 -1
  33. package/dist/services/workflow-scorecard.d.ts +20 -0
  34. package/dist/services/workflow-scorecard.d.ts.map +1 -1
  35. package/docs/agents.md +1 -1
  36. package/docs/commands/fd-ask.md +1 -1
  37. package/docs/commands/fd-deploy-check.md +1 -1
  38. package/docs/commands/fd-discuss.md +1 -1
  39. package/docs/commands/fd-fix-bug.md +1 -1
  40. package/docs/commands/fd-new-feature.md +1 -1
  41. package/docs/commands/fd-verify.md +18 -0
  42. package/docs/commands/fd-write-docs.md +1 -1
  43. package/docs/commands.md +43 -23
  44. package/docs/feature-integration-architecture.md +1 -1
  45. package/docs/notifications.md +2 -2
  46. package/docs/quick-start.md +3 -1
  47. package/docs/skills.md +1 -1
  48. package/docs/workflows.md +1 -1
  49. package/package.json +8 -8
  50. package/src/commands/fd-discuss.md +1 -1
  51. package/src/commands/fd-multi-repo.md +2 -2
  52. package/src/commands/fd-new-project.md +0 -1
  53. package/src/commands/fd-plan.md +1 -1
  54. package/src/commands/fd-quick.md +240 -55
  55. package/src/rules/common/agent-orchestration.md +1 -1
  56. package/src/skills/blast-radius-preview/SKILL.md +1 -1
  57. package/src/skills/change-impact-radar/SKILL.md +2 -2
  58. package/src/skills/confidence-aware-planning/SKILL.md +1 -1
  59. package/src/skills/context-load/SKILL.md +1 -1
  60. package/src/skills/design-tokens/SKILL.md +250 -0
  61. package/src/skills/git-release/SKILL.md +1 -1
  62. package/src/skills/human-review-routing/SKILL.md +3 -3
  63. package/src/skills/intent-translator/SKILL.md +2 -2
  64. package/src/skills/regression-prediction/SKILL.md +1 -1
  65. package/src/skills/test-gap-detector/SKILL.md +1 -1
  66. package/src/skills/ui-design/SKILL.md +313 -0
  67. package/src/skills/volatility-map/SKILL.md +1 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shared Impact Radar utility.
3
3
  * Scans .codebase/ data stores for risk signals relevant to a change description.
4
- * Used by /discuss, /plan, /new-feature, and /fix-bug.
4
+ * Used by /fd-discuss, /fd-plan, /fd-new-feature, and /fd-fix-bug.
5
5
  */
6
6
  import type { FailureEntry } from "../tools/failure-replay";
7
7
  export interface ImpactRadarResult {
@@ -29,7 +29,7 @@ export declare function impactRadarSummaryLines(radar: ImpactRadarResult): strin
29
29
  /**
30
30
  * Look up prior failures from FAILURES.json that match by path prefix or keyword.
31
31
  * Returns full FailureEntry objects (including root_cause and fix_applied) sorted by recurrence desc.
32
- * Used by /fix-bug to surface lessons learned before the fix begins.
32
+ * Used by /fd-fix-bug to surface lessons learned before the fix begins.
33
33
  */
34
34
  export declare function lookupPriorFailures(dir: string, scope: string, bugText: string, limit?: number): FailureEntry[];
35
35
  //# sourceMappingURL=impact-radar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-contract-registry.d.ts","sourceRoot":"","sources":["../../src/services/agent-contract-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,mDAAmD;IACnD,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,+DAA+D;IAC/D,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,2CAA2C;IAC3C,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,+DAA+D;IAC/D,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,qDAAqD;IACrD,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,oCAAoC;IACpC,eAAe,EAAE,MAAM,EAAE,CAAA;CAC1B;AA+SD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAE/D;AAED,wBAAgB,eAAe,IAAI,aAAa,EAAE,CAEjD;AAED,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,CAElD"}
1
+ {"version":3,"file":"agent-contract-registry.d.ts","sourceRoot":"","sources":["../../src/services/agent-contract-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,mDAAmD;IACnD,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,+DAA+D;IAC/D,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,2CAA2C;IAC3C,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,+DAA+D;IAC/D,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,qDAAqD;IACrD,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,oCAAoC;IACpC,eAAe,EAAE,MAAM,EAAE,CAAA;CAC1B;AA+UD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAE/D;AAED,wBAAgB,eAAe,IAAI,aAAa,EAAE,CAEjD;AAED,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,CAElD"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Command reference validator.
3
+ * Source of truth: REGISTERED_COMMANDS from supervisor-binding.
4
+ * Used at startup, in tests, and by the response guardrail to prevent
5
+ * agents from suggesting slash commands that don't exist.
6
+ */
7
+ export interface CommandValidationResult {
8
+ valid: boolean;
9
+ command: string;
10
+ reason?: string;
11
+ }
12
+ export interface AuditResult {
13
+ text: string;
14
+ references: string[];
15
+ invalid: CommandValidationResult[];
16
+ valid: CommandValidationResult[];
17
+ hasInvalid: boolean;
18
+ }
19
+ /**
20
+ * Returns true if the given slash command (with or without leading slash) is registered.
21
+ */
22
+ export declare function isValidCommand(ref: string): boolean;
23
+ /**
24
+ * Validate a single command reference string (e.g. "/fd-plan" or "fd-plan").
25
+ */
26
+ export declare function validateCommandReference(ref: string): CommandValidationResult;
27
+ /**
28
+ * Extract all /fd-* slash command references from a text string.
29
+ */
30
+ export declare function extractCommandReferences(text: string): string[];
31
+ /**
32
+ * Extract bare /word references that are missing the fd- prefix.
33
+ * Returns only those that would be valid if prefixed with fd-.
34
+ */
35
+ export declare function extractBarePrefixErrors(text: string): string[];
36
+ /**
37
+ * Audit a text string for invalid command references.
38
+ * Checks all /fd-* patterns against the registered command set.
39
+ */
40
+ export declare function auditTextForInvalidCommands(text: string): AuditResult;
41
+ /**
42
+ * Rewrite a text string by replacing invalid /fd-* command references with
43
+ * a note that the command is unavailable. Leaves valid commands untouched.
44
+ */
45
+ export declare function rewriteInvalidCommandRefs(text: string): string;
46
+ /**
47
+ * Return the full canonical command inventory for inspection/testing.
48
+ */
49
+ export declare function getCommandInventory(): readonly string[];
50
+ //# sourceMappingURL=command-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-validator.d.ts","sourceRoot":"","sources":["../../src/services/command-validator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,OAAO,EAAE,uBAAuB,EAAE,CAAA;IAClC,KAAK,EAAE,uBAAuB,EAAE,CAAA;IAChC,UAAU,EAAE,OAAO,CAAA;CACpB;AAQD;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGnD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAmB7E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAG/D;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAY9D;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAqBrE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,MAAM,EAAE,CAEvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=command-validator.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-validator.test.d.ts","sourceRoot":"","sources":["../../src/services/command-validator.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Quick Router Service
3
+ *
4
+ * Provides task classification and stage-sequence routing for the /fd-quick
5
+ * autonomous workflow launcher.
6
+ *
7
+ * This module is the single source of truth for:
8
+ * - Classifying user task descriptions into task types
9
+ * - Mapping task types to the correct existing stage sequence
10
+ * - Computing the next stage given what has already completed
11
+ * - Determining whether supervisor clarification is required before proceeding
12
+ *
13
+ * It does NOT create new workflows. It routes to the existing commands:
14
+ * fd-discuss, fd-design, fd-plan, fd-execute, fd-fix-bug, fd-write-docs, fd-verify
15
+ */
16
+ export type TaskType = "feature" | "ui-feature" | "bugfix" | "docs" | "simple" | "ambiguous";
17
+ /** A single stage in a workflow sequence, mapping to an existing fd-* command. */
18
+ export interface WorkflowStage {
19
+ /** Human-readable stage name */
20
+ name: string;
21
+ /** The registered fd-* command that implements this stage */
22
+ command: string;
23
+ /** Arguments to pass to the command (if any) */
24
+ args?: string;
25
+ /** Whether this stage requires human approval before proceeding */
26
+ requiresApproval: boolean;
27
+ /** Whether this stage can be skipped if prerequisites are absent and --override is set */
28
+ skippable: boolean;
29
+ }
30
+ export interface ClassificationResult {
31
+ taskType: TaskType;
32
+ /** 0.0–1.0 confidence in the classification */
33
+ confidence: number;
34
+ /** Which signal patterns triggered the classification */
35
+ signals: string[];
36
+ /** True when the task is explicitly UI/UX-heavy, requiring design-first */
37
+ requiresDesign: boolean;
38
+ /** True when TDD enforcement applies (always true except for docs-only) */
39
+ requiresTDD: boolean;
40
+ /** Ordered sequence of stages to execute */
41
+ stageSequence: WorkflowStage[];
42
+ /** True when the description is too vague to classify without asking a question */
43
+ clarificationNeeded: boolean;
44
+ /** The single clarifying question to ask via supervisor (when clarificationNeeded=true) */
45
+ clarificationPrompt?: string;
46
+ }
47
+ /**
48
+ * Classify a free-text task description into a TaskType with a confidence score.
49
+ *
50
+ * Signal matching is case-insensitive substring search. Multiple signal hits
51
+ * increase confidence. The highest-confidence match wins; ties break toward
52
+ * the more structured workflow type (feature > simple > ambiguous).
53
+ */
54
+ export declare function classifyTask(description: string): ClassificationResult;
55
+ /**
56
+ * Build the ordered WorkflowStage array for a given TaskType.
57
+ * Each stage maps 1:1 to an existing registered fd-* command.
58
+ */
59
+ export declare function buildStageSequence(taskType: TaskType): WorkflowStage[];
60
+ export interface StageProgress {
61
+ completedStageNames: string[];
62
+ blockedAtStage?: string;
63
+ blockedReason?: string;
64
+ }
65
+ export interface NextStageResult {
66
+ /** The stage to execute next, or null if all stages are complete */
67
+ stage: WorkflowStage | null;
68
+ /** True when all stages have been completed */
69
+ allComplete: boolean;
70
+ /** True when execution is blocked at a stage */
71
+ blocked: boolean;
72
+ blockedReason?: string;
73
+ /** Remaining stage names (not counting the returned stage) */
74
+ remaining: string[];
75
+ }
76
+ /**
77
+ * Given a stage sequence and the current progress, determine the next
78
+ * stage to execute.
79
+ *
80
+ * Returns null stage when all stages are complete.
81
+ */
82
+ export declare function getNextStage(sequence: WorkflowStage[], progress: StageProgress): NextStageResult;
83
+ /** The structure written to STATE.md under the `quick_run` key by /fd-quick. */
84
+ export interface QuickRunState {
85
+ /** Original task description from $ARGUMENTS */
86
+ taskDescription: string;
87
+ /** Classification result */
88
+ taskType: TaskType;
89
+ confidence: number;
90
+ requiresDesign: boolean;
91
+ requiresTDD: boolean;
92
+ /** Ordered stage names for this run */
93
+ stageSequence: string[];
94
+ /** Stages that have been completed */
95
+ completedStages: string[];
96
+ /** Current stage being executed, if any */
97
+ currentStage: string | null;
98
+ /** Whether the run has been halted */
99
+ blocked: boolean;
100
+ blockedReason?: string;
101
+ /** Supervisor decisions keyed by stage name */
102
+ supervisorDecisions: Record<string, {
103
+ decision: string;
104
+ reasons: string[];
105
+ timestamp: string;
106
+ }>;
107
+ /** ISO timestamp when the run started */
108
+ startedAt: string;
109
+ /** ISO timestamp of last update */
110
+ updatedAt: string;
111
+ /** Final run outcome */
112
+ outcome: "running" | "complete" | "blocked" | "failed";
113
+ }
114
+ /**
115
+ * Create a fresh QuickRunState record for a new /fd-quick run.
116
+ */
117
+ export declare function createQuickRunState(taskDescription: string, classification: ClassificationResult): QuickRunState;
118
+ //# sourceMappingURL=quick-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quick-router.d.ts","sourceRoot":"","sources":["../../src/services/quick-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,WAAW,CAAA;AAEf,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAA;IACf,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,gBAAgB,EAAE,OAAO,CAAA;IACzB,0FAA0F;IAC1F,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAA;IAClB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAA;IAClB,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,2EAA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,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,+CAA+C;IAC/C,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC/F,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAA;IACjB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAA;IACjB,wBAAwB;IACxB,OAAO,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAA;CACvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,oBAAoB,GACnC,aAAa,CAiBf"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Quick Router Tests
3
+ *
4
+ * Covers:
5
+ * - classifyTask: correctly classifies feature, bugfix, ui-feature, docs, simple, ambiguous
6
+ * - buildStageSequence: returns correct ordered stages for each task type
7
+ * - getNextStage: returns correct next stage and handles completed / blocked states
8
+ * - createQuickRunState: initialises state correctly
9
+ * - /fd-quick routing contracts (supervisor integration points are tested as
10
+ * integration-level expectations on the returned stage sequences)
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=quick-router.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quick-router.test.d.ts","sourceRoot":"","sources":["../../src/services/quick-router.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Supervisor Binding Service
3
+ *
4
+ * Programmatic governance layer that reviews existing commands and agents
5
+ * before execution. It never invents new commands or workflows — it only
6
+ * operates on items already registered in the system.
7
+ *
8
+ * Architecture:
9
+ * Orchestrator → [supervisor review] → proceed / block / escalate
10
+ *
11
+ * The supervisor is strictly read-only with respect to the registry:
12
+ * - It inspects what already exists
13
+ * - It validates policy compliance
14
+ * - It returns a structured decision
15
+ * - It NEVER creates or modifies commands or workflows
16
+ */
17
+ /**
18
+ * The canonical set of registered FlowDeck commands.
19
+ * This list is derived from src/commands/*.md at build time and must NOT
20
+ * be modified by the supervisor under any circumstances.
21
+ */
22
+ export declare const REGISTERED_COMMANDS: readonly string[];
23
+ /**
24
+ * The canonical workflow phases derived from the orchestrator phase state
25
+ * machine. These are the only valid workflow stages in the system.
26
+ */
27
+ export declare const WORKFLOW_PHASES: readonly string[];
28
+ export type SupervisorDecisionKind = "approve" | "revise" | "block" | "escalate";
29
+ export type SupervisorTargetType = "command" | "agent" | "workflow";
30
+ export type SupervisorReviewPhase = "preflight" | "post-stage";
31
+ export interface SupervisorDecision {
32
+ /** Final decision */
33
+ decision: SupervisorDecisionKind;
34
+ /** Type of the reviewed target */
35
+ targetType: SupervisorTargetType;
36
+ /** Name of the reviewed target (exact registered name) */
37
+ targetName: string;
38
+ /** Whether the target actually exists in the registry */
39
+ exists: boolean;
40
+ /** Human-readable reasons for the decision */
41
+ reasons: string[];
42
+ /** Required inputs or stages that are absent */
43
+ missingRequirements: string[];
44
+ /** Risk conditions detected */
45
+ riskFlags: string[];
46
+ /** Changes the caller must make before proceeding (for "revise") */
47
+ requiredChanges: string[];
48
+ /** Approval gate status */
49
+ approvalStatus: "approved" | "pending" | "denied" | "escalated";
50
+ /** 0–1 confidence in the decision */
51
+ confidenceScore: number;
52
+ /** Whether this was a preflight or post-stage review */
53
+ reviewPhase: SupervisorReviewPhase;
54
+ /** ISO timestamp */
55
+ timestamp: string;
56
+ }
57
+ export interface SupervisorContext {
58
+ /** Task description provided by the user or orchestrator */
59
+ taskDescription?: string;
60
+ /** Current workflow phase at the time of review */
61
+ currentPhase?: string;
62
+ /** Whether required inputs have been confirmed present */
63
+ prerequisitesMet?: boolean;
64
+ /** Specific missing inputs */
65
+ missingInputs?: string[];
66
+ /** Whether design approval is present (for UI-heavy tasks) */
67
+ designApprovalPresent?: boolean;
68
+ /** Whether a regression test exists (for bugfix commands) */
69
+ regressionTestPresent?: boolean;
70
+ /** Whether the target requires explicit human approval */
71
+ approvalRequired?: boolean;
72
+ /** Whether human approval was granted */
73
+ approvalGranted?: boolean;
74
+ /** Review phase: before or after execution */
75
+ reviewPhase?: SupervisorReviewPhase;
76
+ /** Run/session IDs for telemetry */
77
+ run_id?: string;
78
+ session_id?: string;
79
+ }
80
+ export interface ResolvedSupervisorConfig {
81
+ enabled: boolean;
82
+ mode: "advisory" | "strict";
83
+ /** Command/agent names to gate; empty array means gate all */
84
+ reviewedTargets: string[];
85
+ canBlock: boolean;
86
+ confidenceThreshold: number;
87
+ postExecutionReview: boolean;
88
+ }
89
+ export declare function resolveSupervisorConfig(directory: string): ResolvedSupervisorConfig;
90
+ export declare function isRegisteredCommand(name: string): boolean;
91
+ export declare function isRegisteredAgent(name: string): boolean;
92
+ export declare function isRegisteredTarget(name: string): {
93
+ exists: boolean;
94
+ type: SupervisorTargetType;
95
+ };
96
+ /**
97
+ * Run a supervisor review on an existing command or agent before execution.
98
+ *
99
+ * Returns a structured SupervisorDecision. In "advisory" mode the caller may
100
+ * proceed even on a "block" decision (it should log the decision). In "strict"
101
+ * mode the caller must honour "block" and "escalate".
102
+ *
103
+ * The supervisor NEVER creates a new command or workflow. If the target does
104
+ * not exist, it returns decision="block" with exists=false and explains that
105
+ * the requested target is not registered.
106
+ */
107
+ export declare function runSupervisorReview(directory: string, targetName: string, ctx?: SupervisorContext): SupervisorDecision;
108
+ /**
109
+ * Shorthand: should execution proceed given a decision and the current config mode?
110
+ * In "advisory" mode, only "block" with a missing-existence check is hard-stopped.
111
+ * In "strict" mode, "block" and "escalate" both halt execution.
112
+ */
113
+ export declare function shouldProceed(decision: SupervisorDecision, mode: "advisory" | "strict", canBlock: boolean): boolean;
114
+ //# sourceMappingURL=supervisor-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor-binding.d.ts","sourceRoot":"","sources":["../../src/services/supervisor-binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAsBvC,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAMnC,CAAA;AAIV,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAA;AAChF,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAA;AACnE,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,YAAY,CAAA;AAE9D,MAAM,WAAW,kBAAkB;IACjC,qBAAqB;IACrB,QAAQ,EAAE,sBAAsB,CAAA;IAChC,kCAAkC;IAClC,UAAU,EAAE,oBAAoB,CAAA;IAChC,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAA;IAClB,yDAAyD;IACzD,MAAM,EAAE,OAAO,CAAA;IACf,8CAA8C;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,gDAAgD;IAChD,mBAAmB,EAAE,MAAM,EAAE,CAAA;IAC7B,+BAA+B;IAC/B,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,oEAAoE;IACpE,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,2BAA2B;IAC3B,cAAc,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;IAC/D,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,wDAAwD;IACxD,WAAW,EAAE,qBAAqB,CAAA;IAClC,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,mDAAmD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A4FpB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,kBAAkB,EAC5B,IAAI,EAAE,UAAU,GAAG,QAAQ,EAC3B,QAAQ,EAAE,OAAO,GAChB,OAAO,CAWT"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Supervisor Binding Tests
3
+ *
4
+ * Covers:
5
+ * - Approves an existing valid command
6
+ * - Blocks an existing command with missing required stage
7
+ * - Blocks a workflow that violates policy
8
+ * - Does not invent new commands or workflows
9
+ * - Integrates with current orchestrator without breaking existing command routing
10
+ * - Only applied to already-registered commands/workflows
11
+ * - Missing command/workflow reported correctly
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=supervisor.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor.test.d.ts","sourceRoot":"","sources":["../../src/services/supervisor.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -1,4 +1,4 @@
1
- export type TelemetryEventType = "command.start" | "command.end" | "tool.call" | "tool.complete" | "agent.dispatch" | "agent.complete" | "approval.request" | "approval.resolve" | "run.complete" | "run.fail" | "policy.violation" | "patch.scored" | "contract.violation" | "agent.span.open" | "agent.span.close" | "budget.warning" | "budget.exhausted" | "deadlock.detected" | "scorecard.generated";
1
+ export type TelemetryEventType = "command.start" | "command.end" | "tool.call" | "tool.complete" | "agent.dispatch" | "agent.complete" | "approval.request" | "approval.resolve" | "run.complete" | "run.fail" | "policy.violation" | "patch.scored" | "contract.violation" | "agent.span.open" | "agent.span.close" | "budget.warning" | "budget.exhausted" | "deadlock.detected" | "scorecard.generated" | "supervisor.review";
2
2
  export interface TelemetryEvent {
3
3
  id: string;
4
4
  ts: string;
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/services/telemetry.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,aAAa,GACb,WAAW,GACX,eAAe,GACf,gBAAgB,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C,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,cAAc,GAAG,IAAI,CAa1G;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,cAAc,EAAE,CAUrE;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,CAE1E;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,SAAM,GAAG,cAAc,EAAE,CAuBxE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,cAAc,EAAE,CAI/E"}
@@ -25,6 +25,12 @@ export interface ScorecardDimensions {
25
25
  handoffQuality: number;
26
26
  /** No agent contract violations */
27
27
  contractCompliance: number;
28
+ /**
29
+ * Supervisor review outcomes: proportion of reviews that resulted in "approve"
30
+ * or "revise" (recoverable), versus "block" or "escalate" (hard stops).
31
+ * Defaults to 1.0 when the supervisor is disabled or no reviews occurred.
32
+ */
33
+ supervisorCompliance: number;
28
34
  }
29
35
  export interface WorkflowScorecard {
30
36
  scorecard_id: string;
@@ -40,6 +46,10 @@ export interface WorkflowScorecard {
40
46
  human_interventions: number;
41
47
  overrides_used: number;
42
48
  deadlock_signals: number;
49
+ /** Total supervisor review events for this run */
50
+ supervisor_reviews: number;
51
+ /** Supervisor reviews that resulted in block or escalate */
52
+ supervisor_hard_stops: number;
43
53
  success_reason?: string;
44
54
  failure_reason?: string;
45
55
  }
@@ -55,6 +65,16 @@ export interface ScorecardInput {
55
65
  policy_violations?: number;
56
66
  human_interventions?: number;
57
67
  overrides_used?: number;
68
+ /**
69
+ * Total supervisor reviews that occurred.
70
+ * Computed automatically from telemetry when omitted.
71
+ */
72
+ supervisor_reviews?: number;
73
+ /**
74
+ * Number of reviews that resulted in "block" or "escalate".
75
+ * Computed automatically from telemetry when omitted.
76
+ */
77
+ supervisor_hard_stops?: number;
58
78
  }
59
79
  export declare function scorecardsPath(dir: string): string;
60
80
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-scorecard.d.ts","sourceRoot":"","sources":["../../src/services/workflow-scorecard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM3C,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAA;IACvB,uDAAuD;IACvD,qBAAqB,EAAE,MAAM,CAAA;IAC7B,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAA;IACrB,oDAAoD;IACpD,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAA;IACrB,iDAAiD;IACjD,eAAe,EAAE,MAAM,CAAA;IACvB,wCAAwC;IACxC,gBAAgB,EAAE,MAAM,CAAA;IACxB,0CAA0C;IAC1C,eAAe,EAAE,MAAM,CAAA;IACvB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAA;IACtB,mCAAmC;IACnC,kBAAk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AAM,GAAG,iBAAiB,GAAG,IAAI,CAEvF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,iBAAiB,EAAE,CAIhG;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIhF"}
package/docs/agents.md CHANGED
@@ -527,7 +527,7 @@ The writer drafts technical documentation that developers will actually read. It
527
527
  **Best for:**
528
528
  - Writing a README.md from scratch for a new project or module
529
529
  - Drafting API reference documentation for newly implemented public functions
530
- - Creating a changelog entry after a release milestone
530
+ - Creating a changelog entry after a release
531
531
  - Writing a code tour or architectural overview document
532
532
 
533
533
  **Example usage:**
@@ -46,6 +46,6 @@ Route a free-form task to the best specialized agent automatically.
46
46
 
47
47
  After `/fd-ask` completes, you can go deeper:
48
48
 
49
- 1. **Full workflow** → `/fd-fix-bug`, `/fd-new-feature`, `/fd-review-code`
49
+ 1. **Full workflow** → `/fd-fix-bug`, `/fd-new-feature`, `/fd-verify`
50
50
  2. **Detailed planning** → `/fd-discuss`, `/fd-plan`
51
51
  3. **Another question** → `/fd-ask --task '...'`
@@ -7,5 +7,5 @@ Run the FlowDeck deploy-check workflow before deploying to production.
7
7
 
8
8
  1. **Fix blocking issues** → `/fd-fix-bug [issue]`
9
9
  2. **Create deployment checkpoint** → `/fd-checkpoint`
10
- 3. **Review code again** → `/fd-review-code`
10
+ 3. **Review code again** → `/fd-verify`
11
11
  4. **View project roadmap** → `/fd-roadmap`
@@ -22,7 +22,7 @@ After discussion completes, choose your next step:
22
22
 
23
23
  1. **Create implementation plan** → `/fd-plan [phase-number]`
24
24
  2. **Continue discussion** → `/fd-discuss [phase-number]`
25
- 3. **Review existing work** → `/fd-review-code`
25
+ 3. **Review existing work** → `/fd-verify`
26
26
  4. **Check project dashboard** → `/fd-dashboard`
27
27
 
28
28
  Type the number or the command to proceed.
@@ -18,7 +18,7 @@ Systematically debug and fix a bug using FlowDeck's structured approach.
18
18
 
19
19
  ## What Next?
20
20
 
21
- 1. **Run code review** → `/fd-review-code`
21
+ 1. **Run code review** → `/fd-verify`
22
22
  2. **Check for more bugs** → `/fd-fix-bug [next-issue]`
23
23
  3. **Update documentation** → `/fd-write-docs`
24
24
  4. **Deploy check** → `/fd-deploy-check`
@@ -19,7 +19,7 @@ Execute a new feature using FlowDeck's multi-agent workflow.
19
19
 
20
20
  ## What Next?
21
21
 
22
- 1. **Review the code** → `/fd-review-code`
22
+ 1. **Review the code** → `/fd-verify`
23
23
  2. **Write documentation** → `/fd-write-docs`
24
24
  3. **Deploy check** → `/fd-deploy-check`
25
25
  4. **Start next feature** → `/fd-new-feature [description]`
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: Review code quality, security, and conventions — runs parallel @reviewer + @security-auditor agents
3
+ argument-hint: "[file-pattern|dir|stage number]"
4
+ ---
5
+
6
+ Run the FlowDeck code review workflow. Reviews can target:
7
+ - **Specific files or directories** — `fd-verify src/services/`
8
+ - **Git staged changes** — `fd-verify staged`
9
+ - **Full project** — `fd-verify`
10
+
11
+ ## What Next?
12
+
13
+ 1. **Fix issues found** → `/fd-fix-bug [issue]`
14
+ 2. **Create deployment checkpoint** → `/fd-checkpoint`
15
+ 3. **Deploy to production** → `/fd-deploy-check`
16
+ 4. **View project dashboard** → `/fd-dashboard`
17
+
18
+ Type the number or command to proceed.
@@ -5,6 +5,6 @@ Run the FlowDeck write-docs workflow to generate accurate project documentation.
5
5
 
6
6
  ## What Next?
7
7
 
8
- 1. **Review documentation** → `/fd-review-code staged`
8
+ 1. **Review documentation** → `/fd-verify staged`
9
9
  2. **Deploy check** → `/fd-deploy-check`
10
10
  3. **Create checkpoint** → `/fd-checkpoint`
package/docs/commands.md CHANGED
@@ -24,7 +24,7 @@ Commands are slash commands registered in OpenCode. Run them by typing `/command
24
24
  | `/fd-multi-repo` | `[list \| add <path> [name] \| remove <name> \| status]` | Multi-repo orchestration |
25
25
  | `/fd-translate-intent` | `[vague intent]` | Convert vague request into ranked implementation options |
26
26
  | `/fd-ask` | `[question]` | Route question to specialist agent (architect, security, etc.) |
27
- | `/fd-quick` | `[task description]` | Quick focused task with automatic agent selection |
27
+ | `/fd-quick` | `[task description]` | Autonomous workflow launcher — classifies task, selects correct workflow, runs all stages end-to-end |
28
28
  | `/fd-doctor` | — | Check FlowDeck installation and environment health |
29
29
 
30
30
  ---
@@ -483,34 +483,54 @@ Comprehensive pre-change analysis: impact radar, blast radius, regression predic
483
483
 
484
484
  ## /fd-quick
485
485
 
486
- **Description:** Execute a focused task without the full workflow. Selects best specialist agent automatically.
486
+ **Description:** Autonomous workflow launcher. Classifies the task, selects the correct existing FlowDeck workflow, and runs all stages end-to-end with minimal user input. Routes all clarifying questions through `@supervisor`.
487
487
 
488
488
  **Arguments:**
489
- - `[task description]` — what you need done
490
-
491
- **Agent Selection Matrix:**
492
-
493
- | Task Type | Agent |
494
- |-----------|-------|
495
- | Backend code | @backend-coder |
496
- | Frontend code | @frontend-coder |
497
- | DevOps/infra code | @devops |
498
- | Explore/understand | @code-explorer |
499
- | Review code | @reviewer |
500
- | Security review | @security-auditor |
501
- | Design/architecture | @architect |
502
- | Write tests | @tester |
503
- | Documentation | @doc-updater |
504
- | Research | @researcher |
505
- | Debug | @debug-specialist |
506
- | Performance | @performance-optimizer |
507
- | Build error | @build-error-resolver |
489
+ - `[task description]` — what you need done (any phrasing — the command classifies it)
490
+
491
+ **Task Classification:**
492
+
493
+ | Classification | Trigger Signals | Stage Sequence |
494
+ |----------------|-----------------|----------------|
495
+ | `feature` | Substantive description, no specific signals | `discuss → plan → execute → verify` |
496
+ | `ui-feature` | landing page, dashboard, admin panel, app screen, ux flow | `discuss → design → plan → execute → verify` |
497
+ | `bugfix` | fix, bug, error, crash, regression, broken, exception | `discuss → fix-bug → verify` |
498
+ | `docs` | docs, documentation, readme, api docs, write docs | `discuss → write-docs → verify` |
499
+ | `simple` | rename, typo, minor, move file | `execute → verify` |
500
+ | `ambiguous` | vague or too short | *supervisor asks one clarifying question* |
501
+
502
+ **What it does:**
503
+ 1. Classifies the task from `$ARGUMENTS` using signal patterns
504
+ 2. Routes ambiguous tasks through `@supervisor` for a single focused clarifying question
505
+ 3. Presents the selected stage sequence to the user
506
+ 4. Executes each stage in order using the existing registered commands (`/fd-discuss`, `/fd-plan`, etc.)
507
+ 5. Gates each stage through `@supervisor` preflight review (approve / revise / block / escalate)
508
+ 6. Respects all workflow discipline: TDD gates, design-first gate for UI tasks, plan CONFIRM gate
509
+ 7. Pauses only when a supervisor gate requires user approval, or when blocked
510
+ 8. Records all routing decisions, stage transitions, and supervisor decisions in STATE.md
511
+ 9. On block: explains exactly what stopped execution and what is needed to resume
512
+
513
+ **What it preserves:**
514
+ - All existing commands (`/fd-discuss`, `/fd-plan`, `/fd-execute`, etc.) remain independently usable
515
+ - TDD enforcement is never bypassed
516
+ - Design-first gate for UI-heavy tasks is enforced
517
+ - Plan CONFIRM gate is always presented to the user
518
+ - Verify pipeline always runs at end
508
519
 
509
520
  **Example:**
510
521
  ```
511
- /fd-quick find where the session token is validated
512
- /fd-quick add rate limiting to the API
522
+ /fd-quick add two-factor authentication to the login system
523
+ /fd-quick fix the checkout crash when cart is empty
524
+ /fd-quick build a new analytics dashboard for admin users
525
+ /fd-quick write API documentation for the user service
526
+ /fd-quick rename MAX_RETRIES constant to RETRY_LIMIT
527
+ ```
528
+
529
+ **Resume after a block:**
530
+ ```
531
+ /fd-quick <original task description>
513
532
  ```
533
+ `/fd-quick` resumes from the last completed stage automatically.
514
534
 
515
535
  ---
516
536
 
@@ -219,7 +219,7 @@ All existing commands continue to work unchanged. New capabilities are additive:
219
219
 
220
220
  - `fd-new-feature` — now uses model router instead of hardcoded models; emits telemetry
221
221
  - `fd-fix-bug` — emits run trace on entry, evaluates policies, proposes new policies from failures
222
- - `fd-review-code` — shows policy violations in output table
222
+ - `fd-verify` — shows policy violations in output table
223
223
  - Dashboard — new operational sections appear only when data exists (no empty-state noise)
224
224
  - Approval hook — only triggers for write operations on sensitive file patterns; safe paths are unaffected
225
225
  - Telemetry — append-only, never read during hook execution, cannot slow down tool calls