@acmeacmeio/setup-sh 0.2.6

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 (32) hide show
  1. package/README.md +212 -0
  2. package/package.json +39 -0
  3. package/src/cli.mjs +614 -0
  4. package/templates/.claude/agents/code-simplifier.md +52 -0
  5. package/templates/.claude/commands/auto.md +85 -0
  6. package/templates/.claude/commands/clean-copy.md +93 -0
  7. package/templates/.claude/commands/fix-issue.md +34 -0
  8. package/templates/.claude/commands/review.md +46 -0
  9. package/templates/.claude/router/classify.js +241 -0
  10. package/templates/.claude/router/registry.json +49 -0
  11. package/templates/.claude/settings.json +113 -0
  12. package/templates/.claude/skills/api-design/SKILL.md +77 -0
  13. package/templates/.claude/skills/security-review/SKILL.md +65 -0
  14. package/templates/.codex/config.toml +31 -0
  15. package/templates/.codex/skills/api-design/SKILL.md +77 -0
  16. package/templates/.codex/skills/security-review/SKILL.md +65 -0
  17. package/templates/.cursor/commands/auto.md +55 -0
  18. package/templates/.cursor/commands/clean-copy.md +80 -0
  19. package/templates/.cursor/commands/code-simplifier.md +28 -0
  20. package/templates/.cursor/commands/fix-issue.md +28 -0
  21. package/templates/.cursor/commands/review.md +41 -0
  22. package/templates/.cursor/hooks.json +11 -0
  23. package/templates/.cursor/rules/api-design.mdc +80 -0
  24. package/templates/.cursor/rules/git-workflow.mdc +73 -0
  25. package/templates/.cursor/rules/security.mdc +69 -0
  26. package/templates/.cursor/rules/tdd.mdc +35 -0
  27. package/templates/.cursor/rules/typescript.mdc +82 -0
  28. package/templates/.cursorignore.template +20 -0
  29. package/templates/.gitignore.template +10 -0
  30. package/templates/.mcp.json +16 -0
  31. package/templates/AGENTS.md +118 -0
  32. package/templates/CLAUDE.md +138 -0
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: Git workflow and conventional commits
3
+ globs: []
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Git Workflow
8
+
9
+ ## Branches
10
+
11
+ - `main`: Production-ready code
12
+ - `dev`: Integration branch for features
13
+
14
+ ## Conventional Commits
15
+
16
+ Use conventional commit format:
17
+
18
+ ```
19
+ <type>: <description>
20
+
21
+ [optional body]
22
+
23
+ [optional footer]
24
+ ```
25
+
26
+ ### Types
27
+
28
+ | Type | Usage |
29
+ | ---------- | ------------------------------ |
30
+ | `feat` | New feature |
31
+ | `fix` | Bug fix |
32
+ | `docs` | Documentation only |
33
+ | `refactor` | Code change (no feature/fix) |
34
+ | `test` | Adding/updating tests |
35
+ | `chore` | Build, tooling, dependencies |
36
+ | `perf` | Performance improvement |
37
+ | `style` | Formatting (no logic change) |
38
+
39
+ ### Examples
40
+
41
+ ```bash
42
+ feat: add user authentication
43
+ fix: resolve null pointer in user lookup
44
+ docs: update API documentation
45
+ refactor: extract validation logic to utils
46
+ test: add integration tests for auth flow
47
+ chore: update dependencies
48
+ ```
49
+
50
+ ## Pull Requests
51
+
52
+ - Keep PRs small and focused (ideally < 400 lines)
53
+ - Reference issues: `Fixes #123`
54
+ - All PRs require review before merge
55
+ - Use draft PRs for work in progress
56
+
57
+ ## Commit Message Guidelines
58
+
59
+ - Use imperative mood: "add feature" not "added feature"
60
+ - First line < 72 characters
61
+ - Explain "why" in body, not just "what"
62
+ - Reference issues when applicable
63
+
64
+ ## Branch Naming
65
+
66
+ ```
67
+ <type>/<short-description>
68
+ ```
69
+
70
+ Examples:
71
+ - `feat/user-authentication`
72
+ - `fix/login-redirect-loop`
73
+ - `refactor/extract-validation`
@@ -0,0 +1,69 @@
1
+ ---
2
+ description: Security review checklist for code audits
3
+ globs: []
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Security Review Checklist
8
+
9
+ ## Authentication
10
+
11
+ - [ ] Tokens are validated on every request
12
+ - [ ] Passwords are hashed with bcrypt or argon2 (not MD5/SHA1)
13
+ - [ ] Sessions expire appropriately
14
+ - [ ] Password reset tokens are single-use and time-limited
15
+ - [ ] Multi-factor authentication where appropriate
16
+
17
+ ## Authorization
18
+
19
+ - [ ] Users can only access their own data
20
+ - [ ] Admin endpoints require admin role
21
+ - [ ] API keys are scoped appropriately
22
+ - [ ] Role checks happen server-side, not just client
23
+ - [ ] Sensitive operations require re-authentication
24
+
25
+ ## Input Validation
26
+
27
+ - [ ] All user input is validated (Zod schemas at boundaries)
28
+ - [ ] SQL queries use parameterized statements
29
+ - [ ] File uploads are restricted by type and size
30
+ - [ ] URLs and redirects are validated against allowlist
31
+ - [ ] HTML output is escaped to prevent XSS
32
+
33
+ ## Secrets Management
34
+
35
+ - [ ] No hardcoded credentials in code
36
+ - [ ] Environment variables for all secrets
37
+ - [ ] .env files are gitignored
38
+ - [ ] Secrets rotated regularly
39
+ - [ ] Different credentials per environment
40
+
41
+ ## Data Protection
42
+
43
+ - [ ] Sensitive data encrypted at rest
44
+ - [ ] HTTPS enforced in production
45
+ - [ ] Passwords never logged
46
+ - [ ] PII minimized and access-controlled
47
+ - [ ] Data retention policies enforced
48
+
49
+ ## Error Handling
50
+
51
+ - [ ] No stack traces in production responses
52
+ - [ ] Generic error messages to users
53
+ - [ ] Detailed errors logged server-side
54
+ - [ ] Failed login attempts rate-limited
55
+
56
+ ## Dependencies
57
+
58
+ - [ ] Dependencies regularly updated
59
+ - [ ] Known vulnerabilities addressed (npm audit)
60
+ - [ ] Minimal dependencies (smaller attack surface)
61
+ - [ ] Lock files committed (package-lock.json)
62
+
63
+ ## Common Vulnerabilities
64
+
65
+ 1. **SQL Injection**: Use parameterized queries
66
+ 2. **XSS**: Escape HTML output, use CSP headers
67
+ 3. **CSRF**: Use CSRF tokens for state-changing requests
68
+ 4. **IDOR**: Verify user owns the resource they're accessing
69
+ 5. **Secrets in Code**: Use environment variables
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Test-Driven Development methodology enforcement
3
+ globs: []
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # TDD: Mandatory
8
+
9
+ All new code follows Test-Driven Development:
10
+
11
+ 1. **Red**: Write a failing test first
12
+ 2. **Green**: Write minimal code to pass
13
+ 3. **Refactor**: Clean up while tests stay green
14
+
15
+ ## Workflow
16
+
17
+ When implementing any feature or fix:
18
+
19
+ 1. **Before writing production code**: Create a test file or add a test case that defines the expected behavior
20
+ 2. **Run the test**: Confirm it fails for the right reason
21
+ 3. **Write minimal implementation**: Just enough code to make the test pass
22
+ 4. **Run all tests**: Ensure no regressions
23
+ 5. **Refactor if needed**: Improve code quality while keeping tests green
24
+
25
+ ## Test File Conventions
26
+
27
+ - Place tests next to source files: `foo.ts` -> `foo.test.ts`
28
+ - Or use `__tests__/` directory at package root
29
+ - Use descriptive test names: `it('returns null when user not found')`
30
+
31
+ ## Key Principles
32
+
33
+ - Never write production code without a failing test
34
+ - Each commit should have the test and implementation together
35
+ - Test behavior, not implementation details
@@ -0,0 +1,82 @@
1
+ ---
2
+ description: TypeScript strict mode patterns
3
+ globs:
4
+ - "**/*.ts"
5
+ - "**/*.tsx"
6
+ alwaysApply: false
7
+ ---
8
+
9
+ # TypeScript Patterns
10
+
11
+ ## Strict Mode Configuration
12
+
13
+ ```json
14
+ {
15
+ "compilerOptions": {
16
+ "strict": true,
17
+ "noUncheckedIndexedAccess": true,
18
+ "noImplicitReturns": true,
19
+ "noFallthroughCasesInSwitch": true
20
+ }
21
+ }
22
+ ```
23
+
24
+ ## Naming Conventions
25
+
26
+ ### Explicit, No Abbreviations
27
+
28
+ ```typescript
29
+ // Bad
30
+ const usr = getUsr(req.params.id);
31
+ const btn = document.querySelector('.btn');
32
+
33
+ // Good
34
+ const user = getUser(req.params.userId);
35
+ const button = document.querySelector('.button');
36
+ ```
37
+
38
+ ## Types: Always Explicit
39
+
40
+ ```typescript
41
+ // Bad
42
+ function processData(data: any): any { ... }
43
+ const items = [];
44
+
45
+ // Good
46
+ function processUser(user: User): ProcessedUser { ... }
47
+ const items: Item[] = [];
48
+ ```
49
+
50
+ ## Avoid Type Assertions
51
+
52
+ ```typescript
53
+ // Bad
54
+ const user = response.data as User;
55
+
56
+ // Good
57
+ const user = parseUser(response.data); // with runtime validation
58
+ ```
59
+
60
+ ## Use Union Types Over Enums
61
+
62
+ ```typescript
63
+ // Prefer
64
+ type Status = 'pending' | 'active' | 'completed';
65
+
66
+ // Over
67
+ enum Status { Pending, Active, Completed }
68
+ ```
69
+
70
+ ## Handle Null/Undefined Properly
71
+
72
+ ```typescript
73
+ // Bad
74
+ function getUser(id: string) {
75
+ return users.find(u => u.id === id)!; // Non-null assertion
76
+ }
77
+
78
+ // Good
79
+ function getUser(id: string): User | undefined {
80
+ return users.find(u => u.id === id);
81
+ }
82
+ ```
@@ -0,0 +1,20 @@
1
+ # Environment and secrets
2
+ .env
3
+ .env.*
4
+ *.pem
5
+ *.key
6
+
7
+ # Build artifacts
8
+ dist/
9
+ build/
10
+ node_modules/
11
+
12
+ # IDE local files
13
+ *.local.md
14
+ *.local.json
15
+ *.local.toml
16
+
17
+ # Large files
18
+ *.log
19
+ *.sql
20
+ *.sqlite
@@ -0,0 +1,10 @@
1
+ # Claude Code (local overrides)
2
+ .claude/settings.local.json
3
+ CLAUDE.local.md
4
+
5
+ # Codex (local overrides)
6
+ .codex/config.local.toml
7
+ AGENTS.local.md
8
+
9
+ # Cursor (local overrides)
10
+ .cursor/settings.local.json
@@ -0,0 +1,16 @@
1
+ {
2
+ "mcpServers": {
3
+ "github": {
4
+ "command": "npx",
5
+ "args": ["-y", "@modelcontextprotocol/server-github"],
6
+ "env": {
7
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
8
+ }
9
+ },
10
+ "sequential-thinking": {
11
+ "command": "npx",
12
+ "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"],
13
+ "env": {}
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,118 @@
1
+ # Team Standards
2
+
3
+ ## Development Methodology
4
+
5
+ ### TDD: Mandatory
6
+
7
+ All new code follows Test-Driven Development:
8
+
9
+ 1. **Red**: Write a failing test first
10
+ 2. **Green**: Write minimal code to pass
11
+ 3. **Refactor**: Clean up while tests stay green
12
+
13
+ TDD is enforced through the `test-driven-development` skill (installed from `obra/superpowers`). When writing new code, always use this skill to ensure proper Red-Green-Refactor workflow.
14
+
15
+ ### TypeScript: Strict Mode
16
+
17
+ ```json
18
+ {
19
+ "compilerOptions": {
20
+ "strict": true,
21
+ "noUncheckedIndexedAccess": true,
22
+ "noImplicitReturns": true,
23
+ "noFallthroughCasesInSwitch": true
24
+ }
25
+ }
26
+ ```
27
+
28
+ ### ESLint: Strict Defaults
29
+
30
+ Use ESLint with strict defaults. No custom rule overrides unless documented in this file.
31
+
32
+ ## Code Style
33
+
34
+ ### Legacy Code: Gradual Fix
35
+
36
+ - Fix only code you touch (new or changed files)
37
+ - Don't rewrite working legacy code unprompted
38
+ - Leave existing patterns alone if not in scope
39
+
40
+ ### Naming: Explicit, No Abbreviations
41
+
42
+ ```typescript
43
+ // Bad
44
+ const usr = getUsr(req.params.id);
45
+
46
+ // Good
47
+ const user = getUser(req.params.userId);
48
+ ```
49
+
50
+ ### Types: Always Explicit
51
+
52
+ ```typescript
53
+ // Bad
54
+ function processData(data: any): any { ... }
55
+
56
+ // Good
57
+ function processUser(user: User): ProcessedUser { ... }
58
+ ```
59
+
60
+ ## API Style
61
+
62
+ ### REST + Zod
63
+
64
+ - Use RESTful routes: GET/POST/PUT/PATCH/DELETE
65
+ - Validate all inputs with Zod schemas at boundaries
66
+ - Response format: `{ data: T }` or `{ error: string }`
67
+
68
+ ### Error Handling: Typed Error Classes
69
+
70
+ ```typescript
71
+ class ValidationError extends Error {
72
+ constructor(
73
+ public field: string,
74
+ message: string,
75
+ ) {
76
+ super(message);
77
+ this.name = "ValidationError";
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Git Workflow
83
+
84
+ ### Branches
85
+
86
+ - `main`: Production
87
+ - `dev`: Integration
88
+
89
+ ### Commits
90
+
91
+ Use conventional commits:
92
+
93
+ - `feat:` New feature
94
+ - `fix:` Bug fix
95
+ - `docs:` Documentation
96
+ - `refactor:` Code refactoring
97
+ - `test:` Test changes
98
+
99
+ ### Pull Requests
100
+
101
+ - Keep PRs small and focused
102
+ - Reference issues: `Fixes #123`
103
+ - All PRs require review before merge
104
+
105
+ ## Frontend
106
+
107
+ ### Next.js + App Router
108
+
109
+ Use latest Next.js with App Router. Server Components by default, Client Components only when needed for interactivity.
110
+
111
+ ## Skills Reference
112
+
113
+ ### Bundled Skills (in .codex/skills/)
114
+ - `$api-design` - REST + Zod API patterns
115
+ - `$security-review` - Security audit checklist
116
+
117
+ Note: Codex uses bundled skills from `.codex/skills/`. The following skills are available to Claude Code users via `npx add-skill`:
118
+ - `test-driven-development`, `frontend-design`, `commit-commands`, `pr-review-toolkit`, `code-simplifier`, `browser-use`, `supabase-postgres-best-practices`
@@ -0,0 +1,138 @@
1
+ # Team Standards
2
+
3
+ ## Development Methodology
4
+
5
+ ### TDD: Mandatory
6
+
7
+ All new code follows Test-Driven Development:
8
+
9
+ 1. **Red**: Write a failing test first
10
+ 2. **Green**: Write minimal code to pass
11
+ 3. **Refactor**: Clean up while tests stay green
12
+
13
+ TDD is enforced through the `test-driven-development` skill (installed from `obra/superpowers`). When writing new code, always use this skill to ensure proper Red-Green-Refactor workflow.
14
+
15
+ ### TypeScript: Strict Mode
16
+
17
+ ```json
18
+ {
19
+ "compilerOptions": {
20
+ "strict": true,
21
+ "noUncheckedIndexedAccess": true,
22
+ "noImplicitReturns": true,
23
+ "noFallthroughCasesInSwitch": true
24
+ }
25
+ }
26
+ ```
27
+
28
+ ### ESLint: Strict Defaults
29
+
30
+ Use ESLint with strict defaults. No custom rule overrides unless documented in this file.
31
+
32
+ ## Code Style
33
+
34
+ ### Legacy Code: Gradual Fix
35
+
36
+ - Fix only code you touch (new or changed files)
37
+ - Don't rewrite working legacy code unprompted
38
+ - Leave existing patterns alone if not in scope
39
+
40
+ ### Naming: Explicit, No Abbreviations
41
+
42
+ ```typescript
43
+ // Bad
44
+ const usr = getUsr(req.params.id);
45
+
46
+ // Good
47
+ const user = getUser(req.params.userId);
48
+ ```
49
+
50
+ ### Types: Always Explicit
51
+
52
+ ```typescript
53
+ // Bad
54
+ function processData(data: any): any { ... }
55
+
56
+ // Good
57
+ function processUser(user: User): ProcessedUser { ... }
58
+ ```
59
+
60
+ ## API Style
61
+
62
+ ### REST + Zod
63
+
64
+ - Use RESTful routes: GET/POST/PUT/PATCH/DELETE
65
+ - Validate all inputs with Zod schemas at boundaries
66
+ - Response format: `{ data: T }` or `{ error: string }`
67
+
68
+ ### Error Handling: Typed Error Classes
69
+
70
+ ```typescript
71
+ class ValidationError extends Error {
72
+ constructor(
73
+ public field: string,
74
+ message: string,
75
+ ) {
76
+ super(message);
77
+ this.name = "ValidationError";
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Git Workflow
83
+
84
+ ### Branches
85
+
86
+ - `main`: Production
87
+ - `dev`: Integration
88
+
89
+ ### Commits
90
+
91
+ Use conventional commits:
92
+
93
+ - `feat:` New feature
94
+ - `fix:` Bug fix
95
+ - `docs:` Documentation
96
+ - `refactor:` Code refactoring
97
+ - `test:` Test changes
98
+
99
+ ### Pull Requests
100
+
101
+ - Keep PRs small and focused
102
+ - Reference issues: `Fixes #123`
103
+ - All PRs require review before merge
104
+
105
+ ## Frontend
106
+
107
+ ### Next.js + App Router
108
+
109
+ Use latest Next.js with App Router. Server Components by default, Client Components only when needed for interactivity.
110
+
111
+ ## Skills Reference
112
+
113
+ ### Commands (slash commands)
114
+ - `/fix-issue` - Fix a GitHub issue following TDD workflow
115
+ - `/review` - Run code review checklist
116
+ - `/clean-copy` - Reimplement branch with clean, narrative-quality commit history
117
+ - `/auto` - Auto-detect and execute the best workflow for your request
118
+
119
+ ### Plugins (enabled via marketplace)
120
+
121
+ These are bundled extensions that provide subagents, skills, and commands as cohesive units. They are configured in `.claude/settings.json` under `enabledPlugins`:
122
+
123
+ - `commit-commands` - Commit workflow helpers (anthropics/claude-code-plugins)
124
+ - `pr-review-toolkit` - PR review automation with specialized subagents (anthropics/claude-code-plugins)
125
+ - `code-simplifier` - Code simplification agent (anthropics/claude-code-plugins)
126
+
127
+ ### Installed Skills (via npx add-skill)
128
+ - `test-driven-development` - TDD workflow enforcement (obra/superpowers)
129
+ - `frontend-design` - Frontend design patterns (anthropics/anthropic-skills)
130
+ - `browser-use` - Browser automation (browser-use/browser-use)
131
+ - `supabase-postgres-best-practices` - Supabase/Postgres patterns (supabase/agent-skills)
132
+
133
+ ### Bundled Skills (in .claude/skills/)
134
+ - `api-design` - REST + Zod API patterns
135
+ - `security-review` - Security audit checklist
136
+
137
+ ### Bundled Subagents (in .claude/agents/)
138
+ - `code-simplifier` - Code simplification agent for clarity and maintainability