Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/d-o-hub/github-template-ai-agents/lifecycle-managementnpx skills add d-o-hub/github-template-ai-agents --skill lifecycle-managementgit clone --depth 1 https://github.com/d-o-hub/github-template-ai-agentsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/lifecycle-management)<a href="https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/lifecycle-management"><img src="https://agentmods.dev/badge/skills/d-o-hub/github-template-ai-agents/lifecycle-management.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00074 | $0.00611 |
| Opus 5 | $0.00037 | $0.00305 |
| Sonnet 5 | $0.00015 | $0.00122 |
| Haiku 4.5 | $0.00007 | $0.00061 |
Grade A, and why
lifecycle-management scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Lifecycle Management
Generic patterns for managing application lifecycle, specifically for web applications to prevent memory leaks and handle global errors.
When to Use
- User asks to handle startup/shutdown sequences or manage resource pools
- Need to implement error boundaries or prevent memory leaks
- Even if they just say "clean up resources" or "fix the memory leak"
Patterns
Global Error Handler
initGlobalErrorHandling() MUST be called to catch uncaught exceptions and unhandled rejections.
function initGlobalErrorHandling() {
window.addEventListener('error', (event) => {
console.error('Uncaught exception:', event.error);
// Add telemetry/reporting here
});
window.addEventListener('unhandledrejection', (event) => {
console.error('Unhandled rejection:', event.reason);
// Add telemetry/reporting here
});
}
Route Cleanup
Call lifecycle.cleanupRoute() before navigating to cancel in-flight fetch requests via a global AbortController.
const lifecycle = {
controller: new AbortController(),
cleanupRoute() {
this.controller.abort();
this.controller = new AbortController();
}
};
Event Listeners
Use AbortController signal for all addEventListener calls where possible to automate cleanup.
const controller = new AbortController();
const { signal } = controller;
// handleResize must be defined in your component or module
window.addEventListener('resize', handleResize, { signal });
// Later, to remove all listeners associated with this controller:
controller.abort();
See Also
security-code-auditor— Security auditspwa-offline-sync— Service workers and caching
Rationalizations
| Rationalization | Reality |
|---|---|
| "It's just a small app, no leaks." | Memory leaks accumulate over time and affect performance and stability even in small apps. |
| "I'll remove listeners manually." | Manual removal is error-prone and often forgotten. AbortController is a cleaner, more robust pattern. |
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 90 lines · 74 tokens per session scan A 149638bfeadc
lifecycle-management is a skill published in the GitHub repository d-o-hub/github-template-ai-agents (2 stars, last pushed today), licensed MIT. It adds 74 tokens to every session and 611 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
code-review
Orchestrates code review by detecting the project language and architecture, then routing to the appropriate specialized review skill (code-review-go, code-review-typescript, code-review-python, code-review-php, code-review-architecture). Falls back to the generic checklist when no specific skill applies. Invoked when…
static-code-analysis
Selects, configures, and integrates a static analysis tool for the project's language. Covers tool selection, rule configuration, CI integration, fixing existing violations, and pre-commit hook setup. Invoked when the user asks to add linting, set up static analysis, or configure a code quality tool.
code-review-architecture
Architecture-focused code review covering hexagonal boundary violations, DDD anti-patterns, CQRS misuse, and microservices coupling issues. Applied in addition to the language-specific review skill when architecture markers are detected. Invoked when reviewing hexagonal architectures, DDD patterns, or microservices…
code-review-go
Deep Go-specific code review covering goroutine lifecycle, data races, error wrapping, domain modeling, and interface design. Applied in addition to the generic code-review skill when Go code is detected. Invoked when reviewing Go PRs, Go code changes, or performing Go-specific quality checks.
code-review-php
Deep PHP-specific code review covering strict types, PHPStan compliance, PSR standards, domain modeling, and ORM boundary violations. Applied in addition to the generic code-review skill when PHP code is detected. Invoked when reviewing PHP PRs, Symfony/Laravel changes, or performing PHP-specific quality checks.
code-review-python
Deep Python-specific code review covering type annotations, async pitfalls, mutable defaults, threading safety, and domain modeling. Applied in addition to the generic code-review skill when Python code is detected. Invoked when reviewing Python PRs, Py changes, or performing Python-specific quality checks.