legacyver 2.1.3 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/.env +1 -0
  2. package/.env.example +17 -0
  3. package/.gitattributes +0 -0
  4. package/bin/legacyver.js +18 -2
  5. package/legacyver-docs/SUMMARY.md +1 -3
  6. package/legacyver-docs/components.md +31 -22
  7. package/legacyver-docs/index.md +5 -7
  8. package/package.json +3 -1
  9. package/src/api/auth.js +69 -0
  10. package/src/cli/commands/analyze.js +40 -9
  11. package/src/cli/commands/init.js +14 -7
  12. package/src/cli/commands/login.js +68 -0
  13. package/src/cli/commands/logout.js +22 -0
  14. package/src/cli/commands/providers.js +29 -11
  15. package/src/cli/ui.js +38 -0
  16. package/src/db/config.js +18 -0
  17. package/src/db/index.js +145 -0
  18. package/src/llm/free-model.js +12 -3
  19. package/src/llm/index.js +9 -6
  20. package/src/llm/providers/groq.js +4 -2
  21. package/src/llm/providers/kimi.js +86 -0
  22. package/src/llm/validator.js +1 -1
  23. package/src/utils/config.js +28 -2
  24. package/temp_credentials/README.md +61 -0
  25. package/temp_credentials/db-credentials.txt +6 -0
  26. package/temp_credentials/domain.txt +1 -0
  27. package/temp_credentials/kubeconfig.yaml +18 -0
  28. package/temp_credentials/kubernetes-credentials.txt +2 -0
  29. package/.agent/skills/openspec-apply-change/SKILL.md +0 -156
  30. package/.agent/skills/openspec-archive-change/SKILL.md +0 -114
  31. package/.agent/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  32. package/.agent/skills/openspec-continue-change/SKILL.md +0 -118
  33. package/.agent/skills/openspec-explore/SKILL.md +0 -290
  34. package/.agent/skills/openspec-ff-change/SKILL.md +0 -101
  35. package/.agent/skills/openspec-new-change/SKILL.md +0 -74
  36. package/.agent/skills/openspec-onboard/SKILL.md +0 -529
  37. package/.agent/skills/openspec-sync-specs/SKILL.md +0 -138
  38. package/.agent/skills/openspec-verify-change/SKILL.md +0 -168
  39. package/.agent/workflows/opsx-apply.md +0 -149
  40. package/.agent/workflows/opsx-archive.md +0 -154
  41. package/.agent/workflows/opsx-bulk-archive.md +0 -239
  42. package/.agent/workflows/opsx-continue.md +0 -111
  43. package/.agent/workflows/opsx-explore.md +0 -171
  44. package/.agent/workflows/opsx-ff.md +0 -91
  45. package/.agent/workflows/opsx-new.md +0 -66
  46. package/.agent/workflows/opsx-onboard.md +0 -522
  47. package/.agent/workflows/opsx-sync.md +0 -131
  48. package/.agent/workflows/opsx-verify.md +0 -161
  49. package/.github/prompts/opsx-apply.prompt.md +0 -149
  50. package/.github/prompts/opsx-archive.prompt.md +0 -154
  51. package/.github/prompts/opsx-bulk-archive.prompt.md +0 -239
  52. package/.github/prompts/opsx-continue.prompt.md +0 -111
  53. package/.github/prompts/opsx-explore.prompt.md +0 -171
  54. package/.github/prompts/opsx-ff.prompt.md +0 -91
  55. package/.github/prompts/opsx-new.prompt.md +0 -66
  56. package/.github/prompts/opsx-onboard.prompt.md +0 -522
  57. package/.github/prompts/opsx-sync.prompt.md +0 -131
  58. package/.github/prompts/opsx-verify.prompt.md +0 -161
  59. package/.github/skills/openspec-apply-change/SKILL.md +0 -156
  60. package/.github/skills/openspec-archive-change/SKILL.md +0 -114
  61. package/.github/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  62. package/.github/skills/openspec-continue-change/SKILL.md +0 -118
  63. package/.github/skills/openspec-explore/SKILL.md +0 -290
  64. package/.github/skills/openspec-ff-change/SKILL.md +0 -101
  65. package/.github/skills/openspec-new-change/SKILL.md +0 -74
  66. package/.github/skills/openspec-onboard/SKILL.md +0 -529
  67. package/.github/skills/openspec-sync-specs/SKILL.md +0 -138
  68. package/.github/skills/openspec-verify-change/SKILL.md +0 -168
  69. package/.legacyverignore.example +0 -43
  70. package/.legacyverrc +0 -7
  71. package/.opencode/command/opsx-apply.md +0 -149
  72. package/.opencode/command/opsx-archive.md +0 -154
  73. package/.opencode/command/opsx-bulk-archive.md +0 -239
  74. package/.opencode/command/opsx-continue.md +0 -111
  75. package/.opencode/command/opsx-explore.md +0 -171
  76. package/.opencode/command/opsx-ff.md +0 -91
  77. package/.opencode/command/opsx-new.md +0 -66
  78. package/.opencode/command/opsx-onboard.md +0 -522
  79. package/.opencode/command/opsx-sync.md +0 -131
  80. package/.opencode/command/opsx-verify.md +0 -161
  81. package/.opencode/skills/openspec-apply-change/SKILL.md +0 -156
  82. package/.opencode/skills/openspec-archive-change/SKILL.md +0 -114
  83. package/.opencode/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  84. package/.opencode/skills/openspec-continue-change/SKILL.md +0 -118
  85. package/.opencode/skills/openspec-explore/SKILL.md +0 -290
  86. package/.opencode/skills/openspec-ff-change/SKILL.md +0 -101
  87. package/.opencode/skills/openspec-new-change/SKILL.md +0 -74
  88. package/.opencode/skills/openspec-onboard/SKILL.md +0 -529
  89. package/.opencode/skills/openspec-sync-specs/SKILL.md +0 -138
  90. package/.opencode/skills/openspec-verify-change/SKILL.md +0 -168
  91. package/legacyver-docs/config.md +0 -30
  92. package/legacyver-docs/errors.md +0 -74
  93. package/legacyver-docs/logger.md +0 -83
  94. package/nul +0 -2
