bobs-workshop 3.1.1 β 3.1.4
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/dist/tools/background-agent/manager.d.ts.map +1 -1
- package/dist/tools/background-agent/manager.js +39 -12
- package/dist/tools/manual/verify-manual.d.ts.map +1 -1
- package/dist/tools/manual/verify-manual.js +36 -6
- package/package.json +3 -2
- package/src/agents/alice.md +14 -14
- package/src/agents/bob-rev.md +13 -14
- package/src/agents/bob-send.md +14 -15
- package/src/agents/bob.md +12 -14
- package/src/agents/trace.md +2 -2
- package/src/skills/api-patterns/SKILL.md +15 -15
- package/src/skills/architecture/SKILL.md +4 -4
- package/src/skills/brainstorming/SKILL.md +18 -18
- package/src/skills/clean-code/SKILL.md +11 -11
- package/src/skills/code-review-checklist/SKILL.md +23 -23
- package/src/skills/database-design/SKILL.md +1 -1
- package/src/skills/exploration/SKILL.md +5 -5
- package/src/skills/performance/SKILL.md +1 -1
- package/src/skills/plan-writing/SKILL.md +6 -6
- package/src/skills/security/SKILL.md +13 -13
- package/src/skills/simplification/SKILL.md +2 -2
- package/src/skills/systematic-debugging/SKILL.md +6 -6
- package/src/skills/testing-patterns/SKILL.md +1 -1
- package/src/tools/background-agent/manager.ts +44 -12
- package/src/tools/manual/verify-manual.ts +44 -6
- package/src/skills/verification/SKILL.md +0 -286
|
@@ -12,23 +12,23 @@ metadata:
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## STOP SOCRATIC GATE (ENFORCEMENT)
|
|
16
16
|
|
|
17
17
|
### When to Trigger
|
|
18
18
|
|
|
19
19
|
| Pattern | Action |
|
|
20
20
|
|---------|--------|
|
|
21
|
-
| "Build/Create/Make [thing]" without details |
|
|
22
|
-
| Complex feature or architecture |
|
|
23
|
-
| Update/change request |
|
|
24
|
-
| Vague requirements |
|
|
21
|
+
| "Build/Create/Make [thing]" without details | STOP ASK 3 questions |
|
|
22
|
+
| Complex feature or architecture | STOP Clarify before implementing |
|
|
23
|
+
| Update/change request | STOP Confirm scope |
|
|
24
|
+
| Vague requirements | STOP Ask purpose, users, constraints |
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### DENIED MANDATORY: 3 Questions Before Implementation
|
|
27
27
|
|
|
28
28
|
1. **STOP** - Do NOT start coding
|
|
29
29
|
2. **ASK** - Minimum 3 questions:
|
|
30
|
-
-
|
|
31
|
-
-
|
|
30
|
+
- [TARGET] Purpose: What problem are you solving?
|
|
31
|
+
- [TEAM] Users: Who will use this?
|
|
32
32
|
- π¦ Scope: Must-have vs nice-to-have?
|
|
33
33
|
3. **WAIT** - Get response before proceeding
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ metadata:
|
|
|
36
36
|
|
|
37
37
|
## π§ Dynamic Question Generation
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
**BLOCKED NEVER use static templates.** Read `dynamic-questioning.md` for principles.
|
|
40
40
|
|
|
41
41
|
### Core Principles
|
|
42
42
|
|
|
@@ -85,17 +85,17 @@ metadata:
|
|
|
85
85
|
|
|
86
86
|
| Agent | Status | Current Task | Progress |
|
|
87
87
|
|-------|--------|--------------|----------|
|
|
88
|
-
| [Agent Name] |
|
|
88
|
+
| [Agent Name] | YES[REFRESH]β³NOWARNING | [Task description] | [% or count] |
|
|
89
89
|
|
|
90
90
|
### Status Icons
|
|
91
91
|
|
|
92
92
|
| Icon | Meaning | Usage |
|
|
93
93
|
|------|---------|-------|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
94
|
+
| YES | Completed | Task finished successfully |
|
|
95
|
+
| [REFRESH] | Running | Currently executing |
|
|
96
96
|
| β³ | Waiting | Blocked, waiting for dependency |
|
|
97
|
-
|
|
|
98
|
-
|
|
|
97
|
+
| NO | Error | Failed, needs attention |
|
|
98
|
+
| WARNING | Warning | Potential issue, not blocking |
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
@@ -143,7 +143,7 @@ metadata:
|
|
|
143
143
|
| Principle | Implementation |
|
|
144
144
|
|-----------|----------------|
|
|
145
145
|
| **Concise** | No unnecessary details, get to point |
|
|
146
|
-
| **Visual** | Use emojis (
|
|
146
|
+
| **Visual** | Use emojis (YES[REFRESH]β³NO) for quick scanning |
|
|
147
147
|
| **Specific** | "~2 minutes" not "wait a bit" |
|
|
148
148
|
| **Alternatives** | Offer multiple paths when stuck |
|
|
149
149
|
| **Proactive** | Suggest next step after completion |
|
|
@@ -170,7 +170,7 @@ This skill is used by **alice (architect)** agent during the PLAN phase.
|
|
|
170
170
|
|
|
171
171
|
Add planning section to MANUAL:
|
|
172
172
|
```markdown
|
|
173
|
-
##
|
|
173
|
+
## [DOC] Product Specifications
|
|
174
174
|
|
|
175
175
|
### Requirements Clarification (Socratic Gate)
|
|
176
176
|
- [ ] Purpose identified
|
|
@@ -190,7 +190,7 @@ Update agent handoffs with status:
|
|
|
190
190
|
```markdown
|
|
191
191
|
## π€ Agent Handoffs
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
[REFRESH] alice: Planning in progress (3/5 tasks complete)
|
|
194
194
|
π€ alice β bob-eng: Handoff - MANUAL ready for implementation
|
|
195
195
|
```
|
|
196
196
|
|
|
@@ -198,7 +198,7 @@ Update agent handoffs with status:
|
|
|
198
198
|
|
|
199
199
|
Standardize error messages across all agents:
|
|
200
200
|
```markdown
|
|
201
|
-
|
|
201
|
+
NO Error: [Brief description]
|
|
202
202
|
|
|
203
203
|
**What happened:** [User-friendly explanation]
|
|
204
204
|
|
|
@@ -72,7 +72,7 @@ metadata:
|
|
|
72
72
|
|
|
73
73
|
## Anti-Patterns (DON'T)
|
|
74
74
|
|
|
75
|
-
|
|
|
75
|
+
| NO Pattern | YES Fix |
|
|
76
76
|
|-----------|-------|
|
|
77
77
|
| Comment every line | Delete obvious comments |
|
|
78
78
|
| Helper for one-liner | Inline the code |
|
|
@@ -85,7 +85,7 @@ metadata:
|
|
|
85
85
|
|
|
86
86
|
---
|
|
87
87
|
|
|
88
|
-
##
|
|
88
|
+
## CRITICAL Before Editing ANY File (THINK FIRST!)
|
|
89
89
|
|
|
90
90
|
**Before changing a file, ask yourself:**
|
|
91
91
|
|
|
@@ -103,8 +103,8 @@ File to edit: UserService.ts
|
|
|
103
103
|
βββ Do they need changes too? β Check function signatures
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
>
|
|
107
|
-
>
|
|
106
|
+
> CRITICAL **Rule:** Edit the file + all dependent files in the SAME task.
|
|
107
|
+
> CRITICAL **Never leave broken imports or missing updates.**
|
|
108
108
|
|
|
109
109
|
---
|
|
110
110
|
|
|
@@ -114,13 +114,13 @@ File to edit: UserService.ts
|
|
|
114
114
|
|
|
115
115
|
| Check | Question |
|
|
116
116
|
|-------|----------|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
117
|
+
| YES **Goal met?** | Did I do exactly what user asked? |
|
|
118
|
+
| YES **Files edited?** | Did I modify all necessary files? |
|
|
119
|
+
| YES **Code works?** | Did I test/verify the change? |
|
|
120
|
+
| YES **No errors?** | Lint and TypeScript pass? |
|
|
121
|
+
| YES **Nothing forgotten?** | Any edge cases missed? |
|
|
122
122
|
|
|
123
|
-
>
|
|
123
|
+
> CRITICAL **Rule:** If ANY check fails, fix it before completing.
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
@@ -132,7 +132,7 @@ This skill is used by **bob-eng (engineer)** agent during the BUILD phase.
|
|
|
132
132
|
|
|
133
133
|
Add code quality checks to implementation logs:
|
|
134
134
|
```markdown
|
|
135
|
-
##
|
|
135
|
+
## Execution Logs
|
|
136
136
|
|
|
137
137
|
### Code Quality
|
|
138
138
|
- [ ] Functions under 20 lines
|
|
@@ -55,10 +55,10 @@ metadata:
|
|
|
55
55
|
|
|
56
56
|
### Prompt Engineering Review
|
|
57
57
|
```markdown
|
|
58
|
-
//
|
|
58
|
+
// NO Vague prompt in code
|
|
59
59
|
const response = await ai.generate(userInput);
|
|
60
60
|
|
|
61
|
-
//
|
|
61
|
+
// YES Structured & Safe prompt
|
|
62
62
|
const response = await ai.generate({
|
|
63
63
|
system: "You are a specialized parser...",
|
|
64
64
|
input: sanitize(userInput),
|
|
@@ -69,36 +69,36 @@ const response = await ai.generate({
|
|
|
69
69
|
## Anti-Patterns to Flag
|
|
70
70
|
|
|
71
71
|
```typescript
|
|
72
|
-
//
|
|
72
|
+
// NO Magic numbers
|
|
73
73
|
if (status === 3) { ... }
|
|
74
74
|
|
|
75
|
-
//
|
|
75
|
+
// YES Named constants
|
|
76
76
|
if (status === Status.ACTIVE) { ... }
|
|
77
77
|
|
|
78
|
-
//
|
|
78
|
+
// NO Deep nesting
|
|
79
79
|
if (a) { if (b) { if (c) { ... } } }
|
|
80
80
|
|
|
81
|
-
//
|
|
81
|
+
// YES Early returns
|
|
82
82
|
if (!a) return;
|
|
83
83
|
if (!b) return;
|
|
84
84
|
if (!c) return;
|
|
85
85
|
// do work
|
|
86
86
|
|
|
87
|
-
//
|
|
88
|
-
//
|
|
87
|
+
// NO Long functions (100+ lines)
|
|
88
|
+
// YES Small, focused functions
|
|
89
89
|
|
|
90
|
-
//
|
|
90
|
+
// NO any type
|
|
91
91
|
const data: any = ...
|
|
92
92
|
|
|
93
|
-
//
|
|
93
|
+
// YES Proper types
|
|
94
94
|
const data: UserData = ...
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
## Review Comments Guide
|
|
98
98
|
|
|
99
99
|
```
|
|
100
|
-
// Blocking issues use
|
|
101
|
-
|
|
100
|
+
// Blocking issues use CRITICAL
|
|
101
|
+
CRITICAL BLOCKING: SQL injection vulnerability here
|
|
102
102
|
|
|
103
103
|
// Important suggestions use π‘
|
|
104
104
|
π‘ SUGGESTION: Consider using useMemo for performance
|
|
@@ -106,8 +106,8 @@ const data: UserData = ...
|
|
|
106
106
|
// Minor nits use π’
|
|
107
107
|
π’ NIT: Prefer const over let for immutable variable
|
|
108
108
|
|
|
109
|
-
// Questions use
|
|
110
|
-
|
|
109
|
+
// Questions use [QUESTION]
|
|
110
|
+
[QUESTION] QUESTION: What happens if user is null here?
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
---
|
|
@@ -120,7 +120,7 @@ This skill is used by **bob-rev (reviewer)** agent during the VERIFY phase.
|
|
|
120
120
|
|
|
121
121
|
Add review section to MANUAL:
|
|
122
122
|
```markdown
|
|
123
|
-
##
|
|
123
|
+
## [SEARCH] Review Notes
|
|
124
124
|
|
|
125
125
|
### Review Checklist
|
|
126
126
|
#### Correctness
|
|
@@ -153,27 +153,27 @@ Add review section to MANUAL:
|
|
|
153
153
|
### Review Comments
|
|
154
154
|
| Severity | Comment | File:Line | Status |
|
|
155
155
|
|----------|----------|-----------|--------|
|
|
156
|
-
|
|
|
156
|
+
| CRITICAL BLOCKING | [Description] | [File:Line] | [Open/Resolved] |
|
|
157
157
|
| π‘ SUGGESTION | [Description] | [File:Line] | [Open/Resolved] |
|
|
158
158
|
| π’ NIT | [Description] | [File:Line] | [Open/Resolved] |
|
|
159
|
-
|
|
|
159
|
+
| [QUESTION] QUESTION | [Description] | [File:Line] | [Answered] |
|
|
160
160
|
|
|
161
161
|
### Review Decision
|
|
162
|
-
- [ ]
|
|
163
|
-
- [ ]
|
|
162
|
+
- [ ] YES PASS - Ready for SEND
|
|
163
|
+
- [ ] NO FAIL - Return to trace for fixes
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
### PASS/FAIL Criteria
|
|
167
167
|
|
|
168
168
|
#### PASS Conditions
|
|
169
|
-
- All
|
|
169
|
+
- All CRITICAL BLOCKING issues resolved
|
|
170
170
|
- Security vulnerabilities addressed
|
|
171
171
|
- Tests pass and have good coverage
|
|
172
172
|
- Code follows project conventions
|
|
173
173
|
- No obvious bugs
|
|
174
174
|
|
|
175
175
|
#### FAIL Conditions
|
|
176
|
-
- Any unresolved
|
|
176
|
+
- Any unresolved CRITICAL BLOCKING issues
|
|
177
177
|
- Security vulnerabilities present
|
|
178
178
|
- Tests failing or missing
|
|
179
179
|
- Code doesn't match MANUAL specifications
|
|
@@ -184,7 +184,7 @@ Add review section to MANUAL:
|
|
|
184
184
|
```markdown
|
|
185
185
|
## π€ Agent Handoffs
|
|
186
186
|
|
|
187
|
-
π€ bob-rev: Review complete -
|
|
187
|
+
π€ bob-rev: Review complete - YES PASS / NO FAIL
|
|
188
188
|
[Decision rationale]
|
|
189
189
|
|
|
190
190
|
π€ bob-rev β trace: [FAIL - Issues found, please fix]
|
|
@@ -212,7 +212,7 @@ When quality issues are discussed:
|
|
|
212
212
|
|
|
213
213
|
### Quality Indicators
|
|
214
214
|
|
|
215
|
-
| Good
|
|
215
|
+
| Good YES | Poor NO |
|
|
216
216
|
|---------|---------|
|
|
217
217
|
| Self-documenting code | Requires comments to explain |
|
|
218
218
|
| Small, focused functions | God functions (100+ lines) |
|
|
@@ -38,7 +38,7 @@ context7: Documentation lookup for frameworks
|
|
|
38
38
|
|
|
39
39
|
## Layer-Specific Exploration
|
|
40
40
|
|
|
41
|
-
###
|
|
41
|
+
### [DB] Database Layer
|
|
42
42
|
|
|
43
43
|
**Find schemas and migrations**:
|
|
44
44
|
```bash
|
|
@@ -58,7 +58,7 @@ grep("@ManyToOne|@OneToMany|@ManyToMany|references|foreignKey", "src/")
|
|
|
58
58
|
LspReferences on entity classes
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
###
|
|
61
|
+
### [TOOL] Backend Layer
|
|
62
62
|
|
|
63
63
|
**Find services and controllers**:
|
|
64
64
|
```bash
|
|
@@ -84,7 +84,7 @@ LspDefinition on service imports
|
|
|
84
84
|
LspReferences on service methods
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
###
|
|
87
|
+
### [LINK] Integration Layer
|
|
88
88
|
|
|
89
89
|
**Find external API clients**:
|
|
90
90
|
```bash
|
|
@@ -104,7 +104,7 @@ glob("**/Dockerfile", "**/docker-compose*", "**/*.yml")
|
|
|
104
104
|
glob("**/.github/workflows/**", "**/ci/**")
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
###
|
|
107
|
+
### [UI] Frontend Layer
|
|
108
108
|
|
|
109
109
|
**Find components**:
|
|
110
110
|
```bash
|
|
@@ -131,7 +131,7 @@ LspReferences on component names
|
|
|
131
131
|
grep("import.*from.*components", "src/")
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
###
|
|
134
|
+
### [TARGET] UI/UX Layer
|
|
135
135
|
|
|
136
136
|
**Find styles**:
|
|
137
137
|
```bash
|
|
@@ -38,11 +38,11 @@ This skill provides a framework for breaking down work into clear, actionable ta
|
|
|
38
38
|
|
|
39
39
|
## Planning Principles (NOT Templates!)
|
|
40
40
|
|
|
41
|
-
>
|
|
41
|
+
> CRITICAL **NO fixed templates. Each plan is UNIQUE to the task.**
|
|
42
42
|
|
|
43
43
|
### Principle 1: Keep It SHORT
|
|
44
44
|
|
|
45
|
-
|
|
|
45
|
+
| NO Wrong | YES Right |
|
|
46
46
|
|----------|----------|
|
|
47
47
|
| 50 tasks with sub-sub-tasks | 5-10 clear tasks max |
|
|
48
48
|
| Every micro-step listed | Only actionable items |
|
|
@@ -54,7 +54,7 @@ This skill provides a framework for breaking down work into clear, actionable ta
|
|
|
54
54
|
|
|
55
55
|
### Principle 2: Be SPECIFIC, Not Generic
|
|
56
56
|
|
|
57
|
-
|
|
|
57
|
+
| NO Wrong | YES Right |
|
|
58
58
|
|----------|----------|
|
|
59
59
|
| "Set up project" | "Run `npx create-next-app`" |
|
|
60
60
|
| "Add authentication" | "Install next-auth, create `/api/auth/[...nextauth].ts`" |
|
|
@@ -85,7 +85,7 @@ This skill provides a framework for breaking down work into clear, actionable ta
|
|
|
85
85
|
|
|
86
86
|
### Principle 4: Scripts Are Project-Specific
|
|
87
87
|
|
|
88
|
-
>
|
|
88
|
+
> CRITICAL **DO NOT copy-paste script commands. Choose based on project type.**
|
|
89
89
|
|
|
90
90
|
| Project Type | Relevant Scripts |
|
|
91
91
|
|--------------|------------------|
|
|
@@ -102,7 +102,7 @@ This skill provides a framework for breaking down work into clear, actionable ta
|
|
|
102
102
|
|
|
103
103
|
### Principle 5: Verification is Simple
|
|
104
104
|
|
|
105
|
-
|
|
|
105
|
+
| NO Wrong | YES Right |
|
|
106
106
|
|----------|----------|
|
|
107
107
|
| "Verify the component works correctly" | "Run `npm run dev`, click button, see toast" |
|
|
108
108
|
| "Test the API" | "curl localhost:3000/api/users returns 200" |
|
|
@@ -163,7 +163,7 @@ This skill is used by **alice (architect)** agent during the PLAN phase.
|
|
|
163
163
|
|
|
164
164
|
Add implementation plan to MANUAL:
|
|
165
165
|
```markdown
|
|
166
|
-
##
|
|
166
|
+
## [LAUNCH] Implementation Plan
|
|
167
167
|
|
|
168
168
|
### Layered Tasks
|
|
169
169
|
|
|
@@ -10,7 +10,7 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
> Think like an attacker, defend like an expert. 2025 threat landscape awareness.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## [TOOL] Runtime Scripts
|
|
14
14
|
|
|
15
15
|
**Execute for automated validation:**
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ metadata:
|
|
|
18
18
|
|--------|---------|-------|
|
|
19
19
|
| `scripts/security_scan.py` | Validate security principles applied | `python scripts/security_scan.py <project_path>` |
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## [LIST] Reference Files
|
|
22
22
|
|
|
23
23
|
| File | Purpose |
|
|
24
24
|
|------|---------|
|
|
@@ -56,14 +56,14 @@ Before scanning, ask:
|
|
|
56
56
|
|------|----------|-------------|
|
|
57
57
|
| **A01** | Broken Access Control | Who can access what? IDOR, SSRF |
|
|
58
58
|
| **A02** | Security Misconfiguration | Defaults, headers, exposed services |
|
|
59
|
-
| **A03** | Software Supply Chain
|
|
59
|
+
| **A03** | Software Supply Chain [NEW] | Dependencies, CI/CD, build integrity |
|
|
60
60
|
| **A04** | Cryptographic Failures | Weak crypto, exposed secrets |
|
|
61
61
|
| **A05** | Injection | User input β system commands |
|
|
62
62
|
| **A06** | Insecure Design | Flawed architecture |
|
|
63
63
|
| **A07** | Authentication Failures | Session, credential management |
|
|
64
64
|
| **A08** | Integrity Failures | Unsigned updates, tampered data |
|
|
65
65
|
| **A09** | Logging & Alerting | Blind spots, no monitoring |
|
|
66
|
-
| **A10** | Exceptional Conditions
|
|
66
|
+
| **A10** | Exceptional Conditions [NEW] | Error handling, fail-open states |
|
|
67
67
|
|
|
68
68
|
### 2025 Key Changes
|
|
69
69
|
|
|
@@ -226,10 +226,10 @@ Is it actively exploited (EPSS >0.5)?
|
|
|
226
226
|
|
|
227
227
|
| Layer | You Own | Provider Owns |
|
|
228
228
|
|-------|---------|---------------|
|
|
229
|
-
| Data |
|
|
230
|
-
| Application |
|
|
229
|
+
| Data | YES | NO |
|
|
230
|
+
| Application | YES | NO |
|
|
231
231
|
| OS/Runtime | Depends | Depends |
|
|
232
|
-
| Infrastructure |
|
|
232
|
+
| Infrastructure | NO | YES |
|
|
233
233
|
|
|
234
234
|
### Cloud-Specific Checks
|
|
235
235
|
|
|
@@ -242,7 +242,7 @@ Is it actively exploited (EPSS >0.5)?
|
|
|
242
242
|
|
|
243
243
|
## 10. Anti-Patterns
|
|
244
244
|
|
|
245
|
-
|
|
|
245
|
+
| NO Don't | YES Do |
|
|
246
246
|
|----------|-------|
|
|
247
247
|
| Scan without understanding | Map attack surface first |
|
|
248
248
|
| Alert on every CVE | Prioritize by exploitability + asset |
|
|
@@ -287,7 +287,7 @@ This skill is used by **bob-rev (reviewer)** agent during VERIFY phase and **tra
|
|
|
287
287
|
|
|
288
288
|
Add security section to MANUAL:
|
|
289
289
|
```markdown
|
|
290
|
-
##
|
|
290
|
+
## [SEARCH] Review Notes
|
|
291
291
|
|
|
292
292
|
### Security Checklist
|
|
293
293
|
|
|
@@ -325,7 +325,7 @@ Add security section to MANUAL:
|
|
|
325
325
|
|
|
326
326
|
| Severity | Finding | Location | Status |
|
|
327
327
|
|----------|-----------|-----------|--------|
|
|
328
|
-
|
|
|
328
|
+
| CRITICAL CRITICAL | [Description] | [File:Line] | [Open/Resolved] |
|
|
329
329
|
| π HIGH | [Description] | [File:Line] | [Open/Resolved] |
|
|
330
330
|
| π‘ MEDIUM | [Description] | [File:Line] | [Open/Resolved] |
|
|
331
331
|
| π’ LOW | [Description] | [File:Line] | [Open/Resolved] |
|
|
@@ -339,14 +339,14 @@ Add security section to MANUAL:
|
|
|
339
339
|
### Review Decision (Security-Focused)
|
|
340
340
|
|
|
341
341
|
#### PASS Conditions
|
|
342
|
-
- No
|
|
342
|
+
- No CRITICAL CRITICAL issues
|
|
343
343
|
- No π HIGH issues
|
|
344
344
|
- Supply chain secure (dependencies audited)
|
|
345
345
|
- No hardcoded secrets in code
|
|
346
346
|
- Authentication and authorization properly implemented
|
|
347
347
|
|
|
348
348
|
#### FAIL Conditions
|
|
349
|
-
- Any
|
|
349
|
+
- Any CRITICAL CRITICAL vulnerabilities
|
|
350
350
|
- Unresolved π HIGH vulnerabilities
|
|
351
351
|
- Hardcoded secrets/API keys found
|
|
352
352
|
- Supply chain vulnerabilities present
|
|
@@ -367,7 +367,7 @@ Add security section to MANUAL:
|
|
|
367
367
|
|
|
368
368
|
When trace (debugger) investigates security issues:
|
|
369
369
|
```markdown
|
|
370
|
-
##
|
|
370
|
+
## [SEARCH] Debug Logs
|
|
371
371
|
|
|
372
372
|
### Security Issue Analysis
|
|
373
373
|
|
|
@@ -202,13 +202,13 @@ Document all changes made:
|
|
|
202
202
|
### Changes Reverted
|
|
203
203
|
1. **[file:line]** - Attempted to flatten query builder conditionals
|
|
204
204
|
- Reason: Test 'db.handles-concurrent' failed
|
|
205
|
-
- Reverted:
|
|
205
|
+
- Reverted: YES
|
|
206
206
|
|
|
207
207
|
### Summary
|
|
208
208
|
- Simplifications made: 2
|
|
209
209
|
- Simplifications reverted: 1
|
|
210
210
|
- Passes completed: 2
|
|
211
|
-
- Tests still pass:
|
|
211
|
+
- Tests still pass: YES
|
|
212
212
|
- Net lines: -21
|
|
213
213
|
```
|
|
214
214
|
|
|
@@ -104,11 +104,11 @@ pm2 logs app-name --err --lines 100
|
|
|
104
104
|
|
|
105
105
|
## Anti-Patterns
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
NO **Random changes** - "Maybe if I change this..."
|
|
108
|
+
NO **Ignoring evidence** - "That can't be the cause"
|
|
109
|
+
NO **Assuming** - "It must be X" without proof
|
|
110
|
+
NO **Not reproducing first** - Fixing blindly
|
|
111
|
+
NO **Stopping at symptoms** - Not finding root cause
|
|
112
112
|
|
|
113
113
|
---
|
|
114
114
|
|
|
@@ -120,7 +120,7 @@ This skill is used by **trace (debugger)** agent during the FIX phase.
|
|
|
120
120
|
|
|
121
121
|
Add debugging section to MANUAL:
|
|
122
122
|
```markdown
|
|
123
|
-
##
|
|
123
|
+
## [SEARCH] Debug Logs
|
|
124
124
|
|
|
125
125
|
### Issue Summary
|
|
126
126
|
- **Bug ID:** [BUG-001]
|
|
@@ -9,6 +9,39 @@ import { ConcurrencyManager } from "./concurrency";
|
|
|
9
9
|
|
|
10
10
|
const TASK_TTL_MS = 30 * 60 * 1000; // 30 minutes
|
|
11
11
|
const MIN_STABILITY_TIME_MS = 10 * 1000; // 10 seconds before stability detection
|
|
12
|
+
const MAX_SYSTEM_CONTENT_LENGTH = 50000; // Maximum characters for system prompt
|
|
13
|
+
const MAX_PROMPT_LENGTH = 10000; // Maximum characters for user prompt
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sanitize content for safe JSON transmission to kimi model
|
|
17
|
+
* Handles Unicode issues, control characters, and length limits
|
|
18
|
+
*/
|
|
19
|
+
function sanitizeForModel(content: string, maxLength: number = MAX_SYSTEM_CONTENT_LENGTH): string {
|
|
20
|
+
if (!content) return "";
|
|
21
|
+
|
|
22
|
+
// Step 1: Remove control characters (keep only \n, \r, \t)
|
|
23
|
+
let sanitized = content
|
|
24
|
+
.replace(/[\x00-\x08\x0B-\x0C\x0E-\x1F]/g, '')
|
|
25
|
+
// Step 2: Replace Unicode line/paragraph separators
|
|
26
|
+
.replace(/\u2028/g, '\n')
|
|
27
|
+
.replace(/\u2029/g, '\n')
|
|
28
|
+
// Step 3: Replace other problematic Unicode
|
|
29
|
+
.replace(/\uFEFF/g, '') // BOM
|
|
30
|
+
.replace(/\u200B-\u200D/g, '') // Zero-width spaces
|
|
31
|
+
// Step 4: Escape backslashes to prevent JSON issues
|
|
32
|
+
.replace(/\\/g, '\\\\')
|
|
33
|
+
// Step 5: Normalize line endings
|
|
34
|
+
.replace(/\r\n/g, '\n')
|
|
35
|
+
.replace(/\r/g, '\n');
|
|
36
|
+
|
|
37
|
+
// Step 6: Truncate if too long (with indicator)
|
|
38
|
+
if (sanitized.length > maxLength) {
|
|
39
|
+
const truncationMsg = "\n\n[Content truncated due to length limits]";
|
|
40
|
+
sanitized = sanitized.substring(0, maxLength - truncationMsg.length) + truncationMsg;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return sanitized;
|
|
44
|
+
}
|
|
12
45
|
|
|
13
46
|
type OpencodeClient = PluginInput["client"];
|
|
14
47
|
|
|
@@ -118,11 +151,8 @@ export class BackgroundManager {
|
|
|
118
151
|
const skillPath = join(this.directory, ".opencode", "skill", "bobs-workshop", skillName, "SKILL.md");
|
|
119
152
|
if (existsSync(skillPath)) {
|
|
120
153
|
let skillFile = readFileSync(skillPath, "utf8");
|
|
121
|
-
// Sanitize content
|
|
122
|
-
skillFile = skillFile
|
|
123
|
-
.replace(/[\x00-\x08\x0B-\x0C\x0E-\x1F]/g, '') // Remove control chars except \n, \r, \t
|
|
124
|
-
.replace(/\u2028/g, '\n') // Replace line separator with newline
|
|
125
|
-
.replace(/\u2029/g, '\n'); // Replace paragraph separator with newline
|
|
154
|
+
// Sanitize content for kimi model compatibility
|
|
155
|
+
skillFile = sanitizeForModel(skillFile, 10000); // Limit per skill
|
|
126
156
|
skillContent += `\n\n---\n## Skill: ${skillName}\n\n${skillFile}`;
|
|
127
157
|
}
|
|
128
158
|
}
|
|
@@ -133,18 +163,20 @@ export class BackgroundManager {
|
|
|
133
163
|
const { existsSync, readFileSync } = await import("node:fs");
|
|
134
164
|
if (existsSync(input.manual_path)) {
|
|
135
165
|
let manualContent = readFileSync(input.manual_path, "utf8");
|
|
136
|
-
// Sanitize content
|
|
137
|
-
|
|
138
|
-
manualContent = manualContent
|
|
139
|
-
.replace(/[\x00-\x08\x0B-\x0C\x0E-\x1F]/g, '') // Remove control chars except \n, \r, \t
|
|
140
|
-
.replace(/\u2028/g, '\n') // Replace line separator with newline
|
|
141
|
-
.replace(/\u2029/g, '\n'); // Replace paragraph separator with newline
|
|
166
|
+
// Sanitize content for kimi model compatibility
|
|
167
|
+
manualContent = sanitizeForModel(manualContent, 30000); // Larger limit for manual
|
|
142
168
|
skillContent = skillContent
|
|
143
169
|
? `${skillContent}\n\n## MANUAL Context:\n${manualContent}`
|
|
144
170
|
: manualContent;
|
|
145
171
|
}
|
|
146
172
|
}
|
|
173
|
+
|
|
174
|
+
// Final sanitization of combined skill content
|
|
175
|
+
skillContent = sanitizeForModel(skillContent, MAX_SYSTEM_CONTENT_LENGTH);
|
|
147
176
|
|
|
177
|
+
// Sanitize user prompt to prevent JSON issues
|
|
178
|
+
const sanitizedPrompt = sanitizeForModel(input.prompt, MAX_PROMPT_LENGTH);
|
|
179
|
+
|
|
148
180
|
// Fire-and-forget prompt
|
|
149
181
|
this.client.session.prompt({
|
|
150
182
|
path: { id: sessionID },
|
|
@@ -156,7 +188,7 @@ export class BackgroundManager {
|
|
|
156
188
|
task: false,
|
|
157
189
|
delegate_task: false,
|
|
158
190
|
},
|
|
159
|
-
parts: [{ type: "text", text:
|
|
191
|
+
parts: [{ type: "text", text: sanitizedPrompt }],
|
|
160
192
|
},
|
|
161
193
|
} as any).catch((error) => {
|
|
162
194
|
console.error("[background-agent] Prompt error:", error);
|