/laravel-api-tool-kit:update-knowledgefrom laravel-api-tool-kit
Scans the conversation for confirmed findings (root causes, patterns, decisions) and maps them to project rules or feature knowledge files. Preserves learnings across sessions.
Claude never picks this command on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /laravel-api-tool-kit:update-knowledge still runs it.
Run this after completing a feature, fixing a bug, discovering a non-obvious data pattern, or making an architectural decision. Preserves learnings so future sessions start where this one ended.
Trigger phrases: "update knowledge", "update the skill", "remember this", "save what we learned", "update skills"
Also trigger proactively — if a significant discovery was confirmed during the session (root cause found, non-obvious gotcha, reusable pattern), run this without being asked.
Review the full conversation. Extract findings in these categories:
| Category | Examples |
|---|---|
| Root cause confirmed | "The bug was X because Y — verified with data/tests" |
| Pattern confirmed | "We consistently do X for Y in this project" |
| Anti-pattern found | "Never do X — it causes Y (confirmed with evidence)" |
| Decision made | "We chose X over Y because Z" |
| New constraint | "Field X must always be Y", "This API requires Z format" |
| Investigation insight | "When symptom X appears, always check Y first" |
| DB / data gotcha | "Column X is VARCHAR not INT", "Use scope X not Y for this query type" |
| Fix / solution | "The fix was to use X instead of Y" |
Skip:
ORDER_ID, USER_ID placeholders)There are two types of knowledge to update. Choose the right one:
These go into the skill's rules/ and workflows/ files.
| Finding type | Target |
|---|---|
| General coding rule | Closest rule file (rules/code-quality.md, rules/models.md, etc.) |
| Anti-pattern with wrong/correct example | rules/anti-patterns.md |
| Component-specific pattern | That component's rule file (rules/actions.md, rules/filters.md, etc.) |
| Multi-step process | Existing workflow or new workflows/[name].md |
| Project-level default | SKILL.md → Project Defaults section |
These go into per-feature knowledge docs in knowledge/[FEATURE].md. Use this for:
Knowledge location depends on the AI tool: .claude/knowledge/ (Claude Code), .agent/knowledge/ (Antigravity), or knowledge/ at project root (Cursor/Copilot). One file per feature area — never one file per investigation ticket.
Knowledge file template:
# [Feature Name] Knowledge
Last Updated: YYYY-MM-DD
## How It Works
Brief description of the feature's core flow.
## Issues Found & Fixed
### Issue 1: [Short title]
**Symptom**: What the user reported.
**Root cause**: What actually caused it (with data evidence).
**Fix**: What was changed.
**Diagnostic query** (if applicable):
\`\`\`sql
SELECT ... FROM ... WHERE feature_id = FEATURE_ID;
\`\`\`
## Key Lessons
- When [symptom X] → always check [Y] first
- [Column/field] is [type] not [assumed type]
## DB Gotchas
- `table.column` is VARCHAR not INT — use `'value'` not `12`
Rules for writing:
ORDER_ID, Car, User — never session-specific namesGood (directive format):
**NEVER access a relationship in a Resource without `whenLoaded()`**
// Wrong — causes N+1 on every request
'brand' => $this->brand->name,
// Correct
'brand' => $this->whenLoaded('brand')?->name,
Bad (narrative format):
We found that in the CarResource, accessing the brand relationship directly
was causing N+1 queries because we didn't use whenLoaded(). This happened
during the cars refactor in March 2026 when we added the brand relationship.
# [Rule / Component Name]
## Rules
- MUST ...
- NEVER ...
## [Pattern Name]
\`\`\`php
// Wrong
...
// Correct
...
\`\`\`
Tell the user exactly what changed:
Updated rules/models.md:
→ Added: ULID models must declare $keyType = 'string' and $incrementing = false
Updated rules/anti-patterns.md:
→ Added: NEVER access relationship in Resource without whenLoaded() (N+1)
Created knowledge/orders.md:
→ Documented root cause: order status is VARCHAR not INT — always quote it
→ Added diagnostic query: check stuck orders by status + created_at range
Nothing new for rules/controllers.md — already covered.
If nothing new: "All learnings from this session are already covered in the knowledge base."
❌ Writing narrative ("In this session we discovered...")
❌ Including specific IDs — use placeholders (ORDER_ID, USER_ID)
❌ Adding unconfirmed findings — only what was verified
❌ Creating a new rule file for a single one-off finding — add to an existing file
❌ Creating a new knowledge doc per investigation ticket — one file per feature
❌ Skipping the read-before-write check (duplicates)
✅ Write directives: "When X → do Y" ✅ Include reusable code/SQL with generic placeholders ✅ Separate architectural rules (rules/) from project knowledge (knowledge/) ✅ Keep findings brief and scannable ✅ Always read the target file before writing to it
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
Generated from the plugin's indexed repository (ahmedesa/laravel-api-tool-kit) — no native marketplace selected
npx claudepluginhub p/ahmedesa-laravel-api-tool-kit9 commands in this plugin
/add-filterWorkflow: Add Filtering to an Existing ModelUse this when an existing model needs filtering, sorting, or search added to its list endpoint./code-reviewWorkflow: Code ReviewA defense-oriented multi-phase code review. Validates feature completeness against acceptance criteria, catches real bugs (not just style), and separates introduced issues from pre-existing debt./create-workflowWorkflow: Create a New WorkflowUse this when you discover a repeatable process during a session — an investigation type, a setup procedure, a debugging pattern — that should be captured as a reusable workflow./curl-testWorkflow: Test an API Endpoint with CurlUse during investigation or feature verification to test an endpoint directly and cross-reference its response against the database./investigateWorkflow: Investigate & DebugStructured debugging workflow for any issue — wrong response, missing data, queue failures, auth problems, performance issues. Works for any Laravel API project./new-endpointWorkflow: Add a New CRUD EndpointFollow these steps in order. Do not skip steps or reorder them.Other plugins' commands for the same job