@synth-coder/memhub 0.2.4 → 0.2.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 (53) hide show
  1. package/.eslintrc.cjs +45 -45
  2. package/.factory/commands/opsx-apply.md +150 -150
  3. package/.factory/commands/opsx-archive.md +155 -155
  4. package/.factory/commands/opsx-explore.md +171 -171
  5. package/.factory/commands/opsx-propose.md +104 -104
  6. package/.factory/skills/openspec-apply-change/SKILL.md +156 -156
  7. package/.factory/skills/openspec-archive-change/SKILL.md +114 -114
  8. package/.factory/skills/openspec-explore/SKILL.md +288 -288
  9. package/.factory/skills/openspec-propose/SKILL.md +110 -110
  10. package/.github/workflows/ci.yml +110 -110
  11. package/.github/workflows/release.yml +3 -0
  12. package/.iflow/commands/opsx-apply.md +152 -152
  13. package/.iflow/commands/opsx-archive.md +157 -157
  14. package/.iflow/commands/opsx-explore.md +173 -173
  15. package/.iflow/commands/opsx-propose.md +106 -106
  16. package/.iflow/skills/openspec-apply-change/SKILL.md +156 -156
  17. package/.iflow/skills/openspec-archive-change/SKILL.md +114 -114
  18. package/.iflow/skills/openspec-explore/SKILL.md +288 -288
  19. package/.iflow/skills/openspec-propose/SKILL.md +110 -110
  20. package/.prettierrc +11 -11
  21. package/AGENTS.md +167 -167
  22. package/README.md +17 -9
  23. package/README.zh-CN.md +246 -238
  24. package/dist/src/cli/agents/index.d.ts +0 -1
  25. package/dist/src/cli/agents/index.d.ts.map +1 -1
  26. package/dist/src/cli/agents/index.js +0 -3
  27. package/dist/src/cli/agents/index.js.map +1 -1
  28. package/dist/src/cli/index.js +0 -0
  29. package/dist/src/cli/init.d.ts.map +1 -1
  30. package/dist/src/cli/init.js +4 -24
  31. package/dist/src/cli/init.js.map +1 -1
  32. package/dist/src/cli/types.d.ts +2 -2
  33. package/dist/src/cli/types.d.ts.map +1 -1
  34. package/dist/src/cli/types.js +0 -11
  35. package/dist/src/cli/types.js.map +1 -1
  36. package/docs/user-guide.md +8 -6
  37. package/package.json +16 -16
  38. package/src/cli/agents/claude-code.ts +1 -1
  39. package/src/cli/agents/cline.ts +1 -1
  40. package/src/cli/agents/codex.ts +2 -2
  41. package/src/cli/agents/cursor.ts +1 -1
  42. package/src/cli/agents/factory-droid.ts +1 -1
  43. package/src/cli/agents/gemini-cli.ts +1 -1
  44. package/src/cli/agents/windsurf.ts +1 -1
  45. package/src/cli/init.ts +14 -14
  46. package/test/cli/init.test.ts +23 -1
  47. package/tsconfig.json +25 -25
  48. package/tsconfig.test.json +8 -8
  49. package/vitest.config.ts +29 -29
  50. package/dist/src/cli/agents/codex.d.ts +0 -5
  51. package/dist/src/cli/agents/codex.d.ts.map +0 -1
  52. package/dist/src/cli/agents/codex.js +0 -14
  53. package/dist/src/cli/agents/codex.js.map +0 -1
