engremran07/gsmvault/alp-store-actions

Claude Code and agent skill by engremran07/gsmvault

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Store actions and methods. Use when: mutating global store state, defining store methods for add/remove/toggle, async store operations with fetch.

Install

npx vskill@latest install engremran07/gsmvault/alp-store-actions

SKILL.md

The same SKILL.md was published earlier as engremran07/gsmvault/alp-store-actions.

Alpine Store Actions

When to Use

  • Defining methods that mutate global store state (add, remove, toggle, set)
  • Performing async operations (fetch) that update store data
  • Encapsulating business logic in store methods rather than inline templates

Patterns

Basic CRUD Actions
html
<script>
document.addEventListener('alpine:init', () => {
Alpine.store('bookmarks', {
items: [],
add(item) {
if (!this.items.find(b => b.id === item.id)) {
this.items.push(item);
}
},
remove(id) {
this.items = this.items.filter(b => b.id !== id);
},
toggle(item) {
this.has(item.id) ? this.remove(item.id) : this.add(item);
},
has(id) {
return this.items.some(b => b.id === id);
}
});
});
</script>
Async Action with Fetch
html
<script>
document.addEventListener('alpine:init', () => {
Alpine.store('notifications', {
items: [],
loading: false,
async fetch() {
this.loading = true;
try {
const res = await fetch('/api/v1/notifications/', {
headers: { 'X-CSRFToken': document.querySelector('[name=csrfmiddlewaretoken]')?.value || '' }
});
if (res.ok) this.items = await res.json();
} finally {
this.loading = false;
}
},
async markRead(id) {
await fetch(`/api/v1/notifications/${id}/read/`, { method: 'POST',
headers: { 'X-CSRFToken': document.querySelector('[name=csrfmiddlewaretoken]')?.value || '' }
});
const item = this.items.find(n => n.id === id);
if (item) item.read = true;
}
});
});
</script>
Using Actions in Templates
html
<div x-data>
<button @click="$store.bookmarks.toggle({ id: {{ fw.pk }}, name: '{{ fw.name|escapejs }}' })">
<template x-if="$store.bookmarks.has({{ fw.pk }})"><i data-lucide="bookmark-check"></i></template>
<template x-if="!$store.bookmarks.has({{ fw.pk }})"><i data-lucide="bookmark"></i></template>
</button>
</div>

Anti-Patterns

PatternProblemFix
Mutation logic in templatesHard to debug, duplicatedMove to store methods
fetch() without CSRF header403 on POST/PUT/DELETEInclude X-CSRFToken header
No error handling in async actionsSilent failuresAdd try/catch, set error state
Direct this.items.splice() in templateReactivity issuesUse store method with reassignment

Red Flags

  • Inline mutation logic duplicated across multiple templates
  • Async actions without loading/error state management
  • CSRF token missing on mutating fetch calls

Quality Gate

powershell
& .\.venv\Scripts\python.exe -m ruff check . --fix
& .\.venv\Scripts\python.exe -m ruff format .
& .\.venv\Scripts\python.exe manage.py check --settings=app.settings_dev

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/engremran07/gsmvault/alp-store-actions/badge)](https://verified-skill.com/skills/engremran07/gsmvault/alp-store-actions)

Something wrong with this skill or its page? Tell us.