resources/skills/x-create-bug/SKILL.md
Create a structured bug report from the RA9 template
npx skillsauth add edercnj/claude-environment resources/skills/x-create-bugInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a new bug report from the standard template with automatic slug generation, status initialization, and structured metadata.
/x-create-bug "Login form crashes on invalid email" — create bug with description only/x-create-bug "Login form crashes on invalid email" --severity HIGH — create with severity/x-create-bug "Login form crashes on invalid email" --scope SIMPLE --severity HIGH — full invocation/x-create-bug "Session token leaks to browser console" --severity CRITICAL — security bug| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| description | String | Yes | — | Bug description (8–200 characters) |
| --severity | Enum | No | MEDIUM | One of: LOW, MEDIUM, HIGH, CRITICAL |
| --scope | Enum | No | STANDARD | One of: SIMPLE, STANDARD, COMPLEX |
| --output | String | No | docs/bugs/ | Directory for bug file (must exist) |
| --id | String | No | auto | Auto-generated as next integer; override if needed |
On success, the skill creates:
{output}/bug-{ID}-{SLUG}.md with complete template and metadata**Status:** Pendente (initial state)Returns JSON to stdout:
{
"bugId": "bug-0001",
"slug": "login-form-crashes-on-invalid-email",
"bugFile": "docs/bugs/bug-0001-login-form-crashes-on-invalid-email.md",
"severity": "HIGH",
"scope": "STANDARD",
"status": "Pendente",
"created": "2026-05-07T14:23:15Z"
}
1. PARSE_VALIDATE -> Validate description (8–200 chars), severity enum, scope enum, output dir
2. SLUG -> NFKD normalize + strip non-alphanumeric + lowercase + collapse hyphens + truncate-40
3. ASSIGN_ID -> Auto-detect MAX(existing bug-NNNN) + 1, or validate user-provided --id
4. LOAD_TEMPLATE -> Read .claude/templates/_TEMPLATE-BUG.md (abort on missing)
5. INSTANTIATE -> sed-substitute {{BUG_DESCRIPTION}}/{{BUG_ID}}/{{SLUG}}/{{SEVERITY}}/{{SCOPE}}/...
6. WRITE -> Write to {output}/bug-{ID}-{SLUG}.md
7. INIT_STATUS -> Ensure **Status:** Pendente is present (inject after header if missing)
8. EMIT -> jq response envelope (bugId, slug, bugFile, severity, scope, status, created)
Detailed bash for each step, slug-generation pipeline, template substitution map, and worked examples in references/full-protocol.md:
iconv + sed + tr slug-generation pipeline; 40-char truncation.ls bug-*.md + sort -n | tail -1; bug-NNNN regex for user-provided IDs..claude/templates/_TEMPLATE-BUG.md; abort on missing.{{BUG_DESCRIPTION}}, {{BUG_ID}}, {{SLUG}}, {{SEVERITY}}, {{SCOPE}}, {{PERSONA}}, {{VERSION_OR_SHA}}, {{OS_RUNTIME}}, {{JAVA_VERSION}}, {{DATE}}).sed injection fallback.jq -n envelope construction.| Scenario | Exit Code | Message | |----------|-----------|---------| | Description too short (< 8 chars) | 1 | "Description must be 8–200 characters" | | Description too long (> 200 chars) | 1 | "Description must be 8–200 characters" | | Invalid severity | 1 | "Severity must be LOW|MEDIUM|HIGH|CRITICAL" | | Invalid scope | 1 | "Scope must be SIMPLE|STANDARD|COMPLEX" | | Output directory missing | 1 | "Output directory not found: {path}" | | Template not found | 1 | "Template not found: {path}" | | Slug generation failed | 1 | "Slug generation failed (no alphanumeric content)" | | Invalid user-provided ID | 1 | "Bug ID must match pattern bug-NNNN" | | File write failed | 1 | "Failed to write bug file: {path}" | | jq not available | 127 | "jq is required" |
Target: < 500 ms for slug generation + file creation. No network I/O; all operations are local file and string processing.
Read .claude/knowledge/governance/bug-lifecycle.md for the canonical bug lifecycle state machine.
| Skill | Relationship | Context |
|-------|-------------|---------|
| x-refine-bug | called after | Refine workflow accepts created bugs |
| x-implement-epic | consumes | Epic lifecycle can invoke to create test bugs |
| _TEMPLATE-BUG.md | dependency | Template must exist at .claude/templates/_TEMPLATE-BUG.md |
| bug-lifecycle.yaml | dependency | Capability declaration must be present |
config/capabilities/bug-lifecycle.yaml.claude/templates/_TEMPLATE-BUG.md/x-refine-bugMinimum viable contract above. Detailed bash for all 8 steps, slug-generation pipeline, template substitution map, worked examples, and acceptance test scenarios live in references/full-protocol.md per ADR-0012 (skill body slim-by-default).
tools
Documentation automation v2: stack-aware generation from documentation.targets.
development
Generates or updates CI/CD pipelines per project stack with actionlint validation.
tools
Generates ADRs from architecture-plan mini-ADRs with sequential numbering and index update.
development
Formats source code; first step of the pre-commit chain (format -> lint -> compile).