create-tigra 2.0.4 → 2.1.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.
@@ -124,11 +124,11 @@ async function main() {
124
124
  program
125
125
  .name('create-tigra')
126
126
  .description('Create a production-ready full-stack app with Next.js + Fastify + Prisma + Redis')
127
- .version('2.0.2')
127
+ .version('2.1.0')
128
128
  .argument('[project-name]', 'Name for your new project')
129
129
  .action(async (projectNameArg) => {
130
130
  console.log();
131
- console.log(chalk.bold(' Create Tigra') + chalk.dim(' v2.0.2'));
131
+ console.log(chalk.bold(' Create Tigra') + chalk.dim(' v2.1.0'));
132
132
  console.log();
133
133
 
134
134
  let projectName = projectNameArg;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tigra",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "description": "Create a production-ready full-stack app with Next.js 16 + Fastify 5 + Prisma + Redis",
6
6
  "bin": {
@@ -0,0 +1,69 @@
1
+ #!/bin/bash
2
+ # Restrict Claude's WRITE access based on the .developer-role file.
3
+ # Claude can always READ any file for full project context.
4
+ # Only Edit/Write operations are blocked on the other side's directory.
5
+ #
6
+ # To switch roles, either:
7
+ # 1. Edit .developer-role and type: frontend, backend, or fullstack
8
+ # 2. Use /role command in Claude
9
+ #
10
+ # fullstack (or empty/missing file) = no restrictions
11
+
12
+ ROLE_FILE="$CLAUDE_PROJECT_DIR/.developer-role"
13
+
14
+ # Read role from file, trim whitespace
15
+ if [ -f "$ROLE_FILE" ]; then
16
+ ROLE=$(tr -d '[:space:]' < "$ROLE_FILE")
17
+ else
18
+ ROLE=""
19
+ fi
20
+
21
+ # No file, empty, or fullstack = full access
22
+ if [ -z "$ROLE" ] || [ "$ROLE" = "fullstack" ]; then
23
+ exit 0
24
+ fi
25
+
26
+ # Read stdin (JSON from Claude Code)
27
+ INPUT=$(cat)
28
+
29
+ # Extract tool_name from JSON
30
+ TOOL_NAME=$(echo "$INPUT" | grep -oP '"tool_name"\s*:\s*"[^"]*"' | head -1 | sed 's/.*:.*"\(.*\)"/\1/')
31
+
32
+ # Only block write operations (Edit, Write). Allow Read, Glob, Grep.
33
+ if [ "$TOOL_NAME" != "Edit" ] && [ "$TOOL_NAME" != "Write" ]; then
34
+ exit 0
35
+ fi
36
+
37
+ # Extract file_path or path from JSON
38
+ FILE_PATH=""
39
+ for field in file_path path; do
40
+ value=$(echo "$INPUT" | grep -oP "\"${field}\"\s*:\s*\"[^\"]*\"" | head -1 | sed 's/.*:.*"\(.*\)"/\1/')
41
+ if [ -n "$value" ]; then
42
+ FILE_PATH="$value"
43
+ break
44
+ fi
45
+ done
46
+
47
+ # No file path found = allow
48
+ if [ -z "$FILE_PATH" ]; then
49
+ exit 0
50
+ fi
51
+
52
+ deny_with_reason() {
53
+ cat <<DENY_EOF
54
+ {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"$1"}}
55
+ DENY_EOF
56
+ exit 0
57
+ }
58
+
59
+ if [ "$ROLE" = "frontend" ]; then
60
+ if echo "$FILE_PATH" | grep -qiE "(^|/|\\\\)server(/|\\\\|$)"; then
61
+ deny_with_reason "BLOCKED: Role is set to frontend. You can read server/ files but cannot modify them. Only the backend developer can edit server/ code."
62
+ fi
63
+ elif [ "$ROLE" = "backend" ]; then
64
+ if echo "$FILE_PATH" | grep -qiE "(^|/|\\\\)client(/|\\\\|$)"; then
65
+ deny_with_reason "BLOCKED: Role is set to backend. You can read client/ files but cannot modify them. Only the frontend developer can edit client/ code."
66
+ fi
67
+ fi
68
+
69
+ exit 0
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "Edit|Write",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/restrict-paths.sh\""
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: role
3
+ description: Switch developer role to restrict Claude's access to frontend-only, backend-only, or full access
4
+ argument-hint: "[frontend | backend | fullstack]"
5
+ disable-model-invocation: true
6
+ allowed-tools: Read, Write
7
+ ---
8
+
9
+ The user wants to switch their developer role. The argument is: $ARGUMENTS
10
+
11
+ Read the file `.developer-role` in the project root to see the current role.
12
+
13
+ ## Rules
14
+
15
+ - If the argument is `frontend`, `backend`, or `fullstack` — write that word to `.developer-role` and confirm the switch.
16
+ - If no argument is given — read `.developer-role` and tell the user their current role, then ask which role they want.
17
+ - If the argument is not one of the three valid roles — tell the user the valid options.
18
+
19
+ ## What each role does
20
+
21
+ | Role | Access |
22
+ |------|--------|
23
+ | `frontend` | Can only work in `client/`. Blocked from `server/`. |
24
+ | `backend` | Can only work in `server/`. Blocked from `client/`. |
25
+ | `fullstack` | Full access to everything. No restrictions. |
26
+
27
+ ## Response format
28
+
29
+ After switching, confirm like this:
30
+
31
+ ```
32
+ Role switched to **{role}**.
33
+
34
+ - frontend → client/ only
35
+ - backend → server/ only
36
+ - fullstack → full access
37
+ ```
@@ -22,6 +22,9 @@ Thumbs.db
22
22
  # Claude Code local settings
23
23
  .claude/settings.local.json
24
24
 
25
+ # Developer role (personal per developer)
26
+ .developer-role
27
+
25
28
  # Playwright MCP artifacts
26
29
  .playwright-mcp/
27
30