maxsim-flutter 1.32.0 → 1.34.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.
@@ -3,9 +3,12 @@ interface AgentDefinition {
3
3
  filename: string;
4
4
  name: string;
5
5
  description: string;
6
- model: 'sonnet' | 'haiku';
6
+ model: 'opus' | 'sonnet' | 'haiku';
7
7
  tools: string[];
8
8
  body: string;
9
+ isolation?: 'worktree';
10
+ memory?: 'user' | 'project' | 'local';
11
+ maxTurns?: number;
9
12
  }
10
13
  /**
11
14
  * Generates agent definition markdown files for the scaffolded Flutter project.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-writer.d.ts","sourceRoot":"","sources":["../../src/claude-setup/agent-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAenB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,eAAe,EAAE,CAMhF"}
1
+ {"version":3,"file":"agent-writer.d.ts","sourceRoot":"","sources":["../../src/claude-setup/agent-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAenB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,eAAe,EAAE,CAOhF"}
@@ -23,6 +23,7 @@ export async function writeAgents(context, outputPath) {
23
23
  */
24
24
  export function buildAgentDefinitions(context) {
25
25
  return [
26
+ buildFlutterArchitectAgent(context),
26
27
  buildFlutterBuilderAgent(context),
27
28
  buildFlutterTesterAgent(context),
28
29
  buildFlutterReviewerAgent(context),
@@ -30,15 +31,22 @@ export function buildAgentDefinitions(context) {
30
31
  }
31
32
  function formatAgentMarkdown(agent) {
32
33
  const toolsList = JSON.stringify(agent.tools);
33
- return `---
34
+ let frontmatter = `---
34
35
  name: ${agent.name}
35
36
  description: ${agent.description}
36
37
  model: ${agent.model}
37
- tools: ${toolsList}
38
- ---
39
-
40
- ${agent.body}
41
- `;
38
+ tools: ${toolsList}`;
39
+ if (agent.isolation) {
40
+ frontmatter += `\nisolation: ${agent.isolation}`;
41
+ }
42
+ if (agent.memory) {
43
+ frontmatter += `\nmemory: ${agent.memory}`;
44
+ }
45
+ if (agent.maxTurns !== undefined) {
46
+ frontmatter += `\nmaxTurns: ${agent.maxTurns}`;
47
+ }
48
+ frontmatter += `\n---\n\n${agent.body}\n`;
49
+ return frontmatter;
42
50
  }
43
51
  function getEnabledModulesList(context) {
44
52
  const modules = [];
@@ -69,19 +77,83 @@ function buildModuleContext(context) {
69
77
  }
70
78
  return `Active modules: ${modules.join(', ')}. Be aware of module boundaries and inter-module dependencies.`;
71
79
  }
80
+ function buildFlutterArchitectAgent(context) {
81
+ const moduleContext = buildModuleContext(context);
82
+ return {
83
+ filename: 'flutter-architect.md',
84
+ name: 'flutter-architect',
85
+ description: 'Read-only planning agent. Designs feature architecture, defines interfaces, and plans implementation before coding begins.',
86
+ model: 'opus',
87
+ tools: ['Read', 'Grep', 'Glob', 'WebSearch'],
88
+ maxTurns: 30,
89
+ body: `You are a Flutter architect for **${context.projectName}**. You design feature architecture, define interfaces, and plan implementation before coding begins.
90
+
91
+ ## Model Selection Rationale
92
+
93
+ This agent uses **Opus** for complex architectural reasoning — designing interfaces, analyzing dependencies, and planning multi-layer implementations requires deep reasoning that benefits from Opus-level capability.
94
+
95
+ ## Your Role
96
+
97
+ You are a **planning** teammate. You:
98
+ 1. Read the story requirements and acceptance criteria
99
+ 2. Analyze the existing codebase for relevant patterns
100
+ 3. Design interfaces and data models following Clean Architecture
101
+ 4. Plan the implementation order across layers
102
+ 5. Hand off the design to the builder with clear specifications
103
+
104
+ ## Architecture Planning Workflow
105
+
106
+ 1. **Analyze**: Read the story, identify affected layers and modules
107
+ 2. **Design**: Define domain entities, repository interfaces, and use case signatures
108
+ 3. **Plan**: Specify implementation order (Domain → Data → Presentation)
109
+ 4. **Review**: Check for dependency violations and circular imports
110
+ 5. **Hand off**: Provide the builder with interface specs, file paths, and test case suggestions
111
+
112
+ ## Clean Architecture Compliance
113
+
114
+ Verify all designs follow the layer rules:
115
+ - **Domain** (entities, repository interfaces, use cases) — no external dependencies
116
+ - **Data** (repository implementations, data sources, models) — depends only on Domain
117
+ - **Presentation** (pages, widgets, Riverpod providers) — depends on Domain, never directly on Data
118
+
119
+ ## Module Context
120
+
121
+ ${moduleContext}
122
+
123
+ ## Rules Reference
124
+
125
+ Consult \`.claude/rules/\` for the full set of project-specific rules and conventions before finalizing any design.
126
+
127
+ ## Scope Boundaries
128
+
129
+ ### Do
130
+ - Read and analyze existing code patterns
131
+ - Design interfaces and plan implementations
132
+ - Check dependency graphs between features
133
+ - Reference documentation and best practices
134
+
135
+ ### Do NOT
136
+ - Do NOT write or edit files — planning only
137
+ - Do NOT make implementation decisions without checking existing patterns
138
+ - Do NOT skip dependency analysis between features
139
+ - Do NOT approve designs that violate Clean Architecture layer rules`,
140
+ };
141
+ }
72
142
  function buildFlutterBuilderAgent(context) {
73
143
  const moduleContext = buildModuleContext(context);
74
144
  return {
75
145
  filename: 'flutter-builder.md',
76
146
  name: 'flutter-builder',
77
147
  description: 'Implements Flutter features following Clean Architecture. Handles both architecture review and implementation.',
78
- model: 'sonnet',
148
+ model: 'opus',
79
149
  tools: ['Read', 'Write', 'Edit', 'Grep', 'Glob', 'Bash'],
150
+ isolation: 'worktree',
151
+ maxTurns: 50,
80
152
  body: `You are a Flutter builder for **${context.projectName}**. You design and implement features following Clean Architecture and Riverpod patterns.
81
153
 
82
154
  ## Model Selection Rationale
83
155
 
84
- This agent uses **Sonnet** because Sonnet balances speed and capability for implementation tasks — it handles complex code generation and architectural reasoning without the latency of Opus.
156
+ This agent uses **Opus** for non-trivial implementation tasks Opus produces fewer bugs, handles edge cases better, and makes superior architectural decisions compared to lighter models.
85
157
 
86
158
  ## Sub-Agent Usage
87
159
 
@@ -151,7 +223,20 @@ dart run build_runner build --delete-conflicting-outputs
151
223
  - \`lib/core/router/app_router.dart\` — Route definitions
152
224
  - \`lib/core/providers/app_providers.dart\` — Global provider barrel
153
225
  - \`pubspec.yaml\` — Dependencies
154
- - \`.claude/rules/\` — Project-specific coding rules and conventions`,
226
+ - \`.claude/rules/\` — Project-specific coding rules and conventions
227
+
228
+ ## Scope Boundaries
229
+
230
+ ### Do
231
+ - Implement features following the architect's design
232
+ - Run quality checks after every change
233
+ - Follow existing code patterns and conventions
234
+
235
+ ### Do NOT
236
+ - Do NOT modify files outside the project directory
237
+ - Do NOT run \`flutter clean\` without explicit instruction
238
+ - Do NOT install new packages without checking acceptance criteria first
239
+ - Do NOT skip quality gates`,
155
240
  };
156
241
  }
157
242
  function buildFlutterTesterAgent(context) {
@@ -162,6 +247,8 @@ function buildFlutterTesterAgent(context) {
162
247
  description: 'TDD-first testing agent. Writes tests before implementation and validates that features meet acceptance criteria.',
163
248
  model: 'sonnet',
164
249
  tools: ['Read', 'Write', 'Edit', 'Grep', 'Glob', 'Bash'],
250
+ isolation: 'worktree',
251
+ maxTurns: 40,
165
252
  body: `You are a Flutter test engineer for **${context.projectName}**. You practice TDD and validate that implementations meet acceptance criteria.
166
253
 
167
254
  ## Model Selection Rationale
@@ -226,7 +313,20 @@ dart format --set-exit-if-changed . # Code is formatted
226
313
  - Message the builder when tests fail with specific error details and reproduction steps
227
314
  - Confirm to the reviewer when all tests pass
228
315
  - Flag any untestable code patterns — these indicate a design problem
229
- - See \`.claude/rules/\` for naming conventions and test file placement`,
316
+ - See \`.claude/rules/\` for naming conventions and test file placement
317
+
318
+ ## Scope Boundaries
319
+
320
+ ### Do
321
+ - Write comprehensive tests covering happy paths and edge cases
322
+ - Validate acceptance criteria through tests
323
+ - Report test failures with reproduction steps
324
+
325
+ ### Do NOT
326
+ - Do NOT write implementation code — only tests
327
+ - Do NOT modify source files outside \`test/\`
328
+ - Do NOT mark tasks complete without all tests passing
329
+ - Do NOT skip edge case tests`,
230
330
  };
231
331
  }
232
332
  function buildFlutterReviewerAgent(context) {
@@ -237,6 +337,8 @@ function buildFlutterReviewerAgent(context) {
237
337
  description: 'Read-only compliance checker. Reviews code for Clean Architecture violations, Riverpod patterns, and code quality.',
238
338
  model: 'haiku',
239
339
  tools: ['Read', 'Grep', 'Glob'],
340
+ memory: 'user',
341
+ maxTurns: 20,
240
342
  body: `You are a Flutter code reviewer for **${context.projectName}**. You review completed implementations for architecture compliance and code quality.
241
343
 
242
344
  ## Model Selection Rationale
@@ -294,7 +396,20 @@ Consult \`.claude/rules/\` for the full set of project-specific rules and conven
294
396
 
295
397
  - Approve implementations that pass all checks
296
398
  - Send specific, actionable feedback for issues found
297
- - Prioritize critical issues (architecture violations) over style suggestions`,
399
+ - Prioritize critical issues (architecture violations) over style suggestions
400
+
401
+ ## Scope Boundaries
402
+
403
+ ### Do
404
+ - Review all changed files against the checklist
405
+ - Provide specific, actionable feedback with file/line references
406
+ - Check for architecture violations and anti-patterns
407
+
408
+ ### Do NOT
409
+ - Do NOT write or edit any files — read-only analysis only
410
+ - Do NOT approve code with unresolved architecture violations
411
+ - Do NOT skip the review checklist
412
+ - Do NOT suggest changes without specific file/line references`,
298
413
  };
299
414
  }
300
415
  //# sourceMappingURL=agent-writer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-writer.js","sourceRoot":"","sources":["../../src/claude-setup/agent-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAYjC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAuB,EACvB,UAAkB;IAElB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACxD,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAa,EAAE,CAAC;IAElC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC3C,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5C,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,YAAY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;;;;;;;;;;;;;;;;;;;EA+CpE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA8Be;KAC3B,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAAC,OAAuB;IACxD,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAElD,OAAO;QACL,QAAQ,EAAE,qBAAqB;QAC/B,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,oHAAoH;QACtH,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAC/B,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,yCAAyC,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CpE,aAAa;;;;;;;;;;;;;;;;;;;;;;;+DAuBgD;KAC5D,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-writer.d.ts","sourceRoot":"","sources":["../../src/claude-setup/hooks-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAsDzD,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuE3F"}
1
+ {"version":3,"file":"hooks-writer.d.ts","sourceRoot":"","sources":["../../src/claude-setup/hooks-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA2GzD,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmG3F"}
@@ -32,6 +32,55 @@ if echo "$INPUT" | grep -qE '"file_path"\\s*:\\s*"[^"]*\\.dart"'; then
32
32
  fi
33
33
  fi
34
34
 
35
+ exit 0
36
+ `;
37
+ const PROTECT_SECRETS_SH = `#!/bin/bash
38
+ # PreToolUse hook: block access to secret/credential files
39
+ # Matches Read, Edit, Write tool invocations
40
+
41
+ INPUT=$(cat)
42
+ FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // empty')
43
+
44
+ [ -z "$FILE" ] && exit 0
45
+
46
+ # Check for sensitive file patterns
47
+ case "$FILE" in
48
+ *.env|*.env.*|*.pem|*.key)
49
+ echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"Blocked: access to sensitive file '"$FILE"'"}}'
50
+ exit 0
51
+ ;;
52
+ esac
53
+
54
+ BASENAME=$(basename "$FILE")
55
+ case "$BASENAME" in
56
+ credentials*|secrets*)
57
+ echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"Blocked: access to credentials/secrets file '"$FILE"'"}}'
58
+ exit 0
59
+ ;;
60
+ esac
61
+
62
+ exit 0
63
+ `;
64
+ const NOTIFY_WAITING_SH = `#!/bin/bash
65
+ # Notification hook: send desktop notification when Claude needs attention
66
+ # Triggered on idle_prompt events
67
+
68
+ INPUT=$(cat)
69
+
70
+ # Cross-platform notification
71
+ MESSAGE="Claude Code needs your attention"
72
+
73
+ if command -v osascript &>/dev/null; then
74
+ # macOS
75
+ osascript -e "display notification \\"$MESSAGE\\" with title \\"Claude Code\\"" 2>/dev/null &
76
+ elif command -v notify-send &>/dev/null; then
77
+ # Linux (freedesktop)
78
+ notify-send "Claude Code" "$MESSAGE" 2>/dev/null &
79
+ elif command -v powershell.exe &>/dev/null; then
80
+ # Windows (WSL)
81
+ powershell.exe -Command "[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null; [System.Windows.Forms.MessageBox]::Show('$MESSAGE', 'Claude Code')" 2>/dev/null &
82
+ fi
83
+
35
84
  exit 0
36
85
  `;
37
86
  export async function writeHooks(context, outputPath) {
@@ -42,11 +91,17 @@ export async function writeHooks(context, outputPath) {
42
91
  // Write shell scripts
43
92
  const blockDangerousPath = path.join(hooksDir, 'block-dangerous.sh');
44
93
  const formatDartPath = path.join(hooksDir, 'format-dart.sh');
94
+ const protectSecretsPath = path.join(hooksDir, 'protect-secrets.sh');
95
+ const notifyWaitingPath = path.join(hooksDir, 'notify-waiting.sh');
45
96
  await fs.writeFile(blockDangerousPath, BLOCK_DANGEROUS_SH);
46
97
  await fs.writeFile(formatDartPath, FORMAT_DART_SH);
98
+ await fs.writeFile(protectSecretsPath, PROTECT_SECRETS_SH);
99
+ await fs.writeFile(notifyWaitingPath, NOTIFY_WAITING_SH);
47
100
  // Make scripts executable (mode 0o755)
48
101
  await chmod(blockDangerousPath, 0o755);
49
102
  await chmod(formatDartPath, 0o755);
103
+ await chmod(protectSecretsPath, 0o755);
104
+ await chmod(notifyWaitingPath, 0o755);
50
105
  // Build hooks config
51
106
  const hooks = {
52
107
  PreToolUse: [
@@ -59,6 +114,16 @@ export async function writeHooks(context, outputPath) {
59
114
  },
60
115
  ],
61
116
  },
117
+ {
118
+ matcher: 'Read|Edit|Write',
119
+ hooks: [
120
+ {
121
+ type: 'command',
122
+ command: '.claude/hooks/protect-secrets.sh',
123
+ timeout: 5,
124
+ },
125
+ ],
126
+ },
62
127
  ],
63
128
  PostToolUse: [
64
129
  {
@@ -81,6 +146,18 @@ export async function writeHooks(context, outputPath) {
81
146
  ],
82
147
  },
83
148
  ],
149
+ Notification: [
150
+ {
151
+ matcher: 'idle_prompt',
152
+ hooks: [
153
+ {
154
+ type: 'command',
155
+ command: '.claude/hooks/notify-waiting.sh',
156
+ timeout: 10,
157
+ },
158
+ ],
159
+ },
160
+ ],
84
161
  };
85
162
  if (context.claude?.agentTeams) {
86
163
  hooks.TeammateIdle = [
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-writer.js","sourceRoot":"","sources":["../../src/claude-setup/hooks-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;A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CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxsim-flutter",
3
- "version": "1.32.0",
3
+ "version": "1.34.0",
4
4
  "description": "AI-powered Flutter app scaffolding with Clean Architecture, Riverpod, and autonomous development via Ralph",
5
5
  "type": "module",
6
6
  "bin": {