{"id":"ce388387-34cb-4e02-a04e-e9b269ac92db","entityType":"agent","slug":"clawhub-athola-nm-sanctum-workflow-improvement","name":"workflow-improvement","canonicalUrl":"https://www.xpersona.co/agent/clawhub-athola-nm-sanctum-workflow-improvement","canonicalPath":"/agent/clawhub-athola-nm-sanctum-workflow-improvement","generatedAt":"2026-10-11T07:43:23.656Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T05:11:42.441Z","emptyReason":null},"description":"Evaluates and improves skills, agents, commands, and hooks after a workflow slice Skill: workflow-improvement Owner: athola Summary: Evaluates and improves skills, agents, commands, and hooks after a workflow slice Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:21:32.521Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:41:31.750Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:58:18.730Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:06:05.813Z | user Release v1.9.14 v1.9.13 | 2026-06-","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-sanctum-workflow-improvement","sourceUrl":"https://clawhub.ai/athola/nm-sanctum-workflow-improvement","homepage":"https://clawhub.ai/athola/skills/nm-sanctum-workflow-improvement","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/athola/nm-sanctum-workflow-improvement","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/athola/skills/nm-sanctum-workflow-improvement","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Evaluates and improves skills, agents, commands, and hooks after a workflow slice Skill: workflow-improvement Owner: athola Summary: Evaluates and improves skil"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T05:11:42.441Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T05:11:42.441Z","emptyReason":null},"stars":null,"forks":null,"downloads":1150,"packageName":null,"latestVersion":"1.9.19","tractionLabel":"1.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T05:11:42.369Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T05:11:42.441Z","lastCrawledAt":"2026-10-11T05:11:42.369Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T05:11:42.369Z","lastVerifiedAt":null,"highlights":[{"version":"1.9.19","createdAt":"2026-08-26T13:21:32.521Z","changelog":"Release v1.9.19","fileCount":4,"zipByteSize":8822},{"version":"1.9.17","createdAt":"2026-07-30T05:41:31.750Z","changelog":"Release v1.9.17","fileCount":4,"zipByteSize":8891},{"version":"1.9.16","createdAt":"2026-07-14T19:58:18.730Z","changelog":"Release v1.9.16","fileCount":4,"zipByteSize":8944},{"version":"1.9.14","createdAt":"2026-06-30T18:06:05.813Z","changelog":"Release v1.9.14","fileCount":4,"zipByteSize":8824},{"version":"1.9.13","createdAt":"2026-06-27T16:23:51.339Z","changelog":"Release v1.9.13","fileCount":4,"zipByteSize":8912},{"version":"1.9.12","createdAt":"2026-06-19T03:19:26.527Z","changelog":"Release v1.9.12","fileCount":4,"zipByteSize":8785},{"version":"1.0.2","createdAt":"2026-05-09T02:20:15.190Z","changelog":"Release v1.9.5","fileCount":3,"zipByteSize":7638},{"version":"1.0.1","createdAt":"2026-05-06T14:21:42.871Z","changelog":"Release v1.9.4","fileCount":3,"zipByteSize":7638}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-sanctum-workflow-improvement","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T07:43:23.653Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-workflow-improvement/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T05:11:42.441Z","emptyReason":null},"readme":"Skill: workflow-improvement\n\nOwner: athola\n\nSummary: Evaluates and improves skills, agents, commands, and hooks after a workflow slice\n\nTags: latest:1.9.19\n\nVersion history:\n\nv1.9.19 | 2026-08-26T13:21:32.521Z | user\n\nRelease v1.9.19\n\nv1.9.17 | 2026-07-30T05:41:31.750Z | user\n\nRelease v1.9.17\n\nv1.9.16 | 2026-07-14T19:58:18.730Z | user\n\nRelease v1.9.16\n\nv1.9.14 | 2026-06-30T18:06:05.813Z | user\n\nRelease v1.9.14\n\nv1.9.13 | 2026-06-27T16:23:51.339Z | user\n\nRelease v1.9.13\n\nv1.9.12 | 2026-06-19T03:19:26.527Z | user\n\nRelease v1.9.12\n\nv1.0.2 | 2026-05-09T02:20:15.190Z | user\n\nRelease v1.9.5\n\nv1.0.1 | 2026-05-06T14:21:42.871Z | user\n\nRelease v1.9.4\n\nv1.0.0 | 2026-04-20T13:01:28.544Z | auto\n\n- Initial release of the workflow-improvement skill, focused on retrospective analysis and enhancement of skill, agent, command, and hook workflows.\n- Introduces a step-by-step process: context gathering, session slice capture, workflow recreation, improvement generation, plan agreement, implementation, validation, and lesson storage.\n- Provides detailed guidance on gathering data from logs, git history, and knowledge bases to identify and address recurring workflow issues.\n- Includes validation metrics and templates to clearly measure workflow improvements.\n- Establishes conventions for both code changes and documentation.\n- Sets up triggers for use in scenarios involving workflow inefficiency, instability, or recurring issues.\n\nArchive index:\n\nArchive v1.9.19: 4 files, 8822 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), skill-card.md (2119b), SKILL.md (9653b), _meta.json (151b)\n\nFile v1.9.19:SKILL.md\n\n---\nname: workflow-improvement\ndescription: |\n  Evaluates and improves skills, agents, commands, and hooks after a workflow slice\nversion: 1.9.8\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\n  - execution felt slow\n  - confusing\n  - repetitive\n  - or fragile\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\"\n```\n\n## Step 1: Capture the Session Slice (`slice-captured`)\n\nIdentify the **most recent command or session slice** in the current context window and capture:\n- **Trigger**: What command / request started it (include the literal `/command` if present)\n- **Goal**: What \"done\" meant for the user\n- **Artifacts touched**: Skills, agents, commands, hooks (names + file paths)\n- **Evidence**: Key tool calls / errors / retries that indicate inefficiency\n- **Context from Step 0**: Reference any relevant patterns from improvement context\n\nIf the slice is ambiguous, pick the most recent *complete* attempt and state the exact boundary you chose.\n\n## Step 2: Recreate the Workflow (`workflow-recreated`)\n\nReconstruct the workflow as a numbered list of 5 to 20 steps, identifying inputs, branch points for decisions, and outputs such as file changes or state modifications. During this reconstruction, identify specific friction points that reduce efficiency. These often include repeated steps or redundant tool calls, as well as missing guardrails where validation occurs too late or prerequisites are unclear. Other common issues are a lack of automation for tasks that should be scripted, and discoverability gaps caused by confusing naming conventions.\n\n**Cross-reference with Step 0 context:**\n- Are friction points matching known failure patterns?\n- Do repeated steps align with git history themes?\n- Are missing guardrails mentioned in review-chamber lessons?\n\n## Step 3: Generate Improvements (`improvements-generated`)\n\nGenerate 3 to 5 distinct improvement approaches and score each on impact, complexity, reversibility, and consistency with existing sanctum patterns. The scoring should specifically address whether the change prevents the recurrence of patterns identified in Step 0. Prioritize improvements that address components with a high stability gap (greater than 0.3) or recurring issues found in the git history. You should also incorporate lessons from the review-chamber and aim to reduce failure modes identified in the skill logs. Prefer small, high-use changes such as tightening a skill's exit criteria, adding missing command options, improving hook guardrails for better observability, or splitting overloaded commands into clearer phases.\n\n## Step 4: Agree on a Plan (`plan-agreed`)\n\nChoose 1 approach and define:\n- Acceptance criteria (\"substantive difference\")\n- Files to change\n- Validation commands to run\n- Out-of-scope items to defer\n\nKeep the plan bounded: aim for ≤ 5 files changed unless the workflow truly spans more.\n\n## Step 5: Implement (`changes-implemented`)\n\nApply changes following sanctum conventions:\n- Keep naming consistent across `commands/`, `agents/`, `skills/`, `hooks/`\n- Prefer documentation-first improvements if ambiguity was the primary issue\n- If behavior changes, add/adjust tests in `plugins/sanctum/tests/`\n\n## Step 6: Validate Substantive Improvement (`validated`)\n\nValidation should include at least 2 of:\n- Plugin validators / unit tests passing (targeted)\n- Re-running the minimal workflow reproduction with fewer steps or less manual work\n- A clear reduction in failure modes (e.g., earlier validation, clearer options)\n\nRecord the before/after comparison as *metrics*, not prose:\n- Step count reduction\n- Tool call reduction\n- Errors avoided (what would have failed before)\n- Duration improvement (if measurable)\n\n### Metrics Comparison Template\n\n```markdown\n## Validation Results\n\n### Before Improvement\n- Step count: 15\n- Tool calls: 23\n- Failure points: 3\n- Duration: ~8 minutes\n- Manual interventions: 5\n\n### After Improvement\n- Step count: 11 (-4, -27%)\n- Tool calls: 17 (-6, -26%)\n- Failure points: 0 (-3, -100%)\n- Duration: ~5 minutes (-37%)\n- Manual interventions: 2 (-3, -60%)\n\n### Verification\n[E1] Command: `python3 plugins/sanctum/scripts/test_workflow.py`\nOutput: All tests passed (0.5s)\n\n[E2] Command: `/validate-plugin sanctum`\nOutput: No issues found\n```\n\n## Step 7: Close the Loop (Store Lessons)\n\nAfter validation, capture the improvement for future reference:\n\n### 7.1: Update Git History\n\nCommit with descriptive message that future searches will find:\n\n```bash\ngit add <changed-files>\ngit commit -m \"improve(sanctum): <component> - <specific fix>\n\nAddresses recurring issue: <pattern from Step 0>\nReduces <metric> by <percentage>\n\nEvidence: stability_gap reduced from 0.35 to 0.12\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>\"\n```\n\n### 7.2: Post Tooling Learnings to Discussions (Preferred)\n\nObservations about night-market tooling (skill behavior, agent\ncoordination, hook timing, command UX) belong in\nhttps://github.com/athola/claude-night-market/discussions,\nnot local memory. Always target the night-market repo\nregardless of which repo you are currently working in.\n\n```bash\n# Post to night-market Learnings category\n# See fix-pr Step 6.7 for the full GraphQL pattern\n# targeting athola/claude-night-market explicitly\n```\n\n> Repo-specific learnings stay in the current repo. Tooling\n> learnings always go to\n> https://github.com/athola/claude-night-market/discussions\n> so the framework can improve.\n\n### 7.3: Capture Lesson in Memory Palace (Optional, Local Only)\n\nIf the improvement addresses a repo-specific pattern (not\ntooling), store it locally:\n\n```bash\n# Store in review-chamber lessons\n/review-room capture --room lessons --title \"Workflow: <pattern name>\"\n```\n\n### 7.4: Update Improvement Metrics\n\nTrack the improvement's impact:\n\n```bash\n# Check post-improvement stability\npensive:skill-review --skill sanctum:<component> --recommendations\n```\n\nThis creates a feedback loop where future `/fix-workflow` and `/update-plugins` runs will reference this lesson.\n\n## Supporting Modules\n\n- [Auto issue creation](modules/auto-issue-creation.md) - patterns for automatically creating GitHub issues from deferred items\n\n## Troubleshooting\n\n### Common Issues\n\nIf a command is not found, confirm that all dependencies are installed and accessible in your PATH. For permission errors, check file system permissions and run the command with appropriate privileges. If you encounter unexpected behavior, enable verbose logging using the `--verbose` flag to capture more detailed execution data.\n\nFile v1.9.19:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-workflow-improvement\",\n  \"version\": \"1.9.19\",\n  \"publishedAt\": 1787750492521\n}\n\nFile v1.9.19:modules/auto-issue-creation.md\n\n# Automatic Issue Creation for Deferred Items\n\nReusable patterns for automatically creating GitHub issues when items are classified as deferred, backlog, out-of-scope, or suggestions during workflow execution.\n\n## Philosophy\n\n**Automatic by Default**: When items are explicitly classified as deferred/backlog during any workflow, they should be automatically logged to GitHub issues without requiring a separate flag or manual step. The user is notified of what was created.\n\n## When to Use This Module\n\nInclude this module in any workflow that:\n- Classifies items as \"deferred\", \"backlog\", \"out-of-scope\", or \"suggestion\"\n- Identifies work that should be tracked but not addressed immediately\n- Produces improvement recommendations with priority levels\n\n## Integration Pattern\n\n### Step 1: Collect Deferred Items\n\nDuring workflow execution, collect deferred items in a structured format:\n\n```bash\n# Data structure for deferred items\nDEFERRED_ITEMS=()\n\n# Add items as they're identified\nDEFERRED_ITEMS+=(\"type:suggestion|title:Improve error messages|source:PR #123|file:auth.py:45|description:Error messages could be more descriptive|labels:enhancement,plugin:sanctum\")\nDEFERRED_ITEMS+=(\"type:backlog|title:Add rate limiting|source:PR #123|file:routes.py|description:Consider adding rate limiting to API|labels:enhancement,low-priority\")\n```\n\n### Step 2: Invoke Auto-Creation\n\nAt the end of the workflow (after all analysis is complete), invoke the auto-creation routine:\n\n```markdown\n## Auto-Create GitHub Issues\n\nFor each deferred item collected during this workflow:\n\n1. **Check for duplicates** before creating\n2. **Create the issue** with proper labels and context\n3. **Report what was created** to the user\n```\n\n### Step 3: Duplicate Detection\n\nBefore creating any issue, check if a similar issue already exists:\n\n```bash\n# Search for existing issues with similar title\nSEARCH_QUERY=\"$ITEM_TITLE in:title is:issue is:open\"\nEXISTING=$(gh issue list --search \"$SEARCH_QUERY\" --json number,title --jq '.[0].number // empty')\n\nif [[ -n \"$EXISTING\" ]]; then\n  echo \"Skipping duplicate: Issue #$EXISTING already tracks '$ITEM_TITLE'\"\n  SKIPPED_ITEMS+=(\"$ITEM_TITLE (duplicate of #$EXISTING)\")\nelse\n  # Proceed with creation\nfi\n```\n\n### Step 4: Issue Creation Template\n\n```bash\ncreate_deferred_issue() {\n  local TYPE=\"$1\"      # suggestion, backlog, deferred\n  local TITLE=\"$2\"     # Issue title\n  local SOURCE=\"$3\"    # Where it came from (PR #X, /update-plugins, etc.)\n  local FILE=\"$4\"      # file:line reference (optional)\n  local DESC=\"$5\"      # Description\n  local LABELS=\"$6\"    # Comma-separated labels\n\n  # Determine prefix based on type\n  case \"$TYPE\" in\n    suggestion) PREFIX=\"[Suggestion]\" ;;\n    backlog) PREFIX=\"[Backlog]\" ;;\n    deferred|out-of-scope) PREFIX=\"[Deferred]\" ;;\n    improvement) PREFIX=\"[Improvement]\" ;;\n    *) PREFIX=\"\" ;;\n  esac\n\n  # Create issue body\n  BODY=\"## Context\n\nIdentified during $SOURCE as $TYPE item.\n\n$(if [[ -n \"$FILE\" ]]; then echo \"**Location:** \\`$FILE\\`\"; fi)\n\n## Description\n\n$DESC\n\n## Value\n\nThis improvement would enhance the codebase by addressing an identified opportunity.\n\n## Acceptance Criteria\n\n- [ ] Implementation complete\n- [ ] Tests added/updated (if applicable)\n- [ ] Documentation updated (if applicable)\n\n---\n*Auto-created by workflow execution*\"\n\n  # Create the issue\n  ISSUE_URL=$(gh issue create \\\n    --title \"$PREFIX $TITLE\" \\\n    --body \"$BODY\" \\\n    --label \"$LABELS\" 2>&1)\n\n  if [[ $? -eq 0 ]]; then\n    echo \"$ISSUE_URL\"\n  else\n    echo \"ERROR: $ISSUE_URL\"\n    return 1\n  fi\n}\n```\n\n### Step 5: Report Created Issues\n\nAfter all issues are created, report to the user:\n\n```markdown\n### Issues Created (Automatic)\n\n| Type | Title | Issue | Labels |\n|------|-------|-------|--------|\n| Suggestion | Improve error messages | [#115](url) | enhancement, plugin:sanctum |\n| Backlog | Add rate limiting | [#116](url) | enhancement, low-priority |\n\n**Skipped (duplicates):**\n- \"Fix validation\" (duplicate of #42)\n```\n\n## Workflow-Specific Integration\n\n### For `/pr-review`\n\nAdd to Phase 3 (after triage):\n\n```markdown\n### Auto-Create Issues for Out-of-Scope Items\n\nItems classified as \"Suggestion\" or \"Out-of-Scope\" during triage are automatically logged:\n\n1. For each suggestion/out-of-scope item:\n   - Check for duplicate issues\n   - Create issue with `[Suggestion]` or `[Deferred]` prefix\n   - Add labels: `enhancement`, plugin label, priority label\n   - Reference the source PR\n\n2. Report created issues in the review summary\n```\n\n### For `/fix-pr`\n\nAdd to Step 6.1/6.2 (issue creation is already defined - make it automatic):\n\n```markdown\n### Automatic Issue Creation\n\n**CHANGE: Issue creation for suggestions and deferred items is now AUTOMATIC.**\n\nWhen items are classified as \"Suggestion\" or \"Deferred\" during triage (Step 2):\n- Issues are created automatically at the end of Step 6\n- No `--create-backlog-issues` flag required\n- User is notified of all created issues in the summary\n\n**Skip automatic creation with:** `--no-auto-issues` flag\n```\n\n### For `/update-plugins`\n\nAdd to Step 5 (after recommendations):\n\n```markdown\n### Auto-Create Issues for Improvement Recommendations\n\nItems in \"Critical\" and \"Moderate\" categories are automatically logged:\n\n1. For each improvement recommendation:\n   - Check for duplicate issues\n   - Create issue with `[Improvement]` prefix\n   - Add labels based on component type and priority\n   - Reference the plugin being analyzed\n\n2. \"Low Priority\" items are reported but not auto-created (stay in backlog docs)\n```\n\n### For `/fix-workflow`\n\nAdd to Phase 2 (outcome feedback):\n\n```markdown\n### Auto-Create Issues for Identified Improvements\n\nWhen retrospective analysis identifies workflow improvements:\n- Improvements that can't be implemented immediately → auto-create issue\n- Pattern: \"[Workflow] <improvement description>\"\n- Labels: `refactor`, `workflow`, priority based on complexity score\n```\n\n## Label Strategy\n\n| Item Type | Default Labels |\n|-----------|---------------|\n| Suggestion | `enhancement`, `low-priority`, `small-effort` |\n| Backlog | `enhancement`, `low-priority` |\n| Deferred | `enhancement`, `medium-priority` |\n| Improvement (Critical) | `enhancement`, `high-priority` |\n| Improvement (Moderate) | `enhancement`, `medium-priority` |\n| Workflow | `refactor`, `workflow` |\n\nAlways add plugin-specific labels when applicable: `plugin:sanctum`, `plugin:imbue`, etc.\n\n## Error Handling\n\n```bash\n# If issue creation fails\nif ! ISSUE_URL=$(create_deferred_issue ...); then\n  echo \"Warning: Failed to create issue for '$TITLE'\"\n  echo \"Error: $ISSUE_URL\"\n  FAILED_ITEMS+=(\"$TITLE\")\nfi\n```\n\nAt end of workflow:\n\n```markdown\n### Issue Creation Summary\n\n**Created:** 3 issues\n**Skipped (duplicates):** 1\n**Failed:** 0\n\nIf any failed, manually create using:\n\\`\\`\\`bash\ngh issue create --title \"[Type] Title\" --body \"...\" --label \"labels\"\n\\`\\`\\`\n```\n\n## Opting Out\n\nTo disable automatic issue creation for a specific workflow run:\n\n```bash\n# Flag to disable\n--no-auto-issues\n\n# Or environment variable\nSKIP_AUTO_ISSUES=true /pr-review 123\n```\n\nWhen disabled, deferred items are still reported but not created as issues:\n\n```markdown\n### Deferred Items (not auto-created)\n\nThe following items were identified but not logged to GitHub:\n- Suggestion: Improve error messages (auth.py:45)\n- Backlog: Add rate limiting (routes.py)\n\nTo create issues manually: `/create-issue \"Title\" --labels \"enhancement\"`\n```\n\nFile v1.9.19:skill-card.md\n\n## Description:\n\nEvaluates and improves skills, agents, commands, and hooks after a workflow slice.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[athola](https://clawhub.ai/user/athola)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and teams use this skill after a workflow slice to analyze friction in skills, agents, commands, and hooks, choose bounded improvements, implement them, and validate measurable workflow gains.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can expose private workflow, repository, or process details when creating GitHub issues or discussions.\n\nMitigation: Preview the exact content before posting, verify the destination repository and visibility, and redact private filenames, stack traces, secrets, and repository-specific context.\n\nRisk: The skill may write persistent records or change workflow assets during improvement work.\n\nMitigation: Require explicit approval before any git commit, GitHub issue, or GitHub Discussion post, and review proposed file changes before applying them.\n\n## Reference(s):\n\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum)\n- [Automatic issue creation module](artifact/modules/auto-issue-creation.md)\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-workflow-improvement)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown with inline bash code blocks and structured checklists]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May propose workflow asset edits and GitHub issue or discussion commands that should be previewed and approved before execution.]\n\n## Skill Version(s):\n\n1.9.19 (source: ClawHub release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.9.17: 4 files, 8891 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), skill-card.md (2423b), SKILL.md (9653b), _meta.json (151b)\n\nFile v1.9.17:SKILL.md\n\n---\nname: workflow-improvement\ndescription: |\n  Evaluates and improves skills, agents, commands, and hooks after a workflow slice\nversion: 1.9.8\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\n  - execution felt slow\n  - confusing\n  - repetitive\n  - or fragile\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\"\n```\n\n## Step 1: Capture the Session Slice (`slice-captured`)\n\nIdentify the **most recent command or session slice** in the current context window and capture:\n- **Trigger**: What command / request started it (include the literal `/command` if present)\n- **Goal**: What \"done\" meant for the user\n- **Artifacts touched**: Skills, agents, commands, hooks (names + file paths)\n- **Evidence**: Key tool calls / errors / retries that indicate inefficiency\n- **Context from Step 0**: Reference any relevant patterns from improvement context\n\nIf the slice is ambiguous, pick the most recent *complete* attempt and state the exact boundary you chose.\n\n## Step 2: Recreate the Workflow (`workflow-recreated`)\n\nReconstruct the workflow as a numbered list of 5 to 20 steps, identifying inputs, branch points for decisions, and outputs such as file changes or state modifications. During this reconstruction, identify specific friction points that reduce efficiency. These often include repeated steps or redundant tool calls, as well as missing guardrails where validation occurs too late or prerequisites are unclear. Other common issues are a lack of automation for tasks that should be scripted, and discoverability gaps caused by confusing naming conventions.\n\n**Cross-reference with Step 0 context:**\n- Are friction points matching known failure patterns?\n- Do repeated steps align with git history themes?\n- Are missing guardrails mentioned in review-chamber lessons?\n\n## Step 3: Generate Improvements (`improvements-generated`)\n\nGenerate 3 to 5 distinct improvement approaches and score each on impact, complexity, reversibility, and consistency with existing sanctum patterns. The scoring should specifically address whether the change prevents the recurrence of patterns identified in Step 0. Prioritize improvements that address components with a high stability gap (greater than 0.3) or recurring issues found in the git history. You should also incorporate lessons from the review-chamber and aim to reduce failure modes identified in the skill logs. Prefer small, high-use changes such as tightening a skill's exit criteria, adding missing command options, improving hook guardrails for better observability, or splitting overloaded commands into clearer phases.\n\n## Step 4: Agree on a Plan (`plan-agreed`)\n\nChoose 1 approach and define:\n- Acceptance criteria (\"substantive difference\")\n- Files to change\n- Validation commands to run\n- Out-of-scope items to defer\n\nKeep the plan bounded: aim for ≤ 5 files changed unless the workflow truly spans more.\n\n## Step 5: Implement (`changes-implemented`)\n\nApply changes following sanctum conventions:\n- Keep naming consistent across `commands/`, `agents/`, `skills/`, `hooks/`\n- Prefer documentation-first improvements if ambiguity was the primary issue\n- If behavior changes, add/adjust tests in `plugins/sanctum/tests/`\n\n## Step 6: Validate Substantive Improvement (`validated`)\n\nValidation should include at least 2 of:\n- Plugin validators / unit tests passing (targeted)\n- Re-running the minimal workflow reproduction with fewer steps or less manual work\n- A clear reduction in failure modes (e.g., earlier validation, clearer options)\n\nRecord the before/after comparison as *metrics*, not prose:\n- Step count reduction\n- Tool call reduction\n- Errors avoided (what would have failed before)\n- Duration improvement (if measurable)\n\n### Metrics Comparison Template\n\n```markdown\n## Validation Results\n\n### Before Improvement\n- Step count: 15\n- Tool calls: 23\n- Failure points: 3\n- Duration: ~8 minutes\n- Manual interventions: 5\n\n### After Improvement\n- Step count: 11 (-4, -27%)\n- Tool calls: 17 (-6, -26%)\n- Failure points: 0 (-3, -100%)\n- Duration: ~5 minutes (-37%)\n- Manual interventions: 2 (-3, -60%)\n\n### Verification\n[E1] Command: `python3 plugins/sanctum/scripts/test_workflow.py`\nOutput: All tests passed (0.5s)\n\n[E2] Command: `/validate-plugin sanctum`\nOutput: No issues found\n```\n\n## Step 7: Close the Loop (Store Lessons)\n\nAfter validation, capture the improvement for future reference:\n\n### 7.1: Update Git History\n\nCommit with descriptive message that future searches will find:\n\n```bash\ngit add <changed-files>\ngit commit -m \"improve(sanctum): <component> - <specific fix>\n\nAddresses recurring issue: <pattern from Step 0>\nReduces <metric> by <percentage>\n\nEvidence: stability_gap reduced from 0.35 to 0.12\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>\"\n```\n\n### 7.2: Post Tooling Learnings to Discussions (Preferred)\n\nObservations about night-market tooling (skill behavior, agent\ncoordination, hook timing, command UX) belong in\nhttps://github.com/athola/claude-night-market/discussions,\nnot local memory. Always target the night-market repo\nregardless of which repo you are currently working in.\n\n```bash\n# Post to night-market Learnings category\n# See fix-pr Step 6.7 for the full GraphQL pattern\n# targeting athola/claude-night-market explicitly\n```\n\n> Repo-specific learnings stay in the current repo. Tooling\n> learnings always go to\n> https://github.com/athola/claude-night-market/discussions\n> so the framework can improve.\n\n### 7.3: Capture Lesson in Memory Palace (Optional, Local Only)\n\nIf the improvement addresses a repo-specific pattern (not\ntooling), store it locally:\n\n```bash\n# Store in review-chamber lessons\n/review-room capture --room lessons --title \"Workflow: <pattern name>\"\n```\n\n### 7.4: Update Improvement Metrics\n\nTrack the improvement's impact:\n\n```bash\n# Check post-improvement stability\npensive:skill-review --skill sanctum:<component> --recommendations\n```\n\nThis creates a feedback loop where future `/fix-workflow` and `/update-plugins` runs will reference this lesson.\n\n## Supporting Modules\n\n- [Auto issue creation](modules/auto-issue-creation.md) - patterns for automatically creating GitHub issues from deferred items\n\n## Troubleshooting\n\n### Common Issues\n\nIf a command is not found, confirm that all dependencies are installed and accessible in your PATH. For permission errors, check file system permissions and run the command with appropriate privileges. If you encounter unexpected behavior, enable verbose logging using the `--verbose` flag to capture more detailed execution data.\n\nFile v1.9.17:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-workflow-improvement\",\n  \"version\": \"1.9.17\",\n  \"publishedAt\": 1785390091750\n}\n\nFile v1.9.17:modules/auto-issue-creation.md\n\n# Automatic Issue Creation for Deferred Items\n\nReusable patterns for automatically creating GitHub issues when items are classified as deferred, backlog, out-of-scope, or suggestions during workflow execution.\n\n## Philosophy\n\n**Automatic by Default**: When items are explicitly classified as deferred/backlog during any workflow, they should be automatically logged to GitHub issues without requiring a separate flag or manual step. The user is notified of what was created.\n\n## When to Use This Module\n\nInclude this module in any workflow that:\n- Classifies items as \"deferred\", \"backlog\", \"out-of-scope\", or \"suggestion\"\n- Identifies work that should be tracked but not addressed immediately\n- Produces improvement recommendations with priority levels\n\n## Integration Pattern\n\n### Step 1: Collect Deferred Items\n\nDuring workflow execution, collect deferred items in a structured format:\n\n```bash\n# Data structure for deferred items\nDEFERRED_ITEMS=()\n\n# Add items as they're identified\nDEFERRED_ITEMS+=(\"type:suggestion|title:Improve error messages|source:PR #123|file:auth.py:45|description:Error messages could be more descriptive|labels:enhancement,plugin:sanctum\")\nDEFERRED_ITEMS+=(\"type:backlog|title:Add rate limiting|source:PR #123|file:routes.py|description:Consider adding rate limiting to API|labels:enhancement,low-priority\")\n```\n\n### Step 2: Invoke Auto-Creation\n\nAt the end of the workflow (after all analysis is complete), invoke the auto-creation routine:\n\n```markdown\n## Auto-Create GitHub Issues\n\nFor each deferred item collected during this workflow:\n\n1. **Check for duplicates** before creating\n2. **Create the issue** with proper labels and context\n3. **Report what was created** to the user\n```\n\n### Step 3: Duplicate Detection\n\nBefore creating any issue, check if a similar issue already exists:\n\n```bash\n# Search for existing issues with similar title\nSEARCH_QUERY=\"$ITEM_TITLE in:title is:issue is:open\"\nEXISTING=$(gh issue list --search \"$SEARCH_QUERY\" --json number,title --jq '.[0].number // empty')\n\nif [[ -n \"$EXISTING\" ]]; then\n  echo \"Skipping duplicate: Issue #$EXISTING already tracks '$ITEM_TITLE'\"\n  SKIPPED_ITEMS+=(\"$ITEM_TITLE (duplicate of #$EXISTING)\")\nelse\n  # Proceed with creation\nfi\n```\n\n### Step 4: Issue Creation Template\n\n```bash\ncreate_deferred_issue() {\n  local TYPE=\"$1\"      # suggestion, backlog, deferred\n  local TITLE=\"$2\"     # Issue title\n  local SOURCE=\"$3\"    # Where it came from (PR #X, /update-plugins, etc.)\n  local FILE=\"$4\"      # file:line reference (optional)\n  local DESC=\"$5\"      # Description\n  local LABELS=\"$6\"    # Comma-separated labels\n\n  # Determine prefix based on type\n  case \"$TYPE\" in\n    suggestion) PREFIX=\"[Suggestion]\" ;;\n    backlog) PREFIX=\"[Backlog]\" ;;\n    deferred|out-of-scope) PREFIX=\"[Deferred]\" ;;\n    improvement) PREFIX=\"[Improvement]\" ;;\n    *) PREFIX=\"\" ;;\n  esac\n\n  # Create issue body\n  BODY=\"## Context\n\nIdentified during $SOURCE as $TYPE item.\n\n$(if [[ -n \"$FILE\" ]]; then echo \"**Location:** \\`$FILE\\`\"; fi)\n\n## Description\n\n$DESC\n\n## Value\n\nThis improvement would enhance the codebase by addressing an identified opportunity.\n\n## Acceptance Criteria\n\n- [ ] Implementation complete\n- [ ] Tests added/updated (if applicable)\n- [ ] Documentation updated (if applicable)\n\n---\n*Auto-created by workflow execution*\"\n\n  # Create the issue\n  ISSUE_URL=$(gh issue create \\\n    --title \"$PREFIX $TITLE\" \\\n    --body \"$BODY\" \\\n    --label \"$LABELS\" 2>&1)\n\n  if [[ $? -eq 0 ]]; then\n    echo \"$ISSUE_URL\"\n  else\n    echo \"ERROR: $ISSUE_URL\"\n    return 1\n  fi\n}\n```\n\n### Step 5: Report Created Issues\n\nAfter all issues are created, report to the user:\n\n```markdown\n### Issues Created (Automatic)\n\n| Type | Title | Issue | Labels |\n|------|-------|-------|--------|\n| Suggestion | Improve error messages | [#115](url) | enhancement, plugin:sanctum |\n| Backlog | Add rate limiting | [#116](url) | enhancement, low-priority |\n\n**Skipped (duplicates):**\n- \"Fix validation\" (duplicate of #42)\n```\n\n## Workflow-Specific Integration\n\n### For `/pr-review`\n\nAdd to Phase 3 (after triage):\n\n```markdown\n### Auto-Create Issues for Out-of-Scope Items\n\nItems classified as \"Suggestion\" or \"Out-of-Scope\" during triage are automatically logged:\n\n1. For each suggestion/out-of-scope item:\n   - Check for duplicate issues\n   - Create issue with `[Suggestion]` or `[Deferred]` prefix\n   - Add labels: `enhancement`, plugin label, priority label\n   - Reference the source PR\n\n2. Report created issues in the review summary\n```\n\n### For `/fix-pr`\n\nAdd to Step 6.1/6.2 (issue creation is already defined - make it automatic):\n\n```markdown\n### Automatic Issue Creation\n\n**CHANGE: Issue creation for suggestions and deferred items is now AUTOMATIC.**\n\nWhen items are classified as \"Suggestion\" or \"Deferred\" during triage (Step 2):\n- Issues are created automatically at the end of Step 6\n- No `--create-backlog-issues` flag required\n- User is notified of all created issues in the summary\n\n**Skip automatic creation with:** `--no-auto-issues` flag\n```\n\n### For `/update-plugins`\n\nAdd to Step 5 (after recommendations):\n\n```markdown\n### Auto-Create Issues for Improvement Recommendations\n\nItems in \"Critical\" and \"Moderate\" categories are automatically logged:\n\n1. For each improvement recommendation:\n   - Check for duplicate issues\n   - Create issue with `[Improvement]` prefix\n   - Add labels based on component type and priority\n   - Reference the plugin being analyzed\n\n2. \"Low Priority\" items are reported but not auto-created (stay in backlog docs)\n```\n\n### For `/fix-workflow`\n\nAdd to Phase 2 (outcome feedback):\n\n```markdown\n### Auto-Create Issues for Identified Improvements\n\nWhen retrospective analysis identifies workflow improvements:\n- Improvements that can't be implemented immediately → auto-create issue\n- Pattern: \"[Workflow] <improvement description>\"\n- Labels: `refactor`, `workflow`, priority based on complexity score\n```\n\n## Label Strategy\n\n| Item Type | Default Labels |\n|-----------|---------------|\n| Suggestion | `enhancement`, `low-priority`, `small-effort` |\n| Backlog | `enhancement`, `low-priority` |\n| Deferred | `enhancement`, `medium-priority` |\n| Improvement (Critical) | `enhancement`, `high-priority` |\n| Improvement (Moderate) | `enhancement`, `medium-priority` |\n| Workflow | `refactor`, `workflow` |\n\nAlways add plugin-specific labels when applicable: `plugin:sanctum`, `plugin:imbue`, etc.\n\n## Error Handling\n\n```bash\n# If issue creation fails\nif ! ISSUE_URL=$(create_deferred_issue ...); then\n  echo \"Warning: Failed to create issue for '$TITLE'\"\n  echo \"Error: $ISSUE_URL\"\n  FAILED_ITEMS+=(\"$TITLE\")\nfi\n```\n\nAt end of workflow:\n\n```markdown\n### Issue Creation Summary\n\n**Created:** 3 issues\n**Skipped (duplicates):** 1\n**Failed:** 0\n\nIf any failed, manually create using:\n\\`\\`\\`bash\ngh issue create --title \"[Type] Title\" --body \"...\" --label \"labels\"\n\\`\\`\\`\n```\n\n## Opting Out\n\nTo disable automatic issue creation for a specific workflow run:\n\n```bash\n# Flag to disable\n--no-auto-issues\n\n# Or environment variable\nSKIP_AUTO_ISSUES=true /pr-review 123\n```\n\nWhen disabled, deferred items are still reported but not created as issues:\n\n```markdown\n### Deferred Items (not auto-created)\n\nThe following items were identified but not logged to GitHub:\n- Suggestion: Improve error messages (auth.py:45)\n- Backlog: Add rate limiting (routes.py)\n\nTo create issues manually: `/create-issue \"Title\" --labels \"enhancement\"`\n```\n\nFile v1.9.17:skill-card.md\n\n## Description: <br>\nEvaluates and improves skills, agents, commands, and hooks after a workflow slice. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and maintainers use this skill after a slow, confusing, repetitive, or fragile workflow slice to identify friction and improve the involved skills, agents, commands, and hooks. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can direct an agent to inspect workflow history and logs, which may expose private or sensitive repository context. <br>\nMitigation: Review the skill before installation and avoid using it on private or sensitive repositories unless external-sharing steps are disabled. <br>\nRisk: The workflow includes persistent repository changes such as editing workflow files and creating commits. <br>\nMitigation: Require explicit review and approval before applying file edits or committing changes. <br>\nRisk: The workflow can create GitHub issues or post public Discussions entries. <br>\nMitigation: Require manual confirmation before any GitHub issue creation or public Discussions post. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-workflow-improvement) <br>\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n- [Auto issue creation module](modules/auto-issue-creation.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, Guidance] <br>\n**Output Format:** [Markdown with structured checklists, inline shell commands, and code snippets] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May propose workflow-asset edits and GitHub issue or discussion actions; require manual confirmation before external publication or persistent repository changes.] <br>\n\n## Skill Version(s): <br>\n1.9.17 (source: server release metadata; artifact frontmatter reports 1.9.8) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.16: 4 files, 8944 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), skill-card.md (2470b), SKILL.md (9653b), _meta.json (151b)\n\nFile v1.9.16:SKILL.md\n\n---\nname: workflow-improvement\ndescription: |\n  Evaluates and improves skills, agents, commands, and hooks after a workflow slice\nversion: 1.9.8\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\n  - execution felt slow\n  - confusing\n  - repetitive\n  - or fragile\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\"\n```\n\n## Step 1: Capture the Session Slice (`slice-captured`)\n\nIdentify the **most recent command or session slice** in the current context window and capture:\n- **Trigger**: What command / request started it (include the literal `/command` if present)\n- **Goal**: What \"done\" meant for the user\n- **Artifacts touched**: Skills, agents, commands, hooks (names + file paths)\n- **Evidence**: Key tool calls / errors / retries that indicate inefficiency\n- **Context from Step 0**: Reference any relevant patterns from improvement context\n\nIf the slice is ambiguous, pick the most recent *complete* attempt and state the exact boundary you chose.\n\n## Step 2: Recreate the Workflow (`workflow-recreated`)\n\nReconstruct the workflow as a numbered list of 5 to 20 steps, identifying inputs, branch points for decisions, and outputs such as file changes or state modifications. During this reconstruction, identify specific friction points that reduce efficiency. These often include repeated steps or redundant tool calls, as well as missing guardrails where validation occurs too late or prerequisites are unclear. Other common issues are a lack of automation for tasks that should be scripted, and discoverability gaps caused by confusing naming conventions.\n\n**Cross-reference with Step 0 context:**\n- Are friction points matching known failure patterns?\n- Do repeated steps align with git history themes?\n- Are missing guardrails mentioned in review-chamber lessons?\n\n## Step 3: Generate Improvements (`improvements-generated`)\n\nGenerate 3 to 5 distinct improvement approaches and score each on impact, complexity, reversibility, and consistency with existing sanctum patterns. The scoring should specifically address whether the change prevents the recurrence of patterns identified in Step 0. Prioritize improvements that address components with a high stability gap (greater than 0.3) or recurring issues found in the git history. You should also incorporate lessons from the review-chamber and aim to reduce failure modes identified in the skill logs. Prefer small, high-use changes such as tightening a skill's exit criteria, adding missing command options, improving hook guardrails for better observability, or splitting overloaded commands into clearer phases.\n\n## Step 4: Agree on a Plan (`plan-agreed`)\n\nChoose 1 approach and define:\n- Acceptance criteria (\"substantive difference\")\n- Files to change\n- Validation commands to run\n- Out-of-scope items to defer\n\nKeep the plan bounded: aim for ≤ 5 files changed unless the workflow truly spans more.\n\n## Step 5: Implement (`changes-implemented`)\n\nApply changes following sanctum conventions:\n- Keep naming consistent across `commands/`, `agents/`, `skills/`, `hooks/`\n- Prefer documentation-first improvements if ambiguity was the primary issue\n- If behavior changes, add/adjust tests in `plugins/sanctum/tests/`\n\n## Step 6: Validate Substantive Improvement (`validated`)\n\nValidation should include at least 2 of:\n- Plugin validators / unit tests passing (targeted)\n- Re-running the minimal workflow reproduction with fewer steps or less manual work\n- A clear reduction in failure modes (e.g., earlier validation, clearer options)\n\nRecord the before/after comparison as *metrics*, not prose:\n- Step count reduction\n- Tool call reduction\n- Errors avoided (what would have failed before)\n- Duration improvement (if measurable)\n\n### Metrics Comparison Template\n\n```markdown\n## Validation Results\n\n### Before Improvement\n- Step count: 15\n- Tool calls: 23\n- Failure points: 3\n- Duration: ~8 minutes\n- Manual interventions: 5\n\n### After Improvement\n- Step count: 11 (-4, -27%)\n- Tool calls: 17 (-6, -26%)\n- Failure points: 0 (-3, -100%)\n- Duration: ~5 minutes (-37%)\n- Manual interventions: 2 (-3, -60%)\n\n### Verification\n[E1] Command: `python3 plugins/sanctum/scripts/test_workflow.py`\nOutput: All tests passed (0.5s)\n\n[E2] Command: `/validate-plugin sanctum`\nOutput: No issues found\n```\n\n## Step 7: Close the Loop (Store Lessons)\n\nAfter validation, capture the improvement for future reference:\n\n### 7.1: Update Git History\n\nCommit with descriptive message that future searches will find:\n\n```bash\ngit add <changed-files>\ngit commit -m \"improve(sanctum): <component> - <specific fix>\n\nAddresses recurring issue: <pattern from Step 0>\nReduces <metric> by <percentage>\n\nEvidence: stability_gap reduced from 0.35 to 0.12\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>\"\n```\n\n### 7.2: Post Tooling Learnings to Discussions (Preferred)\n\nObservations about night-market tooling (skill behavior, agent\ncoordination, hook timing, command UX) belong in\nhttps://github.com/athola/claude-night-market/discussions,\nnot local memory. Always target the night-market repo\nregardless of which repo you are currently working in.\n\n```bash\n# Post to night-market Learnings category\n# See fix-pr Step 6.7 for the full GraphQL pattern\n# targeting athola/claude-night-market explicitly\n```\n\n> Repo-specific learnings stay in the current repo. Tooling\n> learnings always go to\n> https://github.com/athola/claude-night-market/discussions\n> so the framework can improve.\n\n### 7.3: Capture Lesson in Memory Palace (Optional, Local Only)\n\nIf the improvement addresses a repo-specific pattern (not\ntooling), store it locally:\n\n```bash\n# Store in review-chamber lessons\n/review-room capture --room lessons --title \"Workflow: <pattern name>\"\n```\n\n### 7.4: Update Improvement Metrics\n\nTrack the improvement's impact:\n\n```bash\n# Check post-improvement stability\npensive:skill-review --skill sanctum:<component> --recommendations\n```\n\nThis creates a feedback loop where future `/fix-workflow` and `/update-plugins` runs will reference this lesson.\n\n## Supporting Modules\n\n- [Auto issue creation](modules/auto-issue-creation.md) - patterns for automatically creating GitHub issues from deferred items\n\n## Troubleshooting\n\n### Common Issues\n\nIf a command is not found, confirm that all dependencies are installed and accessible in your PATH. For permission errors, check file system permissions and run the command with appropriate privileges. If you encounter unexpected behavior, enable verbose logging using the `--verbose` flag to capture more detailed execution data.\n\nFile v1.9.16:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-workflow-improvement\",\n  \"version\": \"1.9.16\",\n  \"publishedAt\": 1784059098730\n}\n\nFile v1.9.16:modules/auto-issue-creation.md\n\n# Automatic Issue Creation for Deferred Items\n\nReusable patterns for automatically creating GitHub issues when items are classified as deferred, backlog, out-of-scope, or suggestions during workflow execution.\n\n## Philosophy\n\n**Automatic by Default**: When items are explicitly classified as deferred/backlog during any workflow, they should be automatically logged to GitHub issues without requiring a separate flag or manual step. The user is notified of what was created.\n\n## When to Use This Module\n\nInclude this module in any workflow that:\n- Classifies items as \"deferred\", \"backlog\", \"out-of-scope\", or \"suggestion\"\n- Identifies work that should be tracked but not addressed immediately\n- Produces improvement recommendations with priority levels\n\n## Integration Pattern\n\n### Step 1: Collect Deferred Items\n\nDuring workflow execution, collect deferred items in a structured format:\n\n```bash\n# Data structure for deferred items\nDEFERRED_ITEMS=()\n\n# Add items as they're identified\nDEFERRED_ITEMS+=(\"type:suggestion|title:Improve error messages|source:PR #123|file:auth.py:45|description:Error messages could be more descriptive|labels:enhancement,plugin:sanctum\")\nDEFERRED_ITEMS+=(\"type:backlog|title:Add rate limiting|source:PR #123|file:routes.py|description:Consider adding rate limiting to API|labels:enhancement,low-priority\")\n```\n\n### Step 2: Invoke Auto-Creation\n\nAt the end of the workflow (after all analysis is complete), invoke the auto-creation routine:\n\n```markdown\n## Auto-Create GitHub Issues\n\nFor each deferred item collected during this workflow:\n\n1. **Check for duplicates** before creating\n2. **Create the issue** with proper labels and context\n3. **Report what was created** to the user\n```\n\n### Step 3: Duplicate Detection\n\nBefore creating any issue, check if a similar issue already exists:\n\n```bash\n# Search for existing issues with similar title\nSEARCH_QUERY=\"$ITEM_TITLE in:title is:issue is:open\"\nEXISTING=$(gh issue list --search \"$SEARCH_QUERY\" --json number,title --jq '.[0].number // empty')\n\nif [[ -n \"$EXISTING\" ]]; then\n  echo \"Skipping duplicate: Issue #$EXISTING already tracks '$ITEM_TITLE'\"\n  SKIPPED_ITEMS+=(\"$ITEM_TITLE (duplicate of #$EXISTING)\")\nelse\n  # Proceed with creation\nfi\n```\n\n### Step 4: Issue Creation Template\n\n```bash\ncreate_deferred_issue() {\n  local TYPE=\"$1\"      # suggestion, backlog, deferred\n  local TITLE=\"$2\"     # Issue title\n  local SOURCE=\"$3\"    # Where it came from (PR #X, /update-plugins, etc.)\n  local FILE=\"$4\"      # file:line reference (optional)\n  local DESC=\"$5\"      # Description\n  local LABELS=\"$6\"    # Comma-separated labels\n\n  # Determine prefix based on type\n  case \"$TYPE\" in\n    suggestion) PREFIX=\"[Suggestion]\" ;;\n    backlog) PREFIX=\"[Backlog]\" ;;\n    deferred|out-of-scope) PREFIX=\"[Deferred]\" ;;\n    improvement) PREFIX=\"[Improvement]\" ;;\n    *) PREFIX=\"\" ;;\n  esac\n\n  # Create issue body\n  BODY=\"## Context\n\nIdentified during $SOURCE as $TYPE item.\n\n$(if [[ -n \"$FILE\" ]]; then echo \"**Location:** \\`$FILE\\`\"; fi)\n\n## Description\n\n$DESC\n\n## Value\n\nThis improvement would enhance the codebase by addressing an identified opportunity.\n\n## Acceptance Criteria\n\n- [ ] Implementation complete\n- [ ] Tests added/updated (if applicable)\n- [ ] Documentation updated (if applicable)\n\n---\n*Auto-created by workflow execution*\"\n\n  # Create the issue\n  ISSUE_URL=$(gh issue create \\\n    --title \"$PREFIX $TITLE\" \\\n    --body \"$BODY\" \\\n    --label \"$LABELS\" 2>&1)\n\n  if [[ $? -eq 0 ]]; then\n    echo \"$ISSUE_URL\"\n  else\n    echo \"ERROR: $ISSUE_URL\"\n    return 1\n  fi\n}\n```\n\n### Step 5: Report Created Issues\n\nAfter all issues are created, report to the user:\n\n```markdown\n### Issues Created (Automatic)\n\n| Type | Title | Issue | Labels |\n|------|-------|-------|--------|\n| Suggestion | Improve error messages | [#115](url) | enhancement, plugin:sanctum |\n| Backlog | Add rate limiting | [#116](url) | enhancement, low-priority |\n\n**Skipped (duplicates):**\n- \"Fix validation\" (duplicate of #42)\n```\n\n## Workflow-Specific Integration\n\n### For `/pr-review`\n\nAdd to Phase 3 (after triage):\n\n```markdown\n### Auto-Create Issues for Out-of-Scope Items\n\nItems classified as \"Suggestion\" or \"Out-of-Scope\" during triage are automatically logged:\n\n1. For each suggestion/out-of-scope item:\n   - Check for duplicate issues\n   - Create issue with `[Suggestion]` or `[Deferred]` prefix\n   - Add labels: `enhancement`, plugin label, priority label\n   - Reference the source PR\n\n2. Report created issues in the review summary\n```\n\n### For `/fix-pr`\n\nAdd to Step 6.1/6.2 (issue creation is already defined - make it automatic):\n\n```markdown\n### Automatic Issue Creation\n\n**CHANGE: Issue creation for suggestions and deferred items is now AUTOMATIC.**\n\nWhen items are classified as \"Suggestion\" or \"Deferred\" during triage (Step 2):\n- Issues are created automatically at the end of Step 6\n- No `--create-backlog-issues` flag required\n- User is notified of all created issues in the summary\n\n**Skip automatic creation with:** `--no-auto-issues` flag\n```\n\n### For `/update-plugins`\n\nAdd to Step 5 (after recommendations):\n\n```markdown\n### Auto-Create Issues for Improvement Recommendations\n\nItems in \"Critical\" and \"Moderate\" categories are automatically logged:\n\n1. For each improvement recommendation:\n   - Check for duplicate issues\n   - Create issue with `[Improvement]` prefix\n   - Add labels based on component type and priority\n   - Reference the plugin being analyzed\n\n2. \"Low Priority\" items are reported but not auto-created (stay in backlog docs)\n```\n\n### For `/fix-workflow`\n\nAdd to Phase 2 (outcome feedback):\n\n```markdown\n### Auto-Create Issues for Identified Improvements\n\nWhen retrospective analysis identifies workflow improvements:\n- Improvements that can't be implemented immediately → auto-create issue\n- Pattern: \"[Workflow] <improvement description>\"\n- Labels: `refactor`, `workflow`, priority based on complexity score\n```\n\n## Label Strategy\n\n| Item Type | Default Labels |\n|-----------|---------------|\n| Suggestion | `enhancement`, `low-priority`, `small-effort` |\n| Backlog | `enhancement`, `low-priority` |\n| Deferred | `enhancement`, `medium-priority` |\n| Improvement (Critical) | `enhancement`, `high-priority` |\n| Improvement (Moderate) | `enhancement`, `medium-priority` |\n| Workflow | `refactor`, `workflow` |\n\nAlways add plugin-specific labels when applicable: `plugin:sanctum`, `plugin:imbue`, etc.\n\n## Error Handling\n\n```bash\n# If issue creation fails\nif ! ISSUE_URL=$(create_deferred_issue ...); then\n  echo \"Warning: Failed to create issue for '$TITLE'\"\n  echo \"Error: $ISSUE_URL\"\n  FAILED_ITEMS+=(\"$TITLE\")\nfi\n```\n\nAt end of workflow:\n\n```markdown\n### Issue Creation Summary\n\n**Created:** 3 issues\n**Skipped (duplicates):** 1\n**Failed:** 0\n\nIf any failed, manually create using:\n\\`\\`\\`bash\ngh issue create --title \"[Type] Title\" --body \"...\" --label \"labels\"\n\\`\\`\\`\n```\n\n## Opting Out\n\nTo disable automatic issue creation for a specific workflow run:\n\n```bash\n# Flag to disable\n--no-auto-issues\n\n# Or environment variable\nSKIP_AUTO_ISSUES=true /pr-review 123\n```\n\nWhen disabled, deferred items are still reported but not created as issues:\n\n```markdown\n### Deferred Items (not auto-created)\n\nThe following items were identified but not logged to GitHub:\n- Suggestion: Improve error messages (auth.py:45)\n- Backlog: Add rate limiting (routes.py)\n\nTo create issues manually: `/create-issue \"Title\" --labels \"enhancement\"`\n```\n\nFile v1.9.16:skill-card.md\n\n## Description: <br>\nEvaluates and improves skills, agents, commands, and hooks after a workflow slice. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and maintainers use this skill after a short workflow or command run to identify slow, confusing, repetitive, or fragile steps, then plan and validate improvements to related skills, agents, commands, and hooks. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can review workflow history and project context that may include sensitive operational details. <br>\nMitigation: Review the context and generated summaries before sharing them, and avoid including secrets, private project names, stack traces, architecture details, or internal operational notes. <br>\nRisk: Automatic GitHub issue creation can publish deferred work, recommendations, or tooling lessons to an external repository. <br>\nMitigation: Disable automatic issue creation unless intended, check for duplicates, and review every proposed issue or discussion post before allowing publication. <br>\nRisk: The skill may suggest changes to workflow assets that affect future agent behavior. <br>\nMitigation: Keep changes bounded, review diffs, run targeted validation, and compare before-and-after workflow metrics before relying on the updated assets. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill listing](https://clawhub.ai/athola/skills/nm-sanctum-workflow-improvement) <br>\n- [Metadata homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with checklists, plans, metrics tables, and inline shell commands] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May propose file edits, validation commands, GitHub issue content, and retrospective metrics for human review.] <br>\n\n## Skill Version(s): <br>\n1.9.16 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.14: 4 files, 8824 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), skill-card.md (2202b), SKILL.md (9653b), _meta.json (151b)\n\nFile v1.9.14:SKILL.md\n\n---\nname: workflow-improvement\ndescription: |\n  Evaluates and improves skills, agents, commands, and hooks after a workflow slice\nversion: 1.9.8\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\n  - execution felt slow\n  - confusing\n  - repetitive\n  - or fragile\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\"\n```\n\n## Step 1: Capture the Session Slice (`slice-captured`)\n\nIdentify the **most recent command or session slice** in the current context window and capture:\n- **Trigger**: What command / request started it (include the literal `/command` if present)\n- **Goal**: What \"done\" meant for the user\n- **Artifacts touched**: Skills, agents, commands, hooks (names + file paths)\n- **Evidence**: Key tool calls / errors / retries that indicate inefficiency\n- **Context from Step 0**: Reference any relevant patterns from improvement context\n\nIf the slice is ambiguous, pick the most recent *complete* attempt and state the exact boundary you chose.\n\n## Step 2: Recreate the Workflow (`workflow-recreated`)\n\nReconstruct the workflow as a numbered list of 5 to 20 steps, identifying inputs, branch points for decisions, and outputs such as file changes or state modifications. During this reconstruction, identify specific friction points that reduce efficiency. These often include repeated steps or redundant tool calls, as well as missing guardrails where validation occurs too late or prerequisites are unclear. Other common issues are a lack of automation for tasks that should be scripted, and discoverability gaps caused by confusing naming conventions.\n\n**Cross-reference with Step 0 context:**\n- Are friction points matching known failure patterns?\n- Do repeated steps align with git history themes?\n- Are missing guardrails mentioned in review-chamber lessons?\n\n## Step 3: Generate Improvements (`improvements-generated`)\n\nGenerate 3 to 5 distinct improvement approaches and score each on impact, complexity, reversibility, and consistency with existing sanctum patterns. The scoring should specifically address whether the change prevents the recurrence of patterns identified in Step 0. Prioritize improvements that address components with a high stability gap (greater than 0.3) or recurring issues found in the git history. You should also incorporate lessons from the review-chamber and aim to reduce failure modes identified in the skill logs. Prefer small, high-use changes such as tightening a skill's exit criteria, adding missing command options, improving hook guardrails for better observability, or splitting overloaded commands into clearer phases.\n\n## Step 4: Agree on a Plan (`plan-agreed`)\n\nChoose 1 approach and define:\n- Acceptance criteria (\"substantive difference\")\n- Files to change\n- Validation commands to run\n- Out-of-scope items to defer\n\nKeep the plan bounded: aim for ≤ 5 files changed unless the workflow truly spans more.\n\n## Step 5: Implement (`changes-implemented`)\n\nApply changes following sanctum conventions:\n- Keep naming consistent across `commands/`, `agents/`, `skills/`, `hooks/`\n- Prefer documentation-first improvements if ambiguity was the primary issue\n- If behavior changes, add/adjust tests in `plugins/sanctum/tests/`\n\n## Step 6: Validate Substantive Improvement (`validated`)\n\nValidation should include at least 2 of:\n- Plugin validators / unit tests passing (targeted)\n- Re-running the minimal workflow reproduction with fewer steps or less manual work\n- A clear reduction in failure modes (e.g., earlier validation, clearer options)\n\nRecord the before/after comparison as *metrics*, not prose:\n- Step count reduction\n- Tool call reduction\n- Errors avoided (what would have failed before)\n- Duration improvement (if measurable)\n\n### Metrics Comparison Template\n\n```markdown\n## Validation Results\n\n### Before Improvement\n- Step count: 15\n- Tool calls: 23\n- Failure points: 3\n- Duration: ~8 minutes\n- Manual interventions: 5\n\n### After Improvement\n- Step count: 11 (-4, -27%)\n- Tool calls: 17 (-6, -26%)\n- Failure points: 0 (-3, -100%)\n- Duration: ~5 minutes (-37%)\n- Manual interventions: 2 (-3, -60%)\n\n### Verification\n[E1] Command: `python3 plugins/sanctum/scripts/test_workflow.py`\nOutput: All tests passed (0.5s)\n\n[E2] Command: `/validate-plugin sanctum`\nOutput: No issues found\n```\n\n## Step 7: Close the Loop (Store Lessons)\n\nAfter validation, capture the improvement for future reference:\n\n### 7.1: Update Git History\n\nCommit with descriptive message that future searches will find:\n\n```bash\ngit add <changed-files>\ngit commit -m \"improve(sanctum): <component> - <specific fix>\n\nAddresses recurring issue: <pattern from Step 0>\nReduces <metric> by <percentage>\n\nEvidence: stability_gap reduced from 0.35 to 0.12\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>\"\n```\n\n### 7.2: Post Tooling Learnings to Discussions (Preferred)\n\nObservations about night-market tooling (skill behavior, agent\ncoordination, hook timing, command UX) belong in\nhttps://github.com/athola/claude-night-market/discussions,\nnot local memory. Always target the night-market repo\nregardless of which repo you are currently working in.\n\n```bash\n# Post to night-market Learnings category\n# See fix-pr Step 6.7 for the full GraphQL pattern\n# targeting athola/claude-night-market explicitly\n```\n\n> Repo-specific learnings stay in the current repo. Tooling\n> learnings always go to\n> https://github.com/athola/claude-night-market/discussions\n> so the framework can improve.\n\n### 7.3: Capture Lesson in Memory Palace (Optional, Local Only)\n\nIf the improvement addresses a repo-specific pattern (not\ntooling), store it locally:\n\n```bash\n# Store in review-chamber lessons\n/review-room capture --room lessons --title \"Workflow: <pattern name>\"\n```\n\n### 7.4: Update Improvement Metrics\n\nTrack the improvement's impact:\n\n```bash\n# Check post-improvement stability\npensive:skill-review --skill sanctum:<component> --recommendations\n```\n\nThis creates a feedback loop where future `/fix-workflow` and `/update-plugins` runs will reference this lesson.\n\n## Supporting Modules\n\n- [Auto issue creation](modules/auto-issue-creation.md) - patterns for automatically creating GitHub issues from deferred items\n\n## Troubleshooting\n\n### Common Issues\n\nIf a command is not found, confirm that all dependencies are installed and accessible in your PATH. For permission errors, check file system permissions and run the command with appropriate privileges. If you encounter unexpected behavior, enable verbose logging using the `--verbose` flag to capture more detailed execution data.\n\nFile v1.9.14:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-workflow-improvement\",\n  \"version\": \"1.9.14\",\n  \"publishedAt\": 1782842765813\n}\n\nFile v1.9.14:modules/auto-issue-creation.md\n\n# Automatic Issue Creation for Deferred Items\n\nReusable patterns for automatically creating GitHub issues when items are classified as deferred, backlog, out-of-scope, or suggestions during workflow execution.\n\n## Philosophy\n\n**Automatic by Default**: When items are explicitly classified as deferred/backlog during any workflow, they should be automatically logged to GitHub issues without requiring a separate flag or manual step. The user is notified of what was created.\n\n## When to Use This Module\n\nInclude this module in any workflow that:\n- Classifies items as \"deferred\", \"backlog\", \"out-of-scope\", or \"suggestion\"\n- Identifies work that should be tracked but not addressed immediately\n- Produces improvement recommendations with priority levels\n\n## Integration Pattern\n\n### Step 1: Collect Deferred Items\n\nDuring workflow execution, collect deferred items in a structured format:\n\n```bash\n# Data structure for deferred items\nDEFERRED_ITEMS=()\n\n# Add items as they're identified\nDEFERRED_ITEMS+=(\"type:suggestion|title:Improve error messages|source:PR #123|file:auth.py:45|description:Error messages could be more descriptive|labels:enhancement,plugin:sanctum\")\nDEFERRED_ITEMS+=(\"type:backlog|title:Add rate limiting|source:PR #123|file:routes.py|description:Consider adding rate limiting to API|labels:enhancement,low-priority\")\n```\n\n### Step 2: Invoke Auto-Creation\n\nAt the end of the workflow (after all analysis is complete), invoke the auto-creation routine:\n\n```markdown\n## Auto-Create GitHub Issues\n\nFor each deferred item collected during this workflow:\n\n1. **Check for duplicates** before creating\n2. **Create the issue** with proper labels and context\n3. **Report what was created** to the user\n```\n\n### Step 3: Duplicate Detection\n\nBefore creating any issue, check if a similar issue already exists:\n\n```bash\n# Search for existing issues with similar title\nSEARCH_QUERY=\"$ITEM_TITLE in:title is:issue is:open\"\nEXISTING=$(gh issue list --search \"$SEARCH_QUERY\" --json number,title --jq '.[0].number // empty')\n\nif [[ -n \"$EXISTING\" ]]; then\n  echo \"Skipping duplicate: Issue #$EXISTING already tracks '$ITEM_TITLE'\"\n  SKIPPED_ITEMS+=(\"$ITEM_TITLE (duplicate of #$EXISTING)\")\nelse\n  # Proceed with creation\nfi\n```\n\n### Step 4: Issue Creation Template\n\n```bash\ncreate_deferred_issue() {\n  local TYPE=\"$1\"      # suggestion, backlog, deferred\n  local TITLE=\"$2\"     # Issue title\n  local SOURCE=\"$3\"    # Where it came from (PR #X, /update-plugins, etc.)\n  local FILE=\"$4\"      # file:line reference (optional)\n  local DESC=\"$5\"      # Description\n  local LABELS=\"$6\"    # Comma-separated labels\n\n  # Determine prefix based on type\n  case \"$TYPE\" in\n    suggestion) PREFIX=\"[Suggestion]\" ;;\n    backlog) PREFIX=\"[Backlog]\" ;;\n    deferred|out-of-scope) PREFIX=\"[Deferred]\" ;;\n    improvement) PREFIX=\"[Improvement]\" ;;\n    *) PREFIX=\"\" ;;\n  esac\n\n  # Create issue body\n  BODY=\"## Context\n\nIdentified during $SOURCE as $TYPE item.\n\n$(if [[ -n \"$FILE\" ]]; then echo \"**Location:** \\`$FILE\\`\"; fi)\n\n## Description\n\n$DESC\n\n## Value\n\nThis improvement would enhance the codebase by addressing an identified opportunity.\n\n## Acceptance Criteria\n\n- [ ] Implementation complete\n- [ ] Tests added/updated (if applicable)\n- [ ] Documentation updated (if applicable)\n\n---\n*Auto-created by workflow execution*\"\n\n  # Create the issue\n  ISSUE_URL=$(gh issue create \\\n    --title \"$PREFIX $TITLE\" \\\n    --body \"$BODY\" \\\n    --label \"$LABELS\" 2>&1)\n\n  if [[ $? -eq 0 ]]; then\n    echo \"$ISSUE_URL\"\n  else\n    echo \"ERROR: $ISSUE_URL\"\n    return 1\n  fi\n}\n```\n\n### Step 5: Report Created Issues\n\nAfter all issues are created, report to the user:\n\n```markdown\n### Issues Created (Automatic)\n\n| Type | Title | Issue | Labels |\n|------|-------|-------|--------|\n| Suggestion | Improve error messages | [#115](url) | enhancement, plugin:sanctum |\n| Backlog | Add rate limiting | [#116](url) | enhancement, low-priority |\n\n**Skipped (duplicates):**\n- \"Fix validation\" (duplicate of #42)\n```\n\n## Workflow-Specific Integration\n\n### For `/pr-review`\n\nAdd to Phase 3 (after triage):\n\n```markdown\n### Auto-Create Issues for Out-of-Scope Items\n\nItems classified as \"Suggestion\" or \"Out-of-Scope\" during triage are automatically logged:\n\n1. For each suggestion/out-of-scope item:\n   - Check for duplicate issues\n   - Create issue with `[Suggestion]` or `[Deferred]` prefix\n   - Add labels: `enhancement`, plugin label, priority label\n   - Reference the source PR\n\n2. Report created issues in the review summary\n```\n\n### For `/fix-pr`\n\nAdd to Step 6.1/6.2 (issue creation is already defined - make it automatic):\n\n```markdown\n### Automatic Issue Creation\n\n**CHANGE: Issue creation for suggestions and deferred items is now AUTOMATIC.**\n\nWhen items are classified as \"Suggestion\" or \"Deferred\" during triage (Step 2):\n- Issues are created automatically at the end of Step 6\n- No `--create-backlog-issues` flag required\n- User is notified of all created issues in the summary\n\n**Skip automatic creation with:** `--no-auto-issues` flag\n```\n\n### For `/update-plugins`\n\nAdd to Step 5 (after recommendations):\n\n```markdown\n### Auto-Create Issues for Improvement Recommendations\n\nItems in \"Critical\" and \"Moderate\" categories are automatically logged:\n\n1. For each improvement recommendation:\n   - Check for duplicate issues\n   - Create issue with `[Improvement]` prefix\n   - Add labels based on component type and priority\n   - Reference the plugin being analyzed\n\n2. \"Low Priority\" items are reported but not auto-created (stay in backlog docs)\n```\n\n### For `/fix-workflow`\n\nAdd to Phase 2 (outcome feedback):\n\n```markdown\n### Auto-Create Issues for Identified Improvements\n\nWhen retrospective analysis identifies workflow improvements:\n- Improvements that can't be implemented immediately → auto-create issue\n- Pattern: \"[Workflow] <improvement description>\"\n- Labels: `refactor`, `workflow`, priority based on complexity score\n```\n\n## Label Strategy\n\n| Item Type | Default Labels |\n|-----------|---------------|\n| Suggestion | `enhancement`, `low-priority`, `small-effort` |\n| Backlog | `enhancement`, `low-priority` |\n| Deferred | `enhancement`, `medium-priority` |\n| Improvement (Critical) | `enhancement`, `high-priority` |\n| Improvement (Moderate) | `enhancement`, `medium-priority` |\n| Workflow | `refactor`, `workflow` |\n\nAlways add plugin-specific labels when applicable: `plugin:sanctum`, `plugin:imbue`, etc.\n\n## Error Handling\n\n```bash\n# If issue creation fails\nif ! ISSUE_URL=$(create_deferred_issue ...); then\n  echo \"Warning: Failed to create issue for '$TITLE'\"\n  echo \"Error: $ISSUE_URL\"\n  FAILED_ITEMS+=(\"$TITLE\")\nfi\n```\n\nAt end of workflow:\n\n```markdown\n### Issue Creation Summary\n\n**Created:** 3 issues\n**Skipped (duplicates):** 1\n**Failed:** 0\n\nIf any failed, manually create using:\n\\`\\`\\`bash\ngh issue create --title \"[Type] Title\" --body \"...\" --label \"labels\"\n\\`\\`\\`\n```\n\n## Opting Out\n\nTo disable automatic issue creation for a specific workflow run:\n\n```bash\n# Flag to disable\n--no-auto-issues\n\n# Or environment variable\nSKIP_AUTO_ISSUES=true /pr-review 123\n```\n\nWhen disabled, deferred items are still reported but not created as issues:\n\n```markdown\n### Deferred Items (not auto-created)\n\nThe following items were identified but not logged to GitHub:\n- Suggestion: Improve error messages (auth.py:45)\n- Backlog: Add rate limiting (routes.py)\n\nTo create issues manually: `/create-issue \"Title\" --labels \"enhancement\"`\n```\n\nFile v1.9.14:skill-card.md\n\n## Description: <br>\nEvaluates and improves skills, agents, commands, and hooks after a workflow slice. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill after a command or short session slice feels slow, confusing, repetitive, or fragile to analyze the workflow assets involved and propose bounded improvements. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The workflow may expose repository context through GitHub issue creation or external discussion posting. <br>\nMitigation: Use only in repositories where this disclosure is acceptable, and require review and approval of any content before posting outside the current workspace. <br>\nRisk: The workflow can change project state by creating issues, committing changes, or running gh commands. <br>\nMitigation: Require the agent to show proposed commands and content before execution, especially in private or sensitive repositories. <br>\n\n\n## Reference(s): <br>\n- [ClawHub release page](https://clawhub.ai/athola/skills/nm-sanctum-workflow-improvement) <br>\n- [Night Market sanctum homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n- [Automatic Issue Creation module](modules/auto-issue-creation.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [analysis, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with inline shell commands and structured checklists] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May propose file changes, validation commands, GitHub issue creation, commits, and external discussion posts for user review.] <br>\n\n## Skill Version(s): <br>\n1.9.14 (source: ClawHub release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.13: 4 files, 8912 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), skill-card.md (2470b), SKILL.md (9653b), _meta.json (151b)\n\nFile v1.9.13:SKILL.md\n\n---\nname: workflow-improvement\ndescription: |\n  Evaluates and improves skills, agents, commands, and hooks after a workflow slice\nversion: 1.9.8\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\n  - execution felt slow\n  - confusing\n  - repetitive\n  - or fragile\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\"\n```\n\n## Step 1: Capture the Session Slice (`slice-captured`)\n\nIdentify the **most recent command or session slice** in the current context window and capture:\n- **Trigger**: What command / request started it (include the literal `/command` if present)\n- **Goal**: What \"done\" meant for the user\n- **Artifacts touched**: Skills, agents, commands, hooks (names + file paths)\n- **Evidence**: Key tool calls / errors / retries that indicate inefficiency\n- **Context from Step 0**: Reference any relevant patterns from improvement context\n\nIf the slice is ambiguous, pick the most recent *complete* attempt and state the exact boundary you chose.\n\n## Step 2: Recreate the Workflow (`workflow-recreated`)\n\nReconstruct the workflow as a numbered list of 5 to 20 steps, identifying inputs, branch points for decisions, and outputs such as file changes or state modifications. During this reconstruction, identify specific friction points that reduce efficiency. These often include repeated steps or redundant tool calls, as well as missing guardrails where validation occurs too late or prerequisites are unclear. Other common issues are a lack of automation for tasks that should be scripted, and discoverability gaps caused by confusing naming conventions.\n\n**Cross-reference with Step 0 context:**\n- Are friction points matching known failure patterns?\n- Do repeated steps align with git history themes?\n- Are missing guardrails mentioned in review-chamber lessons?\n\n## Step 3: Generate Improvements (`improvements-generated`)\n\nGenerate 3 to 5 distinct improvement approaches and score each on impact, complexity, reversibility, and consistency with existing sanctum patterns. The scoring should specifically address whether the change prevents the recurrence of patterns identified in Step 0. Prioritize improvements that address components with a high stability gap (greater than 0.3) or recurring issues found in the git history. You should also incorporate lessons from the review-chamber and aim to reduce failure modes identified in the skill logs. Prefer small, high-use changes such as tightening a skill's exit criteria, adding missing command options, improving hook guardrails for better observability, or splitting overloaded commands into clearer phases.\n\n## Step 4: Agree on a Plan (`plan-agreed`)\n\nChoose 1 approach and define:\n- Acceptance criteria (\"substantive difference\")\n- Files to change\n- Validation commands to run\n- Out-of-scope items to defer\n\nKeep the plan bounded: aim for ≤ 5 files changed unless the workflow truly spans more.\n\n## Step 5: Implement (`changes-implemented`)\n\nApply changes following sanctum conventions:\n- Keep naming consistent across `commands/`, `agents/`, `skills/`, `hooks/`\n- Prefer documentation-first improvements if ambiguity was the primary issue\n- If behavior changes, add/adjust tests in `plugins/sanctum/tests/`\n\n## Step 6: Validate Substantive Improvement (`validated`)\n\nValidation should include at least 2 of:\n- Plugin validators / unit tests passing (targeted)\n- Re-running the minimal workflow reproduction with fewer steps or less manual work\n- A clear reduction in failure modes (e.g., earlier validation, clearer options)\n\nRecord the before/after comparison as *metrics*, not prose:\n- Step count reduction\n- Tool call reduction\n- Errors avoided (what would have failed before)\n- Duration improvement (if measurable)\n\n### Metrics Comparison Template\n\n```markdown\n## Validation Results\n\n### Before Improvement\n- Step count: 15\n- Tool calls: 23\n- Failure points: 3\n- Duration: ~8 minutes\n- Manual interventions: 5\n\n### After Improvement\n- Step count: 11 (-4, -27%)\n- Tool calls: 17 (-6, -26%)\n- Failure points: 0 (-3, -100%)\n- Duration: ~5 minutes (-37%)\n- Manual interventions: 2 (-3, -60%)\n\n### Verification\n[E1] Command: `python3 plugins/sanctum/scripts/test_workflow.py`\nOutput: All tests passed (0.5s)\n\n[E2] Command: `/validate-plugin sanctum`\nOutput: No issues found\n```\n\n## Step 7: Close the Loop (Store Lessons)\n\nAfter validation, capture the improvement for future reference:\n\n### 7.1: Update Git History\n\nCommit with descriptive message that future searches will find:\n\n```bash\ngit add <changed-files>\ngit commit -m \"improve(sanctum): <component> - <specific fix>\n\nAddresses recurring issue: <pattern from Step 0>\nReduces <metric> by <percentage>\n\nEvidence: stability_gap reduced from 0.35 to 0.12\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>\"\n```\n\n### 7.2: Post Tooling Learnings to Discussions (Preferred)\n\nObservations about night-market tooling (skill behavior, agent\ncoordination, hook timing, command UX) belong in\nhttps://github.com/athola/claude-night-market/discussions,\nnot local memory. Always target the night-market repo\nregardless of which repo you are currently working in.\n\n```bash\n# Post to night-market Learnings category\n# See fix-pr Step 6.7 for the full GraphQL pattern\n# targeting athola/claude-night-market explicitly\n```\n\n> Repo-specific learnings stay in the current repo. Tooling\n> learnings always go to\n> https://github.com/athola/claude-night-market/discussions\n> so the framework can improve.\n\n### 7.3: Capture Lesson in Memory Palace (Optional, Local Only)\n\nIf the improvement addresses a repo-specific pattern (not\ntooling), store it locally:\n\n```bash\n# Store in review-chamber lessons\n/review-room capture --room lessons --title \"Workflow: <pattern name>\"\n```\n\n### 7.4: Update Improvement Metrics\n\nTrack the improvement's impact:\n\n```bash\n# Check post-improvement stability\npensive:skill-review --skill sanctum:<component> --recommendations\n```\n\nThis creates a feedback loop where future `/fix-workflow` and `/update-plugins` runs will reference this lesson.\n\n## Supporting Modules\n\n- [Auto issue creation](modules/auto-issue-creation.md) - patterns for automatically creating GitHub issues from deferred items\n\n## Troubleshooting\n\n### Common Issues\n\nIf a command is not found, confirm that all dependencies are installed and accessible in your PATH. For permission errors, check file system permissions and run the command with appropriate privileges. If you encounter unexpected behavior, enable verbose logging using the `--verbose` flag to capture more detailed execution data.\n\nFile v1.9.13:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-workflow-improvement\",\n  \"version\": \"1.9.13\",\n  \"publishedAt\": 1782577431339\n}\n\nFile v1.9.13:modules/auto-issue-creation.md\n\n# Automatic Issue Creation for Deferred Items\n\nReusable patterns for automatically creating GitHub issues when items are classified as deferred, backlog, out-of-scope, or suggestions during workflow execution.\n\n## Philosophy\n\n**Automatic by Default**: When items are explicitly classified as deferred/backlog during any workflow, they should be automatically logged to GitHub issues without requiring a separate flag or manual step. The user is notified of what was created.\n\n## When to Use This Module\n\nInclude this module in any workflow that:\n- Classifies items as \"deferred\", \"backlog\", \"out-of-scope\", or \"suggestion\"\n- Identifies work that should be tracked but not addressed immediately\n- Produces improvement recommendations with priority levels\n\n## Integration Pattern\n\n### Step 1: Collect Deferred Items\n\nDuring workflow execution, collect deferred items in a structured format:\n\n```bash\n# Data structure for deferred items\nDEFERRED_ITEMS=()\n\n# Add items as they're identified\nDEFERRED_ITEMS+=(\"type:suggestion|title:Improve error messages|source:PR #123|file:auth.py:45|description:Error messages could be more descriptive|labels:enhancement,plugin:sanctum\")\nDEFERRED_ITEMS+=(\"type:backlog|title:Add rate limiting|source:PR #123|file:routes.py|description:Consider adding rate limiting to API|labels:enhancement,low-priority\")\n```\n\n### Step 2: Invoke Auto-Creation\n\nAt the end of the workflow (after all analysis is complete), invoke the auto-creation routine:\n\n```markdown\n## Auto-Create GitHub Issues\n\nFor each deferred item collected during this workflow:\n\n1. **Check for duplicates** before creating\n2. **Create the issue** with proper labels and context\n3. **Report what was created** to the user\n```\n\n### Step 3: Duplicate Detection\n\nBefore creating any issue, check if a similar issue already exists:\n\n```bash\n# Search for existing issues with similar title\nSEARCH_QUERY=\"$ITEM_TITLE in:title is:issue is:open\"\nEXISTING=$(gh issue list --search \"$SEARCH_QUERY\" --json number,title --jq '.[0].number // empty')\n\nif [[ -n \"$EXISTING\" ]]; then\n  echo \"Skipping duplicate: Issue #$EXISTING already tracks '$ITEM_TITLE'\"\n  SKIPPED_ITEMS+=(\"$ITEM_TITLE (duplicate of #$EXISTING)\")\nelse\n  # Proceed with creation\nfi\n```\n\n### Step 4: Issue Creation Template\n\n```bash\ncreate_deferred_issue() {\n  local TYPE=\"$1\"      # suggestion, backlog, deferred\n  local TITLE=\"$2\"     # Issue title\n  local SOURCE=\"$3\"    # Where it came from (PR #X, /update-plugins, etc.)\n  local FILE=\"$4\"      # file:line reference (optional)\n  local DESC=\"$5\"      # Description\n  local LABELS=\"$6\"    # Comma-separated labels\n\n  # Determine prefix based on type\n  case \"$TYPE\" in\n    suggestion) PREFIX=\"[Suggestion]\" ;;\n    backlog) PREFIX=\"[Backlog]\" ;;\n    deferred|out-of-scope) PREFIX=\"[Deferred]\" ;;\n    improvement) PREFIX=\"[Improvement]\" ;;\n    *) PREFIX=\"\" ;;\n  esac\n\n  # Create issue body\n  BODY=\"## Context\n\nIdentified during $SOURCE as $TYPE item.\n\n$(if [[ -n \"$FILE\" ]]; then echo \"**Location:** \\`$FILE\\`\"; fi)\n\n## Description\n\n$DESC\n\n## Value\n\nThis improvement would enhance the codebase by addressing an identified opportunity.\n\n## Acceptance Criteria\n\n- [ ] Implementation complete\n- [ ] Tests added/updated (if applicable)\n- [ ] Documentation updated (if applicable)\n\n---\n*Auto-created by workflow execution*\"\n\n  # Create the issue\n  ISSUE_URL=$(gh issue create \\\n    --title \"$PREFIX $TITLE\" \\\n    --body \"$BODY\" \\\n    --label \"$LABELS\" 2>&1)\n\n  if [[ $? -eq 0 ]]; then\n    echo \"$ISSUE_URL\"\n  else\n    echo \"ERROR: $ISSUE_URL\"\n    return 1\n  fi\n}\n```\n\n### Step 5: Report Created Issues\n\nAfter all issues are created, report to the user:\n\n```markdown\n### Issues Created (Automatic)\n\n| Type | Title | Issue | Labels |\n|------|-------|-------|--------|\n| Suggestion | Improve error messages | [#115](url) | enhancement, plugin:sanctum |\n| Backlog | Add rate limiting | [#116](url) | enhancement, low-priority |\n\n**Skipped (duplicates):**\n- \"Fix validation\" (duplicate of #42)\n```\n\n## Workflow-Specific Integration\n\n### For `/pr-review`\n\nAdd to Phase 3 (after triage):\n\n```markdown\n### Auto-Create Issues for Out-of-Scope Items\n\nItems classified as \"Suggestion\" or \"Out-of-Scope\" during triage are automatically logged:\n\n1. For each suggestion/out-of-scope item:\n   - Check for duplicate issues\n   - Create issue with `[Suggestion]` or `[Deferred]` prefix\n   - Add labels: `enhancement`, plugin label, priority label\n   - Reference the source PR\n\n2. Report created issues in the review summary\n```\n\n### For `/fix-pr`\n\nAdd to Step 6.1/6.2 (issue creation is already defined - make it automatic):\n\n```markdown\n### Automatic Issue Creation\n\n**CHANGE: Issue creation for suggestions and deferred items is now AUTOMATIC.**\n\nWhen items are classified as \"Suggestion\" or \"Deferred\" during triage (Step 2):\n- Issues are created automatically at the end of Step 6\n- No `--create-backlog-issues` flag required\n- User is notified of all created issues in the summary\n\n**Skip automatic creation with:** `--no-auto-issues` flag\n```\n\n### For `/update-plugins`\n\nAdd to Step 5 (after recommendations):\n\n```markdown\n### Auto-Create Issues for Improvement Recommendations\n\nItems in \"Critical\" and \"Moderate\" categories are automatically logged:\n\n1. For each improvement recommendation:\n   - Check for duplicate issues\n   - Create issue with `[Improvement]` prefix\n   - Add labels based on component type and priority\n   - Reference the plugin being analyzed\n\n2. \"Low Priority\" items are reported but not auto-created (stay in backlog docs)\n```\n\n### For `/fix-workflow`\n\nAdd to Phase 2 (outcome feedback):\n\n```markdown\n### Auto-Create Issues for Identified Improvements\n\nWhen retrospective analysis identifies workflow improvements:\n- Improvements that can't be implemented immediately → auto-create issue\n- Pattern: \"[Workflow] <improvement description>\"\n- Labels: `refactor`, `workflow`, priority based on complexity score\n```\n\n## Label Strategy\n\n| Item Type | Default Labels |\n|-----------|---------------|\n| Suggestion | `enhancement`, `low-priority`, `small-effort` |\n| Backlog | `enhancement`, `low-priority` |\n| Deferred | `enhancement`, `medium-priority` |\n| Improvement (Critical) | `enhancement`, `high-priority` |\n| Improvement (Moderate) | `enhancement`, `medium-priority` |\n| Workflow | `refactor`, `workflow` |\n\nAlways add plugin-specific labels when applicable: `plugin:sanctum`, `plugin:imbue`, etc.\n\n## Error Handling\n\n```bash\n# If issue creation fails\nif ! ISSUE_URL=$(create_deferred_issue ...); then\n  echo \"Warning: Failed to create issue for '$TITLE'\"\n  echo \"Error: $ISSUE_URL\"\n  FAILED_ITEMS+=(\"$TITLE\")\nfi\n```\n\nAt end of workflow:\n\n```markdown\n### Issue Creation Summary\n\n**Created:** 3 issues\n**Skipped (duplicates):** 1\n**Failed:** 0\n\nIf any failed, manually create using:\n\\`\\`\\`bash\ngh issue create --title \"[Type] Title\" --body \"...\" --label \"labels\"\n\\`\\`\\`\n```\n\n## Opting Out\n\nTo disable automatic issue creation for a specific workflow run:\n\n```bash\n# Flag to disable\n--no-auto-issues\n\n# Or environment variable\nSKIP_AUTO_ISSUES=true /pr-review 123\n```\n\nWhen disabled, deferred items are still reported but not created as issues:\n\n```markdown\n### Deferred Items (not auto-created)\n\nThe following items were identified but not logged to GitHub:\n- Suggestion: Improve error messages (auth.py:45)\n- Backlog: Add rate limiting (routes.py)\n\nTo create issues manually: `/create-issue \"Title\" --labels \"enhancement\"`\n```\n\nFile v1.9.13:skill-card.md\n\n## Description: <br>\nEvaluates and improves skills, agents, commands, and hooks after a workflow slice. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineering teams use this skill after a workflow slice to identify friction in skills, agents, commands, and hooks, agree on bounded improvements, implement them, and validate the before-and-after effect. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Workflow details may be published externally through GitHub issues or Discussions. <br>\nMitigation: Review and redact session context before any external posting, and require explicit confirmation before creating issues or Discussion posts. <br>\nRisk: Automatic issue creation can expose deferred items, repository details, or sensitive workflow context. <br>\nMitigation: Use duplicate checks, restrict labels and issue bodies to necessary context, and give users a clear opt-out or approval step before publication. <br>\nRisk: Workflow recommendations may change skills, agents, commands, or hooks in ways that degrade future agent behavior. <br>\nMitigation: Keep changes bounded, review proposed edits before deployment, and validate with before-and-after metrics and targeted tests. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-workflow-improvement) <br>\n- [Project homepage from ClawHub metadata](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n- [Auto issue creation module](modules/auto-issue-creation.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with inline shell commands and structured checklists] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include workflow improvement plans, validation metrics, issue creation guidance, and file-change recommendations.] <br>\n\n## Skill Version(s): <br>\n1.9.13 (source: ClawHub release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.12: 4 files, 8785 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), skill-card.md (2053b), SKILL.md (9653b), _meta.json (151b)\n\nFile v1.9.12:SKILL.md\n\n---\nname: workflow-improvement\ndescription: |\n  Evaluates and improves skills, agents, commands, and hooks after a workflow slice\nversion: 1.9.8\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\n  - execution felt slow\n  - confusing\n  - repetitive\n  - or fragile\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\"\n```\n\n## Step 1: Capture the Session Slice (`slice-captured`)\n\nIdentify the **most recent command or session slice** in the current context window and capture:\n- **Trigger**: What command / request started it (include the literal `/command` if present)\n- **Goal**: What \"done\" meant for the user\n- **Artifacts touched**: Skills, agents, commands, hooks (names + file paths)\n- **Evidence**: Key tool calls / errors / retries that indicate inefficiency\n- **Context from Step 0**: Reference any relevant patterns from improvement context\n\nIf the slice is ambiguous, pick the most recent *complete* attempt and state the exact boundary you chose.\n\n## Step 2: Recreate the Workflow (`workflow-recreated`)\n\nReconstruct the workflow as a numbered list of 5 to 20 steps, identifying inputs, branch points for decisions, and outputs such as file changes or state modifications. During this reconstruction, identify specific friction points that reduce efficiency. These often include repeated steps or redundant tool calls, as well as missing guardrails where validation occurs too late or prerequisites are unclear. Other common issues are a lack of automation for tasks that should be scripted, and discoverability gaps caused by confusing naming conventions.\n\n**Cross-reference with Step 0 context:**\n- Are friction points matching known failure patterns?\n- Do repeated steps align with git history themes?\n- Are missing guardrails mentioned in review-chamber lessons?\n\n## Step 3: Generate Improvements (`improvements-generated`)\n\nGenerate 3 to 5 distinct improvement approaches and score each on impact, complexity, reversibility, and consistency with existing sanctum patterns. The scoring should specifically address whether the change prevents the recurrence of patterns identified in Step 0. Prioritize improvements that address components with a high stability gap (greater than 0.3) or recurring issues found in the git history. You should also incorporate lessons from the review-chamber and aim to reduce failure modes identified in the skill logs. Prefer small, high-use changes such as tightening a skill's exit criteria, adding missing command options, improving hook guardrails for better observability, or splitting overloaded commands into clearer phases.\n\n## Step 4: Agree on a Plan (`plan-agreed`)\n\nChoose 1 approach and define:\n- Acceptance criteria (\"substantive difference\")\n- Files to change\n- Validation commands to run\n- Out-of-scope items to defer\n\nKeep the plan bounded: aim for ≤ 5 files changed unless the workflow truly spans more.\n\n## Step 5: Implement (`changes-implemented`)\n\nApply changes following sanctum conventions:\n- Keep naming consistent across `commands/`, `agents/`, `skills/`, `hooks/`\n- Prefer documentation-first improvements if ambiguity was the primary issue\n- If behavior changes, add/adjust tests in `plugins/sanctum/tests/`\n\n## Step 6: Validate Substantive Improvement (`validated`)\n\nValidation should include at least 2 of:\n- Plugin validators / unit tests passing (targeted)\n- Re-running the minimal workflow reproduction with fewer steps or less manual work\n- A clear reduction in failure modes (e.g., earlier validation, clearer options)\n\nRecord the before/after comparison as *metrics*, not prose:\n- Step count reduction\n- Tool call reduction\n- Errors avoided (what would have failed before)\n- Duration improvement (if measurable)\n\n### Metrics Comparison Template\n\n```markdown\n## Validation Results\n\n### Before Improvement\n- Step count: 15\n- Tool calls: 23\n- Failure points: 3\n- Duration: ~8 minutes\n- Manual interventions: 5\n\n### After Improvement\n- Step count: 11 (-4, -27%)\n- Tool calls: 17 (-6, -26%)\n- Failure points: 0 (-3, -100%)\n- Duration: ~5 minutes (-37%)\n- Manual interventions: 2 (-3, -60%)\n\n### Verification\n[E1] Command: `python3 plugins/sanctum/scripts/test_workflow.py`\nOutput: All tests passed (0.5s)\n\n[E2] Command: `/validate-plugin sanctum`\nOutput: No issues found\n```\n\n## Step 7: Close the Loop (Store Lessons)\n\nAfter validation, capture the improvement for future reference:\n\n### 7.1: Update Git History\n\nCommit with descriptive message that future searches will find:\n\n```bash\ngit add <changed-files>\ngit commit -m \"improve(sanctum): <component> - <specific fix>\n\nAddresses recurring issue: <pattern from Step 0>\nReduces <metric> by <percentage>\n\nEvidence: stability_gap reduced from 0.35 to 0.12\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>\"\n```\n\n### 7.2: Post Tooling Learnings to Discussions (Preferred)\n\nObservations about night-market tooling (skill behavior, agent\ncoordination, hook timing, command UX) belong in\nhttps://github.com/athola/claude-night-market/discussions,\nnot local memory. Always target the night-market repo\nregardless of which repo you are currently working in.\n\n```bash\n# Post to night-market Learnings category\n# See fix-pr Step 6.7 for the full GraphQL pattern\n# targeting athola/claude-night-market explicitly\n```\n\n> Repo-specific learnings stay in the current repo. Tooling\n> learnings always go to\n> https://github.com/athola/claude-night-market/discussions\n> so the framework can improve.\n\n### 7.3: Capture Lesson in Memory Palace (Optional, Local Only)\n\nIf the improvement addresses a repo-specific pattern (not\ntooling), store it locally:\n\n```bash\n# Store in review-chamber lessons\n/review-room capture --room lessons --title \"Workflow: <pattern name>\"\n```\n\n### 7.4: Update Improvement Metrics\n\nTrack the improvement's impact:\n\n```bash\n# Check post-improvement stability\npensive:skill-review --skill sanctum:<component> --recommendations\n```\n\nThis creates a feedback loop where future `/fix-workflow` and `/update-plugins` runs will reference this lesson.\n\n## Supporting Modules\n\n- [Auto issue creation](modules/auto-issue-creation.md) - patterns for automatically creating GitHub issues from deferred items\n\n## Troubleshooting\n\n### Common Issues\n\nIf a command is not found, confirm that all dependencies are installed and accessible in your PATH. For permission errors, check file system permissions and run the command with appropriate privileges. If you encounter unexpected behavior, enable verbose logging using the `--verbose` flag to capture more detailed execution data.\n\nFile v1.9.12:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-workflow-improvement\",\n  \"version\": \"1.9.12\",\n  \"publishedAt\": 1781839166527\n}\n\nFile v1.9.12:modules/auto-issue-creation.md\n\n# Automatic Issue Creation for Deferred Items\n\nReusable patterns for automatically creating GitHub issues when items are classified as deferred, backlog, out-of-scope, or suggestions during workflow execution.\n\n## Philosophy\n\n**Automatic by Default**: When items are explicitly classified as deferred/backlog during any workflow, they should be automatically logged to GitHub issues without requiring a separate flag or manual step. The user is notified of what was created.\n\n## When to Use This Module\n\nInclude this module in any workflow that:\n- Classifies items as \"deferred\", \"backlog\", \"out-of-scope\", or \"suggestion\"\n- Identifies work that should be tracked but not addressed immediately\n- Produces improvement recommendations with priority levels\n\n## Integration Pattern\n\n### Step 1: Collect Deferred Items\n\nDuring workflow execution, collect deferred items in a structured format:\n\n```bash\n# Data structure for deferred items\nDEFERRED_ITEMS=()\n\n# Add items as they're identified\nDEFERRED_ITEMS+=(\"type:suggestion|title:Improve error messages|source:PR #123|file:auth.py:45|description:Error messages could be more descriptive|labels:enhancement,plugin:sanctum\")\nDEFERRED_ITEMS+=(\"type:backlog|title:Add rate limiting|source:PR #123|file:routes.py|description:Consider adding rate limiting to API|labels:enhancement,low-priority\")\n```\n\n### Step 2: Invoke Auto-Creation\n\nAt the end of the workflow (after all analysis is complete), invoke the auto-creation routine:\n\n```markdown\n## Auto-Create GitHub Issues\n\nFor each deferred item collected during this workflow:\n\n1. **Check for duplicates** before creating\n2. **Create the issue** with proper labels and context\n3. **Report what was created** to the user\n```\n\n### Step 3: Duplicate Detection\n\nBefore creating any issue, check if a similar issue already exists:\n\n```bash\n# Search for existing issues with similar title\nSEARCH_QUERY=\"$ITEM_TITLE in:title is:issue is:open\"\nEXISTING=$(gh issue list --search \"$SEARCH_QUERY\" --json number,title --jq '.[0].number // empty')\n\nif [[ -n \"$EXISTING\" ]]; then\n  echo \"Skipping duplicate: Issue #$EXISTING already tracks '$ITEM_TITLE'\"\n  SKIPPED_ITEMS+=(\"$ITEM_TITLE (duplicate of #$EXISTING)\")\nelse\n  # Proceed with creation\nfi\n```\n\n### Step 4: Issue Creation Template\n\n```bash\ncreate_deferred_issue() {\n  local TYPE=\"$1\"      # suggestion, backlog, deferred\n  local TITLE=\"$2\"     # Issue title\n  local SOURCE=\"$3\"    # Where it came from (PR #X, /update-plugins, etc.)\n  local FILE=\"$4\"      # file:line reference (optional)\n  local DESC=\"$5\"      # Description\n  local LABELS=\"$6\"    # Comma-separated labels\n\n  # Determine prefix based on type\n  case \"$TYPE\" in\n    suggestion) PREFIX=\"[Suggestion]\" ;;\n    backlog) PREFIX=\"[Backlog]\" ;;\n    deferred|out-of-scope) PREFIX=\"[Deferred]\" ;;\n    improvement) PREFIX=\"[Improvement]\" ;;\n    *) PREFIX=\"\" ;;\n  esac\n\n  # Create issue body\n  BODY=\"## Context\n\nIdentified during $SOURCE as $TYPE item.\n\n$(if [[ -n \"$FILE\" ]]; then echo \"**Location:** \\`$FILE\\`\"; fi)\n\n## Description\n\n$DESC\n\n## Value\n\nThis improvement would enhance the codebase by addressing an identified opportunity.\n\n## Acceptance Criteria\n\n- [ ] Implementation complete\n- [ ] Tests added/updated (if applicable)\n- [ ] Documentation updated (if applicable)\n\n---\n*Auto-created by workflow execution*\"\n\n  # Create the issue\n  ISSUE_URL=$(gh issue create \\\n    --title \"$PREFIX $TITLE\" \\\n    --body \"$BODY\" \\\n    --label \"$LABELS\" 2>&1)\n\n  if [[ $? -eq 0 ]]; then\n    echo \"$ISSUE_URL\"\n  else\n    echo \"ERROR: $ISSUE_URL\"\n    return 1\n  fi\n}\n```\n\n### Step 5: Report Created Issues\n\nAfter all issues are created, report to the user:\n\n```markdown\n### Issues Created (Automatic)\n\n| Type | Title | Issue | Labels |\n|------|-------|-------|--------|\n| Suggestion | Improve error messages | [#115](url) | enhancement, plugin:sanctum |\n| Backlog | Add rate limiting | [#116](url) | enhancement, low-priority |\n\n**Skipped (duplicates):**\n- \"Fix validation\" (duplicate of #42)\n```\n\n## Workflow-Specific Integration\n\n### For `/pr-review`\n\nAdd to Phase 3 (after triage):\n\n```markdown\n### Auto-Create Issues for Out-of-Scope Items\n\nItems classified as \"Suggestion\" or \"Out-of-Scope\" during triage are automatically logged:\n\n1. For each suggestion/out-of-scope item:\n   - Check for duplicate issues\n   - Create issue with `[Suggestion]` or `[Deferred]` prefix\n   - Add labels: `enhancement`, plugin label, priority label\n   - Reference the source PR\n\n2. Report created issues in the review summary\n```\n\n### For `/fix-pr`\n\nAdd to Step 6.1/6.2 (issue creation is already defined - make it automatic):\n\n```markdown\n### Automatic Issue Creation\n\n**CHANGE: Issue creation for suggestions and deferred items is now AUTOMATIC.**\n\nWhen items are classified as \"Suggestion\" or \"Deferred\" during triage (Step 2):\n- Issues are created automatically at the end of Step 6\n- No `--create-backlog-issues` flag required\n- User is notified of all created issues in the summary\n\n**Skip automatic creation with:** `--no-auto-issues` flag\n```\n\n### For `/update-plugins`\n\nAdd to Step 5 (after recommendations):\n\n```markdown\n### Auto-Create Issues for Improvement Recommendations\n\nItems in \"Critical\" and \"Moderate\" categories are automatically logged:\n\n1. For each improvement recommendation:\n   - Check for duplicate issues\n   - Create issue with `[Improvement]` prefix\n   - Add labels based on component type and priority\n   - Reference the plugin being analyzed\n\n2. \"Low Priority\" items are reported but not auto-created (stay in backlog docs)\n```\n\n### For `/fix-workflow`\n\nAdd to Phase 2 (outcome feedback):\n\n```markdown\n### Auto-Create Issues for Identified Improvements\n\nWhen retrospective analysis identifies workflow improvements:\n- Improvements that can't be implemented immediately → auto-create issue\n- Pattern: \"[Workflow] <improvement description>\"\n- Labels: `refactor`, `workflow`, priority based on complexity score\n```\n\n## Label Strategy\n\n| Item Type | Default Labels |\n|-----------|---------------|\n| Suggestion | `enhancement`, `low-priority`, `small-effort` |\n| Backlog | `enhancement`, `low-priority` |\n| Deferred | `enhancement`, `medium-priority` |\n| Improvement (Critical) | `enhancement`, `high-priority` |\n| Improvement (Moderate) | `enhancement`, `medium-priority` |\n| Workflow | `refactor`, `workflow` |\n\nAlways add plugin-specific labels when applicable: `plugin:sanctum`, `plugin:imbue`, etc.\n\n## Error Handling\n\n```bash\n# If issue creation fails\nif ! ISSUE_URL=$(create_deferred_issue ...); then\n  echo \"Warning: Failed to create issue for '$TITLE'\"\n  echo \"Error: $ISSUE_URL\"\n  FAILED_ITEMS+=(\"$TITLE\")\nfi\n```\n\nAt end of workflow:\n\n```markdown\n### Issue Creation Summary\n\n**Created:** 3 issues\n**Skipped (duplicates):** 1\n**Failed:** 0\n\nIf any failed, manually create using:\n\\`\\`\\`bash\ngh issue create --title \"[Type] Title\" --body \"...\" --label \"labels\"\n\\`\\`\\`\n```\n\n## Opting Out\n\nTo disable automatic issue creation for a specific workflow run:\n\n```bash\n# Flag to disable\n--no-auto-issues\n\n# Or environment variable\nSKIP_AUTO_ISSUES=true /pr-review 123\n```\n\nWhen disabled, deferred items are still reported but not created as issues:\n\n```markdown\n### Deferred Items (not auto-created)\n\nThe following items were identified but not logged to GitHub:\n- Suggestion: Improve error messages (auth.py:45)\n- Backlog: Add rate limiting (routes.py)\n\nTo create issues manually: `/create-issue \"Title\" --labels \"enhancement\"`\n```\n\nFile v1.9.12:skill-card.md\n\n## Description: <br>\nEvaluates and improves skills, agents, commands, and hooks after a workflow slice. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineering teams use this skill after a short session or command execution to identify slow, confusing, repetitive, or fragile workflow assets and turn improvements into bounded changes. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can automatically create or direct GitHub issues in external repositories with workflow-derived details. <br>\nMitigation: Require an explicit preview and approval before anything is posted outside the current repository. <br>\nRisk: Workflow improvement changes can affect skills, agents, commands, hooks, and related tests. <br>\nMitigation: Keep the agreed plan bounded, review the proposed file list, and run targeted validation before adopting the changes. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/nm-sanctum-workflow-improvement) <br>\n- [Night Market Sanctum plugin](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [markdown, guidance, shell commands, configuration] <br>\n**Output Format:** [Markdown with checklists and command examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include prioritized findings, recommended follow-up tasks, and commands for the user to review before execution.] <br>\n\n## Skill Version(s): <br>\n1.9.12 (source: server release metadata; artifact frontmatter lists 1.9.8) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.2: 3 files, 7638 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), SKILL.md (9583b), _meta.json (150b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: workflow-improvement\ndescription: Retrospective evaluation and improvement of skills, agents, commands, and hooks\nversion: 1.9.5\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\"\n```\n\n## Step 1: Capture the Session Slice (`slice-captured`)\n\nIdentify the **most recent command or session slice** in the current context window and capture:\n- **Trigger**: What command / request started it (include the literal `/command` if present)\n- **Goal**: What \"done\" meant for the user\n- **Artifacts touched**: Skills, agents, commands, hooks (names + file paths)\n- **Evidence**: Key tool calls / errors / retries that indicate inefficiency\n- **Context from Step 0**: Reference any relevant patterns from improvement context\n\nIf the slice is ambiguous, pick the most recent *complete* attempt and state the exact boundary you chose.\n\n## Step 2: Recreate the Workflow (`workflow-recreated`)\n\nReconstruct the workflow as a numbered list of 5 to 20 steps, identifying inputs, branch points for decisions, and outputs such as file changes or state modifications. During this reconstruction, identify specific friction points that reduce efficiency. These often include repeated steps or redundant tool calls, as well as missing guardrails where validation occurs too late or prerequisites are unclear. Other common issues are a lack of automation for tasks that should be scripted, and discoverability gaps caused by confusing naming conventions.\n\n**Cross-reference with Step 0 context:**\n- Are friction points matching known failure patterns?\n- Do repeated steps align with git history themes?\n- Are missing guardrails mentioned in review-chamber lessons?\n\n## Step 3: Generate Improvements (`improvements-generated`)\n\nGenerate 3 to 5 distinct improvement approaches and score each on impact, complexity, reversibility, and consistency with existing sanctum patterns. The scoring should specifically address whether the change prevents the recurrence of patterns identified in Step 0. Prioritize improvements that address components with a high stability gap (greater than 0.3) or recurring issues found in the git history. You should also incorporate lessons from the review-chamber and aim to reduce failure modes identified in the skill logs. Prefer small, high-use changes such as tightening a skill's exit criteria, adding missing command options, improving hook guardrails for better observability, or splitting overloaded commands into clearer phases.\n\n## Step 4: Agree on a Plan (`plan-agreed`)\n\nChoose 1 approach and define:\n- Acceptance criteria (“substantive difference”)\n- Files to change\n- Validation commands to run\n- Out-of-scope items to defer\n\nKeep the plan bounded: aim for ≤ 5 files changed unless the workflow truly spans more.\n\n## Step 5: Implement (`changes-implemented`)\n\nApply changes following sanctum conventions:\n- Keep naming consistent across `commands/`, `agents/`, `skills/`, `hooks/`\n- Prefer documentation-first improvements if ambiguity was the primary issue\n- If behavior changes, add/adjust tests in `plugins/sanctum/tests/`\n\n## Step 6: Validate Substantive Improvement (`validated`)\n\nValidation should include at least 2 of:\n- Plugin validators / unit tests passing (targeted)\n- Re-running the minimal workflow reproduction with fewer steps or less manual work\n- A clear reduction in failure modes (e.g., earlier validation, clearer options)\n\nRecord the before/after comparison as *metrics*, not prose:\n- Step count reduction\n- Tool call reduction\n- Errors avoided (what would have failed before)\n- Duration improvement (if measurable)\n\n### Metrics Comparison Template\n\n```markdown\n## Validation Results\n\n### Before Improvement\n- Step count: 15\n- Tool calls: 23\n- Failure points: 3\n- Duration: ~8 minutes\n- Manual interventions: 5\n\n### After Improvement\n- Step count: 11 (-4, -27%)\n- Tool calls: 17 (-6, -26%)\n- Failure points: 0 (-3, -100%)\n- Duration: ~5 minutes (-37%)\n- Manual interventions: 2 (-3, -60%)\n\n### Verification\n[E1] Command: `python3 plugins/sanctum/scripts/test_workflow.py`\nOutput: All tests passed (0.5s)\n\n[E2] Command: `/validate-plugin sanctum`\nOutput: No issues found\n```\n\n## Step 7: Close the Loop (Store Lessons)\n\nAfter validation, capture the improvement for future reference:\n\n### 7.1: Update Git History\n\nCommit with descriptive message that future searches will find:\n\n```bash\ngit add <changed-files>\ngit commit -m \"improve(sanctum): <component> - <specific fix>\n\nAddresses recurring issue: <pattern from Step 0>\nReduces <metric> by <percentage>\n\nEvidence: stability_gap reduced from 0.35 to 0.12\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>\"\n```\n\n### 7.2: Post Tooling Learnings to Discussions (Preferred)\n\nObservations about night-market tooling (skill behavior, agent\ncoordination, hook timing, command UX) belong in\nhttps://github.com/athola/claude-night-market/discussions,\nnot local memory. Always target the night-market repo\nregardless of which repo you are currently working in.\n\n```bash\n# Post to night-market Learnings category\n# See fix-pr Step 6.7 for the full GraphQL pattern\n# targeting athola/claude-night-market explicitly\n```\n\n> Repo-specific learnings stay in the current repo. Tooling\n> learnings always go to\n> https://github.com/athola/claude-night-market/discussions\n> so the framework can improve.\n\n### 7.3: Capture Lesson in Memory Palace (Optional, Local Only)\n\nIf the improvement addresses a repo-specific pattern (not\ntooling), store it locally:\n\n```bash\n# Store in review-chamber lessons\n/review-room capture --room lessons --title \"Workflow: <pattern name>\"\n```\n\n### 7.4: Update Improvement Metrics\n\nTrack the improvement's impact:\n\n```bash\n# Check post-improvement stability\npensive:skill-review --skill sanctum:<component> --recommendations\n```\n\nThis creates a feedback loop where future `/fix-workflow` and `/update-plugins` runs will reference this lesson.\n\n## Supporting Modules\n\n- [Auto issue creation](modules/auto-issue-creation.md) - patterns for automatically creating GitHub issues from deferred items\n\n## Troubleshooting\n\n### Common Issues\n\nIf a command is not found, confirm that all dependencies are installed and accessible in your PATH. For permission errors, check file system permissions and run the command with appropriate privileges. If you encounter unexpected behavior, enable verbose logging using the `--verbose` flag to capture more detailed execution data.\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-workflow-improvement\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1778293215190\n}\n\nFile v1.0.2:modules/auto-issue-creation.md\n\n# Automatic Issue Creation for Deferred Items\n\nReusable patterns for automatically creating GitHub issues when items are classified as deferred, backlog, out-of-scope, or suggestions during workflow execution.\n\n## Philosophy\n\n**Automatic by Default**: When items are explicitly classified as deferred/backlog during any workflow, they should be automatically logged to GitHub issues without requiring a separate flag or manual step. The user is notified of what was created.\n\n## When to Use This Module\n\nInclude this module in any workflow that:\n- Classifies items as \"deferred\", \"backlog\", \"out-of-scope\", or \"suggestion\"\n- Identifies work that should be tracked but not addressed immediately\n- Produces improvement recommendations with priority levels\n\n## Integration Pattern\n\n### Step 1: Collect Deferred Items\n\nDuring workflow execution, collect deferred items in a structured format:\n\n```bash\n# Data structure for deferred items\nDEFERRED_ITEMS=()\n\n# Add items as they're identified\nDEFERRED_ITEMS+=(\"type:suggestion|title:Improve error messages|source:PR #123|file:auth.py:45|description:Error messages could be more descriptive|labels:enhancement,plugin:sanctum\")\nDEFERRED_ITEMS+=(\"type:backlog|title:Add rate limiting|source:PR #123|file:routes.py|description:Consider adding rate limiting to API|labels:enhancement,low-priority\")\n```\n\n### Step 2: Invoke Auto-Creation\n\nAt the end of the workflow (after all analysis is complete), invoke the auto-creation routine:\n\n```markdown\n## Auto-Create GitHub Issues\n\nFor each deferred item collected during this workflow:\n\n1. **Check for duplicates** before creating\n2. **Create the issue** with proper labels and context\n3. **Report what was created** to the user\n```\n\n### Step 3: Duplicate Detection\n\nBefore creating any issue, check if a similar issue already exists:\n\n```bash\n# Search for existing issues with similar title\nSEARCH_QUERY=\"$ITEM_TITLE in:title is:issue is:open\"\nEXISTING=$(gh issue list --search \"$SEARCH_QUERY\" --json number,title --jq '.[0].number // empty')\n\nif [[ -n \"$EXISTING\" ]]; then\n  echo \"Skipping duplicate: Issue #$EXISTING already tracks '$ITEM_TITLE'\"\n  SKIPPED_ITEMS+=(\"$ITEM_TITLE (duplicate of #$EXISTING)\")\nelse\n  # Proceed with creation\nfi\n```\n\n### Step 4: Issue Creation Template\n\n```bash\ncreate_deferred_issue() {\n  local TYPE=\"$1\"      # suggestion, backlog, deferred\n  local TITLE=\"$2\"     # Issue title\n  local SOURCE=\"$3\"    # Where it came from (PR #X, /update-plugins, etc.)\n  local FILE=\"$4\"      # file:line reference (optional)\n  local DESC=\"$5\"      # Description\n  local LABELS=\"$6\"    # Comma-separated labels\n\n  # Determine prefix based on type\n  case \"$TYPE\" in\n    suggestion) PREFIX=\"[Suggestion]\" ;;\n    backlog) PREFIX=\"[Backlog]\" ;;\n    deferred|out-of-scope) PREFIX=\"[Deferred]\" ;;\n    improvement) PREFIX=\"[Improvement]\" ;;\n    *) PREFIX=\"\" ;;\n  esac\n\n  # Create issue body\n  BODY=\"## Context\n\nIdentified during $SOURCE as $TYPE item.\n\n$(if [[ -n \"$FILE\" ]]; then echo \"**Location:** \\`$FILE\\`\"; fi)\n\n## Description\n\n$DESC\n\n## Value\n\nThis improvement would enhance the codebase by addressing an identified opportunity.\n\n## Acceptance Criteria\n\n- [ ] Implementation complete\n- [ ] Tests added/updated (if applicable)\n- [ ] Documentation updated (if applicable)\n\n---\n*Auto-created by workflow execution*\"\n\n  # Create the issue\n  ISSUE_URL=$(gh issue create \\\n    --title \"$PREFIX $TITLE\" \\\n    --body \"$BODY\" \\\n    --label \"$LABELS\" 2>&1)\n\n  if [[ $? -eq 0 ]]; then\n    echo \"$ISSUE_URL\"\n  else\n    echo \"ERROR: $ISSUE_URL\"\n    return 1\n  fi\n}\n```\n\n### Step 5: Report Created Issues\n\nAfter all issues are created, report to the user:\n\n```markdown\n### Issues Created (Automatic)\n\n| Type | Title | Issue | Labels |\n|------|-------|-------|--------|\n| Suggestion | Improve error messages | [#115](url) | enhancement, plugin:sanctum |\n| Backlog | Add rate limiting | [#116](url) | enhancement, low-priority |\n\n**Skipped (duplicates):**\n- \"Fix validation\" (duplicate of #42)\n```\n\n## Workflow-Specific Integration\n\n### For `/pr-review`\n\nAdd to Phase 3 (after triage):\n\n```markdown\n### Auto-Create Issues for Out-of-Scope Items\n\nItems classified as \"Suggestion\" or \"Out-of-Scope\" during triage are automatically logged:\n\n1. For each suggestion/out-of-scope item:\n   - Check for duplicate issues\n   - Create issue with `[Suggestion]` or `[Deferred]` prefix\n   - Add labels: `enhancement`, plugin label, priority label\n   - Reference the source PR\n\n2. Report created issues in the review summary\n```\n\n### For `/fix-pr`\n\nAdd to Step 6.1/6.2 (issue creation is already defined - make it automatic):\n\n```markdown\n### Automatic Issue Creation\n\n**CHANGE: Issue creation for suggestions and deferred items is now AUTOMATIC.**\n\nWhen items are classified as \"Suggestion\" or \"Deferred\" during triage (Step 2):\n- Issues are created automatically at the end of Step 6\n- No `--create-backlog-issues` flag required\n- User is notified of all created issues in the summary\n\n**Skip automatic creation with:** `--no-auto-issues` flag\n```\n\n### For `/update-plugins`\n\nAdd to Step 5 (after recommendations):\n\n```markdown\n### Auto-Create Issues for Improvement Recommendations\n\nItems in \"Critical\" and \"Moderate\" categories are automatically logged:\n\n1. For each improvement recommendation:\n   - Check for duplicate issues\n   - Create issue with `[Improvement]` prefix\n   - Add labels based on component type and priority\n   - Reference the plugin being analyzed\n\n2. \"Low Priority\" items are reported but not auto-created (stay in backlog docs)\n```\n\n### For `/fix-workflow`\n\nAdd to Phase 2 (outcome feedback):\n\n```markdown\n### Auto-Create Issues for Identified Improvements\n\nWhen retrospective analysis identifies workflow improvements:\n- Improvements that can't be implemented immediately → auto-create issue\n- Pattern: \"[Workflow] <improvement description>\"\n- Labels: `refactor`, `workflow`, priority based on complexity score\n```\n\n## Label Strategy\n\n| Item Type | Default Labels |\n|-----------|---------------|\n| Suggestion | `enhancement`, `low-priority`, `small-effort` |\n| Backlog | `enhancement`, `low-priority` |\n| Deferred | `enhancement`, `medium-priority` |\n| Improvement (Critical) | `enhancement`, `high-priority` |\n| Improvement (Moderate) | `enhancement`, `medium-priority` |\n| Workflow | `refactor`, `workflow` |\n\nAlways add plugin-specific labels when applicable: `plugin:sanctum`, `plugin:imbue`, etc.\n\n## Error Handling\n\n```bash\n# If issue creation fails\nif ! ISSUE_URL=$(create_deferred_issue ...); then\n  echo \"Warning: Failed to create issue for '$TITLE'\"\n  echo \"Error: $ISSUE_URL\"\n  FAILED_ITEMS+=(\"$TITLE\")\nfi\n```\n\nAt end of workflow:\n\n```markdown\n### Issue Creation Summary\n\n**Created:** 3 issues\n**Skipped (duplicates):** 1\n**Failed:** 0\n\nIf any failed, manually create using:\n\\`\\`\\`bash\ngh issue create --title \"[Type] Title\" --body \"...\" --label \"labels\"\n\\`\\`\\`\n```\n\n## Opting Out\n\nTo disable automatic issue creation for a specific workflow run:\n\n```bash\n# Flag to disable\n--no-auto-issues\n\n# Or environment variable\nSKIP_AUTO_ISSUES=true /pr-review 123\n```\n\nWhen disabled, deferred items are still reported but not created as issues:\n\n```markdown\n### Deferred Items (not auto-created)\n\nThe following items were identified but not logged to GitHub:\n- Suggestion: Improve error messages (auth.py:45)\n- Backlog: Add rate limiting (routes.py)\n\nTo create issues manually: `/create-issue \"Title\" --labels \"enhancement\"`\n```\n\nArchive v1.0.1: 3 files, 7638 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), SKILL.md (9583b), _meta.json (150b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: workflow-improvement\ndescription: Retrospective evaluation and improvement of skills, agents, commands, and hooks\nversion: 1.9.4\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\"\n```\n\n## Step 1: Capture the Session Slice (`slice-captured`)\n\nIdentify the **most recent command or session slice** in the current context window and capture:\n- **Trigger**: What command / request started it (include the literal `/command` if present)\n- **Goal**: What \"done\" meant for the user\n- **Artifacts touched**: Skills, agents, commands, hooks (names + file paths)\n- **Evidence**: Key tool calls / errors / retries that indicate inefficiency\n- **Context from Step 0**: Reference any relevant patterns from improvement context\n\nIf the slice is ambiguous, pick the most recent *complete* attempt and state the exact boundary you chose.\n\n## Step 2: Recreate the Workflow (`workflow-recreated`)\n\nReconstruct the workflow as a numbered list of 5 to 20 steps, identifying inputs, branch points for decisions, and outputs such as file changes or state modifications. During this reconstruction, identify specific friction points that reduce efficiency. These often include repeated steps or redundant tool calls, as well as missing guardrails where validation occurs too late or prerequisites are unclear. Other common issues are a lack of automation for tasks that should be scripted, and discoverability gaps caused by confusing naming conventions.\n\n**Cross-reference with Step 0 context:**\n- Are friction points matching known failure patterns?\n- Do repeated steps align with git history themes?\n- Are missing guardrails mentioned in review-chamber lessons?\n\n## Step 3: Generate Improvements (`improvements-generated`)\n\nGenerate 3 to 5 distinct improvement approaches and score each on impact, complexity, reversibility, and consistency with existing sanctum patterns. The scoring should specifically address whether the change prevents the recurrence of patterns identified in Step 0. Prioritize improvements that address components with a high stability gap (greater than 0.3) or recurring issues found in the git history. You should also incorporate lessons from the review-chamber and aim to reduce failure modes identified in the skill logs. Prefer small, high-use changes such as tightening a skill's exit criteria, adding missing command options, improving hook guardrails for better observability, or splitting overloaded commands into clearer phases.\n\n## Step 4: Agree on a Plan (`plan-agreed`)\n\nChoose 1 approach and define:\n- Acceptance criteria (“substantive difference”)\n- Fi\n\nArchive v1.0.0: 3 files, 7637 bytes\n\nFiles: modules/auto-issue-creation.md (7429b), SKILL.md (9583b), _meta.json (150b)","readmeExcerpt":"Skill: workflow-improvement Owner: athola Summary: Evaluates and improves skills, agents, commands, and hooks after a workflow slice Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:21:32.521Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:41:31.750Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:58:18.730Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:06:05.813Z | user Release v1.9.14 v1.9.13 | 2026-06-","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations"},{"language":"bash","snippet":"# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns"},{"language":"bash","snippet":"git log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/"},{"language":"markdown","snippet":"## Improvement Context\n\n### Skill Performance Issues\n- sanctum:workflow-improvement: stability_gap 0.35 (5 failures in 7 days)\n- Error pattern: \"Missing validation in Step 2\"\n\n### Knowledge Base Lessons\n- PR #42 lesson: \"Workflow validation should happen at start, not end\"\n- Pattern: Early validation reduces iteration time by 30%\n\n### Git History Insights\n- workflow-improvement skill: 8 commits in 30 days (instability signal)\n- Recurring theme: \"Add missing prerequisite checks\""},{"language":"markdown","snippet":"## Validation Results\n\n### Before Improvement\n- Step count: 15\n- Tool calls: 23\n- Failure points: 3\n- Duration: ~8 minutes\n- Manual interventions: 5\n\n### After Improvement\n- Step count: 11 (-4, -27%)\n- Tool calls: 17 (-6, -26%)\n- Failure points: 0 (-3, -100%)\n- Duration: ~5 minutes (-37%)\n- Manual interventions: 2 (-3, -60%)\n\n### Verification\n[E1] Command: `python3 plugins/sanctum/scripts/test_workflow.py`\nOutput: All tests passed (0.5s)\n\n[E2] Command: `/validate-plugin sanctum`\nOutput: No issues found"},{"language":"bash","snippet":"git add <changed-files>\ngit commit -m \"improve(sanctum): <component> - <specific fix>\n\nAddresses recurring issue: <pattern from Step 0>\nReduces <metric> by <percentage>\n\nEvidence: stability_gap reduced from 0.35 to 0.12\n\nCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>\""}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: workflow-improvement\ndescription: |\n  Evaluates and improves skills, agents, commands, and hooks after a workflow slice\nversion: 1.9.8\ntriggers:\n  - workflow\n  - retrospective\n  - efficiency\n  - commands\n  - agents\n  - skills\n  - hooks\n  - execution felt slow\n  - confusing\n  - repetitive\n  - or fragile\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\ud83e\\udd9e\", \"requires\": {\"config\": [\"night-market.sanctum:shared\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Workflow Improvement\n\n## When To Use\nUse this skill after running a command or completing a short session slice where execution felt slow, confusing, repetitive, or fragile.\n\nThis skill focuses on improving the *workflow assets* (skills, agents, commands, hooks) that were involved, not on feature work itself.\n\n## When NOT To Use\n\n- Implementing features - focus on feature work first\n\n## Required TodoWrite Items\n1. `fix-workflow:context-gathered`\n2. `fix-workflow:slice-captured`\n3. `fix-workflow:workflow-recreated`\n4. `fix-workflow:improvements-generated`\n5. `fix-workflow:plan-agreed`\n6. `fix-workflow:changes-implemented`\n7. `fix-workflow:validated`\n8. `fix-workflow:lesson-stored`\n\n## Step 0: Gather Improvement Context (`context-gathered`)\n\nBefore analyzing the current session, gather existing improvement data:\n\n### 0.1: Check Skill Execution History\n\nQuery memory-palace logs for recent performance issues:\n\n```bash\n# Recent failures (last 7 days)\n/skill-logs --failures-only --last 7d\n\n# Performance metrics for involved plugins\npensive:skill-review --plugin sanctum --recommendations\n```\n\n**Capture:**\n- Skills with stability_gap > 0.3\n- Recent failure patterns and error messages\n- Performance degradation trends\n\n### 0.2: Query Knowledge Base\n\nSearch for previously captured workflow lessons:\n\n```bash\n# If memory-palace review-chamber is available\n/review-room search \"workflow improvement\" --room lessons\n/review-room search \"efficiency\" --room patterns\n```\n\n**Look for:**\n- Similar workflow issues from past PRs\n- Recurring patterns in workflow failures\n- Architectural decisions affecting workflows\n\n### 0.3: Check Git History\n\nIdentify recurring issues through commit patterns:\n\n```bash\ngit log --oneline --grep=\"improve\\|fix\\|optimize\" --since=\"30 days ago\" \\\n  -- plugins/sanctum/skills/ plugins/sanctum/commands/\n\n# Look for unstable components (frequent fixes)\ngit log --oneline --since=\"30 days ago\" --follow \\\n  -- plugins/sanctum/skills/workflow-improvement/\n```\n\n**Extract:**\n- Components with frequent bug fixes (instability signals)\n- Patterns in improvement commit messages\n- Recurring issue themes\n\n**Output Format:**\n```markdown\n## Improvement Context\n\n### Skil"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-workflow-improvement\",\n  \"version\": \"1.9.19\",\n  \"publishedAt\": 1787750492521\n}"},{"path":"modules/auto-issue-creation.md","content":"# Automatic Issue Creation for Deferred Items\n\nReusable patterns for automatically creating GitHub issues when items are classified as deferred, backlog, out-of-scope, or suggestions during workflow execution.\n\n## Philosophy\n\n**Automatic by Default**: When items are explicitly classified as deferred/backlog during any workflow, they should be automatically logged to GitHub issues without requiring a separate flag or manual step. The user is notified of what was created.\n\n## When to Use This Module\n\nInclude this module in any workflow that:\n- Classifies items as \"deferred\", \"backlog\", \"out-of-scope\", or \"suggestion\"\n- Identifies work that should be tracked but not addressed immediately\n- Produces improvement recommendations with priority levels\n\n## Integration Pattern\n\n### Step 1: Collect Deferred Items\n\nDuring workflow execution, collect deferred items in a structured format:\n\n```bash\n# Data structure for deferred items\nDEFERRED_ITEMS=()\n\n# Add items as they're identified\nDEFERRED_ITEMS+=(\"type:suggestion|title:Improve error messages|source:PR #123|file:auth.py:45|description:Error messages could be more descriptive|labels:enhancement,plugin:sanctum\")\nDEFERRED_ITEMS+=(\"type:backlog|title:Add rate limiting|source:PR #123|file:routes.py|description:Consider adding rate limiting to API|labels:enhancement,low-priority\")\n```\n\n### Step 2: Invoke Auto-Creation\n\nAt the end of the workflow (after all analysis is complete), invoke the auto-creation routine:\n\n```markdown\n## Auto-Create GitHub Issues\n\nFor each deferred item collected during this workflow:\n\n1. **Check for duplicates** before creating\n2. **Create the issue** with proper labels and context\n3. **Report what was created** to the user\n```\n\n### Step 3: Duplicate Detection\n\nBefore creating any issue, check if a similar issue already exists:\n\n```bash\n# Search for existing issues with similar title\nSEARCH_QUERY=\"$ITEM_TITLE in:title is:issue is:open\"\nEXISTING=$(gh issue list --search \"$SEARCH_QUERY\" --json number,title --jq '.[0].number // empty')\n\nif [[ -n \"$EXISTING\" ]]; then\n  echo \"Skipping duplicate: Issue #$EXISTING already tracks '$ITEM_TITLE'\"\n  SKIPPED_ITEMS+=(\"$ITEM_TITLE (duplicate of #$EXISTING)\")\nelse\n  # Proceed with creation\nfi\n```\n\n### Step 4: Issue Creation Template\n\n```bash\ncreate_deferred_issue() {\n  local TYPE=\"$1\"      # suggestion, backlog, deferred\n  local TITLE=\"$2\"     # Issue title\n  local SOURCE=\"$3\"    # Where it came from (PR #X, /update-plugins, etc.)\n  local FILE=\"$4\"      # file:line reference (optional)\n  local DESC=\"$5\"      # Description\n  local LABELS=\"$6\"    # Comma-separated labels\n\n  # Determine prefix based on type\n  case \"$TYPE\" in\n    suggestion) PREFIX=\"[Suggestion]\" ;;\n    backlog) PREFIX=\"[Backlog]\" ;;\n    deferred|out-of-scope) PREFIX=\"[Deferred]\" ;;\n    improvement) PREFIX=\"[Improvement]\" ;;\n    *) PREFIX=\"\" ;;\n  esac\n\n  # Create issue body\n  BODY=\"## Context\n\nIdentified during $SOURCE as $TYPE item.\n\n$(if [[ -n \"$FILE\" ]]; then echo \"**Location:** \\`$FIL"},{"path":"skill-card.md","content":"## Description:\n\nEvaluates and improves skills, agents, commands, and hooks after a workflow slice.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[athola](https://clawhub.ai/user/athola)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and teams use this skill after a workflow slice to analyze friction in skills, agents, commands, and hooks, choose bounded improvements, implement them, and validate measurable workflow gains.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can expose private workflow, repository, or process details when creating GitHub issues or discussions.\n\nMitigation: Preview the exact content before posting, verify the destination repository and visibility, and redact private filenames, stack traces, secrets, and repository-specific context.\n\nRisk: The skill may write persistent records or change workflow assets during improvement work.\n\nMitigation: Require explicit approval before any git commit, GitHub issue, or GitHub Discussion post, and review proposed file changes before applying them.\n\n## Reference(s):\n\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum)\n- [Automatic issue creation module](artifact/modules/auto-issue-creation.md)\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-workflow-improvement)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown with inline bash code blocks and structured checklists]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May propose workflow asset edits and GitHub issue or discussion commands that should be previewed and approved before execution.]\n\n## Skill Version(s):\n\n1.9.19 (source: ClawHub release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Evaluates and improves skills, agents, commands, and hooks after a workflow slice Skill: workflow-improvement Owner: athola Summary: Evaluates and improves skills, agents, commands, and hooks after a workflow slice Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:21:32.521Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:41:31.750Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:58:18.730Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:06:05.813Z | user Release v1.9.14 v1.9.13 | 2026-06-","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1169,"uniquenessScore":52,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T05:11:42.441Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T05:11:42.441Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T07:43:23.656Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}