@@ -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,30 +0,0 @@
1
- ## Overview
2
- This is a JavaScript module that exports a single function `loadConfig`, which loads configuration from a file and merges with CLI flags.
3
-
4
- ## Functions
5
- ### `loadConfig`
6
-
7
- #### Description:
8
- Load configuration from file and merge with CLI flags.
9
- CLI flags always win over file config.
10
-
11
- #### Params Table:
12
-
13
- | Name | Type |
14
- | --- | --- |
15
- | `cliFlags` | Object |
16
-
17
- #### Return Value:
18
- Object
19
-
20
- ```javascript
21
- function loadConfig(cliFlags = {}) {
22
- // ...
23
- }
24
- ```
25
-
26
- ## Dependencies
27
- * `cosmiconfig: cosmiconfigSync`
28
-
29
- ## Usage Example
30
- No clear pattern is visible in the code to demonstrate usage.
@@ -1,74 +0,0 @@
1
- ## Overview
2
- This file exports five custom error classes for use in a Legacyver application.
3
-
4
- ## Functions
5
-
6
- ### `LegacyverError`
7
- #### Description
8
- A base class for all custom errors in Legacyver.
9
- #### Parameters
10
- | Name | Type | Default Value |
11
- | --- | --- | --- |
12
- | message | string | |
13
- | code | string | 'LEGACYVER_ERROR' |
14
-
15
- #### Return Value
16
- None.
17
-
18
- ### `NoApiKeyError`
19
- #### Description
20
- Raised when no API key is found for a provider.
21
- #### Parameters
22
- | Name | Type | Required | Default Value |
23
- | --- | --- | --- | --- |
24
- | provider | string | | |
25
-
26
- #### Return Value
27
- None.
28
-
29
- #### Detected Patterns:
30
- - The error message includes a suggestion to set the `OPENROUTER_API_KEY` environment variable or run `legacyver init`.
31
- - The error message includes a link to obtain an API key at https://openrouter.ai/keys.
32
-
33
- ### `RateLimitError`
34
- #### Description
35
- Raised when the rate limit is exceeded for a provider.
36
- #### Parameters
37
- | Name | Type | Required | Default Value |
38
- | --- | --- | --- | --- |
39
- | provider | string | | |
40
- | retryAfter | number | | 1000 |
41
-
42
- #### Return Value
43
- None.
44
-
45
- #### Detected Patterns:
46
- - The error message includes a suggestion to retry.
47
- - The error message indicates the amount of time that must pass before retrying (1000ms by default).
48
-
49
- ### `ParseError`
50
- #### Description
51
- Raised when there is an issue parsing a file.
52
- #### Parameters
53
- | Name | Type | Required | Default Value |
54
- | --- | --- | --- | --- |
55
- | filePath | string | | |
56
- | originalError | Error | | |
57
-
58
- #### Return Value
59
- None.
60
-
61
- ### `RenderError`
62
- #### Description
63
- Raised when there is an issue rendering a format.
64
- #### Parameters
65
- | Name | Type | Required | Default Value |
66
- | --- | --- | --- | --- |
67
- | format | string | | |
68
- | originalError | Error | | |
69
-
70
- #### Return Value
71
- None.
72
-
73
- ## Dependencies
74
- * `Error`
@@ -1,83 +0,0 @@
1
- ## Overview
2
- This module provides a logging system with configurable log levels and colorful output.
3
-
4
- ## Functions
5
-
6
- ### `setLevel(level)`
7
- #### Params | Description
8
- ----------|-------------
9
- `level` | The desired log level
10
-
11
- #### Returns
12
- None
13
-
14
- Sets the current log level to the specified `level`.
15
-
16
- ### `setCI(val)`
17
- #### Params | Description
18
- ----------|-------------
19
- `val` | A boolean indicating whether CI mode is enabled
20
-
21
- #### Returns
22
- None
23
-
24
- Toggles the CI mode on or off.
25
-
26
- ### `shouldLog(level)`
27
- #### Params | Description
28
- ----------|-------------
29
- `level` | The log level to check for
30
-
31
- #### Returns
32
- Boolean
33
- Determines whether the current log level allows logging at the specified `level`.
34
-
35
- ### `debug(...args)`
36
- #### Params | Description
37
- ----------|-------------
38
- `...args` | Variable number of arguments to be logged as debug output
39
-
40
- #### Returns
41
- None
42
- Logs the provided `args` to the console with a gray '[debug]' prefix if the current log level allows it.
43
-
44
- ### `info(...args)`
45
- #### Params | Description
46
- ----------|-------------
47
- `...args` | Variable number of arguments to be logged as info output
48
-
49
- #### Returns
50
- None
51
- Logs the provided `args` to the console with a cyan '[info]' prefix if the current log level allows it.
52
-
53
- ### `warn(...args)`
54
- #### Params | Description
55
- ----------|-------------
56
- `...args` | Variable number of arguments to be logged as warn output
57
-
58
- #### Returns
59
- None
60
- Logs the provided `args` to the console with a yellow '[warn]' prefix if the current log level allows it.
61
-
62
- ### `error(...args)`
63
- #### Params | Description
64
- ----------|-------------
65
- `...args` | Variable number of arguments to be logged as error output
66
-
67
- #### Returns
68
- None
69
- Logs the provided `args` to the console with a red '[error]' prefix if the current log level allows it.
70
-
71
- ## Dependencies
72
- * picocolors (`pc`)
73
-
74
- ## Usage Example
75
- ```javascript
76
- const logger = require('./logger');
77
-
78
- logger.debug('This is a debug message');
79
- logger.info('This is an info message');
80
- logger.warn('This is a warn message');
81
- logger.error('This is an error message');
82
- ```
83
- Note: This example demonstrates the usage of the `debug`, `info`, `warn`, and `error` functions, which are exported from the logger module.
package/nul DELETED
@@ -1,2 +0,0 @@
1
- dir: cannot access '/b': No such file or directory
2
- dir: cannot access '/s': No such file or directory