@baselane/packs 0.1.3 → 0.1.5

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.
Files changed (91) hide show
  1. package/dist/aliases.js +1 -0
  2. package/package.json +2 -2
  3. package/packs/database-review/pack.json +75 -9
  4. package/packs/database-review/rendered/.claude/agents/database-reviewer.md +75 -2
  5. package/packs/database-review/rendered/.claude/commands/migration-review.md +6 -0
  6. package/packs/database-review/rendered/.claude/settings.json +11 -0
  7. package/packs/database-review/rendered/.claude/skills/database-migrations/SKILL.md +431 -0
  8. package/packs/database-review/rendered/.claude/skills/mysql-patterns/SKILL.md +414 -0
  9. package/packs/database-review/rendered/.claude/skills/postgres-patterns/SKILL.md +149 -0
  10. package/packs/database-review/rendered/.github/copilot-instructions.md +1096 -14
  11. package/packs/database-review/rendered/AGENTS.md +45 -16
  12. package/packs/database-review/rendered/CLAUDE.md +4 -0
  13. package/packs/database-review/rendered/GEMINI.md +987 -0
  14. package/packs/go-rules/pack.json +65 -9
  15. package/packs/go-rules/rendered/.claude/agents/go-build-resolver.md +90 -0
  16. package/packs/go-rules/rendered/.claude/agents/go-reviewer.md +72 -2
  17. package/packs/go-rules/rendered/.claude/commands/go-build.md +6 -0
  18. package/packs/go-rules/rendered/.claude/commands/go-review.md +1 -1
  19. package/packs/go-rules/rendered/.claude/commands/go-test.md +6 -0
  20. package/packs/go-rules/rendered/.claude/settings.json +9 -0
  21. package/packs/go-rules/rendered/.claude/skills/golang-patterns/SKILL.md +673 -0
  22. package/packs/go-rules/rendered/.claude/skills/golang-testing/SKILL.md +719 -0
  23. package/packs/go-rules/rendered/.github/copilot-instructions.md +1783 -7
  24. package/packs/go-rules/rendered/AGENTS.md +244 -8
  25. package/packs/go-rules/rendered/CLAUDE.md +5 -0
  26. package/packs/go-rules/rendered/GEMINI.md +1394 -0
  27. package/packs/python-rules/pack.json +87 -10
  28. package/packs/python-rules/rendered/.claude/agents/django-reviewer.md +159 -0
  29. package/packs/python-rules/rendered/.claude/agents/fastapi-reviewer.md +70 -0
  30. package/packs/python-rules/rendered/.claude/agents/python-reviewer.md +92 -2
  31. package/packs/python-rules/rendered/.claude/commands/django-review.md +6 -0
  32. package/packs/python-rules/rendered/.claude/commands/fastapi-review.md +6 -0
  33. package/packs/python-rules/rendered/.claude/commands/python-review.md +1 -1
  34. package/packs/python-rules/rendered/.claude/settings.json +1 -1
  35. package/packs/python-rules/rendered/.claude/skills/django-security/SKILL.md +642 -0
  36. package/packs/python-rules/rendered/.claude/skills/django-tdd/SKILL.md +728 -0
  37. package/packs/python-rules/rendered/.claude/skills/fastapi-patterns/SKILL.md +512 -0
  38. package/packs/python-rules/rendered/.claude/skills/python-patterns/SKILL.md +749 -0
  39. package/packs/python-rules/rendered/.claude/skills/python-testing/SKILL.md +815 -0
  40. package/packs/python-rules/rendered/.github/copilot-instructions.md +3815 -12
  41. package/packs/python-rules/rendered/AGENTS.md +73 -13
  42. package/packs/python-rules/rendered/CLAUDE.md +9 -0
  43. package/packs/python-rules/rendered/GEMINI.md +3448 -0
  44. package/packs/security-review/pack.json +51 -7
  45. package/packs/security-review/rendered/.claude/agents/security-reviewer.md +29 -2
  46. package/packs/security-review/rendered/.claude/settings.json +11 -0
  47. package/packs/security-review/rendered/.claude/skills/security-review/SKILL.md +302 -0
  48. package/packs/security-review/rendered/.claude/skills/security-review/cloud-infrastructure-security.md +171 -0
  49. package/packs/security-review/rendered/.claude/skills/security-scan-config/SKILL.md +56 -0
  50. package/packs/security-review/rendered/.github/copilot-instructions.md +658 -15
  51. package/packs/security-review/rendered/AGENTS.md +283 -17
  52. package/packs/security-review/rendered/CLAUDE.md +2 -0
  53. package/packs/security-review/rendered/GEMINI.md +352 -0
  54. package/packs/software-engineer-harness/pack.json +249 -13
  55. package/packs/software-engineer-harness/rendered/.claude/agents/build-error-resolver.md +15 -0
  56. package/packs/software-engineer-harness/rendered/.claude/agents/code-explorer.md +67 -0
  57. package/packs/software-engineer-harness/rendered/.claude/agents/performance-optimizer.md +444 -0
  58. package/packs/software-engineer-harness/rendered/.claude/agents/pr-test-analyzer.md +43 -0
  59. package/packs/software-engineer-harness/rendered/.claude/agents/refactor-cleaner.md +12 -0
  60. package/packs/software-engineer-harness/rendered/.claude/agents/silent-failure-hunter.md +16 -0
  61. package/packs/software-engineer-harness/rendered/.claude/agents/tdd-guide.md +16 -0
  62. package/packs/software-engineer-harness/rendered/.claude/commands/feature-dev.md +6 -0
  63. package/packs/software-engineer-harness/rendered/.claude/commands/fix-build.md +6 -0
  64. package/packs/software-engineer-harness/rendered/.claude/commands/hunt-silent-failures.md +6 -0
  65. package/packs/software-engineer-harness/rendered/.claude/commands/tdd.md +6 -0
  66. package/packs/software-engineer-harness/rendered/.claude/settings.json +29 -0
  67. package/packs/software-engineer-harness/rendered/.claude/skills/api-design/SKILL.md +522 -0
  68. package/packs/software-engineer-harness/rendered/.claude/skills/architecture-decision-records/SKILL.md +178 -0
  69. package/packs/software-engineer-harness/rendered/.claude/skills/backend-patterns/SKILL.md +560 -0
  70. package/packs/software-engineer-harness/rendered/.claude/skills/codebase-onboarding/SKILL.md +232 -0
  71. package/packs/software-engineer-harness/rendered/.claude/skills/deployment-patterns/SKILL.md +426 -0
  72. package/packs/software-engineer-harness/rendered/.claude/skills/docker-patterns/SKILL.md +363 -0
  73. package/packs/software-engineer-harness/rendered/.claude/skills/e2e-testing/SKILL.md +325 -0
  74. package/packs/software-engineer-harness/rendered/.claude/skills/tdd-red-green-refactor/SKILL.md +20 -0
  75. package/packs/software-engineer-harness/rendered/.claude/skills/tdd-workflow/SKILL.md +580 -0
  76. package/packs/software-engineer-harness/rendered/.github/copilot-instructions.md +3948 -2
  77. package/packs/software-engineer-harness/rendered/AGENTS.md +194 -4
  78. package/packs/software-engineer-harness/rendered/CLAUDE.md +20 -0
  79. package/packs/software-engineer-harness/rendered/GEMINI.md +3208 -0
  80. package/packs/typescript-rules/pack.json +68 -5
  81. package/packs/typescript-rules/rendered/.claude/agents/react-reviewer.md +165 -0
  82. package/packs/typescript-rules/rendered/.claude/agents/type-design-analyzer.md +48 -0
  83. package/packs/typescript-rules/rendered/.claude/commands/react-review.md +6 -0
  84. package/packs/typescript-rules/rendered/.claude/settings.json +9 -0
  85. package/packs/typescript-rules/rendered/.claude/skills/react-patterns/SKILL.md +340 -0
  86. package/packs/typescript-rules/rendered/.claude/skills/react-performance/SKILL.md +573 -0
  87. package/packs/typescript-rules/rendered/.claude/skills/react-testing/SKILL.md +422 -0
  88. package/packs/typescript-rules/rendered/.github/copilot-instructions.md +2459 -53
  89. package/packs/typescript-rules/rendered/AGENTS.md +893 -17
  90. package/packs/typescript-rules/rendered/CLAUDE.md +6 -0
  91. package/packs/typescript-rules/rendered/GEMINI.md +1335 -0
