quantix-mcp 0.4.9 → 0.5.3

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 (215) hide show
  1. package/README.md +12 -1
  2. package/dist/index.js +20 -5
  3. package/dist/index.js.map +1 -1
  4. package/dist/tools/subscriptions.d.ts.map +1 -1
  5. package/dist/tools/subscriptions.js +46 -1
  6. package/dist/tools/subscriptions.js.map +1 -1
  7. package/dist/tools/transactions.d.ts.map +1 -1
  8. package/dist/tools/transactions.js +5 -5
  9. package/dist/tools/transactions.js.map +1 -1
  10. package/dist/types/schemas.d.ts +17 -0
  11. package/dist/types/schemas.d.ts.map +1 -1
  12. package/dist/types/schemas.js +21 -4
  13. package/dist/types/schemas.js.map +1 -1
  14. package/package.json +9 -4
  15. package/.claude/commands/opsx/apply.md +0 -152
  16. package/.claude/commands/opsx/archive.md +0 -157
  17. package/.claude/commands/opsx/bulk-archive.md +0 -242
  18. package/.claude/commands/opsx/continue.md +0 -114
  19. package/.claude/commands/opsx/explore.md +0 -174
  20. package/.claude/commands/opsx/ff.md +0 -94
  21. package/.claude/commands/opsx/new.md +0 -69
  22. package/.claude/commands/opsx/onboard.md +0 -525
  23. package/.claude/commands/opsx/sync.md +0 -134
  24. package/.claude/commands/opsx/verify.md +0 -164
  25. package/.claude/settings.local.json +0 -9
  26. package/.claude/skills/openspec-apply-change/SKILL.md +0 -156
  27. package/.claude/skills/openspec-archive-change/SKILL.md +0 -114
  28. package/.claude/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  29. package/.claude/skills/openspec-continue-change/SKILL.md +0 -118
  30. package/.claude/skills/openspec-explore/SKILL.md +0 -290
  31. package/.claude/skills/openspec-ff-change/SKILL.md +0 -101
  32. package/.claude/skills/openspec-new-change/SKILL.md +0 -74
  33. package/.claude/skills/openspec-onboard/SKILL.md +0 -529
  34. package/.claude/skills/openspec-sync-specs/SKILL.md +0 -138
  35. package/.claude/skills/openspec-verify-change/SKILL.md +0 -168
  36. package/.dockerignore +0 -8
  37. package/.gemini/commands/opsx/apply.toml +0 -149
  38. package/.gemini/commands/opsx/archive.toml +0 -154
  39. package/.gemini/commands/opsx/bulk-archive.toml +0 -239
  40. package/.gemini/commands/opsx/continue.toml +0 -111
  41. package/.gemini/commands/opsx/explore.toml +0 -171
  42. package/.gemini/commands/opsx/ff.toml +0 -91
  43. package/.gemini/commands/opsx/new.toml +0 -66
  44. package/.gemini/commands/opsx/onboard.toml +0 -522
  45. package/.gemini/commands/opsx/sync.toml +0 -131
  46. package/.gemini/commands/opsx/verify.toml +0 -161
  47. package/.gemini/skills/openspec-apply-change/SKILL.md +0 -156
  48. package/.gemini/skills/openspec-archive-change/SKILL.md +0 -114
  49. package/.gemini/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  50. package/.gemini/skills/openspec-continue-change/SKILL.md +0 -118
  51. package/.gemini/skills/openspec-explore/SKILL.md +0 -290
  52. package/.gemini/skills/openspec-ff-change/SKILL.md +0 -101
  53. package/.gemini/skills/openspec-new-change/SKILL.md +0 -74
  54. package/.gemini/skills/openspec-onboard/SKILL.md +0 -529
  55. package/.gemini/skills/openspec-sync-specs/SKILL.md +0 -138
  56. package/.gemini/skills/openspec-verify-change/SKILL.md +0 -168
  57. package/.github/agents/copilot-instructions.md +0 -32
  58. package/.github/agents/speckit.analyze.agent.md +0 -184
  59. package/.github/agents/speckit.checklist.agent.md +0 -294
  60. package/.github/agents/speckit.clarify.agent.md +0 -181
  61. package/.github/agents/speckit.constitution.agent.md +0 -82
  62. package/.github/agents/speckit.implement.agent.md +0 -135
  63. package/.github/agents/speckit.plan.agent.md +0 -89
  64. package/.github/agents/speckit.specify.agent.md +0 -258
  65. package/.github/agents/speckit.tasks.agent.md +0 -137
  66. package/.github/agents/speckit.taskstoissues.agent.md +0 -30
  67. package/.github/copilot-instructions.md +0 -17
  68. package/.github/prompts/speckit.analyze.prompt.md +0 -3
  69. package/.github/prompts/speckit.checklist.prompt.md +0 -3
  70. package/.github/prompts/speckit.clarify.prompt.md +0 -3
  71. package/.github/prompts/speckit.constitution.prompt.md +0 -3
  72. package/.github/prompts/speckit.implement.prompt.md +0 -3
  73. package/.github/prompts/speckit.plan.prompt.md +0 -3
  74. package/.github/prompts/speckit.specify.prompt.md +0 -3
  75. package/.github/prompts/speckit.tasks.prompt.md +0 -3
  76. package/.github/prompts/speckit.taskstoissues.prompt.md +0 -3
  77. package/.github/workflows/publish.yaml +0 -29
  78. package/.opencode/command/speckit.analyze.md +0 -184
  79. package/.opencode/command/speckit.checklist.md +0 -294
  80. package/.opencode/command/speckit.clarify.md +0 -181
  81. package/.opencode/command/speckit.constitution.md +0 -84
  82. package/.opencode/command/speckit.implement.md +0 -135
  83. package/.opencode/command/speckit.plan.md +0 -89
  84. package/.opencode/command/speckit.specify.md +0 -258
  85. package/.opencode/command/speckit.tasks.md +0 -137
  86. package/.opencode/command/speckit.taskstoissues.md +0 -30
  87. package/.qwen/commands/opsx-apply.toml +0 -149
  88. package/.qwen/commands/opsx-archive.toml +0 -154
  89. package/.qwen/commands/opsx-bulk-archive.toml +0 -239
  90. package/.qwen/commands/opsx-continue.toml +0 -111
  91. package/.qwen/commands/opsx-explore.toml +0 -171
  92. package/.qwen/commands/opsx-ff.toml +0 -91
  93. package/.qwen/commands/opsx-new.toml +0 -66
  94. package/.qwen/commands/opsx-onboard.toml +0 -522
  95. package/.qwen/commands/opsx-sync.toml +0 -131
  96. package/.qwen/commands/opsx-verify.toml +0 -161
  97. package/.qwen/skills/openspec-apply-change/SKILL.md +0 -156
  98. package/.qwen/skills/openspec-archive-change/SKILL.md +0 -114
  99. package/.qwen/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  100. package/.qwen/skills/openspec-continue-change/SKILL.md +0 -118
  101. package/.qwen/skills/openspec-explore/SKILL.md +0 -290
  102. package/.qwen/skills/openspec-ff-change/SKILL.md +0 -101
  103. package/.qwen/skills/openspec-new-change/SKILL.md +0 -74
  104. package/.qwen/skills/openspec-onboard/SKILL.md +0 -529
  105. package/.qwen/skills/openspec-sync-specs/SKILL.md +0 -138
  106. package/.qwen/skills/openspec-verify-change/SKILL.md +0 -168
  107. package/.specify/memory/constitution.md +0 -58
  108. package/.specify/scripts/powershell/check-prerequisites.ps1 +0 -148
  109. package/.specify/scripts/powershell/common.ps1 +0 -137
  110. package/.specify/scripts/powershell/create-new-feature.ps1 +0 -283
  111. package/.specify/scripts/powershell/setup-plan.ps1 +0 -61
  112. package/.specify/scripts/powershell/update-agent-context.ps1 +0 -448
  113. package/.specify/templates/agent-file-template.md +0 -28
  114. package/.specify/templates/checklist-template.md +0 -40
  115. package/.specify/templates/constitution-template.md +0 -50
  116. package/.specify/templates/plan-template.md +0 -104
  117. package/.specify/templates/spec-template.md +0 -115
  118. package/.specify/templates/tasks-template.md +0 -251
  119. package/.vscode/launch.json +0 -14
  120. package/.vscode/settings.json +0 -14
  121. package/.vscode/tasks.json +0 -15
  122. package/AGENTS.md +0 -117
  123. package/CLAUDE.md +0 -70
  124. package/Dockerfile +0 -30
  125. package/GEMINI.md +0 -117
  126. package/QWEN.md +0 -117
  127. package/docker-compose.yml +0 -15
  128. package/openapi.yaml +0 -3127
  129. package/openspec/README.md +0 -33
  130. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/.openspec.yaml +0 -2
  131. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/design.md +0 -60
  132. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/proposal.md +0 -25
  133. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/credit-card-transactions/spec.md +0 -46
  134. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/transactions/spec.md +0 -42
  135. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/tasks.md +0 -22
  136. package/openspec/config.yaml +0 -20
  137. package/openspec/specs/accounts/spec.md +0 -86
  138. package/openspec/specs/categories/spec.md +0 -78
  139. package/openspec/specs/credit-card-transactions/spec.md +0 -64
  140. package/openspec/specs/credit-cards/spec.md +0 -109
  141. package/openspec/specs/data/spec.md +0 -49
  142. package/openspec/specs/settings/spec.md +0 -48
  143. package/openspec/specs/subscriptions/spec.md +0 -85
  144. package/openspec/specs/summary/spec.md +0 -49
  145. package/openspec/specs/transactions/spec.md +0 -113
  146. package/openspec/specs/transfers/spec.md +0 -74
  147. package/specs/001-mcp-api-integration/checklists/requirements.md +0 -34
  148. package/specs/001-mcp-api-integration/contracts/openapi.yaml +0 -636
  149. package/specs/001-mcp-api-integration/data-model.md +0 -106
  150. package/specs/001-mcp-api-integration/plan.md +0 -73
  151. package/specs/001-mcp-api-integration/quickstart.md +0 -74
  152. package/specs/001-mcp-api-integration/research.md +0 -58
  153. package/specs/001-mcp-api-integration/spec.md +0 -119
  154. package/specs/001-mcp-api-integration/tasks.md +0 -64
  155. package/src/config.ts +0 -39
  156. package/src/index.ts +0 -99
  157. package/src/services/apiClient.ts +0 -55
  158. package/src/services/requestContext.ts +0 -11
  159. package/src/tools/accounts.ts +0 -122
  160. package/src/tools/categories.ts +0 -102
  161. package/src/tools/credit-cards.ts +0 -203
  162. package/src/tools/data.ts +0 -45
  163. package/src/tools/settings.ts +0 -64
  164. package/src/tools/subscriptions.ts +0 -159
  165. package/src/tools/summary.ts +0 -29
  166. package/src/tools/transactions.ts +0 -200
  167. package/src/tools/transfers.ts +0 -122
  168. package/src/types/schemas.ts +0 -333
  169. package/src/utils/toolHelpers.ts +0 -11
  170. package/tests/benchmark.test.d.ts +0 -2
  171. package/tests/benchmark.test.d.ts.map +0 -1
  172. package/tests/benchmark.test.js +0 -33
  173. package/tests/benchmark.test.js.map +0 -1
  174. package/tests/benchmark.test.ts +0 -38
  175. package/tests/server.test.d.ts +0 -2
  176. package/tests/server.test.d.ts.map +0 -1
  177. package/tests/server.test.js +0 -13
  178. package/tests/server.test.js.map +0 -1
  179. package/tests/server.test.ts +0 -14
  180. package/tests/setup.d.ts +0 -4
  181. package/tests/setup.d.ts.map +0 -1
  182. package/tests/setup.js +0 -17
  183. package/tests/setup.js.map +0 -1
  184. package/tests/setup.ts +0 -20
  185. package/tests/tools/accounts.test.ts +0 -159
  186. package/tests/tools/categories.test.d.ts +0 -2
  187. package/tests/tools/categories.test.d.ts.map +0 -1
  188. package/tests/tools/categories.test.js +0 -63
  189. package/tests/tools/categories.test.js.map +0 -1
  190. package/tests/tools/categories.test.ts +0 -120
  191. package/tests/tools/credit-cards.test.d.ts +0 -2
  192. package/tests/tools/credit-cards.test.d.ts.map +0 -1
  193. package/tests/tools/credit-cards.test.js +0 -71
  194. package/tests/tools/credit-cards.test.js.map +0 -1
  195. package/tests/tools/credit-cards.test.ts +0 -131
  196. package/tests/tools/data.test.ts +0 -100
  197. package/tests/tools/settings.test.ts +0 -116
  198. package/tests/tools/subscriptions.test.ts +0 -173
  199. package/tests/tools/summary.test.d.ts +0 -2
  200. package/tests/tools/summary.test.d.ts.map +0 -1
  201. package/tests/tools/summary.test.js +0 -36
  202. package/tests/tools/summary.test.js.map +0 -1
  203. package/tests/tools/summary.test.ts +0 -63
  204. package/tests/tools/transactions.test.d.ts +0 -2
  205. package/tests/tools/transactions.test.d.ts.map +0 -1
  206. package/tests/tools/transactions.test.js +0 -67
  207. package/tests/tools/transactions.test.js.map +0 -1
  208. package/tests/tools/transactions.test.ts +0 -133
  209. package/tests/tools/transfers.test.ts +0 -141
  210. package/tsconfig.json +0 -52
  211. package/vitest.config.d.ts +0 -3
  212. package/vitest.config.d.ts.map +0 -1
  213. package/vitest.config.js +0 -14
  214. package/vitest.config.js.map +0 -1
  215. package/vitest.config.ts +0 -14
