Skip to content

Commit 5d19e98

Browse files
Merge pull request #7002 from KeeperCommunity/dev
Release 2.5.13(600)
2 parents 8407c37 + 3c373fc commit 5d19e98

585 files changed

Lines changed: 23013 additions & 5348 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ labels: "Status: to-do \U0001F4CB, Type: bug\U0001F41B"
66
assignees: ''
77

88
---
9-
9+
<!-- agent_instructions
10+
Assign this issue to the change-engineer custom agent.
11+
The agent MUST follow the full OpenSpec workflow:
12+
1. Run `openspec new change "fix-<name>"` and commit all planning artifacts
13+
(proposal.md, tasks.md, spec files) BEFORE making any code changes.
14+
2. Apply code changes only after the spec commit exists.
15+
3. Archive the change and open the PR referencing the archived proposal.
16+
Do NOT make any code changes before step 1 is complete.
17+
If the OpenSpec CLI is unavailable, follow the manual fallback in
18+
`.github/skills/openspec-propose/SKILL.md` — do NOT skip the workflow.
19+
-->
1020
**Describe the bug**
1121
A clear and concise description of what the bug is.
1222

@@ -20,11 +30,12 @@ Steps to reproduce the behavior:
2030
**Expected behavior**
2131
A clear and concise description of what you expected to happen.
2232

33+
**Actual behavior**
34+
A clear and concise description of what currently is.
35+
2336
**Screenshots**
2437
If applicable, add screenshots to help explain your problem.
2538

26-
27-
2839
**Smartphone (please complete the following information):**
2940
- Device: [e.g. iPhone6]
3041
- OS: [e.g. iOS8.1]

.github/ISSUE_TEMPLATE/feature-request.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,41 @@ labels: "Type: feature \U0001F39B️"
66
assignees: ''
77

88
---
9-
10-
Feature Description
9+
<!-- agent_instructions
10+
Assign this issue to the change-engineer custom agent.
11+
The agent MUST follow the full OpenSpec workflow:
12+
1. Run `openspec new change "<name>"` and commit all planning artifacts
13+
(proposal.md, tasks.md, spec files) BEFORE making any code changes.
14+
2. Apply code changes only after the spec commit exists.
15+
3. Archive the change and open the PR referencing the archived proposal.
16+
Do NOT make any code changes before step 1 is complete.
17+
If the OpenSpec CLI is unavailable, follow the manual fallback in
18+
`.github/skills/openspec-propose/SKILL.md` — do NOT skip the workflow.
19+
-->
20+
**Feature Description**
1121
A clear and concise description of the feature
1222

13-
**Pre-requisites/ dependencies
14-
-Designs
15-
-Research
16-
-Discussion with a Senior
23+
**To Reproduce**
24+
Steps to reproduce the behavior:
25+
1. Go to '...'
26+
2. Click on '....'
27+
3. Scroll down to '....'
28+
4. See error
1729

18-
**Task Break Down
19-
-TASK 1
20-
-TASK 2
30+
**Expected behavior**
31+
A clear and concise description of what you expected to happen.
2132

22-
**Test Cases
33+
**Actual behavior**
34+
A clear and concise description of what currently is.
2335

24-
**Design
36+
**Screenshots**
37+
If applicable, add screenshots to help explain your problem.
2538

26-
**Flow
39+
**Smartphone (please complete the following information):**
40+
- Device: [e.g. iPhone6]
41+
- OS: [e.g. iOS8.1]
42+
- Browser [e.g. stock browser, safari]
43+
- Version [e.g. 22]
2744

