legacyver 2.1.4 → 2.1.6

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 (79) hide show
  1. package/bin/legacyver.js +16 -0
  2. package/legacyver-docs/components.md +35 -31
  3. package/legacyver-docs/index.md +1 -1
  4. package/package.json +3 -1
  5. package/src/api/auth.js +69 -0
  6. package/src/cli/commands/analyze.js +22 -0
  7. package/src/cli/commands/login.js +68 -0
  8. package/src/cli/commands/logout.js +22 -0
  9. package/src/cli/commands/providers.js +13 -2
  10. package/src/cli/ui.js +13 -0
  11. package/src/db/config.js +18 -0
  12. package/src/db/index.js +145 -0
  13. package/src/llm/providers/groq.js +4 -2
  14. package/src/llm/validator.js +1 -1
  15. package/src/utils/config.js +27 -1
  16. package/.agent/skills/openspec-apply-change/SKILL.md +0 -156
  17. package/.agent/skills/openspec-archive-change/SKILL.md +0 -114
  18. package/.agent/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  19. package/.agent/skills/openspec-continue-change/SKILL.md +0 -118
  20. package/.agent/skills/openspec-explore/SKILL.md +0 -290
  21. package/.agent/skills/openspec-ff-change/SKILL.md +0 -101
  22. package/.agent/skills/openspec-new-change/SKILL.md +0 -74
  23. package/.agent/skills/openspec-onboard/SKILL.md +0 -529
  24. package/.agent/skills/openspec-sync-specs/SKILL.md +0 -138
  25. package/.agent/skills/openspec-verify-change/SKILL.md +0 -168
  26. package/.agent/workflows/opsx-apply.md +0 -149
  27. package/.agent/workflows/opsx-archive.md +0 -154
  28. package/.agent/workflows/opsx-bulk-archive.md +0 -239
  29. package/.agent/workflows/opsx-continue.md +0 -111
  30. package/.agent/workflows/opsx-explore.md +0 -171
  31. package/.agent/workflows/opsx-ff.md +0 -91
  32. package/.agent/workflows/opsx-new.md +0 -66
  33. package/.agent/workflows/opsx-onboard.md +0 -522
  34. package/.agent/workflows/opsx-sync.md +0 -131
  35. package/.agent/workflows/opsx-verify.md +0 -161
  36. package/.github/prompts/opsx-apply.prompt.md +0 -149
  37. package/.github/prompts/opsx-archive.prompt.md +0 -154
  38. package/.github/prompts/opsx-bulk-archive.prompt.md +0 -239
  39. package/.github/prompts/opsx-continue.prompt.md +0 -111
  40. package/.github/prompts/opsx-explore.prompt.md +0 -171
  41. package/.github/prompts/opsx-ff.prompt.md +0 -91
  42. package/.github/prompts/opsx-new.prompt.md +0 -66
  43. package/.github/prompts/opsx-onboard.prompt.md +0 -522
  44. package/.github/prompts/opsx-sync.prompt.md +0 -131
  45. package/.github/prompts/opsx-verify.prompt.md +0 -161
  46. package/.github/skills/openspec-apply-change/SKILL.md +0 -156
  47. package/.github/skills/openspec-archive-change/SKILL.md +0 -114
  48. package/.github/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  49. package/.github/skills/openspec-continue-change/SKILL.md +0 -118
  50. package/.github/skills/openspec-explore/SKILL.md +0 -290
  51. package/.github/skills/openspec-ff-change/SKILL.md +0 -101
  52. package/.github/skills/openspec-new-change/SKILL.md +0 -74
  53. package/.github/skills/openspec-onboard/SKILL.md +0 -529
  54. package/.github/skills/openspec-sync-specs/SKILL.md +0 -138
  55. package/.github/skills/openspec-verify-change/SKILL.md +0 -168
  56. package/.legacyverrc +0 -6
  57. package/.opencode/command/opsx-apply.md +0 -149
  58. package/.opencode/command/opsx-archive.md +0 -154
  59. package/.opencode/command/opsx-bulk-archive.md +0 -239
  60. package/.opencode/command/opsx-continue.md +0 -111
  61. package/.opencode/command/opsx-explore.md +0 -171
  62. package/.opencode/command/opsx-ff.md +0 -91
  63. package/.opencode/command/opsx-new.md +0 -66
  64. package/.opencode/command/opsx-onboard.md +0 -522
  65. package/.opencode/command/opsx-sync.md +0 -131
  66. package/.opencode/command/opsx-verify.md +0 -161
  67. package/.opencode/skills/openspec-apply-change/SKILL.md +0 -156
  68. package/.opencode/skills/openspec-archive-change/SKILL.md +0 -114
  69. package/.opencode/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  70. package/.opencode/skills/openspec-continue-change/SKILL.md +0 -118
  71. package/.opencode/skills/openspec-explore/SKILL.md +0 -290
  72. package/.opencode/skills/openspec-ff-change/SKILL.md +0 -101
  73. package/.opencode/skills/openspec-new-change/SKILL.md +0 -74
  74. package/.opencode/skills/openspec-onboard/SKILL.md +0 -529
  75. package/.opencode/skills/openspec-sync-specs/SKILL.md +0 -138
  76. package/.opencode/skills/openspec-verify-change/SKILL.md +0 -168
  77. package/legacyver-docs/config.md +0 -21
  78. package/legacyver-docs/errors.md +0 -63
  79. package/legacyver-docs/logger.md +0 -71
