mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-22 06:20:10 +00:00
fix: multiple community-reported issues
- feat(plugin.json): add agents declaration to make 9 agents visible in /agents command (fixes #66, closes PR #67) - fix(backend-patterns): correct requirePermission HOF pattern to properly wrap handlers instead of expecting Request directly (fixes #54, closes PR #63) - docs(user-CLAUDE): add privacy guideline about redacting secrets from logs before sharing (fixes #38, closes PR #39) - fix(eval-harness): add mandatory frontmatter with name, description, and tools fields (closes PR #58)
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
"automation",
|
"automation",
|
||||||
"best-practices"
|
"best-practices"
|
||||||
],
|
],
|
||||||
|
"agents": "./agents",
|
||||||
"commands": "./commands",
|
"commands": "./commands",
|
||||||
"skills": "./skills"
|
"skills": "./skills"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ Located in `~/.claude/agents/`:
|
|||||||
|
|
||||||
## Personal Preferences
|
## Personal Preferences
|
||||||
|
|
||||||
|
### Privacy
|
||||||
|
- Always redact logs; never paste secrets (API keys/tokens/passwords/JWTs)
|
||||||
|
- Review output before sharing - remove any sensitive data
|
||||||
|
|
||||||
### Code Style
|
### Code Style
|
||||||
- No emojis in code, comments, or documentation
|
- No emojis in code, comments, or documentation
|
||||||
- Prefer immutability - never mutate objects or arrays
|
- Prefer immutability - never mutate objects or arrays
|
||||||
|
|||||||
@@ -395,21 +395,26 @@ export function hasPermission(user: User, permission: Permission): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function requirePermission(permission: Permission) {
|
export function requirePermission(permission: Permission) {
|
||||||
return async (request: Request) => {
|
return (handler: (request: Request, user: User) => Promise<Response>) => {
|
||||||
const user = await requireAuth(request)
|
return async (request: Request) => {
|
||||||
|
const user = await requireAuth(request)
|
||||||
|
|
||||||
if (!hasPermission(user, permission)) {
|
if (!hasPermission(user, permission)) {
|
||||||
throw new ApiError(403, 'Insufficient permissions')
|
throw new ApiError(403, 'Insufficient permissions')
|
||||||
|
}
|
||||||
|
|
||||||
|
return handler(request, user)
|
||||||
}
|
}
|
||||||
|
|
||||||
return user
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Usage
|
// Usage - HOF wraps the handler
|
||||||
export const DELETE = requirePermission('delete')(async (request: Request) => {
|
export const DELETE = requirePermission('delete')(
|
||||||
// Handler with permission check
|
async (request: Request, user: User) => {
|
||||||
})
|
// Handler receives authenticated user with verified permission
|
||||||
|
return new Response('Deleted', { status: 200 })
|
||||||
|
}
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Rate Limiting
|
## Rate Limiting
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: eval-harness
|
||||||
|
description: Formal evaluation framework for Claude Code sessions implementing eval-driven development (EDD) principles
|
||||||
|
tools: Read, Write, Edit, Bash, Grep, Glob
|
||||||
|
---
|
||||||
|
|
||||||
# Eval Harness Skill
|
# Eval Harness Skill
|
||||||
|
|
||||||
A formal evaluation framework for Claude Code sessions, implementing eval-driven development (EDD) principles.
|
A formal evaluation framework for Claude Code sessions, implementing eval-driven development (EDD) principles.
|
||||||
|
|||||||
Reference in New Issue
Block a user