@@ -1,168 +0,0 @@
1
- ---
2
- name: openspec-verify-change
3
- description: Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.
4
- license: MIT
5
- compatibility: Requires openspec CLI.
6
- metadata:
7
- author: openspec
8
- version: "1.0"
9
- generatedBy: "1.1.1"
10
- ---
11
-
12
- Verify that an implementation matches the change artifacts (specs, tasks, design).
13
-
14
- **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
15
-
16
- **Steps**
17
-
18
- 1. **If no change name provided, prompt for selection**
19
-
20
- Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
21
-
22
- Show changes that have implementation tasks (tasks artifact exists).
23
- Include the schema used for each change if available.
24
- Mark changes with incomplete tasks as "(In Progress)".
25
-
26
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
27
-
28
- 2. **Check status to understand the schema**
29
- ```bash
30
- openspec status --change "<name>" --json
31
- ```
32
- Parse the JSON to understand:
33
- - `schemaName`: The workflow being used (e.g., "spec-driven")
34
- - Which artifacts exist for this change
35
-
36
- 3. **Get the change directory and load artifacts**
37
-
38
- ```bash
39
- openspec instructions apply --change "<name>" --json
40
- ```
41
-
42
- This returns the change directory and context files. Read all available artifacts from `contextFiles`.
43
-
44
- 4. **Initialize verification report structure**
45
-
46
- Create a report structure with three dimensions:
47
- - **Completeness**: Track tasks and spec coverage
48
- - **Correctness**: Track requirement implementation and scenario coverage
49
- - **Coherence**: Track design adherence and pattern consistency
50
-
51
- Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
52
-
53
- 5. **Verify Completeness**
54
-
55
- **Task Completion**:
56
- - If tasks.md exists in contextFiles, read it
57
- - Parse checkboxes: `- [ ]` (incomplete) vs `- [x]` (complete)
58
- - Count complete vs total tasks
59
- - If incomplete tasks exist:
60
- - Add CRITICAL issue for each incomplete task
61
- - Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
62
-
63
- **Spec Coverage**:
64
- - If delta specs exist in `openspec/changes/<name>/specs/`:
65
- - Extract all requirements (marked with "### Requirement:")
66
- - For each requirement:
67
- - Search codebase for keywords related to the requirement
68
- - Assess if implementation likely exists
69
- - If requirements appear unimplemented:
70
- - Add CRITICAL issue: "Requirement not found: <requirement name>"
71
- - Recommendation: "Implement requirement X: <description>"
72
-
73
- 6. **Verify Correctness**
74
-
75
- **Requirement Implementation Mapping**:
76
- - For each requirement from delta specs:
77
- - Search codebase for implementation evidence
78
- - If found, note file paths and line ranges
79
- - Assess if implementation matches requirement intent
80
- - If divergence detected:
81
- - Add WARNING: "Implementation may diverge from spec: <details>"
82
- - Recommendation: "Review <file>:<lines> against requirement X"
83
-
84
- **Scenario Coverage**:
85
- - For each scenario in delta specs (marked with "#### Scenario:"):
86
- - Check if conditions are handled in code
87
- - Check if tests exist covering the scenario
88
- - If scenario appears uncovered:
89
- - Add WARNING: "Scenario not covered: <scenario name>"
90
- - Recommendation: "Add test or implementation for scenario: <description>"
91
-
92
- 7. **Verify Coherence**
93
-
94
- **Design Adherence**:
95
- - If design.md exists in contextFiles:
96
- - Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
97
- - Verify implementation follows those decisions
98
- - If contradiction detected:
99
- - Add WARNING: "Design decision not followed: <decision>"
100
- - Recommendation: "Update implementation or revise design.md to match reality"
101
- - If no design.md: Skip design adherence check, note "No design.md to verify against"
102
-
103
- **Code Pattern Consistency**:
104
- - Review new code for consistency with project patterns
105
- - Check file naming, directory structure, coding style
106
- - If significant deviations found:
107
- - Add SUGGESTION: "Code pattern deviation: <details>"
108
- - Recommendation: "Consider following project pattern: <example>"
109
-
110
- 8. **Generate Verification Report**
111
-
112
- **Summary Scorecard**:
113
- ```
114
- ## Verification Report: <change-name>
115
-
116
- ### Summary
117
- | Dimension | Status |
118
- |--------------|------------------|
119
- | Completeness | X/Y tasks, N reqs|
120
- | Correctness | M/N reqs covered |
121
- | Coherence | Followed/Issues |
122
- ```
123
-
124
- **Issues by Priority**:
125
-
126
- 1. **CRITICAL** (Must fix before archive):
127
- - Incomplete tasks
128
- - Missing requirement implementations
129
- - Each with specific, actionable recommendation
130
-
131
- 2. **WARNING** (Should fix):
132
- - Spec/design divergences
133
- - Missing scenario coverage
134
- - Each with specific recommendation
135
-
136
- 3. **SUGGESTION** (Nice to fix):
137
- - Pattern inconsistencies
138
- - Minor improvements
139
- - Each with specific recommendation
140
-
141
- **Final Assessment**:
142
- - If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
143
- - If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
144
- - If all clear: "All checks passed. Ready for archive."
145
-
146
- **Verification Heuristics**
147
-
148
- - **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
149
- - **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
150
- - **Coherence**: Look for glaring inconsistencies, don't nitpick style
151
- - **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
152
- - **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
153
-
154
- **Graceful Degradation**
155
-
156
- - If only tasks.md exists: verify task completion only, skip spec/design checks
157
- - If tasks + specs exist: verify completeness and correctness, skip design
158
- - If full artifacts: verify all three dimensions
159
- - Always note which checks were skipped and why
160
-
161
- **Output Format**
162
-
163
- Use clear markdown with:
164
- - Table for summary scorecard
165
- - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
166
- - Code references in format: `file.ts:123`
167
- - Specific, actionable recommendations
168
- - No vague suggestions like "consider reviewing"
@@ -1,58 +0,0 @@
1
- <!--
2
- SYNC IMPACT REPORT
3
- Version Change: 0.0.0 (New) -> 1.0.0
4
- Modified Principles: All (Initial Definition)
5
- Added Sections: All
6
- Removed Sections: None
7
- Templates Requiring Updates: ✅ None (Templates are generic enough)
8
- Follow-up:
9
- - Verify ratification date is acceptable as today.
10
- -->
11
- # Morpheus MCP Constitution
12
-
13
- ## Core Principles
14
-
15
- ### I. Library-First
16
- Every feature or tool set should be implemented as a standalone module or library within the `src/tools/` or `src/lib/` structure. Avoid monolithic `index.ts` files. Modules must be self-contained, independently testable, and have a single clear responsibility.
17
-
18
- ### II. Standard Interface
19
- All tools must expose functionality via the Model Context Protocol (MCP) standard. Inputs must be strictly defined using Zod schemas to ensure type safety and validation at the boundary.
20
-
21
- ### III. Test-First (NON-NEGOTIABLE)
22
- Test-Driven Development (TDD) is mandatory for core logic. Write tests that define the expected behavior before implementing the functionality. Ensure a Red-Green-Refactor cycle.
23
-
24
- ### IV. Integration Testing
25
- Given the nature of MCP servers as API proxies, integration tests are critical. Usage of mocking frameworks to simulate external API responses is required to verify contract adherence without flakiness from external services.
26
-
27
- ### V. Simplicity & Robustness
28
- Keep code simple and readable. Avoid over-engineering. Handle errors gracefully and provide meaningful error messages to the LLM/Client. Strict typing is required throughout to prevent runtime surprises.
29
-
30
- ## Security & Compliance
31
-
32
- ### Authentication Management
33
- API keys and secrets must never be hardcoded. They must be loaded from environment variables (e.g., `QUANTIX_API_KEY`). The server should validate the presence of required configuration at startup.
34
-
35
- ### Data Privacy
36
- Do not log sensitive user data or full API keys. Logs should be structured and sanitized.
37
-
38
- ## Development Workflow
39
-
40
- ### Code Review Gates
41
- All Pull Requests must pass the automated build and test suite. Code reviews should verify adherence to the Library-First and Test-First principles.
42
-
43
- ### Documentation
44
- Every tool must have a clear description and argument documentation suitable for LLM consumption. `README.md` must be kept up-to-date with usage instructions.
45
-
46
- ## Governance
47
-
48
- This constitution serves as the primary source of truth for engineering practices within the Morpheus MCP project.
49
-
50
- ### Amendments
51
- Any changes to this constitution must be made via a Pull Request to `.specify/memory/constitution.md`.
52
- * Major changes (altering core principles) require a Consensus Review.
53
- * Minor changes (clarifications, new sections) require standard Maintainer Review.
54
-
55
- ### Compliance
56
- All new feature plans (Phase 0/1) must include a "Constitution Check" to verify alignment with these principles.
57
-
58
- **Version**: 1.0.0 | **Ratified**: 2026-01-31 | **Last Amended**: 2026-01-31
@@ -1,148 +0,0 @@
1
- #!/usr/bin/env pwsh
2
-
3
- # Consolidated prerequisite checking script (PowerShell)
4
- #
5
- # This script provides unified prerequisite checking for Spec-Driven Development workflow.
6
- # It replaces the functionality previously spread across multiple scripts.
7
- #
8
- # Usage: ./check-prerequisites.ps1 [OPTIONS]
9
- #
10
- # OPTIONS:
11
- # -Json Output in JSON format
12
- # -RequireTasks Require tasks.md to exist (for implementation phase)
13
- # -IncludeTasks Include tasks.md in AVAILABLE_DOCS list
14
- # -PathsOnly Only output path variables (no validation)
15
- # -Help, -h Show help message
16
-
17
- [CmdletBinding()]
18
- param(
19
- [switch]$Json,
20
- [switch]$RequireTasks,
21
- [switch]$IncludeTasks,
22
- [switch]$PathsOnly,
23
- [switch]$Help
24
- )
25
-
26
- $ErrorActionPreference = 'Stop'
27
-
28
- # Show help if requested
29
- if ($Help) {
30
- Write-Output @"
31
- Usage: check-prerequisites.ps1 [OPTIONS]
32
-
33
- Consolidated prerequisite checking for Spec-Driven Development workflow.
34
-
35
- OPTIONS:
36
- -Json Output in JSON format
37
- -RequireTasks Require tasks.md to exist (for implementation phase)
38
- -IncludeTasks Include tasks.md in AVAILABLE_DOCS list
39
- -PathsOnly Only output path variables (no prerequisite validation)
40
- -Help, -h Show this help message
41
-
42
- EXAMPLES:
43
- # Check task prerequisites (plan.md required)
44
- .\check-prerequisites.ps1 -Json
45
-
46
- # Check implementation prerequisites (plan.md + tasks.md required)
47
- .\check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks
48
-
49
- # Get feature paths only (no validation)
50
- .\check-prerequisites.ps1 -PathsOnly
51
-
52
- "@
53
- exit 0
54
- }
55
-
56
- # Source common functions
57
- . "$PSScriptRoot/common.ps1"
58
-
59
- # Get feature paths and validate branch
60
- $paths = Get-FeaturePathsEnv
61
-
62
- if (-not (Test-FeatureBranch -Branch $paths.CURRENT_BRANCH -HasGit:$paths.HAS_GIT)) {
63
- exit 1
64
- }
65
-
66
- # If paths-only mode, output paths and exit (support combined -Json -PathsOnly)
67
- if ($PathsOnly) {
68
- if ($Json) {
69
- [PSCustomObject]@{
70
- REPO_ROOT = $paths.REPO_ROOT
71
- BRANCH = $paths.CURRENT_BRANCH
72
- FEATURE_DIR = $paths.FEATURE_DIR
73
- FEATURE_SPEC = $paths.FEATURE_SPEC
74
- IMPL_PLAN = $paths.IMPL_PLAN
75
- TASKS = $paths.TASKS
76
- } | ConvertTo-Json -Compress
77
- } else {
78
- Write-Output "REPO_ROOT: $($paths.REPO_ROOT)"
79
- Write-Output "BRANCH: $($paths.CURRENT_BRANCH)"
80
- Write-Output "FEATURE_DIR: $($paths.FEATURE_DIR)"
81
- Write-Output "FEATURE_SPEC: $($paths.FEATURE_SPEC)"
82
- Write-Output "IMPL_PLAN: $($paths.IMPL_PLAN)"
83
- Write-Output "TASKS: $($paths.TASKS)"
84
- }
85
- exit 0
86
- }
87
-
88
- # Validate required directories and files
89
- if (-not (Test-Path $paths.FEATURE_DIR -PathType Container)) {
90
- Write-Output "ERROR: Feature directory not found: $($paths.FEATURE_DIR)"
91
- Write-Output "Run /speckit.specify first to create the feature structure."
92
- exit 1
93
- }
94
-
95
- if (-not (Test-Path $paths.IMPL_PLAN -PathType Leaf)) {
96
- Write-Output "ERROR: plan.md not found in $($paths.FEATURE_DIR)"
97
- Write-Output "Run /speckit.plan first to create the implementation plan."
98
- exit 1
99
- }
100
-
101
- # Check for tasks.md if required
102
- if ($RequireTasks -and -not (Test-Path $paths.TASKS -PathType Leaf)) {
103
- Write-Output "ERROR: tasks.md not found in $($paths.FEATURE_DIR)"
104
- Write-Output "Run /speckit.tasks first to create the task list."
105
- exit 1
106
- }
107
-
108
- # Build list of available documents
109
- $docs = @()
110
-
111
- # Always check these optional docs
112
- if (Test-Path $paths.RESEARCH) { $docs += 'research.md' }
113
- if (Test-Path $paths.DATA_MODEL) { $docs += 'data-model.md' }
114
-
115
- # Check contracts directory (only if it exists and has files)
116
- if ((Test-Path $paths.CONTRACTS_DIR) -and (Get-ChildItem -Path $paths.CONTRACTS_DIR -ErrorAction SilentlyContinue | Select-Object -First 1)) {
117
- $docs += 'contracts/'
118
- }
119
-
120
- if (Test-Path $paths.QUICKSTART) { $docs += 'quickstart.md' }
121
-
122
- # Include tasks.md if requested and it exists
123
- if ($IncludeTasks -and (Test-Path $paths.TASKS)) {
124
- $docs += 'tasks.md'
125
- }
126
-
127
- # Output results
128
- if ($Json) {
129
- # JSON output
130
- [PSCustomObject]@{
131
- FEATURE_DIR = $paths.FEATURE_DIR
132
- AVAILABLE_DOCS = $docs
133
- } | ConvertTo-Json -Compress
134
- } else {
135
- # Text output
136
- Write-Output "FEATURE_DIR:$($paths.FEATURE_DIR)"
137
- Write-Output "AVAILABLE_DOCS:"
138
-
139
- # Show status of each potential document
140
- Test-FileExists -Path $paths.RESEARCH -Description 'research.md' | Out-Null
141
- Test-FileExists -Path $paths.DATA_MODEL -Description 'data-model.md' | Out-Null
142
- Test-DirHasFiles -Path $paths.CONTRACTS_DIR -Description 'contracts/' | Out-Null
143
- Test-FileExists -Path $paths.QUICKSTART -Description 'quickstart.md' | Out-Null
144
-
145
- if ($IncludeTasks) {
146
- Test-FileExists -Path $paths.TASKS -Description 'tasks.md' | Out-Null
147
- }
148
- }
@@ -1,137 +0,0 @@
1
- #!/usr/bin/env pwsh
2
- # Common PowerShell functions analogous to common.sh
3
-
4
- function Get-RepoRoot {
5
- try {
6
- $result = git rev-parse --show-toplevel 2>$null
7
- if ($LASTEXITCODE -eq 0) {
8
- return $result
9
- }
10
- } catch {
11
- # Git command failed
12
- }
13
-
14
- # Fall back to script location for non-git repos
15
- return (Resolve-Path (Join-Path $PSScriptRoot "../../..")).Path
16
- }
17
-
18
- function Get-CurrentBranch {
19
- # First check if SPECIFY_FEATURE environment variable is set
20
- if ($env:SPECIFY_FEATURE) {
21
- return $env:SPECIFY_FEATURE
22
- }
23
-
24
- # Then check git if available
25
- try {
26
- $result = git rev-parse --abbrev-ref HEAD 2>$null
27
- if ($LASTEXITCODE -eq 0) {
28
- return $result
29
- }
30
- } catch {
31
- # Git command failed
32
- }
33
-
34
- # For non-git repos, try to find the latest feature directory
35
- $repoRoot = Get-RepoRoot
36
- $specsDir = Join-Path $repoRoot "specs"
37
-
38
- if (Test-Path $specsDir) {
39
- $latestFeature = ""
40
- $highest = 0
41
-
42
- Get-ChildItem -Path $specsDir -Directory | ForEach-Object {
43
- if ($_.Name -match '^(\d{3})-') {
44
- $num = [int]$matches[1]
45
- if ($num -gt $highest) {
46
- $highest = $num
47
- $latestFeature = $_.Name
48
- }
49
- }
50
- }
51
-
52
- if ($latestFeature) {
53
- return $latestFeature
54
- }
55
- }
56
-
57
- # Final fallback
58
- return "main"
59
- }
60
-
61
- function Test-HasGit {
62
- try {
63
- git rev-parse --show-toplevel 2>$null | Out-Null
64
- return ($LASTEXITCODE -eq 0)
65
- } catch {
66
- return $false
67
- }
68
- }
69
-
70
- function Test-FeatureBranch {
71
- param(
72
- [string]$Branch,
73
- [bool]$HasGit = $true
74
- )
75
-
76
- # For non-git repos, we can't enforce branch naming but still provide output
77
- if (-not $HasGit) {
78
- Write-Warning "[specify] Warning: Git repository not detected; skipped branch validation"
79
- return $true
80
- }
81
-
82
- if ($Branch -notmatch '^[0-9]{3}-') {
83
- Write-Output "ERROR: Not on a feature branch. Current branch: $Branch"
84
- Write-Output "Feature branches should be named like: 001-feature-name"
85
- return $false
86
- }
87
- return $true
88
- }
89
-
90
- function Get-FeatureDir {
91
- param([string]$RepoRoot, [string]$Branch)
92
- Join-Path $RepoRoot "specs/$Branch"
93
- }
94
-
95
- function Get-FeaturePathsEnv {
96
- $repoRoot = Get-RepoRoot
97
- $currentBranch = Get-CurrentBranch
98
- $hasGit = Test-HasGit
99
- $featureDir = Get-FeatureDir -RepoRoot $repoRoot -Branch $currentBranch
100
-
101
- [PSCustomObject]@{
102
- REPO_ROOT = $repoRoot
103
- CURRENT_BRANCH = $currentBranch
104
- HAS_GIT = $hasGit
105
- FEATURE_DIR = $featureDir
106
- FEATURE_SPEC = Join-Path $featureDir 'spec.md'
107
- IMPL_PLAN = Join-Path $featureDir 'plan.md'
108
- TASKS = Join-Path $featureDir 'tasks.md'
109
- RESEARCH = Join-Path $featureDir 'research.md'
110
- DATA_MODEL = Join-Path $featureDir 'data-model.md'
111
- QUICKSTART = Join-Path $featureDir 'quickstart.md'
112
- CONTRACTS_DIR = Join-Path $featureDir 'contracts'
113
- }
114
- }
115
-
116
- function Test-FileExists {
117
- param([string]$Path, [string]$Description)
118
- if (Test-Path -Path $Path -PathType Leaf) {
119
- Write-Output " ✓ $Description"
120
- return $true
121
- } else {
122
- Write-Output " ✗ $Description"
123
- return $false
124
- }
125
- }
126
-
127
- function Test-DirHasFiles {
128
- param([string]$Path, [string]$Description)
129
- if ((Test-Path -Path $Path -PathType Container) -and (Get-ChildItem -Path $Path -ErrorAction SilentlyContinue | Where-Object { -not $_.PSIsContainer } | Select-Object -First 1)) {
130
- Write-Output " ✓ $Description"
131
- return $true
132
- } else {
133
- Write-Output " ✗ $Description"
134
- return $false
135
- }
136
- }
137
-