pi-matt-pocock 0.1.0 → 0.2.0

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.
package/src/workflow.ts CHANGED
@@ -1,130 +1,82 @@
1
+ import {
2
+ allowedTransitions,
3
+ modelStandaloneCapabilities,
4
+ normalizeProcedureId,
5
+ workflowEntry,
6
+ workflowPlacement,
7
+ workflowRoutes as catalogWorkflowRoutes,
8
+ } from "./catalog.ts";
9
+
10
+ export const WORKFLOW_STATE_ENTRY = "matt-pocock-workflow";
11
+ export const WORKFLOW_STATE_VERSION = 1;
12
+
1
13
  export interface WorkflowState {
14
+ version: 1;
15
+ workItemId: string;
2
16
  route: string;
3
17
  procedure: string;
4
18
  phase: string;
19
+ status: "active";
20
+ loadedReferences: string[];
5
21
  }
6
22
 
7
- export interface WorkflowRoute extends WorkflowState {
8
- label: string;
9
- description: string;
23
+ export interface TerminalWorkflowState {
24
+ version: 1;
25
+ workItemId: string;
26
+ route: string;
27
+ procedure: string;
28
+ phase: string;
29
+ status: "completed" | "cancelled";
30
+ reason?: string;
10
31
  }
11
32
 
12
- export const WORKFLOW_STATE_ENTRY = "matt-pocock-workflow";
13
- export type WorkflowSessionData = WorkflowState | { active: false };
14
-
15
- const routes: WorkflowRoute[] = [
16
- {
17
- route: "idea-to-ship",
18
- label: "Start an idea-to-ship flow",
19
- description: "Shape an idea before planning and implementation.",
20
- procedure: "grill-with-docs",
21
- phase: "shaping",
22
- },
23
- {
24
- route: "hard-bug",
25
- label: "Diagnose a hard bug",
26
- description: "Build a tight feedback loop before forming a theory.",
27
- procedure: "diagnosing-bugs",
28
- phase: "feedback-loop",
29
- },
30
- {
31
- route: "triage",
32
- label: "Triage incoming work",
33
- description: "Turn incoming issues into agent-ready briefs.",
34
- procedure: "triage",
35
- phase: "triage",
36
- },
37
- {
38
- route: "wayfinding",
39
- label: "Map a large ambiguous initiative",
40
- description: "Resolve decision tickets before creating a build plan.",
41
- procedure: "wayfinder",
42
- phase: "mapping",
43
- },
44
- {
45
- route: "architecture",
46
- label: "Improve codebase architecture",
47
- description: "Find and develop deepening opportunities.",
48
- procedure: "improve-codebase-architecture",
49
- phase: "survey",
50
- },
51
- ];
52
-
53
- const phaseProcedures: Record<string, string[]> = {
54
- "idea-to-ship": [
55
- "grill-with-docs",
56
- "grill-me",
57
- "grilling",
58
- "research",
59
- "prototype",
60
- "to-spec",
61
- "to-tickets",
62
- "implement",
63
- "code-review",
64
- "handoff",
65
- ],
66
- "hard-bug": ["diagnosing-bugs", "implement", "code-review"],
67
- triage: ["triage", "to-spec", "to-tickets", "implement", "code-review"],
68
- wayfinding: ["wayfinder", "research", "prototype", "to-spec", "to-tickets", "implement", "code-review"],
69
- architecture: ["improve-codebase-architecture", "codebase-design", "implement", "code-review"],
70
- };
33
+ export type WorkflowSessionData = WorkflowState | TerminalWorkflowState;
34
+
35
+ export type WorkflowRoute = ReturnType<typeof catalogWorkflowRoutes>[number];
71
36
 
72
37
  export function workflowRoutes(): WorkflowRoute[] {
73
- return routes;
38
+ return catalogWorkflowRoutes();
74
39
  }
75
40
 
76
41
  export function findWorkflowRoute(route: string): WorkflowRoute | undefined {
77
- return routes.find((candidate) => candidate.route === route);
42
+ return workflowRoutes().find((candidate) => candidate.route === route);
78
43
  }
79
44
 
80
- export function transitionProcedures(route: string): string[] {
81
- return phaseProcedures[route] ?? [];
45
+ export function routeEntryState(route: string, workItemId: string): WorkflowState | undefined {
46
+ const entry = workflowEntry(route);
47
+ const placement = entry && workflowPlacement(route, entry.id);
48
+ if (!entry || !placement) return undefined;
49
+ return {
50
+ version: WORKFLOW_STATE_VERSION,
51
+ workItemId,
52
+ route,
53
+ procedure: entry.id,
54
+ phase: placement.phase,
55
+ status: "active",
56
+ loadedReferences: [],
57
+ };
82
58
  }
83
59
 
84
- const procedureAliases: Record<string, string> = {
85
- "tight-red-loop": "diagnosing-bugs",
86
- "clarify-goal": "wayfinder",
87
- };
88
-
89
- export function normalizeProcedureName(procedure: string): string {
90
- const normalized = procedure.trim().replace(/\.md$/i, "");
91
- return procedureAliases[normalized] ?? normalized;
92
- }
93
-
94
- export function transitionProcedureOptions(route: string): string[] {
95
- const procedures = new Set(transitionProcedures(route));
96
- for (const [alias, procedure] of Object.entries(procedureAliases)) {
97
- if (procedures.has(procedure)) procedures.add(alias);
60
+ export function transitionState(state: WorkflowState, target: string): WorkflowState {
61
+ const normalized = normalizeProcedureId(target);
62
+ const allowed = allowedTransitions(state.route, state.procedure);
63
+ if (!allowed.includes(normalized)) {
64
+ throw new Error(
65
+ `Cannot transition ${state.route} from ${state.procedure} to ${target}. Allowed next procedures: ${allowed.join(", ") || "none"}. Complete or cancel the workflow if no next procedure applies.`,
66
+ );
98
67
  }
99
- return [...procedures];
100
- }
101
-
102
- const procedurePhases: Record<string, string> = {
103
- "grill-with-docs": "shaping",
104
- "grill-me": "shaping",
105
- grilling: "shaping",
106
- "diagnosing-bugs": "feedback-loop",
107
- wayfinder: "mapping",
108
- };
109
-
110
- export function phaseForProcedure(procedure: string): string {
111
- const norm = normalizeProcedureName(procedure);
112
- return procedurePhases[norm] ?? norm;
68
+ const placement = workflowPlacement(state.route, normalized);
69
+ if (!placement) throw new Error(`Procedure ${normalized} is not part of workflow ${state.route}.`);
70
+ return {
71
+ ...state,
72
+ procedure: normalized,
73
+ phase: placement.phase,
74
+ loadedReferences: [],
75
+ };
113
76
  }
114
77
 
115
- const routeTitles: Record<string, string> = {
116
- "idea-to-ship": "Idea to Ship",
117
- "hard-bug": "Hard Bug Diagnosis",
118
- triage: "Task Triage",
119
- wayfinding: "Architecture Wayfinding",
120
- architecture: "Codebase Architecture",
121
- };
122
-
123
78
  const phaseTitles: Record<string, string> = {
124
79
  shaping: "Shaping & Requirements",
125
- "grill-with-docs": "Shaping & Requirements",
126
- "grill-me": "Shaping & Requirements",
127
- grilling: "Shaping & Requirements",
128
80
  research: "Research & Feasibility",
129
81
  prototype: "Prototyping",
130
82
  "to-spec": "Specification Design",
@@ -133,20 +85,18 @@ const phaseTitles: Record<string, string> = {
133
85
  "code-review": "Code Review",
134
86
  handoff: "Handoff & Summary",
135
87
  "feedback-loop": "Reproducing & Diagnostics",
136
- "diagnosing-bugs": "Reproducing & Diagnostics",
137
88
  mapping: "Initiative Mapping",
138
- wayfinder: "Initiative Mapping",
139
89
  survey: "Architecture Survey",
140
- "improve-codebase-architecture": "Architecture Survey",
141
- "codebase-design": "Architecture Design",
90
+ "design-review": "Architecture Design",
91
+ triage: "Task Triage",
142
92
  };
143
93
 
144
94
  export function readableRouteTitle(route: string): string {
145
- return routeTitles[route] ?? route.replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
95
+ return findWorkflowRoute(route)?.title ?? route.replace(/-/g, " ").replace(/\b\w/g, (character) => character.toUpperCase());
146
96
  }
147
97
 
148
98
  export function readablePhaseTitle(phase: string): string {
149
- return phaseTitles[phase] ?? phase.replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
99
+ return phaseTitles[phase] ?? phase.replace(/-/g, " ").replace(/\b\w/g, (character) => character.toUpperCase());
150
100
  }
151
101
 
152
102
  export function formatReadableWorkflowSubject(route: string, phase: string): string {
@@ -156,37 +106,70 @@ export function formatReadableWorkflowSubject(route: string, phase: string): str
156
106
  export function isWorkflowState(value: unknown): value is WorkflowState {
157
107
  if (!value || typeof value !== "object") return false;
158
108
  const candidate = value as Record<string, unknown>;
159
- return typeof candidate.route === "string"
109
+ return candidate.version === WORKFLOW_STATE_VERSION
110
+ && typeof candidate.workItemId === "string"
111
+ && typeof candidate.route === "string"
160
112
  && typeof candidate.procedure === "string"
161
- && typeof candidate.phase === "string";
113
+ && typeof candidate.phase === "string"
114
+ && candidate.status === "active"
115
+ && Array.isArray(candidate.loadedReferences)
116
+ && candidate.loadedReferences.every((reference) => typeof reference === "string");
162
117
  }
163
118
 
164
- export function latestWorkflowState(entries: unknown[]): WorkflowState | undefined {
119
+ export function isTerminalWorkflowState(value: unknown): value is TerminalWorkflowState {
120
+ if (!value || typeof value !== "object") return false;
121
+ const candidate = value as Record<string, unknown>;
122
+ return candidate.version === WORKFLOW_STATE_VERSION
123
+ && typeof candidate.workItemId === "string"
124
+ && typeof candidate.route === "string"
125
+ && typeof candidate.procedure === "string"
126
+ && typeof candidate.phase === "string"
127
+ && (candidate.status === "completed" || candidate.status === "cancelled");
128
+ }
129
+
130
+ export function latestWorkflowRecord(entries: unknown[]): WorkflowSessionData | undefined {
165
131
  for (let index = entries.length - 1; index >= 0; index -= 1) {
166
132
  const entry = entries[index] as { type?: unknown; customType?: unknown; data?: unknown } | undefined;
167
133
  if (entry?.type !== "custom" || entry.customType !== WORKFLOW_STATE_ENTRY) continue;
168
- if (isWorkflowState(entry.data)) return entry.data;
169
- if ((entry.data as { active?: unknown } | undefined)?.active === false) return undefined;
134
+ if (isWorkflowState(entry.data) || isTerminalWorkflowState(entry.data)) return entry.data;
170
135
  }
171
136
  return undefined;
172
137
  }
173
138
 
174
- export function workflowGuidance(state: WorkflowState): string {
139
+ export function latestWorkflowState(entries: unknown[]): WorkflowState | undefined {
140
+ const record = latestWorkflowRecord(entries);
141
+ return record?.status === "active" ? record : undefined;
142
+ }
143
+
144
+ export function workflowGuidance(state: WorkflowState, availableReferences: string[]): string {
145
+ const next = allowedTransitions(state.route, state.procedure);
175
146
  return `Matt Pocock workflow active: ${state.route} · ${state.phase}.
176
- Follow the loaded ${state.procedure} procedure. Proceed autonomously from established context: do not stop to recommend, ask whether to continue, or request redundant confirmation. When the procedure's done condition is met and the next applicable procedure is clear, call matt_pocock_workflow to transition immediately, then execute it. Continue through every newly unblocked AFK ticket or task; choose the next frontier ticket yourself when the user did not name one. Ask only for a genuinely user-owned decision, a fact unavailable through exploration, or a required external action. When asking interview or decision questions (e.g. during grilling/shaping), use the matt_pocock_ask tool to present structured options with recommendations, timeout, and custom response support. Do not treat a procedure summary, closed decision ticket, or phase boundary as a reason to wait for the user.`;
147
+ Work item: ${state.workItemId}. Follow the loaded ${state.procedure} procedure. Use matt_pocock_active to transition only to: ${next.join(", ") || "none"}; load an available reference; complete the work; or cancel it with a reason. Available references: ${availableReferences.join(", ") || "none"}. Exact shapes: {"action": "transition", "target": "<allowedNext id>"}; {"action": "load", "reference": "<availableReferences id>"}; {"action": "complete"}; {"action": "cancel", "reason": "<why>"}. Proceed autonomously through non-user-owned work: once the current procedure's deliverables or decisions are ready, transition to the next applicable procedure via matt_pocock_active immediately without stopping to ask permission. Ask only for a genuinely user-owned decision, unavailable fact, or required external action. Use matt_pocock_ask for structured workflow decisions. Complete only after the integrated candidate has applicable verification and all blocking reviews have returned with findings resolved; a completed review assignment is not itself a PASS verdict. Evidence must match that candidate. If only required results remain outstanding, yield with the workflow still active rather than declaring completion. Once these conditions hold, call matt_pocock_active with action complete instead of leaving stale active state.`;
177
148
  }
178
149
 
179
150
  export function availableWorkflowsGuidance(): string {
180
- return `## Available Engineering Workflows (Matt Pocock)
181
-
182
- Use matt_pocock_workflow only after you have determined that the current request needs one of these structured, multi-step engineering workflows. Do not activate it for routine work, document creation, research or testing performed through another loaded skill, simple questions, or because a previous session happened to use a workflow.
183
-
184
- Activate it when relevant:
185
- - idea-to-ship: Complex features and multi-step implementations (shaping → spec → tickets → implement → review).
186
- - hard-bug: Difficult, intermittent, or regressed bugs (build tight red loop before forming a theory).
187
- - triage: Incoming issues and raw requests that need converting into agent-ready briefs.
188
- - wayfinding: Large, ambiguous engineering efforts requiring decision tickets before a build plan.
189
- - architecture: Codebase refactoring and deepening opportunities.
190
-
191
- A workflow remains active only for the deliberate engineering task that started it. When that task is finished or the user changes to unrelated work, call /matt-pocock end before proceeding.`;
151
+ const workflows = workflowRoutes()
152
+ .map((route) => `- ${route.route}: ${route.description}`)
153
+ .join("\n");
154
+ const capabilities = modelStandaloneCapabilities()
155
+ .map((capability) => `- ${capability.id}: ${capability.description}`)
156
+ .join("\n");
157
+ return `## Available Matt Pocock Workflows and Capabilities
158
+
159
+ Use matt_pocock_workflow for structured engineering workflows or a listed standalone capability. Do not activate a workflow for routine work that another loaded skill already owns.
160
+
161
+ When a user request matches a multi-step engineering task, proactively activate the structured workflow:
162
+ - New feature, requirement, or end-to-end initiative: start idea-to-ship.
163
+ - Reproducing, diagnosing, or fixing a hard or non-trivial bug: start hard-bug.
164
+ - Exploring and restructuring codebase architecture or deepening shallow modules: start architecture.
165
+ - Charting ambiguous initiatives with decision tickets: start wayfinding.
166
+ - Categorizing and triaging issue tracker tickets: start triage.
167
+
168
+ Workflows:
169
+ ${workflows}
170
+
171
+ Model-reachable standalone capabilities:
172
+ ${capabilities}
173
+
174
+ Workflow state is deliberate and task-scoped. When relevant, start a workflow first with matt_pocock_workflow (mode: "workflow"); the started workflow carries its procedure and next-step guidance.`;
192
175
  }
@@ -0,0 +1,49 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "repository": "mattpocock/skills",
4
+ "comparedCommit": "6654f6b60cd9d5be8b54c6fafe44346dabeb3b76",
5
+ "comparisonTag": "v1.2.3",
6
+ "resolvedTagCommit": "6acc160e4e0cd062dbbbd7a1b26ae92855edf07e",
7
+ "latestCheckedCommit": "3cca18b368ae95cdbdebbff572ccafa662551015",
8
+ "selected": [
9
+ { "upstreamSkill": "code-review", "upstreamPath": "skills/engineering/code-review/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "code-review", "localResource": "procedures/code-review.md" },
10
+ { "upstreamSkill": "codebase-design", "upstreamPath": "skills/engineering/codebase-design/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "codebase-design", "localResource": "procedures/codebase-design.md" },
11
+ { "upstreamSkill": "diagnosing-bugs", "upstreamPath": "skills/engineering/diagnosing-bugs/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "diagnosing-bugs", "localResource": "procedures/diagnosing-bugs.md" },
12
+ { "upstreamSkill": "domain-modeling", "upstreamPath": "skills/engineering/domain-modeling/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "domain-modeling", "localResource": "procedures/domain-modeling.md" },
13
+ { "upstreamSkill": "grill-with-docs", "upstreamPath": "skills/engineering/grill-with-docs/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "grill-with-docs", "localResource": "procedures/grill-with-docs.md" },
14
+ { "upstreamSkill": "implement", "upstreamPath": "skills/engineering/implement/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "implement", "localResource": "procedures/implement.md" },
15
+ { "upstreamSkill": "improve-codebase-architecture", "upstreamPath": "skills/engineering/improve-codebase-architecture/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "improve-codebase-architecture", "localResource": "procedures/improve-codebase-architecture.md" },
16
+ { "upstreamSkill": "prototype", "upstreamPath": "skills/engineering/prototype/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "prototype", "localResource": "procedures/prototype.md" },
17
+ { "upstreamSkill": "research", "upstreamPath": "skills/engineering/research/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "research", "localResource": "procedures/research.md" },
18
+ { "upstreamSkill": "resolving-merge-conflicts", "upstreamPath": "skills/engineering/resolving-merge-conflicts/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "resolving-merge-conflicts", "localResource": "procedures/resolving-merge-conflicts.md" },
19
+ { "upstreamSkill": "setup-matt-pocock-skills", "upstreamPath": "skills/engineering/setup-matt-pocock-skills/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "setup-matt-pocock-skills", "localResource": "procedures/setup-matt-pocock-skills.md" },
20
+ { "upstreamSkill": "tdd", "upstreamPath": "skills/engineering/tdd/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "tdd", "localResource": "procedures/tdd.md" },
21
+ { "upstreamSkill": "to-spec", "upstreamPath": "skills/engineering/to-spec/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "to-spec", "localResource": "procedures/to-spec.md" },
22
+ { "upstreamSkill": "to-tickets", "upstreamPath": "skills/engineering/to-tickets/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "to-tickets", "localResource": "procedures/to-tickets.md" },
23
+ { "upstreamSkill": "triage", "upstreamPath": "skills/engineering/triage/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "triage", "localResource": "procedures/triage.md" },
24
+ { "upstreamSkill": "wayfinder", "upstreamPath": "skills/engineering/wayfinder/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "wayfinder", "localResource": "procedures/wayfinder.md" },
25
+ { "upstreamSkill": "wizard", "upstreamPath": "skills/engineering/wizard/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "wizard", "localResource": "procedures/wizard.md" },
26
+ { "upstreamSkill": "grill-me", "upstreamPath": "skills/productivity/grill-me/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "grill-me", "localResource": "procedures/grill-me.md" },
27
+ { "upstreamSkill": "grilling", "upstreamPath": "skills/productivity/grilling/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "grilling", "localResource": "procedures/grilling.md" },
28
+ { "upstreamSkill": "handoff", "upstreamPath": "skills/productivity/handoff/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "handoff", "localResource": "procedures/handoff.md" },
29
+ { "upstreamSkill": "teach", "upstreamPath": "skills/productivity/teach/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "teach", "localResource": "procedures/teach.md" },
30
+ { "upstreamSkill": "to-questionnaire", "upstreamPath": "skills/productivity/to-questionnaire/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "to-questionnaire", "localResource": "procedures/to-questionnaire.md" },
31
+ { "upstreamSkill": "wait-what", "upstreamPath": "skills/productivity/wait-what/SKILL.md", "upstreamInvocation": "user", "localCatalogId": "wait-what", "localResource": "procedures/wait-what.md" },
32
+ { "upstreamSkill": "writing-for-agents", "upstreamPath": "skills/productivity/writing-for-agents/SKILL.md", "upstreamInvocation": "model", "localCatalogId": "writing-for-agents", "localResource": "procedures/writing-for-agents.md" }
33
+ ],
34
+ "excluded": [
35
+ { "upstreamSkill": "ask-matt", "upstreamPath": "skills/engineering/ask-matt/SKILL.md", "reason": "Replaced by the single /matt-pocock Pi command and its catalog-backed routing gateway." },
36
+ { "upstreamSkill": "claude-handoff", "upstreamPath": "skills/in-progress/claude-handoff/SKILL.md", "reason": "Host-specific: launches Claude Code background agents and duplicates the selected host-neutral handoff capability." },
37
+ { "upstreamSkill": "implement-spec", "upstreamPath": "skills/in-progress/implement-spec/SKILL.md", "reason": "Experimental duplicate of the selected implement capability; the local workflow catalog supplies the sequencing contract." },
38
+ { "upstreamSkill": "loop-me", "upstreamPath": "skills/in-progress/loop-me/SKILL.md", "reason": "Experimental stateful Claude skill composition is superseded by the persisted Pi workflow harness." },
39
+ { "upstreamSkill": "retro", "upstreamPath": "skills/in-progress/retro/SKILL.md", "reason": "Experimental capability is outside the approved promoted engineering and productivity catalog." },
40
+ { "upstreamSkill": "setup-ts-deep-modules", "upstreamPath": "skills/in-progress/setup-ts-deep-modules/SKILL.md", "reason": "Experimental TypeScript-specific setup is narrower than the selected host-neutral codebase-design procedure." },
41
+ { "upstreamSkill": "writing-beats", "upstreamPath": "skills/in-progress/writing-beats/SKILL.md", "reason": "Experimental editorial workflow is outside this package's engineering workflow scope." },
42
+ { "upstreamSkill": "writing-fragments", "upstreamPath": "skills/in-progress/writing-fragments/SKILL.md", "reason": "Experimental editorial workflow is outside this package's engineering workflow scope." },
43
+ { "upstreamSkill": "writing-shape", "upstreamPath": "skills/in-progress/writing-shape/SKILL.md", "reason": "Experimental editorial workflow is outside this package's engineering workflow scope." },
44
+ { "upstreamSkill": "git-guardrails-claude-code", "upstreamPath": "skills/misc/git-guardrails-claude-code/SKILL.md", "reason": "Host-specific: configures Claude Code PreToolUse hooks; Pi uses its own tool hooks and git-agent guidance." },
45
+ { "upstreamSkill": "migrate-to-shoehorn", "upstreamPath": "skills/misc/migrate-to-shoehorn/SKILL.md", "reason": "Project-specific migration for @total-typescript/shoehorn, not a general workflow capability." },
46
+ { "upstreamSkill": "scaffold-exercises", "upstreamPath": "skills/misc/scaffold-exercises/SKILL.md", "reason": "Project-specific course scaffolding and raw git commit instructions conflict with local git-agent policy." },
47
+ { "upstreamSkill": "setup-pre-commit", "upstreamPath": "skills/misc/setup-pre-commit/SKILL.md", "reason": "Stack-specific Husky, lint-staged, and Prettier setup conflicts with host-project-selected tooling." }
48
+ ]
49
+ }
package/src/procedures.ts DELETED
@@ -1,33 +0,0 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { fileURLToPath } from "node:url";
3
-
4
- const procedureDirectory = fileURLToPath(new URL("../procedures/", import.meta.url));
5
-
6
- export function procedurePath(procedure: string): string {
7
- const normalized = procedure.trim().replace(/\.md$/i, "");
8
- if (!/^[a-zA-Z0-9-]+$/.test(normalized)) {
9
- throw new Error(`Unknown Matt Pocock procedure: ${procedure}`);
10
- }
11
- const exactPath = `${procedureDirectory}${normalized}.md`;
12
- if (existsSync(exactPath)) {
13
- return exactPath;
14
- }
15
- const lowerPath = `${procedureDirectory}${normalized.toLowerCase()}.md`;
16
- if (existsSync(lowerPath)) {
17
- return lowerPath;
18
- }
19
- throw new Error(`Procedure file not found for ${procedure}`);
20
- }
21
-
22
- export function loadProcedure(procedure: string): string {
23
- return readFileSync(procedurePath(procedure), "utf8");
24
- }
25
-
26
- export function procedurePrompt(route: string, procedure: string, phase: string): string {
27
- return `# Matt Pocock workflow procedure
28
-
29
- Route: ${route}
30
- Phase: ${phase}
31
-
32
- ${loadProcedure(procedure)}`;
33
- }