Enterprise-grade AgentSkill for defect intake, approved bug fixing, regression hardening, traceable reporting, and tracker-ready export artifacts.
Public repository/package name: defect-lifecycle-agent-skill
Stable skill trigger: $defect-lifecycle-agent-skill
This repository provides:
- a clear skill contract for bug discovery and approved bug resolution
- repository-aware guidance instead of hard-coded folder assumptions
- structured markdown templates for discovery reports and fix reports
- a deterministic coverage validator for total or file-scoped checks
- canonical JSON schemas for discovery and fix reports
- Jira-ready and Linear-ready draft export artifacts
- lightweight validation and tests for maintainability
- GitHub-ready packaging and contribution guidance
The skill helps an agent:
- classify a request as bug reporting or bug fixing
- discover the target repository's real testing and documentation conventions
- reproduce or verify the defect with evidence
- require a confirmation test before the fix when practical
- implement the smallest credible fix
- validate regression checks and coverage honestly
- update only the documentation that truly changed
- emit markdown, canonical JSON, or tracker-ready drafts as needed
- replace incident response, SRE postmortems, or generic feature planning
- assume a specific repository layout such as
docs/functional analysis/ - silently persist shared memory across repositories
- claim regression safety from total line coverage alone
- bypass approval for tracker bugs that are not clearly ready to fix
- embed direct Jira or Linear API clients, secrets, or auth flows
When invoked through skill-orchestrator, this skill runs as an 11-phase chain defined in config/chain_definition.json. The test type for the confirmation test is determined by test-design-orchestrator (Phase 2) — all test implementation phases self-gate on that output:
| Phase | Sub-skill | Maps to |
|---|---|---|
| 1 | codebase-context |
Discover repo conventions and all test layers |
| 2 | test-design-orchestrator |
Determine test type(s): unit / service / frontend / perf / security |
| 3 | stack-aware-unit-testing-skill |
Unit confirmation test [self-gates] |
| 4 | api-contract-sentinel |
Service/API confirmation test [self-gates] |
| 5 | playwright-skill |
Frontend/E2E confirmation test [self-gates] |
| 6 | performance-testing-skill |
Performance confirmation test [self-gates] |
| 7 | defensive-appsec-review-skill |
Security confirmation test [self-gates] |
| 8 | [agent-handled] | Implement the minimal fix |
| 9 | stack-aware-unit-testing-skill |
Re-run confirmation tests + full regression |
| 10 | automated-test-reviewer |
Review why tests missed it; verify coverage |
| 11 | [agent-handled] | Structured 7-section resolution report |
Self-gating phases declare themselves "not applicable" when the bug type doesn't match their layer, so a pure logic bug skips phases 4–7 automatically.
defect-lifecycle-agent-skill/
|- SKILL.md
|- README.md
|- agents/openai.yaml
|- assets/
|- examples/
|- references/
|- schemas/
|- scripts/
|- tests/
|- .github/workflows/ci.yml
`- package.json
- Use Node.js 18 or newer.
- Run
npm testto execute the built-in validation suite. - Run
node scripts/validate-skill.jsfor a packaging smoke check.
No external dependencies are required.
Validate total coverage:
node scripts/verify-coverage.js --coverage coverage/coverage-summary.jsonValidate specific changed files:
node scripts/verify-coverage.js --coverage coverage/coverage-summary.json --files src/checkout/form.ts,src/checkout/validation.tsValidate using a manifest:
node scripts/verify-coverage.js --manifest examples/coverage-manifest.example.jsonValidate skill packaging:
node scripts/validate-skill.jsExport a Jira draft from a discovery report:
node scripts/export-tracker-artifact.js --tracker jira --input examples/sample-bug-discovery.jsonExport a Linear resolution update from a fix report:
node scripts/export-tracker-artifact.js --tracker linear --input examples/sample-bug-fix-report.jsonRun tests:
npm test- Inspect the target repository and determine the real requirements, docs, and test locations.
- Route into discovery-only or approved-fix mode.
- Reproduce or verify the defect.
- Add or reuse a failing confirmation test when practical.
- Apply the smallest credible fix.
- Re-run targeted checks and coverage validation.
- Update only the docs, diagrams, help content, README, or changelog that truly changed.
- Deliver the structured markdown report and optional JSON or tracker export.
Primary output is markdown using the templates in assets/bug-discovery-template.md and assets/bug-fix-report-template.md.
Machine-readable equivalents live in schemas/bug-discovery-report.schema.json and schemas/bug-fix-report.schema.json.
Exact required fields and export guidance live in references/response-contracts.md and references/tracker-exports.md.
- Runtime memory: active reproduction notes, diffs, logs, and validation results for the current task
- Project-local memory: deliberate artifacts written into the target repository, such as issue notes or documentation updates
- Shared memory: out of scope unless an external shared-memory skill is intentionally integrated
This repo includes:
- packaging validation via scripts/validate-skill.js
- coverage validator tests in tests/verify-coverage.test.js
- repository smoke tests in tests/validate-skill.test.js
- tracker export tests in tests/export-tracker-artifact.test.js
- schema fixture tests in tests/schema-fixtures.test.js
- maintenance guidance in references/evaluation.md
- a GitHub Actions workflow in .github/workflows/ci.yml
These are related but intentionally out of scope for the current implementation:
- direct Jira or Linear API calls with secrets and auth handling
- specialized testing skills such as Playwright, Cypress, or JUnit helpers for stack-specific test authoring
- shared-memory promotion of stable cross-project debugging knowledge
- the repo is self-contained and uses only Node built-ins
- the canonical skill trigger is
$defect-lifecycle-agent-skill - generated tracker drafts are intended for review or for a separate organization-specific integration layer