Skip to content

Commit 52fb5d7

Browse files
committed
fix: Testing & Security skills cleanup
1 parent 9ce063f commit 52fb5d7

54 files changed

Lines changed: 585 additions & 1597 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

skills/Testing & Security/agent-authentication/SKILL.md

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,43 @@
11
---
22
id: api-security-best-practices
33
name: API Security Best Practices
4-
description: Step-by-step guidance for API security best practices.
4+
description: Review API designs for authentication, authorization, validation, rate limiting, error handling, and data exposure risks.
55
category: Testing & Security
6+
requires: []
7+
examples:
8+
- "Review this API design for security gaps."
9+
- "What API security best practices matter for this endpoint?"
10+
- "Help me harden this public API surface."
611
---
712

813
# API Security Best Practices
914

10-
Support api security best practices workflows with clear steps and best practices.
15+
Use this skill to review API designs and implementations for common security weaknesses before they become incidents.
1116

12-
## When to Use
17+
## Start By Clarifying
18+
- Who can call the API and from where.
19+
- Which authentication and authorization model is in play.
20+
- What data is sensitive or business-critical.
21+
- Which endpoints are public, internal, privileged, or high-volume.
22+
- What abuse scenarios are realistic for the system.
1323

14-
- You need help with api security best practices.
15-
- You want a clear, actionable next step.
24+
## Security Review Areas
25+
- Authentication strength and token handling.
26+
- Authorization checks tied to business rules.
27+
- Input validation, payload size limits, and schema enforcement.
28+
- Rate limiting, abuse resistance, and resource protection.
29+
- Error handling that stays useful without leaking internals.
30+
- Response shaping that avoids accidental data exposure.
1631

17-
## Output
32+
## Good Output
33+
- API-specific risks by severity.
34+
- Missing controls or assumptions that need to be explicit.
35+
- Safer default patterns for auth, validation, and responses.
36+
- Verification ideas such as abuse-case tests or authorization checks.
1837

19-
- Brief plan or checklist
20-
- Key recommendations and caveats
38+
## Common Mistakes
39+
- Validating syntax but not ownership or permissions.
40+
- Treating internal APIs as automatically trusted.
41+
- Returning more data than the caller actually needs.
42+
- Weak or inconsistent error semantics around auth and validation.
43+
- Missing rate limits on endpoints that are easy to abuse.
Lines changed: 41 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,49 @@
11
---
22
id: backend-security-coder
33
name: Backend Security Coder
4-
description: Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.
4+
description: Design and review secure backend code with practical guidance on input validation, authentication, authorization, secret handling, and API safety.
55
category: Testing & Security
66
requires: []
77
examples:
8-
- "Implement secure authentication for my API"
9-
- "Review this backend code for security vulnerabilities"
8+
- "Help me implement secure authentication for this API."
9+
- "Review this backend code for security vulnerabilities."
10+
- "What secure coding patterns should this backend endpoint use?"
1011
---
1112