@@ -1,110 +1,110 @@
1
- ---
2
- name: openspec-propose
3
- description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
4
- license: MIT
5
- compatibility: Requires openspec CLI.
6
- metadata:
7
- author: openspec
8
- version: "1.0"
9
- generatedBy: "1.2.0"
10
- ---
11
-
12
- Propose a new change - create the change and generate all artifacts in one step.
13
-
14
- I'll create a change with artifacts:
15
- - proposal.md (what & why)
16
- - design.md (how)
17
- - tasks.md (implementation steps)
18
-
19
- When ready to implement, run /opsx:apply
20
-
21
- ---
22
-
23
- **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
24
-
25
- **Steps**
26
-
27
- 1. **If no clear input provided, ask what they want to build**
28
-
29
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
30
- > "What change do you want to work on? Describe what you want to build or fix."
31
-
32
- From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
33
-
34
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
35
-
36
- 2. **Create the change directory**
37
- ```bash
38
- openspec new change "<name>"
39
- ```
40
- This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
41
-
42
- 3. **Get the artifact build order**
43
- ```bash
44
- openspec status --change "<name>" --json
45
- ```
46
- Parse the JSON to get:
47
- - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
48
- - `artifacts`: list of all artifacts with their status and dependencies
49
-
50
- 4. **Create artifacts in sequence until apply-ready**
51
-
52
- Use the **TodoWrite tool** to track progress through the artifacts.
53
-
54
- Loop through artifacts in dependency order (artifacts with no pending dependencies first):
55
-
56
- a. **For each artifact that is `ready` (dependencies satisfied)**:
57
- - Get instructions:
58
- ```bash
59
- openspec instructions <artifact-id> --change "<name>" --json
60
- ```
61
- - The instructions JSON includes:
62
- - `context`: Project background (constraints for you - do NOT include in output)
63
- - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
64
- - `template`: The structure to use for your output file
65
- - `instruction`: Schema-specific guidance for this artifact type
66
- - `outputPath`: Where to write the artifact
67
- - `dependencies`: Completed artifacts to read for context
68
- - Read any completed dependency files for context
69
- - Create the artifact file using `template` as the structure
70
- - Apply `context` and `rules` as constraints - but do NOT copy them into the file
71
- - Show brief progress: "Created <artifact-id>"
72
-
73
- b. **Continue until all `applyRequires` artifacts are complete**
74
- - After creating each artifact, re-run `openspec status --change "<name>" --json`
75
- - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
76
- - Stop when all `applyRequires` artifacts are done
77
-
78
- c. **If an artifact requires user input** (unclear context):
79
- - Use **AskUserQuestion tool** to clarify
80
- - Then continue with creation
81
-
82
- 5. **Show final status**
83
- ```bash
84
- openspec status --change "<name>"
85
- ```
86
-
87
- **Output**
88
-
89
- After completing all artifacts, summarize:
90
- - Change name and location
91
- - List of artifacts created with brief descriptions
92
- - What's ready: "All artifacts created! Ready for implementation."
93
- - Prompt: "Run `/opsx:apply` or ask me to implement to start working on the tasks."
94
-
95
- **Artifact Creation Guidelines**
96
-
97
- - Follow the `instruction` field from `openspec instructions` for each artifact type
98
- - The schema defines what each artifact should contain - follow it
99
- - Read dependency artifacts for context before creating new ones
100
- - Use `template` as the structure for your output file - fill in its sections
101
- - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
102
- - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
103
- - These guide what you write, but should never appear in the output
104
-
105
- **Guardrails**
106
- - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
107
- - Always read dependency artifacts before creating a new one
108
- - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
109
- - If a change with that name already exists, ask if user wants to continue it or create a new one
110
- - Verify each artifact file exists after writing before proceeding to next
1
+ ---
2
+ name: openspec-propose
3
+ description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
4
+ license: MIT
5
+ compatibility: Requires openspec CLI.
6
+ metadata:
7
+ author: openspec
8
+ version: "1.0"
9
+ generatedBy: "1.2.0"
10
+ ---
11
+
12
+ Propose a new change - create the change and generate all artifacts in one step.
13
+
14
+ I'll create a change with artifacts:
15
+ - proposal.md (what & why)
16
+ - design.md (how)
17
+ - tasks.md (implementation steps)
18
+
19
+ When ready to implement, run /opsx:apply
20
+
21
+ ---
22
+
23
+ **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
24
+
25
+ **Steps**
26
+
27
+ 1. **If no clear input provided, ask what they want to build**
28
+
29
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
30
+ > "What change do you want to work on? Describe what you want to build or fix."
31
+
32
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
33
+
34
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
35
+
36
+ 2. **Create the change directory**
37
+ ```bash
38
+ openspec new change "<name>"
39
+ ```
40
+ This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
41
+
42
+ 3. **Get the artifact build order**
43
+ ```bash
44
+ openspec status --change "<name>" --json
45
+ ```
46
+ Parse the JSON to get:
47
+ - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
48
+ - `artifacts`: list of all artifacts with their status and dependencies
49
+
50
+ 4. **Create artifacts in sequence until apply-ready**
51
+
52
+ Use the **TodoWrite tool** to track progress through the artifacts.
53
+
54
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
55
+
56
+ a. **For each artifact that is `ready` (dependencies satisfied)**:
57
+ - Get instructions:
58
+ ```bash
59
+ openspec instructions <artifact-id> --change "<name>" --json
60
+ ```
61
+ - The instructions JSON includes:
62
+ - `context`: Project background (constraints for you - do NOT include in output)
63
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
64
+ - `template`: The structure to use for your output file
65
+ - `instruction`: Schema-specific guidance for this artifact type
66
+ - `outputPath`: Where to write the artifact
67
+ - `dependencies`: Completed artifacts to read for context
68
+ - Read any completed dependency files for context
69
+ - Create the artifact file using `template` as the structure
70
+ - Apply `context` and `rules` as constraints - but do NOT copy them into the file
71
+ - Show brief progress: "Created <artifact-id>"
72
+
73
+ b. **Continue until all `applyRequires` artifacts are complete**
74
+ - After creating each artifact, re-run `openspec status --change "<name>" --json`
75
+ - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
76
+ - Stop when all `applyRequires` artifacts are done
77
+
78
+ c. **If an artifact requires user input** (unclear context):
79
+ - Use **AskUserQuestion tool** to clarify
80
+ - Then continue with creation
81
+
82
+ 5. **Show final status**
83
+ ```bash
84
+ openspec status --change "<name>"
85
+ ```
86
+
87
+ **Output**
88
+
89
+ After completing all artifacts, summarize:
90
+ - Change name and location
91
+ - List of artifacts created with brief descriptions
92
+ - What's ready: "All artifacts created! Ready for implementation."
93
+ - Prompt: "Run `/opsx:apply` or ask me to implement to start working on the tasks."
94
+
95
+ **Artifact Creation Guidelines**
96
+
97
+ - Follow the `instruction` field from `openspec instructions` for each artifact type
98
+ - The schema defines what each artifact should contain - follow it
99
+ - Read dependency artifacts for context before creating new ones
100
+ - Use `template` as the structure for your output file - fill in its sections
101
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
102
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
103
+ - These guide what you write, but should never appear in the output
104
+
105
+ **Guardrails**
106
+ - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
107
+ - Always read dependency artifacts before creating a new one
108
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
109
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
110
+ - Verify each artifact file exists after writing before proceeding to next
@@ -1,110 +1,110 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main, master]
6
- pull_request:
7
- branches: [main, master]
8
-
9
- jobs:
10
- quality:
11
- name: Quality Gate
12
- runs-on: ubuntu-latest
13
-
14
- strategy:
15
- matrix:
16
- node-version: [20.x, 22.x]
17
-
18
- steps:
19
- - name: Checkout repository
20
- uses: actions/checkout@v4
21
-
22
- - name: Setup Node.js ${{ matrix.node-version }}
23
- uses: actions/setup-node@v4
24
- with:
25
- node-version: ${{ matrix.node-version }}
26
-
27
- - name: Setup pnpm
28
- uses: pnpm/action-setup@v4
29
- with:
30
- version: 9
31
-
32
- - name: Get pnpm store directory
33
- shell: bash
34
- run: |
35
- echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
36
- id: pnpm-cache
37
-
38
- - name: Setup pnpm cache
39
- uses: actions/cache@v4
40
- with:
41
- path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
42
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43
- restore-keys: |
44
- ${{ runner.os }}-pnpm-store-
45
-
46
- - name: Install dependencies
47
- run: pnpm install --frozen-lockfile
48
-
49
- - name: Run linter
50
- run: pnpm run lint
51
-
52
- - name: Check formatting
53
- run: pnpm run format:check
54
-
55
- - name: Run type check
56
- run: pnpm run typecheck
57
-
58
- - name: Run tests with coverage
59
- run: pnpm run test:coverage
60
-
61
- - name: Upload coverage reports
62
- uses: codecov/codecov-action@v3
63
- if: matrix.node-version == '20.x'
64
- with:
65
- files: ./coverage/lcov.info
66
- fail_ci_if_error: false
67
-
68
- build:
69
- name: Build
70
- runs-on: ubuntu-latest
71
- needs: quality
72
-
73
- steps:
74
- - name: Checkout repository
75
- uses: actions/checkout@v4
76
-
77
- - name: Setup Node.js
78
- uses: actions/setup-node@v4
79
- with:
80
- node-version: 20.x
81
-
82
- - name: Setup pnpm
83
- uses: pnpm/action-setup@v4
84
- with:
85
- version: 9
86
-
87
- - name: Get pnpm store directory
88
- shell: bash
89
- run: |
90
- echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
91
- id: pnpm-cache
92
-
93
- - name: Setup pnpm cache
94
- uses: actions/cache@v4
95
- with:
96
- path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
97
- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
98
- restore-keys: |
99
- ${{ runner.os }}-pnpm-store-
100
-
101
- - name: Install dependencies
102
- run: pnpm install --frozen-lockfile
103
-
104
- - name: Build project
105
- run: pnpm run build
106
-
107
- - name: Check build output
108
- run: |
109
- test -f dist/src/index.js
110
- test -f dist/src/server/mcp-server.js
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ quality:
11
+ name: Quality Gate
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ matrix:
16
+ node-version: [20.x, 22.x]
17
+
18
+ steps:
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Setup Node.js ${{ matrix.node-version }}
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: ${{ matrix.node-version }}
26
+
27
+ - name: Setup pnpm
28
+ uses: pnpm/action-setup@v4
29
+ with:
30
+ version: 9
31
+
32
+ - name: Get pnpm store directory
33
+ shell: bash
34
+ run: |
35
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
36
+ id: pnpm-cache
37
+
38
+ - name: Setup pnpm cache
39
+ uses: actions/cache@v4
40
+ with:
41
+ path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
42
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43
+ restore-keys: |
44
+ ${{ runner.os }}-pnpm-store-
45
+
46
+ - name: Install dependencies
47
+ run: pnpm install --frozen-lockfile
48
+
49
+ - name: Run linter
50
+ run: pnpm run lint
51
+
52
+ - name: Check formatting
53
+ run: pnpm run format:check
54
+
55
+ - name: Run type check
56
+ run: pnpm run typecheck
57
+
58
+ - name: Run tests with coverage
59
+ run: pnpm run test:coverage
60
+
61
+ - name: Upload coverage reports
62
+ uses: codecov/codecov-action@v3
63
+ if: matrix.node-version == '20.x'
64
+ with:
65
+ files: ./coverage/lcov.info
66
+ fail_ci_if_error: false
67
+
68
+ build:
69
+ name: Build
70
+ runs-on: ubuntu-latest
71
+ needs: quality
72
+
73
+ steps:
74
+ - name: Checkout repository
75
+ uses: actions/checkout@v4
76
+
77
+ - name: Setup Node.js
78
+ uses: actions/setup-node@v4
79
+ with:
80
+ node-version: 20.x
81
+
82
+ - name: Setup pnpm
83
+ uses: pnpm/action-setup@v4
84
+ with:
85
+ version: 9
86
+
87
+ - name: Get pnpm store directory
88
+ shell: bash
89
+ run: |
90
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
91
+ id: pnpm-cache
92
+
93
+ - name: Setup pnpm cache
94
+ uses: actions/cache@v4
95
+ with:
96
+ path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
97
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
98
+ restore-keys: |
99
+ ${{ runner.os }}-pnpm-store-
100
+
101
+ - name: Install dependencies
102
+ run: pnpm install --frozen-lockfile
103
+
104
+ - name: Build project
105
+ run: pnpm run build
106
+
107
+ - name: Check build output
108
+ run: |
109
+ test -f dist/src/index.js
110
+ test -f dist/src/server/mcp-server.js
@@ -5,6 +5,9 @@ on:
5
5
  tags:
6
6
  - 'v*'
7
7
 
8
+ permissions:
9
+ contents: write
10
+
8
11
  jobs:
9
12
  quality:
10
13
  name: Quality Gate