@@ -0,0 +1,171 @@
1
+ # Cloud & infrastructure security
2
+
3
+ Use when deploying to cloud platforms, configuring infrastructure, managing IAM policies, setting up logging/monitoring, or implementing CI/CD pipelines.
4
+
5
+ ## When to activate
6
+
7
+ - Deploying applications to cloud platforms
8
+ - Configuring IAM roles and permissions
9
+ - Setting up CI/CD pipelines
10
+ - Implementing infrastructure as code (Terraform, CloudFormation)
11
+ - Configuring logging and monitoring
12
+ - Managing secrets in cloud environments
13
+ - Setting up CDN and edge security
14
+ - Implementing disaster recovery and backup strategies
15
+
16
+ ## IAM & access control
17
+
18
+ Principle of least privilege:
19
+
20
+ ```yaml
21
+ # PASS
22
+ iam_role:
23
+ permissions: [s3:GetObject, s3:ListBucket]
24
+ resources: [arn:aws:s3:::my-bucket/*]
25
+
26
+ # FAIL
27
+ iam_role:
28
+ permissions: [s3:*]
29
+ resources: ["*"]
30
+ ```
31
+
32
+ Verify: no root account usage in production · MFA enabled for all privileged accounts · service accounts use roles, not long-lived credentials · IAM policies follow least privilege · regular access reviews · unused credentials rotated or removed.
33
+
34
+ ## Secrets management
35
+
36
+ ```typescript
37
+ // PASS — cloud secrets manager
38
+ import { SecretsManager } from '@aws-sdk/client-secrets-manager'
39
+ const client = new SecretsManager({ region: 'us-east-1' })
40
+ const secret = await client.getSecretValue({ SecretId: 'prod/api-key' })
41
+
42
+ // FAIL — env var only, not rotated, not audited, for a long-lived production credential
43
+ const apiKey = process.env.API_KEY
44
+ ```
45
+
46
+ Verify: secrets in a cloud secrets manager · automatic rotation for database credentials · API keys rotated at least quarterly · no secrets in code, logs, or error messages · audit logging on secret access.
47
+
48
+ ## Network security
49
+
50
+ ```terraform
51
+ # PASS — restricted security group
52
+ resource "aws_security_group" "app" {
53
+ ingress { from_port = 443; to_port = 443; protocol = "tcp"; cidr_blocks = ["10.0.0.0/16"] }
54
+ egress { from_port = 443; to_port = 443; protocol = "tcp"; cidr_blocks = ["0.0.0.0/0"] }
55
+ }
56
+
57
+ # FAIL — open to the internet
58
+ resource "aws_security_group" "bad" {
59
+ ingress { from_port = 0; to_port = 65535; protocol = "tcp"; cidr_blocks = ["0.0.0.0/0"] }
60
+ }
61
+ ```
62
+
63
+ Verify: database not publicly accessible · SSH/RDP restricted to VPN/bastion · security groups follow least privilege · network ACLs configured · VPC flow logs enabled.
64
+
65
+ ## Logging & monitoring
66
+
67
+ Log security events with enough structure to alert on, never with sensitive payloads:
68
+
69
+ ```typescript
70
+ const logSecurityEvent = async (event: SecurityEvent) => {
71
+ await cloudwatch.putLogEvents({
72
+ logGroupName: '/aws/security/events',
73
+ logStreamName: 'authentication',
74
+ logEvents: [{ timestamp: Date.now(), message: JSON.stringify({
75
+ type: event.type, userId: event.userId, ip: event.ip, result: event.result
76
+ // never log sensitive data
77
+ }) }]
78
+ })
79
+ }
80
+ ```
81
+
82
+ Verify: logging enabled for all services · failed auth attempts logged · admin actions audited · retention configured (90+ days for compliance) · alerts on suspicious activity · logs centralized and tamper-proof.
83
+
84
+ ## CI/CD pipeline security
85
+
86
+ ```yaml
87
+ name: Deploy
88
+ on: { push: { branches: [main] } }
89
+ jobs:
90
+ deploy:
91
+ runs-on: ubuntu-latest
92
+ permissions: { contents: read } # minimal permissions
93
+ steps:
94
+ - uses: actions/checkout@v4
95
+ - name: Secret scanning
96
+ uses: trufflesecurity/trufflehog@main
97
+ - name: Audit dependencies
98
+ run: npm audit --audit-level=high
99
+ - name: Configure AWS credentials # OIDC, not long-lived tokens
100
+ uses: aws-actions/configure-aws-credentials@v4
101
+ with: { role-to-assume: "arn:aws:iam::123456789:role/GitHubActionsRole", aws-region: us-east-1 }
102
+ ```
103
+
104
+ Verify: OIDC instead of long-lived credentials · secrets scanning in the pipeline · dependency vulnerability scanning · container image scanning where applicable · branch protection enforced · review required before merge · signed commits enforced where the project requires it.
105
+
106
+ ## CDN & edge security
107
+
108
+ ```typescript
109
+ export default {
110
+ async fetch(request: Request): Promise<Response> {
111
+ const response = await fetch(request)
112
+ const headers = new Headers(response.headers)
113
+ headers.set('X-Frame-Options', 'DENY')
114
+ headers.set('X-Content-Type-Options', 'nosniff')
115
+ headers.set('Referrer-Policy', 'strict-origin-when-cross-origin')
116
+ headers.set('Permissions-Policy', 'geolocation=(), microphone=()')
117
+ return new Response(response.body, { status: response.status, headers })
118
+ }
119
+ }
120
+ ```
121
+
122
+ Verify: WAF enabled with a managed ruleset · rate limiting configured at the edge · bot protection active · DDoS protection enabled · security headers configured · TLS strict mode enabled.
123
+
124
+ ## Backup & disaster recovery
125
+
126
+ ```terraform
127
+ resource "aws_db_instance" "main" {
128
+ backup_retention_period = 30
129
+ backup_window = "03:00-04:00"
130
+ deletion_protection = true
131
+ }
132
+ ```
133
+
134
+ Verify: automated daily backups · retention meets compliance requirements · point-in-time recovery enabled · backup restore tested quarterly · disaster recovery plan documented · RPO/RTO defined and tested.
135
+
136
+ ## Common cloud misconfigurations
137
+
138
+ ```bash
139
+ # FAIL — public bucket
140
+ aws s3api put-bucket-acl --bucket my-bucket --acl public-read
141
+ # PASS — private bucket, explicit policy
142
+ aws s3api put-bucket-acl --bucket my-bucket --acl private
143
+ ```
144
+
145
+ ```terraform
146
+ # FAIL
147
+ resource "aws_db_instance" "bad" { publicly_accessible = true }
148
+ # PASS
149
+ resource "aws_db_instance" "good" { publicly_accessible = false }
150
+ ```
151
+
152
+ ## Pre-deployment cloud checklist
153
+
154
+ - [ ] IAM: root unused, MFA enabled, least-privilege policies
155
+ - [ ] Secrets: cloud secrets manager with rotation
156
+ - [ ] Network: security groups restricted, no public databases
157
+ - [ ] Logging: enabled with retention
158
+ - [ ] Monitoring: alerts configured for anomalies
159
+ - [ ] CI/CD: OIDC auth, secrets scanning, dependency audits
160
+ - [ ] CDN/WAF: enabled with a managed ruleset
161
+ - [ ] Encryption: data encrypted at rest and in transit
162
+ - [ ] Backups: automated with tested recovery
163
+ - [ ] Compliance: applicable requirements (GDPR/HIPAA/etc.) met
164
+ - [ ] Documentation: infrastructure documented, runbooks created
165
+ - [ ] Incident response plan in place
166
+
167
+ ## Resources
168
+
169
+ - [AWS Security Best Practices](https://aws.amazon.com/security/best-practices/)
170
+ - [CIS AWS Foundations Benchmark](https://www.cisecurity.org/benchmark/amazon_web_services)
171
+ - [OWASP Cloud Security](https://owasp.org/www-project-cloud-security/)
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: security-scan-config
3
+ description: Scan this project's AI-harness configuration (settings, CLAUDE.md/AGENTS.md, MCP servers, hooks, agent definitions) for secrets, dangerous permission bypasses, and prompt-injection risk — before committing configuration changes.
4
+ license: MIT
5
+ ---
6
+
7
+ <!-- adapted from affaan-m/ECC (Everything Claude Code) (MIT) — https://github.com/affaan-m/ECC -->
8
+
9
+ # Security scan (harness configuration)
10
+
11
+ Scan this project's AI-harness configuration (`.claude/` or equivalent) for security misconfigurations and prompt-injection risk — a separate concern from application code, but part of the same trust boundary in an AI-assisted repo.
12
+
13
+ ## When to activate
14
+
15
+ - Setting up a new AI-harness project configuration
16
+ - After modifying `settings.json`, `CLAUDE.md`/`AGENTS.md`, or MCP server configs
17
+ - Before committing configuration changes
18
+ - When onboarding to a repo with an existing harness configuration
19
+ - Periodic security hygiene checks
20
+
21
+ ## What to review
22
+
23
+ | File | Checks |
24
+ | --- | --- |
25
+ | `CLAUDE.md` / `AGENTS.md` | Hardcoded secrets, auto-run instructions embedded in project docs, prompt-injection patterns |
26
+ | `settings.json` | Overly permissive allow lists, missing deny lists, dangerous bypass flags (e.g. skip-permissions) |
27
+ | MCP server config | Risky/unaudited servers, hardcoded secrets in server env, unpinned `npx`-style install-on-run entries |
28
+ | hooks | Command injection via unescaped interpolation into a shell command, silent error suppression (`2>/dev/null`, `\|\| true`), unexplained outbound network calls |
29
+ | agent definitions | Unrestricted tool access (e.g. unconditional Bash) where the task doesn't need it, missing model spec, prompt-injection surface from untrusted inputs |
30
+
31
+ ## Manual scan (portable, no extra tooling)
32
+
33
+ ```bash
34
+ # hardcoded-looking secrets in harness config
35
+ grep -rEn '(api[_-]?key|secret|token|password)\s*[:=]\s*["\x27][A-Za-z0-9/+=_-]{12,}' .claude/ CLAUDE.md AGENTS.md 2>/dev/null
36
+
37
+ # unrestricted shell / dangerous bypass flags
38
+ grep -rn 'Bash(\*)\|dangerously-skip-permissions\|--no-verify' .claude/settings*.json 2>/dev/null
39
+
40
+ # hook commands that interpolate a file path or tool output directly into a shell string
41
+ grep -rn '${.*}|$(.*)' .claude/settings*.json 2>/dev/null | grep -i hook
42
+
43
+ # silent error suppression in hooks (hides a failing check rather than fixing it)
44
+ grep -rn '2>/dev/null\|\|\| true' .claude/settings*.json 2>/dev/null
45
+ ```
46
+
47
+ ## Severity levels
48
+
49
+ - **CRITICAL** — hardcoded API keys/tokens in config; `Bash(*)` (or equivalent unrestricted shell) in the allow list; command injection in a hook via unescaped interpolation; a shell-executing MCP server with no scoping.
50
+ - **HIGH** — auto-run instructions embedded in project docs (a prompt-injection vector any collaborator's harness will read); missing deny lists on sensitive paths (`~/.ssh`, `~/.aws`, `.env*`); an agent with Bash access it doesn't need for its stated task.
51
+ - **MEDIUM** — silent error suppression in hooks; missing a pre-tool-use security hook on Bash; unpinned install-on-run entries in MCP server config.
52
+ - **INFO** — missing descriptions on MCP servers or agents; explicit prohibitive instructions correctly present (flag as good practice, not a finding).
53
+
54
+ ## Resources
55
+
56
+ - [OWASP MCP Top 10](https://owasp.org/) — tool poisoning, prompt injection via contextual payloads, command injection, shadow MCP servers, secret exposure.