@neuravim/aiden 0.12.0
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/LICENSE +661 -0
- package/README.fr.md +204 -0
- package/README.md +208 -0
- package/dist/index.js +7483 -0
- package/dist/index.js.map +1 -0
- package/package.json +85 -0
- package/templates/aiden.config.yaml +46 -0
- package/templates/rules/coding-standards.md +29 -0
- package/templates/skills/adr-enforcer/instructions.md +66 -0
- package/templates/skills/adr-enforcer/skill.yaml +14 -0
- package/templates/skills/adversarial-review/instructions.md +33 -0
- package/templates/skills/adversarial-review/skill.yaml +11 -0
- package/templates/skills/api-design-restful/instructions.md +74 -0
- package/templates/skills/api-design-restful/skill.yaml +16 -0
- package/templates/skills/changelog-gen/instructions.md +59 -0
- package/templates/skills/changelog-gen/skill.yaml +14 -0
- package/templates/skills/code-review-strict/instructions.md +13 -0
- package/templates/skills/code-review-strict/skill.yaml +8 -0
- package/templates/skills/compliance-rgpd/instructions.md +18 -0
- package/templates/skills/compliance-rgpd/skill.yaml +12 -0
- package/templates/skills/dead-code-detector/instructions.md +38 -0
- package/templates/skills/dead-code-detector/skill.yaml +7 -0
- package/templates/skills/dependency-audit/instructions.md +43 -0
- package/templates/skills/dependency-audit/skill.yaml +17 -0
- package/templates/skills/hipaa-guard/instructions.md +62 -0
- package/templates/skills/hipaa-guard/skill.yaml +23 -0
- package/templates/skills/iso-27001/instructions.md +54 -0
- package/templates/skills/iso-27001/skill.yaml +10 -0
- package/templates/skills/jira-sync/instructions.md +10 -0
- package/templates/skills/jira-sync/skill.yaml +18 -0
- package/templates/skills/linear-sync/instructions.md +39 -0
- package/templates/skills/linear-sync/skill.yaml +22 -0
- package/templates/skills/naming-conventions/instructions.md +45 -0
- package/templates/skills/naming-conventions/skill.yaml +16 -0
- package/templates/skills/nestjs-patterns/instructions.md +55 -0
- package/templates/skills/nestjs-patterns/skill.yaml +12 -0
- package/templates/skills/owasp-check/instructions.md +71 -0
- package/templates/skills/owasp-check/skill.yaml +20 -0
- package/templates/skills/react-best-practices/instructions.md +59 -0
- package/templates/skills/react-best-practices/skill.yaml +12 -0
- package/templates/skills/secret-scan/instructions.md +44 -0
- package/templates/skills/secret-scan/skill.yaml +11 -0
- package/templates/skills/slack-notify/instructions.md +45 -0
- package/templates/skills/slack-notify/skill.yaml +19 -0
- package/templates/skills/test-coverage-enforcer/instructions.md +42 -0
- package/templates/skills/test-coverage-enforcer/skill.yaml +18 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: hipaa-guard
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Enforce HIPAA compliance for Protected Health Information handling
|
|
4
|
+
agents:
|
|
5
|
+
- analyst
|
|
6
|
+
- dev
|
|
7
|
+
- qa
|
|
8
|
+
modes:
|
|
9
|
+
- enterprise
|
|
10
|
+
priority: 25
|
|
11
|
+
enabled: true
|
|
12
|
+
config:
|
|
13
|
+
phiFields:
|
|
14
|
+
- name
|
|
15
|
+
- dob
|
|
16
|
+
- ssn
|
|
17
|
+
- mrn
|
|
18
|
+
- address
|
|
19
|
+
- phone
|
|
20
|
+
- email
|
|
21
|
+
- insurance_id
|
|
22
|
+
encryptionRequired: AES-256
|
|
23
|
+
auditLogRetention: 2190
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# ISO 27001 Controls Assessment
|
|
2
|
+
|
|
3
|
+
## For Analyst Agent
|
|
4
|
+
|
|
5
|
+
Evaluate the feature against relevant ISO 27001 Annex A controls. Flag any controls that the feature impacts or must comply with:
|
|
6
|
+
|
|
7
|
+
- **A.5 — Information Security Policies**: Does the feature align with documented security policies?
|
|
8
|
+
- **A.6 — Organization of Information Security**: Are responsibilities and segregation of duties clear?
|
|
9
|
+
- **A.8 — Asset Management**: Are information assets (data, configs, keys) classified and handled appropriately?
|
|
10
|
+
- **A.9 — Access Control**: Is access limited to authorized users with least privilege?
|
|
11
|
+
|
|
12
|
+
Include an `## ISO 27001 Impact` section in your analysis listing affected controls.
|
|
13
|
+
|
|
14
|
+
## For QA Agent
|
|
15
|
+
|
|
16
|
+
Assess the implementation against the following ISO 27001 Annex A control domains:
|
|
17
|
+
|
|
18
|
+
### A.9 — Access Control
|
|
19
|
+
- Verify authentication is required for all sensitive operations
|
|
20
|
+
- Verify authorization follows least-privilege principle
|
|
21
|
+
- Check for proper session management and timeout
|
|
22
|
+
|
|
23
|
+
### A.10 — Cryptography
|
|
24
|
+
- Verify encryption is used for sensitive data at rest and in transit
|
|
25
|
+
- Check key management practices (no hardcoded keys, proper rotation)
|
|
26
|
+
- Verify hashing algorithms are current (bcrypt, argon2 for passwords)
|
|
27
|
+
|
|
28
|
+
### A.12 — Operations Security
|
|
29
|
+
- Verify logging captures security-relevant events
|
|
30
|
+
- Check for protection against malware (input validation, sanitization)
|
|
31
|
+
- Verify change management controls (no direct production modifications)
|
|
32
|
+
|
|
33
|
+
### A.13 — Communications Security
|
|
34
|
+
- Verify network communications use TLS
|
|
35
|
+
- Check for proper API authentication (tokens, certificates)
|
|
36
|
+
- Verify data transfer controls between systems
|
|
37
|
+
|
|
38
|
+
### A.14 — System Acquisition, Development, and Maintenance
|
|
39
|
+
- Verify secure coding practices are followed
|
|
40
|
+
- Check for input validation on all external inputs
|
|
41
|
+
- Verify separation of development, test, and production environments
|
|
42
|
+
|
|
43
|
+
### Output Format
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
ISO27001_FINDING:
|
|
47
|
+
- control: A.5 | A.6 | A.8 | A.9 | A.10 | A.12 | A.13 | A.14
|
|
48
|
+
- severity: critical | high | medium | low
|
|
49
|
+
- description: <what control is not satisfied>
|
|
50
|
+
- evidence: <file and line or architectural concern>
|
|
51
|
+
- remediation: <specific action to achieve compliance>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Summarize with a compliance score: number of controls assessed vs. number with findings.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Jira Sync
|
|
2
|
+
|
|
3
|
+
## For Lead Agent
|
|
4
|
+
- When analyzing a feature request, check if a Jira ticket reference is mentioned
|
|
5
|
+
- Include the Jira ticket ID in the feature slug if available (e.g., PROJ-123-feature-name)
|
|
6
|
+
|
|
7
|
+
## For Planner Agent
|
|
8
|
+
- Each story should map to a potential Jira sub-task
|
|
9
|
+
- Include estimated story points in story descriptions
|
|
10
|
+
- Reference the parent Jira ticket in the spec header
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: jira-sync
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Sync AIDEN features with Jira tickets
|
|
4
|
+
agents:
|
|
5
|
+
- lead
|
|
6
|
+
- planner
|
|
7
|
+
hooks:
|
|
8
|
+
on_feature_created:
|
|
9
|
+
- command: "echo 'TODO: Create Jira ticket for {{feature}}'"
|
|
10
|
+
onFailure: warn
|
|
11
|
+
on_feature_completed:
|
|
12
|
+
- command: "echo 'TODO: Close Jira ticket for {{feature}}'"
|
|
13
|
+
onFailure: ignore
|
|
14
|
+
config:
|
|
15
|
+
jira_url: https://your-company.atlassian.net
|
|
16
|
+
project_key: PROJ
|
|
17
|
+
priority: 5
|
|
18
|
+
enabled: false
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Linear Sync
|
|
2
|
+
|
|
3
|
+
## For Lead Agent
|
|
4
|
+
|
|
5
|
+
When creating a new feature:
|
|
6
|
+
|
|
7
|
+
1. Include a Linear-compatible identifier in the feature slug when a Linear issue ID is provided (e.g., `ENG-123-user-auth`)
|
|
8
|
+
2. Reference the Linear issue URL in the feature brief under a `## Tracking` section
|
|
9
|
+
3. If no Linear issue exists, note that one should be created (the `on_feature_created` hook handles this)
|
|
10
|
+
|
|
11
|
+
When summarizing feature status, include the Linear issue reference for traceability.
|
|
12
|
+
|
|
13
|
+
## For Planner Agent
|
|
14
|
+
|
|
15
|
+
When decomposing a feature into stories:
|
|
16
|
+
|
|
17
|
+
1. **Map stories to sub-issues**: Each story should correspond to a potential Linear sub-issue
|
|
18
|
+
2. **Include story points**: Estimate story points (1, 2, 3, 5, 8) for each story based on complexity
|
|
19
|
+
3. **Set priority**: Map story priority to Linear priority levels (Urgent, High, Medium, Low)
|
|
20
|
+
4. **Label mapping**: Suggest Linear labels based on story type (feature, bug, chore, spike)
|
|
21
|
+
|
|
22
|
+
### Story format for Linear sync
|
|
23
|
+
|
|
24
|
+
In each story, include a metadata block:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
STORY_METADATA:
|
|
28
|
+
- linearParent: <parent issue ID if known>
|
|
29
|
+
- storyPoints: <1|2|3|5|8>
|
|
30
|
+
- priority: <urgent|high|medium|low>
|
|
31
|
+
- labels: [<label1>, <label2>]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This metadata will be used by the sync hooks to create properly attributed Linear sub-issues.
|
|
35
|
+
|
|
36
|
+
### Hooks
|
|
37
|
+
|
|
38
|
+
- `on_feature_created`: Creates a Linear issue for the feature (configured via team/project settings)
|
|
39
|
+
- `on_feature_completed`: Closes the Linear issue and its sub-issues
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: linear-sync
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Sync AIDEN features and stories with Linear issues
|
|
4
|
+
agents:
|
|
5
|
+
- lead
|
|
6
|
+
- planner
|
|
7
|
+
modes:
|
|
8
|
+
- standard
|
|
9
|
+
- enterprise
|
|
10
|
+
priority: 5
|
|
11
|
+
enabled: true
|
|
12
|
+
config:
|
|
13
|
+
teamId: ""
|
|
14
|
+
projectId: ""
|
|
15
|
+
apiKeyEnv: LINEAR_API_KEY
|
|
16
|
+
hooks:
|
|
17
|
+
on_feature_created:
|
|
18
|
+
- command: "echo TODO Create Linear issue"
|
|
19
|
+
onFailure: warn
|
|
20
|
+
on_feature_completed:
|
|
21
|
+
- command: "echo TODO Close Linear issue"
|
|
22
|
+
onFailure: ignore
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Naming Conventions
|
|
2
|
+
|
|
3
|
+
## For Dev Agent
|
|
4
|
+
|
|
5
|
+
Apply the following naming conventions to all generated code:
|
|
6
|
+
|
|
7
|
+
| Element | Convention | Example |
|
|
8
|
+
|----------------|--------------------|----------------------------|
|
|
9
|
+
| Files | kebab-case | `user-service.ts` |
|
|
10
|
+
| Functions | camelCase | `getUserById()` |
|
|
11
|
+
| Classes | PascalCase | `UserService` |
|
|
12
|
+
| Constants | UPPER_SNAKE_CASE | `MAX_RETRY_COUNT` |
|
|
13
|
+
| Types/Interfaces | PascalCase | `UserProfile`, `ApiResponse` |
|
|
14
|
+
| Enums | PascalCase (name), UPPER_SNAKE_CASE (members) | `Status.ACTIVE` |
|
|
15
|
+
| Test files | kebab-case | `user-service.test.ts` |
|
|
16
|
+
| Variables | camelCase | `currentUser` |
|
|
17
|
+
| Boolean vars | camelCase with prefix | `isActive`, `hasPermission`, `canEdit` |
|
|
18
|
+
| Private fields | camelCase (no `_` prefix unless framework requires) | `private userId` |
|
|
19
|
+
|
|
20
|
+
### Rules
|
|
21
|
+
|
|
22
|
+
1. Acronyms in names: treat as a word — `HttpClient`, not `HTTPClient`; `apiUrl`, not `APIUrl`
|
|
23
|
+
2. Event handlers: prefix with `handle` or `on` — `handleSubmit`, `onUserCreated`
|
|
24
|
+
3. Factory functions: prefix with `create` — `createLogger`, `createConnection`
|
|
25
|
+
4. Type guards: prefix with `is` or `has` — `isString`, `hasRole`
|
|
26
|
+
|
|
27
|
+
## For QA Agent
|
|
28
|
+
|
|
29
|
+
Verify all new and modified code follows the naming conventions above. Check:
|
|
30
|
+
|
|
31
|
+
1. File names match kebab-case
|
|
32
|
+
2. Exported symbols match their expected convention
|
|
33
|
+
3. No inconsistencies between similar constructs
|
|
34
|
+
|
|
35
|
+
### Output Format
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
NAMING_VIOLATION:
|
|
39
|
+
- file: <path>
|
|
40
|
+
- line: <line number>
|
|
41
|
+
- symbol: <name>
|
|
42
|
+
- expected: <convention>
|
|
43
|
+
- actual: <what was found>
|
|
44
|
+
- suggestion: <corrected name>
|
|
45
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: naming-conventions
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Enforce consistent naming conventions across the codebase
|
|
4
|
+
agents:
|
|
5
|
+
- dev
|
|
6
|
+
- qa
|
|
7
|
+
priority: 5
|
|
8
|
+
enabled: true
|
|
9
|
+
config:
|
|
10
|
+
files: kebab-case
|
|
11
|
+
functions: camelCase
|
|
12
|
+
classes: PascalCase
|
|
13
|
+
constants: UPPER_SNAKE_CASE
|
|
14
|
+
types: PascalCase
|
|
15
|
+
testFiles: kebab-case
|
|
16
|
+
enforcePrefix: false
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# NestJS Patterns
|
|
2
|
+
|
|
3
|
+
## For Dev Agent
|
|
4
|
+
|
|
5
|
+
Follow NestJS architectural patterns and conventions strictly:
|
|
6
|
+
|
|
7
|
+
### Module structure
|
|
8
|
+
- Every feature MUST have its own module (`*.module.ts`)
|
|
9
|
+
- Module structure: `controller` -> `service` -> `repository/provider`
|
|
10
|
+
- Use `forRoot()`/`forRootAsync()` for configurable modules
|
|
11
|
+
- Use `forFeature()` for feature-specific registrations (e.g., TypeORM entities)
|
|
12
|
+
|
|
13
|
+
### Dependency injection
|
|
14
|
+
- All services MUST be `@Injectable()` and provided through modules
|
|
15
|
+
- Use constructor injection, not property injection
|
|
16
|
+
- Use custom providers (`useFactory`, `useClass`, `useValue`) for complex dependencies
|
|
17
|
+
- Use `@Inject()` with tokens for interface-based injection
|
|
18
|
+
|
|
19
|
+
### Controllers
|
|
20
|
+
- All controllers MUST have at least one guard (`@UseGuards()`) when `requireGuardsOnControllers` is enabled
|
|
21
|
+
- Use `@UsePipes(ValidationPipe)` or global validation pipe when `requireValidationPipe` is enabled
|
|
22
|
+
- Use DTOs with `class-validator` decorators for all request bodies
|
|
23
|
+
- Return consistent response shapes — use interceptors for transformation
|
|
24
|
+
|
|
25
|
+
### Error handling
|
|
26
|
+
- Use NestJS built-in exceptions (`NotFoundException`, `BadRequestException`, etc.)
|
|
27
|
+
- Create custom exceptions extending `HttpException` for domain-specific errors
|
|
28
|
+
- Use exception filters for global error handling
|
|
29
|
+
|
|
30
|
+
### Patterns
|
|
31
|
+
- Use interceptors for cross-cutting concerns (logging, caching, transformation)
|
|
32
|
+
- Use pipes for input validation and transformation
|
|
33
|
+
- Use guards for authorization logic
|
|
34
|
+
- Use middleware for request-level concerns (CORS, rate limiting)
|
|
35
|
+
|
|
36
|
+
## For QA Agent
|
|
37
|
+
|
|
38
|
+
Verify the implementation follows NestJS patterns:
|
|
39
|
+
|
|
40
|
+
1. Each feature has a proper module with declarations
|
|
41
|
+
2. Controllers have guards attached (if configured)
|
|
42
|
+
3. DTOs use class-validator decorators
|
|
43
|
+
4. Services are injectable and properly scoped
|
|
44
|
+
5. No circular dependencies between modules
|
|
45
|
+
|
|
46
|
+
### Output Format
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
NESTJS_VIOLATION:
|
|
50
|
+
- rule: module-structure | dependency-injection | controller-guard | validation-pipe | error-handling | pattern
|
|
51
|
+
- file: <path>
|
|
52
|
+
- line: <line number>
|
|
53
|
+
- description: <what violates the pattern>
|
|
54
|
+
- fix: <how to correct it>
|
|
55
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: nestjs-patterns
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Enforce NestJS architectural patterns and best practices
|
|
4
|
+
agents:
|
|
5
|
+
- dev
|
|
6
|
+
- qa
|
|
7
|
+
priority: 10
|
|
8
|
+
enabled: true
|
|
9
|
+
config:
|
|
10
|
+
enforceModuleStructure: true
|
|
11
|
+
requireGuardsOnControllers: true
|
|
12
|
+
requireValidationPipe: true
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# OWASP Top 10 Security Check
|
|
2
|
+
|
|
3
|
+
## For QA Agent
|
|
4
|
+
|
|
5
|
+
Review all new and modified code against the OWASP Top 10 (2021) categories. For each category, perform the specific checks listed below.
|
|
6
|
+
|
|
7
|
+
### A01 — Broken Access Control
|
|
8
|
+
- Missing authorization checks on endpoints or functions
|
|
9
|
+
- Direct object references without ownership validation
|
|
10
|
+
- Missing CORS configuration or overly permissive CORS
|
|
11
|
+
- Path traversal in file operations
|
|
12
|
+
|
|
13
|
+
### A02 — Cryptographic Failures (Sensitive Data)
|
|
14
|
+
- Hardcoded secrets, passwords, or API keys
|
|
15
|
+
- Weak hashing algorithms (MD5, SHA1 for passwords)
|
|
16
|
+
- Missing encryption for PII or sensitive data at rest/in transit
|
|
17
|
+
- Insufficient key management
|
|
18
|
+
|
|
19
|
+
### A03 — Injection
|
|
20
|
+
- SQL/NoSQL injection via string concatenation or template literals
|
|
21
|
+
- Command injection through `exec`, `spawn` with unsanitized input
|
|
22
|
+
- LDAP, XPath, or expression language injection
|
|
23
|
+
- Missing parameterized queries
|
|
24
|
+
|
|
25
|
+
### A04 — Insecure Design
|
|
26
|
+
- Missing rate limiting on sensitive operations
|
|
27
|
+
- Missing input validation on business logic
|
|
28
|
+
- Race conditions in state-changing operations
|
|
29
|
+
|
|
30
|
+
### A05 — Security Misconfiguration
|
|
31
|
+
- Debug mode enabled in production configs
|
|
32
|
+
- Default credentials or unnecessary features enabled
|
|
33
|
+
- Missing security headers (CSP, X-Frame-Options, HSTS)
|
|
34
|
+
- Verbose error messages exposing internals
|
|
35
|
+
|
|
36
|
+
### A06 — Vulnerable and Outdated Components
|
|
37
|
+
- Known vulnerable dependency versions
|
|
38
|
+
- Unmaintained or deprecated packages
|
|
39
|
+
|
|
40
|
+
### A07 — Identification and Authentication Failures
|
|
41
|
+
- Weak password policies or missing MFA hooks
|
|
42
|
+
- Session tokens in URLs, missing session expiry
|
|
43
|
+
- Missing brute-force protection
|
|
44
|
+
|
|
45
|
+
### A08 — Software and Data Integrity Failures
|
|
46
|
+
- Deserialization of untrusted data (`JSON.parse` on raw user input without schema validation)
|
|
47
|
+
- Missing integrity checks on downloads or CI/CD pipelines
|
|
48
|
+
|
|
49
|
+
### A09 — Security Logging and Monitoring Failures
|
|
50
|
+
- Missing audit logs for authentication events, access control failures, input validation failures
|
|
51
|
+
- Sensitive data in logs (tokens, passwords, PII)
|
|
52
|
+
|
|
53
|
+
### A10 — Server-Side Request Forgery (SSRF)
|
|
54
|
+
- User-controlled URLs passed to `fetch`, `http.get`, or similar without allowlist validation
|
|
55
|
+
- Missing URL scheme restrictions
|
|
56
|
+
|
|
57
|
+
### Output Format
|
|
58
|
+
|
|
59
|
+
For each finding, emit:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
OWASP_FINDING:
|
|
63
|
+
- category: A01 | A02 | A03 | A04 | A05 | A06 | A07 | A08 | A09 | A10
|
|
64
|
+
- severity: critical | high | medium | low
|
|
65
|
+
- file: <path>
|
|
66
|
+
- line: <line number>
|
|
67
|
+
- description: <what the vulnerability is>
|
|
68
|
+
- remediation: <specific fix recommendation>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Flag at least the `high` and `critical` severity findings. Any `critical` finding MUST cause QA to fail.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: owasp-check
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Check code against OWASP Top 10 vulnerability categories
|
|
4
|
+
agents:
|
|
5
|
+
- qa
|
|
6
|
+
priority: 90
|
|
7
|
+
enabled: true
|
|
8
|
+
config:
|
|
9
|
+
severity: high
|
|
10
|
+
categories:
|
|
11
|
+
- injection
|
|
12
|
+
- broken-auth
|
|
13
|
+
- sensitive-data
|
|
14
|
+
- xxe
|
|
15
|
+
- broken-access
|
|
16
|
+
- misconfig
|
|
17
|
+
- xss
|
|
18
|
+
- deserialization
|
|
19
|
+
- components
|
|
20
|
+
- logging
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# React Best Practices
|
|
2
|
+
|
|
3
|
+
## For Dev Agent
|
|
4
|
+
|
|
5
|
+
Follow React best practices and conventions:
|
|
6
|
+
|
|
7
|
+
### Hooks rules
|
|
8
|
+
- Never call hooks inside conditions, loops, or nested functions
|
|
9
|
+
- Custom hooks MUST start with `use` prefix
|
|
10
|
+
- Use `useCallback` for functions passed as props to child components
|
|
11
|
+
- Use `useMemo` for expensive computations, not for every value
|
|
12
|
+
- Prefer `useReducer` over `useState` for complex state logic
|
|
13
|
+
|
|
14
|
+
### Component design
|
|
15
|
+
- Components MUST be under the configured `maxComponentLines` (default: 150 lines)
|
|
16
|
+
- Prefer composition over inheritance — use children, render props, or custom hooks
|
|
17
|
+
- Extract reusable logic into custom hooks
|
|
18
|
+
- Use named exports for components, not default exports
|
|
19
|
+
- Colocate related files: `Component.tsx`, `Component.test.tsx`, `Component.module.css`
|
|
20
|
+
|
|
21
|
+
### Performance
|
|
22
|
+
- Wrap expensive child components with `React.memo()` when props are stable
|
|
23
|
+
- Use `key` prop on all list-rendered elements (no array index as key for dynamic lists)
|
|
24
|
+
- Avoid creating objects/arrays inline in JSX props (creates new references each render)
|
|
25
|
+
- Use lazy loading (`React.lazy` + `Suspense`) for route-level code splitting
|
|
26
|
+
|
|
27
|
+
### Accessibility (when `enforceAccessibility` is enabled)
|
|
28
|
+
- All interactive elements MUST be keyboard accessible
|
|
29
|
+
- All images MUST have `alt` attributes (empty string for decorative images)
|
|
30
|
+
- Use semantic HTML elements (`button`, `nav`, `main`, `article`) over generic `div`
|
|
31
|
+
- Form inputs MUST have associated `label` elements or `aria-label`
|
|
32
|
+
- Color MUST NOT be the only means of conveying information
|
|
33
|
+
- Focus management: modals must trap focus, route changes must announce
|
|
34
|
+
|
|
35
|
+
### State management
|
|
36
|
+
- Keep state as close to where it is used as possible
|
|
37
|
+
- Lift state up only when needed by sibling components
|
|
38
|
+
- Use context for truly global state (theme, auth, locale), not for all shared state
|
|
39
|
+
|
|
40
|
+
## For QA Agent
|
|
41
|
+
|
|
42
|
+
Verify React best practices compliance:
|
|
43
|
+
|
|
44
|
+
1. Hooks usage follows the Rules of Hooks
|
|
45
|
+
2. Components are within size limits
|
|
46
|
+
3. Key props are present on list items
|
|
47
|
+
4. Accessibility requirements are met (if enabled)
|
|
48
|
+
5. No common anti-patterns (prop drilling > 3 levels, state in wrong component)
|
|
49
|
+
|
|
50
|
+
### Output Format
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
REACT_VIOLATION:
|
|
54
|
+
- rule: hooks | composition | performance | accessibility | state-management
|
|
55
|
+
- file: <path>
|
|
56
|
+
- line: <line number>
|
|
57
|
+
- description: <what violates the practice>
|
|
58
|
+
- fix: <how to correct it>
|
|
59
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: react-best-practices
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Enforce React best practices including hooks, composition, and accessibility
|
|
4
|
+
agents:
|
|
5
|
+
- dev
|
|
6
|
+
- qa
|
|
7
|
+
priority: 10
|
|
8
|
+
enabled: true
|
|
9
|
+
config:
|
|
10
|
+
enforceAccessibility: true
|
|
11
|
+
maxComponentLines: 150
|
|
12
|
+
requireKeyProp: true
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Secret Scan
|
|
2
|
+
|
|
3
|
+
## For Dev Agent
|
|
4
|
+
|
|
5
|
+
Before finalizing any code, scan all new and modified files for hardcoded secrets. You MUST NOT commit code containing any of the following:
|
|
6
|
+
|
|
7
|
+
### Patterns to detect
|
|
8
|
+
|
|
9
|
+
1. **API keys**: strings matching `sk-`, `pk-`, `api_key`, `apiKey`, `API_KEY` assignments with literal values
|
|
10
|
+
2. **Tokens**: `ghp_`, `gho_`, `github_pat_`, `xoxb-`, `xoxp-`, Bearer tokens as string literals
|
|
11
|
+
3. **Passwords**: variables named `password`, `passwd`, `secret`, `credential` assigned to string literals
|
|
12
|
+
4. **Private keys**: `-----BEGIN (RSA|EC|DSA|OPENSSH) PRIVATE KEY-----`
|
|
13
|
+
5. **Connection strings**: `postgres://`, `mongodb://`, `redis://`, `mysql://` with embedded credentials
|
|
14
|
+
6. **AWS credentials**: `AKIA`, `aws_secret_access_key`, `aws_access_key_id` with literal values
|
|
15
|
+
7. **Generic high-entropy strings**: 32+ character hex or base64 strings assigned to secret-sounding variables
|
|
16
|
+
|
|
17
|
+
### What to do
|
|
18
|
+
|
|
19
|
+
- Replace hardcoded values with environment variable references: `process.env.API_KEY`
|
|
20
|
+
- Add the variable name to `.env.example` with a placeholder
|
|
21
|
+
- Never log secret values, even at debug level
|
|
22
|
+
|
|
23
|
+
## For QA Agent
|
|
24
|
+
|
|
25
|
+
Scan the entire diff for secrets that the Dev agent may have missed:
|
|
26
|
+
|
|
27
|
+
1. Check all string literals, template literals, and config objects
|
|
28
|
+
2. Look for Base64-encoded secrets that might evade simple pattern matching
|
|
29
|
+
3. Check test fixtures and mock data for real credentials
|
|
30
|
+
4. Verify `.env` files are in `.gitignore`
|
|
31
|
+
|
|
32
|
+
### Output Format
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
SECRET_FINDING:
|
|
36
|
+
- type: api-key | token | password | private-key | connection-string | aws-credential | high-entropy
|
|
37
|
+
- file: <path>
|
|
38
|
+
- line: <line number>
|
|
39
|
+
- pattern: <what matched, redacted>
|
|
40
|
+
- risk: critical
|
|
41
|
+
- remediation: Move to environment variable
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
When `blockOnFind` is enabled (default), ANY secret finding MUST cause QA to fail with `passed: false`.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Slack Notify
|
|
2
|
+
|
|
3
|
+
## For Lead Agent
|
|
4
|
+
|
|
5
|
+
Generate a `SLACK_NOTIFICATION` block for each significant workflow event. The hook system will use this to send Slack messages via the configured webhook.
|
|
6
|
+
|
|
7
|
+
### Events to notify
|
|
8
|
+
|
|
9
|
+
1. **Phase complete**: When an agent finishes its phase successfully
|
|
10
|
+
2. **QA failure**: When QA rejects the implementation (include failure reason)
|
|
11
|
+
3. **Blocked**: When a feature is blocked (include blocking reason and required action)
|
|
12
|
+
4. **Feature complete**: When the entire workflow finishes successfully
|
|
13
|
+
|
|
14
|
+
### Notification format
|
|
15
|
+
|
|
16
|
+
For each event, include in your output:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
SLACK_NOTIFICATION:
|
|
20
|
+
- event: phase_complete | qa_fail | blocked | feature_complete
|
|
21
|
+
- channel: #aiden-notifications
|
|
22
|
+
- feature: <feature slug>
|
|
23
|
+
- summary: <1-2 sentence description of what happened>
|
|
24
|
+
- severity: info | warning | error | success
|
|
25
|
+
- details:
|
|
26
|
+
agent: <agent that completed/failed>
|
|
27
|
+
mode: <flash|standard|enterprise>
|
|
28
|
+
duration: <estimated time if available>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Severity mapping
|
|
32
|
+
|
|
33
|
+
| Event | Severity | Emoji |
|
|
34
|
+
|------------------|----------|--------|
|
|
35
|
+
| phase_complete | info | :gear: |
|
|
36
|
+
| qa_fail | warning | :warning: |
|
|
37
|
+
| blocked | error | :red_circle: |
|
|
38
|
+
| feature_complete | success | :white_check_mark: |
|
|
39
|
+
|
|
40
|
+
### Guidelines
|
|
41
|
+
|
|
42
|
+
- Keep summaries concise — Slack messages should be scannable
|
|
43
|
+
- Include actionable information: what happened, what needs attention
|
|
44
|
+
- For QA failures, include the top 3 issues found
|
|
45
|
+
- For blocked features, include who or what can unblock it
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: slack-notify
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Send Slack notifications for AIDEN workflow events
|
|
4
|
+
agents:
|
|
5
|
+
- lead
|
|
6
|
+
priority: 5
|
|
7
|
+
enabled: true
|
|
8
|
+
config:
|
|
9
|
+
webhookUrlEnv: SLACK_WEBHOOK_URL
|
|
10
|
+
channel: "#aiden-notifications"
|
|
11
|
+
notifyOn:
|
|
12
|
+
- phase_complete
|
|
13
|
+
- qa_fail
|
|
14
|
+
- blocked
|
|
15
|
+
- feature_complete
|
|
16
|
+
hooks:
|
|
17
|
+
on_phase_complete:
|
|
18
|
+
- command: "echo TODO Slack notify"
|
|
19
|
+
onFailure: ignore
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Test Coverage Enforcer
|
|
2
|
+
|
|
3
|
+
## For Dev Agent
|
|
4
|
+
|
|
5
|
+
When generating or modifying code, you MUST also generate corresponding tests that cover:
|
|
6
|
+
|
|
7
|
+
- **All branches**: every `if/else`, `switch` case, ternary, and `??`/`||` fallback
|
|
8
|
+
- **All error paths**: catch blocks, thrown exceptions, rejected promises, validation failures
|
|
9
|
+
- **Edge cases**: empty inputs, null/undefined, boundary values, large datasets
|
|
10
|
+
- **Integration points**: any function that calls external services or other modules
|
|
11
|
+
|
|
12
|
+
### Rules
|
|
13
|
+
|
|
14
|
+
1. Every new file with logic MUST have a corresponding `.test.ts` file
|
|
15
|
+
2. Every new public function MUST have at least one happy-path and one error-path test
|
|
16
|
+
3. Exclude from coverage enforcement: files matching `*.d.ts`, `index.ts` (barrel exports), `types.ts`
|
|
17
|
+
4. Use descriptive test names: `it('should throw ValidationError when email is empty')`
|
|
18
|
+
5. Mock external dependencies — tests must be deterministic
|
|
19
|
+
|
|
20
|
+
## For QA Agent
|
|
21
|
+
|
|
22
|
+
Estimate the test coverage ratio for all new and modified files:
|
|
23
|
+
|
|
24
|
+
1. List every branch, function, and code path in the changed files
|
|
25
|
+
2. Check which ones are covered by the generated tests
|
|
26
|
+
3. Compute an estimated coverage percentage (lines covered / total lines with logic)
|
|
27
|
+
4. **FAIL the review** if estimated coverage is below the configured `minCoverage` threshold (default: 80%)
|
|
28
|
+
|
|
29
|
+
### Output Format
|
|
30
|
+
|
|
31
|
+
For each file reviewed, emit:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
COVERAGE_REPORT:
|
|
35
|
+
- file: <path>
|
|
36
|
+
- estimatedCoverage: <percentage>
|
|
37
|
+
- uncoveredPaths:
|
|
38
|
+
- <description of untested branch or function>
|
|
39
|
+
- status: pass | fail
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If any file has `status: fail`, the overall QA verdict MUST be `passed: false` with a clear explanation of what tests are missing.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: test-coverage-enforcer
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Enforce minimum test coverage on new and modified code
|
|
4
|
+
agents:
|
|
5
|
+
- dev
|
|
6
|
+
- qa
|
|
7
|
+
modes:
|
|
8
|
+
- standard
|
|
9
|
+
- enterprise
|
|
10
|
+
priority: 15
|
|
11
|
+
enabled: true
|
|
12
|
+
config:
|
|
13
|
+
minCoverage: 80
|
|
14
|
+
enforceOnNewFiles: true
|
|
15
|
+
excludePatterns:
|
|
16
|
+
- "*.d.ts"
|
|
17
|
+
- "index.ts"
|
|
18
|
+
- "types.ts"
|