quantix-mcp 0.3.7 → 0.4.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 (113) hide show
  1. package/.claude/settings.local.json +2 -1
  2. package/.github/agents/copilot-instructions.md +32 -32
  3. package/.github/copilot-instructions.md +17 -17
  4. package/.github/workflows/publish.yaml +28 -28
  5. package/.opencode/command/speckit.analyze.md +184 -184
  6. package/.opencode/command/speckit.checklist.md +294 -294
  7. package/.opencode/command/speckit.clarify.md +181 -181
  8. package/.opencode/command/speckit.constitution.md +84 -84
  9. package/.opencode/command/speckit.implement.md +135 -135
  10. package/.opencode/command/speckit.plan.md +89 -89
  11. package/.opencode/command/speckit.specify.md +258 -258
  12. package/.opencode/command/speckit.tasks.md +137 -137
  13. package/.opencode/command/speckit.taskstoissues.md +30 -30
  14. package/.specify/memory/constitution.md +58 -58
  15. package/.specify/templates/constitution-template.md +50 -50
  16. package/.vscode/launch.json +14 -14
  17. package/CLAUDE.md +70 -64
  18. package/GEMINI.md +58 -0
  19. package/README.md +176 -176
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +14 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/tools/accounts.d.ts.map +1 -1
  24. package/dist/tools/accounts.js +55 -34
  25. package/dist/tools/accounts.js.map +1 -1
  26. package/dist/tools/categories.d.ts.map +1 -1
  27. package/dist/tools/categories.js +46 -20
  28. package/dist/tools/categories.js.map +1 -1
  29. package/dist/tools/credit-cards.d.ts.map +1 -1
  30. package/dist/tools/credit-cards.js +104 -33
  31. package/dist/tools/credit-cards.js.map +1 -1
  32. package/dist/tools/data.d.ts.map +1 -1
  33. package/dist/tools/data.js +19 -8
  34. package/dist/tools/data.js.map +1 -1
  35. package/dist/tools/settings.d.ts.map +1 -1
  36. package/dist/tools/settings.js +28 -12
  37. package/dist/tools/settings.js.map +1 -1
  38. package/dist/tools/subscriptions.d.ts +3 -0
  39. package/dist/tools/subscriptions.d.ts.map +1 -0
  40. package/dist/tools/subscriptions.js +128 -0
  41. package/dist/tools/subscriptions.js.map +1 -0
  42. package/dist/tools/summary.d.ts.map +1 -1
  43. package/dist/tools/summary.js +17 -11
  44. package/dist/tools/summary.js.map +1 -1
  45. package/dist/tools/transactions.d.ts.map +1 -1
  46. package/dist/tools/transactions.js +85 -50
  47. package/dist/tools/transactions.js.map +1 -1
  48. package/dist/tools/transfers.d.ts +3 -0
  49. package/dist/tools/transfers.d.ts.map +1 -0
  50. package/dist/tools/transfers.js +107 -0
  51. package/dist/tools/transfers.js.map +1 -0
  52. package/dist/types/schemas.d.ts +65 -0
  53. package/dist/types/schemas.d.ts.map +1 -1
  54. package/dist/types/schemas.js +69 -3
  55. package/dist/types/schemas.js.map +1 -1
  56. package/dist/utils/toolHelpers.d.ts +7 -0
  57. package/dist/utils/toolHelpers.d.ts.map +1 -0
  58. package/dist/utils/toolHelpers.js +11 -0
  59. package/dist/utils/toolHelpers.js.map +1 -0
  60. package/openapi.yaml +2279 -1828
  61. package/package.json +41 -41
  62. package/specs/001-mcp-api-integration/checklists/requirements.md +34 -34
  63. package/specs/001-mcp-api-integration/contracts/openapi.yaml +635 -635
  64. package/specs/001-mcp-api-integration/data-model.md +106 -106
  65. package/specs/001-mcp-api-integration/plan.md +73 -73
  66. package/specs/001-mcp-api-integration/quickstart.md +74 -74
  67. package/specs/001-mcp-api-integration/research.md +58 -58
  68. package/specs/001-mcp-api-integration/spec.md +119 -119
  69. package/specs/001-mcp-api-integration/tasks.md +64 -64
  70. package/src/config.ts +36 -36
  71. package/src/index.ts +60 -47
  72. package/src/services/apiClient.ts +49 -49
  73. package/src/tools/accounts.ts +122 -111
  74. package/src/tools/categories.ts +102 -81
  75. package/src/tools/credit-cards.ts +203 -147
  76. package/src/tools/data.ts +45 -36
  77. package/src/tools/settings.ts +64 -51
  78. package/src/tools/subscriptions.ts +159 -0
  79. package/src/tools/summary.ts +29 -24
  80. package/src/tools/transactions.ts +156 -128
  81. package/src/tools/transfers.ts +122 -0
  82. package/src/types/schemas.ts +304 -235
  83. package/src/utils/toolHelpers.ts +11 -0
  84. package/tests/benchmark.test.d.ts +1 -1
  85. package/tests/benchmark.test.js +32 -32
  86. package/tests/benchmark.test.ts +38 -38
  87. package/tests/server.test.d.ts +1 -1
  88. package/tests/server.test.js +12 -12
  89. package/tests/server.test.ts +14 -14
  90. package/tests/setup.d.ts +3 -3
  91. package/tests/setup.js +16 -16
  92. package/tests/setup.ts +20 -20
  93. package/tests/tools/accounts.test.ts +159 -118
  94. package/tests/tools/categories.test.d.ts +1 -1
  95. package/tests/tools/categories.test.js +62 -62
  96. package/tests/tools/categories.test.ts +120 -78
  97. package/tests/tools/credit-cards.test.d.ts +1 -1
  98. package/tests/tools/credit-cards.test.js +70 -70
  99. package/tests/tools/credit-cards.test.ts +131 -89
  100. package/tests/tools/data.test.ts +100 -0
  101. package/tests/tools/settings.test.ts +116 -0
  102. package/tests/tools/subscriptions.test.ts +173 -0
  103. package/tests/tools/summary.test.d.ts +1 -1
  104. package/tests/tools/summary.test.js +35 -35
  105. package/tests/tools/summary.test.ts +63 -42
  106. package/tests/tools/transactions.test.d.ts +1 -1
  107. package/tests/tools/transactions.test.js +66 -66
  108. package/tests/tools/transactions.test.ts +133 -82
  109. package/tests/tools/transfers.test.ts +141 -0
  110. package/tsconfig.json +52 -52
  111. package/vitest.config.d.ts +2 -2
  112. package/vitest.config.js +13 -13
  113. package/vitest.config.ts +14 -14
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Bash(npm test)"
4
+ "Bash(npm test)",
5
+ "Bash(cd /e/quantix-mcp && npm run build 2>&1)"
5
6
  ]
