specweave 0.3.13 → 0.4.1

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 (168) hide show
  1. package/CLAUDE.md +506 -17
  2. package/README.md +100 -58
  3. package/bin/install-all.sh +9 -2
  4. package/bin/install-hooks.sh +57 -0
  5. package/bin/specweave.js +16 -0
  6. package/dist/adapters/adapter-base.d.ts +21 -0
  7. package/dist/adapters/adapter-base.d.ts.map +1 -1
  8. package/dist/adapters/adapter-base.js +28 -0
  9. package/dist/adapters/adapter-base.js.map +1 -1
  10. package/dist/adapters/adapter-interface.d.ts +41 -0
  11. package/dist/adapters/adapter-interface.d.ts.map +1 -1
  12. package/dist/adapters/claude/adapter.d.ts +36 -0
  13. package/dist/adapters/claude/adapter.d.ts.map +1 -1
  14. package/dist/adapters/claude/adapter.js +135 -0
  15. package/dist/adapters/claude/adapter.js.map +1 -1
  16. package/dist/adapters/copilot/adapter.d.ts +25 -0
  17. package/dist/adapters/copilot/adapter.d.ts.map +1 -1
  18. package/dist/adapters/copilot/adapter.js +112 -0
  19. package/dist/adapters/copilot/adapter.js.map +1 -1
  20. package/dist/adapters/cursor/adapter.d.ts +36 -0
  21. package/dist/adapters/cursor/adapter.d.ts.map +1 -1
  22. package/dist/adapters/cursor/adapter.js +140 -0
  23. package/dist/adapters/cursor/adapter.js.map +1 -1
  24. package/dist/adapters/generic/adapter.d.ts +25 -0
  25. package/dist/adapters/generic/adapter.d.ts.map +1 -1
  26. package/dist/adapters/generic/adapter.js +111 -0
  27. package/dist/adapters/generic/adapter.js.map +1 -1
  28. package/dist/cli/commands/init.d.ts.map +1 -1
  29. package/dist/cli/commands/init.js +103 -1
  30. package/dist/cli/commands/init.js.map +1 -1
  31. package/dist/cli/commands/plugin.d.ts +37 -0
  32. package/dist/cli/commands/plugin.d.ts.map +1 -0
  33. package/dist/cli/commands/plugin.js +296 -0
  34. package/dist/cli/commands/plugin.js.map +1 -0
  35. package/dist/core/agent-model-manager.d.ts +52 -0
  36. package/dist/core/agent-model-manager.d.ts.map +1 -0
  37. package/dist/core/agent-model-manager.js +120 -0
  38. package/dist/core/agent-model-manager.js.map +1 -0
  39. package/dist/core/cost-tracker.d.ts +108 -0
  40. package/dist/core/cost-tracker.d.ts.map +1 -0
  41. package/dist/core/cost-tracker.js +281 -0
  42. package/dist/core/cost-tracker.js.map +1 -0
  43. package/dist/core/model-selector.d.ts +57 -0
  44. package/dist/core/model-selector.d.ts.map +1 -0
  45. package/dist/core/model-selector.js +115 -0
  46. package/dist/core/model-selector.js.map +1 -0
  47. package/dist/core/phase-detector.d.ts +62 -0
  48. package/dist/core/phase-detector.d.ts.map +1 -0
  49. package/dist/core/phase-detector.js +229 -0
  50. package/dist/core/phase-detector.js.map +1 -0
  51. package/dist/core/plugin-detector.d.ts +96 -0
  52. package/dist/core/plugin-detector.d.ts.map +1 -0
  53. package/dist/core/plugin-detector.js +349 -0
  54. package/dist/core/plugin-detector.js.map +1 -0
  55. package/dist/core/plugin-loader.d.ts +111 -0
  56. package/dist/core/plugin-loader.d.ts.map +1 -0
  57. package/dist/core/plugin-loader.js +319 -0
  58. package/dist/core/plugin-loader.js.map +1 -0
  59. package/dist/core/plugin-manager.d.ts +144 -0
  60. package/dist/core/plugin-manager.d.ts.map +1 -0
  61. package/dist/core/plugin-manager.js +393 -0
  62. package/dist/core/plugin-manager.js.map +1 -0
  63. package/dist/core/schemas/plugin-manifest.schema.json +253 -0
  64. package/dist/core/types/plugin.d.ts +252 -0
  65. package/dist/core/types/plugin.d.ts.map +1 -0
  66. package/dist/core/types/plugin.js +48 -0
  67. package/dist/core/types/plugin.js.map +1 -0
  68. package/dist/integrations/jira/jira-mapper.d.ts +2 -2
  69. package/dist/integrations/jira/jira-mapper.js +2 -2
  70. package/dist/types/cost-tracking.d.ts +43 -0
  71. package/dist/types/cost-tracking.d.ts.map +1 -0
  72. package/dist/types/cost-tracking.js +8 -0
  73. package/dist/types/cost-tracking.js.map +1 -0
  74. package/dist/types/model-selection.d.ts +53 -0
  75. package/dist/types/model-selection.d.ts.map +1 -0
  76. package/dist/types/model-selection.js +12 -0
  77. package/dist/types/model-selection.js.map +1 -0
  78. package/dist/utils/cost-reporter.d.ts +58 -0
  79. package/dist/utils/cost-reporter.d.ts.map +1 -0
  80. package/dist/utils/cost-reporter.js +224 -0
  81. package/dist/utils/cost-reporter.js.map +1 -0
  82. package/dist/utils/pricing-constants.d.ts +70 -0
  83. package/dist/utils/pricing-constants.d.ts.map +1 -0
  84. package/dist/utils/pricing-constants.js +71 -0
  85. package/dist/utils/pricing-constants.js.map +1 -0
  86. package/package.json +13 -9
  87. package/src/adapters/adapter-base.ts +33 -0
  88. package/src/adapters/adapter-interface.ts +46 -0
  89. package/src/adapters/claude/adapter.ts +164 -0
  90. package/src/adapters/copilot/adapter.ts +138 -0
  91. package/src/adapters/cursor/adapter.ts +170 -0
  92. package/src/adapters/generic/adapter.ts +137 -0
  93. package/src/agents/architect/AGENT.md +3 -0
  94. package/src/agents/code-reviewer.md +156 -0
  95. package/src/agents/data-scientist/AGENT.md +181 -0
  96. package/src/agents/database-optimizer/AGENT.md +147 -0
  97. package/src/agents/devops/AGENT.md +3 -0
  98. package/src/agents/diagrams-architect/AGENT.md +3 -0
  99. package/src/agents/docs-writer/AGENT.md +3 -0
  100. package/src/agents/kubernetes-architect/AGENT.md +142 -0
  101. package/src/agents/ml-engineer/AGENT.md +150 -0
  102. package/src/agents/mlops-engineer/AGENT.md +201 -0
  103. package/src/agents/network-engineer/AGENT.md +149 -0
  104. package/src/agents/observability-engineer/AGENT.md +213 -0
  105. package/src/agents/payment-integration/AGENT.md +35 -0
  106. package/src/agents/performance/AGENT.md +3 -0
  107. package/src/agents/performance-engineer/AGENT.md +153 -0
  108. package/src/agents/pm/AGENT.md +3 -0
  109. package/src/agents/qa-lead/AGENT.md +3 -0
  110. package/src/agents/security/AGENT.md +3 -0
  111. package/src/agents/sre/AGENT.md +3 -0
  112. package/src/agents/tdd-orchestrator/AGENT.md +169 -0
  113. package/src/agents/tech-lead/AGENT.md +3 -0
  114. package/src/commands/specweave.costs.md +261 -0
  115. package/src/commands/specweave.increment.md +48 -4
  116. package/src/commands/specweave.ml-pipeline.md +292 -0
  117. package/src/commands/specweave.monitor-setup.md +501 -0
  118. package/src/commands/specweave.slo-implement.md +1055 -0
  119. package/src/commands/specweave.sync-github.md +1 -1
  120. package/src/commands/specweave.tdd-cycle.md +199 -0
  121. package/src/commands/specweave.tdd-green.md +842 -0
  122. package/src/commands/specweave.tdd-red.md +135 -0
  123. package/src/commands/specweave.tdd-refactor.md +165 -0
  124. package/src/hooks/post-increment-plugin-detect.sh +142 -0
  125. package/src/hooks/post-task-completion.sh +53 -11
  126. package/src/hooks/pre-task-plugin-detect.sh +96 -0
  127. package/src/skills/SKILLS-INDEX.md +18 -10
  128. package/src/skills/billing-automation/SKILL.md +559 -0
  129. package/src/skills/distributed-tracing/SKILL.md +438 -0
  130. package/src/skills/e2e-playwright/README.md +1 -1
  131. package/src/skills/e2e-playwright/package.json +1 -1
  132. package/src/skills/gitops-workflow/SKILL.md +285 -0
  133. package/src/skills/gitops-workflow/references/argocd-setup.md +134 -0
  134. package/src/skills/gitops-workflow/references/sync-policies.md +131 -0
  135. package/src/skills/grafana-dashboards/SKILL.md +369 -0
  136. package/src/skills/helm-chart-scaffolding/SKILL.md +544 -0
  137. package/src/skills/helm-chart-scaffolding/assets/Chart.yaml.template +42 -0
  138. package/src/skills/helm-chart-scaffolding/assets/values.yaml.template +185 -0
  139. package/src/skills/helm-chart-scaffolding/references/chart-structure.md +500 -0
  140. package/src/skills/helm-chart-scaffolding/scripts/validate-chart.sh +244 -0
  141. package/src/skills/k8s-manifest-generator/SKILL.md +511 -0
  142. package/src/skills/k8s-manifest-generator/assets/configmap-template.yaml +296 -0
  143. package/src/skills/k8s-manifest-generator/assets/deployment-template.yaml +203 -0
  144. package/src/skills/k8s-manifest-generator/assets/service-template.yaml +171 -0
  145. package/src/skills/k8s-manifest-generator/references/deployment-spec.md +753 -0
  146. package/src/skills/k8s-manifest-generator/references/service-spec.md +724 -0
  147. package/src/skills/k8s-security-policies/SKILL.md +334 -0
  148. package/src/skills/k8s-security-policies/assets/network-policy-template.yaml +177 -0
  149. package/src/skills/k8s-security-policies/references/rbac-patterns.md +187 -0
  150. package/src/skills/ml-pipeline-workflow/SKILL.md +245 -0
  151. package/src/skills/paypal-integration/SKILL.md +467 -0
  152. package/src/skills/pci-compliance/SKILL.md +466 -0
  153. package/src/skills/prometheus-configuration/SKILL.md +392 -0
  154. package/src/skills/slo-implementation/SKILL.md +329 -0
  155. package/src/skills/stripe-integration/SKILL.md +442 -0
  156. package/src/skills/tdd-workflow/SKILL.md +378 -0
  157. package/src/templates/README.md.template +1 -1
  158. package/src/skills/bmad-method-expert/SKILL.md +0 -626
  159. package/src/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
  160. package/src/skills/bmad-method-expert/scripts/check-setup.js +0 -208
  161. package/src/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
  162. package/src/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
  163. package/src/skills/context-optimizer/SKILL.md +0 -588
  164. package/src/skills/figma-designer/SKILL.md +0 -149
  165. package/src/skills/figma-implementer/SKILL.md +0 -148
  166. package/src/skills/figma-mcp-connector/SKILL.md +0 -136
  167. package/src/skills/figma-to-code/SKILL.md +0 -128
  168. package/src/skills/spec-kit-expert/SKILL.md +0 -1010