12-
## Use this skill when
13-
14-
- Working on backend security coder tasks or workflows
15-
- Needing guidance, best practices, or checklists for backend security coder
16-
17-
## Do not use this skill when
18-
19-
- The task is unrelated to backend security coder
20-
- You need a different domain or tool outside this scope
21-
22-
## Instructions
23-
24-
- Clarify goals, constraints, and required inputs.
25-
- Apply relevant best practices and validate outcomes.
26-
- Provide actionable steps and verification.
27-
- If detailed examples are required, open `resources/implementation-playbook.md`.
28-
29-
You are a backend security coding expert specializing in secure development practices, vulnerability prevention, and secure architecture implementation.
30-
31-
## Purpose
32-
Expert backend security developer with comprehensive knowledge of secure coding practices, vulnerability prevention, and defensive programming techniques. Masters input validation, authentication systems, API security, database protection, and secure error handling. Specializes in building security-first backend applications that resist common attack vectors.
33-
34-
## When to Use vs Security Auditor
35-
- **Use this agent for**: Hands-on backend security coding, API security implementation, database security configuration, authentication system coding, vulnerability fixes
36-
- **Use security-auditor for**: High-level security audits, compliance assessments, DevSecOps pipeline design, threat modeling, security architecture reviews, penetration testing planning
37-
- **Key difference**: This agent focuses on writing secure backend code, while security-auditor focuses on auditing and assessing security posture
38-
39-
## Capabilities
40-
41-
### General Secure Coding Practices
42-
- **Input validation and sanitization**: Comprehensive input validation frameworks, allowlist approaches, data type enforcement
43-
- **Injection attack prevention**: SQL injection, NoSQL injection, LDAP injection, command injection prevention techniques
44-
- **Error handling security**: Secure error messages, logging without information leakage, graceful degradation
45-
- **Sensitive data protection**: Data classification, secure storage patterns, encryption at rest and in transit
46-
- **Secret management**: Secure credential storage, environment variable best practices, secret rotation strategies
47-
- **Output encoding**: Context-aware encoding, preventing injection in templates and APIs
48-
49-
### HTTP Security Headers and Cookies
50-
- **Content Security Policy (CSP)**: CSP implementation, nonce and hash strategies, report-only mode
51-
- **Security headers**: HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy implementation
52-
- **Cookie security**: HttpOnly, Secure, SameSite attributes, cookie scoping and domain restrictions
53-
- **CORS configuration**: Strict CORS policies, preflight request handling, credential-aware CORS
54-
- **Session management**: Secure session handling, session fixation prevention, timeout management
55-
56-
### CSRF Protection
57-
- **Anti-CSRF tokens**: Token generation, validation, and refresh strategies for cookie-based authentication
58-
- **Header validation**: Origin and Referer header validation for non-GET requests
59-
- **Double-submit cookies**: CSRF token implementation in cookies and headers
60-
- **SameSite cookie enforcement**: Leveraging SameSite attributes for CSRF protection
61-
- **State-changing operation protection**: Authentication requirements for sensitive actions
62-
63-
### Output Rendering Security
64-
- **Context-aware encoding**: HTML, JavaScript, CSS, URL encoding based on output context
65-
- **Template security**: Secure templating practices, auto-escaping configuration
66-
- **JSON response security**: Preventing JSON hijacking, secure API response formatting
67-
- **XML security**: XML external entity (XXE) prevention, secure XML parsing
68-
- **File serving security**: Secure file download, content-type validation, path traversal prevention
69-
70-
### Database Security
71-
- **Parameterized queries**: Prepared statements, ORM security configuration, query parameterization
72-
- **Database authentication**: Connection security, credential management, connection pooling security
73-
- **Data encryption**: Field-level encryption, transparent data encryption, key management
74-
- **Access control**: Database user privilege separation, role-based access control
75-
- **Audit logging**: Database activity monitoring, change tracking, compliance logging
76-
- **Backup security**: Secure backup procedures, encryption of backups, access control for backup files
77-
78-
### API Security
79-
- **Authentication mechanisms**: JWT security, OAuth 2.0/2.1 implementation, API key management
80-
- **Authorization patterns**: RBAC, ABAC, scope-based access control, fine-grained permissions
81-
- **Input validation**: API request validation, payload size limits, content-type validation
82-
- **Rate limiting**: Request throttling, burst protection, user-based and IP-based limiting
83-
- **API versioning security**: Secure version management, backward compatibility security
84-
- **Error handling**: Consistent error responses, security-aware error messages, logging strategies
85-
86-
### External Requests Security
87-
- **Allowlist management**: Destination allowlisting, URL validation, domain restriction
88-
- **Request validation**: URL sanitization, protocol restrictions, parameter validation
89-
- **SSRF prevention**: Server-side request forgery protection, internal network isolation
90-
- **Timeout and limits**: Request timeout configuration, response size limits, resource protection
91-
- **Certificate validation**: SSL/TLS certificate pinning, certificate authority validation
92-
- **Proxy security**: Secure proxy configuration, header forwarding restrictions
93-
94-
### Authentication and Authorization
95-
- **Multi-factor authentication**: TOTP, hardware tokens, biometric integration, backup codes
96-
- **Password security**: Hashing algorithms (bcrypt, Argon2), salt generation, password policies
97-
- **Session security**: Secure session tokens, session invalidation, concurrent session management
98-
- **JWT implementation**: Secure JWT handling, signature verification, token expiration
99-
- **OAuth security**: Secure OAuth flows, PKCE implementation, scope validation
100-
101-
### Logging and Monitoring
102-
- **Security logging**: Authentication events, authorization failures, suspicious activity tracking
103-
- **Log sanitization**: Preventing log injection, sensitive data exclusion from logs
104-
- **Audit trails**: Comprehensive activity logging, tamper-evident logging, log integrity
105-
- **Monitoring integration**: SIEM integration, alerting on security events, anomaly detection
106-
- **Compliance logging**: Regulatory requirement compliance, retention policies, log encryption
107-
108-
### Cloud and Infrastructure Security
109-
- **Environment configuration**: Secure environment variable management, configuration encryption
110-
- **Container security**: Secure Docker practices, image scanning, runtime security
111-
- **Secrets management**: Integration with HashiCorp Vault, AWS Secrets Manager, Azure Key Vault
112-
- **Network security**: VPC configuration, security groups, network segmentation
113-
- **Identity and access management**: IAM roles, service account security, principle of least privilege
114-
115-
## Behavioral Traits
116-
- Validates and sanitizes all user inputs using allowlist approaches
117-
- Implements defense-in-depth with multiple security layers
118-
- Uses parameterized queries and prepared statements exclusively
119-
- Never exposes sensitive information in error messages or logs
120-
- Applies principle of least privilege to all access controls
121-
- Implements comprehensive audit logging for security events
122-
- Uses secure defaults and fails securely in error conditions
123-
- Regularly updates dependencies and monitors for vulnerabilities
124-
- Considers security implications in every design decision
125-
- Maintains separation of concerns between security layers
126-
127-
## Knowledge Base
128-
- OWASP Top 10 and secure coding guidelines
129-
- Common vulnerability patterns and prevention techniques
130-
- Authentication and authorization best practices
131-
- Database security and query parameterization
132-
- HTTP security headers and cookie security
133-
- Input validation and output encoding techniques
134-
- Secure error handling and logging practices
135-
- API security and rate limiting strategies
136-
- CSRF and SSRF prevention mechanisms
137-
- Secret management and encryption practices
138-
139-
## Response Approach
140-
1. **Assess security requirements** including threat model and compliance needs
141-
2. **Implement input validation** with comprehensive sanitization and allowlist approaches
142-
3. **Configure secure authentication** with multi-factor authentication and session management
143-
4. **Apply database security** with parameterized queries and access controls
144-
5. **Set security headers** and implement CSRF protection for web applications
145-
6. **Implement secure API design** with proper authentication and rate limiting
146-
7. **Configure secure external requests** with allowlists and validation
147-
8. **Set up security logging** and monitoring for threat detection
148-
9. **Review and test security controls** with both automated and manual testing
149-
150-
## Example Interactions
151-
- "Implement secure user authentication with JWT and refresh token rotation"
152-
- "Review this API endpoint for injection vulnerabilities and implement proper validation"
153-
- "Configure CSRF protection for cookie-based authentication system"
154-
- "Implement secure database queries with parameterization and access controls"
155-
- "Set up comprehensive security headers and CSP for web application"
156-
- "Create secure error handling that doesn't leak sensitive information"
157-
- "Implement rate limiting and DDoS protection for public API endpoints"
158-
- "Design secure external service integration with allowlist validation"
13+
# Backend Security Coder
14+
15+
Use this skill when building or reviewing backend logic that touches authentication, authorization, input validation, secrets, or high-risk data flows.
16+
17+
## Start By Clarifying
18+
- What is the endpoint, service, or workflow supposed to do?
19+
- Which inputs are untrusted?
20+
- Which roles, identities, or permissions matter?
21+
- What sensitive data or side effects are involved?
22+
- What failure modes would be dangerous?
23+
24+
## Secure Backend Priorities
25+
- Validate and constrain untrusted input.
26+
- Enforce authentication and authorization separately and explicitly.
27+
- Use safe query and storage patterns for sensitive data.
28+
- Fail securely without leaking secrets or internals.
29+
- Keep dangerous operations observable and reviewable.
30+
31+
## Implementation Lenses
32+
- Input validation and allowlisting.
33+
- Injection prevention for SQL, commands, templates, or downstream services.
34+
- Authentication flow safety, session or token handling, and replay concerns.
35+
- Authorization checks tied to business rules, not only route placement.
36+
- Secret management, logging hygiene, rate limits, and abuse resistance.
37+
38+
## Good Output
39+
- Security risks relevant to the specific backend path.
40+
- Secure implementation or refactoring guidance.
41+
- Verification ideas such as abuse-case tests or authorization checks.
42+
- Gaps where more context is needed before recommending a pattern.
43+
44+
## Common Mistakes
45+
- Treating authentication as authorization.
46+
- Validating shape but not meaning or ownership.
47+
- Logging secrets, tokens, or sensitive payloads.
48+
- Trusting upstream systems too broadly.
49+
- Returning detailed error information that helps attackers.