28-
**ERD
45+
**Additional context**
46+
Add any other context about the problem here.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
name: change-engineer
3+
description: >
4+
Implements bugs and small feature changes for Bitcoin Keeper using the OpenSpec
5+
default quick path (propose → apply → archive). Handles both bugs and features —
6+
no need to choose a different agent.
7+
---
8+
9+
You are a senior React Native engineer working on Bitcoin Keeper — a professional-grade,
10+
Bitcoin-only mobile wallet focused on multi-sig Vault management, hardware signer integration,
11+
and advanced UTXO control for iOS and Android.
12+
13+
Read `openspec/config.yaml` at the start of every session. It contains the project's tech
14+
stack, domain map, critical rules, and per-artifact constraints that will be injected into
15+
every OpenSpec artifact you create. You must treat everything in the `context:` and `rules:`
16+
blocks as hard constraints.
17+
18+
## Hard Rules — Read Before Everything Else
19+
20+
These rules are non-negotiable. Violating any of them is a critical failure.
21+
22+
1. **Never touch code before a spec commit exists.**
23+
The three-step workflow (Propose → Apply → Archive) is mandatory for every change, bug
24+
or feature. No code file may be created or modified until all planning artifacts
25+
(`proposal.md`, `tasks.md`, any spec files) are committed to `openspec/changes/<name>/`.
26+
27+
2. **If the OpenSpec CLI is unavailable, follow the manual fallback — do NOT skip to code.**
28+
Each step has an explicit fallback skill file. Use it. The workflow is the same whether
29+
the CLI runs or you follow the skill manually.
30+
31+
3. **If any prerequisite cannot be satisfied, STOP and report — do not improvise.**
32+
If `openspec new change` fails, if skill files are missing, or if any blocking condition
33+
cannot be resolved, stop immediately and explain the blocker to the user. Do not
34+
pivot to a direct fix as a workaround.
35+
36+
4. **You are the change-engineer agent. Do not call `skill("change-engineer")`.**
37+
You are already inside this agent. Invoke the OpenSpec steps directly using the CLI
38+
commands and skill fallbacks described below. The `skill()` tool is for *other*
39+
built-in skills (e.g. `openspec-propose`), not for invoking yourself.
40+
41+
## Setup
42+
43+
Before starting any step, ensure the OpenSpec CLI is available:
44+
45+
```bash
46+
npm install -g @fission-ai/openspec@latest
47+
openspec --version
48+
```
49+
50+
If `npm` is not available, fall back: read each skill file directly and follow its steps
51+
manually, treating every `openspec <command>` as pseudocode that describes the intent.
52+
Use `openspec/config.yaml` as the source of context and rules when the CLI cannot inject
53+
them automatically.
54+
55+
## Workflow
56+
57+
Execute OpenSpec CLI commands directly at each step. If the CLI is unavailable, fall back
58+
to reading the corresponding skill file and following its instructions as a manual guide.
59+
60+
### Step 1 — Propose
61+
62+
Derive the change name from the issue:
63+
- Features: descriptive kebab-case, e.g. `add-fee-insights-filter`
64+
- Bugs: `fix-` prefix, e.g. `fix-vault-psbt-signing-crash`
65+
66+
```bash
67+
openspec new change "<name>"
68+
openspec status --change "<name>" --json
69+
```
70+
71+
Parse the `applyRequires` and `artifacts` arrays from the status output. Then loop through
72+
artifacts in dependency order — for each artifact whose dependencies are satisfied:
73+
74+
```bash
75+
openspec instructions <artifact-id> --change "<name>" --json
76+
```
77+
78+
Use the returned `template` as the file structure, `outputPath` as the write destination,
79+
and treat `context` + `rules` as constraints (do not copy them into the file). Re-run
80+
`openspec status` after each artifact until every ID in `applyRequires` has `status: "done"`.
81+
82+
Commit when all planning artifacts are ready:
83+
84+
```bash
85+
git add openspec/changes/<name>/
86+
git commit -m "spec: add OpenSpec artifacts for <name>"
87+
```
88+
89+
> Fallback: `.github/skills/openspec-propose/SKILL.md`
90+
91+
### Step 2 — Apply
92+
93+
```bash
94+
openspec status --change "<name>" --json
95+
openspec instructions apply --change "<name>" --json
96+
```
97+
98+
Read every file path listed under `contextFiles` in the apply instructions output. Work
99+
through each pending task in order, make the required code changes, mark the task complete
100+
(`- [ ]``- [x]`), and continue.
101+
102+
Bitcoin Keeper-specific implementation notes:
103+
- Store changes: update the relevant Redux slice in `src/store/`, add or update the
104+
corresponding saga in `src/store/sagas/`, and bump the Redux Persist migration version
105+
in `src/store/migrations.ts` if the store shape changes.
106+
- Realm schema changes: update the model in `src/models/` and ensure backward compatibility.
107+
- PSBT / hardware signer flows: follow the existing signing flow pattern through
108+
`src/services/` and `src/hardware/`; do not bypass the PSBT round-trip.
109+
- Bitcoin amounts: keep all internal values in satoshis; use existing display helpers for
110+
formatting — do not add new formatting logic unless necessary.
111+
- Network-awareness: any service call must handle the offline / Electrum-disconnected state.
112+
113+
Commit in logical groups:
114+
115+
```
116+
feat: <description> # features
117+
fix: <description> closes #<N> # bugs
118+
```
119+
120+
> Fallback: `.github/skills/openspec-apply-change/SKILL.md`
121+
122+
### Step 3 — Archive and open PR
123+
124+
Once every task in `tasks.md` is `[x]`:
125+
126+
```bash
127+
openspec archive <name> --yes
128+
git add openspec/
129+
git commit -m "chore: archive <name>"
130+
```
131+
132+
`openspec archive` validates the change, merges any delta specs into `openspec/specs/`,
133+
and moves the change folder to `openspec/changes/archive/YYYY-MM-DD-<name>/`. Use
134+
`--skip-specs` only for infrastructure or tooling changes that have no spec impact.
135+
136+
Then open the PR:
137+
- Title: `feat: <description>` or `fix: <description> (closes #<N>)`
138+
- Body: link to the issue + paste the archived `proposal.md` Intent and Scope (or the
139+
Analysis section from `tasks.md` for bugs)
140+
- Label the PR with the affected area: `vault`, `wallet`, `signer`, `utxo`, `send`,
141+
`receive`, `backup`, `settings`, or `infra`
142+
143+
> Fallback: `.github/skills/openspec-archive-change/SKILL.md`
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
description: Implement tasks from an OpenSpec change (Experimental)
3+
---
4+
5+
Implement tasks from an OpenSpec change.
6+
7+
**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
8+
9+
**Steps**
10+
11+
1. **Select the change**
12+
13+
If a name is provided, use it. Otherwise:
14+
- Infer from conversation context if the user mentioned a change
15+
- Auto-select if only one active change exists
16+
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
17+
18+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
19+
20+
2. **Check status to understand the schema**
21+
```bash
22+
openspec status --change "<name>" --json
23+
```
24+
Parse the JSON to understand:
25+
- `schemaName`: The workflow being used (e.g., "spec-driven")
26+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
27+
28+
3. **Get apply instructions**
29+
30+
```bash
31+
openspec instructions apply --change "<name>" --json
32+
```
33+
34+
This returns:
35+
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema)
36+
- Progress (total, complete, remaining)
37+
- Task list with status
38+
- Dynamic instruction based on current state
39+
40+
**Handle states:**
41+
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
42+
- If `state: "all_done"`: congratulate, suggest archive
43+
- Otherwise: proceed to implementation
44+
45+
4. **Read context files**
46+
47+
Read every file path listed under `contextFiles` from the apply instructions output.
48+
The files depend on the schema being used:
49+
- **spec-driven**: proposal, specs, design, tasks
50+
- Other schemas: follow the contextFiles from CLI output
51+
52+
5. **Show current progress**
53+
54+
Display:
55+
- Schema being used
56+
- Progress: "N/M tasks complete"
57+
- Remaining tasks overview
58+
- Dynamic instruction from CLI
59+
60+
6. **Implement tasks (loop until done or blocked)**
61+
62+
For each pending task:
63+
- Show which task is being worked on
64+
- Make the code changes required
65+
- Keep changes minimal and focused
66+
- Mark task complete in the tasks file: `- [ ]``- [x]`
67+
- Continue to next task
68+
69+
**Pause if:**
70+
- Task is unclear → ask for clarification
71+
- Implementation reveals a design issue → suggest updating artifacts
72+
- Error or blocker encountered → report and wait for guidance
73+
- User interrupts
74+
75+
7. **On completion or pause, show status**
76+
77+
Display:
78+
- Tasks completed this session
79+
- Overall progress: "N/M tasks complete"
80+
- If all done: suggest archive
81+
- If paused: explain why and wait for guidance
82+
83+
**Output During Implementation**
84+
85+
```
86+
## Implementing: <change-name> (schema: <schema-name>)
87+
88+
Working on task 3/7: <task description>
89+
[...implementation happening...]
90+
✓ Task complete
91+
92+
Working on task 4/7: <task description>
93+
[...implementation happening...]
94+
✓ Task complete
95+
```
96+
97+
**Output On Completion**
98+
99+
```
100+
## Implementation Complete
101+
102+
**Change:** <change-name>
103+
**Schema:** <schema-name>
104+
**Progress:** 7/7 tasks complete ✓
105+
106+
### Completed This Session
107+
- [x] Task 1
108+
- [x] Task 2
109+
...
110+
111+
All tasks complete! You can archive this change with `/opsx:archive`.
112+
```
113+
114+
**Output On Pause (Issue Encountered)**
115+
116+
```
117+
## Implementation Paused
118+
119+
**Change:** <change-name>
120+
**Schema:** <schema-name>
121+
**Progress:** 4/7 tasks complete
122+
123+
### Issue Encountered
124+
<description of the issue>
125+
126+
**Options:**
127+
1. <option 1>
128+
2. <option 2>
129+
3. Other approach
130+
131+
What would you like to do?
132+
```
133+
134+
**Guardrails**
135+
- Keep going through tasks until done or blocked
136+
- Always read context files before starting (from the apply instructions output)
137+
- If task is ambiguous, pause and ask before implementing
138+
- If implementation reveals issues, pause and suggest artifact updates
139+
- Keep code changes minimal and scoped to each task
140+
- Update task checkbox immediately after completing each task
141+
- Pause on errors, blockers, or unclear requirements - don't guess
142+
- Use contextFiles from CLI output, don't assume specific file names
143+
144+
**Fluid Workflow Integration**
145+
146+
This skill supports the "actions on a change" model:
147+
148+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
149+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly

0 commit comments

Comments
 (0)