pi-matt-pocock 0.2.2 → 0.3.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/ARCHITECTURE.zh-CN.md +37 -19
- package/README.md +80 -13
- package/package.json +12 -7
- package/procedures/code-review.md +25 -17
- package/procedures/codebase-design.md +11 -10
- package/procedures/deslop.md +4 -2
- package/procedures/diagnosing-bugs.md +25 -25
- package/procedures/domain-modeling.md +18 -20
- package/procedures/grill-me.md +1 -1
- package/procedures/grill-with-docs.md +1 -1
- package/procedures/grilling.md +29 -5
- package/procedures/handoff.md +1 -1
- package/procedures/implement.md +7 -1
- package/procedures/improve-codebase-architecture.md +22 -22
- package/procedures/pr.md +169 -0
- package/procedures/prototype.md +7 -6
- package/procedures/research.md +2 -2
- package/procedures/retro.md +42 -0
- package/procedures/setup-matt-pocock-skills.md +26 -22
- package/procedures/tdd.md +17 -15
- package/procedures/teach.md +11 -7
- package/procedures/to-questionnaire.md +7 -5
- package/procedures/to-spec.md +2 -2
- package/procedures/to-tickets.md +12 -12
- package/procedures/triage.md +22 -22
- package/procedures/wait-what.md +1 -1
- package/procedures/wayfinder.md +24 -24
- package/procedures/wizard.md +7 -7
- package/procedures/writing-for-agents.md +14 -14
- package/{procedures → references}/ADR-FORMAT.md +11 -11
- package/{procedures → references}/AGENT-BRIEF.md +4 -4
- package/{procedures → references}/DEEPENING.md +3 -3
- package/{procedures → references}/DESIGN-IT-TWICE.md +7 -7
- package/{procedures → references}/GLOSSARY-FORMAT.md +9 -2
- package/{procedures → references}/HTML-REPORT.md +15 -15
- package/{procedures → references}/LEARNING-RECORD-FORMAT.md +10 -10
- package/{procedures → references}/LOGIC.md +5 -5
- package/{procedures → references}/MISSION-FORMAT.md +2 -2
- package/{procedures → references}/OUT-OF-SCOPE.md +11 -11
- package/{procedures → references}/RESOURCES-FORMAT.md +1 -1
- package/{procedures → references}/SKILL-MECHANICS.md +3 -3
- package/{procedures → references}/UI.md +14 -14
- package/{procedures → references}/bdd-best-practices.md +3 -3
- package/{procedures → references}/bdd.md +9 -9
- package/{procedures → references}/domain.md +12 -12
- package/references/issue-tracker-github.md +50 -0
- package/{procedures → references}/issue-tracker-gitlab.md +9 -9
- package/{procedures → references}/issue-tracker-local.md +3 -3
- package/{procedures → references}/phase-boundaries.md +8 -8
- package/src/catalog.json +49 -28
- package/src/catalog.ts +58 -2
- package/src/index.ts +521 -383
- package/src/native-dialog.ts +149 -213
- package/src/resolver.ts +30 -14
- package/src/workflow.ts +55 -16
- package/upstream/UPSTREAM.md +116 -0
- package/{scripts → upstream}/check-upstream-sync.mjs +12 -12
- package/{upstream-selection.json → upstream/upstream-selection.json} +9 -7
- package/UPSTREAM.md +0 -63
- package/procedures/CONTEXT-FORMAT.md +0 -60
- package/procedures/issue-tracker-github.md +0 -45
- /package/{procedures → assets}/hitl-loop.template.sh +0 -0
- /package/{procedures → assets}/template.sh +0 -0
- /package/{procedures → references}/GLOSSARY.md +0 -0
- /package/{procedures → references}/gherkin-guide.md +0 -0
- /package/{procedures → references}/mocking.md +0 -0
- /package/{procedures → references}/testing-anti-patterns.md +0 -0
- /package/{procedures → references}/tests.md +0 -0
- /package/{procedures → references}/triage-labels.md +0 -0
- /package/{procedures → references}/writing-great-skills.md +0 -0
package/src/catalog.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"kind": "workflow",
|
|
36
36
|
"invocation": "user",
|
|
37
37
|
"label": "Grill Me",
|
|
38
|
+
"description": "Interview the user relentlessly, one decision at a time, until you share one understanding. Use when the user says grill me.",
|
|
38
39
|
"standalone": true,
|
|
39
40
|
"requires": [
|
|
40
41
|
"grilling"
|
|
@@ -324,6 +325,7 @@
|
|
|
324
325
|
"kind": "workflow",
|
|
325
326
|
"invocation": "user",
|
|
326
327
|
"label": "Handoff",
|
|
328
|
+
"description": "Write a handoff document that another agent or person can pick up cold.",
|
|
327
329
|
"standalone": true,
|
|
328
330
|
"discloses": [
|
|
329
331
|
"phase-boundaries"
|
|
@@ -337,6 +339,27 @@
|
|
|
337
339
|
}
|
|
338
340
|
]
|
|
339
341
|
},
|
|
342
|
+
{
|
|
343
|
+
"id": "pr",
|
|
344
|
+
"file": "pr.md",
|
|
345
|
+
"kind": "utility",
|
|
346
|
+
"invocation": "model",
|
|
347
|
+
"label": "Pull Request Body",
|
|
348
|
+
"description": "Write a PR body with summary, evidence, and merge risk.",
|
|
349
|
+
"standalone": true
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"id": "retro",
|
|
353
|
+
"file": "retro.md",
|
|
354
|
+
"kind": "utility",
|
|
355
|
+
"invocation": "user",
|
|
356
|
+
"label": "Session Retrospective",
|
|
357
|
+
"description": "Review a coding session and propose improvements to the agent environment.",
|
|
358
|
+
"standalone": true,
|
|
359
|
+
"requires": [
|
|
360
|
+
"writing-for-agents"
|
|
361
|
+
]
|
|
362
|
+
},
|
|
340
363
|
{
|
|
341
364
|
"id": "diagnosing-bugs",
|
|
342
365
|
"file": "diagnosing-bugs.md",
|
|
@@ -349,6 +372,7 @@
|
|
|
349
372
|
],
|
|
350
373
|
"standalone": true,
|
|
351
374
|
"discloses": [
|
|
375
|
+
"hitl-loop.template.sh",
|
|
352
376
|
"improve-codebase-architecture"
|
|
353
377
|
],
|
|
354
378
|
"workflows": [
|
|
@@ -435,6 +459,7 @@
|
|
|
435
459
|
"kind": "workflow",
|
|
436
460
|
"invocation": "user",
|
|
437
461
|
"label": "Improve Codebase Architecture",
|
|
462
|
+
"description": "Find and rank architecture deepening opportunities, then improve the strongest one.",
|
|
438
463
|
"standalone": true,
|
|
439
464
|
"requires": [
|
|
440
465
|
"codebase-design"
|
|
@@ -593,10 +618,10 @@
|
|
|
593
618
|
"kind": "utility",
|
|
594
619
|
"invocation": "model",
|
|
595
620
|
"label": "Domain Modeling",
|
|
596
|
-
"description": "Build or sharpen project terminology,
|
|
621
|
+
"description": "Build or sharpen project terminology, GLOSSARY.md, and architectural decisions.",
|
|
597
622
|
"standalone": true,
|
|
598
623
|
"discloses": [
|
|
599
|
-
"
|
|
624
|
+
"GLOSSARY-FORMAT",
|
|
600
625
|
"ADR-FORMAT"
|
|
601
626
|
]
|
|
602
627
|
},
|
|
@@ -605,7 +630,7 @@
|
|
|
605
630
|
"file": "tdd.md",
|
|
606
631
|
"kind": "utility",
|
|
607
632
|
"invocation": "model",
|
|
608
|
-
"label": "
|
|
633
|
+
"label": "TDD",
|
|
609
634
|
"description": "Run the BDD-driven red-green automation loop through public seams.",
|
|
610
635
|
"standalone": true,
|
|
611
636
|
"requires": [
|
|
@@ -623,21 +648,21 @@
|
|
|
623
648
|
"file": "ADR-FORMAT.md",
|
|
624
649
|
"kind": "reference",
|
|
625
650
|
"invocation": "internal",
|
|
626
|
-
"label": "ADR
|
|
651
|
+
"label": "ADR Format"
|
|
627
652
|
},
|
|
628
653
|
{
|
|
629
654
|
"id": "AGENT-BRIEF",
|
|
630
655
|
"file": "AGENT-BRIEF.md",
|
|
631
656
|
"kind": "reference",
|
|
632
657
|
"invocation": "internal",
|
|
633
|
-
"label": "
|
|
658
|
+
"label": "Agent Brief"
|
|
634
659
|
},
|
|
635
660
|
{
|
|
636
661
|
"id": "bdd-best-practices",
|
|
637
662
|
"file": "bdd-best-practices.md",
|
|
638
663
|
"kind": "reference",
|
|
639
664
|
"invocation": "internal",
|
|
640
|
-
"label": "
|
|
665
|
+
"label": "BDD Best Practices",
|
|
641
666
|
"discloses": [
|
|
642
667
|
"gherkin-guide",
|
|
643
668
|
"bdd",
|
|
@@ -651,26 +676,19 @@
|
|
|
651
676
|
"file": "bdd.md",
|
|
652
677
|
"kind": "reference",
|
|
653
678
|
"invocation": "internal",
|
|
654
|
-
"label": "
|
|
679
|
+
"label": "BDD",
|
|
655
680
|
"discloses": [
|
|
656
681
|
"bdd-best-practices",
|
|
657
682
|
"tdd",
|
|
658
683
|
"code-review"
|
|
659
684
|
]
|
|
660
685
|
},
|
|
661
|
-
{
|
|
662
|
-
"id": "CONTEXT-FORMAT",
|
|
663
|
-
"file": "CONTEXT-FORMAT.md",
|
|
664
|
-
"kind": "reference",
|
|
665
|
-
"invocation": "internal",
|
|
666
|
-
"label": "CONTEXT FORMAT"
|
|
667
|
-
},
|
|
668
686
|
{
|
|
669
687
|
"id": "DEEPENING",
|
|
670
688
|
"file": "DEEPENING.md",
|
|
671
689
|
"kind": "reference",
|
|
672
690
|
"invocation": "internal",
|
|
673
|
-
"label": "
|
|
691
|
+
"label": "Deepening",
|
|
674
692
|
"discloses": [
|
|
675
693
|
"codebase-design"
|
|
676
694
|
]
|
|
@@ -680,7 +698,7 @@
|
|
|
680
698
|
"file": "DESIGN-IT-TWICE.md",
|
|
681
699
|
"kind": "reference",
|
|
682
700
|
"invocation": "internal",
|
|
683
|
-
"label": "
|
|
701
|
+
"label": "Design It Twice",
|
|
684
702
|
"discloses": [
|
|
685
703
|
"codebase-design",
|
|
686
704
|
"DEEPENING"
|
|
@@ -708,16 +726,19 @@
|
|
|
708
726
|
{
|
|
709
727
|
"id": "GLOSSARY-FORMAT",
|
|
710
728
|
"file": "GLOSSARY-FORMAT.md",
|
|
729
|
+
"aliases": [
|
|
730
|
+
"CONTEXT-FORMAT"
|
|
731
|
+
],
|
|
711
732
|
"kind": "reference",
|
|
712
733
|
"invocation": "internal",
|
|
713
|
-
"label": "
|
|
734
|
+
"label": "Glossary Format"
|
|
714
735
|
},
|
|
715
736
|
{
|
|
716
737
|
"id": "GLOSSARY",
|
|
717
738
|
"file": "GLOSSARY.md",
|
|
718
739
|
"kind": "reference",
|
|
719
740
|
"invocation": "internal",
|
|
720
|
-
"label": "
|
|
741
|
+
"label": "Glossary",
|
|
721
742
|
"discloses": [
|
|
722
743
|
"writing-great-skills"
|
|
723
744
|
]
|
|
@@ -727,7 +748,7 @@
|
|
|
727
748
|
"file": "HTML-REPORT.md",
|
|
728
749
|
"kind": "reference",
|
|
729
750
|
"invocation": "internal",
|
|
730
|
-
"label": "HTML
|
|
751
|
+
"label": "HTML Report",
|
|
731
752
|
"discloses": [
|
|
732
753
|
"codebase-design"
|
|
733
754
|
]
|
|
@@ -737,7 +758,7 @@
|
|
|
737
758
|
"file": "issue-tracker-github.md",
|
|
738
759
|
"kind": "reference",
|
|
739
760
|
"invocation": "internal",
|
|
740
|
-
"label": "Issue Tracker
|
|
761
|
+
"label": "Issue Tracker GitHub",
|
|
741
762
|
"discloses": [
|
|
742
763
|
"triage",
|
|
743
764
|
"wayfinder"
|
|
@@ -748,7 +769,7 @@
|
|
|
748
769
|
"file": "issue-tracker-gitlab.md",
|
|
749
770
|
"kind": "reference",
|
|
750
771
|
"invocation": "internal",
|
|
751
|
-
"label": "Issue Tracker
|
|
772
|
+
"label": "Issue Tracker GitLab",
|
|
752
773
|
"discloses": [
|
|
753
774
|
"triage",
|
|
754
775
|
"wayfinder"
|
|
@@ -769,7 +790,7 @@
|
|
|
769
790
|
"file": "LEARNING-RECORD-FORMAT.md",
|
|
770
791
|
"kind": "reference",
|
|
771
792
|
"invocation": "internal",
|
|
772
|
-
"label": "
|
|
793
|
+
"label": "Learning Record Format",
|
|
773
794
|
"discloses": [
|
|
774
795
|
"GLOSSARY-FORMAT"
|
|
775
796
|
]
|
|
@@ -779,7 +800,7 @@
|
|
|
779
800
|
"file": "LOGIC.md",
|
|
780
801
|
"kind": "reference",
|
|
781
802
|
"invocation": "internal",
|
|
782
|
-
"label": "
|
|
803
|
+
"label": "Logic",
|
|
783
804
|
"discloses": [
|
|
784
805
|
"UI",
|
|
785
806
|
"prototype"
|
|
@@ -790,7 +811,7 @@
|
|
|
790
811
|
"file": "MISSION-FORMAT.md",
|
|
791
812
|
"kind": "reference",
|
|
792
813
|
"invocation": "internal",
|
|
793
|
-
"label": "
|
|
814
|
+
"label": "Mission Format"
|
|
794
815
|
},
|
|
795
816
|
{
|
|
796
817
|
"id": "mocking",
|
|
@@ -804,7 +825,7 @@
|
|
|
804
825
|
"file": "OUT-OF-SCOPE.md",
|
|
805
826
|
"kind": "reference",
|
|
806
827
|
"invocation": "internal",
|
|
807
|
-
"label": "
|
|
828
|
+
"label": "Out of Scope"
|
|
808
829
|
},
|
|
809
830
|
{
|
|
810
831
|
"id": "phase-boundaries",
|
|
@@ -821,7 +842,7 @@
|
|
|
821
842
|
"file": "RESOURCES-FORMAT.md",
|
|
822
843
|
"kind": "reference",
|
|
823
844
|
"invocation": "internal",
|
|
824
|
-
"label": "
|
|
845
|
+
"label": "Resources Format",
|
|
825
846
|
"discloses": [
|
|
826
847
|
"teach"
|
|
827
848
|
]
|
|
@@ -831,7 +852,7 @@
|
|
|
831
852
|
"file": "SKILL-MECHANICS.md",
|
|
832
853
|
"kind": "reference",
|
|
833
854
|
"invocation": "internal",
|
|
834
|
-
"label": "
|
|
855
|
+
"label": "Skill Mechanics",
|
|
835
856
|
"discloses": [
|
|
836
857
|
"writing-for-agents"
|
|
837
858
|
]
|
|
@@ -883,7 +904,7 @@
|
|
|
883
904
|
"file": "hitl-loop.template.sh",
|
|
884
905
|
"kind": "asset",
|
|
885
906
|
"invocation": "internal",
|
|
886
|
-
"label": "
|
|
907
|
+
"label": "HITL Loop Template"
|
|
887
908
|
},
|
|
888
909
|
{
|
|
889
910
|
"id": "template",
|
package/src/catalog.ts
CHANGED
|
@@ -28,12 +28,30 @@ export interface ProcedureDefinition {
|
|
|
28
28
|
workflows?: WorkflowPlacement[];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
/** The catalogue's own kinds decide where a resource lives; nothing else may. */
|
|
32
|
+
const resourceDirectories: Record<ProcedureKind, string> = {
|
|
33
|
+
workflow: "procedures/",
|
|
34
|
+
utility: "procedures/",
|
|
35
|
+
reference: "references/",
|
|
36
|
+
asset: "assets/",
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const packageDirectory = fileURLToPath(new URL("../", import.meta.url));
|
|
32
40
|
const catalogPath = fileURLToPath(new URL("./catalog.json", import.meta.url));
|
|
33
41
|
|
|
34
42
|
export const procedureCatalog = JSON.parse(readFileSync(catalogPath, "utf8")) as ProcedureDefinition[];
|
|
35
43
|
const definitionsById = new Map(procedureCatalog.map((definition) => [definition.id, definition]));
|
|
36
44
|
|
|
45
|
+
/** Absolute path of one catalogue resource, derived from its kind. */
|
|
46
|
+
export function resourcePath(definition: ProcedureDefinition): string {
|
|
47
|
+
return `${packageDirectory}${resourceDirectories[definition.kind]}${definition.file}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Absolute directory holding every resource of one kind, so a reader can list them. */
|
|
51
|
+
export function resourceDirectory(kind: ProcedureKind): string {
|
|
52
|
+
return `${packageDirectory}${resourceDirectories[kind]}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
37
55
|
export function catalogFiles(): string[] {
|
|
38
56
|
return procedureCatalog.map((definition) => definition.file);
|
|
39
57
|
}
|
|
@@ -97,6 +115,13 @@ export function modelStandaloneCapabilities(): ProcedureDefinition[] {
|
|
|
97
115
|
return standaloneCapabilities().filter((definition) => definition.invocation === "model");
|
|
98
116
|
}
|
|
99
117
|
|
|
118
|
+
/** Standalone capabilities the user starts by name. They stay out of capability mode
|
|
119
|
+
* so the model never picks one on its own, but the gateway still exposes them so an
|
|
120
|
+
* explicit request ("grill me") reaches the package instead of an improvised method. */
|
|
121
|
+
export function userStandaloneCapabilities(): ProcedureDefinition[] {
|
|
122
|
+
return standaloneCapabilities().filter((definition) => definition.invocation === "user");
|
|
123
|
+
}
|
|
124
|
+
|
|
100
125
|
export function validateProcedureCatalog(): string[] {
|
|
101
126
|
const errors: string[] = [];
|
|
102
127
|
const ids = new Set<string>();
|
|
@@ -108,7 +133,7 @@ export function validateProcedureCatalog(): string[] {
|
|
|
108
133
|
ids.add(definition.id);
|
|
109
134
|
files.add(definition.file);
|
|
110
135
|
|
|
111
|
-
if (!existsSync(
|
|
136
|
+
if (!existsSync(resourcePath(definition))) {
|
|
112
137
|
errors.push(`${definition.id}: file not found: ${definition.file}`);
|
|
113
138
|
}
|
|
114
139
|
for (const dependency of [...(definition.requires ?? []), ...(definition.discloses ?? [])]) {
|
|
@@ -124,6 +149,37 @@ export function validateProcedureCatalog(): string[] {
|
|
|
124
149
|
}
|
|
125
150
|
}
|
|
126
151
|
|
|
152
|
+
const aliases = new Map<string, string>();
|
|
153
|
+
for (const definition of procedureCatalog) {
|
|
154
|
+
for (const alias of definition.aliases ?? []) {
|
|
155
|
+
if (ids.has(alias) || aliases.has(alias)) errors.push(`${definition.id}: conflicting alias: ${alias}`);
|
|
156
|
+
aliases.set(alias, definition.id);
|
|
157
|
+
}
|
|
158
|
+
const placements = new Set<string>();
|
|
159
|
+
for (const placement of definition.workflows ?? []) {
|
|
160
|
+
if (placements.has(placement.route)) errors.push(`${definition.id}: duplicate placement for ${placement.route}`);
|
|
161
|
+
placements.add(placement.route);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const visiting = new Set<string>();
|
|
166
|
+
const visited = new Set<string>();
|
|
167
|
+
const visit = (definition: ProcedureDefinition): void => {
|
|
168
|
+
if (visiting.has(definition.id)) {
|
|
169
|
+
errors.push(`${definition.id}: required dependency cycle`);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (visited.has(definition.id)) return;
|
|
173
|
+
visiting.add(definition.id);
|
|
174
|
+
for (const id of definition.requires ?? []) {
|
|
175
|
+
const dependency = findProcedure(id);
|
|
176
|
+
if (dependency) visit(dependency);
|
|
177
|
+
}
|
|
178
|
+
visiting.delete(definition.id);
|
|
179
|
+
visited.add(definition.id);
|
|
180
|
+
};
|
|
181
|
+
for (const definition of procedureCatalog) visit(definition);
|
|
182
|
+
|
|
127
183
|
const routes = new Map<string, WorkflowPlacement[]>();
|
|
128
184
|
for (const definition of procedureCatalog) {
|
|
129
185
|
for (const workflow of definition.workflows ?? []) {
|