@agimon-ai/doompi-major-mode 0.0.1-alpha.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.
Files changed (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -0
  3. package/dist/adapters/pi/extension.cjs +2 -0
  4. package/dist/adapters/pi/extension.cjs.map +1 -0
  5. package/dist/adapters/pi/extension.d.cts +8 -0
  6. package/dist/adapters/pi/extension.d.cts.map +1 -0
  7. package/dist/adapters/pi/extension.d.mts +8 -0
  8. package/dist/adapters/pi/extension.d.mts.map +1 -0
  9. package/dist/adapters/pi/extension.mjs +2 -0
  10. package/dist/adapters/pi/extension.mjs.map +1 -0
  11. package/dist/adapters/pi/voiceTool.cjs +2 -0
  12. package/dist/adapters/pi/voiceTool.cjs.map +1 -0
  13. package/dist/adapters/pi/voiceTool.d.cts +18 -0
  14. package/dist/adapters/pi/voiceTool.d.cts.map +1 -0
  15. package/dist/adapters/pi/voiceTool.d.mts +18 -0
  16. package/dist/adapters/pi/voiceTool.d.mts.map +1 -0
  17. package/dist/adapters/pi/voiceTool.mjs +2 -0
  18. package/dist/adapters/pi/voiceTool.mjs.map +1 -0
  19. package/dist/adapters/telemetry/logSinkTelemetry.cjs +2 -0
  20. package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +1 -0
  21. package/dist/adapters/telemetry/logSinkTelemetry.d.cts +14 -0
  22. package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -0
  23. package/dist/adapters/telemetry/logSinkTelemetry.d.mts +14 -0
  24. package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -0
  25. package/dist/adapters/telemetry/logSinkTelemetry.mjs +2 -0
  26. package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +1 -0
  27. package/dist/commands/majorModeCommand.cjs +2 -0
  28. package/dist/commands/majorModeCommand.cjs.map +1 -0
  29. package/dist/commands/majorModeCommand.d.cts +19 -0
  30. package/dist/commands/majorModeCommand.d.cts.map +1 -0
  31. package/dist/commands/majorModeCommand.d.mts +19 -0
  32. package/dist/commands/majorModeCommand.d.mts.map +1 -0
  33. package/dist/commands/majorModeCommand.mjs +2 -0
  34. package/dist/commands/majorModeCommand.mjs.map +1 -0
  35. package/dist/extensions/pi.cjs +1 -0
  36. package/dist/extensions/pi.d.cts +2 -0
  37. package/dist/extensions/pi.d.mts +2 -0
  38. package/dist/extensions/pi.mjs +1 -0
  39. package/dist/index.cjs +1 -0
  40. package/dist/index.d.cts +11 -0
  41. package/dist/index.d.mts +11 -0
  42. package/dist/index.mjs +1 -0
  43. package/dist/schemas/majorModeVoiceTools.cjs +2 -0
  44. package/dist/schemas/majorModeVoiceTools.cjs.map +1 -0
  45. package/dist/schemas/majorModeVoiceTools.d.cts +30 -0
  46. package/dist/schemas/majorModeVoiceTools.d.cts.map +1 -0
  47. package/dist/schemas/majorModeVoiceTools.d.mts +30 -0
  48. package/dist/schemas/majorModeVoiceTools.d.mts.map +1 -0
  49. package/dist/schemas/majorModeVoiceTools.mjs +2 -0
  50. package/dist/schemas/majorModeVoiceTools.mjs.map +1 -0
  51. package/dist/services/majorModeText.cjs +8 -0
  52. package/dist/services/majorModeText.cjs.map +1 -0
  53. package/dist/services/majorModeText.d.cts +25 -0
  54. package/dist/services/majorModeText.d.cts.map +1 -0
  55. package/dist/services/majorModeText.d.mts +25 -0
  56. package/dist/services/majorModeText.d.mts.map +1 -0
  57. package/dist/services/majorModeText.mjs +8 -0
  58. package/dist/services/majorModeText.mjs.map +1 -0
  59. package/dist/services/pendingSelection.cjs +2 -0
  60. package/dist/services/pendingSelection.cjs.map +1 -0
  61. package/dist/services/pendingSelection.d.cts +18 -0
  62. package/dist/services/pendingSelection.d.cts.map +1 -0
  63. package/dist/services/pendingSelection.d.mts +18 -0
  64. package/dist/services/pendingSelection.d.mts.map +1 -0
  65. package/dist/services/pendingSelection.mjs +2 -0
  66. package/dist/services/pendingSelection.mjs.map +1 -0
  67. package/dist/services/statusLine.cjs +2 -0
  68. package/dist/services/statusLine.cjs.map +1 -0
  69. package/dist/services/statusLine.d.cts +16 -0
  70. package/dist/services/statusLine.d.cts.map +1 -0
  71. package/dist/services/statusLine.d.mts +16 -0
  72. package/dist/services/statusLine.d.mts.map +1 -0
  73. package/dist/services/statusLine.mjs +2 -0
  74. package/dist/services/statusLine.mjs.map +1 -0
  75. package/dist/types/majorMode.cjs +2 -0
  76. package/dist/types/majorMode.cjs.map +1 -0
  77. package/dist/types/majorMode.d.cts +16 -0
  78. package/dist/types/majorMode.d.cts.map +1 -0
  79. package/dist/types/majorMode.d.mts +16 -0
  80. package/dist/types/majorMode.d.mts.map +1 -0
  81. package/dist/types/majorMode.mjs +2 -0
  82. package/dist/types/majorMode.mjs.map +1 -0
  83. package/dist/types/telemetry.cjs +2 -0
  84. package/dist/types/telemetry.cjs.map +1 -0
  85. package/dist/types/telemetry.d.cts +15 -0
  86. package/dist/types/telemetry.d.cts.map +1 -0
  87. package/dist/types/telemetry.d.mts +15 -0
  88. package/dist/types/telemetry.d.mts.map +1 -0
  89. package/dist/types/telemetry.mjs +2 -0
  90. package/dist/types/telemetry.mjs.map +1 -0
  91. package/llms.txt +12 -0
  92. package/package.json +94 -0
  93. package/src/prompts/doompi-author-major-mode/SKILL.md +30 -0
  94. package/src/prompts/doompi-author-major-mode/references/modes-contract.md +152 -0
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: doompi-author-major-mode
3
+ description: Configure DoomPi default packages, layers, extensions, hook groups, and named major modes. Use when creating or editing ~/.pi/.doom/modes.yaml or a repository's .doom/modes.yaml, choosing a default mode, or diagnosing which behavior a mode activates.
4
+ ---
5
+
6
+ # Author DoomPi major modes
7
+
8
+ Use `modes.yaml` only for runtime composition. Major modes choose ordered layers, and layers choose
9
+ Pi extensions, extension packages, and hook groups. Domains configure plugin content and MCP access;
10
+ profiles configure personas and environment defaults.
11
+
12
+ ## Workflow
13
+
14
+ 1. Read both `~/.pi/.doom/modes.yaml` and the repository's `.doom/modes.yaml` when they exist.
15
+ 2. Decide whether the change belongs in the personal defaults or only in the current repository.
16
+ 3. Preserve unrelated definitions and authored array order.
17
+ 4. Put unconditional packages in `default.packages`, reusable behavior in `layers`, and selections
18
+ under `majorMode`.
19
+ 5. Write new modes as mappings with a useful `description` and an ordered `layers` array.
20
+ 6. Put package-owned settings under that package's `config` mapping. Do not add layer-level `config`
21
+ or the removed `targets` field.
22
+ 7. Check the result with `doompi --major-mode <name> --explain`. Use `doompi sync --check` when the
23
+ change affects installed packages or the synchronized matrix.
24
+
25
+ Relative local paths resolve from the repository root for repository configuration and from
26
+ `~/.pi/.doom` for personal configuration. A repository definition replaces a personal definition
27
+ of the same name as a whole value, so never assume nested fields merge.
28
+
29
+ Read [references/modes-contract.md](references/modes-contract.md) before editing package entries,
30
+ local extension paths, hook-only layers, inherited definitions, or tombstones.
@@ -0,0 +1,152 @@
1
+ # DoomPi `modes.yaml` authoring contract
2
+
3
+ ## Purpose and sources
4
+
5
+ `modes.yaml` controls the behavior axis of a DoomPi session:
6
+
7
+ - `default.packages` is the unconditional package baseline.
8
+ - `layers` are reusable ordered bundles of extensions, packages, and hook groups.
9
+ - `majorMode` maps a session mode to an ordered list of layer names.
10
+ - `defaultMajorMode` selects the starting mode when no flag or inherited environment value wins.
11
+
12
+ DoomPi reads `~/.pi/.doom/modes.yaml` first and `<repoRoot>/.doom/modes.yaml` second. Either file may
13
+ stand alone. A missing or empty file contributes nothing.
14
+
15
+ Named `layers` and `majorMode` entries merge by name. A repository entry replaces the complete
16
+ personal entry with the same name. Setting an inherited layer or mode to `null` removes it. The
17
+ top-level `default` block is also replaced as a whole when the repository declares it. An omitted
18
+ repository `default` keeps the personal definition. `defaultMajorMode` uses the last declared value.
19
+
20
+ Relative paths retain the source that declared them:
21
+
22
+ - Personal paths resolve from `~/.pi/.doom`.
23
+ - Repository paths resolve from the repository root, not from `<repoRoot>/.doom`.
24
+
25
+ ## Supported shape
26
+
27
+ ```yaml
28
+ # Optional package baseline loaded before every selected named layer.
29
+ default:
30
+ packages:
31
+ - '@agimon-ai/doompi-help'
32
+ - name: '@scope/optional-extension'
33
+ optional: true
34
+ config:
35
+ policy: concise
36
+
37
+ layers:
38
+ local-review:
39
+ extensions:
40
+ - './extensions/review.ts'
41
+ packages:
42
+ - '@scope/review-extension'
43
+ hookGroups: [repository]
44
+ team:
45
+ packages:
46
+ - name: '@agimon-ai/doompi-team'
47
+ config:
48
+ models:
49
+ - model: provider/model-id
50
+ thinking: high
51
+
52
+ defaultMajorMode: copilot
53
+ majorMode:
54
+ minimal:
55
+ description: Small sessions with delegation only.
56
+ layers: [team]
57
+ copilot:
58
+ description: General coding with delegation and local review policy.
59
+ layers: [team, local-review]
60
+ ```
61
+
62
+ Treat the `default` example as a shape, not as the current distribution package list. Preserve the
63
+ baseline emitted by `doompi init` unless the user explicitly wants to replace it. If neither source
64
+ declares `default`, DoomPi adds no fallback feature package set. `default.packages: []` deliberately
65
+ selects an empty baseline. Fixed core packages remain active independently.
66
+
67
+ ### `default`
68
+
69
+ `default` accepts exactly one field, `packages`, and `packages` must be an array. It does not accept
70
+ `extensions` or `hookGroups`. Its packages activate before packages from selected named layers.
71
+
72
+ ### `layers`
73
+
74
+ Each layer is a mapping with these supported fields:
75
+
76
+ - `extensions`: an array of non-empty strings. A bare name selects a DoomPi built-in extension.
77
+ A `./` or `../` path, or an absolute path, selects a Pi-compatible script or extension directory.
78
+ - `packages`: an array of package strings or package mappings. A normal npm package activates its
79
+ ordered `package.json` `pi.extensions` entries. An exported subpath can select one adapter.
80
+ Path-like packages are supported for local unpublished Pi packages.
81
+ - `hookGroups`: an array of hook group IDs contributed by the layer. Duplicate group IDs are
82
+ removed while retaining first-seen order.
83
+
84
+ A package mapping accepts only:
85
+
86
+ - `name`: required non-empty package specifier or local path.
87
+ - `optional`: optional boolean. A missing optional package is skipped and is not installed.
88
+ - `config`: optional mapping owned and interpreted by that package. Its contents stay opaque to the
89
+ major-mode parser.
90
+
91
+ Required npm packages missing from the active baseline or selected layers can be installed during
92
+ launch. `doompi sync` considers required packages from the baseline and every declared layer.
93
+ Optional packages and local paths are not installed automatically.
94
+
95
+ Package configuration belongs inside its package mapping. Layer-level `config` is rejected because
96
+ there is no unambiguous owner. The removed `targets` field is also rejected. Select a layer by naming
97
+ it from the appropriate major modes.
98
+
99
+ When hooks are disabled for a run, any selected layer with one or more `hookGroups` is suppressed as
100
+ a whole. Its extension and package entries are suppressed too. Keep unrelated packages out of a
101
+ hook-only layer if they must remain active when hooks are off.
102
+
103
+ ### `majorMode` and `defaultMajorMode`
104
+
105
+ New major modes use this mapping form:
106
+
107
+ ```yaml
108
+ majorMode:
109
+ review:
110
+ description: Focused review with repository policy and Team delegation.
111
+ layers: [team, local-review]
112
+ ```
113
+
114
+ `description` must be a non-empty string and `layers` must be an array of non-empty layer names.
115
+ Every referenced layer must survive source merging. Layer order and repeated entries are preserved.
116
+ The array-only compatibility form, such as `review: [team, local-review]`, is accepted and receives a
117
+ generated description, but new configuration should use the mapping form.
118
+
119
+ When `defaultMajorMode` is explicitly configured, it must name a surviving mode. If no source
120
+ declares it, DoomPi uses the compatible `copilot` fallback. Declare an explicit default when the
121
+ available modes do not include `copilot`.
122
+
123
+ ## Safe changes
124
+
125
+ - Add a package to an existing layer when it should follow that layer's activation and ownership.
126
+ - Add a new layer when the behavior should be reusable across multiple modes or independently
127
+ ordered.
128
+ - Add a new mode by composing existing layers, then add new layers only for missing behavior.
129
+ - Use a repository replacement when a shared personal definition is unsuitable for one repository.
130
+ - Use `null` only to remove an inherited named layer or named mode. Do not use it as a package entry
131
+ or as a partial-field deletion mechanism.
132
+ - Keep local paths within trusted, reviewable locations and confirm they resolve from the declaring
133
+ source's base directory.
134
+
135
+ ## Verification
136
+
137
+ Run a read-only resolution before launching:
138
+
139
+ ```sh
140
+ doompi --major-mode review --explain
141
+ ```
142
+
143
+ Confirm the reported major mode, ordered layers, hook groups, and resulting resources. If packages
144
+ or synchronized composition changed, check drift and missing packages without updating artifacts:
145
+
146
+ ```sh
147
+ doompi sync --check
148
+ ```
149
+
150
+ Run `doompi sync` only when the user intends to install packages or refresh synchronized artifacts.
151
+ For repository changes to the parser or templates themselves, run the affected Doom Config and
152
+ DoomPi lint, typecheck, build, and test targets.