@event4u/agent-config 1.9.1
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/.agent-src/README.md +64 -0
- package/.agent-src/commands/agent-handoff.md +64 -0
- package/.agent-src/commands/agent-status.md +83 -0
- package/.agent-src/commands/agents-audit.md +243 -0
- package/.agent-src/commands/agents-cleanup.md +169 -0
- package/.agent-src/commands/agents-prepare.md +137 -0
- package/.agent-src/commands/analyze-reference-repo.md +191 -0
- package/.agent-src/commands/bug-fix.md +181 -0
- package/.agent-src/commands/bug-investigate.md +175 -0
- package/.agent-src/commands/commit.md +121 -0
- package/.agent-src/commands/compress.md +177 -0
- package/.agent-src/commands/config-agent-settings.md +126 -0
- package/.agent-src/commands/context-create.md +167 -0
- package/.agent-src/commands/context-refactor.md +170 -0
- package/.agent-src/commands/copilot-agents-init.md +150 -0
- package/.agent-src/commands/copilot-agents-optimize.md +251 -0
- package/.agent-src/commands/create-pr-description.md +112 -0
- package/.agent-src/commands/create-pr.md +76 -0
- package/.agent-src/commands/do-and-judge.md +114 -0
- package/.agent-src/commands/do-in-steps.md +84 -0
- package/.agent-src/commands/e2e-heal.md +98 -0
- package/.agent-src/commands/e2e-plan.md +85 -0
- package/.agent-src/commands/estimate-ticket.md +80 -0
- package/.agent-src/commands/feature-dev.md +111 -0
- package/.agent-src/commands/feature-explore.md +180 -0
- package/.agent-src/commands/feature-plan.md +288 -0
- package/.agent-src/commands/feature-refactor.md +181 -0
- package/.agent-src/commands/feature-roadmap.md +184 -0
- package/.agent-src/commands/fix-ci.md +48 -0
- package/.agent-src/commands/fix-portability.md +97 -0
- package/.agent-src/commands/fix-pr-bot-comments.md +146 -0
- package/.agent-src/commands/fix-pr-comments.md +58 -0
- package/.agent-src/commands/fix-pr-developer-comments.md +152 -0
- package/.agent-src/commands/fix-references.md +94 -0
- package/.agent-src/commands/fix-seeder.md +146 -0
- package/.agent-src/commands/implement-ticket.md +133 -0
- package/.agent-src/commands/jira-ticket.md +71 -0
- package/.agent-src/commands/judge.md +86 -0
- package/.agent-src/commands/memory-add.md +130 -0
- package/.agent-src/commands/memory-full.md +97 -0
- package/.agent-src/commands/memory-promote.md +144 -0
- package/.agent-src/commands/mode.md +121 -0
- package/.agent-src/commands/module-create.md +132 -0
- package/.agent-src/commands/module-explore.md +157 -0
- package/.agent-src/commands/optimize-agents.md +139 -0
- package/.agent-src/commands/optimize-augmentignore.md +262 -0
- package/.agent-src/commands/optimize-rtk-filters.md +120 -0
- package/.agent-src/commands/optimize-skills.md +121 -0
- package/.agent-src/commands/override-create.md +97 -0
- package/.agent-src/commands/override-manage.md +96 -0
- package/.agent-src/commands/package-reset.md +154 -0
- package/.agent-src/commands/package-test.md +154 -0
- package/.agent-src/commands/prepare-for-review.md +91 -0
- package/.agent-src/commands/project-analyze.md +300 -0
- package/.agent-src/commands/project-health.md +95 -0
- package/.agent-src/commands/propose-memory.md +108 -0
- package/.agent-src/commands/quality-fix.md +106 -0
- package/.agent-src/commands/refine-ticket.md +81 -0
- package/.agent-src/commands/review-changes.md +130 -0
- package/.agent-src/commands/review-routing.md +111 -0
- package/.agent-src/commands/roadmap-create.md +110 -0
- package/.agent-src/commands/roadmap-execute.md +68 -0
- package/.agent-src/commands/rule-compliance-audit.md +139 -0
- package/.agent-src/commands/tests-create.md +73 -0
- package/.agent-src/commands/tests-execute.md +58 -0
- package/.agent-src/commands/threat-model.md +115 -0
- package/.agent-src/commands/update-form-request-messages.md +189 -0
- package/.agent-src/commands/upstream-contribute.md +171 -0
- package/.agent-src/contexts/augment-infrastructure.md +181 -0
- package/.agent-src/contexts/documentation-hierarchy.md +142 -0
- package/.agent-src/contexts/model-recommendations.md +142 -0
- package/.agent-src/contexts/override-system.md +187 -0
- package/.agent-src/contexts/skills-and-commands.md +154 -0
- package/.agent-src/contexts/subagent-configuration.md +62 -0
- package/.agent-src/guidelines/agent-infra/agent-interaction-and-decision-quality.md +110 -0
- package/.agent-src/guidelines/agent-infra/break-glass-usage.md +113 -0
- package/.agent-src/guidelines/agent-infra/developer-judgment.md +82 -0
- package/.agent-src/guidelines/agent-infra/engineering-memory-data-format.md +117 -0
- package/.agent-src/guidelines/agent-infra/layered-settings.md +158 -0
- package/.agent-src/guidelines/agent-infra/memory-access.md +121 -0
- package/.agent-src/guidelines/agent-infra/naming.md +69 -0
- package/.agent-src/guidelines/agent-infra/output-patterns.md +117 -0
- package/.agent-src/guidelines/agent-infra/review-routing-data-format.md +144 -0
- package/.agent-src/guidelines/agent-infra/role-contracts.md +211 -0
- package/.agent-src/guidelines/agent-infra/role-mode-router.md +89 -0
- package/.agent-src/guidelines/agent-infra/runtime-layer.md +89 -0
- package/.agent-src/guidelines/agent-infra/self-improvement-pipeline.md +135 -0
- package/.agent-src/guidelines/agent-infra/size-and-scope.md +189 -0
- package/.agent-src/guidelines/agent-infra/tool-integration.md +73 -0
- package/.agent-src/guidelines/docs/readme-size-and-splitting.md +153 -0
- package/.agent-src/guidelines/e2e/playwright.md +363 -0
- package/.agent-src/guidelines/php/api-design.md +115 -0
- package/.agent-src/guidelines/php/artisan-commands.md +81 -0
- package/.agent-src/guidelines/php/blade-ui.md +78 -0
- package/.agent-src/guidelines/php/controllers.md +90 -0
- package/.agent-src/guidelines/php/database.md +111 -0
- package/.agent-src/guidelines/php/eloquent.md +208 -0
- package/.agent-src/guidelines/php/flux.md +80 -0
- package/.agent-src/guidelines/php/general.md +191 -0
- package/.agent-src/guidelines/php/git.md +96 -0
- package/.agent-src/guidelines/php/jobs.md +111 -0
- package/.agent-src/guidelines/php/livewire.md +71 -0
- package/.agent-src/guidelines/php/logging.md +79 -0
- package/.agent-src/guidelines/php/naming.md +89 -0
- package/.agent-src/guidelines/php/patterns/dependency-injection.md +57 -0
- package/.agent-src/guidelines/php/patterns/dtos.md +199 -0
- package/.agent-src/guidelines/php/patterns/events.md +67 -0
- package/.agent-src/guidelines/php/patterns/factory.md +53 -0
- package/.agent-src/guidelines/php/patterns/pipelines.md +66 -0
- package/.agent-src/guidelines/php/patterns/policies.md +66 -0
- package/.agent-src/guidelines/php/patterns/repositories.md +122 -0
- package/.agent-src/guidelines/php/patterns/service-layer.md +64 -0
- package/.agent-src/guidelines/php/patterns/strategy.md +69 -0
- package/.agent-src/guidelines/php/patterns.md +28 -0
- package/.agent-src/guidelines/php/performance.md +92 -0
- package/.agent-src/guidelines/php/resources.md +100 -0
- package/.agent-src/guidelines/php/security.md +110 -0
- package/.agent-src/guidelines/php/sql.md +97 -0
- package/.agent-src/guidelines/php/validations.md +119 -0
- package/.agent-src/guidelines/php/websocket.md +100 -0
- package/.agent-src/personas/README.md +104 -0
- package/.agent-src/personas/ai-agent.md +77 -0
- package/.agent-src/personas/critical-challenger.md +73 -0
- package/.agent-src/personas/developer.md +73 -0
- package/.agent-src/personas/product-owner.md +78 -0
- package/.agent-src/personas/qa.md +67 -0
- package/.agent-src/personas/senior-engineer.md +77 -0
- package/.agent-src/personas/stakeholder.md +78 -0
- package/.agent-src/rules/agent-docs.md +61 -0
- package/.agent-src/rules/analysis-skill-routing.md +48 -0
- package/.agent-src/rules/architecture.md +62 -0
- package/.agent-src/rules/artifact-drafting-protocol.md +73 -0
- package/.agent-src/rules/ask-when-uncertain.md +52 -0
- package/.agent-src/rules/augment-portability.md +38 -0
- package/.agent-src/rules/augment-source-of-truth.md +128 -0
- package/.agent-src/rules/capture-learnings.md +89 -0
- package/.agent-src/rules/cli-output-handling.md +94 -0
- package/.agent-src/rules/commit-conventions.md +64 -0
- package/.agent-src/rules/context-hygiene.md +90 -0
- package/.agent-src/rules/docker-commands.md +55 -0
- package/.agent-src/rules/docs-sync.md +79 -0
- package/.agent-src/rules/downstream-changes.md +70 -0
- package/.agent-src/rules/e2e-testing.md +53 -0
- package/.agent-src/rules/guidelines.md +90 -0
- package/.agent-src/rules/improve-before-implement.md +94 -0
- package/.agent-src/rules/language-and-tone.md +104 -0
- package/.agent-src/rules/laravel-translations.md +48 -0
- package/.agent-src/rules/markdown-safe-codeblocks.md +18 -0
- package/.agent-src/rules/minimal-safe-diff.md +87 -0
- package/.agent-src/rules/missing-tool-handling.md +62 -0
- package/.agent-src/rules/model-recommendation.md +70 -0
- package/.agent-src/rules/package-ci-checks.md +80 -0
- package/.agent-src/rules/php-coding.md +63 -0
- package/.agent-src/rules/preservation-guard.md +29 -0
- package/.agent-src/rules/review-routing-awareness.md +125 -0
- package/.agent-src/rules/reviewer-awareness.md +92 -0
- package/.agent-src/rules/roadmap-progress-sync.md +56 -0
- package/.agent-src/rules/role-mode-adherence.md +54 -0
- package/.agent-src/rules/rule-type-governance.md +46 -0
- package/.agent-src/rules/runtime-safety.md +42 -0
- package/.agent-src/rules/scope-control.md +40 -0
- package/.agent-src/rules/security-sensitive-stop.md +77 -0
- package/.agent-src/rules/size-enforcement.md +29 -0
- package/.agent-src/rules/skill-improvement-trigger.md +58 -0
- package/.agent-src/rules/skill-quality.md +110 -0
- package/.agent-src/rules/slash-commands.md +30 -0
- package/.agent-src/rules/think-before-action.md +91 -0
- package/.agent-src/rules/token-efficiency.md +99 -0
- package/.agent-src/rules/tool-safety.md +36 -0
- package/.agent-src/rules/upstream-proposal.md +76 -0
- package/.agent-src/rules/user-interaction.md +79 -0
- package/.agent-src/rules/verify-before-complete.md +120 -0
- package/.agent-src/scripts/scan-seeder-violations.php +145 -0
- package/.agent-src/scripts/update_roadmap_progress.py +244 -0
- package/.agent-src/skills/adversarial-review/SKILL.md +149 -0
- package/.agent-src/skills/agent-docs-writing/SKILL.md +234 -0
- package/.agent-src/skills/analysis-autonomous-mode/SKILL.md +197 -0
- package/.agent-src/skills/analysis-skill-router/SKILL.md +134 -0
- package/.agent-src/skills/api-design/SKILL.md +104 -0
- package/.agent-src/skills/api-endpoint/SKILL.md +185 -0
- package/.agent-src/skills/api-testing/SKILL.md +206 -0
- package/.agent-src/skills/artisan-commands/SKILL.md +78 -0
- package/.agent-src/skills/authz-review/SKILL.md +171 -0
- package/.agent-src/skills/aws-infrastructure/SKILL.md +152 -0
- package/.agent-src/skills/blade-ui/SKILL.md +75 -0
- package/.agent-src/skills/blast-radius-analyzer/SKILL.md +185 -0
- package/.agent-src/skills/bug-analyzer/SKILL.md +256 -0
- package/.agent-src/skills/check-refs/SKILL.md +72 -0
- package/.agent-src/skills/code-refactoring/SKILL.md +200 -0
- package/.agent-src/skills/code-review/SKILL.md +214 -0
- package/.agent-src/skills/command-routing/SKILL.md +96 -0
- package/.agent-src/skills/command-writing/SKILL.md +143 -0
- package/.agent-src/skills/composer-packages/SKILL.md +172 -0
- package/.agent-src/skills/context-authoring/SKILL.md +157 -0
- package/.agent-src/skills/context-document/SKILL.md +153 -0
- package/.agent-src/skills/conventional-commits-writing/SKILL.md +70 -0
- package/.agent-src/skills/copilot-agents-optimization/SKILL.md +220 -0
- package/.agent-src/skills/copilot-config/SKILL.md +203 -0
- package/.agent-src/skills/dashboard-design/SKILL.md +116 -0
- package/.agent-src/skills/data-flow-mapper/SKILL.md +160 -0
- package/.agent-src/skills/database/SKILL.md +91 -0
- package/.agent-src/skills/dependency-upgrade/SKILL.md +204 -0
- package/.agent-src/skills/description-assist/SKILL.md +169 -0
- package/.agent-src/skills/design-review/SKILL.md +228 -0
- package/.agent-src/skills/devcontainer/SKILL.md +121 -0
- package/.agent-src/skills/developer-like-execution/SKILL.md +276 -0
- package/.agent-src/skills/docker/SKILL.md +245 -0
- package/.agent-src/skills/dto-creator/SKILL.md +117 -0
- package/.agent-src/skills/eloquent/SKILL.md +92 -0
- package/.agent-src/skills/eloquent/evals/last-run.json +99 -0
- package/.agent-src/skills/eloquent/evals/triggers.json +16 -0
- package/.agent-src/skills/estimate-ticket/SKILL.md +186 -0
- package/.agent-src/skills/estimate-ticket/evals/output-schema.yml +20 -0
- package/.agent-src/skills/estimate-ticket/evals/triggers.json +18 -0
- package/.agent-src/skills/fe-design/SKILL.md +223 -0
- package/.agent-src/skills/feature-planning/SKILL.md +226 -0
- package/.agent-src/skills/file-editor/SKILL.md +129 -0
- package/.agent-src/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/.agent-src/skills/flux/SKILL.md +64 -0
- package/.agent-src/skills/git-workflow/SKILL.md +102 -0
- package/.agent-src/skills/github-ci/SKILL.md +122 -0
- package/.agent-src/skills/grafana/SKILL.md +168 -0
- package/.agent-src/skills/guideline-writing/SKILL.md +147 -0
- package/.agent-src/skills/jira-integration/SKILL.md +182 -0
- package/.agent-src/skills/jobs-events/SKILL.md +87 -0
- package/.agent-src/skills/judge-bug-hunter/SKILL.md +157 -0
- package/.agent-src/skills/judge-code-quality/SKILL.md +158 -0
- package/.agent-src/skills/judge-security-auditor/SKILL.md +167 -0
- package/.agent-src/skills/judge-test-coverage/SKILL.md +154 -0
- package/.agent-src/skills/laravel/SKILL.md +195 -0
- package/.agent-src/skills/laravel-horizon/SKILL.md +169 -0
- package/.agent-src/skills/laravel-mail/SKILL.md +193 -0
- package/.agent-src/skills/laravel-middleware/SKILL.md +185 -0
- package/.agent-src/skills/laravel-notifications/SKILL.md +168 -0
- package/.agent-src/skills/laravel-pennant/SKILL.md +188 -0
- package/.agent-src/skills/laravel-pulse/SKILL.md +160 -0
- package/.agent-src/skills/laravel-reverb/SKILL.md +205 -0
- package/.agent-src/skills/laravel-scheduling/SKILL.md +167 -0
- package/.agent-src/skills/laravel-validation/SKILL.md +71 -0
- package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +249 -0
- package/.agent-src/skills/lint-skills/SKILL.md +72 -0
- package/.agent-src/skills/livewire/SKILL.md +79 -0
- package/.agent-src/skills/logging-monitoring/SKILL.md +100 -0
- package/.agent-src/skills/mcp/SKILL.md +193 -0
- package/.agent-src/skills/merge-conflicts/SKILL.md +158 -0
- package/.agent-src/skills/migration-creator/SKILL.md +160 -0
- package/.agent-src/skills/module-management/SKILL.md +154 -0
- package/.agent-src/skills/multi-tenancy/SKILL.md +129 -0
- package/.agent-src/skills/openapi/SKILL.md +154 -0
- package/.agent-src/skills/override-management/SKILL.md +186 -0
- package/.agent-src/skills/performance/SKILL.md +69 -0
- package/.agent-src/skills/performance-analysis/SKILL.md +118 -0
- package/.agent-src/skills/pest-testing/SKILL.md +321 -0
- package/.agent-src/skills/php-coder/SKILL.md +78 -0
- package/.agent-src/skills/php-coder/evals/triggers.json +16 -0
- package/.agent-src/skills/php-debugging/SKILL.md +184 -0
- package/.agent-src/skills/php-service/SKILL.md +96 -0
- package/.agent-src/skills/playwright-testing/SKILL.md +244 -0
- package/.agent-src/skills/project-analysis-core/SKILL.md +138 -0
- package/.agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +130 -0
- package/.agent-src/skills/project-analysis-laravel/SKILL.md +119 -0
- package/.agent-src/skills/project-analysis-nextjs/SKILL.md +123 -0
- package/.agent-src/skills/project-analysis-node-express/SKILL.md +111 -0
- package/.agent-src/skills/project-analysis-react/SKILL.md +119 -0
- package/.agent-src/skills/project-analysis-symfony/SKILL.md +111 -0
- package/.agent-src/skills/project-analysis-zend-laminas/SKILL.md +108 -0
- package/.agent-src/skills/project-analyzer/SKILL.md +341 -0
- package/.agent-src/skills/project-docs/SKILL.md +137 -0
- package/.agent-src/skills/quality-tools/SKILL.md +411 -0
- package/.agent-src/skills/readme-reviewer/SKILL.md +187 -0
- package/.agent-src/skills/readme-writing/SKILL.md +142 -0
- package/.agent-src/skills/readme-writing-package/SKILL.md +185 -0
- package/.agent-src/skills/receiving-code-review/SKILL.md +190 -0
- package/.agent-src/skills/refine-ticket/SKILL.md +310 -0
- package/.agent-src/skills/refine-ticket/detection-map.yml +124 -0
- package/.agent-src/skills/refine-ticket/evals/output-schema.yml +16 -0
- package/.agent-src/skills/refine-ticket/evals/triggers.json +16 -0
- package/.agent-src/skills/requesting-code-review/SKILL.md +199 -0
- package/.agent-src/skills/review-routing/SKILL.md +195 -0
- package/.agent-src/skills/roadmap-management/SKILL.md +303 -0
- package/.agent-src/skills/rtk-output-filtering/SKILL.md +184 -0
- package/.agent-src/skills/rule-writing/SKILL.md +148 -0
- package/.agent-src/skills/security/SKILL.md +79 -0
- package/.agent-src/skills/security-audit/SKILL.md +123 -0
- package/.agent-src/skills/sentry-integration/SKILL.md +170 -0
- package/.agent-src/skills/sequential-thinking/SKILL.md +158 -0
- package/.agent-src/skills/skill-improvement-pipeline/SKILL.md +155 -0
- package/.agent-src/skills/skill-management/SKILL.md +121 -0
- package/.agent-src/skills/skill-reviewer/SKILL.md +218 -0
- package/.agent-src/skills/skill-writing/SKILL.md +291 -0
- package/.agent-src/skills/skill-writing/evals/triggers.json +16 -0
- package/.agent-src/skills/sql-writing/SKILL.md +74 -0
- package/.agent-src/skills/subagent-orchestration/SKILL.md +190 -0
- package/.agent-src/skills/systematic-debugging/SKILL.md +244 -0
- package/.agent-src/skills/technical-specification/SKILL.md +185 -0
- package/.agent-src/skills/terraform/SKILL.md +137 -0
- package/.agent-src/skills/terragrunt/SKILL.md +217 -0
- package/.agent-src/skills/test-driven-development/SKILL.md +252 -0
- package/.agent-src/skills/test-performance/SKILL.md +172 -0
- package/.agent-src/skills/threat-modeling/SKILL.md +189 -0
- package/.agent-src/skills/traefik/SKILL.md +319 -0
- package/.agent-src/skills/universal-project-analysis/SKILL.md +179 -0
- package/.agent-src/skills/upstream-contribute/SKILL.md +255 -0
- package/.agent-src/skills/using-git-worktrees/SKILL.md +148 -0
- package/.agent-src/skills/validate-feature-fit/SKILL.md +113 -0
- package/.agent-src/skills/verify-before-complete/SKILL.md +188 -0
- package/.agent-src/skills/websocket/SKILL.md +75 -0
- package/.agent-src/templates/AGENTS.md +146 -0
- package/.agent-src/templates/agent-settings.md +256 -0
- package/.agent-src/templates/agents/.gitattributes.fragment +16 -0
- package/.agent-src/templates/agents/agent-project-settings.example.yml +138 -0
- package/.agent-src/templates/agents/memory/architecture-decisions.example.yml +95 -0
- package/.agent-src/templates/agents/memory/domain-invariants.example.yml +80 -0
- package/.agent-src/templates/agents/memory/historical-patterns.example.yml +82 -0
- package/.agent-src/templates/agents/memory/incident-learnings.example.yml +113 -0
- package/.agent-src/templates/agents/memory/ownership.example.yml +75 -0
- package/.agent-src/templates/agents/memory/product-rules.example.yml +87 -0
- package/.agent-src/templates/agents/proposal.example.md +143 -0
- package/.agent-src/templates/command.md +84 -0
- package/.agent-src/templates/contexts/auth-model.md +59 -0
- package/.agent-src/templates/contexts/data-sensitivity.md +60 -0
- package/.agent-src/templates/contexts/deployment-order.md +72 -0
- package/.agent-src/templates/contexts/observability.md +64 -0
- package/.agent-src/templates/contexts/tenant-boundaries.md +68 -0
- package/.agent-src/templates/contexts.md +116 -0
- package/.agent-src/templates/copilot-instructions.md +115 -0
- package/.agent-src/templates/features.md +125 -0
- package/.agent-src/templates/github-workflows/memory-hygiene.yml +133 -0
- package/.agent-src/templates/github-workflows/pr-risk-review.yml +123 -0
- package/.agent-src/templates/github-workflows/proposal-drift.yml +118 -0
- package/.agent-src/templates/overrides/command.md +24 -0
- package/.agent-src/templates/overrides/guideline.md +21 -0
- package/.agent-src/templates/overrides/rule.md +19 -0
- package/.agent-src/templates/overrides/skill.md +24 -0
- package/.agent-src/templates/overrides/template.md +21 -0
- package/.agent-src/templates/persona.md +99 -0
- package/.agent-src/templates/roadmaps.md +109 -0
- package/.agent-src/templates/scripts/README.md +195 -0
- package/.agent-src/templates/scripts/check_memory.py +283 -0
- package/.agent-src/templates/scripts/check_memory_proposal.py +180 -0
- package/.agent-src/templates/scripts/historical-bug-patterns.example.yml +84 -0
- package/.agent-src/templates/scripts/implement_ticket/__init__.py +57 -0
- package/.agent-src/templates/scripts/implement_ticket/__main__.py +9 -0
- package/.agent-src/templates/scripts/implement_ticket/cli.py +171 -0
- package/.agent-src/templates/scripts/implement_ticket/delivery_state.py +130 -0
- package/.agent-src/templates/scripts/implement_ticket/dispatcher.py +134 -0
- package/.agent-src/templates/scripts/implement_ticket/persona_policy.py +85 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/__init__.py +49 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/analyze.py +98 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/implement.py +145 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/memory.py +136 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/plan.py +175 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/refine.py +140 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/report.py +195 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/test.py +180 -0
- package/.agent-src/templates/scripts/implement_ticket/steps/verify.py +170 -0
- package/.agent-src/templates/scripts/memory_hash.py +75 -0
- package/.agent-src/templates/scripts/memory_lookup.py +216 -0
- package/.agent-src/templates/scripts/memory_report.py +184 -0
- package/.agent-src/templates/scripts/memory_signal.py +167 -0
- package/.agent-src/templates/scripts/memory_status.py +156 -0
- package/.agent-src/templates/scripts/ownership-map.example.yml +87 -0
- package/.agent-src/templates/scripts/pr-risk-config.example.yml +76 -0
- package/.agent-src/templates/scripts/pr_review_routing.py +340 -0
- package/.agent-src/templates/scripts/pr_risk_review.py +211 -0
- package/.agent-src/templates/skill.md +136 -0
- package/.augment-plugin/marketplace.json +32 -0
- package/.augment-plugin/plugin.json +21 -0
- package/.claude-plugin/marketplace.json +119 -0
- package/AGENTS.md +121 -0
- package/CHANGELOG.md +279 -0
- package/CONTRIBUTING.md +176 -0
- package/LICENSE +21 -0
- package/README.md +357 -0
- package/bin/install.php +38 -0
- package/composer.json +29 -0
- package/config/agent-settings.template.yml +96 -0
- package/config/profiles/balanced.ini +10 -0
- package/config/profiles/full.ini +10 -0
- package/config/profiles/minimal.ini +10 -0
- package/docs/architecture.md +144 -0
- package/docs/customization.md +88 -0
- package/docs/development.md +171 -0
- package/docs/getting-started.md +130 -0
- package/docs/github-topics.md +84 -0
- package/docs/installation.md +376 -0
- package/docs/mcp.md +133 -0
- package/docs/quality.md +98 -0
- package/docs/skills-catalog.md +136 -0
- package/docs/troubleshooting.md +167 -0
- package/llms.txt +130 -0
- package/package.json +31 -0
- package/scripts/audit_skill_descriptions.py +168 -0
- package/scripts/check_compression.py +221 -0
- package/scripts/check_memory.py +341 -0
- package/scripts/check_memory_proposal.py +180 -0
- package/scripts/check_portability.py +320 -0
- package/scripts/check_proposal.py +269 -0
- package/scripts/check_references.py +400 -0
- package/scripts/ci_summary.py +131 -0
- package/scripts/compress.py +671 -0
- package/scripts/compress.sh +18 -0
- package/scripts/first-run.sh +109 -0
- package/scripts/generate_catalog.py +116 -0
- package/scripts/install +151 -0
- package/scripts/install-hooks.sh +29 -0
- package/scripts/install.py +487 -0
- package/scripts/install.sh +637 -0
- package/scripts/install_anthropic_key.sh +101 -0
- package/scripts/inventory_frontmatter.py +164 -0
- package/scripts/lint_marketplace.py +142 -0
- package/scripts/lint_regression.py +232 -0
- package/scripts/mcp_render.py +159 -0
- package/scripts/measure_patterns.py +376 -0
- package/scripts/memory_hash.py +75 -0
- package/scripts/memory_lookup.py +441 -0
- package/scripts/memory_report.py +336 -0
- package/scripts/memory_signal.py +210 -0
- package/scripts/memory_status.py +195 -0
- package/scripts/postinstall.sh +60 -0
- package/scripts/readme_linter.py +580 -0
- package/scripts/refine_ticket_detect.py +623 -0
- package/scripts/requirements-evals.txt +7 -0
- package/scripts/runtime_dispatcher.py +265 -0
- package/scripts/runtime_handler.py +148 -0
- package/scripts/runtime_registry.py +166 -0
- package/scripts/schemas/command.schema.json +32 -0
- package/scripts/schemas/persona.schema.json +42 -0
- package/scripts/schemas/rule.schema.json +28 -0
- package/scripts/schemas/skill.schema.json +73 -0
- package/scripts/setup.sh +230 -0
- package/scripts/setup_eval_venv.sh +58 -0
- package/scripts/skill_linter.py +2175 -0
- package/scripts/skill_trigger_eval.py +651 -0
- package/scripts/tool_registry.py +146 -0
- package/scripts/tools/__init__.py +1 -0
- package/scripts/tools/adapter_errors.py +63 -0
- package/scripts/tools/base_adapter.py +91 -0
- package/scripts/tools/github_adapter.py +128 -0
- package/scripts/tools/jira_adapter.py +115 -0
- package/scripts/update_counts.py +147 -0
- package/scripts/validate_frontmatter.py +424 -0
- package/templates/consumer-settings/README.md +46 -0
- package/templates/consumer-settings/augment-settings.json +12 -0
- package/templates/consumer-settings/claude-settings.json +9 -0
- package/templates/consumer-settings/copilot-settings.json +14 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: laravel-middleware
|
|
3
|
+
description: "Use when creating or modifying Laravel middleware — request/response filtering, groups, priority, terminable middleware, or route-level assignment."
|
|
4
|
+
source: package
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# laravel-middleware
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Use this skill when working with HTTP middleware:
|
|
12
|
+
- Creating custom middleware for authentication, logging, headers, etc.
|
|
13
|
+
- Configuring middleware groups and priority
|
|
14
|
+
- Terminable middleware (post-response processing)
|
|
15
|
+
- Route-level and global middleware assignment
|
|
16
|
+
|
|
17
|
+
## Procedure: Create middleware
|
|
18
|
+
|
|
19
|
+
1. **Generate class** — `php artisan make:middleware EnsureCustomerIsActive`.
|
|
20
|
+
2. **Implement logic** — Handle request in `handle()`, return response or pass to next.
|
|
21
|
+
3. **Register** — Add to route group or global middleware stack.
|
|
22
|
+
4. **Verify** — Run tests covering both allowed and blocked request scenarios.
|
|
23
|
+
|
|
24
|
+
### Example
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
php artisan make:middleware EnsureCustomerIsActive
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```php
|
|
31
|
+
declare(strict_types=1);
|
|
32
|
+
|
|
33
|
+
namespace App\Http\Middleware;
|
|
34
|
+
|
|
35
|
+
use Closure;
|
|
36
|
+
use Illuminate\Http\Request;
|
|
37
|
+
use Symfony\Component\HttpFoundation\Response;
|
|
38
|
+
|
|
39
|
+
class EnsureCustomerIsActive
|
|
40
|
+
{
|
|
41
|
+
public function handle(Request $request, Closure $next): Response
|
|
42
|
+
{
|
|
43
|
+
if (!$request->user()?->getCustomer()?->isActive()) {
|
|
44
|
+
abort(403, 'Customer account is inactive.');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return $next($request);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Before vs. After middleware
|
|
53
|
+
|
|
54
|
+
```php
|
|
55
|
+
// Before middleware — runs BEFORE the request hits the controller
|
|
56
|
+
public function handle(Request $request, Closure $next): Response
|
|
57
|
+
{
|
|
58
|
+
// Check something before the request
|
|
59
|
+
return $next($request);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// After middleware — runs AFTER the controller returns a response
|
|
63
|
+
public function handle(Request $request, Closure $next): Response
|
|
64
|
+
{
|
|
65
|
+
$response = $next($request);
|
|
66
|
+
|
|
67
|
+
// Modify the response
|
|
68
|
+
$response->headers->set('X-Custom-Header', 'value');
|
|
69
|
+
|
|
70
|
+
return $response;
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Terminable middleware
|
|
75
|
+
|
|
76
|
+
Runs **after the response has been sent** to the browser:
|
|
77
|
+
|
|
78
|
+
```php
|
|
79
|
+
class LogRequestDuration
|
|
80
|
+
{
|
|
81
|
+
private float $startTime;
|
|
82
|
+
|
|
83
|
+
public function handle(Request $request, Closure $next): Response
|
|
84
|
+
{
|
|
85
|
+
$this->startTime = microtime(true);
|
|
86
|
+
|
|
87
|
+
return $next($request);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public function terminate(Request $request, Response $response): void
|
|
91
|
+
{
|
|
92
|
+
$duration = microtime(true) - $this->startTime;
|
|
93
|
+
Log::info('Request duration', [
|
|
94
|
+
'url' => $request->fullUrl(),
|
|
95
|
+
'duration_ms' => round($duration * 1000, 2),
|
|
96
|
+
]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Middleware with parameters
|
|
102
|
+
|
|
103
|
+
```php
|
|
104
|
+
class CheckRole
|
|
105
|
+
{
|
|
106
|
+
public function handle(Request $request, Closure $next, string $role): Response
|
|
107
|
+
{
|
|
108
|
+
if (!$request->user()?->hasRole($role)) {
|
|
109
|
+
abort(403);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return $next($request);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Usage in routes
|
|
117
|
+
Route::get('/admin', AdminController::class)->middleware('role:admin');
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Assigning middleware
|
|
121
|
+
|
|
122
|
+
```php
|
|
123
|
+
// Route-level
|
|
124
|
+
Route::get('/dashboard', DashboardController::class)
|
|
125
|
+
->middleware([EnsureCustomerIsActive::class]);
|
|
126
|
+
|
|
127
|
+
// Group-level
|
|
128
|
+
Route::middleware(['auth', EnsureCustomerIsActive::class])->group(function () {
|
|
129
|
+
// ...
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// Global middleware (bootstrap/app.php)
|
|
133
|
+
->withMiddleware(function (Middleware $middleware) {
|
|
134
|
+
$middleware->append(LogRequestDuration::class);
|
|
135
|
+
$middleware->prepend(SetLocale::class);
|
|
136
|
+
})
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Middleware priority
|
|
140
|
+
|
|
141
|
+
```php
|
|
142
|
+
// bootstrap/app.php — control execution order
|
|
143
|
+
->withMiddleware(function (Middleware $middleware) {
|
|
144
|
+
$middleware->priority([
|
|
145
|
+
AuthenticateMiddleware::class,
|
|
146
|
+
EnsureCustomerIsActive::class,
|
|
147
|
+
CheckRole::class,
|
|
148
|
+
]);
|
|
149
|
+
})
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Core rules
|
|
153
|
+
|
|
154
|
+
- **Single responsibility** — one middleware, one concern.
|
|
155
|
+
- **Early return** — abort or redirect as early as possible.
|
|
156
|
+
- **Use terminable** for logging/metrics — don't block the response.
|
|
157
|
+
- **Type-hint dependencies** — use constructor injection.
|
|
158
|
+
- **Keep middleware thin** — delegate complex logic to services.
|
|
159
|
+
|
|
160
|
+
## Output format
|
|
161
|
+
|
|
162
|
+
1. Middleware class with handle method and typed request/response
|
|
163
|
+
2. Registration in bootstrap or route group
|
|
164
|
+
|
|
165
|
+
## Auto-trigger keywords
|
|
166
|
+
|
|
167
|
+
- middleware
|
|
168
|
+
- request filter
|
|
169
|
+
- before middleware
|
|
170
|
+
- after middleware
|
|
171
|
+
- terminable
|
|
172
|
+
- middleware group
|
|
173
|
+
|
|
174
|
+
## Gotcha
|
|
175
|
+
|
|
176
|
+
- Middleware execution order matters — registered order in the kernel defines the pipeline sequence.
|
|
177
|
+
- Don't modify the response in `handle()` if the next middleware might also modify it — use `terminate()` for cleanup.
|
|
178
|
+
- The model tends to forget that middleware runs on EVERY request in its group — keep it lightweight.
|
|
179
|
+
|
|
180
|
+
## Do NOT
|
|
181
|
+
|
|
182
|
+
- Do NOT put business logic in middleware — delegate to services.
|
|
183
|
+
- Do NOT create catch-all middleware that does too many things.
|
|
184
|
+
- Do NOT forget to register middleware — it won't run if not assigned.
|
|
185
|
+
- Do NOT modify the request in after-middleware — use before-middleware for that.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: laravel-notifications
|
|
3
|
+
description: "Use when sending notifications via mail, Slack, database, or custom channels — with queuing, on-demand recipients, and notification preferences."
|
|
4
|
+
source: package
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# laravel-notifications
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Use this skill when sending notifications to users or external systems:
|
|
12
|
+
- Email, Slack, SMS, or database notifications
|
|
13
|
+
- Custom notification channels
|
|
14
|
+
- On-demand notifications (to non-user recipients)
|
|
15
|
+
- Notification preferences and opt-out logic
|
|
16
|
+
|
|
17
|
+
For **Mailables** (complex email templates, attachments), see [laravel-mail](../laravel-mail/SKILL.md).
|
|
18
|
+
|
|
19
|
+
## Procedure: Create a notification
|
|
20
|
+
|
|
21
|
+
1. **Generate class** — `php artisan make:notification InvoiceCreated`.
|
|
22
|
+
2. **Choose channels** — Mail, database, Slack, or custom. Implement `via()`.
|
|
23
|
+
3. **Build content** — Implement `toMail()`, `toArray()`, etc. for each channel.
|
|
24
|
+
4. **Queue it** — Add `ShouldQueue` interface for non-blocking delivery.
|
|
25
|
+
5. **Verify** — Send test notification, confirm delivery on all channels.
|
|
26
|
+
|
|
27
|
+
### Example
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
php artisan make:notification InvoiceCreated
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```php
|
|
34
|
+
class InvoiceCreated extends Notification implements ShouldQueue
|
|
35
|
+
{
|
|
36
|
+
use Queueable;
|
|
37
|
+
|
|
38
|
+
public function __construct(
|
|
39
|
+
private readonly Invoice $invoice,
|
|
40
|
+
) {}
|
|
41
|
+
|
|
42
|
+
/** @return array<int, string> */
|
|
43
|
+
public function via(object $notifiable): array
|
|
44
|
+
{
|
|
45
|
+
return ['mail', 'database'];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public function toMail(object $notifiable): MailMessage
|
|
49
|
+
{
|
|
50
|
+
return (new MailMessage())
|
|
51
|
+
->subject('New Invoice #' . $this->invoice->getNumber())
|
|
52
|
+
->greeting('Hello ' . $notifiable->getName())
|
|
53
|
+
->line('A new invoice has been created.')
|
|
54
|
+
->action('View Invoice', url('/invoices/' . $this->invoice->getId()))
|
|
55
|
+
->line('Thank you for your business.');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @return array<string, mixed> */
|
|
59
|
+
public function toArray(object $notifiable): array
|
|
60
|
+
{
|
|
61
|
+
return [
|
|
62
|
+
'invoice_id' => $this->invoice->getId(),
|
|
63
|
+
'amount' => $this->invoice->getAmount(),
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Sending notifications
|
|
70
|
+
|
|
71
|
+
```php
|
|
72
|
+
// Via the Notifiable trait on the model
|
|
73
|
+
$user->notify(new InvoiceCreated($invoice));
|
|
74
|
+
|
|
75
|
+
// Via the Notification facade (multiple recipients)
|
|
76
|
+
Notification::send($users, new InvoiceCreated($invoice));
|
|
77
|
+
|
|
78
|
+
// On-demand (no user model needed)
|
|
79
|
+
Notification::route('mail', 'admin@example.com')
|
|
80
|
+
->route('slack', '#billing')
|
|
81
|
+
->notify(new InvoiceCreated($invoice));
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Database notifications
|
|
85
|
+
|
|
86
|
+
Requires the notifications table migration:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
php artisan notifications:table
|
|
90
|
+
php artisan migrate
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```php
|
|
94
|
+
// Read notifications
|
|
95
|
+
$user->notifications; // all
|
|
96
|
+
$user->unreadNotifications; // unread only
|
|
97
|
+
|
|
98
|
+
// Mark as read
|
|
99
|
+
$notification->markAsRead();
|
|
100
|
+
$user->unreadNotifications->markAsRead();
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Slack notifications
|
|
104
|
+
|
|
105
|
+
```php
|
|
106
|
+
public function toSlack(object $notifiable): SlackMessage
|
|
107
|
+
{
|
|
108
|
+
return (new SlackMessage())
|
|
109
|
+
->text('Invoice #' . $this->invoice->getNumber() . ' created')
|
|
110
|
+
->headerBlock('New Invoice')
|
|
111
|
+
->sectionBlock(function (SectionBlock $block) {
|
|
112
|
+
$block->text('Amount: ' . $this->invoice->getAmount());
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Notification preferences
|
|
118
|
+
|
|
119
|
+
```php
|
|
120
|
+
public function via(object $notifiable): array
|
|
121
|
+
{
|
|
122
|
+
// Respect user preferences
|
|
123
|
+
$channels = ['database'];
|
|
124
|
+
|
|
125
|
+
if ($notifiable->wantsEmailNotifications()) {
|
|
126
|
+
$channels[] = 'mail';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if ($notifiable->wantsSlackNotifications()) {
|
|
130
|
+
$channels[] = 'slack';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return $channels;
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Core rules
|
|
138
|
+
|
|
139
|
+
- **Always queue notifications** — implement `ShouldQueue` to avoid blocking requests.
|
|
140
|
+
- **Keep payloads small** in `toArray()` — store IDs, not full objects.
|
|
141
|
+
- **Use `via()` for channel logic** — don't hardcode channels, respect user preferences.
|
|
142
|
+
- **On-demand for external recipients** — use `Notification::route()` for non-user targets.
|
|
143
|
+
- **Database notifications for in-app** — use the notifications table for in-app notification centers.
|
|
144
|
+
|
|
145
|
+
## Output format
|
|
146
|
+
|
|
147
|
+
1. Notification class with via() and channel-specific methods
|
|
148
|
+
2. Queued dispatch with proper serialization
|
|
149
|
+
|
|
150
|
+
## Auto-trigger keywords
|
|
151
|
+
|
|
152
|
+
- notification
|
|
153
|
+
- notify
|
|
154
|
+
- Notifiable
|
|
155
|
+
- MailMessage
|
|
156
|
+
- SlackMessage
|
|
157
|
+
- database notification
|
|
158
|
+
|
|
159
|
+
## Gotcha
|
|
160
|
+
|
|
161
|
+
- Don't send notifications synchronously in request lifecycle — always queue them.
|
|
162
|
+
- The model forgets to implement `toArray()` for database notifications — it throws silently.
|
|
163
|
+
- `via()` method must return an array even for a single channel — `return ['mail']`, not `return 'mail'`.
|
|
164
|
+
|
|
165
|
+
## Do NOT
|
|
166
|
+
|
|
167
|
+
- Do NOT store large objects in database notification `data` — use IDs and fetch on read.
|
|
168
|
+
- Do NOT use notifications for complex emails — use [Mailables](../laravel-mail/SKILL.md) instead.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: laravel-pennant
|
|
3
|
+
description: "Use when working with feature flags — Laravel Pennant, gradual rollouts, A/B testing, scope-based flags — even when the user just says 'hide this behind a flag' without naming Pennant."
|
|
4
|
+
source: package
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# laravel-pennant
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Use this skill when working with feature flags:
|
|
12
|
+
- Gradual feature rollouts (percentage-based)
|
|
13
|
+
- Per-user or per-tenant feature toggling
|
|
14
|
+
- A/B testing with feature variants
|
|
15
|
+
- Environment-based feature gating
|
|
16
|
+
|
|
17
|
+
## Procedure: Set up feature flags
|
|
18
|
+
|
|
19
|
+
1. **Install** — `composer require laravel/pennant`, publish config, run migrations.
|
|
20
|
+
2. **Define feature** — Create feature class or use closure-based definition.
|
|
21
|
+
3. **Check feature** — Use `Feature::active('feature-name')` in code.
|
|
22
|
+
4. **Verify** — Confirm feature is active/inactive for correct scopes. Run tests.
|
|
23
|
+
|
|
24
|
+
### Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
composer require laravel/pennant
|
|
28
|
+
php artisan vendor:publish --provider="Laravel\Pennant\PennantServiceProvider"
|
|
29
|
+
php artisan migrate
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Defining features
|
|
33
|
+
|
|
34
|
+
### Class-based features (recommended)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
php artisan pennant:feature NewDashboard
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```php
|
|
41
|
+
declare(strict_types=1);
|
|
42
|
+
|
|
43
|
+
namespace App\Features;
|
|
44
|
+
|
|
45
|
+
use App\Models\User;
|
|
46
|
+
use Illuminate\Support\Lottery;
|
|
47
|
+
|
|
48
|
+
class NewDashboard
|
|
49
|
+
{
|
|
50
|
+
/** Resolve the feature's initial value. */
|
|
51
|
+
public function resolve(User $user): bool
|
|
52
|
+
{
|
|
53
|
+
// Percentage rollout
|
|
54
|
+
return Lottery::odds(1, 10)->choose(); // 10% of users
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Closure-based features
|
|
60
|
+
|
|
61
|
+
```php
|
|
62
|
+
// In a service provider
|
|
63
|
+
use Laravel\Pennant\Feature;
|
|
64
|
+
|
|
65
|
+
Feature::define('new-dashboard', function (User $user): bool {
|
|
66
|
+
return $user->getCustomer()?->isEarlyAdopter() ?? false;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Rich values (A/B testing)
|
|
70
|
+
Feature::define('checkout-button', function (User $user): string {
|
|
71
|
+
return Arr::random(['blue', 'green', 'red']);
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Checking features
|
|
76
|
+
|
|
77
|
+
```php
|
|
78
|
+
// Boolean check
|
|
79
|
+
if (Feature::active('new-dashboard')) {
|
|
80
|
+
// Show new dashboard
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Via the user model (HasFeatures trait)
|
|
84
|
+
if ($user->features()->active('new-dashboard')) {
|
|
85
|
+
// ...
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Rich value
|
|
89
|
+
$color = Feature::value('checkout-button'); // 'blue', 'green', or 'red'
|
|
90
|
+
|
|
91
|
+
// Blade directive
|
|
92
|
+
@feature('new-dashboard')
|
|
93
|
+
<x-new-dashboard />
|
|
94
|
+
@else
|
|
95
|
+
<x-legacy-dashboard />
|
|
96
|
+
@endfeature
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Managing features
|
|
100
|
+
|
|
101
|
+
```php
|
|
102
|
+
// Activate for a specific user
|
|
103
|
+
Feature::for($user)->activate('new-dashboard');
|
|
104
|
+
|
|
105
|
+
// Deactivate
|
|
106
|
+
Feature::for($user)->deactivate('new-dashboard');
|
|
107
|
+
|
|
108
|
+
// Activate for everyone
|
|
109
|
+
Feature::activateForEveryone('new-dashboard');
|
|
110
|
+
|
|
111
|
+
// Deactivate for everyone
|
|
112
|
+
Feature::deactivateForEveryone('new-dashboard');
|
|
113
|
+
|
|
114
|
+
// Purge stored values (re-resolve on next check)
|
|
115
|
+
Feature::purge('new-dashboard');
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Scopes
|
|
119
|
+
|
|
120
|
+
Features can be scoped to any model, not just users:
|
|
121
|
+
|
|
122
|
+
```php
|
|
123
|
+
// Per-tenant feature
|
|
124
|
+
Feature::for($customer)->active('advanced-reporting');
|
|
125
|
+
|
|
126
|
+
// Define with tenant scope
|
|
127
|
+
Feature::define('advanced-reporting', function (Customer $customer): bool {
|
|
128
|
+
return $customer->getPlan() === 'enterprise';
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Drivers
|
|
133
|
+
|
|
134
|
+
| Driver | Storage | Use case |
|
|
135
|
+
|---|---|---|
|
|
136
|
+
| `database` | DB table | Production — persistent, shared across servers |
|
|
137
|
+
| `array` | In-memory | Testing — no persistence |
|
|
138
|
+
|
|
139
|
+
```php
|
|
140
|
+
// config/pennant.php
|
|
141
|
+
'default' => env('PENNANT_STORE', 'database'),
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Eager loading
|
|
145
|
+
|
|
146
|
+
```php
|
|
147
|
+
// Prevent N+1 when checking features for multiple users
|
|
148
|
+
Feature::for($users)->loadAll();
|
|
149
|
+
|
|
150
|
+
// Load specific features
|
|
151
|
+
Feature::for($users)->load(['new-dashboard', 'advanced-reporting']);
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Core rules
|
|
155
|
+
|
|
156
|
+
- **Use class-based features** for anything non-trivial — they're testable and discoverable.
|
|
157
|
+
- **Scope to the right model** — user, customer, or team depending on the feature.
|
|
158
|
+
- **Eager load** when checking features for collections of users.
|
|
159
|
+
- **Purge after full rollout** — remove the flag once 100% of users have the feature.
|
|
160
|
+
- **Use `array` driver in tests** — prevents test pollution.
|
|
161
|
+
- **Clean up old flags** — feature flags are temporary, not permanent config.
|
|
162
|
+
|
|
163
|
+
## Output format
|
|
164
|
+
|
|
165
|
+
1. Feature flag definition with scope and resolve logic
|
|
166
|
+
2. Integration in controllers/services using Feature::active()
|
|
167
|
+
|
|
168
|
+
## Auto-trigger keywords
|
|
169
|
+
|
|
170
|
+
- feature flag
|
|
171
|
+
- feature toggle
|
|
172
|
+
- Pennant
|
|
173
|
+
- gradual rollout
|
|
174
|
+
- A/B test
|
|
175
|
+
- feature gate
|
|
176
|
+
|
|
177
|
+
## Gotcha
|
|
178
|
+
|
|
179
|
+
- Feature flags in database driver require migration — don't forget `php artisan pennant:purge` for cleanup.
|
|
180
|
+
- The model tends to check flags without a scope — always pass the authenticated user or a default scope.
|
|
181
|
+
- Don't nest feature flag checks — it makes the logic impossible to reason about.
|
|
182
|
+
|
|
183
|
+
## Do NOT
|
|
184
|
+
|
|
185
|
+
- Do NOT leave feature flags forever — remove them after full rollout.
|
|
186
|
+
- Do NOT use feature flags for permanent configuration — use config files.
|
|
187
|
+
- Do NOT check features in tight loops without eager loading.
|
|
188
|
+
- Do NOT forget to purge stored values when changing the resolve logic.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: laravel-pulse
|
|
3
|
+
description: "Use when setting up Laravel Pulse — real-time dashboard, built-in cards, custom recorders, performance insights — even when the user just says 'I need app monitoring' without naming Pulse."
|
|
4
|
+
source: package
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# laravel-pulse
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Use this skill when working with Laravel Pulse:
|
|
12
|
+
- Setting up the Pulse monitoring dashboard
|
|
13
|
+
- Configuring built-in recorders (slow queries, exceptions, queues, etc.)
|
|
14
|
+
- Creating custom Pulse cards and recorders
|
|
15
|
+
- Performance monitoring and alerting
|
|
16
|
+
|
|
17
|
+
## Procedure: Set up Pulse
|
|
18
|
+
|
|
19
|
+
1. **Install** — `composer require laravel/pulse`, publish config, run migrations.
|
|
20
|
+
2. **Configure** — Set up recorders in `config/pulse.php`.
|
|
21
|
+
3. **Add dashboard** — Register route and authorize access.
|
|
22
|
+
4. **Verify** — Visit `/pulse` dashboard, confirm data is being recorded.
|
|
23
|
+
|
|
24
|
+
### Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
composer require laravel/pulse
|
|
28
|
+
php artisan vendor:publish --provider="Laravel\Pulse\PulseServiceProvider"
|
|
29
|
+
php artisan migrate
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Dashboard
|
|
33
|
+
|
|
34
|
+
### Access control
|
|
35
|
+
|
|
36
|
+
```php
|
|
37
|
+
// PulseServiceProvider or Gate
|
|
38
|
+
Gate::define('viewPulse', function (User $user): bool {
|
|
39
|
+
return $user->isSuperuser();
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Dashboard route
|
|
44
|
+
|
|
45
|
+
Pulse registers `/pulse` automatically. Customize in `config/pulse.php`:
|
|
46
|
+
|
|
47
|
+
```php
|
|
48
|
+
'path' => 'pulse',
|
|
49
|
+
'middleware' => ['web', 'auth'],
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Built-in cards
|
|
53
|
+
|
|
54
|
+
| Card | What it shows |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `<livewire:pulse.servers />` | CPU, memory, storage per server |
|
|
57
|
+
| `<livewire:pulse.usage />` | Top users by request count |
|
|
58
|
+
| `<livewire:pulse.queues />` | Queue throughput and wait times |
|
|
59
|
+
| `<livewire:pulse.slow-queries />` | Slowest database queries |
|
|
60
|
+
| `<livewire:pulse.slow-requests />` | Slowest HTTP requests |
|
|
61
|
+
| `<livewire:pulse.slow-jobs />` | Slowest queued jobs |
|
|
62
|
+
| `<livewire:pulse.slow-outgoing-requests />` | Slowest external HTTP calls |
|
|
63
|
+
| `<livewire:pulse.exceptions />` | Most frequent exceptions |
|
|
64
|
+
| `<livewire:pulse.cache />` | Cache hit/miss ratio |
|
|
65
|
+
|
|
66
|
+
### Dashboard view
|
|
67
|
+
|
|
68
|
+
```blade
|
|
69
|
+
{{-- resources/views/vendor/pulse/dashboard.blade.php --}}
|
|
70
|
+
<x-pulse>
|
|
71
|
+
<livewire:pulse.servers cols="full" />
|
|
72
|
+
|
|
73
|
+
<livewire:pulse.usage cols="4" rows="2" />
|
|
74
|
+
<livewire:pulse.queues cols="4" />
|
|
75
|
+
<livewire:pulse.cache cols="4" />
|
|
76
|
+
|
|
77
|
+
<livewire:pulse.slow-queries cols="8" />
|
|
78
|
+
<livewire:pulse.exceptions cols="4" />
|
|
79
|
+
|
|
80
|
+
<livewire:pulse.slow-requests cols="6" />
|
|
81
|
+
<livewire:pulse.slow-jobs cols="6" />
|
|
82
|
+
</x-pulse>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Configuration
|
|
86
|
+
|
|
87
|
+
### config/pulse.php
|
|
88
|
+
|
|
89
|
+
```php
|
|
90
|
+
'recorders' => [
|
|
91
|
+
\Laravel\Pulse\Recorders\SlowQueries::class => [
|
|
92
|
+
'enabled' => true,
|
|
93
|
+
'threshold' => 1000, // ms
|
|
94
|
+
'sample_rate' => 1.0,
|
|
95
|
+
],
|
|
96
|
+
\Laravel\Pulse\Recorders\SlowRequests::class => [
|
|
97
|
+
'enabled' => true,
|
|
98
|
+
'threshold' => 1000, // ms
|
|
99
|
+
'sample_rate' => 1.0,
|
|
100
|
+
],
|
|
101
|
+
\Laravel\Pulse\Recorders\Exceptions::class => [
|
|
102
|
+
'enabled' => true,
|
|
103
|
+
'sample_rate' => 1.0,
|
|
104
|
+
],
|
|
105
|
+
],
|
|
106
|
+
|
|
107
|
+
// Data retention
|
|
108
|
+
'ingest' => [
|
|
109
|
+
'trim' => [
|
|
110
|
+
'lottery' => [1, 1000],
|
|
111
|
+
'keep' => '7 days',
|
|
112
|
+
],
|
|
113
|
+
],
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Custom recorders
|
|
117
|
+
|
|
118
|
+
```php
|
|
119
|
+
use Laravel\Pulse\Facades\Pulse;
|
|
120
|
+
|
|
121
|
+
// Record a custom entry
|
|
122
|
+
Pulse::record('api_call', 'stripe', 250) // type, key, value
|
|
123
|
+
->avg()
|
|
124
|
+
->count();
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Core rules
|
|
128
|
+
|
|
129
|
+
- **Trim old data** — configure retention to prevent database bloat.
|
|
130
|
+
- **Use sample rates** in production — not every request needs recording.
|
|
131
|
+
- **Separate database** — consider a dedicated DB connection for Pulse data.
|
|
132
|
+
- **Restrict access** — always gate the dashboard behind authentication.
|
|
133
|
+
- **Monitor what matters** — don't enable all recorders if you don't need them.
|
|
134
|
+
|
|
135
|
+
## Output format
|
|
136
|
+
|
|
137
|
+
1. Pulse configuration with recorders and dashboard cards
|
|
138
|
+
2. Custom recorder class if needed
|
|
139
|
+
|
|
140
|
+
## Auto-trigger keywords
|
|
141
|
+
|
|
142
|
+
- Pulse
|
|
143
|
+
- monitoring dashboard
|
|
144
|
+
- slow queries
|
|
145
|
+
- slow requests
|
|
146
|
+
- application monitoring
|
|
147
|
+
- performance dashboard
|
|
148
|
+
|
|
149
|
+
## Gotcha
|
|
150
|
+
|
|
151
|
+
- Pulse stores data in the same database by default — configure a separate connection for production.
|
|
152
|
+
- The model forgets that Pulse data is sampled, not exact — don't use it for billing or exact counts.
|
|
153
|
+
- Custom recorders must be registered in a service provider — they don't auto-discover.
|
|
154
|
+
|
|
155
|
+
## Do NOT
|
|
156
|
+
|
|
157
|
+
- Do NOT expose the Pulse dashboard without authentication.
|
|
158
|
+
- Do NOT set sample rate to 1.0 on high-traffic production — use 0.1 or lower.
|
|
159
|
+
- Do NOT forget to run `pulse:check` for server metrics.
|
|
160
|
+
- Do NOT store Pulse data in the main application database on large apps.
|