@@ -0,0 +1,252 @@
1
+ /**
2
+ * Plugin System Type Definitions
3
+ *
4
+ * Defines interfaces and types for the SpecWeave plugin architecture.
5
+ * Plugins are modular, domain-specific extensions that enhance SpecWeave's capabilities.
6
+ *
7
+ * @module core/types/plugin
8
+ * @version 0.4.0
9
+ */
10
+ /**
11
+ * Plugin Manifest - Metadata describing a plugin
12
+ *
13
+ * Loaded from .claude-plugin/manifest.json in each plugin directory.
14
+ * Follows JSON Schema defined in src/core/schemas/plugin-manifest.schema.json
15
+ */
16
+ export interface PluginManifest {
17
+ /** Unique plugin name (must start with 'specweave-') */
18
+ name: string;
19
+ /** Semantic version (e.g., "1.0.0") */
20
+ version: string;
21
+ /** Human-readable description (max 1024 chars) */
22
+ description: string;
23
+ /** Plugin author */
24
+ author?: string;
25
+ /** License identifier (e.g., "MIT", "Apache-2.0") */
26
+ license?: string;
27
+ /** Required SpecWeave core version (e.g., ">=0.4.0") */
28
+ specweave_core_version: string;
29
+ /** Plugin dependencies */
30
+ dependencies?: {
31
+ /** Other plugins this plugin requires */
32
+ plugins?: string[];
33
+ };
34
+ /** Auto-detection rules for suggesting this plugin */
35
+ auto_detect?: {
36
+ /** File/directory patterns to detect (e.g., "kubernetes/", ".git/") */
37
+ files?: string[];
38
+ /** NPM package dependencies to detect */
39
+ packages?: string[];
40
+ /** Environment variables to detect */
41
+ env_vars?: string[];
42
+ /** Git remote pattern (e.g., "github\\.com") */
43
+ git_remote_pattern?: string;
44
+ };
45
+ /** What this plugin provides */
46
+ provides: {
47
+ /** Skill names provided by this plugin */
48
+ skills: string[];
49
+ /** Agent names provided by this plugin */
50
+ agents: string[];
51
+ /** Command names provided by this plugin */
52
+ commands: string[];
53
+ };
54
+ /** Keywords that trigger plugin suggestions in specs/tasks */
55
+ triggers?: string[];
56
+ /** Attribution for forked/borrowed plugins */
57
+ credits?: {
58
+ /** Upstream source URL if forked */
59
+ based_on?: string | null;
60
+ /** Original author name */
61
+ original_author?: string;
62
+ /** List of contributors */
63
+ contributors?: string[];
64
+ /** Modifications made for SpecWeave */
65
+ modifications?: string[];
66
+ };
67
+ }
68
+ /**
69
+ * Skill - Auto-activating capability
70
+ */
71
+ export interface Skill {
72
+ /** Skill name (unique within plugin) */
73
+ name: string;
74
+ /** Path to SKILL.md file */
75
+ path: string;
76
+ /** Description from SKILL.md frontmatter */
77
+ description: string;
78
+ /** Test cases for this skill */
79
+ testCases?: TestCase[];
80
+ }
81
+ /**
82
+ * Agent - Specialized role with isolated context
83
+ */
84
+ export interface Agent {
85
+ /** Agent name (unique within plugin) */
86
+ name: string;
87
+ /** Path to AGENT.md file */
88
+ path: string;
89
+ /** System prompt from AGENT.md */
90
+ systemPrompt: string;
91
+ /** Agent capabilities */
92
+ capabilities: string[];
93
+ }
94
+ /**
95
+ * Command - Slash command (e.g., /specweave.github.sync)
96
+ */
97
+ export interface Command {
98
+ /** Command name (e.g., "github-sync") */
99
+ name: string;
100
+ /** Path to command.md file */
101
+ path: string;
102
+ /** Description of what the command does */
103
+ description: string;
104
+ /** Command prompt/template */
105
+ prompt: string;
106
+ }
107
+ /**
108
+ * Test Case - YAML-based test case for skills
109
+ */
110
+ export interface TestCase {
111
+ /** Test case ID (e.g., "TC-001") */
112
+ id: string;
113
+ /** Test description */
114
+ description: string;
115
+ /** Input for the skill */
116
+ input: string;
117
+ /** Expected output pattern */
118
+ expected: string;
119
+ /** Path to test case file */
120
+ path: string;
121
+ }
122
+ /**
123
+ * Plugin - Complete plugin with all components loaded
124
+ */
125
+ export interface Plugin {
126
+ /** Plugin manifest (metadata) */
127
+ manifest: PluginManifest;
128
+ /** Absolute path to plugin directory */
129
+ path: string;
130
+ /** Skills provided by this plugin */
131
+ skills: Skill[];
132
+ /** Agents provided by this plugin */
133
+ agents: Agent[];
134
+ /** Commands provided by this plugin */
135
+ commands: Command[];
136
+ }
137
+ /**
138
+ * Plugin Info - Lightweight plugin metadata (for listing)
139
+ */
140
+ export interface PluginInfo {
141
+ /** Plugin name */
142
+ name: string;
143
+ /** Plugin version */
144
+ version: string;
145
+ /** Description */
146
+ description: string;
147
+ /** Path to plugin directory */
148
+ path: string;
149
+ /** Is this plugin currently enabled? */
150
+ enabled: boolean;
151
+ /** Skill count */
152
+ skillCount: number;
153
+ /** Agent count */
154
+ agentCount: number;
155
+ /** Command count */
156
+ commandCount: number;
157
+ }
158
+ /**
159
+ * Validation Result - Result of manifest validation
160
+ */
161
+ export interface ValidationResult {
162
+ /** Is the manifest valid? */
163
+ valid: boolean;
164
+ /** Validation errors (if any) */
165
+ errors: string[];
166
+ /** Warnings (non-fatal issues) */
167
+ warnings: string[];
168
+ }
169
+ /**
170
+ * Detection Result - Result of plugin auto-detection
171
+ */
172
+ export interface DetectionResult {
173
+ /** Detected plugin name */
174
+ pluginName: string;
175
+ /** Detection confidence (0-1) */
176
+ confidence: number;
177
+ /** Reason for detection */
178
+ reason: string;
179
+ /** What triggered detection (file, package, env var, etc.) */
180
+ trigger: string;
181
+ }
182
+ /**
183
+ * Plugin Config - User's plugin configuration
184
+ *
185
+ * Stored in .specweave/config.yaml
186
+ */
187
+ export interface PluginConfig {
188
+ /** List of enabled plugin names */
189
+ enabled: string[];
190
+ /** Plugin-specific settings */
191
+ settings?: {
192
+ [pluginName: string]: Record<string, any>;
193
+ };
194
+ }
195
+ /**
196
+ * Plugin Load Options - Options for loading a plugin
197
+ */
198
+ export interface PluginLoadOptions {
199
+ /** Force reload even if already loaded */
200
+ force?: boolean;
201
+ /** Skip dependency checking */
202
+ skipDependencies?: boolean;
203
+ /** Validate plugin integrity */
204
+ validate?: boolean;
205
+ }
206
+ /**
207
+ * Plugin Unload Options - Options for unloading a plugin
208
+ */
209
+ export interface PluginUnloadOptions {
210
+ /** Remove plugin files (vs. just marking as disabled) */
211
+ remove?: boolean;
212
+ /** Force unload even if other plugins depend on it */
213
+ force?: boolean;
214
+ }
215
+ /**
216
+ * Plugin Dependency - Dependency information
217
+ */
218
+ export interface PluginDependency {
219
+ /** Plugin name */
220
+ name: string;
221
+ /** Version requirement (e.g., ">=1.0.0") */
222
+ version?: string;
223
+ /** Is this dependency optional? */
224
+ optional?: boolean;
225
+ }
226
+ /**
227
+ * Plugin Error - Custom error for plugin operations
228
+ */
229
+ export declare class PluginError extends Error {
230
+ pluginName?: string | undefined;
231
+ code?: string | undefined;
232
+ constructor(message: string, pluginName?: string | undefined, code?: string | undefined);
233
+ }
234
+ /**
235
+ * Plugin Manifest Validation Error
236
+ */
237
+ export declare class ManifestValidationError extends PluginError {
238
+ constructor(message: string, pluginName?: string);
239
+ }
240
+ /**
241
+ * Plugin Not Found Error
242
+ */
243
+ export declare class PluginNotFoundError extends PluginError {
244
+ constructor(pluginName: string);
245
+ }
246
+ /**
247
+ * Plugin Dependency Error
248
+ */
249
+ export declare class PluginDependencyError extends PluginError {
250
+ constructor(message: string, pluginName?: string);
251
+ }
252
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/core/types/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IAEb,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IAEpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,wDAAwD;IACxD,sBAAsB,EAAE,MAAM,CAAC;IAE/B,0BAA0B;IAC1B,YAAY,CAAC,EAAE;QACb,yCAAyC;QACzC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IAEF,sDAAsD;IACtD,WAAW,CAAC,EAAE;QACZ,uEAAuE;QACvE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAEjB,yCAAyC;QACzC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAEpB,sCAAsC;QACtC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAEpB,gDAAgD;QAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;IAEF,gCAAgC;IAChC,QAAQ,EAAE;QACR,0CAA0C;QAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;QAEjB,0CAA0C;QAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;QAEjB,4CAA4C;QAC5C,QAAQ,EAAE,MAAM,EAAE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MAAM;CAIjD"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Plugin System Type Definitions
3
+ *
4
+ * Defines interfaces and types for the SpecWeave plugin architecture.
5
+ * Plugins are modular, domain-specific extensions that enhance SpecWeave's capabilities.
6
+ *
7
+ * @module core/types/plugin
8
+ * @version 0.4.0
9
+ */
10
+ /**
11
+ * Plugin Error - Custom error for plugin operations
12
+ */
13
+ export class PluginError extends Error {
14
+ constructor(message, pluginName, code) {
15
+ super(message);
16
+ this.pluginName = pluginName;
17
+ this.code = code;
18
+ this.name = 'PluginError';
19
+ }
20
+ }
21
+ /**
22
+ * Plugin Manifest Validation Error
23
+ */
24
+ export class ManifestValidationError extends PluginError {
25
+ constructor(message, pluginName) {
26
+ super(message, pluginName, 'MANIFEST_INVALID');
27
+ this.name = 'ManifestValidationError';
28
+ }
29
+ }
30
+ /**
31
+ * Plugin Not Found Error
32
+ */
33
+ export class PluginNotFoundError extends PluginError {
34
+ constructor(pluginName) {
35
+ super(`Plugin '${pluginName}' not found`, pluginName, 'PLUGIN_NOT_FOUND');
36
+ this.name = 'PluginNotFoundError';
37
+ }
38
+ }
39
+ /**
40
+ * Plugin Dependency Error
41
+ */
42
+ export class PluginDependencyError extends PluginError {
43
+ constructor(message, pluginName) {
44
+ super(message, pluginName, 'DEPENDENCY_ERROR');
45
+ this.name = 'PluginDependencyError';
46
+ }
47
+ }
48
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/core/types/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA4RH;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YACE,OAAe,EACR,UAAmB,EACnB,IAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,eAAU,GAAV,UAAU,CAAS;QACnB,SAAI,GAAJ,IAAI,CAAS;QAGpB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,WAAW;IACtD,YAAY,OAAe,EAAE,UAAmB;QAC9C,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD,YAAY,UAAkB;QAC5B,KAAK,CAAC,WAAW,UAAU,aAAa,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IACpD,YAAY,OAAe,EAAE,UAAmB;QAC9C,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF"}
@@ -8,8 +8,8 @@
8
8
  *
