forge-orkes 0.3.8 → 0.3.10
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/package.json +1 -1
- package/template/.claude/agents/executor.md +37 -50
- package/template/.claude/agents/planner.md +33 -41
- package/template/.claude/agents/researcher.md +24 -26
- package/template/.claude/agents/reviewer.md +45 -53
- package/template/.claude/agents/verifier.md +30 -50
- package/template/.claude/skills/architecting/SKILL.md +32 -46
- package/template/.claude/skills/beads-integration/SKILL.md +27 -43
- package/template/.claude/skills/debugging/SKILL.md +34 -35
- package/template/.claude/skills/designing/SKILL.md +33 -52
- package/template/.claude/skills/discussing/SKILL.md +139 -180
- package/template/.claude/skills/executing/SKILL.md +85 -157
- package/template/.claude/skills/forge/SKILL.md +101 -148
- package/template/.claude/skills/initializing/SKILL.md +104 -144
- package/template/.claude/skills/planning/SKILL.md +65 -67
- package/template/.claude/skills/quick-tasking/SKILL.md +25 -31
- package/template/.claude/skills/researching/SKILL.md +22 -32
- package/template/.claude/skills/reviewing/SKILL.md +406 -0
- package/template/.claude/skills/securing/SKILL.md +19 -19
- package/template/.claude/skills/upgrading/SKILL.md +19 -27
- package/template/.claude/skills/verifying/SKILL.md +53 -81
- package/template/CLAUDE.md +7 -10
- package/template/.claude/skills/auditing/SKILL.md +0 -314
- package/template/.claude/skills/refactoring/SKILL.md +0 -168
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reviewing
|
|
3
|
+
description: "Post-verification health gate. Runs security audit (10 categories), architecture audit (4 dimensions), and refactoring scan (6 categories) in parallel. Determines if the milestone can ship and catalogs improvement opportunities."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Reviewing: Health Audit + Refactoring Review
|
|
7
|
+
|
|
8
|
+
The pre-completion gate. After `verifying` confirms deliverables, assess codebase health and catalog improvements. Three parallel scans produce a structured report that gates milestone completion.
|
|
9
|
+
|
|
10
|
+
## Triggers
|
|
11
|
+
|
|
12
|
+
- **Auto:** after `verifying` returns PASSED (Standard/Full tiers)
|
|
13
|
+
- **Manual:** on user request
|
|
14
|
+
|
|
15
|
+
## Process
|
|
16
|
+
|
|
17
|
+
1. Read project context from `.forge/project.yml`
|
|
18
|
+
2. Scope the review — glob source files, determine milestone diff
|
|
19
|
+
3. Spawn three parallel subagents: Security + Architecture + Refactoring
|
|
20
|
+
4. Collect results, score per-category, determine overall status
|
|
21
|
+
5. Write health report to `.forge/audits/milestone-{id}-health-report.md`
|
|
22
|
+
6. Write accepted refactoring items to `.forge/refactor-backlog.yml`
|
|
23
|
+
7. Route: healthy → complete, critical → user decides
|
|
24
|
+
|
|
25
|
+
## Step 1: Read Context
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Read: .forge/project.yml → tech stack, framework, database, dependencies
|
|
29
|
+
Read: .forge/state/milestone-{id}.yml → milestone ID and name
|
|
30
|
+
Read: .forge/constitution.md → active architectural gates (if exists)
|
|
31
|
+
Read: .forge/refactor-backlog.yml → existing backlog items (if any)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Skip inapplicable security categories based on tech stack:
|
|
35
|
+
- No database → SQL/NoSQL Injection N/A
|
|
36
|
+
- No frontend → XSS Prevention N/A
|
|
37
|
+
- No CI/CD config → Pipeline Security N/A
|
|
38
|
+
|
|
39
|
+
Determine the milestone's git diff starting point:
|
|
40
|
+
- Check git log for the milestone start commit
|
|
41
|
+
- Fallback: first commit after previous milestone's completion date
|
|
42
|
+
- Last resort: ask the user
|
|
43
|
+
|
|
44
|
+
## Step 2: Scope the Review
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Glob: src/**/*.{ts,tsx,js,jsx,py,go,rs,java} (adapt to project language)
|
|
48
|
+
Glob: **/*.env*, **/docker-compose*, **/.github/workflows/*
|
|
49
|
+
Glob: **/next.config*, **/vite.config*, **/webpack.config*
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Get diff file list for refactoring scan:
|
|
53
|
+
```
|
|
54
|
+
git diff --name-only {milestone_start}..HEAD
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Present scope summary:
|
|
58
|
+
*"Review scope: {N} source files, {N} config files, {N} changed files. Scanning security (10), architecture (4), refactoring (6)."*
|
|
59
|
+
|
|
60
|
+
Build explicit file lists for each subagent — pass paths, not globs.
|
|
61
|
+
|
|
62
|
+
## Step 3: Spawn Parallel Scans
|
|
63
|
+
|
|
64
|
+
Spawn all three as fresh-context subagents. Each receives: explicit file list, tech stack from `project.yml`, instructions below.
|
|
65
|
+
|
|
66
|
+
### Part 1: Security Audit (subagent)
|
|
67
|
+
|
|
68
|
+
**10 Security Categories:**
|
|
69
|
+
|
|
70
|
+
| # | Category | Checks |
|
|
71
|
+
|---|----------|--------|
|
|
72
|
+
| 1 | Authentication & Authorization | Every endpoint has auth middleware; role checks before data access |
|
|
73
|
+
| 2 | Data Scoping / Tenant Isolation | Queries scoped to correct user/tenant; no cross-tenant leaks |
|
|
74
|
+
| 3 | Input Validation | Request bodies/params validated before use |
|
|
75
|
+
| 4 | Error Information Leakage | No stack traces, DB schemas, or internals in API responses |
|
|
76
|
+
| 5 | XSS Prevention | No unsanitized user content injected into DOM |
|
|
77
|
+
| 6 | SQL/NoSQL Injection | All queries parameterized, no string interpolation |
|
|
78
|
+
| 7 | Secrets Management | No hardcoded keys/tokens; `.env` in `.gitignore`; `process.env` usage |
|
|
79
|
+
| 8 | CORS Policy | No wildcard `*` origins in production; appropriate method restrictions |
|
|
80
|
+
| 9 | HTTP Security Headers | CSP, X-Frame-Options, HSTS, X-Content-Type-Options, Referrer-Policy |
|
|
81
|
+
| 10 | CI/CD Pipeline Security | Secrets via secrets context, not hardcoded in workflows |
|
|
82
|
+
|
|
83
|
+
**Rules:**
|
|
84
|
+
- Read every file. No sampling.
|
|
85
|
+
- Every finding needs: file path, line number, issue, severity, remediation.
|
|
86
|
+
- Check surrounding code for middleware/wrappers before flagging.
|
|
87
|
+
- Document intentionally public endpoints — don't flag them.
|
|
88
|
+
- Severity: `critical` = exploitable vulnerability, `warning` = defense-in-depth gap, `info` = observation.
|
|
89
|
+
- Prefer false negatives over false positives.
|
|
90
|
+
- Inapplicable categories → N/A with brief reason.
|
|
91
|
+
|
|
92
|
+
**Adapt checks to detected stack:** Express/Next.js/Fastify endpoints, PostgreSQL/MongoDB/SQLite queries, GitHub Actions/GitLab CI, React/Vue/Svelte frontends.
|
|
93
|
+
|
|
94
|
+
**Output format:**
|
|
95
|
+
|
|
96
|
+
```yaml
|
|
97
|
+
security_audit:
|
|
98
|
+
files_scanned: N
|
|
99
|
+
categories:
|
|
100
|
+
- id: 1
|
|
101
|
+
name: "Authentication & Authorization"
|
|
102
|
+
status: passed | warning | critical | na
|
|
103
|
+
findings:
|
|
104
|
+
- file: "src/api/users.ts"
|
|
105
|
+
line: 42
|
|
106
|
+
severity: critical | warning | info
|
|
107
|
+
issue: "Description of what's wrong"
|
|
108
|
+
remediation: "How to fix it"
|
|
109
|
+
notes: "Optional context about intentional decisions"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Part 2: Architecture Audit (subagent)
|
|
113
|
+
|
|
114
|
+
**4 Dimensions:**
|
|
115
|
+
|
|
116
|
+
| Dimension | Checks |
|
|
117
|
+
|-----------|--------|
|
|
118
|
+
| **Scalability** | Synchronous blocking, missing pagination, unbounded queries, N+1 patterns, missing caching, single points of failure, hardcoded limits |
|
|
119
|
+
| **Maintainability** | Files >300 lines, nesting >4 levels, god components/classes, circular deps, duplicated logic warranting abstraction |
|
|
120
|
+
| **Code Health** | Dead code/unused exports, TODO/FIXME inventory with age, untested critical paths, stale/vulnerable deps |
|
|
121
|
+
| **Structural Quality** | Business logic in UI layer, inconsistent patterns across features, missing error boundaries, API contract inconsistency |
|
|
122
|
+
|
|
123
|
+
**Rules:**
|
|
124
|
+
- Check actual code, not theoretical concerns.
|
|
125
|
+
- Every finding references specific files with evidence.
|
|
126
|
+
- Severity: `critical` = debt causing production issues or blocking future work, `warning` = quality concern, `info` = improvement opportunity.
|
|
127
|
+
- Respect existing ADRs in `.forge/decisions/` and constitutional articles — don't flag intentional choices.
|
|
128
|
+
|
|
129
|
+
**Output format:**
|
|
130
|
+
|
|
131
|
+
```yaml
|
|
132
|
+
architecture_audit:
|
|
133
|
+
files_scanned: N
|
|
134
|
+
dimensions:
|
|
135
|
+
- name: "Scalability"
|
|
136
|
+
status: passed | warning | critical
|
|
137
|
+
findings:
|
|
138
|
+
- file: "src/api/products.ts"
|
|
139
|
+
line: 87
|
|
140
|
+
severity: critical | warning | info
|
|
141
|
+
issue: "Unbounded query with no pagination"
|
|
142
|
+
remediation: "Add limit/offset parameters"
|
|
143
|
+
- name: "Maintainability"
|
|
144
|
+
status: passed | warning | critical
|
|
145
|
+
findings: []
|
|
146
|
+
- name: "Code Health"
|
|
147
|
+
status: passed | warning | critical
|
|
148
|
+
findings: []
|
|
149
|
+
- name: "Structural Quality"
|
|
150
|
+
status: passed | warning | critical
|
|
151
|
+
findings: []
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Part 3: Refactoring Scan (subagent)
|
|
155
|
+
|
|
156
|
+
Pass only files changed during the milestone (from git diff).
|
|
157
|
+
|
|
158
|
+
**6 Categories:**
|
|
159
|
+
|
|
160
|
+
| # | Category | Look For |
|
|
161
|
+
|---|----------|----------|
|
|
162
|
+
| 1 | **Duplication** | Similar logic in 2+ places extractable into shared function/hook/utility |
|
|
163
|
+
| 2 | **Complexity hotspots** | Functions >50 lines, nesting >3 levels, high cyclomatic complexity, overly long files |
|
|
164
|
+
| 3 | **Naming & clarity** | Unclear names, misleading abstractions, functions exceeding their name's scope |
|
|
165
|
+
| 4 | **Pattern inconsistency** | Same concern handled differently across milestone files (error handling, data fetching, state) |
|
|
166
|
+
| 5 | **Dead code** | Unused functions, unreachable branches, commented-out code, unused imports |
|
|
167
|
+
| 6 | **Abstraction issues** | Over-engineered one-use helpers, repeated inline code warranting extraction, premature/missing abstractions |
|
|
168
|
+
|
|
169
|
+
**Rules:**
|
|
170
|
+
- Read every file in the diff. No sampling.
|
|
171
|
+
- Every finding references a specific file and line range.
|
|
172
|
+
- Don't flag patterns documented in the constitution.
|
|
173
|
+
- Don't duplicate security or architecture findings.
|
|
174
|
+
- Estimate effort: `quick` (< 30 min, < 50 lines) or `standard` (needs planning).
|
|
175
|
+
- Suggest a concrete approach, not "refactor this."
|
|
176
|
+
- Fewer high-quality findings over many low-signal ones.
|
|
177
|
+
|
|
178
|
+
**Output format:**
|
|
179
|
+
|
|
180
|
+
```yaml
|
|
181
|
+
refactoring_scan:
|
|
182
|
+
files_scanned: N
|
|
183
|
+
findings:
|
|
184
|
+
- category: duplication
|
|
185
|
+
file: "src/api/users.ts"
|
|
186
|
+
lines: "42-67"
|
|
187
|
+
description: "Duplicate validation logic — same email check in createUser and updateUser"
|
|
188
|
+
effort: quick
|
|
189
|
+
suggested_approach: "Extract shared validateEmail() helper to src/utils/validation.ts"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Step 4: Score Results
|
|
193
|
+
|
|
194
|
+
**Per-category scoring (security + architecture):**
|
|
195
|
+
|
|
196
|
+
| Status | Meaning |
|
|
197
|
+
|--------|---------|
|
|
198
|
+
| `passed` | No issues |
|
|
199
|
+
| `warning` | Non-critical issues |
|
|
200
|
+
| `critical` | Exploitable vulnerabilities or architectural blockers |
|
|
201
|
+
| `na` | Category doesn't apply |
|
|
202
|
+
|
|
203
|
+
**Overall health:**
|
|
204
|
+
|
|
205
|
+
| Overall | Condition |
|
|
206
|
+
|---------|-----------|
|
|
207
|
+
| `passed` | All categories passed or N/A |
|
|
208
|
+
| `warnings_only` | One+ warnings, zero critical |
|
|
209
|
+
| `issues_found` | One+ critical findings |
|
|
210
|
+
|
|
211
|
+
Refactoring findings are separate — they never block completion.
|
|
212
|
+
|
|
213
|
+
## Step 5: Write Health Report
|
|
214
|
+
|
|
215
|
+
Create `.forge/audits/` if needed. Write to `.forge/audits/milestone-{id}-health-report.md`.
|
|
216
|
+
|
|
217
|
+
**YAML frontmatter:**
|
|
218
|
+
|
|
219
|
+
```yaml
|
|
220
|
+
---
|
|
221
|
+
milestone_id: {id}
|
|
222
|
+
milestone_name: "{name}"
|
|
223
|
+
reviewed: "{ISO 8601 timestamp}"
|
|
224
|
+
status: passed | warnings_only | issues_found
|
|
225
|
+
security:
|
|
226
|
+
status: passed | warnings_only | issues_found
|
|
227
|
+
categories_passed: N
|
|
228
|
+
categories_warning: N
|
|
229
|
+
categories_critical: N
|
|
230
|
+
categories_na: N
|
|
231
|
+
architecture:
|
|
232
|
+
status: passed | warnings_only | issues_found
|
|
233
|
+
scalability: passed | warning | critical
|
|
234
|
+
maintainability: passed | warning | critical
|
|
235
|
+
code_health: passed | warning | critical
|
|
236
|
+
structural_quality: passed | warning | critical
|
|
237
|
+
refactoring:
|
|
238
|
+
findings_count: N
|
|
239
|
+
quick_count: N
|
|
240
|
+
standard_count: N
|
|
241
|
+
total_files_scanned: N
|
|
242
|
+
---
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Body structure:**
|
|
246
|
+
|
|
247
|
+
```markdown
|
|
248
|
+
# Review Report: {milestone name}
|
|
249
|
+
|
|
250
|
+
## Executive Summary
|
|
251
|
+
{1-3 sentences: health assessment, key findings, refactoring highlights, recommendation}
|
|
252
|
+
|
|
253
|
+
## Security Findings
|
|
254
|
+
|
|
255
|
+
### Category 1: Authentication & Authorization — {STATUS}
|
|
256
|
+
| File | Line | Severity | Issue | Remediation |
|
|
257
|
+
|------|------|----------|-------|-------------|
|
|
258
|
+
| ... | ... | ... | ... | ... |
|
|
259
|
+
|
|
260
|
+
{Repeat per category. N/A categories: single line "N/A — {reason}"}
|
|
261
|
+
|
|
262
|
+
## Architecture Findings
|
|
263
|
+
|
|
264
|
+
### Scalability — {STATUS}
|
|
265
|
+
| File | Line | Severity | Issue | Remediation |
|
|
266
|
+
|------|------|----------|-------|-------------|
|
|
267
|
+
| ... | ... | ... | ... | ... |
|
|
268
|
+
|
|
269
|
+
{Repeat per dimension}
|
|
270
|
+
|
|
271
|
+
## Refactoring Opportunities
|
|
272
|
+
|
|
273
|
+
### Duplication ({N} items)
|
|
274
|
+
| File | Lines | Description | Effort | Approach |
|
|
275
|
+
|------|-------|-------------|--------|----------|
|
|
276
|
+
| ... | ... | ... | quick/standard | ... |
|
|
277
|
+
|
|
278
|
+
{Repeat per category with findings}
|
|
279
|
+
|
|
280
|
+
## Public Endpoints
|
|
281
|
+
{Intentionally public endpoints documented during security audit}
|
|
282
|
+
|
|
283
|
+
## Files Scanned
|
|
284
|
+
{Count and list of all files scanned}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
If a previous milestone audit exists in `.forge/audits/`, compare results and note improvements/regressions in the executive summary.
|
|
288
|
+
|
|
289
|
+
## Step 6: Present Results + Triage Refactoring
|
|
290
|
+
|
|
291
|
+
### Health Results
|
|
292
|
+
|
|
293
|
+
Present health status first — this is the gate.
|
|
294
|
+
|
|
295
|
+
**HEALTHY (all passed):**
|
|
296
|
+
*"Health audit passed. No security vulnerabilities or architectural concerns."*
|
|
297
|
+
|
|
298
|
+
**NEEDS ATTENTION (critical issues):**
|
|
299
|
+
*"Critical issues found:"*
|
|
300
|
+
Inline top 3 findings per critical category.
|
|
301
|
+
|
|
302
|
+
**WARNINGS ONLY:**
|
|
303
|
+
*"Passed with warnings — no critical issues, {N} items worth noting. Full report: `.forge/audits/milestone-{id}-health-report.md`."*
|
|
304
|
+
|
|
305
|
+
### Refactoring Triage
|
|
306
|
+
|
|
307
|
+
Show findings grouped by category (max 10 initially):
|
|
308
|
+
|
|
309
|
+
*"{N} refactoring opportunities found:"*
|
|
310
|
+
|
|
311
|
+
Per category:
|
|
312
|
+
*"**Duplication** ({N}):*
|
|
313
|
+
*1. `src/api/users.ts:42-67` — Duplicate email validation. Quick fix: extract helper. [Accept / Dismiss]*"
|
|
314
|
+
|
|
315
|
+
User responses:
|
|
316
|
+
- **Accept** → add to backlog
|
|
317
|
+
- **Dismiss** → skip (optionally ask reason to calibrate future scans)
|
|
318
|
+
- **Accept all** → bulk add remaining
|
|
319
|
+
- **Dismiss all** → skip everything
|
|
320
|
+
|
|
321
|
+
## Step 7: Write Backlog + Route
|
|
322
|
+
|
|
323
|
+
### Write Refactoring Backlog
|
|
324
|
+
|
|
325
|
+
Read existing `.forge/refactor-backlog.yml`. Determine next item ID by incrementing from highest existing.
|
|
326
|
+
|
|
327
|
+
Append accepted items:
|
|
328
|
+
|
|
329
|
+
```yaml
|
|
330
|
+
items:
|
|
331
|
+
- id: R001
|
|
332
|
+
milestone: 1
|
|
333
|
+
category: duplication
|
|
334
|
+
file: "src/api/users.ts"
|
|
335
|
+
lines: "42-67"
|
|
336
|
+
description: "Duplicate validation logic — same email check in createUser and updateUser"
|
|
337
|
+
effort: quick
|
|
338
|
+
suggested_approach: "Extract shared validateEmail() helper"
|
|
339
|
+
status: pending
|
|
340
|
+
added: "2026-03-18"
|
|
341
|
+
completed: null
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
If file doesn't exist, create from `.forge/templates/refactor-backlog.yml`.
|
|
345
|
+
|
|
346
|
+
### Route Based on Health Status
|
|
347
|
+
|
|
348
|
+
#### HEALTHY or WARNINGS ONLY (accepted)
|
|
349
|
+
|
|
350
|
+
Update `.forge/state/milestone-{id}.yml`: set `current.status` to `complete`.
|
|
351
|
+
Update `.forge/state/index.yml`: set milestone status to `complete`, update `last_updated`.
|
|
352
|
+
|
|
353
|
+
*"Milestone [{name}] complete. {N} refactoring items in backlog."*
|
|
354
|
+
|
|
355
|
+
If Beads installed, run `bd complete`.
|
|
356
|
+
|
|
357
|
+
#### NEEDS ATTENTION (critical issues)
|
|
358
|
+
|
|
359
|
+
Do NOT mark complete. Present choices:
|
|
360
|
+
|
|
361
|
+
- **A. Fix critical issues** — return to `planning` in fix mode with findings as requirements
|
|
362
|
+
- **B. Accept risk** — document accepted risks in report, complete the milestone
|
|
363
|
+
|
|
364
|
+
If A: create fix requirements from findings → route to `planning` → after fix + re-verification → re-run `reviewing`.
|
|
365
|
+
If B: append "Accepted Risks" section to report → complete milestone (same as HEALTHY path).
|
|
366
|
+
|
|
367
|
+
#### WARNINGS ONLY (user wants to fix)
|
|
368
|
+
|
|
369
|
+
Create fix requirements from warnings → route to `planning` in fix mode → after fix → re-run `reviewing`.
|
|
370
|
+
|
|
371
|
+
## Gate Type: Mixed
|
|
372
|
+
|
|
373
|
+
- **Security critical** → soft gate (user can accept risk)
|
|
374
|
+
- **Architecture critical** → soft gate (user has final authority)
|
|
375
|
+
- **Warnings** → advisory (noted in report, user chooses)
|
|
376
|
+
- **Refactoring items** → never block (cataloged to backlog)
|
|
377
|
+
|
|
378
|
+
The report documents the decision either way — audit trail.
|
|
379
|
+
|
|
380
|
+
## Backlog Lifecycle
|
|
381
|
+
|
|
382
|
+
```
|
|
383
|
+
pending → in_progress → done
|
|
384
|
+
pending → dismissed (during triage or later)
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
`effort: quick` items → pick up via `quick-tasking`.
|
|
388
|
+
`effort: standard` items → Standard tier flow.
|
|
389
|
+
|
|
390
|
+
Working a backlog item:
|
|
391
|
+
1. `forge` surfaces it as available
|
|
392
|
+
2. User selects it
|
|
393
|
+
3. Route to `quick-tasking` or Standard tier based on effort
|
|
394
|
+
4. On completion, set `status: done` and `completed` date
|
|
395
|
+
|
|
396
|
+
## Phase Handoff
|
|
397
|
+
|
|
398
|
+
After reviewing completes (all paths):
|
|
399
|
+
|
|
400
|
+
1. Confirm health report written to `.forge/audits/milestone-{id}-health-report.md` and backlog updated
|
|
401
|
+
2. Set `current.status` to `complete` in `.forge/state/milestone-{id}.yml`
|
|
402
|
+
3. Present:
|
|
403
|
+
|
|
404
|
+
*"Milestone [{name}] complete. Report: `.forge/audits/milestone-{id}-health-report.md`. {N} refactoring items in backlog.*
|
|
405
|
+
|
|
406
|
+
*Start new work with `/forge` or tackle backlog items anytime."*
|
|
@@ -7,11 +7,11 @@ description: "Use when building features that touch authentication, user data, e
|
|
|
7
7
|
|
|
8
8
|
Security is a requirement, not a feature. Review before shipping.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Trigger
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
YES to any of these? Run this skill:
|
|
13
13
|
|
|
14
|
-
1. Does
|
|
14
|
+
1. Does the feature touch **authentication or authorization**?
|
|
15
15
|
2. Does it **store or transmit user data**?
|
|
16
16
|
3. Does it **call external APIs** or accept webhooks?
|
|
17
17
|
4. Does it **handle secrets, keys, or tokens**?
|
|
@@ -20,43 +20,43 @@ Ask these 4 questions. If YES to any, run this skill:
|
|
|
20
20
|
|
|
21
21
|
### Authentication & Authorization
|
|
22
22
|
- [ ] Passwords hashed with bcrypt/scrypt/argon2 (never MD5/SHA)
|
|
23
|
-
- [ ] Sessions/tokens expire
|
|
23
|
+
- [ ] Sessions/tokens expire with reasonable defaults
|
|
24
24
|
- [ ] Token refresh mechanism exists
|
|
25
25
|
- [ ] Authorization checked server-side before every data access
|
|
26
26
|
- [ ] Failed login attempts rate-limited
|
|
27
27
|
- [ ] Password reset flow doesn't reveal account existence
|
|
28
28
|
|
|
29
29
|
### Input Validation & Injection
|
|
30
|
-
- [ ] All user input validated server-side
|
|
30
|
+
- [ ] All user input validated server-side
|
|
31
31
|
- [ ] SQL queries use parameterized statements (never string concatenation)
|
|
32
32
|
- [ ] HTML output escaped to prevent XSS
|
|
33
|
-
- [ ] File uploads validated: type, size, content (not
|
|
34
|
-
- [ ] URL parameters sanitized
|
|
33
|
+
- [ ] File uploads validated: type, size, content (not extension alone)
|
|
34
|
+
- [ ] URL parameters sanitized
|
|
35
35
|
- [ ] JSON parsing has size limits
|
|
36
36
|
|
|
37
37
|
### Secrets Management
|
|
38
|
-
- [ ] Secrets
|
|
39
|
-
- [ ] `.env`
|
|
38
|
+
- [ ] Secrets in environment variables, never in code
|
|
39
|
+
- [ ] `.env` in `.gitignore`
|
|
40
40
|
- [ ] No secrets in logs, error messages, or stack traces
|
|
41
|
-
- [ ] API keys scoped to minimum
|
|
42
|
-
- [ ]
|
|
41
|
+
- [ ] API keys scoped to minimum permissions
|
|
42
|
+
- [ ] Documented rotation process
|
|
43
43
|
|
|
44
44
|
### Data Protection
|
|
45
|
-
- [ ] Sensitive data encrypted at rest
|
|
46
|
-
- [ ] HTTPS enforced for all
|
|
45
|
+
- [ ] Sensitive data encrypted at rest
|
|
46
|
+
- [ ] HTTPS enforced for all transit
|
|
47
47
|
- [ ] PII not logged (names, emails, addresses, IPs)
|
|
48
|
-
- [ ] Data retention policy defined
|
|
49
|
-
- [ ] CORS
|
|
48
|
+
- [ ] Data retention policy defined
|
|
49
|
+
- [ ] CORS allows only known origins
|
|
50
50
|
|
|
51
51
|
### Dependencies
|
|
52
52
|
- [ ] `npm audit` (or equivalent) passes or vulnerabilities documented
|
|
53
|
-
- [ ] No known vulnerable versions of critical
|
|
54
|
-
- [ ] Lock file committed
|
|
53
|
+
- [ ] No known vulnerable versions of critical deps
|
|
54
|
+
- [ ] Lock file committed
|
|
55
55
|
- [ ] Dependencies from trusted registries only
|
|
56
56
|
|
|
57
57
|
### Error Handling
|
|
58
|
-
- [ ] Error messages don't leak
|
|
59
|
-
- [ ] Unhandled exceptions caught and logged
|
|
58
|
+
- [ ] Error messages don't leak internals (stack traces, DB schema, file paths)
|
|
59
|
+
- [ ] Unhandled exceptions caught and logged, not displayed
|
|
60
60
|
- [ ] Rate limiting on all public endpoints
|
|
61
61
|
- [ ] Graceful degradation when external services fail
|
|
62
62
|
|
|
@@ -5,30 +5,26 @@ description: "Sync Forge framework files from a local dev repo or NPM. Use when
|
|
|
5
5
|
|
|
6
6
|
# Upgrading: Local Dev Sync
|
|
7
7
|
|
|
8
|
-
Sync framework files from a local Forge source repo into the current project
|
|
8
|
+
Sync framework files from a local Forge source repo into the current project for testing without publishing to NPM.
|
|
9
9
|
|
|
10
|
-
For published upgrades, use `npx forge-orkes upgrade
|
|
10
|
+
For published upgrades, use `npx forge-orkes upgrade`.
|
|
11
11
|
|
|
12
12
|
## Step 1: Resolve Source Path
|
|
13
13
|
|
|
14
14
|
Check if `.forge/dev-source` exists in the project root.
|
|
15
15
|
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- Validate the path has `packages/create-forge/template/`
|
|
19
|
-
- Save the path to `.forge/dev-source` for next time
|
|
16
|
+
- **Exists:** Read the path (first line, trimmed). Confirm it contains `packages/create-forge/template/`.
|
|
17
|
+
- **Missing:** Ask the user for the local Forge repo path, validate it has `packages/create-forge/template/`, save to `.forge/dev-source`.
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
Template directory: `{source}/packages/create-forge/template/`.
|
|
22
20
|
|
|
23
21
|
## Step 2: File Classification
|
|
24
22
|
|
|
25
|
-
Files are classified into three categories:
|
|
26
|
-
|
|
27
23
|
| Category | Paths | Behavior |
|
|
28
24
|
|----------|-------|----------|
|
|
29
|
-
| **Framework-owned** | `.claude/agents/*.md`, `.claude/skills/*/SKILL.md` | Overwrite
|
|
25
|
+
| **Framework-owned** | `.claude/agents/*.md`, `.claude/skills/*/SKILL.md` | Overwrite |
|
|
30
26
|
| **Merge-owned** | `CLAUDE.md`, `.claude/settings.json` | Never auto-overwrite |
|
|
31
|
-
| **Template-only** | `.forge/templates/**` | Overwrite
|
|
27
|
+
| **Template-only** | `.forge/templates/**` | Overwrite |
|
|
32
28
|
|
|
33
29
|
**Never touch** user-generated files: `.forge/project.yml`, `.forge/state/`, `.forge/constitution.md`, `.forge/context.md`, `.forge/requirements.yml`, `.forge/roadmap.yml`, `.forge/design-system.md`, `.forge/refactor-backlog.yml`.
|
|
34
30
|
|
|
@@ -36,34 +32,30 @@ Files are classified into three categories:
|
|
|
36
32
|
|
|
37
33
|
For each framework-owned file in the source template:
|
|
38
34
|
|
|
39
|
-
1. Read
|
|
40
|
-
2.
|
|
41
|
-
3.
|
|
42
|
-
4.
|
|
43
|
-
5.
|
|
44
|
-
6. If local has a file not in source → report as **removed from template** (don't delete — let user decide)
|
|
35
|
+
1. Read source and local content
|
|
36
|
+
2. Different → overwrite local, report **updated**
|
|
37
|
+
3. Same → report **unchanged**
|
|
38
|
+
4. Source has new file → copy, report **added**
|
|
39
|
+
5. Local has file not in source → report **removed from template** (don't delete -- let user decide)
|
|
45
40
|
|
|
46
41
|
## Step 4: Sync Template-Only Files
|
|
47
42
|
|
|
48
|
-
Same process as Step 3
|
|
43
|
+
Same process as Step 3 for `.forge/templates/**`.
|
|
49
44
|
|
|
50
45
|
## Step 5: Handle Merge-Owned Files
|
|
51
46
|
|
|
52
|
-
|
|
47
|
+
**`CLAUDE.md`:**
|
|
53
48
|
1. Read source and local versions
|
|
54
|
-
2. If different →
|
|
55
|
-
3. Present the summary to the user and let them decide how to merge
|
|
49
|
+
2. If different → summarize changes (new/removed/modified sections) and let the user decide how to merge. Do not overwrite.
|
|
56
50
|
|
|
57
|
-
|
|
51
|
+
**`.claude/settings.json`:**
|
|
58
52
|
1. Read source and local versions
|
|
59
|
-
2. Compare
|
|
60
|
-
3. If
|
|
61
|
-
4.
|
|
53
|
+
2. Compare `forge.*` keys only
|
|
54
|
+
3. If different → update `forge.*` keys in local, preserve user's `hooks` and custom keys
|
|
55
|
+
4. Set `forge.version` to match the source package version
|
|
62
56
|
|
|
63
57
|
## Step 6: Report
|
|
64
58
|
|
|
65
|
-
Present a summary:
|
|
66
|
-
|
|
67
59
|
```
|
|
68
60
|
Forge Local Sync Complete
|
|
69
61
|
─────────────────────────
|