@northbridge-security/secureai 0.1.13 → 0.2.1
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/.claude/README.md +0 -1
- package/.claude/commands/catchup.md +2 -1
- package/.claude/commands/code.md +46 -3
- package/.claude/commands/pr.md +11 -11
- package/.claude/commands/todo.md +59 -9
- package/.claude/commands/wrapup.md +11 -11
- package/package.json +1 -1
package/.claude/README.md
CHANGED
|
@@ -5,6 +5,7 @@ After `/clear` or new session, understand recent changes and context. This comma
|
|
|
5
5
|
## Automation
|
|
6
6
|
|
|
7
7
|
This command is triggered automatically on session start:
|
|
8
|
+
|
|
8
9
|
- Hook checks for `.tmp/session.keep` flag
|
|
9
10
|
- If flag missing: runs catchup and creates flag
|
|
10
11
|
- If flag exists: skips (already caught up this session)
|
|
@@ -87,4 +88,4 @@ Check .tmp/session.keep
|
|
|
87
88
|
│
|
|
88
89
|
▼
|
|
89
90
|
/clear → New session
|
|
90
|
-
```
|
|
91
|
+
```
|
package/.claude/commands/code.md
CHANGED
|
@@ -2,13 +2,45 @@ Implement a feature from its PRD specification.
|
|
|
2
2
|
|
|
3
3
|
## Input
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Requirement path or task identifier: $ARGUMENTS
|
|
6
6
|
|
|
7
|
-
Resolve the
|
|
7
|
+
Resolve the requirement file using this priority:
|
|
8
|
+
|
|
9
|
+
### 1. PRD in docs/requirements/
|
|
10
|
+
|
|
11
|
+
Accept both formats:
|
|
8
12
|
- Full path: `docs/requirements/prd.feature-name.md`
|
|
9
13
|
- Short name: `prd.feature-name.md` (prepend `docs/requirements/`)
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
If the file exists, use it and proceed to Phase 1.
|
|
16
|
+
|
|
17
|
+
### 2. Plan in ~/.claude/plans/
|
|
18
|
+
|
|
19
|
+
Accept both formats:
|
|
20
|
+
- Full path: `~/.claude/plans/feature-name.md`
|
|
21
|
+
- Short name: `feature-name.md` (prepend `~/.claude/plans/`)
|
|
22
|
+
|
|
23
|
+
If the file exists, use it and proceed to Phase 1.
|
|
24
|
+
|
|
25
|
+
### 3. TODO task in docs/TODO.md
|
|
26
|
+
|
|
27
|
+
If no file found in steps 1-2, search `docs/TODO.md` for a matching task section:
|
|
28
|
+
- Read the entire TODO.md file
|
|
29
|
+
- Search for headers (lines starting with `##` or `###`) that contain the search text (case-insensitive)
|
|
30
|
+
- If found, extract the full task section including:
|
|
31
|
+
- The task header
|
|
32
|
+
- All task items (lines starting with `- [ ]` or `- [x]`)
|
|
33
|
+
- Any PRD references in the header (e.g., "PRD: prd.feature-name.md")
|
|
34
|
+
- If a PRD reference exists, read that PRD file from `docs/requirements/`
|
|
35
|
+
- If no PRD reference, use the task section content as the requirement specification
|
|
36
|
+
|
|
37
|
+
### 4. Not Found
|
|
38
|
+
|
|
39
|
+
If none of the above resolve, stop and tell the user:
|
|
40
|
+
- List the paths checked
|
|
41
|
+
- Suggest running `/todo` to see available tasks
|
|
42
|
+
- Suggest checking `docs/requirements/` for available PRDs
|
|
43
|
+
- Suggest going in to plan mode and refine a new plan to work on
|
|
12
44
|
|
|
13
45
|
## Phase 1: Discovery
|
|
14
46
|
|
|
@@ -70,28 +102,37 @@ Create the `*.system.ts` entry point file (excluded from coverage):
|
|
|
70
102
|
Quality and security verification per `docs/QA.md` and `docs/SECURITY.md`.
|
|
71
103
|
|
|
72
104
|
### 6.1 Lint
|
|
105
|
+
|
|
73
106
|
```bash
|
|
74
107
|
bunx biome check src/ tests/
|
|
75
108
|
```
|
|
109
|
+
|
|
76
110
|
Fix all errors. Zero errors required.
|
|
77
111
|
|
|
78
112
|
### 6.2 Type Check
|
|
113
|
+
|
|
79
114
|
```bash
|
|
80
115
|
bunx tsc --noEmit
|
|
81
116
|
```
|
|
117
|
+
|
|
82
118
|
Fix all errors. Zero errors required.
|
|
83
119
|
|
|
84
120
|
### 6.3 Full Test Suite
|
|
121
|
+
|
|
85
122
|
```bash
|
|
86
123
|
bun test tests/unit/
|
|
87
124
|
```
|
|
125
|
+
|
|
88
126
|
All tests must pass. Zero failures. Coverage thresholds from `bunfig.toml`:
|
|
127
|
+
|
|
89
128
|
- Line: 80%
|
|
90
129
|
- Statement: 80%
|
|
91
130
|
- Function: 60%
|
|
92
131
|
|
|
93
132
|
### 6.4 Security Review
|
|
133
|
+
|
|
94
134
|
Verify against `docs/SECURITY.md` checklist:
|
|
135
|
+
|
|
95
136
|
- No `console.log` in production code (Semgrep: `no-console-log-in-production`)
|
|
96
137
|
- No secrets, API keys, or credentials in source (Semgrep: `no-secrets-in-code`)
|
|
97
138
|
- No hardcoded credentials (Semgrep: `no-hardcoded-credentials`)
|
|
@@ -100,7 +141,9 @@ Verify against `docs/SECURITY.md` checklist:
|
|
|
100
141
|
- Managed identity for Azure services (no connection strings in business logic)
|
|
101
142
|
|
|
102
143
|
### 6.5 Architecture Review
|
|
144
|
+
|
|
103
145
|
Verify against `AGENTS.md` clean architecture rules:
|
|
146
|
+
|
|
104
147
|
- Dependencies point inward (business logic does not import system files)
|
|
105
148
|
- Every external dependency has an `I{Name}` interface
|
|
106
149
|
- System files (`*.system.ts`) contain only thin wrappers
|
package/.claude/commands/pr.md
CHANGED
|
@@ -434,16 +434,16 @@ The workflow runs autonomously except:
|
|
|
434
434
|
|
|
435
435
|
This command expects these tasks (create stubs if missing):
|
|
436
436
|
|
|
437
|
-
| Task | Purpose | Required
|
|
438
|
-
| ------------------------------ | ---------------- |
|
|
439
|
-
| `task test` or `task qa` | Run tests | Yes
|
|
440
|
-
| `task lint` | Run linting | Optional
|
|
441
|
-
| `task deploy` | Deploy to stage | Optional
|
|
442
|
-
| `task git` | List git tasks | Used for detection (see 2.5)
|
|
443
|
-
| `task git:pr:create FILE=path` | Create PR | If detected, always used instead of MCP
|
|
444
|
-
| `task git:pr:update` | Update PR | If detected, always used instead of MCP
|
|
445
|
-
| `task git:pr:comments` | Fetch comments | Optional (MCP fallback)
|
|
446
|
-
| `task git:runs:log` | Download CI logs | Optional
|
|
437
|
+
| Task | Purpose | Required |
|
|
438
|
+
| ------------------------------ | ---------------- | --------------------------------------- |
|
|
439
|
+
| `task test` or `task qa` | Run tests | Yes |
|
|
440
|
+
| `task lint` | Run linting | Optional |
|
|
441
|
+
| `task deploy` | Deploy to stage | Optional |
|
|
442
|
+
| `task git` | List git tasks | Used for detection (see 2.5) |
|
|
443
|
+
| `task git:pr:create FILE=path` | Create PR | If detected, always used instead of MCP |
|
|
444
|
+
| `task git:pr:update` | Update PR | If detected, always used instead of MCP |
|
|
445
|
+
| `task git:pr:comments` | Fetch comments | Optional (MCP fallback) |
|
|
446
|
+
| `task git:runs:log` | Download CI logs | Optional |
|
|
447
447
|
|
|
448
448
|
---
|
|
449
449
|
|
|
@@ -454,7 +454,7 @@ This command expects these tasks (create stubs if missing):
|
|
|
454
454
|
| Tests fail | Analyze, fix, retry |
|
|
455
455
|
| Deploy fails | Analyze infrastructure errors, fix, retry |
|
|
456
456
|
| GoTask not available | Use GitHub MCP (detected in step 2.5) |
|
|
457
|
-
| PR creation fails | Report error and ask user for guidance
|
|
457
|
+
| PR creation fails | Report error and ask user for guidance |
|
|
458
458
|
| CI fails | Download logs, fix, ask user to push |
|
|
459
459
|
| Review comments unclear | Ask user for decision |
|
|
460
460
|
|
package/.claude/commands/todo.md
CHANGED
|
@@ -8,11 +8,61 @@ List or add todos in `docs/TODO.md`. This file is gitignored - personal task tra
|
|
|
8
8
|
- **Git status**: Ignored (add to `.gitignore` if not present)
|
|
9
9
|
- **Scope**: Personal/local - not shared with team
|
|
10
10
|
|
|
11
|
+
## Requirement Document References
|
|
12
|
+
|
|
13
|
+
When referencing requirement documents in TODO.md, follow these path rules:
|
|
14
|
+
|
|
15
|
+
### No Path Required
|
|
16
|
+
|
|
17
|
+
- **Global Claude plans**: `~/.claude/plans/*.md` - Just use filename: `plan-feature.md`
|
|
18
|
+
- **Project requirements**: `docs/requirements/*.md` - Just use filename: `prd.feature.md`
|
|
19
|
+
- **Self-contained tasks**: All information in TODO.md - No reference needed
|
|
20
|
+
|
|
21
|
+
**Examples**:
|
|
22
|
+
```markdown
|
|
23
|
+
## Feature Implementation
|
|
24
|
+
PRD: prd.auth-system.md
|
|
25
|
+
- [ ] Implement OAuth2 flow
|
|
26
|
+
|
|
27
|
+
## Database Migration
|
|
28
|
+
Plan: migration-plan.md
|
|
29
|
+
- [ ] Update schema
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Path MUST Be Provided
|
|
33
|
+
|
|
34
|
+
- **Other repo locations**: Provide repo-relative path
|
|
35
|
+
- **Outside repo**: Provide full filesystem path or URL
|
|
36
|
+
|
|
37
|
+
**Examples**:
|
|
38
|
+
```markdown
|
|
39
|
+
## Infrastructure Update
|
|
40
|
+
Spec: infrastructure/specs/k8s-migration.md
|
|
41
|
+
- [ ] Migrate to Kubernetes
|
|
42
|
+
|
|
43
|
+
## External Integration
|
|
44
|
+
API Docs: https://api.example.com/docs/v2
|
|
45
|
+
- [ ] Implement webhook handler
|
|
46
|
+
|
|
47
|
+
## Shared Documentation
|
|
48
|
+
Guide: /Users/team/shared-docs/security-guidelines.md
|
|
49
|
+
- [ ] Apply security standards
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Validation
|
|
53
|
+
|
|
54
|
+
The `/code` command will:
|
|
55
|
+
1. Check `~/.claude/plans/` for plan files
|
|
56
|
+
2. Check `docs/requirements/` for PRD files
|
|
57
|
+
3. Check repo-relative paths if provided
|
|
58
|
+
4. Fail with clear error if document not found
|
|
59
|
+
|
|
11
60
|
## Tasks
|
|
12
61
|
|
|
13
62
|
### Prerequisites
|
|
14
63
|
|
|
15
64
|
- If `docs/TODO.md` doesn't exist: Create it with template:
|
|
65
|
+
|
|
16
66
|
```markdown
|
|
17
67
|
# Project TODOs
|
|
18
68
|
|
|
@@ -21,17 +71,17 @@ List or add todos in `docs/TODO.md`. This file is gitignored - personal task tra
|
|
|
21
71
|
## In Progress
|
|
22
72
|
|
|
23
73
|
| Task | Priority | Notes |
|
|
24
|
-
|
|
74
|
+
| ---- | -------- | ----- |
|
|
25
75
|
|
|
26
76
|
## Backlog
|
|
27
77
|
|
|
28
78
|
| Task | Priority | Notes |
|
|
29
|
-
|
|
79
|
+
| ---- | -------- | ----- |
|
|
30
80
|
|
|
31
81
|
## Done
|
|
32
82
|
|
|
33
83
|
| Task | Completed | Notes |
|
|
34
|
-
|
|
84
|
+
| ---- | --------- | ----- |
|
|
35
85
|
```
|
|
36
86
|
|
|
37
87
|
- If `docs/TODO.md` not in `.gitignore`: Add `docs/TODO.md` to `.gitignore`
|
|
@@ -71,11 +121,11 @@ List or add todos in `docs/TODO.md`. This file is gitignored - personal task tra
|
|
|
71
121
|
|
|
72
122
|
## Priority Guidelines
|
|
73
123
|
|
|
74
|
-
| Priority | When
|
|
75
|
-
|
|
76
|
-
| High
|
|
77
|
-
| Medium
|
|
78
|
-
| Low
|
|
124
|
+
| Priority | When |
|
|
125
|
+
| -------- | --------------------------- |
|
|
126
|
+
| High | Blocking other work, urgent |
|
|
127
|
+
| Medium | Next planned work |
|
|
128
|
+
| Low | Nice to have, future idea |
|
|
79
129
|
|
|
80
130
|
## Examples
|
|
81
131
|
|
|
@@ -96,4 +146,4 @@ List or add todos in `docs/TODO.md`. This file is gitignored - personal task tra
|
|
|
96
146
|
|
|
97
147
|
/todo done Fix login timeout bug
|
|
98
148
|
→ Moved to Done (2024-02-03)
|
|
99
|
-
```
|
|
149
|
+
```
|
|
@@ -76,8 +76,8 @@ Decisions are numbered sequentially (ADR-001, ADR-002, etc.).
|
|
|
76
76
|
|
|
77
77
|
## Index
|
|
78
78
|
|
|
79
|
-
| ADR
|
|
80
|
-
|
|
79
|
+
| ADR | Title | Date | Status |
|
|
80
|
+
| ------- | ---------------- | ---------- | -------- |
|
|
81
81
|
| ADR-001 | Example decision | 2024-01-15 | Accepted |
|
|
82
82
|
|
|
83
83
|
---
|
|
@@ -89,15 +89,15 @@ Decisions are numbered sequentially (ADR-001, ADR-002, etc.).
|
|
|
89
89
|
|
|
90
90
|
## What Qualifies as an ADR?
|
|
91
91
|
|
|
92
|
-
| Include
|
|
93
|
-
|
|
94
|
-
| Technology choices
|
|
95
|
-
| Architecture patterns | Implementation details
|
|
96
|
-
| Breaking changes
|
|
97
|
-
| API design decisions
|
|
98
|
-
| Security policies
|
|
99
|
-
| Data model changes
|
|
92
|
+
| Include | Exclude |
|
|
93
|
+
| --------------------- | -------------------------- |
|
|
94
|
+
| Technology choices | Bug fixes |
|
|
95
|
+
| Architecture patterns | Implementation details |
|
|
96
|
+
| Breaking changes | Temporary workarounds |
|
|
97
|
+
| API design decisions | Style preferences |
|
|
98
|
+
| Security policies | Config tweaks |
|
|
99
|
+
| Data model changes | Dependency updates (minor) |
|
|
100
100
|
|
|
101
101
|
## Note
|
|
102
102
|
|
|
103
|
-
After this command, manually run `/clear` to start fresh.
|
|
103
|
+
After this command, manually run `/clear` to start fresh.
|