6
7
  }
7
8
  }
@@ -1,32 +1,32 @@
1
- # morpheus-mcp Development Guidelines
2
-
3
- Auto-generated from all feature plans. Last updated: 2026-01-31
4
-
5
- ## Active Technologies
6
- - N/A (Stateless proxy to external API) (001-mcp-api-integration)
7
-
8
- - TypeScript 5.9 (Node.js) + `@modelcontextprotocol/sdk`, `express`, `zod`, `fetch` (native Node 18+) (001-mcp-api-integration)
9
-
10
- ## Project Structure
11
-
12
- ```text
13
- src/
14
- tests/
15
- ```
16
-
17
- ## Commands
18
-
19
- npm test; npm run lint
20
-
21
- ## Code Style
22
-
23
- TypeScript 5.9 (Node.js): Follow standard conventions
24
-
25
- ## Recent Changes
26
- - 001-mcp-api-integration: Added TypeScript 5.9 (Node.js) + `@modelcontextprotocol/sdk`, `express`, `zod`, `fetch` (native Node 18+)
27
- - 001-mcp-api-integration: Added TypeScript 5.9 (Node.js) + `@modelcontextprotocol/sdk`, `express`, `zod`, `fetch` (native Node 18+)
28
-
29
- - 001-mcp-api-integration: Added TypeScript 5.9 (Node.js) + `@modelcontextprotocol/sdk`, `express`, `zod`, `fetch` (native Node 18+)
30
-
31
- <!-- MANUAL ADDITIONS START -->
32
- <!-- MANUAL ADDITIONS END -->
1
+ # morpheus-mcp Development Guidelines
2
+
3
+ Auto-generated from all feature plans. Last updated: 2026-01-31
4
+
5
+ ## Active Technologies
6
+ - N/A (Stateless proxy to external API) (001-mcp-api-integration)
7
+
8
+ - TypeScript 5.9 (Node.js) + `@modelcontextprotocol/sdk`, `express`, `zod`, `fetch` (native Node 18+) (001-mcp-api-integration)
9
+
10
+ ## Project Structure
11
+
12
+ ```text
13
+ src/
14
+ tests/
15
+ ```
16
+
17
+ ## Commands
18
+
19
+ npm test; npm run lint
20
+
21
+ ## Code Style
22
+
23
+ TypeScript 5.9 (Node.js): Follow standard conventions
24
+
25
+ ## Recent Changes
26
+ - 001-mcp-api-integration: Added TypeScript 5.9 (Node.js) + `@modelcontextprotocol/sdk`, `express`, `zod`, `fetch` (native Node 18+)
27
+ - 001-mcp-api-integration: Added TypeScript 5.9 (Node.js) + `@modelcontextprotocol/sdk`, `express`, `zod`, `fetch` (native Node 18+)
28
+
29
+ - 001-mcp-api-integration: Added TypeScript 5.9 (Node.js) + `@modelcontextprotocol/sdk`, `express`, `zod`, `fetch` (native Node 18+)
30
+
31
+ <!-- MANUAL ADDITIONS START -->
32
+ <!-- MANUAL ADDITIONS END -->
@@ -1,17 +1,17 @@
1
- - [x] Verify that the copilot-instructions.md file in the .github directory is created.
2
-
3
- - [x] Clarify Project Requirements
4
-
5
- - [x] Scaffold the Project
6
-
7
- - [x] Customize the Project
8
-
9
- - [x] Install Required Extensions
10
-
11
- - [x] Compile the Project
12
-
13
- - [x] Create and Run Task
14
-
15
- - [x] Launch the Project
16
-
17
- - [x] Ensure Documentation is Complete
1
+ - [x] Verify that the copilot-instructions.md file in the .github directory is created.
2
+
3
+ - [x] Clarify Project Requirements
4
+
5
+ - [x] Scaffold the Project
6
+
7
+ - [x] Customize the Project
8
+
9
+ - [x] Install Required Extensions
10
+
11
+ - [x] Compile the Project
12
+
13
+ - [x] Create and Run Task
14
+
15
+ - [x] Launch the Project
16
+
17
+ - [x] Ensure Documentation is Complete
@@ -1,28 +1,28 @@
1
- name: Publish Package
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v*.*.*' # Trigger on version tags like v1.0.0
7
-
8
- jobs:
9
- publish:
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - uses: actions/checkout@v4
14
- - uses: actions/setup-node@v4
15
- with:
16
- node-version: '20'
17
- registry-url: 'https://registry.npmjs.org'
18
- - run: npm ci
19
- - run: npm run build --if-present
20
- - run: npm publish
21
- env:
22
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Use the secret
23
-
24
- # 1. Garante que a versão no package.json está correta
25
- # npm version 1.0.0
26
-
27
- # 2. Envia o commit e a nova tag para o GitHub
28
- # git push origin main --tags
1
+ name: Publish Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*' # Trigger on version tags like v1.0.0
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: actions/setup-node@v4
15
+ with:
16
+ node-version: '20'
17
+ registry-url: 'https://registry.npmjs.org'
18
+ - run: npm ci
19
+ - run: npm run build --if-present
20
+ - run: npm publish
21
+ env:
22
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Use the secret
23
+
24
+ # 1. Garante que a versão no package.json está correta
25
+ # npm version 1.0.0
26
+
27
+ # 2. Envia o commit e a nova tag para o GitHub
28
+ # git push origin main --tags
@@ -1,184 +1,184 @@
1
- ---
2
- description: Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
3
- ---
4
-
5
- ## User Input
6
-
7
- ```text
8
- $ARGUMENTS
9
- ```
10
-
11
- You **MUST** consider the user input before proceeding (if not empty).
12
-
13
- ## Goal
14
-
15
- Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/speckit.tasks` has successfully produced a complete `tasks.md`.
16
-
17
- ## Operating Constraints
18
-
19
- **STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
20
-
21
- **Constitution Authority**: The project constitution (`.specify/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/speckit.analyze`.
22
-
23
- ## Execution Steps
24
-
25
- ### 1. Initialize Analysis Context
26
-
27
- Run `.specify/scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
28
-
29
- - SPEC = FEATURE_DIR/spec.md
30
- - PLAN = FEATURE_DIR/plan.md
31
- - TASKS = FEATURE_DIR/tasks.md
32
-
33
- Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
34
- For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
35
-
36
- ### 2. Load Artifacts (Progressive Disclosure)
37
-
38
- Load only the minimal necessary context from each artifact:
39
-
40
- **From spec.md:**
41
-
42
- - Overview/Context
43
- - Functional Requirements
44
- - Non-Functional Requirements
45
- - User Stories
46
- - Edge Cases (if present)
47
-
48
- **From plan.md:**
49
-
50
- - Architecture/stack choices
51
- - Data Model references
52
- - Phases
53
- - Technical constraints
54
-
55
- **From tasks.md:**
56
-
57
- - Task IDs
58
- - Descriptions
59
- - Phase grouping
60
- - Parallel markers [P]
61
- - Referenced file paths
62
-
63
- **From constitution:**
64
-
65
- - Load `.specify/memory/constitution.md` for principle validation
66
-
67
- ### 3. Build Semantic Models
68
-
69
- Create internal representations (do not include raw artifacts in output):
70
-
71
- - **Requirements inventory**: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" → `user-can-upload-file`)
72
- - **User story/action inventory**: Discrete user actions with acceptance criteria
73
- - **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
74
- - **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
75
-
76
- ### 4. Detection Passes (Token-Efficient Analysis)
77
-
78
- Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
79
-
80
- #### A. Duplication Detection
81
-
82
- - Identify near-duplicate requirements
83
- - Mark lower-quality phrasing for consolidation
84
-
85
- #### B. Ambiguity Detection
86
-
87
- - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
88
- - Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
89
-
90
- #### C. Underspecification
91
-
92
- - Requirements with verbs but missing object or measurable outcome
93
- - User stories missing acceptance criteria alignment
94
- - Tasks referencing files or components not defined in spec/plan
95
-
96
- #### D. Constitution Alignment
97
-
98
- - Any requirement or plan element conflicting with a MUST principle
99
- - Missing mandated sections or quality gates from constitution
100
-
101
- #### E. Coverage Gaps
102
-
103
- - Requirements with zero associated tasks
104
- - Tasks with no mapped requirement/story
105
- - Non-functional requirements not reflected in tasks (e.g., performance, security)
106
-
107
- #### F. Inconsistency
108
-
109
- - Terminology drift (same concept named differently across files)
110
- - Data entities referenced in plan but absent in spec (or vice versa)
111
- - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
112
- - Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
113
-
114
- ### 5. Severity Assignment
115
-
116
- Use this heuristic to prioritize findings:
117
-
118
- - **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
119
- - **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
120
- - **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
121
- - **LOW**: Style/wording improvements, minor redundancy not affecting execution order
122
-
123
- ### 6. Produce Compact Analysis Report
124
-
125
- Output a Markdown report (no file writes) with the following structure:
126
-
127
- ## Specification Analysis Report
128
-
129
- | ID | Category | Severity | Location(s) | Summary | Recommendation |
130
- |----|----------|----------|-------------|---------|----------------|
131
- | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
132
-
133
- (Add one row per finding; generate stable IDs prefixed by category initial.)
134
-
135
- **Coverage Summary Table:**
136
-
137
- | Requirement Key | Has Task? | Task IDs | Notes |
138
- |-----------------|-----------|----------|-------|
139
-
140
- **Constitution Alignment Issues:** (if any)
141
-
142
- **Unmapped Tasks:** (if any)
143
-
144
- **Metrics:**
145
-
146
- - Total Requirements
147
- - Total Tasks
148
- - Coverage % (requirements with >=1 task)
149
- - Ambiguity Count
150
- - Duplication Count
151
- - Critical Issues Count
152
-
153
- ### 7. Provide Next Actions
154
-
155
- At end of report, output a concise Next Actions block:
156
-
157
- - If CRITICAL issues exist: Recommend resolving before `/speckit.implement`
158
- - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
159
- - Provide explicit command suggestions: e.g., "Run /speckit.specify with refinement", "Run /speckit.plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
160
-
161
- ### 8. Offer Remediation
162
-
163
- Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
164
-
165
- ## Operating Principles
166
-
167
- ### Context Efficiency
168
-
169
- - **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
170
- - **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
171
- - **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
172
- - **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
173
-
174
- ### Analysis Guidelines
175
-
176
- - **NEVER modify files** (this is read-only analysis)
177
- - **NEVER hallucinate missing sections** (if absent, report them accurately)
178
- - **Prioritize constitution violations** (these are always CRITICAL)
179
- - **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
180
- - **Report zero issues gracefully** (emit success report with coverage statistics)
181
-
182
- ## Context
183
-
184
- $ARGUMENTS
1
+ ---
2
+ description: Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
3
+ ---
4
+
5
+ ## User Input
6
+
7
+ ```text
8
+ $ARGUMENTS
9
+ ```
10
+
11
+ You **MUST** consider the user input before proceeding (if not empty).
12
+
13
+ ## Goal
14
+
15
+ Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/speckit.tasks` has successfully produced a complete `tasks.md`.
16
+
17
+ ## Operating Constraints
18
+
19
+ **STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
20
+
21
+ **Constitution Authority**: The project constitution (`.specify/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/speckit.analyze`.
22
+
23
+ ## Execution Steps
24
+
25
+ ### 1. Initialize Analysis Context
26
+
27
+ Run `.specify/scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
28
+
29
+ - SPEC = FEATURE_DIR/spec.md
30
+ - PLAN = FEATURE_DIR/plan.md
31
+ - TASKS = FEATURE_DIR/tasks.md
32
+
33
+ Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
34
+ For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
35
+
36
+ ### 2. Load Artifacts (Progressive Disclosure)
37
+
38
+ Load only the minimal necessary context from each artifact:
39
+
40
+ **From spec.md:**
41
+
42
+ - Overview/Context
43
+ - Functional Requirements
44
+ - Non-Functional Requirements
45
+ - User Stories
46
+ - Edge Cases (if present)
47
+
48
+ **From plan.md:**
49
+
50
+ - Architecture/stack choices
51
+ - Data Model references
52
+ - Phases
53
+ - Technical constraints
54
+
55
+ **From tasks.md:**
56
+
57
+ - Task IDs
58
+ - Descriptions
59
+ - Phase grouping
60
+ - Parallel markers [P]
61
+ - Referenced file paths
62
+
63
+ **From constitution:**
64
+
65
+ - Load `.specify/memory/constitution.md` for principle validation
66
+
67
+ ### 3. Build Semantic Models
68
+
69
+ Create internal representations (do not include raw artifacts in output):
70
+
71
+ - **Requirements inventory**: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" → `user-can-upload-file`)
72
+ - **User story/action inventory**: Discrete user actions with acceptance criteria
73
+ - **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
74
+ - **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
75
+
76
+ ### 4. Detection Passes (Token-Efficient Analysis)
77
+
78
+ Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
79
+
80
+ #### A. Duplication Detection
81
+
82
+ - Identify near-duplicate requirements
83
+ - Mark lower-quality phrasing for consolidation
84
+
85
+ #### B. Ambiguity Detection
86
+
87
+ - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
88
+ - Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
89
+
90
+ #### C. Underspecification
91
+
92
+ - Requirements with verbs but missing object or measurable outcome
93
+ - User stories missing acceptance criteria alignment
94
+ - Tasks referencing files or components not defined in spec/plan
95
+
96
+ #### D. Constitution Alignment
97
+
98
+ - Any requirement or plan element conflicting with a MUST principle
99
+ - Missing mandated sections or quality gates from constitution
100
+
101
+ #### E. Coverage Gaps
102
+
103
+ - Requirements with zero associated tasks
104
+ - Tasks with no mapped requirement/story
105
+ - Non-functional requirements not reflected in tasks (e.g., performance, security)
106
+
107
+ #### F. Inconsistency
108
+
109
+ - Terminology drift (same concept named differently across files)
110
+ - Data entities referenced in plan but absent in spec (or vice versa)
111
+ - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
112
+ - Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
113
+
114
+ ### 5. Severity Assignment
115
+
116
+ Use this heuristic to prioritize findings:
117
+
118
+ - **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
119
+ - **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
120
+ - **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
121
+ - **LOW**: Style/wording improvements, minor redundancy not affecting execution order
122
+
123
+ ### 6. Produce Compact Analysis Report
124
+
125
+ Output a Markdown report (no file writes) with the following structure:
126
+
127
+ ## Specification Analysis Report
128
+
129
+ | ID | Category | Severity | Location(s) | Summary | Recommendation |
130
+ |----|----------|----------|-------------|---------|----------------|
131
+ | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
132
+
133
+ (Add one row per finding; generate stable IDs prefixed by category initial.)
134
+
135
+ **Coverage Summary Table:**
136
+
137
+ | Requirement Key | Has Task? | Task IDs | Notes |
138
+ |-----------------|-----------|----------|-------|
139
+
140
+ **Constitution Alignment Issues:** (if any)
141
+
142
+ **Unmapped Tasks:** (if any)
143
+
144
+ **Metrics:**
145
+
146
+ - Total Requirements
147
+ - Total Tasks
148
+ - Coverage % (requirements with >=1 task)
149
+ - Ambiguity Count
150
+ - Duplication Count
151
+ - Critical Issues Count
152
+
153
+ ### 7. Provide Next Actions
154
+
155
+ At end of report, output a concise Next Actions block:
156
+
157
+ - If CRITICAL issues exist: Recommend resolving before `/speckit.implement`
158
+ - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
159
+ - Provide explicit command suggestions: e.g., "Run /speckit.specify with refinement", "Run /speckit.plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
160
+
161
+ ### 8. Offer Remediation
162
+
163
+ Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
164
+
165
+ ## Operating Principles
166
+
167
+ ### Context Efficiency
168
+
169
+ - **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
170
+ - **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
171
+ - **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
172
+ - **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
173
+
174
+ ### Analysis Guidelines
175
+
176
+ - **NEVER modify files** (this is read-only analysis)
177
+ - **NEVER hallucinate missing sections** (if absent, report them accurately)
178
+ - **Prioritize constitution violations** (these are always CRITICAL)
179
+ - **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
180
+ - **Report zero issues gracefully** (emit success report with coverage statistics)
181
+
182
+ ## Context
183
+
184
+ $ARGUMENTS