@northbridge-security/secureai 0.1.13
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 +122 -0
- package/.claude/commands/architect/clean.md +978 -0
- package/.claude/commands/architect/kiss.md +762 -0
- package/.claude/commands/architect/review.md +704 -0
- package/.claude/commands/catchup.md +90 -0
- package/.claude/commands/code.md +115 -0
- package/.claude/commands/commit.md +1218 -0
- package/.claude/commands/cover.md +1298 -0
- package/.claude/commands/fmea.md +275 -0
- package/.claude/commands/kaizen.md +312 -0
- package/.claude/commands/pr.md +503 -0
- package/.claude/commands/todo.md +99 -0
- package/.claude/commands/worktree.md +738 -0
- package/.claude/commands/wrapup.md +103 -0
- package/LICENSE +183 -0
- package/README.md +108 -0
- package/dist/cli.js +75634 -0
- package/docs/agents/devops-reviewer.md +889 -0
- package/docs/agents/kiss-simplifier.md +1088 -0
- package/docs/agents/typescript.md +8 -0
- package/docs/guides/README.md +109 -0
- package/docs/guides/agents.clean.arch.md +244 -0
- package/docs/guides/agents.clean.arch.ts.md +1314 -0
- package/docs/guides/agents.gotask.md +1037 -0
- package/docs/guides/agents.markdown.md +1209 -0
- package/docs/guides/agents.onepassword.md +285 -0
- package/docs/guides/agents.sonar.md +857 -0
- package/docs/guides/agents.tdd.md +838 -0
- package/docs/guides/agents.tdd.ts.md +1062 -0
- package/docs/guides/agents.typesript.md +1389 -0
- package/docs/guides/github-mcp.md +1075 -0
- package/package.json +130 -0
- package/packages/secureai-cli/src/cli.ts +21 -0
- package/tasks/README.md +880 -0
- package/tasks/aws.yml +64 -0
- package/tasks/bash.yml +118 -0
- package/tasks/bun.yml +738 -0
- package/tasks/claude.yml +183 -0
- package/tasks/docker.yml +420 -0
- package/tasks/docs.yml +127 -0
- package/tasks/git.yml +1336 -0
- package/tasks/gotask.yml +132 -0
- package/tasks/json.yml +77 -0
- package/tasks/markdown.yml +95 -0
- package/tasks/onepassword.yml +350 -0
- package/tasks/security.yml +102 -0
- package/tasks/sonar.yml +437 -0
- package/tasks/template.yml +74 -0
- package/tasks/vscode.yml +103 -0
- package/tasks/yaml.yml +121 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Catchup: Understand Changed Files
|
|
2
|
+
|
|
3
|
+
After `/clear` or new session, understand recent changes and context. This command runs automatically on first prompt via UserPromptSubmit hook.
|
|
4
|
+
|
|
5
|
+
## Automation
|
|
6
|
+
|
|
7
|
+
This command is triggered automatically on session start:
|
|
8
|
+
- Hook checks for `.tmp/session.keep` flag
|
|
9
|
+
- If flag missing: runs catchup and creates flag
|
|
10
|
+
- If flag exists: skips (already caught up this session)
|
|
11
|
+
- Flag is cleared by `/wrapup`
|
|
12
|
+
|
|
13
|
+
## Tasks
|
|
14
|
+
|
|
15
|
+
1. **Check session flag**
|
|
16
|
+
- If `.tmp/session.keep` exists: Skip catchup, continue with user's request
|
|
17
|
+
- If missing: Continue with catchup tasks below
|
|
18
|
+
|
|
19
|
+
2. **Read project context**
|
|
20
|
+
- Read `README.md` in project root or first `docs` folder
|
|
21
|
+
- Read `AGENTS.md` if exists
|
|
22
|
+
- Understand project purpose and structure
|
|
23
|
+
|
|
24
|
+
3. **Read recent changes**
|
|
25
|
+
- Run `git diff --name-only HEAD~10` (last 10 commits)
|
|
26
|
+
- Run `git status` for uncommitted changes
|
|
27
|
+
- Summarize what files changed recently
|
|
28
|
+
|
|
29
|
+
4. **Load TODOs**
|
|
30
|
+
- Read `docs/TODO.md` if exists
|
|
31
|
+
- Note tasks in "In Progress" section
|
|
32
|
+
- These are active work items
|
|
33
|
+
|
|
34
|
+
5. **Load recent ADRs**
|
|
35
|
+
- Read `docs/ADR.md` if exists
|
|
36
|
+
- Scan the Index table for recent decisions (last 30 days)
|
|
37
|
+
- Note any ADRs relevant to current work
|
|
38
|
+
|
|
39
|
+
6. **Read open notes**
|
|
40
|
+
- Check for `docs/notes/*.open.md` files
|
|
41
|
+
- If found: Read and summarize key points
|
|
42
|
+
- These contain context from previous sessions
|
|
43
|
+
|
|
44
|
+
7. **Mark session started**
|
|
45
|
+
- Run: `secureai session start`
|
|
46
|
+
- This creates the flag and prevents catchup from running again this session
|
|
47
|
+
|
|
48
|
+
8. **Output summary**
|
|
49
|
+
```
|
|
50
|
+
Session catchup complete:
|
|
51
|
+
- Recent changes: [list of changed areas]
|
|
52
|
+
- In Progress: [tasks from TODO.md]
|
|
53
|
+
- Recent ADRs: [any new decisions]
|
|
54
|
+
- Ready to continue.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Manual Override
|
|
58
|
+
|
|
59
|
+
User can always run `/catchup` manually to refresh context, even if flag exists.
|
|
60
|
+
When run manually, skip the flag check and always execute catchup.
|
|
61
|
+
|
|
62
|
+
## Session Flow
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
New session
|
|
66
|
+
│
|
|
67
|
+
▼
|
|
68
|
+
First prompt → UserPromptSubmit hook
|
|
69
|
+
│
|
|
70
|
+
▼
|
|
71
|
+
Check .tmp/session.keep
|
|
72
|
+
│
|
|
73
|
+
├─ Exists → Skip catchup, process user prompt
|
|
74
|
+
│
|
|
75
|
+
└─ Missing → Run catchup
|
|
76
|
+
│
|
|
77
|
+
▼
|
|
78
|
+
Create flag
|
|
79
|
+
│
|
|
80
|
+
▼
|
|
81
|
+
Process user prompt
|
|
82
|
+
│
|
|
83
|
+
...
|
|
84
|
+
│
|
|
85
|
+
▼
|
|
86
|
+
/wrapup → Removes flag
|
|
87
|
+
│
|
|
88
|
+
▼
|
|
89
|
+
/clear → New session
|
|
90
|
+
```
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Implement a feature from its PRD specification.
|
|
2
|
+
|
|
3
|
+
## Input
|
|
4
|
+
|
|
5
|
+
PRD path: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
Resolve the PRD file path. The PRD is always under `docs/requirements/`. Accept both formats:
|
|
8
|
+
- Full path: `docs/requirements/prd.feature-name.md`
|
|
9
|
+
- Short name: `prd.feature-name.md` (prepend `docs/requirements/`)
|
|
10
|
+
|
|
11
|
+
Read the PRD file. If it does not exist, stop and tell the user.
|
|
12
|
+
|
|
13
|
+
## Phase 1: Discovery
|
|
14
|
+
|
|
15
|
+
1. Read the PRD thoroughly — understand the problem, features, WBS, file summary, milestones, and dependencies.
|
|
16
|
+
2. Read `AGENTS.md` for architecture rules, code style, testing rules, and security requirements.
|
|
17
|
+
3. Read `docs/QA.md` for test strategy, coverage targets, and quality gate criteria.
|
|
18
|
+
4. Read `docs/SECURITY.md` for security design practices and constraints.
|
|
19
|
+
5. Explore the existing codebase to understand what types, interfaces, mocks, and patterns already exist. Use the Explore agent for this.
|
|
20
|
+
|
|
21
|
+
## Phase 2: Plan
|
|
22
|
+
|
|
23
|
+
1. Create an implementation plan at `docs/requirements/plan.<feature-name>.md` that covers:
|
|
24
|
+
- Prerequisites (what already exists, what needs to be created)
|
|
25
|
+
- Phased implementation matching the PRD milestones
|
|
26
|
+
- Concrete tasks with file paths, function signatures, and test cases
|
|
27
|
+
- Dependency graph showing which phases can run in parallel
|
|
28
|
+
- File summary with architecture layer and coverage expectations
|
|
29
|
+
2. Commit the plan to the current branch and push.
|
|
30
|
+
|
|
31
|
+
## Phase 3: Setup
|
|
32
|
+
|
|
33
|
+
1. Install any new dependencies (`bun add <package>`).
|
|
34
|
+
2. Create the directory structure for new source and test files.
|
|
35
|
+
3. Run `task quality` (or `bun test && bunx biome check src/ tests/ && bunx tsc --noEmit`) to verify the baseline is green before writing any code.
|
|
36
|
+
|
|
37
|
+
## Phase 4: Implementation — Parallel Sub-Agents
|
|
38
|
+
|
|
39
|
+
Identify which phases from the plan can run in parallel. The typical split:
|
|
40
|
+
|
|
41
|
+
- **Agent A**: Pure utility functions + their tests (no external dependency mocks needed)
|
|
42
|
+
- **Agent B**: Handler/business logic + their tests (uses existing mocks for interfaces)
|
|
43
|
+
|
|
44
|
+
Launch both agents simultaneously using the Task tool with `subagent_type: general-purpose`. Each agent prompt must include:
|
|
45
|
+
|
|
46
|
+
- The exact file paths to create
|
|
47
|
+
- All relevant type definitions, interface signatures, and mock APIs (copy from discovery)
|
|
48
|
+
- Library API signatures (from `node_modules/**/*.d.ts`)
|
|
49
|
+
- Biome formatting rules: double quotes, semicolons, ES5 trailing commas, 2-space indent, 100 char width
|
|
50
|
+
- TypeScript constraints: `verbatimModuleSyntax: true` (use `import type` for type-only imports)
|
|
51
|
+
- Testing rules: `bun:test`, use `test()` not `it()`, atomic tests (new mock per `test()` block)
|
|
52
|
+
- Instruction to write files AND run tests, fixing any failures before returning
|
|
53
|
+
|
|
54
|
+
After both agents complete:
|
|
55
|
+
|
|
56
|
+
1. Read all generated files to verify consistency
|
|
57
|
+
2. Run the combined tests: `bun test tests/unit/functions/<feature>/`
|
|
58
|
+
3. Fix any integration issues between the two agents' outputs
|
|
59
|
+
|
|
60
|
+
## Phase 5: System Entry Point
|
|
61
|
+
|
|
62
|
+
Create the `*.system.ts` entry point file (excluded from coverage):
|
|
63
|
+
|
|
64
|
+
- Thin wiring only — zero business logic
|
|
65
|
+
- Message parsing and dependency instantiation
|
|
66
|
+
- If Azure SDK packages are not yet installed (depends on infrastructure PRD), write a compilable version that references the handler and types without importing unavailable packages
|
|
67
|
+
|
|
68
|
+
## Phase 6: Hardening
|
|
69
|
+
|
|
70
|
+
Quality and security verification per `docs/QA.md` and `docs/SECURITY.md`.
|
|
71
|
+
|
|
72
|
+
### 6.1 Lint
|
|
73
|
+
```bash
|
|
74
|
+
bunx biome check src/ tests/
|
|
75
|
+
```
|
|
76
|
+
Fix all errors. Zero errors required.
|
|
77
|
+
|
|
78
|
+
### 6.2 Type Check
|
|
79
|
+
```bash
|
|
80
|
+
bunx tsc --noEmit
|
|
81
|
+
```
|
|
82
|
+
Fix all errors. Zero errors required.
|
|
83
|
+
|
|
84
|
+
### 6.3 Full Test Suite
|
|
85
|
+
```bash
|
|
86
|
+
bun test tests/unit/
|
|
87
|
+
```
|
|
88
|
+
All tests must pass. Zero failures. Coverage thresholds from `bunfig.toml`:
|
|
89
|
+
- Line: 80%
|
|
90
|
+
- Statement: 80%
|
|
91
|
+
- Function: 60%
|
|
92
|
+
|
|
93
|
+
### 6.4 Security Review
|
|
94
|
+
Verify against `docs/SECURITY.md` checklist:
|
|
95
|
+
- No `console.log` in production code (Semgrep: `no-console-log-in-production`)
|
|
96
|
+
- No secrets, API keys, or credentials in source (Semgrep: `no-secrets-in-code`)
|
|
97
|
+
- No hardcoded credentials (Semgrep: `no-hardcoded-credentials`)
|
|
98
|
+
- All external I/O behind interfaces (`*.system.ts` files)
|
|
99
|
+
- Dependency injection used — no SDK clients instantiated in handlers
|
|
100
|
+
- Managed identity for Azure services (no connection strings in business logic)
|
|
101
|
+
|
|
102
|
+
### 6.5 Architecture Review
|
|
103
|
+
Verify against `AGENTS.md` clean architecture rules:
|
|
104
|
+
- Dependencies point inward (business logic does not import system files)
|
|
105
|
+
- Every external dependency has an `I{Name}` interface
|
|
106
|
+
- System files (`*.system.ts`) contain only thin wrappers
|
|
107
|
+
- Mocks implement their corresponding interface
|
|
108
|
+
- Test isolation: mocks scoped to each `test()` block
|
|
109
|
+
|
|
110
|
+
## Phase 7: Commit and Push
|
|
111
|
+
|
|
112
|
+
1. Stage all new and modified files (be specific, avoid `git add -A`)
|
|
113
|
+
2. Commit with conventional commit format: `feat(<scope>): <description>`
|
|
114
|
+
3. Push to the current branch
|
|
115
|
+
4. Report summary: files created, test count, coverage numbers, quality gate status
|