@@ -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,21 +0,0 @@
1
- ## Overview
2
- The provided JavaScript file, `config.js`, contains a function for loading configuration from a file and merging it with command-line interface (CLI) flags. The function, `loadConfig`, utilizes the `cosmiconfig` library to search for configuration files in specific locations.
3
-
4
- ## Functions
5
- ### loadConfig
6
- #### Description
7
- Loads configuration from a file and merges it with CLI flags, with CLI flags taking precedence over file configuration.
8
-
9
- #### Parameters
10
- | Name | Type | Description |
11
- | --- | --- | --- |
12
- | cliFlags | Object | Command-line interface flags to merge with file configuration |
13
-
14
- #### Return Value
15
- An object containing the merged configuration, with defaults applied where necessary.
16
-
17
- ## Dependencies
18
- * `cosmiconfig`: a library for searching and loading configuration files
19
-
20
- ## Usage Example
21
- Although a specific usage example is not provided in the code, the `loadConfig` function can be used by passing an object containing CLI flags, like so: `loadConfig({ provider: 'customProvider' })`. This would load the configuration from a file, merge it with the provided CLI flags, and return the resulting configuration object.
@@ -1,63 +0,0 @@
1
- ## Overview
2
- The errors.js file contains custom error classes for Legacyver, a set of classes that extend the built-in Error class to provide more specific error handling. These classes include LegacyverError, NoApiKeyError, RateLimitError, ParseError, and RenderError.
3
-
4
- ## Functions
5
- ### LegacyverError
6
- #### Description
7
- The LegacyverError class is the base class for all custom error classes in Legacyver. It extends the built-in Error class and adds a code property.
8
- #### Parameters
9
- | Parameter | Type | Description |
10
- | --- | --- | --- |
11
- | message | string | The error message |
12
- | code | string | The error code (default: 'LEGACYVER_ERROR') |
13
- #### Return Value
14
- An instance of the LegacyverError class
15
-
16
- ### NoApiKeyError
17
- #### Description
18
- The NoApiKeyError class extends LegacyverError and is thrown when no API key is found for a provider.
19
- #### Parameters
20
- | Parameter | Type | Description |
21
- | --- | --- | --- |
22
- | provider | string | The provider for which no API key was found |
23
- #### Return Value
24
- An instance of the NoApiKeyError class
25
-
26
- ### RateLimitError
27
- #### Description
28
- The RateLimitError class extends LegacyverError and is thrown when the rate limit is exceeded for a provider.
29
- #### Parameters
30
- | Parameter | Type | Description |
31
- | --- | --- | --- |
32
- | provider | string | The provider for which the rate limit was exceeded |
33
- | retryAfter | number | The time to wait before retrying (default: 1000) |
34
- #### Return Value
35
- An instance of the RateLimitError class
36
-
37
- ### ParseError
38
- #### Description
39
- The ParseError class extends LegacyverError and is thrown when a file cannot be parsed.
40
- #### Parameters
41
- | Parameter | Type | Description |
42
- | --- | --- | --- |
43
- | filePath | string | The path to the file that could not be parsed |
44
- | originalError | Error | The original error that occurred during parsing |
45
- #### Return Value
46
- An instance of the ParseError class
47
-
48
- ### RenderError
49
- #### Description
50
- The RenderError class extends LegacyverError and is thrown when rendering fails for a format.
51
- #### Parameters
52
- | Parameter | Type | Description |
53
- | --- | --- | --- |
54
- | format | string | The format for which rendering failed |
55
- | originalError | Error | The original error that occurred during rendering |
56
- #### Return Value
57
- An instance of the RenderError class
58
-
59
- ## Dependencies
60
- * None (built-in Error class)
61
-
62
- ## Usage Example
63
- No clear usage pattern is visible in the provided code. These error classes are likely used throughout the Legacyver application to handle specific error cases.
@@ -1,71 +0,0 @@
1
- ## Overview
2
- This module provides a simple logging system with adjustable log levels and colorized output. It exports functions for logging at different levels, as well as setting the current log level and CI environment.
3
-
4
- ## Functions
5
- ### setLevel
6
- Description: Sets the current log level.
7
- Parameters:
8
- | Param | Description |
9
- | --- | --- |
10
- | level | The new log level (one of 'debug', 'info', 'warn', 'error') |
11
- Return Value: None
12
-
13
- ### setCI
14
- Description: Sets whether the logger is running in a CI environment.
15
- Parameters:
16
- | Param | Description |
17
- | --- | --- |
18
- | val | A boolean indicating whether the logger is in a CI environment |
19
- Return Value: None
20
-
21
- ### shouldLog
22
- Description: Checks whether a log message of a given level should be logged.
23
- Parameters:
24
- | Param | Description |
25
- | --- | --- |
26
- | level | The log level to check |
27
- Return Value: A boolean indicating whether the log message should be logged
28
-
29
- ### debug
30
- Description: Logs a debug message if the current log level is debug or lower.
31
- Parameters:
32
- | Param | Description |
33
- | --- | --- |
34
- | ...args | The message to log |
35
- Return Value: None
36
-
37
- ### info
38
- Description: Logs an info message if the current log level is info or lower.
39
- Parameters:
40
- | Param | Description |
41
- | --- | --- |
42
- | ...args | The message to log |
43
- Return Value: None
44
-
45
- ### warn
46
- Description: Logs a warning message if the current log level is warn or lower.
47
- Parameters:
48
- | Param | Description |
49
- | --- | --- |
50
- | ...args | The message to log |
51
- Return Value: None
52
-
53
- ### error
54
- Description: Logs an error message if the current log level is error or lower.
55
- Parameters:
56
- | Param | Description |
57
- | --- | --- |
58
- | ...args | The message to log |
59
- Return Value: None
60
-
61
- ## Dependencies
62
- * picocolors (as pc)
63
-
64
- ## Usage Example
65
- No specific usage example is visible in the provided code, but the exported functions can be used as follows:
66
- ```javascript
67
- const logger = require('./logger');
68
- logger.setLevel('debug');
69
- logger.debug('This is a debug message');
70
- logger.info('This is an info message');
71
- ```