@mytechtoday/augment-extensions 0.1.0
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.
- package/AGENTS.md +152 -0
- package/LICENSE +22 -0
- package/MODULES.md +124 -0
- package/README.md +195 -0
- package/cli/dist/cli.d.ts +3 -0
- package/cli/dist/cli.d.ts.map +1 -0
- package/cli/dist/cli.js +100 -0
- package/cli/dist/cli.js.map +1 -0
- package/cli/dist/commands/init.d.ts +6 -0
- package/cli/dist/commands/init.d.ts.map +1 -0
- package/cli/dist/commands/init.js +137 -0
- package/cli/dist/commands/init.js.map +1 -0
- package/cli/dist/commands/link.d.ts +6 -0
- package/cli/dist/commands/link.d.ts.map +1 -0
- package/cli/dist/commands/link.js +85 -0
- package/cli/dist/commands/link.js.map +1 -0
- package/cli/dist/commands/list.d.ts +7 -0
- package/cli/dist/commands/list.d.ts.map +1 -0
- package/cli/dist/commands/list.js +122 -0
- package/cli/dist/commands/list.js.map +1 -0
- package/cli/dist/commands/search.d.ts +6 -0
- package/cli/dist/commands/search.d.ts.map +1 -0
- package/cli/dist/commands/search.js +16 -0
- package/cli/dist/commands/search.js.map +1 -0
- package/cli/dist/commands/show.d.ts +6 -0
- package/cli/dist/commands/show.d.ts.map +1 -0
- package/cli/dist/commands/show.js +106 -0
- package/cli/dist/commands/show.js.map +1 -0
- package/cli/dist/commands/update.d.ts +6 -0
- package/cli/dist/commands/update.d.ts.map +1 -0
- package/cli/dist/commands/update.js +19 -0
- package/cli/dist/commands/update.js.map +1 -0
- package/modules/coding-standards/typescript/README.md +45 -0
- package/modules/coding-standards/typescript/module.json +27 -0
- package/modules/coding-standards/typescript/rules/naming-conventions.md +225 -0
- package/modules/workflows/beads/README.md +135 -0
- package/modules/workflows/beads/examples/complete-workflow-example.md +278 -0
- package/modules/workflows/beads/module.json +54 -0
- package/modules/workflows/beads/rules/best-practices.md +398 -0
- package/modules/workflows/beads/rules/file-format.md +283 -0
- package/modules/workflows/beads/rules/manual-setup.md +315 -0
- package/modules/workflows/beads/rules/workflow.md +285 -0
- package/modules/workflows/openspec/README.md +96 -0
- package/modules/workflows/openspec/examples/complete-change-example.md +230 -0
- package/modules/workflows/openspec/module.json +53 -0
- package/modules/workflows/openspec/rules/best-practices.md +272 -0
- package/modules/workflows/openspec/rules/manual-setup.md +231 -0
- package/modules/workflows/openspec/rules/spec-format.md +193 -0
- package/modules/workflows/openspec/rules/workflow.md +189 -0
- package/package.json +72 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# Beads Workflow Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Beads provides a git-backed issue tracker optimized for AI agents. Issues are stored as JSONL (JSON Lines) in `.beads/issues.jsonl`, making them version-controlled, mergeable, and agent-readable.
|
|
6
|
+
|
|
7
|
+
## Core Workflow
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌─────────────────┐
|
|
11
|
+
│ Create Task │
|
|
12
|
+
│ bd create │
|
|
13
|
+
└────────┬────────┘
|
|
14
|
+
│
|
|
15
|
+
▼
|
|
16
|
+
┌─────────────────┐
|
|
17
|
+
│ Add Dependencies│
|
|
18
|
+
│ bd dep add │
|
|
19
|
+
└────────┬────────┘
|
|
20
|
+
│
|
|
21
|
+
▼
|
|
22
|
+
┌─────────────────┐
|
|
23
|
+
│ Find Ready Tasks│
|
|
24
|
+
│ bd ready │
|
|
25
|
+
└────────┬────────┘
|
|
26
|
+
│
|
|
27
|
+
▼
|
|
28
|
+
┌─────────────────┐
|
|
29
|
+
│ Work on Task │
|
|
30
|
+
│ bd comment │
|
|
31
|
+
└────────┬────────┘
|
|
32
|
+
│
|
|
33
|
+
▼
|
|
34
|
+
┌─────────────────┐
|
|
35
|
+
│ Close Task │
|
|
36
|
+
│ bd close │
|
|
37
|
+
└─────────────────┘
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Step 1: Initialize Beads
|
|
41
|
+
|
|
42
|
+
### With CLI
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd your-project
|
|
46
|
+
bd init
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This creates:
|
|
50
|
+
- `.beads/issues.jsonl` - Issue storage
|
|
51
|
+
- `.beads/config.json` - Configuration
|
|
52
|
+
- Updates `AGENTS.md` with Beads instructions
|
|
53
|
+
|
|
54
|
+
### Without CLI
|
|
55
|
+
|
|
56
|
+
Create the directory structure manually:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
mkdir .beads
|
|
60
|
+
touch .beads/issues.jsonl
|
|
61
|
+
echo '{"version": "1.0"}' > .beads/config.json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Add to `AGENTS.md`:
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
# Beads Task Tracking
|
|
68
|
+
|
|
69
|
+
This project uses Beads for task tracking. Issues are stored in `.beads/issues.jsonl`.
|
|
70
|
+
|
|
71
|
+
## Workflow
|
|
72
|
+
1. Create tasks by appending to `.beads/issues.jsonl`
|
|
73
|
+
2. Use hash-based IDs: `bd-<hash>`
|
|
74
|
+
3. Track dependencies with `blocks` and `blocked_by` fields
|
|
75
|
+
4. Mark tasks closed with `status: "closed"`
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Step 2: Create Tasks
|
|
79
|
+
|
|
80
|
+
### With CLI
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Create a P0 task
|
|
84
|
+
bd create "Implement user authentication" -p 0
|
|
85
|
+
|
|
86
|
+
# Create with description
|
|
87
|
+
bd create "Add login endpoint" -p 1 -d "POST /api/auth/login with email/password"
|
|
88
|
+
|
|
89
|
+
# Create subtask
|
|
90
|
+
bd create "Add password hashing" -p 1 --parent bd-a3f8.1
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Without CLI
|
|
94
|
+
|
|
95
|
+
Append JSON to `.beads/issues.jsonl`:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{"id":"bd-a1b2","title":"Implement user authentication","status":"open","priority":0,"created":"2024-01-20T10:00:00Z","updated":"2024-01-20T10:00:00Z"}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### AI Agent Pattern
|
|
102
|
+
|
|
103
|
+
Ask your AI:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Create a Beads task for implementing user authentication with priority 0
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The AI will either:
|
|
110
|
+
- Run `bd create` if CLI is available
|
|
111
|
+
- Append to `.beads/issues.jsonl` if working manually
|
|
112
|
+
|
|
113
|
+
## Step 3: Add Dependencies
|
|
114
|
+
|
|
115
|
+
### With CLI
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Task bd-b2c3 blocks task bd-a1b2
|
|
119
|
+
bd dep add bd-a1b2 bd-b2c3
|
|
120
|
+
|
|
121
|
+
# View dependencies
|
|
122
|
+
bd show bd-a1b2
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Without CLI
|
|
126
|
+
|
|
127
|
+
Update the issue in `.beads/issues.jsonl`:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{"id":"bd-a1b2","title":"Implement user authentication","status":"open","priority":0,"blocks":["bd-b2c3"],"created":"2024-01-20T10:00:00Z","updated":"2024-01-20T10:00:00Z"}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Dependency Types
|
|
134
|
+
|
|
135
|
+
- **blocks** - This task blocks another task
|
|
136
|
+
- **blocked_by** - This task is blocked by another task
|
|
137
|
+
- **related** - Related but not blocking
|
|
138
|
+
- **parent** - Parent task (for hierarchical IDs)
|
|
139
|
+
|
|
140
|
+
## Step 4: Find Ready Tasks
|
|
141
|
+
|
|
142
|
+
### With CLI
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# List tasks with no open blockers
|
|
146
|
+
bd ready
|
|
147
|
+
|
|
148
|
+
# List all open tasks
|
|
149
|
+
bd list
|
|
150
|
+
|
|
151
|
+
# Filter by priority
|
|
152
|
+
bd list -p 0
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Without CLI
|
|
156
|
+
|
|
157
|
+
Parse `.beads/issues.jsonl` to find tasks where:
|
|
158
|
+
- `status` is `"open"`
|
|
159
|
+
- `blocked_by` is empty or all blockers are closed
|
|
160
|
+
|
|
161
|
+
### AI Agent Pattern
|
|
162
|
+
|
|
163
|
+
Ask your AI:
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
What Beads tasks are ready to work on?
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The AI will:
|
|
170
|
+
- Run `bd ready` if CLI available
|
|
171
|
+
- Parse `.beads/issues.jsonl` manually otherwise
|
|
172
|
+
|
|
173
|
+
## Step 5: Work on Task
|
|
174
|
+
|
|
175
|
+
### With CLI
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Add comment
|
|
179
|
+
bd comment bd-a1b2 "Started implementation, added login endpoint"
|
|
180
|
+
|
|
181
|
+
# Update status
|
|
182
|
+
bd update bd-a1b2 --status in-progress
|
|
183
|
+
|
|
184
|
+
# Add labels
|
|
185
|
+
bd update bd-a1b2 --labels backend,auth
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Without CLI
|
|
189
|
+
|
|
190
|
+
Append update to `.beads/issues.jsonl`:
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{"id":"bd-a1b2","title":"Implement user authentication","status":"in-progress","priority":0,"comments":[{"text":"Started implementation","timestamp":"2024-01-20T11:00:00Z"}],"updated":"2024-01-20T11:00:00Z"}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Step 6: Close Task
|
|
197
|
+
|
|
198
|
+
### With CLI
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
bd close bd-a1b2
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Without CLI
|
|
205
|
+
|
|
206
|
+
Update status in `.beads/issues.jsonl`:
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{"id":"bd-a1b2","title":"Implement user authentication","status":"closed","priority":0,"closed":"2024-01-20T12:00:00Z","updated":"2024-01-20T12:00:00Z"}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Essential Commands
|
|
213
|
+
|
|
214
|
+
### With CLI
|
|
215
|
+
|
|
216
|
+
| Command | Action |
|
|
217
|
+
|---------|--------|
|
|
218
|
+
| `bd create "Title" -p 0` | Create P0 task |
|
|
219
|
+
| `bd ready` | List tasks with no blockers |
|
|
220
|
+
| `bd list` | List all open tasks |
|
|
221
|
+
| `bd show <id>` | View task details |
|
|
222
|
+
| `bd dep add <child> <parent>` | Add dependency |
|
|
223
|
+
| `bd comment <id> "Text"` | Add comment |
|
|
224
|
+
| `bd close <id>` | Close task |
|
|
225
|
+
| `bd compact` | Summarize old closed tasks |
|
|
226
|
+
|
|
227
|
+
### Without CLI
|
|
228
|
+
|
|
229
|
+
All operations are manual edits to `.beads/issues.jsonl`. See `file-format.md` for JSONL structure.
|
|
230
|
+
|
|
231
|
+
## Advanced Features
|
|
232
|
+
|
|
233
|
+
### Hierarchical Tasks
|
|
234
|
+
|
|
235
|
+
Create epic/task/subtask structure:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Create epic
|
|
239
|
+
bd create "User Management" -p 0
|
|
240
|
+
# Returns: bd-a3f8
|
|
241
|
+
|
|
242
|
+
# Create task under epic
|
|
243
|
+
bd create "Add authentication" -p 1 --parent bd-a3f8
|
|
244
|
+
# Returns: bd-a3f8.1
|
|
245
|
+
|
|
246
|
+
# Create subtask
|
|
247
|
+
bd create "Hash passwords" -p 2 --parent bd-a3f8.1
|
|
248
|
+
# Returns: bd-a3f8.1.1
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Stealth Mode
|
|
252
|
+
|
|
253
|
+
Use Beads without committing to main repo:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
bd init --stealth
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
This creates `.beads/` in a separate branch that doesn't merge to main.
|
|
260
|
+
|
|
261
|
+
### Compaction
|
|
262
|
+
|
|
263
|
+
Summarize old closed tasks to save context:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
bd compact
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
This uses AI to create semantic summaries of closed tasks, reducing context window usage.
|
|
270
|
+
|
|
271
|
+
## Best Practices
|
|
272
|
+
|
|
273
|
+
1. **Use Descriptive Titles**: Clear, specific task names
|
|
274
|
+
2. **Set Priorities**: P0 (critical) to P3 (nice-to-have)
|
|
275
|
+
3. **Track Dependencies**: Use `bd dep add` to show relationships
|
|
276
|
+
4. **Add Comments**: Document progress and decisions
|
|
277
|
+
5. **Close Promptly**: Mark tasks closed when done
|
|
278
|
+
6. **Compact Regularly**: Run `bd compact` to manage context
|
|
279
|
+
|
|
280
|
+
## Next Steps
|
|
281
|
+
|
|
282
|
+
- See `file-format.md` for JSONL structure
|
|
283
|
+
- See `manual-setup.md` for CLI-free setup
|
|
284
|
+
- See `best-practices.md` for advanced patterns
|
|
285
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# OpenSpec Workflow Module
|
|
2
|
+
|
|
3
|
+
**Spec-driven development (SDD) for AI coding assistants.**
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
OpenSpec provides a structured workflow for managing changes in AI-assisted development. It ensures humans and AI agents agree on specifications before implementation, reducing rework and improving code quality.
|
|
8
|
+
|
|
9
|
+
## Key Benefits
|
|
10
|
+
|
|
11
|
+
- **Alignment Before Implementation**: Agree on specs before writing code
|
|
12
|
+
- **Structured Change Management**: Proposals, specs, and tasks in organized folders
|
|
13
|
+
- **Brownfield-Friendly**: Excellent for modifying existing features (1→n), not just greenfield (0→1)
|
|
14
|
+
- **Version Controlled**: All specs stored in git alongside code
|
|
15
|
+
- **AI Agent Compatible**: Works with any tool that reads AGENTS.md
|
|
16
|
+
|
|
17
|
+
## Installation Options
|
|
18
|
+
|
|
19
|
+
### Option 1: With CLI (Recommended)
|
|
20
|
+
|
|
21
|
+
Install the OpenSpec CLI for full features:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# npm
|
|
25
|
+
npm install -g @fission-ai/openspec@latest
|
|
26
|
+
|
|
27
|
+
# Nix
|
|
28
|
+
nix run github:Fission-AI/OpenSpec -- init
|
|
29
|
+
|
|
30
|
+
# Initialize in your project
|
|
31
|
+
cd your-project
|
|
32
|
+
openspec init
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Benefits**: Validation, archiving, slash commands, auto-generated AGENTS.md
|
|
36
|
+
|
|
37
|
+
### Option 2: Without CLI (Manual)
|
|
38
|
+
|
|
39
|
+
Follow the workflow manually without installing the CLI. See `rules/manual-setup.md` for instructions.
|
|
40
|
+
|
|
41
|
+
**Benefits**: No installation required, works immediately
|
|
42
|
+
|
|
43
|
+
**Limitations**: No validation, manual archiving, no slash commands
|
|
44
|
+
|
|
45
|
+
## Directory Structure
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
your-project/
|
|
49
|
+
├── openspec/
|
|
50
|
+
│ ├── AGENTS.md # AI agent instructions (auto-generated)
|
|
51
|
+
│ ├── project.md # Project context and conventions
|
|
52
|
+
│ ├── specs/ # Current specifications (source of truth)
|
|
53
|
+
│ │ └── auth/
|
|
54
|
+
│ │ └── spec.md
|
|
55
|
+
│ └── changes/ # Proposed changes
|
|
56
|
+
│ └── add-2fa/
|
|
57
|
+
│ ├── proposal.md # Why and what
|
|
58
|
+
│ ├── tasks.md # Implementation checklist
|
|
59
|
+
│ ├── design.md # Technical decisions (optional)
|
|
60
|
+
│ └── specs/ # Spec deltas (changes)
|
|
61
|
+
│ └── auth/
|
|
62
|
+
│ └── spec.md
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Workflow
|
|
66
|
+
|
|
67
|
+
See `rules/workflow.md` for complete workflow documentation.
|
|
68
|
+
|
|
69
|
+
**Quick Summary**:
|
|
70
|
+
|
|
71
|
+
1. **Draft Proposal** - Create change proposal with AI
|
|
72
|
+
2. **Review & Align** - Iterate on specs until agreement
|
|
73
|
+
3. **Implement** - AI implements tasks referencing specs
|
|
74
|
+
4. **Archive** - Merge approved changes into source specs
|
|
75
|
+
|
|
76
|
+
## Character Count
|
|
77
|
+
|
|
78
|
+
This module contains comprehensive OpenSpec workflow documentation that exceeds the standard `.augment/` folder character limit.
|
|
79
|
+
|
|
80
|
+
**Total**: ~25,000 characters across all rule files
|
|
81
|
+
|
|
82
|
+
## Contents
|
|
83
|
+
|
|
84
|
+
- `rules/workflow.md` - Complete workflow guide
|
|
85
|
+
- `rules/spec-format.md` - Specification format and delta syntax
|
|
86
|
+
- `rules/manual-setup.md` - Manual setup without CLI
|
|
87
|
+
- `rules/commands.md` - CLI command reference
|
|
88
|
+
- `rules/best-practices.md` - Tips and patterns
|
|
89
|
+
- `examples/` - Example specs and changes
|
|
90
|
+
|
|
91
|
+
## Learn More
|
|
92
|
+
|
|
93
|
+
- **Homepage**: https://openspec.dev/
|
|
94
|
+
- **GitHub**: https://github.com/Fission-AI/OpenSpec
|
|
95
|
+
- **Documentation**: See `rules/` directory in this module
|
|
96
|
+
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# Complete OpenSpec Change Example
|
|
2
|
+
|
|
3
|
+
This example shows a complete OpenSpec change from start to finish.
|
|
4
|
+
|
|
5
|
+
## Scenario
|
|
6
|
+
|
|
7
|
+
Adding two-factor authentication (2FA) to an existing authentication system.
|
|
8
|
+
|
|
9
|
+
## Directory Structure
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
openspec/
|
|
13
|
+
├── specs/
|
|
14
|
+
│ └── auth/
|
|
15
|
+
│ └── spec.md # Existing auth spec
|
|
16
|
+
└── changes/
|
|
17
|
+
└── add-2fa/
|
|
18
|
+
├── proposal.md # Why we need 2FA
|
|
19
|
+
├── tasks.md # Implementation steps
|
|
20
|
+
└── specs/
|
|
21
|
+
└── auth/
|
|
22
|
+
└── spec.md # Changes to auth spec
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## File: proposal.md
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
# Add Two-Factor Authentication
|
|
29
|
+
|
|
30
|
+
## Motivation
|
|
31
|
+
|
|
32
|
+
Users have requested stronger account security. Password-only authentication
|
|
33
|
+
is insufficient for protecting sensitive user data. Industry best practices
|
|
34
|
+
recommend 2FA for all accounts.
|
|
35
|
+
|
|
36
|
+
## Changes
|
|
37
|
+
|
|
38
|
+
1. Add OTP (One-Time Password) generation and verification
|
|
39
|
+
2. Modify login flow to require 2FA after password verification
|
|
40
|
+
3. Add user settings for 2FA enrollment and recovery codes
|
|
41
|
+
4. Add audit logging for 2FA events
|
|
42
|
+
|
|
43
|
+
## Impact
|
|
44
|
+
|
|
45
|
+
### Breaking Changes
|
|
46
|
+
- All users will be required to enroll in 2FA on next login
|
|
47
|
+
- Login API response changes to include 2FA challenge
|
|
48
|
+
|
|
49
|
+
### Database Changes
|
|
50
|
+
- Add `otp_secret` column to users table
|
|
51
|
+
- Create `otp_verification_logs` table
|
|
52
|
+
- Add `recovery_codes` table
|
|
53
|
+
|
|
54
|
+
### Frontend Changes
|
|
55
|
+
- New OTP input component
|
|
56
|
+
- Updated login flow with 2FA step
|
|
57
|
+
- New 2FA settings page
|
|
58
|
+
|
|
59
|
+
## Timeline
|
|
60
|
+
|
|
61
|
+
- Database migration: 1 day
|
|
62
|
+
- Backend implementation: 2-3 days
|
|
63
|
+
- Frontend implementation: 2-3 days
|
|
64
|
+
- Testing and rollout: 1 week
|
|
65
|
+
|
|
66
|
+
## Dependencies
|
|
67
|
+
|
|
68
|
+
- TOTP library (e.g., pyotp, speakeasy)
|
|
69
|
+
- QR code generation library
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## File: tasks.md
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
# Implementation Tasks
|
|
76
|
+
|
|
77
|
+
## 1. Database Setup
|
|
78
|
+
- [ ] 1.1 Add `otp_secret` column to users table (nullable initially)
|
|
79
|
+
- [ ] 1.2 Create `otp_verification_logs` table with columns:
|
|
80
|
+
- id, user_id, success, ip_address, timestamp
|
|
81
|
+
- [ ] 1.3 Create `recovery_codes` table with columns:
|
|
82
|
+
- id, user_id, code_hash, used, created_at
|
|
83
|
+
- [ ] 1.4 Write and test migration script
|
|
84
|
+
- [ ] 1.5 Add database indexes for performance
|
|
85
|
+
|
|
86
|
+
## 2. Backend Implementation
|
|
87
|
+
- [ ] 2.1 Install TOTP library dependency
|
|
88
|
+
- [ ] 2.2 Create OTP service with methods:
|
|
89
|
+
- generate_secret()
|
|
90
|
+
- generate_qr_code(secret)
|
|
91
|
+
- verify_otp(secret, code)
|
|
92
|
+
- [ ] 2.3 Add POST /api/auth/2fa/enroll endpoint
|
|
93
|
+
- Generates secret and QR code
|
|
94
|
+
- Returns QR code and recovery codes
|
|
95
|
+
- [ ] 2.4 Add POST /api/auth/2fa/verify endpoint
|
|
96
|
+
- Verifies OTP code
|
|
97
|
+
- Issues JWT on success
|
|
98
|
+
- [ ] 2.5 Modify POST /api/auth/login endpoint
|
|
99
|
+
- Return 2FA challenge instead of JWT
|
|
100
|
+
- Include temporary token for 2FA verification
|
|
101
|
+
- [ ] 2.6 Add rate limiting to verification endpoint (3 attempts per 5 minutes)
|
|
102
|
+
- [ ] 2.7 Add audit logging for all 2FA events
|
|
103
|
+
- [ ] 2.8 Write unit tests for OTP service
|
|
104
|
+
- [ ] 2.9 Write integration tests for 2FA endpoints
|
|
105
|
+
|
|
106
|
+
## 3. Frontend Implementation
|
|
107
|
+
- [ ] 3.1 Create OTPInput component
|
|
108
|
+
- 6-digit input with auto-focus
|
|
109
|
+
- Paste support
|
|
110
|
+
- Error state display
|
|
111
|
+
- [ ] 3.2 Create 2FAEnrollment component
|
|
112
|
+
- Display QR code
|
|
113
|
+
- Show recovery codes
|
|
114
|
+
- Confirmation step
|
|
115
|
+
- [ ] 3.3 Update LoginForm component
|
|
116
|
+
- Handle 2FA challenge response
|
|
117
|
+
- Show OTP input after password verification
|
|
118
|
+
- [ ] 3.4 Create 2FASettings page
|
|
119
|
+
- Enable/disable 2FA
|
|
120
|
+
- Regenerate recovery codes
|
|
121
|
+
- View 2FA status
|
|
122
|
+
- [ ] 3.5 Add 2FA status indicator to user profile
|
|
123
|
+
- [ ] 3.6 Write component tests
|
|
124
|
+
|
|
125
|
+
## 4. Documentation
|
|
126
|
+
- [ ] 4.1 Update API documentation
|
|
127
|
+
- [ ] 4.2 Create user guide for 2FA enrollment
|
|
128
|
+
- [ ] 4.3 Create admin guide for 2FA management
|
|
129
|
+
- [ ] 4.4 Update security documentation
|
|
130
|
+
|
|
131
|
+
## 5. Testing & Rollout
|
|
132
|
+
- [ ] 5.1 End-to-end testing
|
|
133
|
+
- [ ] 5.2 Security review
|
|
134
|
+
- [ ] 5.3 Performance testing
|
|
135
|
+
- [ ] 5.4 Staged rollout plan
|
|
136
|
+
- [ ] 5.5 Monitor error rates and user feedback
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## File: specs/auth/spec.md (Delta)
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
# Delta for Auth Specification
|
|
143
|
+
|
|
144
|
+
## ADDED Requirements
|
|
145
|
+
|
|
146
|
+
### Requirement: Two-Factor Authentication
|
|
147
|
+
The system MUST require a second factor (OTP) during login for all users.
|
|
148
|
+
|
|
149
|
+
#### Scenario: 2FA enrollment
|
|
150
|
+
- GIVEN a user without 2FA enabled
|
|
151
|
+
- WHEN the user accesses the 2FA settings page
|
|
152
|
+
- THEN a QR code is generated
|
|
153
|
+
- AND recovery codes are displayed
|
|
154
|
+
- AND the user must verify an OTP to complete enrollment
|
|
155
|
+
|
|
156
|
+
#### Scenario: Login with 2FA
|
|
157
|
+
- GIVEN a user with 2FA enabled
|
|
158
|
+
- WHEN the user submits valid credentials
|
|
159
|
+
- THEN a 2FA challenge is returned
|
|
160
|
+
- AND a temporary token is issued (valid for 5 minutes)
|
|
161
|
+
- AND no JWT is issued until OTP verification
|
|
162
|
+
|
|
163
|
+
#### Scenario: Valid OTP
|
|
164
|
+
- GIVEN a user has received a 2FA challenge
|
|
165
|
+
- WHEN the user submits a valid OTP within 5 minutes
|
|
166
|
+
- THEN a JWT is issued
|
|
167
|
+
- AND the user is logged in
|
|
168
|
+
- AND the verification is logged
|
|
169
|
+
|
|
170
|
+
#### Scenario: Invalid OTP
|
|
171
|
+
- GIVEN a user has received a 2FA challenge
|
|
172
|
+
- WHEN the user submits an invalid OTP
|
|
173
|
+
- THEN an error message is displayed
|
|
174
|
+
- AND the user can retry up to 3 times
|
|
175
|
+
- AND after 3 failures, the temporary token is invalidated
|
|
176
|
+
|
|
177
|
+
#### Scenario: Expired 2FA challenge
|
|
178
|
+
- GIVEN a user has received a 2FA challenge
|
|
179
|
+
- WHEN more than 5 minutes have passed
|
|
180
|
+
- THEN the temporary token is invalid
|
|
181
|
+
- AND the user must restart the login process
|
|
182
|
+
|
|
183
|
+
### Requirement: Recovery Codes
|
|
184
|
+
The system MUST provide recovery codes for account recovery.
|
|
185
|
+
|
|
186
|
+
#### Scenario: Generate recovery codes
|
|
187
|
+
- WHEN a user enrolls in 2FA
|
|
188
|
+
- THEN 10 recovery codes are generated
|
|
189
|
+
- AND codes are displayed once
|
|
190
|
+
- AND codes are hashed before storage
|
|
191
|
+
|
|
192
|
+
#### Scenario: Use recovery code
|
|
193
|
+
- GIVEN a user cannot access their OTP device
|
|
194
|
+
- WHEN the user submits a valid recovery code
|
|
195
|
+
- THEN the code is marked as used
|
|
196
|
+
- AND a JWT is issued
|
|
197
|
+
- AND the user is logged in
|
|
198
|
+
|
|
199
|
+
## MODIFIED Requirements
|
|
200
|
+
|
|
201
|
+
### Requirement: User Authentication
|
|
202
|
+
The system SHALL issue a JWT on successful login after password and 2FA verification.
|
|
203
|
+
|
|
204
|
+
#### Scenario: Valid credentials (MODIFIED)
|
|
205
|
+
- WHEN a user submits valid credentials
|
|
206
|
+
- THEN if 2FA is enabled, a 2FA challenge is returned (CHANGED)
|
|
207
|
+
- AND if 2FA is disabled, a JWT is returned (CHANGED)
|
|
208
|
+
- AND the login attempt is logged
|
|
209
|
+
|
|
210
|
+
## REMOVED Requirements
|
|
211
|
+
|
|
212
|
+
(None for this change)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## After Implementation
|
|
216
|
+
|
|
217
|
+
Once all tasks are complete, archive the change:
|
|
218
|
+
|
|
219
|
+
### With CLI
|
|
220
|
+
```bash
|
|
221
|
+
openspec archive add-2fa --yes
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Without CLI
|
|
225
|
+
1. Copy the delta from `openspec/changes/add-2fa/specs/auth/spec.md`
|
|
226
|
+
2. Apply ADDED/MODIFIED sections to `openspec/specs/auth/spec.md`
|
|
227
|
+
3. Move `openspec/changes/add-2fa/` to `openspec/archive/add-2fa/`
|
|
228
|
+
|
|
229
|
+
The source spec now includes all 2FA requirements as the new source of truth.
|
|
230
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openspec-workflow",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"displayName": "OpenSpec Workflow",
|
|
5
|
+
"description": "Spec-driven development (SDD) workflow for AI coding assistants. Provides structured change management with proposals, specs, and tasks.",
|
|
6
|
+
"type": "workflow",
|
|
7
|
+
"author": "Augment Extensions",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"openspec",
|
|
11
|
+
"spec-driven-development",
|
|
12
|
+
"sdd",
|
|
13
|
+
"workflow",
|
|
14
|
+
"planning",
|
|
15
|
+
"specifications",
|
|
16
|
+
"change-management"
|
|
17
|
+
],
|
|
18
|
+
"augment": {
|
|
19
|
+
"characterCount": 30509,
|
|
20
|
+
"priority": "high",
|
|
21
|
+
"category": "workflow",
|
|
22
|
+
"compatibleWith": [
|
|
23
|
+
"Claude Code",
|
|
24
|
+
"CodeBuddy",
|
|
25
|
+
"Cursor",
|
|
26
|
+
"GitHub Copilot",
|
|
27
|
+
"Continue",
|
|
28
|
+
"Windsurf",
|
|
29
|
+
"All AGENTS.md compatible tools"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/Fission-AI/OpenSpec"
|
|
36
|
+
},
|
|
37
|
+
"documentation": {
|
|
38
|
+
"homepage": "https://openspec.dev/",
|
|
39
|
+
"installation": "https://github.com/Fission-AI/OpenSpec#install--initialize",
|
|
40
|
+
"workflow": "https://github.com/Fission-AI/OpenSpec#create-your-first-change"
|
|
41
|
+
},
|
|
42
|
+
"installation": {
|
|
43
|
+
"required": false,
|
|
44
|
+
"optional": true,
|
|
45
|
+
"methods": {
|
|
46
|
+
"npm": "npm install -g @fission-ai/openspec@latest",
|
|
47
|
+
"nix": "nix run github:Fission-AI/OpenSpec -- init",
|
|
48
|
+
"manual": "Follow manual setup instructions in rules/manual-setup.md"
|
|
49
|
+
},
|
|
50
|
+
"notes": "CLI installation is optional. AI agents can follow the workflow manually without the CLI, but the CLI provides validation, archiving, and slash commands."
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|