skills/Testing & Security/better-auth-best-practices/SKILL.md

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,44 @@
11
---
22
id: broken-authentication-testing
33
name: Broken Authentication Testing
4-
description: Step-by-step guidance for broken authentication testing.
4+
description: Test authentication and session flows for common weaknesses such as bypasses, fixation, weak recovery, and token misuse.
55
category: Testing & Security
6+
requires: []
7+
examples:
8+
- "How should I test this auth flow for weaknesses?"
9+
- "What broken-authentication cases should I check?"
10+
- "Review this login and session design for security test coverage."
611
---
712

813
# Broken Authentication Testing
914

10-
Support broken authentication testing workflows with clear steps and best practices.
15+
Use this skill to design security tests for login, session, token, and account-recovery flows.
1116

12-
## When to Use
17+
## What To Clarify
18+
- Which auth flows exist: login, logout, refresh, reset, MFA, invitation, device trust, or session revocation.
19+
- Which credentials or tokens are used and where they are stored.
20+
- What permissions or account transitions happen after authentication.
21+
- Which threat model matters most: account takeover, token theft, session abuse, or privilege escalation.
1322

14-
- You need help with broken authentication testing.
15-
- You want a clear, actionable next step.
23+
## High-Value Test Areas
24+
- Authentication bypass or inconsistent enforcement.
25+
- Session fixation, stale-session reuse, or weak logout invalidation.
26+
- Password reset and recovery flow abuse.
27+
- MFA downgrade, bypass, or weak recovery paths.
28+
- Token rotation, expiration, replay, and storage assumptions.
1629

17-
## Output
30+
## Good Output
31+
- Abuse-case scenarios to test.
32+
- Priority vulnerabilities by impact.
33+
- Specific flow gaps or state-transition weaknesses.
34+
- Safer design or verification recommendations.
1835

19-
- Brief plan or checklist
20-
- Key recommendations and caveats
36+
## Common Mistakes
37+
- Testing only happy-path login success.
38+
- Assuming logout truly invalidates all relevant sessions.
39+
- Treating password reset as less sensitive than login.
40+
- Forgetting old tokens, shared devices, or privilege changes after authentication.
41+
42+
## Boundaries
43+
- Do not pretend to run penetration tests automatically.
44+
- Focus on test design, abuse scenarios, and review logic.

skills/Testing & Security/checking-changes/SKILL.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

skills/Testing & Security/claims/SKILL.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)