@atlashub/smartstack-cli 1.13.2 → 1.14.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/.documentation/agents.html +1 -1
- package/.documentation/apex.html +1 -1
- package/.documentation/business-analyse.html +1 -1
- package/.documentation/cli-commands.html +3 -3
- package/.documentation/commands.html +1 -1
- package/.documentation/efcore.html +1 -1
- package/.documentation/gitflow.html +1 -1
- package/.documentation/hooks.html +1 -1
- package/.documentation/index.html +1 -1
- package/.documentation/init.html +3 -3
- package/.documentation/installation.html +1001 -352
- package/.documentation/ralph-loop.html +1 -1
- package/.documentation/test-web.html +1 -1
- package/README.md +88 -20
- package/dist/index.js +276 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/code-reviewer.md +163 -0
- package/templates/agents/efcore/db-deploy.md +25 -7
- package/templates/agents/efcore/db-reset.md +31 -10
- package/templates/agents/efcore/db-status.md +22 -5
- package/templates/agents/efcore/migration.md +69 -19
- package/templates/agents/gitflow/cleanup.md +8 -1
- package/templates/agents/gitflow/commit.md +7 -5
- package/templates/agents/gitflow/finish.md +6 -4
- package/templates/agents/gitflow/pr.md +8 -1
- package/templates/agents/gitflow/start.md +1 -1
- package/templates/commands/check-version.md +267 -0
- package/templates/commands/efcore/_shared.md +30 -1
- package/templates/commands/efcore/db-reset.md +18 -6
- package/templates/commands/gitflow/OPTIMIZATIONS.md +206 -0
- package/templates/commands/refactor.md +164 -0
- package/templates/project/DependencyInjection.Application.cs.template +25 -0
- package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
- package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
- package/templates/project/ExampleEntity.cs.template +116 -0
- package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
- package/templates/project/ExampleService.cs.template +146 -0
- package/templates/project/ExtensionsDbContext.cs.template +41 -0
- package/templates/project/IExtensionsDbContext.cs.template +22 -0
- package/templates/project/Program.cs.template +47 -0
- package/templates/project/README.md +79 -0
- package/templates/ralph/README.md +10 -8
- package/templates/ralph/ralph.config.yaml +2 -2
- package/templates/skills/_shared.md +44 -44
- package/templates/skills/ai-prompt/SKILL.md +55 -55
- package/templates/skills/apex/SKILL.md +235 -0
- package/templates/skills/apex/steps/step-00-init.md +203 -0
- package/templates/skills/apex/steps/step-01-analyze.md +210 -0
- package/templates/skills/apex/steps/step-02-plan.md +217 -0
- package/templates/skills/apex/steps/step-03-execute.md +178 -0
- package/templates/skills/apex/steps/step-04-validate.md +217 -0
- package/templates/skills/apex/steps/step-05-examine.md +207 -0
- package/templates/skills/apex/steps/step-06-resolve.md +181 -0
- package/templates/skills/apex/steps/step-07-tests.md +206 -0
- package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
- package/templates/skills/apex/templates/00-context.md +46 -0
- package/templates/skills/apex/templates/01-analyze.md +63 -0
- package/templates/skills/apex/templates/02-plan.md +63 -0
- package/templates/skills/apex/templates/03-execute.md +34 -0
- package/templates/skills/apex/templates/04-validate.md +61 -0
- package/templates/skills/apex/templates/05-examine.md +58 -0
- package/templates/skills/apex/templates/06-resolve.md +39 -0
- package/templates/skills/apex/templates/07-tests.md +56 -0
- package/templates/skills/apex/templates/08-run-tests.md +41 -0
- package/templates/skills/apex/templates/README.md +69 -0
- package/templates/skills/application/SKILL.md +50 -50
- package/templates/skills/application/templates-backend.md +25 -25
- package/templates/skills/application/templates-frontend.md +43 -43
- package/templates/skills/application/templates-i18n.md +29 -29
- package/templates/skills/application/templates-seed.md +77 -77
- package/templates/skills/business-analyse/SKILL.md +223 -0
- package/templates/skills/business-analyse/_shared.md +258 -0
- package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
- package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
- package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
- package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
- package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
- package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
- package/templates/skills/business-analyse/questionnaire.md +177 -177
- package/templates/skills/business-analyse/react/components.md +340 -0
- package/templates/skills/business-analyse/react/i18n-template.md +245 -0
- package/templates/skills/business-analyse/react/schema.md +151 -0
- package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
- package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
- package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
- package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
- package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
- package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
- package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
- package/templates/skills/business-analyse/templates/00-context.md +105 -0
- package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
- package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
- package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
- package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
- package/templates/skills/business-analyse/templates-frd.md +217 -217
- package/templates/skills/business-analyse/templates-react.md +26 -26
- package/templates/skills/controller/SKILL.md +141 -92
- package/templates/skills/controller/postman-templates.md +15 -15
- package/templates/skills/controller/steps/step-00-init.md +191 -0
- package/templates/skills/controller/steps/step-01-analyze.md +146 -0
- package/templates/skills/controller/steps/step-02-plan.md +176 -0
- package/templates/skills/controller/steps/step-03-generate.md +219 -0
- package/templates/skills/controller/steps/step-04-perms.md +219 -0
- package/templates/skills/controller/steps/step-05-validate.md +107 -0
- package/templates/skills/controller/templates.md +77 -77
- package/templates/skills/documentation/SKILL.md +79 -79
- package/templates/skills/feature-full/SKILL.md +38 -38
- package/templates/skills/gitflow/SKILL.md +277 -0
- package/templates/{commands → skills}/gitflow/_shared.md +20 -20
- package/templates/skills/gitflow/phases/abort.md +173 -0
- package/templates/skills/gitflow/phases/cleanup.md +226 -0
- package/templates/skills/gitflow/phases/status.md +178 -0
- package/templates/skills/gitflow/steps/step-commit.md +255 -0
- package/templates/skills/gitflow/steps/step-finish.md +255 -0
- package/templates/skills/gitflow/steps/step-init.md +209 -0
- package/templates/skills/gitflow/steps/step-merge.md +225 -0
- package/templates/skills/gitflow/steps/step-plan.md +208 -0
- package/templates/skills/gitflow/steps/step-pr.md +235 -0
- package/templates/skills/gitflow/steps/step-start.md +234 -0
- package/templates/skills/gitflow/steps/step-sync.md +200 -0
- package/templates/skills/gitflow/templates/config.json +53 -0
- package/templates/skills/notification/SKILL.md +51 -51
- package/templates/skills/ralph-loop/SKILL.md +228 -0
- package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
- package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
- package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
- package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
- package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
- package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
- package/templates/skills/review-code/SKILL.md +219 -0
- package/templates/skills/review-code/references/clean-code-principles.md +140 -0
- package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
- package/templates/skills/review-code/references/feedback-patterns.md +149 -0
- package/templates/skills/review-code/references/security-checklist.md +127 -0
- package/templates/skills/ui-components/SKILL.md +54 -54
- package/templates/skills/workflow/SKILL.md +46 -46
- package/templates/commands/ai-prompt.md +0 -315
- package/templates/commands/apex/1-analyze.md +0 -100
- package/templates/commands/apex/2-plan.md +0 -145
- package/templates/commands/apex/3-execute.md +0 -171
- package/templates/commands/apex/4-examine.md +0 -116
- package/templates/commands/apex/5-tasks.md +0 -209
- package/templates/commands/apex.md +0 -76
- package/templates/commands/application/create.md +0 -362
- package/templates/commands/application/templates-backend.md +0 -463
- package/templates/commands/application/templates-frontend.md +0 -517
- package/templates/commands/application/templates-i18n.md +0 -478
- package/templates/commands/application/templates-seed.md +0 -362
- package/templates/commands/application.md +0 -303
- package/templates/commands/business-analyse/0-orchestrate.md +0 -156
- package/templates/commands/business-analyse/1-init.md +0 -99
- package/templates/commands/business-analyse/2-discover.md +0 -143
- package/templates/commands/business-analyse/3-analyse.md +0 -106
- package/templates/commands/business-analyse/4-specify.md +0 -133
- package/templates/commands/business-analyse/5-validate.md +0 -132
- package/templates/commands/business-analyse/6-handoff.md +0 -157
- package/templates/commands/business-analyse/7-doc-html.md +0 -103
- package/templates/commands/business-analyse/_shared.md +0 -176
- package/templates/commands/business-analyse/bug.md +0 -118
- package/templates/commands/business-analyse/change-request.md +0 -144
- package/templates/commands/business-analyse/hotfix.md +0 -116
- package/templates/commands/business-analyse.md +0 -121
- package/templates/commands/controller/create.md +0 -216
- package/templates/commands/controller/postman-templates.md +0 -528
- package/templates/commands/controller/templates.md +0 -600
- package/templates/commands/controller.md +0 -337
- package/templates/commands/create/agent.md +0 -138
- package/templates/commands/create/command.md +0 -166
- package/templates/commands/create/hook.md +0 -234
- package/templates/commands/create/plugin.md +0 -329
- package/templates/commands/create/project.md +0 -508
- package/templates/commands/create/skill.md +0 -199
- package/templates/commands/create.md +0 -220
- package/templates/commands/documentation/module.md +0 -202
- package/templates/commands/documentation/templates.md +0 -432
- package/templates/commands/documentation.md +0 -190
- package/templates/commands/epct.md +0 -69
- package/templates/commands/explain.md +0 -186
- package/templates/commands/feature-full.md +0 -267
- package/templates/commands/gitflow/1-init.md +0 -188
- package/templates/commands/gitflow/10-start.md +0 -190
- package/templates/commands/gitflow/11-finish.md +0 -382
- package/templates/commands/gitflow/12-cleanup.md +0 -103
- package/templates/commands/gitflow/13-sync.md +0 -216
- package/templates/commands/gitflow/14-rebase.md +0 -251
- package/templates/commands/gitflow/2-status.md +0 -122
- package/templates/commands/gitflow/3-commit.md +0 -209
- package/templates/commands/gitflow/4-plan.md +0 -174
- package/templates/commands/gitflow/5-exec.md +0 -202
- package/templates/commands/gitflow/6-abort.md +0 -121
- package/templates/commands/gitflow/7-pull-request.md +0 -176
- package/templates/commands/gitflow/8-review.md +0 -113
- package/templates/commands/gitflow/9-merge.md +0 -157
- package/templates/commands/gitflow.md +0 -128
- package/templates/commands/implement.md +0 -663
- package/templates/commands/init.md +0 -567
- package/templates/commands/mcp-integration.md +0 -330
- package/templates/commands/notification.md +0 -129
- package/templates/commands/oneshot.md +0 -57
- package/templates/commands/quickstart.md +0 -154
- package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
- package/templates/commands/ralph-loop/help.md +0 -126
- package/templates/commands/ralph-loop/ralph-loop.md +0 -120
- package/templates/commands/review.md +0 -106
- package/templates/commands/workflow.md +0 -193
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Code review feedback patterns based on research from Google, Microsoft, and academic studies on effective code review communication.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<what_why_how_pattern>
|
|
6
|
+
Every valuable comment includes three components:
|
|
7
|
+
|
|
8
|
+
1. **What**: The specific issue
|
|
9
|
+
2. **Why**: Why it matters
|
|
10
|
+
3. **How**: Concrete fix or direction
|
|
11
|
+
|
|
12
|
+
<good_example>
|
|
13
|
+
```
|
|
14
|
+
[BLOCKING] SQL injection vulnerability at line 34.
|
|
15
|
+
The query uses string concatenation with user input, allowing attackers to modify the query.
|
|
16
|
+
Fix: Use parameterized query: db.query('SELECT * FROM users WHERE id = ?', [userId])
|
|
17
|
+
```
|
|
18
|
+
</good_example>
|
|
19
|
+
|
|
20
|
+
<bad_example>
|
|
21
|
+
```
|
|
22
|
+
This query looks unsafe.
|
|
23
|
+
```
|
|
24
|
+
</bad_example>
|
|
25
|
+
</what_why_how_pattern>
|
|
26
|
+
|
|
27
|
+
<priority_labels>
|
|
28
|
+
Use consistent labels so authors know severity:
|
|
29
|
+
|
|
30
|
+
| Label | Meaning | Merge? |
|
|
31
|
+
|-------|---------|--------|
|
|
32
|
+
| `[BLOCKING]` | Must fix - security, bugs, missing requirements | No |
|
|
33
|
+
| `[CRITICAL]` | Strongly recommended - architecture, major issues | Discuss |
|
|
34
|
+
| `[SUGGESTION]` | Would improve code - not required | Yes |
|
|
35
|
+
| `[NIT]` | Minor preference - skip if busy | Yes |
|
|
36
|
+
| `[QUESTION]` | Need clarification - not blocking | Yes |
|
|
37
|
+
</priority_labels>
|
|
38
|
+
|
|
39
|
+
<feedback_value>
|
|
40
|
+
<high_value>
|
|
41
|
+
High-value feedback (36-43% implementation rate):
|
|
42
|
+
|
|
43
|
+
- Security vulnerabilities with exploit scenario
|
|
44
|
+
- Logic errors with failing test case
|
|
45
|
+
- Missing error handling with consequences
|
|
46
|
+
- Performance issues with measurements
|
|
47
|
+
</high_value>
|
|
48
|
+
|
|
49
|
+
<wasteful>
|
|
50
|
+
Wasteful feedback (damages team dynamics):
|
|
51
|
+
|
|
52
|
+
- Style preferences covered by linters
|
|
53
|
+
- Renaming suggestions without clear benefit
|
|
54
|
+
- "I would do it differently" without why
|
|
55
|
+
- Comments on code outside the diff
|
|
56
|
+
</wasteful>
|
|
57
|
+
</feedback_value>
|
|
58
|
+
|
|
59
|
+
<communication_patterns>
|
|
60
|
+
<collaborative_framing>
|
|
61
|
+
Use collaborative, question-based framing:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
✓ "Have you considered using a Map here for O(1) lookup?"
|
|
65
|
+
✓ "This could throw if user is null - should we add a check?"
|
|
66
|
+
✓ "I'm not sure I understand this logic - could you explain?"
|
|
67
|
+
|
|
68
|
+
✗ "You need to fix this."
|
|
69
|
+
✗ "This is wrong."
|
|
70
|
+
✗ "Obviously this should be..."
|
|
71
|
+
```
|
|
72
|
+
</collaborative_framing>
|
|
73
|
+
|
|
74
|
+
<avoid_belittling>
|
|
75
|
+
Remove belittling words: "just", "simply", "obviously", "easy", "only"
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
✗ "Just add a null check"
|
|
79
|
+
✗ "This is obviously wrong"
|
|
80
|
+
✓ "Add a null check for user.profile"
|
|
81
|
+
```
|
|
82
|
+
</avoid_belittling>
|
|
83
|
+
</communication_patterns>
|
|
84
|
+
|
|
85
|
+
<merge_decisions>
|
|
86
|
+
<block_merge>
|
|
87
|
+
Block merge for:
|
|
88
|
+
|
|
89
|
+
- Security vulnerabilities (any severity)
|
|
90
|
+
- Logic bugs that affect functionality
|
|
91
|
+
- Missing required tests
|
|
92
|
+
- Breaking API changes without migration
|
|
93
|
+
</block_merge>
|
|
94
|
+
|
|
95
|
+
<approve_with_comments>
|
|
96
|
+
Approve with comments for:
|
|
97
|
+
|
|
98
|
+
- Suggestions for future improvement
|
|
99
|
+
- Minor refactoring opportunities
|
|
100
|
+
- Documentation improvements
|
|
101
|
+
- Style preferences (should be in linter)
|
|
102
|
+
</approve_with_comments>
|
|
103
|
+
|
|
104
|
+
<approve_clean>
|
|
105
|
+
Approve cleanly when:
|
|
106
|
+
|
|
107
|
+
- Code meets requirements
|
|
108
|
+
- Tests pass
|
|
109
|
+
- No security issues
|
|
110
|
+
- Follows project conventions
|
|
111
|
+
</approve_clean>
|
|
112
|
+
</merge_decisions>
|
|
113
|
+
|
|
114
|
+
<avoiding_nitpick_culture>
|
|
115
|
+
**Research finding**: Nitpicking damages team relationships more than it improves code quality. Developers become defensive and less receptive to legitimate feedback.
|
|
116
|
+
|
|
117
|
+
<solution>
|
|
118
|
+
1. Automate style enforcement (linters, formatters)
|
|
119
|
+
2. Block CI on lint failures, not PR comments
|
|
120
|
+
3. Reserve human review for logic and design
|
|
121
|
+
4. Mark true nitpicks with `[NIT]` prefix
|
|
122
|
+
5. Limit to 3-5 critical items per review
|
|
123
|
+
</solution>
|
|
124
|
+
</avoiding_nitpick_culture>
|
|
125
|
+
|
|
126
|
+
<review_efficiency>
|
|
127
|
+
<google_data>
|
|
128
|
+
Google's review data shows:
|
|
129
|
+
|
|
130
|
+
- 90% of reviews: <10 files changed
|
|
131
|
+
- Average turnaround: 4 hours
|
|
132
|
+
- 75% need only one reviewer
|
|
133
|
+
</google_data>
|
|
134
|
+
|
|
135
|
+
<best_practices>
|
|
136
|
+
Efficiency best practices:
|
|
137
|
+
|
|
138
|
+
- Small PRs get better feedback
|
|
139
|
+
- Review within 4 hours if possible
|
|
140
|
+
- Focus on changed code only
|
|
141
|
+
- One pass, thorough, then done
|
|
142
|
+
</best_practices>
|
|
143
|
+
</review_efficiency>
|
|
144
|
+
|
|
145
|
+
<sources>
|
|
146
|
+
- [Google Code Review Guide](https://google.github.io/eng-practices/review/)
|
|
147
|
+
- [Microsoft Reviewer Guidance](https://microsoft.github.io/code-with-engineering-playbook/code-reviews/)
|
|
148
|
+
- [Conventional Comments](https://conventionalcomments.org/)
|
|
149
|
+
</sources>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Security code review checklist based on OWASP Code Review Guide and Top 10 2025. Comprehensive vulnerability patterns and search techniques.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<critical_vulnerabilities>
|
|
6
|
+
<a01_broken_access_control priority="most_critical">
|
|
7
|
+
Authorization checks on **every request** (not just UI):
|
|
8
|
+
|
|
9
|
+
- [ ] Server-side enforcement (never trust client)
|
|
10
|
+
- [ ] IDOR protection: Users can't access others' data by changing IDs
|
|
11
|
+
- [ ] No privilege escalation paths
|
|
12
|
+
- [ ] Default deny policy (explicit allow required)
|
|
13
|
+
</a01_broken_access_control>
|
|
14
|
+
|
|
15
|
+
<a02_security_misconfiguration>
|
|
16
|
+
Configuration hardening:
|
|
17
|
+
|
|
18
|
+
- [ ] No default credentials
|
|
19
|
+
- [ ] Debug mode disabled in production
|
|
20
|
+
- [ ] Secure headers present (CSP, X-Frame-Options, HSTS)
|
|
21
|
+
- [ ] Error messages don't expose internals
|
|
22
|
+
</a02_security_misconfiguration>
|
|
23
|
+
|
|
24
|
+
<a04_cryptographic_failures>
|
|
25
|
+
Encryption requirements:
|
|
26
|
+
|
|
27
|
+
- [ ] TLS 1.2+ for data in transit
|
|
28
|
+
- [ ] AES-256 for data at rest
|
|
29
|
+
- [ ] Password hashing: bcrypt/Argon2/scrypt (NOT MD5/SHA1)
|
|
30
|
+
- [ ] No hardcoded encryption keys
|
|
31
|
+
</a04_cryptographic_failures>
|
|
32
|
+
|
|
33
|
+
<a05_injection>
|
|
34
|
+
Injection prevention:
|
|
35
|
+
|
|
36
|
+
- [ ] SQL: Parameterized queries only (no string concatenation)
|
|
37
|
+
- [ ] Command: No `eval()`, `exec()`, `system()` with user input
|
|
38
|
+
- [ ] XSS: Output encoding context-appropriate
|
|
39
|
+
- [ ] Template: No user input in template names
|
|
40
|
+
</a05_injection>
|
|
41
|
+
</critical_vulnerabilities>
|
|
42
|
+
|
|
43
|
+
<input_validation>
|
|
44
|
+
Server-side validation checklist:
|
|
45
|
+
|
|
46
|
+
✓ Server-side validation on ALL inputs
|
|
47
|
+
✓ Allowlist approach (whitelist known-good)
|
|
48
|
+
✓ Validate: type, length, format, range
|
|
49
|
+
✓ File uploads: extension + MIME + content inspection
|
|
50
|
+
✓ Regex reviewed for ReDoS vulnerabilities
|
|
51
|
+
</input_validation>
|
|
52
|
+
|
|
53
|
+
<authentication>
|
|
54
|
+
| Check | Requirement |
|
|
55
|
+
|-------|-------------|
|
|
56
|
+
| Password Storage | bcrypt/Argon2 with salt |
|
|
57
|
+
| Session Tokens | ≥128 bits entropy, HttpOnly+Secure+SameSite |
|
|
58
|
+
| Error Messages | Generic ("Invalid credentials"), no enumeration |
|
|
59
|
+
| MFA | Required for sensitive accounts |
|
|
60
|
+
| Lockout | Exponential delay after failed attempts |
|
|
61
|
+
</authentication>
|
|
62
|
+
|
|
63
|
+
<authorization>
|
|
64
|
+
Access control requirements:
|
|
65
|
+
|
|
66
|
+
✓ Default deny (explicit allow required)
|
|
67
|
+
✓ Checks on EVERY request
|
|
68
|
+
✓ Server-side only (never trust client roles)
|
|
69
|
+
✓ Centralized access control logic
|
|
70
|
+
✓ No horizontal escalation (user → other user's data)
|
|
71
|
+
✓ No vertical escalation (user → admin functions)
|
|
72
|
+
</authorization>
|
|
73
|
+
|
|
74
|
+
<search_patterns>
|
|
75
|
+
Grep patterns for vulnerability detection:
|
|
76
|
+
|
|
77
|
+
<hardcoded_secrets>
|
|
78
|
+
```bash
|
|
79
|
+
grep -rE "(password|api[_-]?key|secret|token)\s*=\s*['\"]" --include="*.{js,ts,py,java}"
|
|
80
|
+
```
|
|
81
|
+
</hardcoded_secrets>
|
|
82
|
+
|
|
83
|
+
<dangerous_functions>
|
|
84
|
+
```bash
|
|
85
|
+
grep -rE "(eval|exec|system|shell_exec)\s*\(" --include="*.{js,ts,py,php}"
|
|
86
|
+
```
|
|
87
|
+
</dangerous_functions>
|
|
88
|
+
|
|
89
|
+
<sql_injection_risk>
|
|
90
|
+
```bash
|
|
91
|
+
grep -rE "query\s*\(\s*['\"].*\+|execute\s*\(\s*f['\"]" --include="*.{js,ts,py}"
|
|
92
|
+
```
|
|
93
|
+
</sql_injection_risk>
|
|
94
|
+
</search_patterns>
|
|
95
|
+
|
|
96
|
+
<csrf_protection>
|
|
97
|
+
CSRF prevention requirements:
|
|
98
|
+
|
|
99
|
+
✓ Tokens in state-changing requests (POST, PUT, DELETE)
|
|
100
|
+
✓ Token validated server-side
|
|
101
|
+
✓ SameSite=Lax minimum on cookies
|
|
102
|
+
✓ GET requests have no side effects
|
|
103
|
+
</csrf_protection>
|
|
104
|
+
|
|
105
|
+
<logging_security>
|
|
106
|
+
<must_log>
|
|
107
|
+
Events that must be logged:
|
|
108
|
+
|
|
109
|
+
- Authentication events (login, logout, failed attempts)
|
|
110
|
+
- Authorization failures
|
|
111
|
+
- Sensitive data access
|
|
112
|
+
</must_log>
|
|
113
|
+
|
|
114
|
+
<never_log>
|
|
115
|
+
Sensitive data to never log:
|
|
116
|
+
|
|
117
|
+
- Passwords, API keys, session tokens
|
|
118
|
+
- Full credit card numbers
|
|
119
|
+
- PII without masking
|
|
120
|
+
</never_log>
|
|
121
|
+
</logging_security>
|
|
122
|
+
|
|
123
|
+
<sources>
|
|
124
|
+
- [OWASP Code Review Guide](https://owasp.org/www-project-code-review-guide/)
|
|
125
|
+
- [OWASP Top 10:2025](https://owasp.org/Top10/)
|
|
126
|
+
- [OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/)
|
|
127
|
+
</sources>
|
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ui-components
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- Claude
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
4
|
+
Generates standardized SmartStack UI components.
|
|
5
|
+
Use this skill when:
|
|
6
|
+
- Creating React page (.tsx) in src/pages/
|
|
7
|
+
- Creating React component in src/components/
|
|
8
|
+
- User asks to create cards, grids, tables, or Kanban
|
|
9
|
+
- Claude detects creation of an entity list with display
|
|
10
|
+
- User mentions "card", "grid", "table", "list", "kanban"
|
|
11
|
+
- User asks for tooltips or infobubbles
|
|
12
|
+
- Creating a page with entity display
|
|
13
|
+
- Managing disabled states with explanatory messages
|
|
14
14
|
Scope: Pages, Components, Cards, Tables, Grids, Kanban boards, Tooltips
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
# Skill UI Components SmartStack
|
|
18
18
|
|
|
19
|
-
**
|
|
19
|
+
**Reference:** [_shared.md](../_shared.md) for architecture, i18n
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## WHEN THIS SKILL ACTIVATES
|
|
22
22
|
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
23
|
+
| Trigger | Example |
|
|
24
|
+
|---------|---------|
|
|
25
|
+
| React page/component creation | File in `src/pages/**/*.tsx` or `src/components/**/*.tsx` |
|
|
26
|
+
| List creation | "Display products in cards" |
|
|
27
|
+
| Keywords | "card", "grid", "table", "kanban", "tooltip" |
|
|
28
|
+
| Disabled states | "Disable button with explanatory message" |
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## MANDATORY COMPONENT: EntityCard
|
|
31
31
|
|
|
32
|
-
**
|
|
32
|
+
**ALWAYS use `EntityCard` for entity cards. NEVER use custom cards with divs.**
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
35
|
import { EntityCard, ProviderCard, TemplateCard } from '@/components/ui/EntityCard';
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
### Usage
|
|
38
|
+
### EntityCard Usage
|
|
39
39
|
```tsx
|
|
40
40
|
<EntityCard
|
|
41
41
|
avatar={{ letter: 'O', color: '#10a37f' }}
|
|
42
42
|
title="OpenAI" subtitle="openai"
|
|
43
43
|
description="OpenAI GPT models"
|
|
44
|
-
stats="15
|
|
45
|
-
badge={{ icon: Shield, tooltip: 'API
|
|
46
|
-
links={[{ icon: ExternalLink, label: '
|
|
44
|
+
stats="15 model(s)"
|
|
45
|
+
badge={{ icon: Shield, tooltip: 'Admin API supported' }}
|
|
46
|
+
links={[{ icon: ExternalLink, label: 'Website', href: 'https://...' }]}
|
|
47
47
|
actions={[{ label: 'Config', onClick: () => {}, variant: 'primary' }]}
|
|
48
48
|
/>
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
### Usage
|
|
51
|
+
### ProviderCard Usage (AI Providers)
|
|
52
52
|
```tsx
|
|
53
53
|
<ProviderCard name="OpenAI" code="openai" description="..." modelCount={15} color="#10a37f"
|
|
54
54
|
websiteUrl="..." docsUrl="..." apiKeyUrl="..." hasAdminKey />
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
### Usage
|
|
57
|
+
### TemplateCard Usage (Templates)
|
|
58
58
|
```tsx
|
|
59
59
|
<TemplateCard name="Welcome" code="welcome" category="Transactional" isActive isSystem
|
|
60
60
|
icon={Mail} translationsCount={3} onClick={() => {}} onEdit={() => {}} onDelete={() => {}} />
|
|
@@ -77,7 +77,7 @@ import { EntityCard, ProviderCard, TemplateCard } from '@/components/ui/EntityCa
|
|
|
77
77
|
| `secondary` | `bg-accent-700 text-white` |
|
|
78
78
|
| `ghost` | `border bg-transparent` |
|
|
79
79
|
|
|
80
|
-
##
|
|
80
|
+
## RESPONSIVE GRID
|
|
81
81
|
|
|
82
82
|
```tsx
|
|
83
83
|
// Standard
|
|
@@ -85,9 +85,9 @@ import { EntityCard, ProviderCard, TemplateCard } from '@/components/ui/EntityCa
|
|
|
85
85
|
{items.map(item => <EntityCard key={item.id} {...mapToCardProps(item)} />)}
|
|
86
86
|
</div>
|
|
87
87
|
|
|
88
|
-
//
|
|
88
|
+
// With empty state
|
|
89
89
|
{items.length === 0 ? (
|
|
90
|
-
<div className="text-center py-12"><p>
|
|
90
|
+
<div className="text-center py-12"><p>No items</p></div>
|
|
91
91
|
) : (
|
|
92
92
|
<div className="grid ...">...</div>
|
|
93
93
|
)}
|
|
@@ -95,25 +95,25 @@ import { EntityCard, ProviderCard, TemplateCard } from '@/components/ui/EntityCa
|
|
|
95
95
|
|
|
96
96
|
## CUSTOM CARDS (Status, Dashboard)
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
Button alignment pattern at bottom (mandatory for custom cards):
|
|
99
99
|
|
|
100
100
|
```tsx
|
|
101
|
-
//
|
|
101
|
+
// WARNING: h-full flex flex-col + flex-1 + mt-auto
|
|
102
102
|
<div className="h-full flex flex-col rounded-[var(--radius-card)] border ...">
|
|
103
103
|
{/* Header */}
|
|
104
104
|
<div className="px-4 py-3 bg-gradient-to-r from-[var(--color-accent-500)]/10 ...">
|
|
105
105
|
{/* ... */}
|
|
106
106
|
</div>
|
|
107
|
-
{/* Content
|
|
107
|
+
{/* Content with flex-1 */}
|
|
108
108
|
<div className="flex-1 flex flex-col p-4">
|
|
109
|
-
{/*
|
|
110
|
-
{/*
|
|
109
|
+
{/* Variable content */}
|
|
110
|
+
{/* WARNING: mt-auto for button at bottom */}
|
|
111
111
|
<button className="mt-auto w-full ...">Action</button>
|
|
112
112
|
</div>
|
|
113
113
|
</div>
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
##
|
|
116
|
+
## COMPONENT: DataTable
|
|
117
117
|
|
|
118
118
|
```tsx
|
|
119
119
|
import { DataTable } from '@/components/ui/DataTable';
|
|
@@ -121,8 +121,8 @@ import { DataTable } from '@/components/ui/DataTable';
|
|
|
121
121
|
<DataTable
|
|
122
122
|
data={users}
|
|
123
123
|
columns={[
|
|
124
|
-
{ key: 'name', label: '
|
|
125
|
-
{ key: 'role', label: '
|
|
124
|
+
{ key: 'name', label: 'Name', sortable: true },
|
|
125
|
+
{ key: 'role', label: 'Role', render: (user) => <Badge>{user.role}</Badge> }
|
|
126
126
|
]}
|
|
127
127
|
pagination={{ pageSize: 10 }}
|
|
128
128
|
searchable
|
|
@@ -130,20 +130,20 @@ import { DataTable } from '@/components/ui/DataTable';
|
|
|
130
130
|
/>
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
##
|
|
133
|
+
## COMPONENT: Tooltip
|
|
134
134
|
|
|
135
135
|
```tsx
|
|
136
136
|
import { Tooltip } from '@/components/ui/Tooltip';
|
|
137
137
|
|
|
138
|
-
//
|
|
138
|
+
// Variants: default, error, warning, success, info
|
|
139
139
|
// Positions: top, bottom, left, right
|
|
140
140
|
|
|
141
|
-
<Tooltip content="Permission
|
|
142
|
-
<button disabled>
|
|
141
|
+
<Tooltip content="Permission required" variant="error">
|
|
142
|
+
<button disabled>Protected action</button>
|
|
143
143
|
</Tooltip>
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
###
|
|
146
|
+
### Disabled Button with Explanation Pattern
|
|
147
147
|
```tsx
|
|
148
148
|
const canExecute = hasPermission('module.action.execute');
|
|
149
149
|
<Tooltip content={!canExecute ? t('errors.noPermission') : undefined} variant="error" disabled={canExecute}>
|
|
@@ -151,20 +151,20 @@ const canExecute = hasPermission('module.action.execute');
|
|
|
151
151
|
</Tooltip>
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
##
|
|
154
|
+
## WHEN TO USE EntityCard vs Custom
|
|
155
155
|
|
|
156
|
-
| EntityCard
|
|
157
|
-
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
156
|
+
| EntityCard for | Custom for |
|
|
157
|
+
|----------------|------------|
|
|
158
|
+
| Homogeneous entity lists | Dashboard stats cards |
|
|
159
|
+
| Catalogs | Cards with complex interactive states |
|
|
160
|
+
| Clickable grids | Cards with integrated forms |
|
|
161
161
|
|
|
162
|
-
##
|
|
162
|
+
## ABSOLUTE RULES
|
|
163
163
|
|
|
164
164
|
| DO | DON'T |
|
|
165
165
|
|----|-------|
|
|
166
|
-
| EntityCard
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
| h-full + flex-1 + mt-auto |
|
|
170
|
-
|
|
|
166
|
+
| EntityCard for entities | Custom cards with manual divs |
|
|
167
|
+
| Distinct colored header | rounded-full for avatar (that's table) |
|
|
168
|
+
| Responsive grid 1→2→3→4 | Fixed non-responsive grid |
|
|
169
|
+
| h-full + flex-1 + mt-auto | Unaligned buttons in grid |
|
|
170
|
+
| Empty and loading states | Native HTML tooltip |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: workflow
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
4
|
+
Creates and configures automated SmartStack workflows.
|
|
5
|
+
Use this skill when:
|
|
6
|
+
- User wants to automate actions (emails, webhooks)
|
|
7
|
+
- User mentions "workflow", "automation", "trigger"
|
|
8
|
+
- Creating a business process with steps
|
|
9
|
+
- Integrating transactional emails
|
|
10
10
|
Types: SendEmail, Wait, Condition, Webhook
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -14,16 +14,16 @@ description: |
|
|
|
14
14
|
|
|
15
15
|
> **Architecture:** Trigger → Steps → Actions (Email/Wait/Condition/Webhook)
|
|
16
16
|
|
|
17
|
-
**
|
|
17
|
+
**Reference:** [_shared.md](../_shared.md) for common services
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## WHEN THIS SKILL ACTIVATES
|
|
20
20
|
|
|
21
|
-
|
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
21
|
+
| Trigger | Example |
|
|
22
|
+
|---------|---------|
|
|
23
|
+
| Explicit request | "Create a workflow for registration" |
|
|
24
|
+
| Automatic email | "Send an email when a ticket is created" |
|
|
25
|
+
| Chaining | "After 24h without response, send a reminder" |
|
|
26
|
+
| Keywords | "workflow", "trigger", "automation", "email template" |
|
|
27
27
|
|
|
28
28
|
## FLOW
|
|
29
29
|
|
|
@@ -35,7 +35,7 @@ IWorkflowService.TriggerAsync(code, variables)
|
|
|
35
35
|
Workflow Steps: SendEmail → Wait → Condition → Webhook
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
## TRIGGERS
|
|
38
|
+
## AVAILABLE TRIGGERS
|
|
39
39
|
|
|
40
40
|
### User Events
|
|
41
41
|
| Trigger | Variables |
|
|
@@ -52,17 +52,17 @@ Workflow Steps: SendEmail → Wait → Condition → Webhook
|
|
|
52
52
|
| `ticket.resolved/assigned` | ticketId, ticketNumber, assigneeName |
|
|
53
53
|
| `ticket.sla-warning/breached` | ticketId, deadline, remainingMinutes |
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### Add a Trigger
|
|
56
56
|
```csharp
|
|
57
57
|
// WorkflowTriggerConfiguration.cs - GetSeedData()
|
|
58
58
|
new { Id = Guid.Parse("..."), Code = "entity.event", Name = "Entity Event",
|
|
59
59
|
AvailableVariablesJson = JsonSerializer.Serialize(new[]{ ... }), ... }
|
|
60
60
|
|
|
61
|
-
//
|
|
62
|
-
await _workflowService.TriggerAsync("entity.event", new Dictionary<string, object>{...}, language: "
|
|
61
|
+
// Trigger
|
|
62
|
+
await _workflowService.TriggerAsync("entity.event", new Dictionary<string, object>{...}, language: "en");
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
## TYPES
|
|
65
|
+
## STEP TYPES
|
|
66
66
|
|
|
67
67
|
### 1. SendEmail
|
|
68
68
|
```csharp
|
|
@@ -81,7 +81,7 @@ WorkflowStep.CreateConditionStep("Check premium", JsonSerializer.Serialize(new {
|
|
|
81
81
|
condition = "{{userType}} == 'Premium'",
|
|
82
82
|
trueStepOrder = 3, falseStepOrder = 4
|
|
83
83
|
}), order: 2);
|
|
84
|
-
//
|
|
84
|
+
// Operators: ==, !=, >, <, contains, &&, ||
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
### 4. Webhook
|
|
@@ -97,10 +97,10 @@ WorkflowStep.CreateWebhookStep("Notify CRM", JsonSerializer.Serialize(new {
|
|
|
97
97
|
## WORKFLOW CREATION
|
|
98
98
|
|
|
99
99
|
```csharp
|
|
100
|
-
// 1.
|
|
100
|
+
// 1. Create workflow
|
|
101
101
|
var workflow = Workflow.Create("welcome-sequence", "Welcome Sequence", description, triggerId, null, false, 10);
|
|
102
102
|
|
|
103
|
-
// 2.
|
|
103
|
+
// 2. Add steps
|
|
104
104
|
workflow.AddStep(WorkflowStep.CreateEmailStep("Welcome", templateId, 1));
|
|
105
105
|
workflow.AddStep(WorkflowStep.CreateWaitStep("Wait 24h", 1440, 2));
|
|
106
106
|
workflow.AddStep(WorkflowStep.CreateEmailStep("Follow-up", followUpTemplateId, 3));
|
|
@@ -109,16 +109,16 @@ workflow.AddStep(WorkflowStep.CreateEmailStep("Follow-up", followUpTemplateId, 3
|
|
|
109
109
|
builder.HasData(new { Id = ..., Code = "welcome-sequence", TriggerId = ..., IsActive = true, ... });
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
##
|
|
112
|
+
## TRIGGERING
|
|
113
113
|
|
|
114
114
|
```csharp
|
|
115
|
-
//
|
|
115
|
+
// In Service or Controller
|
|
116
116
|
await _workflowService.TriggerAsync("user.registered", new Dictionary<string, object>
|
|
117
117
|
{
|
|
118
118
|
["userId"] = user.Id,
|
|
119
119
|
["email"] = user.Email,
|
|
120
120
|
["confirmUrl"] = GenerateConfirmUrl(user.Id)
|
|
121
|
-
}, language: "
|
|
121
|
+
}, language: "en", ct);
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
## EMAIL TEMPLATES
|
|
@@ -129,10 +129,10 @@ EmailTemplate: Code, Name, Category, IsActive, Translations[]
|
|
|
129
129
|
EmailTemplateTranslation: LanguageCode, Subject, HtmlBody, TextBody
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
###
|
|
132
|
+
### Syntax (Handlebars)
|
|
133
133
|
```html
|
|
134
|
-
<h1>
|
|
135
|
-
{{#if isPremium}}<p>
|
|
134
|
+
<h1>Welcome {{userName}}!</h1>
|
|
135
|
+
{{#if isPremium}}<p>Thank you Premium member!</p>{{else}}<p>Premium offers...</p>{{/if}}
|
|
136
136
|
{{#each items}}<li>{{this.name}}</li>{{/each}}
|
|
137
137
|
```
|
|
138
138
|
|
|
@@ -148,31 +148,31 @@ workflowsApi.execute(workflowId, variables)
|
|
|
148
148
|
## CHECKLIST
|
|
149
149
|
|
|
150
150
|
```
|
|
151
|
-
□ Trigger
|
|
152
|
-
□ Workflow
|
|
151
|
+
□ Trigger identified (existing or new in WorkflowTriggerConfiguration.cs)
|
|
152
|
+
□ Workflow created: Unique code, Linked trigger, Priority (10=standard, 20+=priority)
|
|
153
153
|
□ Steps: SendEmail+templateId, Wait+delayMinutes, Condition+expression, Webhook+url
|
|
154
|
-
□ Email templates
|
|
155
|
-
□
|
|
154
|
+
□ Email templates created (if SendEmail)
|
|
155
|
+
□ Trigger added to source code
|
|
156
156
|
□ Tests: trigger, emails, variables
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
##
|
|
159
|
+
## ABSOLUTE RULES
|
|
160
160
|
|
|
161
161
|
| DO | DON'T |
|
|
162
162
|
|----|-------|
|
|
163
|
-
| IWorkflowService.TriggerAsync |
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
169
|
-
##
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|
|
173
|
-
| `Domain/Communications/Workflow.cs` |
|
|
174
|
-
| `Domain/Communications/WorkflowStep.cs` |
|
|
175
|
-
| `Domain/Communications/WorkflowTrigger.cs` |
|
|
163
|
+
| IWorkflowService.TriggerAsync | Direct execution |
|
|
164
|
+
| All trigger variables | Hardcoded URLs in templates |
|
|
165
|
+
| Specify language for emails | Secrets in variables |
|
|
166
|
+
| Unique kebab-case codes | Infinite loops (A→B→A) |
|
|
167
|
+
| Log executions | Forget email templates |
|
|
168
|
+
|
|
169
|
+
## KEY FILES
|
|
170
|
+
|
|
171
|
+
| File | Role |
|
|
172
|
+
|------|------|
|
|
173
|
+
| `Domain/Communications/Workflow.cs` | Workflow entity |
|
|
174
|
+
| `Domain/Communications/WorkflowStep.cs` | Step entity |
|
|
175
|
+
| `Domain/Communications/WorkflowTrigger.cs` | Trigger entity |
|
|
176
176
|
| `Application/Common/Interfaces/IWorkflowService.cs` | Interface |
|
|
177
177
|
| `Infrastructure/Services/Workflow/WorkflowExecutionService.cs` | Implementation |
|
|
178
178
|
| `Infrastructure/.../WorkflowConfiguration.cs` | EF Config + Seed |
|