9
9
  * Syncs with:
10
10
  * - .specweave/increments/{id}/ - Increment folder
11
- * - .specweave/docs/rfcs/ - RFC documents for detailed specs
12
- * - .specweave/docs/decisions/ - Architecture decisions (ADRs)
11
+ * - .specweave/docs/internal/architecture/rfc/ - RFC documents for detailed specs
12
+ * - .specweave/docs/internal/architecture/adr/ - Architecture decisions (ADRs)
13
13
  */
14
14
  import { JiraClient } from './jira-client';
15
15
  export interface SpecWeaveIncrement {
@@ -8,8 +8,8 @@
8
8
  *
9
9
  * Syncs with:
10
10
  * - .specweave/increments/{id}/ - Increment folder
11
- * - .specweave/docs/rfcs/ - RFC documents for detailed specs
12
- * - .specweave/docs/decisions/ - Architecture decisions (ADRs)
11
+ * - .specweave/docs/internal/architecture/rfc/ - RFC documents for detailed specs
12
+ * - .specweave/docs/internal/architecture/adr/ - Architecture decisions (ADRs)
13
13
  */
14
14
  import * as fs from 'fs';
15
15
  import * as path from 'path';
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Type definitions for Cost Tracking system
3
+ *
4
+ * Tracks token usage and costs per session, agent, model, and increment.
5
+ * Calculates savings vs all-Sonnet baseline.
6
+ */
7
+ import type { Model } from './model-selection';
8
+ /**
9
+ * Token usage for a single session
10
+ */
11
+ export interface TokenUsage {
12
+ inputTokens: number;
13
+ outputTokens: number;
14
+ totalTokens: number;
15
+ }
16
+ /**
17
+ * Single cost tracking session (one agent invocation)
18
+ */
19
+ export interface CostSession {
20
+ sessionId: string;
21
+ agent: string;
22
+ model: Exclude<Model, 'auto'>;
23
+ increment?: string;
24
+ command?: string;
25
+ startedAt: string;
26
+ endedAt?: string;
27
+ tokenUsage: TokenUsage;
28
+ cost: number;
29
+ savings: number;
30
+ }
31
+ /**
32
+ * Cost report for an entire increment
33
+ */
34
+ export interface IncrementCostReport {
35
+ incrementId: string;
36
+ totalCost: number;
37
+ totalSavings: number;
38
+ totalTokens: number;
39
+ sessionCount: number;
40
+ costByModel: Record<string, number>;
41
+ costByAgent: Record<string, number>;
42
+ }
43
+ //# sourceMappingURL=cost-tracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cost-tracking.d.ts","sourceRoot":"","sources":["../../src/types/cost-tracking.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Type definitions for Cost Tracking system
3
+ *
4
+ * Tracks token usage and costs per session, agent, model, and increment.
5
+ * Calculates savings vs all-Sonnet baseline.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=cost-tracking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cost-tracking.js","sourceRoot":"","sources":["../../src/types/cost-tracking.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Type definitions for the Intelligent Model Selection system
3
+ *
4
+ * This system automatically routes work to the optimal AI model based on:
5
+ * - Agent preferences (planning vs execution agents)
6
+ * - Phase detection (planning vs execution vs review)
7
+ * - User overrides (manual model selection)
8
+ *
9
+ * Achieves 60-70% cost savings by using Haiku for execution, Sonnet for planning.
10
+ */
11
+ /**
12
+ * Available AI models
13
+ * - sonnet: Latest Sonnet 4.5 (planning, complex analysis)
14
+ * - haiku: Latest Haiku 4.5 (execution, simple tasks)
15
+ * - opus: Latest Opus (rare, critical decisions)
16
+ * - auto: System decides based on context
17
+ */
18
+ export type Model = 'sonnet' | 'haiku' | 'opus' | 'auto';
19
+ /**
20
+ * Work phases for phase detection
21
+ */
22
+ export type Phase = 'planning' | 'execution' | 'review';
23
+ /**
24
+ * Cost profiles for agents
25
+ */
26
+ export type CostProfile = 'planning' | 'execution' | 'hybrid';
27
+ /**
28
+ * Fallback behavior when preferred model fails
29
+ */
30
+ export type FallbackBehavior = 'strict' | 'flexible' | 'auto';
31
+ /**
32
+ * Agent model preference loaded from AGENT.md frontmatter
33
+ */
34
+ export interface AgentModelPreference {
35
+ agent: string;
36
+ preference: Model;
37
+ profile: CostProfile;
38
+ fallback: FallbackBehavior;
39
+ }
40
+ /**
41
+ * Model selection decision with reasoning
42
+ */
43
+ export interface ModelSelectionDecision {
44
+ model: Exclude<Model, 'auto'>;
45
+ reason: 'user_override' | 'agent_preference' | 'phase_detection' | 'low_confidence_default' | 'cost_policy' | 'fallback';
46
+ confidence?: number;
47
+ reasoning: string;
48
+ alternatives?: Array<{
49
+ model: Model;
50
+ score: number;
51
+ }>;
52
+ }
53
+ //# sourceMappingURL=model-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-selection.d.ts","sourceRoot":"","sources":["../../src/types/model-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,MAAM,EAAE,eAAe,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,wBAAwB,GAAG,aAAa,GAAG,UAAU,CAAC;IACzH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACvD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Type definitions for the Intelligent Model Selection system
3
+ *
4
+ * This system automatically routes work to the optimal AI model based on:
5
+ * - Agent preferences (planning vs execution agents)
6
+ * - Phase detection (planning vs execution vs review)
7
+ * - User overrides (manual model selection)
8
+ *
9
+ * Achieves 60-70% cost savings by using Haiku for execution, Sonnet for planning.
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=model-selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-selection.js","sourceRoot":"","sources":["../../src/types/model-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Cost Report Generation
3
+ *
4
+ * Generates human-readable cost reports with multiple export formats:
5
+ * - JSON (machine-readable)
6
+ * - CSV (spreadsheet import)
7
+ * - ASCII Dashboard (CLI display)
8
+ */
9
+ import type { CostTracker } from '../core/cost-tracker';
10
+ import type { IncrementCostReport } from '../types/cost-tracking';
11
+ export declare class CostReporter {
12
+ private costTracker;
13
+ constructor(costTracker: CostTracker);
14
+ /**
15
+ * Generate cost report for a specific increment
16
+ *
17
+ * @param incrementId - Increment ID (e.g., '0003')
18
+ * @returns Aggregate cost report
19
+ */
20
+ generateIncrementReport(incrementId: string): IncrementCostReport;
21
+ /**
22
+ * Export report to JSON file
23
+ *
24
+ * @param incrementId - Increment ID
25
+ * @param outputPath - Output file path
26
+ */
27
+ exportToJSON(incrementId: string, outputPath: string): Promise<void>;
28
+ /**
29
+ * Export report to CSV file
30
+ *
31
+ * @param incrementId - Increment ID
32
+ * @param outputPath - Output file path
33
+ */
34
+ exportToCSV(incrementId: string, outputPath: string): Promise<void>;
35
+ /**
36
+ * Generate ASCII dashboard for CLI display
37
+ *
38
+ * @param incrementId - Optional increment ID (defaults to all increments)
39
+ * @returns ASCII table with cost breakdown
40
+ */
41
+ generateDashboard(incrementId?: string): string;
42
+ /**
43
+ * Generate dashboard for a specific increment
44
+ */
45
+ private generateIncrementDashboard;
46
+ /**
47
+ * Generate dashboard for all increments
48
+ */
49
+ private generateOverallDashboard;
50
+ /**
51
+ * Generate compact one-line summary
52
+ *
53
+ * @param incrementId - Optional increment ID
54
+ * @returns One-line summary string
55
+ */
56
+ generateSummaryLine(incrementId?: string): string;
57
+ }
58
+ //# sourceMappingURL=cost-reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cost-reporter.d.ts","sourceRoot":"","sources":["../../src/utils/cost-reporter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,qBAAa,YAAY;IACX,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAE5C;;;;;OAKG;IACH,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB;IAIjE;;;;;OAKG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1E;;;;;OAKG;IACG,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyCzE;;;;;OAKG;IACH,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ/C;;OAEG;IACH,OAAO,CAAC,0BAA0B;IA8FlC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAmEhC;;;;;OAKG;IACH,mBAAmB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM;CASlD"}