@eddacraft/anvil-adapters 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 +180 -0
- package/BMAD_ADAPTER_SPEC.md +489 -0
- package/LICENSE +14 -0
- package/README.md +500 -0
- package/dist/aps-markdown/adapter.d.ts +102 -0
- package/dist/aps-markdown/adapter.d.ts.map +1 -0
- package/dist/aps-markdown/adapter.js +351 -0
- package/dist/aps-markdown/index.d.ts +8 -0
- package/dist/aps-markdown/index.d.ts.map +1 -0
- package/dist/aps-markdown/index.js +7 -0
- package/dist/base/file-discovery.d.ts +63 -0
- package/dist/base/file-discovery.d.ts.map +1 -0
- package/dist/base/file-discovery.js +246 -0
- package/dist/base/index.d.ts +10 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +9 -0
- package/dist/base/registry.d.ts +155 -0
- package/dist/base/registry.d.ts.map +1 -0
- package/dist/base/registry.js +227 -0
- package/dist/base/testing.d.ts +102 -0
- package/dist/base/testing.d.ts.map +1 -0
- package/dist/base/testing.js +221 -0
- package/dist/base/types.d.ts +255 -0
- package/dist/base/types.d.ts.map +1 -0
- package/dist/base/types.js +78 -0
- package/dist/base/utils.d.ts +127 -0
- package/dist/base/utils.d.ts.map +1 -0
- package/dist/base/utils.js +254 -0
- package/dist/bmad/format-adapter.d.ts +76 -0
- package/dist/bmad/format-adapter.d.ts.map +1 -0
- package/dist/bmad/format-adapter.js +186 -0
- package/dist/bmad/index.d.ts +12 -0
- package/dist/bmad/index.d.ts.map +1 -0
- package/dist/bmad/index.js +10 -0
- package/dist/bmad/parser.d.ts +12 -0
- package/dist/bmad/parser.d.ts.map +1 -0
- package/dist/bmad/parser.js +181 -0
- package/dist/bmad/serializer.d.ts +16 -0
- package/dist/bmad/serializer.d.ts.map +1 -0
- package/dist/bmad/serializer.js +170 -0
- package/dist/bmad/types.d.ts +127 -0
- package/dist/bmad/types.d.ts.map +1 -0
- package/dist/bmad/types.js +47 -0
- package/dist/bmad/utils.d.ts +120 -0
- package/dist/bmad/utils.d.ts.map +1 -0
- package/dist/bmad/utils.js +480 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +2 -0
- package/dist/common/registry.d.ts +18 -0
- package/dist/common/registry.d.ts.map +1 -0
- package/dist/common/registry.js +58 -0
- package/dist/common/types.d.ts +68 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +12 -0
- package/dist/generic/format-adapter.d.ts +64 -0
- package/dist/generic/format-adapter.d.ts.map +1 -0
- package/dist/generic/format-adapter.js +159 -0
- package/dist/generic/index.d.ts +10 -0
- package/dist/generic/index.d.ts.map +1 -0
- package/dist/generic/index.js +9 -0
- package/dist/generic/parser.d.ts +11 -0
- package/dist/generic/parser.d.ts.map +1 -0
- package/dist/generic/parser.js +106 -0
- package/dist/generic/serializer.d.ts +11 -0
- package/dist/generic/serializer.d.ts.map +1 -0
- package/dist/generic/serializer.js +118 -0
- package/dist/generic/types.d.ts +52 -0
- package/dist/generic/types.d.ts.map +1 -0
- package/dist/generic/types.js +6 -0
- package/dist/generic/utils.d.ts +51 -0
- package/dist/generic/utils.d.ts.map +1 -0
- package/dist/generic/utils.js +232 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/speckit/export.d.ts +22 -0
- package/dist/speckit/export.d.ts.map +1 -0
- package/dist/speckit/export.js +384 -0
- package/dist/speckit/format-adapter.d.ts +104 -0
- package/dist/speckit/format-adapter.d.ts.map +1 -0
- package/dist/speckit/format-adapter.js +488 -0
- package/dist/speckit/import-v2.d.ts +33 -0
- package/dist/speckit/import-v2.d.ts.map +1 -0
- package/dist/speckit/import-v2.js +361 -0
- package/dist/speckit/import.d.ts +16 -0
- package/dist/speckit/import.d.ts.map +1 -0
- package/dist/speckit/import.js +247 -0
- package/dist/speckit/index.d.ts +5 -0
- package/dist/speckit/index.d.ts.map +1 -0
- package/dist/speckit/index.js +4 -0
- package/dist/speckit/parser.d.ts +28 -0
- package/dist/speckit/parser.d.ts.map +1 -0
- package/dist/speckit/parser.js +283 -0
- package/dist/speckit/parsers/plan-parser.d.ts +71 -0
- package/dist/speckit/parsers/plan-parser.d.ts.map +1 -0
- package/dist/speckit/parsers/plan-parser.js +216 -0
- package/dist/speckit/parsers/spec-parser.d.ts +67 -0
- package/dist/speckit/parsers/spec-parser.d.ts.map +1 -0
- package/dist/speckit/parsers/spec-parser.js +255 -0
- package/dist/speckit/parsers/tasks-parser.d.ts +57 -0
- package/dist/speckit/parsers/tasks-parser.d.ts.map +1 -0
- package/dist/speckit/parsers/tasks-parser.js +157 -0
- package/package.json +23 -0
- package/project.json +29 -0
- package/src/__tests__/adapter-edge-cases.test.ts +937 -0
- package/src/__tests__/bmad-format-adapter.test.ts +1470 -0
- package/src/__tests__/fixtures/aps/expected-output.json +83 -0
- package/src/__tests__/fixtures/bmad/invalid-malformed-yaml.md +16 -0
- package/src/__tests__/fixtures/bmad/invalid-no-requirements.md +23 -0
- package/src/__tests__/fixtures/bmad/invalid-only-yaml.md +16 -0
- package/src/__tests__/fixtures/bmad/invalid-too-short.md +3 -0
- package/src/__tests__/fixtures/bmad/invalid-wrong-format.md +40 -0
- package/src/__tests__/fixtures/bmad/valid-agent.md +27 -0
- package/src/__tests__/fixtures/bmad/valid-architecture.md +116 -0
- package/src/__tests__/fixtures/bmad/valid-complex-prd.md +161 -0
- package/src/__tests__/fixtures/bmad/valid-epic.md +73 -0
- package/src/__tests__/fixtures/bmad/valid-minimal-prd.md +19 -0
- package/src/__tests__/fixtures/bmad/valid-prd.md +107 -0
- package/src/__tests__/fixtures/bmad/valid-story.md +107 -0
- package/src/__tests__/fixtures/bmad/valid-task.md +79 -0
- package/src/__tests__/fixtures/bmad/valid-v6-prd.md +35 -0
- package/src/__tests__/fixtures/generic/plan-detailed.md +39 -0
- package/src/__tests__/fixtures/generic/prd-simple.md +27 -0
- package/src/__tests__/fixtures/generic/rfc-example.md +26 -0
- package/src/__tests__/fixtures/generic/todo-list.md +23 -0
- package/src/__tests__/fixtures/speckit/sample-plan.md +63 -0
- package/src/__tests__/fixtures/speckit/sample-spec-namespaced.md +50 -0
- package/src/__tests__/fixtures/speckit/sample-spec.md +105 -0
- package/src/__tests__/fixtures/speckit/sample-tasks.md +87 -0
- package/src/__tests__/fixtures/speckit-official/auth-feature/plan.md +272 -0
- package/src/__tests__/fixtures/speckit-official/auth-feature/spec.md +149 -0
- package/src/__tests__/fixtures/speckit-official/auth-feature/tasks.md +169 -0
- package/src/__tests__/generic-format-adapter.test.ts +398 -0
- package/src/__tests__/speckit-export.test.ts +233 -0
- package/src/__tests__/speckit-format-adapter.test.ts +832 -0
- package/src/__tests__/speckit-import-v2.test.ts +253 -0
- package/src/__tests__/speckit-import.test.ts +209 -0
- package/src/__tests__/speckit-parser.test.ts +219 -0
- package/src/__tests__/speckit-spec-parser.test.ts +120 -0
- package/src/aps-markdown/__tests__/__fixtures__/simple-leaf.aps.md +17 -0
- package/src/aps-markdown/__tests__/adapter.test.ts +393 -0
- package/src/aps-markdown/adapter.ts +455 -0
- package/src/aps-markdown/index.ts +8 -0
- package/src/base/__tests__/registry.test.ts +515 -0
- package/src/base/file-discovery.ts +305 -0
- package/src/base/index.ts +10 -0
- package/src/base/registry.ts +263 -0
- package/src/base/testing.ts +334 -0
- package/src/base/types.ts +342 -0
- package/src/base/utils.ts +306 -0
- package/src/bmad/format-adapter.ts +227 -0
- package/src/bmad/index.ts +21 -0
- package/src/bmad/parser.ts +224 -0
- package/src/bmad/serializer.ts +206 -0
- package/src/bmad/types.ts +135 -0
- package/src/bmad/utils.ts +575 -0
- package/src/common/index.ts +2 -0
- package/src/common/registry.ts +72 -0
- package/src/common/types.ts +84 -0
- package/src/generic/__tests__/serializer.test.ts +167 -0
- package/src/generic/format-adapter.ts +200 -0
- package/src/generic/index.ts +11 -0
- package/src/generic/parser.ts +129 -0
- package/src/generic/serializer.ts +134 -0
- package/src/generic/types.ts +53 -0
- package/src/generic/utils.ts +270 -0
- package/src/index.ts +48 -0
- package/src/speckit/export.ts +489 -0
- package/src/speckit/format-adapter.ts +595 -0
- package/src/speckit/import-v2.ts +445 -0
- package/src/speckit/import.ts +305 -0
- package/src/speckit/index.ts +4 -0
- package/src/speckit/parser.ts +351 -0
- package/src/speckit/parsers/plan-parser.ts +342 -0
- package/src/speckit/parsers/spec-parser.ts +379 -0
- package/src/speckit/parsers/tasks-parser.ts +246 -0
- package/tsconfig.json +26 -0
- package/tsconfig.lib.json +21 -0
- package/tsconfig.lib.tsbuildinfo +1 -0
- package/tsconfig.spec.json +9 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vitest.config.ts +14 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "aps-12345678",
|
|
3
|
+
"hash": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
4
|
+
"intent": "Implement a user authentication system with JWT tokens to secure API endpoints and manage user sessions effectively.",
|
|
5
|
+
"schema_version": "0.1.0",
|
|
6
|
+
"proposed_changes": [
|
|
7
|
+
{
|
|
8
|
+
"type": "file_create",
|
|
9
|
+
"path": "src/controllers/auth.controller.ts",
|
|
10
|
+
"description": "Create authentication controller at `src/controllers/auth.controller.ts`",
|
|
11
|
+
"content": "import { Request, Response } from 'express';\nimport jwt from 'jsonwebtoken';\nimport bcrypt from 'bcrypt';\n\nexport class AuthController {\n async register(req: Request, res: Response) {\n // Implementation here\n }\n \n async login(req: Request, res: Response) {\n // Implementation here\n }\n \n async refresh(req: Request, res: Response) {\n // Implementation here\n }\n}"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "file_create",
|
|
15
|
+
"path": "src/middleware/auth.middleware.ts",
|
|
16
|
+
"description": "Create authentication middleware at `src/middleware/auth.middleware.ts`",
|
|
17
|
+
"content": "import { Request, Response, NextFunction } from 'express';\nimport jwt from 'jsonwebtoken';\n\nexport function authenticateToken(req: Request, res: Response, next: NextFunction) {\n // Token verification logic\n}"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "file_update",
|
|
21
|
+
"path": "src/app.ts",
|
|
22
|
+
"description": "Update main application file `src/app.ts`"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "file_update",
|
|
26
|
+
"path": "src/config/env.ts",
|
|
27
|
+
"description": "Update environment configuration `src/config/env.ts`"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "config_update",
|
|
31
|
+
"path": ".env",
|
|
32
|
+
"description": "Update `.env` file"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "dependency_add",
|
|
36
|
+
"path": "package.json",
|
|
37
|
+
"description": "jsonwebtoken: For creating and verifying JWT tokens"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "dependency_add",
|
|
41
|
+
"path": "package.json",
|
|
42
|
+
"description": "bcrypt: For password hashing"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "dependency_add",
|
|
46
|
+
"path": "package.json",
|
|
47
|
+
"description": "express-rate-limit: For rate limiting authentication endpoints"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "script_execute",
|
|
51
|
+
"path": "",
|
|
52
|
+
"description": "Run database migrations to add user table"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "script_execute",
|
|
56
|
+
"path": "",
|
|
57
|
+
"description": "Generate RSA key pair for token signing (optional)"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"provenance": {
|
|
61
|
+
"timestamp": "2024-01-15T10:00:00Z",
|
|
62
|
+
"source": "cli",
|
|
63
|
+
"version": "1.0.0"
|
|
64
|
+
},
|
|
65
|
+
"metadata": {
|
|
66
|
+
"source_format": "speckit",
|
|
67
|
+
"goals": [
|
|
68
|
+
"Implement secure user authentication using JWT tokens",
|
|
69
|
+
"Add middleware for protecting API routes",
|
|
70
|
+
"Support token refresh mechanism for long-lived sessions",
|
|
71
|
+
"Implement proper password hashing and validation",
|
|
72
|
+
"Add rate limiting for authentication endpoints"
|
|
73
|
+
],
|
|
74
|
+
"requirements": [
|
|
75
|
+
"Node.js 18+ runtime environment",
|
|
76
|
+
"Express.js web framework",
|
|
77
|
+
"jsonwebtoken library for JWT handling",
|
|
78
|
+
"bcrypt for password hashing",
|
|
79
|
+
"Redis for session management (optional)"
|
|
80
|
+
],
|
|
81
|
+
"overview": "This specification outlines the implementation of a JWT-based authentication system that will provide secure access control for our API endpoints. The system will support user registration, login, logout, and token refresh functionality."
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Test Document
|
|
3
|
+
version: 1.0.0: invalid
|
|
4
|
+
author: [unclosed array
|
|
5
|
+
date: "2025-10-25
|
|
6
|
+
invalid: yaml: structure: here
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Document with Malformed YAML
|
|
10
|
+
|
|
11
|
+
This document has YAML front-matter that is syntactically invalid, which should
|
|
12
|
+
affect parsing but the BMAD adapter should handle gracefully.
|
|
13
|
+
|
|
14
|
+
FR-01: Some requirement that exists
|
|
15
|
+
|
|
16
|
+
The YAML is malformed but we still have requirement identifiers.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Document Without Requirements'
|
|
3
|
+
version: '1.0.0'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Document Title
|
|
7
|
+
|
|
8
|
+
This document has YAML front-matter and enough content, but it doesn't contain
|
|
9
|
+
any requirement identifiers (FR-XX, NFR-XX, US-XX) which are essential for BMAD
|
|
10
|
+
format.
|
|
11
|
+
|
|
12
|
+
## Section One
|
|
13
|
+
|
|
14
|
+
This is just regular content without any structured requirements.
|
|
15
|
+
|
|
16
|
+
## Section Two
|
|
17
|
+
|
|
18
|
+
More content here, but still no requirements that would indicate this is a BMAD
|
|
19
|
+
document.
|
|
20
|
+
|
|
21
|
+
The document is long enough to pass the minimum length check, but the lack of
|
|
22
|
+
requirement identifiers means it should not be confidently detected as BMAD
|
|
23
|
+
format.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Document with Only YAML'
|
|
3
|
+
version: '1.0.0'
|
|
4
|
+
author: 'Test Author'
|
|
5
|
+
date: '2025-10-25'
|
|
6
|
+
description: 'This document only has YAML front-matter'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Document Title
|
|
10
|
+
|
|
11
|
+
This document has proper YAML front-matter but absolutely no requirements or
|
|
12
|
+
user stories. It's just freeform content without any of the structured elements
|
|
13
|
+
that make it a BMAD document.
|
|
14
|
+
|
|
15
|
+
This should result in low confidence detection and validation warnings about
|
|
16
|
+
missing requirements.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Regular Markdown Document
|
|
2
|
+
|
|
3
|
+
This is just a regular markdown document that doesn't follow BMAD format at all.
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
This document has no YAML front-matter, no requirement identifiers (FR-XX,
|
|
8
|
+
NFR-XX, US-XX), and no user stories. It's just plain markdown content that talks
|
|
9
|
+
about various topics.
|
|
10
|
+
|
|
11
|
+
## Section One
|
|
12
|
+
|
|
13
|
+
Here's some content about topic one. This is a normal paragraph with normal
|
|
14
|
+
text.
|
|
15
|
+
|
|
16
|
+
- Bullet point one
|
|
17
|
+
- Bullet point two
|
|
18
|
+
- Bullet point three
|
|
19
|
+
|
|
20
|
+
## Section Two
|
|
21
|
+
|
|
22
|
+
More content here. Some **bold text** and _italic text_ for variety.
|
|
23
|
+
|
|
24
|
+
> A blockquote for good measure
|
|
25
|
+
|
|
26
|
+
### Subsection
|
|
27
|
+
|
|
28
|
+
Code example:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
function example() {
|
|
32
|
+
return 'This is not BMAD format';
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Conclusion
|
|
37
|
+
|
|
38
|
+
This document should not be detected as BMAD format because it lacks all the key
|
|
39
|
+
indicators like YAML front-matter, requirement identifiers, and structured
|
|
40
|
+
content.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Code Review Agent'
|
|
3
|
+
version: '1.0.0'
|
|
4
|
+
author: 'BMAD Team'
|
|
5
|
+
hasSidecar: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Code Review Agent
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
An automated code review agent that analyzes pull requests for quality,
|
|
13
|
+
security, and best practice adherence using BMAD v6 agent framework.
|
|
14
|
+
|
|
15
|
+
## Role
|
|
16
|
+
|
|
17
|
+
Perform thorough code reviews on incoming pull requests, checking for:
|
|
18
|
+
|
|
19
|
+
- Coding standards compliance
|
|
20
|
+
- Security vulnerabilities
|
|
21
|
+
- Performance issues
|
|
22
|
+
- Test coverage gaps
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
The agent uses `_bmad/_config/module.yaml` for its base configuration and stores
|
|
27
|
+
review history in `_bmad/_memory`.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Architecture Document'
|
|
3
|
+
version: '1.0.0'
|
|
4
|
+
description: 'Authentication Service Architecture'
|
|
5
|
+
output_file: 'ARCHITECTURE.md'
|
|
6
|
+
variables:
|
|
7
|
+
project_name: 'Authentication Service'
|
|
8
|
+
author: 'Technical Team'
|
|
9
|
+
date: '2025-10-23'
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Authentication Service - Architecture Document
|
|
13
|
+
|
|
14
|
+
**Author:** Technical Team **Date:** 2025-10-23 **Version:** 1.0
|
|
15
|
+
|
|
16
|
+
## Change Log
|
|
17
|
+
|
|
18
|
+
| Date | Version | Description | Author |
|
|
19
|
+
| :--------- | :------ | :------------------- | :------------- |
|
|
20
|
+
| 2025-10-23 | 1.0 | Initial architecture | Technical Team |
|
|
21
|
+
|
|
22
|
+
## Technical Summary
|
|
23
|
+
|
|
24
|
+
The authentication service is built using a microservices architecture with
|
|
25
|
+
Node.js/Express backend, PostgreSQL database, and Redis for session management.
|
|
26
|
+
The system follows REST API patterns and implements JWT-based authentication
|
|
27
|
+
tokens.
|
|
28
|
+
|
|
29
|
+
## High Level Architecture
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
┌─────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
33
|
+
│ Client │────▶ │ Auth API │────▶ │ PostgreSQL │
|
|
34
|
+
│ (React) │ │ (Express) │ │ Database │
|
|
35
|
+
└─────────────┘ └──────┬───────┘ └──────────────┘
|
|
36
|
+
│
|
|
37
|
+
▼
|
|
38
|
+
┌──────────────┐
|
|
39
|
+
│ Redis │
|
|
40
|
+
│ Sessions │
|
|
41
|
+
└──────────────┘
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## System Components
|
|
45
|
+
|
|
46
|
+
### API Layer
|
|
47
|
+
|
|
48
|
+
- Express.js REST API
|
|
49
|
+
- JWT token generation and validation
|
|
50
|
+
- Rate limiting and request validation
|
|
51
|
+
- OpenAPI specification
|
|
52
|
+
|
|
53
|
+
### Data Layer
|
|
54
|
+
|
|
55
|
+
- PostgreSQL for user data persistence
|
|
56
|
+
- Redis for session caching
|
|
57
|
+
- Database migrations with Knex.js
|
|
58
|
+
|
|
59
|
+
### Security Layer
|
|
60
|
+
|
|
61
|
+
- bcrypt password hashing
|
|
62
|
+
- JWT token signing
|
|
63
|
+
- CORS configuration
|
|
64
|
+
- Helmet.js security headers
|
|
65
|
+
|
|
66
|
+
## Tech Stack
|
|
67
|
+
|
|
68
|
+
**Backend:**
|
|
69
|
+
|
|
70
|
+
- Node.js 18+
|
|
71
|
+
- Express 4.x
|
|
72
|
+
- TypeScript
|
|
73
|
+
- Passport.js
|
|
74
|
+
|
|
75
|
+
**Database:**
|
|
76
|
+
|
|
77
|
+
- PostgreSQL 14+
|
|
78
|
+
- Redis 7+
|
|
79
|
+
|
|
80
|
+
**Testing:**
|
|
81
|
+
|
|
82
|
+
- Vitest
|
|
83
|
+
- Supertest for API testing
|
|
84
|
+
|
|
85
|
+
## API Specifications
|
|
86
|
+
|
|
87
|
+
### Authentication Endpoints
|
|
88
|
+
|
|
89
|
+
**POST /api/auth/register**
|
|
90
|
+
|
|
91
|
+
- Request: `{ email, password, name }`
|
|
92
|
+
- Response: `{ user, token }`
|
|
93
|
+
- Status: 201 Created
|
|
94
|
+
|
|
95
|
+
**POST /api/auth/login**
|
|
96
|
+
|
|
97
|
+
- Request: `{ email, password }`
|
|
98
|
+
- Response: `{ user, token }`
|
|
99
|
+
- Status: 200 OK
|
|
100
|
+
|
|
101
|
+
**POST /api/auth/logout**
|
|
102
|
+
|
|
103
|
+
- Request: `Bearer token in Authorization header`
|
|
104
|
+
- Response: `{ message: "Logged out" }`
|
|
105
|
+
- Status: 200 OK
|
|
106
|
+
|
|
107
|
+
## Security Considerations
|
|
108
|
+
|
|
109
|
+
FR-07: All API endpoints shall use HTTPS in production
|
|
110
|
+
|
|
111
|
+
FR-08: Rate limiting shall prevent brute force attacks (max 5 attempts per
|
|
112
|
+
minute)
|
|
113
|
+
|
|
114
|
+
NFR-07: Token expiration shall be configurable (default 24 hours)
|
|
115
|
+
|
|
116
|
+
NFR-08: Database connections shall use connection pooling for performance
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Complex PRD'
|
|
3
|
+
version: '2.1.0'
|
|
4
|
+
description: 'E-Commerce Platform PRD'
|
|
5
|
+
output_file: 'ECOMMERCE-PRD.md'
|
|
6
|
+
variables:
|
|
7
|
+
project_name: 'E-Commerce Platform'
|
|
8
|
+
author: 'Product Team'
|
|
9
|
+
date: '2025-10-25'
|
|
10
|
+
status: 'In Progress'
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# E-Commerce Platform - Product Requirements Document
|
|
14
|
+
|
|
15
|
+
**Author:** Product Team **Date:** 2025-10-25 **Version:** 2.1.0 **Status:** In
|
|
16
|
+
Progress
|
|
17
|
+
|
|
18
|
+
## Change Log
|
|
19
|
+
|
|
20
|
+
| Date | Version | Description | Author |
|
|
21
|
+
| :--------- | :------ | :------------------------- | :----------- |
|
|
22
|
+
| 2025-10-20 | 1.0 | Initial PRD | Product Team |
|
|
23
|
+
| 2025-10-23 | 2.0 | Added payment integration | Product Team |
|
|
24
|
+
| 2025-10-25 | 2.1 | Added inventory management | Product Team |
|
|
25
|
+
|
|
26
|
+
## Executive Summary
|
|
27
|
+
|
|
28
|
+
This PRD defines requirements for a comprehensive e-commerce platform that
|
|
29
|
+
handles product catalogue, shopping cart, checkout, payment processing,
|
|
30
|
+
inventory management, and order fulfilment.
|
|
31
|
+
|
|
32
|
+
## Functional Requirements
|
|
33
|
+
|
|
34
|
+
### Product Catalogue
|
|
35
|
+
|
|
36
|
+
FR-01: System shall display product catalogue with search and filter
|
|
37
|
+
capabilities FR-02: System shall support product categories and subcategories
|
|
38
|
+
FR-03: System shall allow product image upload (up to 10 images per product)
|
|
39
|
+
FR-04: System shall display product reviews and ratings FR-05: System shall
|
|
40
|
+
support product variants (size, colour, etc.)
|
|
41
|
+
|
|
42
|
+
### Shopping Cart
|
|
43
|
+
|
|
44
|
+
FR-06: System shall allow users to add products to cart FR-07: System shall
|
|
45
|
+
persist cart across sessions FR-08: System shall calculate cart totals including
|
|
46
|
+
taxes and shipping FR-09: System shall apply discount codes and promotions
|
|
47
|
+
FR-10: System shall show real-time inventory availability
|
|
48
|
+
|
|
49
|
+
### Checkout Process
|
|
50
|
+
|
|
51
|
+
FR-11: System shall provide multi-step checkout flow FR-12: System shall collect
|
|
52
|
+
shipping address FR-13: System shall calculate shipping costs based on
|
|
53
|
+
destination FR-14: System shall support multiple payment methods FR-15: System
|
|
54
|
+
shall send order confirmation emails
|
|
55
|
+
|
|
56
|
+
### Payment Integration
|
|
57
|
+
|
|
58
|
+
FR-16: System shall integrate with Stripe payment gateway FR-17: System shall
|
|
59
|
+
support credit card payments FR-18: System shall support PayPal payments FR-19:
|
|
60
|
+
System shall handle payment failures gracefully FR-20: System shall support
|
|
61
|
+
refund processing
|
|
62
|
+
|
|
63
|
+
### Inventory Management
|
|
64
|
+
|
|
65
|
+
FR-21: System shall track inventory levels in real-time FR-22: System shall
|
|
66
|
+
prevent overselling FR-23: System shall alert when inventory is low FR-24:
|
|
67
|
+
System shall support inventory adjustments FR-25: System shall support multiple
|
|
68
|
+
warehouses
|
|
69
|
+
|
|
70
|
+
### Order Management
|
|
71
|
+
|
|
72
|
+
FR-26: System shall create orders upon payment confirmation FR-27: System shall
|
|
73
|
+
display order history to users FR-28: System shall send order status updates
|
|
74
|
+
FR-29: System shall support order cancellation FR-30: System shall generate
|
|
75
|
+
shipping labels
|
|
76
|
+
|
|
77
|
+
## Non-Functional Requirements
|
|
78
|
+
|
|
79
|
+
### Performance
|
|
80
|
+
|
|
81
|
+
NFR-01: Product search shall return results within 500ms NFR-02: Cart operations
|
|
82
|
+
shall complete within 200ms NFR-03: Checkout shall complete within 5 seconds
|
|
83
|
+
NFR-04: System shall support 1,000 concurrent users
|
|
84
|
+
|
|
85
|
+
### Security
|
|
86
|
+
|
|
87
|
+
NFR-05: All payment data shall be PCI-DSS compliant NFR-06: User passwords shall
|
|
88
|
+
be hashed using bcrypt NFR-07: All API endpoints shall use HTTPS NFR-08: Payment
|
|
89
|
+
information shall never be stored in database
|
|
90
|
+
|
|
91
|
+
### Scalability
|
|
92
|
+
|
|
93
|
+
NFR-09: System shall support 10,000 products NFR-10: System shall handle 100,000
|
|
94
|
+
orders per month NFR-11: Database shall support horizontal scaling
|
|
95
|
+
|
|
96
|
+
### Reliability
|
|
97
|
+
|
|
98
|
+
NFR-12: System shall maintain 99.9% uptime NFR-13: System shall have automated
|
|
99
|
+
backup every 6 hours NFR-14: Payment processing shall have retry mechanism
|
|
100
|
+
|
|
101
|
+
### Compliance
|
|
102
|
+
|
|
103
|
+
NFR-15: System shall be GDPR compliant NFR-16: System shall be CCPA compliant
|
|
104
|
+
NFR-17: System shall provide data export for users NFR-18: System shall support
|
|
105
|
+
right to deletion
|
|
106
|
+
|
|
107
|
+
### Testing
|
|
108
|
+
|
|
109
|
+
NFR-19: All features shall have >90% test coverage NFR-20: System shall have
|
|
110
|
+
end-to-end tests for checkout flow
|
|
111
|
+
|
|
112
|
+
## User Stories
|
|
113
|
+
|
|
114
|
+
US-01: Product Browsing
|
|
115
|
+
|
|
116
|
+
As a customer, I want to browse products by category, so that I can find items
|
|
117
|
+
I'm interested in purchasing.
|
|
118
|
+
|
|
119
|
+
US-02: Add to Cart
|
|
120
|
+
|
|
121
|
+
As a customer, I want to add products to my cart, so that I can purchase
|
|
122
|
+
multiple items at once.
|
|
123
|
+
|
|
124
|
+
US-03: Secure Checkout
|
|
125
|
+
|
|
126
|
+
As a customer, I want a secure checkout process, so that my payment information
|
|
127
|
+
is protected.
|
|
128
|
+
|
|
129
|
+
US-04: Order Tracking
|
|
130
|
+
|
|
131
|
+
As a customer, I want to track my order status, so that I know when to expect
|
|
132
|
+
delivery.
|
|
133
|
+
|
|
134
|
+
US-05: Inventory Management
|
|
135
|
+
|
|
136
|
+
As a store admin, I want to manage inventory levels, so that products don't go
|
|
137
|
+
out of stock unexpectedly.
|
|
138
|
+
|
|
139
|
+
## Success Criteria
|
|
140
|
+
|
|
141
|
+
1. All 30 functional requirements implemented and tested
|
|
142
|
+
2. All 20 non-functional requirements met
|
|
143
|
+
3. Payment integration completed and tested
|
|
144
|
+
4. Inventory management operational
|
|
145
|
+
5. Load testing completed successfully
|
|
146
|
+
6. Security audit passed with no critical issues
|
|
147
|
+
7. User acceptance testing completed
|
|
148
|
+
|
|
149
|
+
## Technical Stack
|
|
150
|
+
|
|
151
|
+
**Frontend:** React, TypeScript, TailwindCSS **Backend:** Node.js, Express,
|
|
152
|
+
TypeScript **Database:** PostgreSQL **Cache:** Redis **Payment:** Stripe API
|
|
153
|
+
**Email:** SendGrid **Hosting:** AWS (EC2, RDS, S3, CloudFront)
|
|
154
|
+
|
|
155
|
+
## Out of Scope
|
|
156
|
+
|
|
157
|
+
- Multi-vendor marketplace (deferred to v3.0)
|
|
158
|
+
- Cryptocurrency payments
|
|
159
|
+
- International shipping (Phase 1 is US only)
|
|
160
|
+
- Mobile app (web-only for Phase 1)
|
|
161
|
+
- Subscription products
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Epic Document'
|
|
3
|
+
version: '1.0.0'
|
|
4
|
+
description: 'User Registration Epic'
|
|
5
|
+
output_file: 'EPIC-001.md'
|
|
6
|
+
variables:
|
|
7
|
+
epic_id: 'EPIC-001'
|
|
8
|
+
author: 'Product Manager'
|
|
9
|
+
date: '2025-10-23'
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# EPIC-001: User Registration
|
|
13
|
+
|
|
14
|
+
**Author:** Product Manager **Date:** 2025-10-23 **Version:** 1.0
|
|
15
|
+
|
|
16
|
+
## Change Log
|
|
17
|
+
|
|
18
|
+
| Date | Version | Description | Author |
|
|
19
|
+
| :--------- | :------ | :----------- | :-------------- |
|
|
20
|
+
| 2025-10-23 | 1.0 | Epic created | Product Manager |
|
|
21
|
+
|
|
22
|
+
## Epic Goal
|
|
23
|
+
|
|
24
|
+
Enable users to create accounts on the platform using email/password or OAuth
|
|
25
|
+
providers, ensuring a smooth onboarding experience whilst maintaining security
|
|
26
|
+
standards.
|
|
27
|
+
|
|
28
|
+
## Description
|
|
29
|
+
|
|
30
|
+
This epic encompasses all functionality related to user registration, including
|
|
31
|
+
account creation forms, validation logic, email verification, and OAuth
|
|
32
|
+
integration. The goal is to make registration as frictionless as possible whilst
|
|
33
|
+
collecting necessary information for compliance.
|
|
34
|
+
|
|
35
|
+
## Related Stories
|
|
36
|
+
|
|
37
|
+
US-01: User registration with email/password US-02: OAuth registration with
|
|
38
|
+
Google US-03: OAuth registration with GitHub US-04: Email verification flow
|
|
39
|
+
US-05: Registration form validation
|
|
40
|
+
|
|
41
|
+
## Success Criteria
|
|
42
|
+
|
|
43
|
+
1. Users can successfully register using email/password
|
|
44
|
+
2. Users can successfully register using OAuth (Google, GitHub)
|
|
45
|
+
3. Email verification process completes successfully
|
|
46
|
+
4. Registration conversion rate >80%
|
|
47
|
+
5. Form validation provides clear error messages
|
|
48
|
+
6. All registration flows have >90% test coverage
|
|
49
|
+
|
|
50
|
+
## Technical Requirements
|
|
51
|
+
|
|
52
|
+
FR-09: Registration form shall validate inputs on client and server side
|
|
53
|
+
|
|
54
|
+
FR-10: Email verification links shall expire after 24 hours
|
|
55
|
+
|
|
56
|
+
NFR-09: Registration process shall complete within 3 seconds
|
|
57
|
+
|
|
58
|
+
NFR-10: Registration form shall be accessible (WCAG 2.1 AA compliant)
|
|
59
|
+
|
|
60
|
+
## Acceptance Criteria
|
|
61
|
+
|
|
62
|
+
As a product owner, I want to see:
|
|
63
|
+
|
|
64
|
+
1. Registration success rate >95%
|
|
65
|
+
2. Form abandonment rate <20%
|
|
66
|
+
3. Email verification completion rate >80%
|
|
67
|
+
4. Zero security vulnerabilities in code review
|
|
68
|
+
|
|
69
|
+
## Out of Scope
|
|
70
|
+
|
|
71
|
+
- Phone number verification
|
|
72
|
+
- Social media login beyond Google and GitHub
|
|
73
|
+
- Corporate email domain restrictions
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Minimal PRD'
|
|
3
|
+
version: '1.0.0'
|
|
4
|
+
author: 'John Doe'
|
|
5
|
+
date: '2025-10-25'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Minimal Product Requirements Document
|
|
9
|
+
|
|
10
|
+
This is a minimal but valid BMAD PRD that contains just the essential elements.
|
|
11
|
+
|
|
12
|
+
## Functional Requirements
|
|
13
|
+
|
|
14
|
+
FR-01: System shall provide a dashboard view FR-02: System shall allow data
|
|
15
|
+
export
|
|
16
|
+
|
|
17
|
+
## Non-Functional Requirements
|
|
18
|
+
|
|
19
|
+
NFR-01: System shall load within 2 seconds
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Product Requirements Document'
|
|
3
|
+
version: '1.0.0'
|
|
4
|
+
description: 'User Authentication System PRD'
|
|
5
|
+
output_file: 'PRD.md'
|
|
6
|
+
variables:
|
|
7
|
+
project_name: 'Authentication Service'
|
|
8
|
+
author: 'Jane Smith'
|
|
9
|
+
date: '2025-10-23'
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Authentication Service - Product Requirements Document
|
|
13
|
+
|
|
14
|
+
**Author:** Jane Smith **Date:** 2025-10-23 **Version:** 1.0
|
|
15
|
+
|
|
16
|
+
## Change Log
|
|
17
|
+
|
|
18
|
+
| Date | Version | Description | Author |
|
|
19
|
+
| :--------- | :------ | :------------------- | :--------- |
|
|
20
|
+
| 2025-10-23 | 1.0 | Initial PRD creation | Jane Smith |
|
|
21
|
+
| 2025-10-24 | 1.1 | Added OAuth support | John Doe |
|
|
22
|
+
|
|
23
|
+
## Executive Summary
|
|
24
|
+
|
|
25
|
+
This PRD defines the requirements for a user authentication system that will
|
|
26
|
+
provide secure login, registration, and session management capabilities for the
|
|
27
|
+
platform. The system must support multiple authentication methods including
|
|
28
|
+
email/password and OAuth providers.
|
|
29
|
+
|
|
30
|
+
## Product Vision
|
|
31
|
+
|
|
32
|
+
Build a secure, scalable authentication system that provides excellent user
|
|
33
|
+
experience whilst maintaining industry-standard security practices.
|
|
34
|
+
|
|
35
|
+
## Functional Requirements
|
|
36
|
+
|
|
37
|
+
### User Registration
|
|
38
|
+
|
|
39
|
+
FR-01: The system shall allow users to register with email and password
|
|
40
|
+
|
|
41
|
+
As a new user, I want to create an account using my email address so that I can
|
|
42
|
+
access the platform.
|
|
43
|
+
|
|
44
|
+
**Acceptance Criteria:**
|
|
45
|
+
|
|
46
|
+
1. Email validation is performed
|
|
47
|
+
2. Password meets complexity requirements
|
|
48
|
+
3. Confirmation email is sent
|
|
49
|
+
4. Account is created in database
|
|
50
|
+
|
|
51
|
+
FR-02: The system shall support OAuth registration
|
|
52
|
+
|
|
53
|
+
As a user, I want to sign up using my Google or GitHub account so that I don't
|
|
54
|
+
need to create a new password.
|
|
55
|
+
|
|
56
|
+
### User Login
|
|
57
|
+
|
|
58
|
+
FR-03: The system shall provide secure login functionality
|
|
59
|
+
|
|
60
|
+
Users must be able to authenticate using their registered credentials and
|
|
61
|
+
receive a session token.
|
|
62
|
+
|
|
63
|
+
FR-04: The system shall implement password reset functionality
|
|
64
|
+
|
|
65
|
+
As a user who forgot their password, I want to receive a reset link via email so
|
|
66
|
+
that I can regain access to my account.
|
|
67
|
+
|
|
68
|
+
### Session Management
|
|
69
|
+
|
|
70
|
+
FR-05: The system shall maintain user sessions securely
|
|
71
|
+
|
|
72
|
+
Session tokens must be cryptographically secure and have appropriate expiration
|
|
73
|
+
times.
|
|
74
|
+
|
|
75
|
+
FR-06: The system shall allow users to log out
|
|
76
|
+
|
|
77
|
+
As a logged-in user, I want to end my session so that others cannot access my
|
|
78
|
+
account on shared devices.
|
|
79
|
+
|
|
80
|
+
## Non-Functional Requirements
|
|
81
|
+
|
|
82
|
+
NFR-01: Security - The system shall encrypt all passwords using bcrypt with
|
|
83
|
+
minimum 12 rounds
|
|
84
|
+
|
|
85
|
+
NFR-02: Performance - Authentication operations shall complete within 500ms at
|
|
86
|
+
95th percentile
|
|
87
|
+
|
|
88
|
+
NFR-03: Scalability - The system shall support 10,000 concurrent users
|
|
89
|
+
|
|
90
|
+
NFR-04: Availability - The authentication service shall maintain 99.9% uptime
|
|
91
|
+
|
|
92
|
+
NFR-05: Compliance - The system shall be GDPR compliant for data handling
|
|
93
|
+
|
|
94
|
+
NFR-06: Testing - All authentication flows shall have >90% test coverage
|
|
95
|
+
|
|
96
|
+
## Success Criteria
|
|
97
|
+
|
|
98
|
+
1. All functional requirements implemented and tested
|
|
99
|
+
2. Non-functional requirements meet defined thresholds
|
|
100
|
+
3. Security audit completed with no critical findings
|
|
101
|
+
4. User acceptance testing completed successfully
|
|
102
|
+
|
|
103
|
+
## Out of Scope
|
|
104
|
+
|
|
105
|
+
- Multi-factor authentication (deferred to v2.0)
|
|
106
|
+
- Biometric authentication
|
|
107
|
+
- Single sign-on (SSO) for enterprise
|