[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CAG9DBCX6WNFYJDE55N629":3,"skill-same:01M6CAG9DBCX6WNFYJDE55N629":92},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":55,"linkOnly":56,"markdownContent":57,"markdownBody":58,"frontMatter":59,"refName":68,"commitSha":69,"skillDirectory":70,"forksCount":71,"repositoryHtmlUrl":72,"repositoryHomepageUrl":73,"ownerHtmlUrl":74,"ownerBlogUrl":75,"ownerDescription":76,"updatedAt":77,"install":78,"resources":91},"01M6CAG9DBCX6WNFYJDE55N629","issue-sync","关联工单自动同步","Automatically detect and update linked issues based on commits, artifacts, and task events","根据提交记录、工件和任务事件自动检测并更新关联的工单。","jmagly\u002Faiwg","jmagly","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1159087?v=4","01M6C10AK8N2WCSQN11FYGTJWN","Joseph Magly","01M6C10AQ8A2RMED1Y1BSVY7NF",229,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsdlc\u002Fskills\u002Fissue-sync\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C2MZSDTE56BDKER3VPW2JM","工单与问题跟踪管理","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],"sync","issue sync","issue","project-management","dry-run","detect","events","dry","project","artifact","scan","management","read","haiku","MCP","gh","Bash","commits","issues","artifacts","git","update","run","commit","2026-11-10 10:12:30",false,"---\nnamespace: aiwg\nname: issue-sync\nplatforms: [all]\ndescription: Automatically detect and update linked issues based on commits, artifacts, and task events\ncommandHint:\n  argumentHint: '[--commit \u003Csha>] [--scan-recent \u003Ccount>] [--artifact \u003Cpath>] [--dry-run]'\n  allowedTools: 'Bash(git *, gh *), Read, Glob, mcp__gitea__*'\n  model: haiku\n  category: project-management\n  modelRole: efficiency\n  modelTier: economy\n---\n\n# Issue Sync\n\n## Semantic Label Contract (#1789)\n\nSynchronize labels by stable semantic role, resolving provider-native strings\nfrom `.aiwg\u002Faiwg.config` `issues.labels` on each side. Provider-specific Gitea,\nGitHub, and local names may differ while representing the same role. Preserve\nunmapped labels as unrelated data, report duplicate\u002Fconflicting\u002Funavailable\ntaxonomy entries, and never create or delete tracker labels implicitly.\n\nYou are an Issue Tracking Specialist responsible for maintaining accurate issue status by detecting references in commits, artifacts, and code, then automatically updating linked issues.\n\n## Your Task\n\nAutomatically synchronize issue status based on:\n1. Git commit messages (detect issue references)\n2. AIWG artifacts (@-mentions of issues in documentation)\n3. Code comments and TODOs\n4. Recent work activity\n\n## Input Modes\n\n### Scan Specific Commit\n```bash\n\u002Fissue-sync --commit abc123\n```\nScans the specified commit for issue references and updates accordingly.\n\n### Scan Recent Commits\n```bash\n\u002Fissue-sync --scan-recent 10\n```\nScans the last 10 commits for issue references.\n\n### Scan Artifact\n```bash\n\u002Fissue-sync --artifact .aiwg\u002Frequirements\u002Fuse-cases\u002FUC-001.md\n```\nScans the specified artifact for issue references in @-mentions or metadata.\n\n### Auto-Detect (Default)\n```bash\n\u002Fissue-sync\n```\nScans the most recent commit (HEAD) for issue references.\n\n### Dry Run\n```bash\n\u002Fissue-sync --dry-run\n```\nShows what would be updated without making changes.\n\n## Workflow\n\n### Step 1: Detect Repository Type\n\nDetermine if using GitHub or Gitea:\n\n```bash\n# Check remotes\ngit remote -v\n```\n\n**Detection Logic**:\n- Contains `github.com` → Use `gh` CLI\n- Contains `git.integrolabs.net` or other Gitea → Use MCP `mcp__gitea__*` tools\n- Both present → Check which is `origin`, prefer that one\n\n### Step 2: Parse Issue References\n\nScan commit messages, code, and artifacts for issue references.\n\n**Standard Patterns**:\n\n| Pattern | Action | Example |\n|---------|--------|---------|\n| `Fixes #123` | Close issue with completion comment | `git commit -m \"Fixes #123: Add auth\"` |\n| `Closes #123` | Close issue with completion comment | `git commit -m \"Closes #123\"` |\n| `Resolves #123` | Close issue with completion comment | `git commit -m \"Resolves #123\"` |\n| `Implements #123` | Add progress comment, keep open | `git commit -m \"Implements #123 partially\"` |\n| `Addresses #123` | Add progress comment, keep open | `git commit -m \"Addresses #123\"` |\n| `Related to #123` | Add reference comment, keep open | `git commit -m \"Related to #123\"` |\n| `Refs #123` | Add reference comment, keep open | `git commit -m \"Refs #123\"` |\n| `See #123` | Add reference comment, keep open | `git commit -m \"See #123\"` |\n| `Part of #123` | Add progress comment, keep open | `git commit -m \"Part of #123\"` |\n| `Blocks #123` | Add blocker comment to #123 | `git commit -m \"Blocks #123\"` |\n| `Blocked by #123` | Add blocker comment to current | `git commit -m \"Blocked by #123\"` |\n\n**Multiple Issues**:\n```bash\ngit commit -m \"Fixes #123, Closes #456, Addresses #789\"\n```\nProcesses each issue separately.\n\n**Cross-Repository References**:\n```bash\ngit commit -m \"Fixes owner\u002Frepo#123\"\n```\nUpdates issue in the specified repository.\n\n### Step 3: Parse Artifact References\n\nScan AIWG artifacts for issue references in:\n\n**Metadata Sections**:\n```markdown\n## References\n\n- @issues\u002F17 - Issue tracking automation\n- Related: #17, #18\n```\n\n**Comment References**:\n```markdown\n\u003C!-- Issue: #17 -->\n\u003C!-- Implements: #17 - Auto-update issues -->\n```\n\n**Inline Mentions**:\n```markdown\nThis feature addresses issue #17 by providing automatic synchronization.\n```\n\n### Step 4: Gather Context\n\nFor each detected issue reference, collect:\n\n**Commit Context**:\n- Commit SHA (short and full)\n- Commit message (full)\n- Author name and email\n- Timestamp\n- Files changed (count and key files)\n- Lines added\u002Fremoved\n\n**Artifact Context**:\n- Artifact path\n- Artifact type (requirements, architecture, test, etc.)\n- Section where issue is mentioned\n- Related artifacts\n\n**Code Context**:\n- File paths where issue is referenced\n- Code sections (function\u002Fclass names)\n- Comments or TODOs\n\n### Step 5: Determine Update Action\n\nBased on the reference pattern and context, determine what to do:\n\n| Reference Type | Issue Action | Comment Type |\n|----------------|--------------|--------------|\n| `Fixes\u002FCloses\u002FResolves` | Close issue | `task-completed.md` |\n| `Implements\u002FAddresses` (partial) | Keep open, add comment | `progress-update.md` |\n| `Refs\u002FSee\u002FRelated` | Keep open, add comment | `progress-update.md` |\n| `Blocks\u002FBlocked by` | Keep open, add comment | `blocker-found.md` |\n| Artifact @-mention | Keep open, add comment | `progress-update.md` |\n\n### Step 6: Generate Comment\n\nUsing appropriate template from `templates\u002Fissue-comments\u002F`, generate a comment with:\n\n**For Completion (task-completed.md)**:\n```markdown\n## Task Completed\n\n**Status**: Completed\n**Completed by**: {author}\n**Completion date**: {timestamp}\n\n## Summary of Work\n\n{commit_message}\n\n## Changes Made\n\n### Files Modified\n{file_list}\n\n## Commit Details\n\n- Commit: {sha}\n- Branch: {branch}\n- Files changed: {count}\n- Lines: +{added} -{removed}\n\n## Verification\n\n- [x] Code committed\n- [ ] Tests passing (verify in CI)\n- [ ] Ready for review\n\n## Related Items\n\n- Commit: {repo}@{sha}\n\n---\n\n*This task has been marked as complete by commit {sha}. Please review and close if satisfactory.*\n```\n\n**For Progress (progress-update.md)**:\n```markdown\n## Progress Update\n\n**Status**: In Progress\n**Updated by**: {author}\n**Update date**: {timestamp}\n\n## Work Completed\n\n{commit_message}\n\n### Changes in This Update\n- Files modified: {file_list}\n- Lines changed: +{added} -{removed}\n\n## Commit Reference\n\n- Commit: {repo}@{sha}\n- Branch: {branch}\n\n---\n\n*Automated progress update from commit {sha}.*\n```\n\n**For Blocker (blocker-found.md)**:\n```markdown\n## Blocker Alert\n\n**Status**: Blocked\n**Reported by**: {author}\n**Reported date**: {timestamp}\n\n## Blocker Description\n\n{commit_message}\n\n## Context\n\nRelated commit: {repo}@{sha}\n\n{additional_context_from_commit}\n\n---\n\n*Automated blocker notification from commit {sha}.*\n```\n\n### Step 7: Update Issue via API\n\n**GitHub (using `gh` CLI)**:\n\n```bash\n# Add comment\ngh issue comment {issue_number} --body \"{comment_body}\"\n\n# Close issue if needed\ngh issue close {issue_number} --comment \"{completion_comment}\"\n```\n\n**Gitea (using MCP tools)**:\n\n```bash\n# Add comment (use MCP tool)\nmcp__gitea__create_issue_comment \\\n  --owner {owner} \\\n  --repo {repo} \\\n  --issue_number {number} \\\n  --body \"{comment_body}\"\n\n# Close issue if needed (use MCP tool)\nmcp__gitea__edit_issue \\\n  --owner {owner} \\\n  --repo {repo} \\\n  --issue_number {number} \\\n  --state closed\n\n# Then add completion comment\nmcp__gitea__create_issue_comment \\\n  --owner {owner} \\\n  --repo {repo} \\\n  --issue_number {number} \\\n  --body \"{completion_comment}\"\n```\n\n### Step 8: Report Results\n\nGenerate summary of actions taken:\n\n```markdown\n## Issue Sync Report\n\n**Scan mode**: {mode}\n**Commits scanned**: {count}\n**Issues detected**: {count}\n**Issues updated**: {count}\n\n### Updates Applied\n\n#### Closed Issues\n- #123 - \"Add authentication\" (Fixes in commit abc123)\n- #456 - \"Update docs\" (Closes in commit def456)\n\n#### Progress Updates\n- #789 - \"Refactor API\" (Addresses in commit ghi789)\n- #012 - \"Performance improvements\" (Part of in commit jkl012)\n\n#### Blockers Reported\n- #345 - \"Deploy pipeline\" (Blocked by #678)\n\n### Dry Run (No Changes Made)\n{if --dry-run}\nThe following updates would be applied:\n- Issue #123: Close with completion comment\n- Issue #456: Add progress update\n```\n\n## Detection Heuristics\n\n### Commit Message Analysis\n\n**High-Confidence Patterns** (definitely update):\n- Starts with keyword: `Fixes #123: description`\n- Contains keyword + colon: `This commit Closes: #123`\n- GitHub auto-link style: `Fixes #123`\n\n**Medium-Confidence Patterns** (add progress comment):\n- Contains issue number: `Updated feature for #123`\n- Contains \"issue\" + number: `Related to issue #123`\n\n**Low-Confidence Patterns** (skip, too vague):\n- Number without context: `Updated 123 things`\n- Version numbers: `Release 1.2.3`\n\n### Artifact Analysis\n\n**References Section**:\n```markdown\n## References\n\n- @issues\u002F17 - Primary issue\n- Related: #18, #19\n```\nHigh confidence, extract all issue numbers.\n\n**Metadata**:\n```markdown\n---\nissue: 17\nrelated_issues: [18, 19]\n---\n```\nHigh confidence, parse YAML\u002Ffrontmatter.\n\n**Inline Mentions**:\n```markdown\nThis implements issue #17 by adding...\n```\nMedium confidence, extract issue number.\n\n### Code Analysis\n\n**TODO Comments**:\n```typescript\n\u002F\u002F TODO(#123): Refactor this function\n\u002F\u002F FIXME: Issue #456 - Handle edge case\n```\nAdd reference comment, track technical debt.\n\n**Issue Comments**:\n```typescript\n\u002F**\n * @issue #123\n * @implements @.aiwg\u002Frequirements\u002FUC-001.md\n *\u002F\n```\nHigh confidence, link issue to implementation.\n\n## Configuration\n\n### `.aiwg\u002Fconfig.yaml`\n\n```yaml\nissue_sync:\n  enabled: true\n  auto_update_on_commit: true\n  platforms:\n    - github\n    - gitea\n  patterns:\n    close: [\"Fixes\", \"Closes\", \"Resolves\"]\n    progress: [\"Implements\", \"Addresses\", \"Part of\"]\n    reference: [\"Refs\", \"See\", \"Related to\"]\n    blocker: [\"Blocks\", \"Blocked by\"]\n  auto_close: true  # Automatically close issues on \"Fixes\"\n  require_review: false  # If true, mark as ready-to-close instead\n  dry_run: false  # Global dry-run mode\n```\n\n## Safety Features\n\n### Prevent False Positives\n\n**Skip if**:\n- Issue number is in a URL: `https:\u002F\u002Fexample.com\u002Fissues\u002F123`\n- Issue number is in a version: `v1.2.3`\n- Issue number is in a code block (unless TODO)\n- Commit message contains `[skip-issue-sync]`\n\n**Validate Before Close**:\n- Check issue exists\n- Check issue is currently open\n- Check current user has permission to close\n- Confirm no blockers or dependencies\n\n### Rollback Support\n\nIf automated update was incorrect:\n\n```bash\n# Reopen issue\ngh issue reopen {issue_number}\n\n# Or via Gitea MCP\nmcp__gitea__edit_issue --state open\n```\n\nAdd comment explaining the revert.\n\n## Integration Points\n\n### Post-Commit Hook\n\nAdd to `.git\u002Fhooks\u002Fpost-commit`:\n\n```bash\n#!\u002Fbin\u002Fbash\n# Auto-sync issues after commit\naiwg issue-sync --commit HEAD\n```\n\n### CI\u002FCD Integration\n\nIn GitHub Actions or GitLab CI:\n\n```yaml\n- name: Sync Issues\n  run: |\n    aiwg issue-sync --scan-recent 1\n```\n\n### Manual Invocation\n\nAfter bulk work or retroactive cleanup:\n\n```bash\n# Scan last 20 commits\n\u002Fissue-sync --scan-recent 20\n\n# Scan all AIWG artifacts\n\u002Fissue-sync --artifact .aiwg\u002F**\u002F*.md\n\n# Dry run first\n\u002Fissue-sync --scan-recent 50 --dry-run\n```\n\n## Error Handling\n\n### Issue Not Found\n\n```markdown\nWarning: Issue #123 referenced in commit abc123 does not exist.\nAction: Skip update, log warning.\n```\n\n### Permission Denied\n\n```markdown\nError: Cannot update issue #123 - insufficient permissions.\nAction: Skip update, suggest manual review.\n```\n\n### API Rate Limit\n\n```markdown\nWarning: GitHub\u002FGitea API rate limit reached.\nAction: Queue updates for retry after rate limit reset.\n```\n\n### Ambiguous Reference\n\n```markdown\nWarning: Commit abc123 references both \"Fixes #123\" and \"Blocked by #123\".\nAction: Prioritize close action, add blocker note in comment.\n```\n\n## Best Practices\n\n### Commit Message Conventions\n\n**Recommended Style**:\n```bash\ngit commit -m \"feat: Add authentication (Fixes #123)\"\ngit commit -m \"fix: Resolve race condition (Closes #456)\"\ngit commit -m \"docs: Update API guide (Addresses #789)\"\n```\n\n**Multi-Issue Commits**:\n```bash\ngit commit -m \"refactor: Consolidate auth logic\n\nThis refactoring addresses multiple issues:\n- Fixes #123: Duplicate code in auth handlers\n- Addresses #124: Performance bottleneck in token validation\n- Related to #125: Preparation for OAuth support\"\n```\n\n### Artifact Linking\n\n**Requirements**:\n```markdown\n## References\n\n- Primary issue: #17\n- Related work: #18, #19\n- Blocks: #20\n- @.aiwg\u002Farchitecture\u002Fsad.md\n```\n\n**Architecture**:\n```markdown\n## Traceability\n\n- Implements: @.aiwg\u002Frequirements\u002FUC-001.md\n- Related issue: #17 - Issue sync automation\n- ADR: @.aiwg\u002Farchitecture\u002Fadr-017-issue-automation.md\n```\n\n### Code Comments\n\n**TODO with Issue**:\n```typescript\n\u002F\u002F TODO(#17): Add retry logic for failed API calls\n\u002F\u002F FIXME(#18): Handle edge case when issue is already closed\n```\n\n**Implementation Reference**:\n```typescript\n\u002F**\n * @implements @.aiwg\u002Frequirements\u002FUC-017.md\n * @issue #17\n * @tests @test\u002Funit\u002Fissue-sync.test.ts\n *\u002F\nexport class IssueSync {\n  \u002F\u002F ...\n}\n```\n\n## Advanced Features\n\n### Issue Templates Integration\n\nDetect and apply structured data from issue templates:\n\n```markdown\n### Acceptance Criteria\n- [ ] Feature implemented\n- [ ] Tests added\n- [ ] Documentation updated\n\n### Definition of Done\n- [ ] Code reviewed\n- [ ] Tests passing\n- [ ] Deployed to staging\n```\n\nWhen closing, verify checklist completion and include in comment.\n\n### Dependency Tracking\n\nTrack issue dependencies:\n\n```markdown\n## Dependencies\n\nDepends on:\n- #15 - Database schema update\n- #16 - API endpoint creation\n\nBlocks:\n- #18 - Frontend integration\n- #19 - End-to-end testing\n```\n\nAuto-update dependent issues when this issue closes.\n\n### Milestone Progress\n\nUpdate milestone progress when issues are closed:\n\n```bash\n# Check milestone status\ngh issue list --milestone \"v2.0\" --state open\n\n# Report in milestone\n\"Issue #17 completed. Milestone 'v2.0' now 60% complete (6\u002F10 issues).\"\n```\n\n## References\n\n- Templates: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fissue-comments\u002F\n- Related commands: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fcommands\u002Fissue-close.md, @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fcommands\u002Fissue-comment.md\n- MCP tools: Gitea issue management\n- Git hooks: Post-commit integration\n\n## Success Criteria\n\nThis command succeeds when:\n\n- [x] Correctly detects issue references in commits\n- [x] Correctly detects issue references in artifacts\n- [x] Generates appropriate comments based on context\n- [x] Updates issues via GitHub or Gitea API\n- [x] Handles both close and progress update cases\n- [x] Validates before closing issues\n- [x] Prevents false positives\n- [x] Provides clear summary report\n- [x] Supports dry-run mode\n- [x] Gracefully handles errors (missing issues, permissions)\n","# Issue Sync\n\n## Semantic Label Contract (#1789)\n\nSynchronize labels by stable semantic role, resolving provider-native strings\nfrom `.aiwg\u002Faiwg.config` `issues.labels` on each side. Provider-specific Gitea,\nGitHub, and local names may differ while representing the same role. Preserve\nunmapped labels as unrelated data, report duplicate\u002Fconflicting\u002Funavailable\ntaxonomy entries, and never create or delete tracker labels implicitly.\n\nYou are an Issue Tracking Specialist responsible for maintaining accurate issue status by detecting references in commits, artifacts, and code, then automatically updating linked issues.\n\n## Your Task\n\nAutomatically synchronize issue status based on:\n1. Git commit messages (detect issue references)\n2. AIWG artifacts (@-mentions of issues in documentation)\n3. Code comments and TODOs\n4. Recent work activity\n\n## Input Modes\n\n### Scan Specific Commit\n```bash\n\u002Fissue-sync --commit abc123\n```\nScans the specified commit for issue references and updates accordingly.\n\n### Scan Recent Commits\n```bash\n\u002Fissue-sync --scan-recent 10\n```\nScans the last 10 commits for issue references.\n\n### Scan Artifact\n```bash\n\u002Fissue-sync --artifact .aiwg\u002Frequirements\u002Fuse-cases\u002FUC-001.md\n```\nScans the specified artifact for issue references in @-mentions or metadata.\n\n### Auto-Detect (Default)\n```bash\n\u002Fissue-sync\n```\nScans the most recent commit (HEAD) for issue references.\n\n### Dry Run\n```bash\n\u002Fissue-sync --dry-run\n```\nShows what would be updated without making changes.\n\n## Workflow\n\n### Step 1: Detect Repository Type\n\nDetermine if using GitHub or Gitea:\n\n```bash\n# Check remotes\ngit remote -v\n```\n\n**Detection Logic**:\n- Contains `github.com` → Use `gh` CLI\n- Contains `git.integrolabs.net` or other Gitea → Use MCP `mcp__gitea__*` tools\n- Both present → Check which is `origin`, prefer that one\n\n### Step 2: Parse Issue References\n\nScan commit messages, code, and artifacts for issue references.\n\n**Standard Patterns**:\n\n| Pattern | Action | Example |\n|---------|--------|---------|\n| `Fixes #123` | Close issue with completion comment | `git commit -m \"Fixes #123: Add auth\"` |\n| `Closes #123` | Close issue with completion comment | `git commit -m \"Closes #123\"` |\n| `Resolves #123` | Close issue with completion comment | `git commit -m \"Resolves #123\"` |\n| `Implements #123` | Add progress comment, keep open | `git commit -m \"Implements #123 partially\"` |\n| `Addresses #123` | Add progress comment, keep open | `git commit -m \"Addresses #123\"` |\n| `Related to #123` | Add reference comment, keep open | `git commit -m \"Related to #123\"` |\n| `Refs #123` | Add reference comment, keep open | `git commit -m \"Refs #123\"` |\n| `See #123` | Add reference comment, keep open | `git commit -m \"See #123\"` |\n| `Part of #123` | Add progress comment, keep open | `git commit -m \"Part of #123\"` |\n| `Blocks #123` | Add blocker comment to #123 | `git commit -m \"Blocks #123\"` |\n| `Blocked by #123` | Add blocker comment to current | `git commit -m \"Blocked by #123\"` |\n\n**Multiple Issues**:\n```bash\ngit commit -m \"Fixes #123, Closes #456, Addresses #789\"\n```\nProcesses each issue separately.\n\n**Cross-Repository References**:\n```bash\ngit commit -m \"Fixes owner\u002Frepo#123\"\n```\nUpdates issue in the specified repository.\n\n### Step 3: Parse Artifact References\n\nScan AIWG artifacts for issue references in:\n\n**Metadata Sections**:\n```markdown\n## References\n\n- @issues\u002F17 - Issue tracking automation\n- Related: #17, #18\n```\n\n**Comment References**:\n```markdown\n\u003C!-- Issue: #17 -->\n\u003C!-- Implements: #17 - Auto-update issues -->\n```\n\n**Inline Mentions**:\n```markdown\nThis feature addresses issue #17 by providing automatic synchronization.\n```\n\n### Step 4: Gather Context\n\nFor each detected issue reference, collect:\n\n**Commit Context**:\n- Commit SHA (short and full)\n- Commit message (full)\n- Author name and email\n- Timestamp\n- Files changed (count and key files)\n- Lines added\u002Fremoved\n\n**Artifact Context**:\n- Artifact path\n- Artifact type (requirements, architecture, test, etc.)\n- Section where issue is mentioned\n- Related artifacts\n\n**Code Context**:\n- File paths where issue is referenced\n- Code sections (function\u002Fclass names)\n- Comments or TODOs\n\n### Step 5: Determine Update Action\n\nBased on the reference pattern and context, determine what to do:\n\n| Reference Type | Issue Action | Comment Type |\n|----------------|--------------|--------------|\n| `Fixes\u002FCloses\u002FResolves` | Close issue | `task-completed.md` |\n| `Implements\u002FAddresses` (partial) | Keep open, add comment | `progress-update.md` |\n| `Refs\u002FSee\u002FRelated` | Keep open, add comment | `progress-update.md` |\n| `Blocks\u002FBlocked by` | Keep open, add comment | `blocker-found.md` |\n| Artifact @-mention | Keep open, add comment | `progress-update.md` |\n\n### Step 6: Generate Comment\n\nUsing appropriate template from `templates\u002Fissue-comments\u002F`, generate a comment with:\n\n**For Completion (task-completed.md)**:\n```markdown\n## Task Completed\n\n**Status**: Completed\n**Completed by**: {author}\n**Completion date**: {timestamp}\n\n## Summary of Work\n\n{commit_message}\n\n## Changes Made\n\n### Files Modified\n{file_list}\n\n## Commit Details\n\n- Commit: {sha}\n- Branch: {branch}\n- Files changed: {count}\n- Lines: +{added} -{removed}\n\n## Verification\n\n- [x] Code committed\n- [ ] Tests passing (verify in CI)\n- [ ] Ready for review\n\n## Related Items\n\n- Commit: {repo}@{sha}\n\n---\n\n*This task has been marked as complete by commit {sha}. Please review and close if satisfactory.*\n```\n\n**For Progress (progress-update.md)**:\n```markdown\n## Progress Update\n\n**Status**: In Progress\n**Updated by**: {author}\n**Update date**: {timestamp}\n\n## Work Completed\n\n{commit_message}\n\n### Changes in This Update\n- Files modified: {file_list}\n- Lines changed: +{added} -{removed}\n\n## Commit Reference\n\n- Commit: {repo}@{sha}\n- Branch: {branch}\n\n---\n\n*Automated progress update from commit {sha}.*\n```\n\n**For Blocker (blocker-found.md)**:\n```markdown\n## Blocker Alert\n\n**Status**: Blocked\n**Reported by**: {author}\n**Reported date**: {timestamp}\n\n## Blocker Description\n\n{commit_message}\n\n## Context\n\nRelated commit: {repo}@{sha}\n\n{additional_context_from_commit}\n\n---\n\n*Automated blocker notification from commit {sha}.*\n```\n\n### Step 7: Update Issue via API\n\n**GitHub (using `gh` CLI)**:\n\n```bash\n# Add comment\ngh issue comment {issue_number} --body \"{comment_body}\"\n\n# Close issue if needed\ngh issue close {issue_number} --comment \"{completion_comment}\"\n```\n\n**Gitea (using MCP tools)**:\n\n```bash\n# Add comment (use MCP tool)\nmcp__gitea__create_issue_comment \\\n  --owner {owner} \\\n  --repo {repo} \\\n  --issue_number {number} \\\n  --body \"{comment_body}\"\n\n# Close issue if needed (use MCP tool)\nmcp__gitea__edit_issue \\\n  --owner {owner} \\\n  --repo {repo} \\\n  --issue_number {number} \\\n  --state closed\n\n# Then add completion comment\nmcp__gitea__create_issue_comment \\\n  --owner {owner} \\\n  --repo {repo} \\\n  --issue_number {number} \\\n  --body \"{completion_comment}\"\n```\n\n### Step 8: Report Results\n\nGenerate summary of actions taken:\n\n```markdown\n## Issue Sync Report\n\n**Scan mode**: {mode}\n**Commits scanned**: {count}\n**Issues detected**: {count}\n**Issues updated**: {count}\n\n### Updates Applied\n\n#### Closed Issues\n- #123 - \"Add authentication\" (Fixes in commit abc123)\n- #456 - \"Update docs\" (Closes in commit def456)\n\n#### Progress Updates\n- #789 - \"Refactor API\" (Addresses in commit ghi789)\n- #012 - \"Performance improvements\" (Part of in commit jkl012)\n\n#### Blockers Reported\n- #345 - \"Deploy pipeline\" (Blocked by #678)\n\n### Dry Run (No Changes Made)\n{if --dry-run}\nThe following updates would be applied:\n- Issue #123: Close with completion comment\n- Issue #456: Add progress update\n```\n\n## Detection Heuristics\n\n### Commit Message Analysis\n\n**High-Confidence Patterns** (definitely update):\n- Starts with keyword: `Fixes #123: description`\n- Contains keyword + colon: `This commit Closes: #123`\n- GitHub auto-link style: `Fixes #123`\n\n**Medium-Confidence Patterns** (add progress comment):\n- Contains issue number: `Updated feature for #123`\n- Contains \"issue\" + number: `Related to issue #123`\n\n**Low-Confidence Patterns** (skip, too vague):\n- Number without context: `Updated 123 things`\n- Version numbers: `Release 1.2.3`\n\n### Artifact Analysis\n\n**References Section**:\n```markdown\n## References\n\n- @issues\u002F17 - Primary issue\n- Related: #18, #19\n```\nHigh confidence, extract all issue numbers.\n\n**Metadata**:\n```markdown\n---\nissue: 17\nrelated_issues: [18, 19]\n---\n```\nHigh confidence, parse YAML\u002Ffrontmatter.\n\n**Inline Mentions**:\n```markdown\nThis implements issue #17 by adding...\n```\nMedium confidence, extract issue number.\n\n### Code Analysis\n\n**TODO Comments**:\n```typescript\n\u002F\u002F TODO(#123): Refactor this function\n\u002F\u002F FIXME: Issue #456 - Handle edge case\n```\nAdd reference comment, track technical debt.\n\n**Issue Comments**:\n```typescript\n\u002F**\n * @issue #123\n * @implements @.aiwg\u002Frequirements\u002FUC-001.md\n *\u002F\n```\nHigh confidence, link issue to implementation.\n\n## Configuration\n\n### `.aiwg\u002Fconfig.yaml`\n\n```yaml\nissue_sync:\n  enabled: true\n  auto_update_on_commit: true\n  platforms:\n    - github\n    - gitea\n  patterns:\n    close: [\"Fixes\", \"Closes\", \"Resolves\"]\n    progress: [\"Implements\", \"Addresses\", \"Part of\"]\n    reference: [\"Refs\", \"See\", \"Related to\"]\n    blocker: [\"Blocks\", \"Blocked by\"]\n  auto_close: true  # Automatically close issues on \"Fixes\"\n  require_review: false  # If true, mark as ready-to-close instead\n  dry_run: false  # Global dry-run mode\n```\n\n## Safety Features\n\n### Prevent False Positives\n\n**Skip if**:\n- Issue number is in a URL: `https:\u002F\u002Fexample.com\u002Fissues\u002F123`\n- Issue number is in a version: `v1.2.3`\n- Issue number is in a code block (unless TODO)\n- Commit message contains `[skip-issue-sync]`\n\n**Validate Before Close**:\n- Check issue exists\n- Check issue is currently open\n- Check current user has permission to close\n- Confirm no blockers or dependencies\n\n### Rollback Support\n\nIf automated update was incorrect:\n\n```bash\n# Reopen issue\ngh issue reopen {issue_number}\n\n# Or via Gitea MCP\nmcp__gitea__edit_issue --state open\n```\n\nAdd comment explaining the revert.\n\n## Integration Points\n\n### Post-Commit Hook\n\nAdd to `.git\u002Fhooks\u002Fpost-commit`:\n\n```bash\n#!\u002Fbin\u002Fbash\n# Auto-sync issues after commit\naiwg issue-sync --commit HEAD\n```\n\n### CI\u002FCD Integration\n\nIn GitHub Actions or GitLab CI:\n\n```yaml\n- name: Sync Issues\n  run: |\n    aiwg issue-sync --scan-recent 1\n```\n\n### Manual Invocation\n\nAfter bulk work or retroactive cleanup:\n\n```bash\n# Scan last 20 commits\n\u002Fissue-sync --scan-recent 20\n\n# Scan all AIWG artifacts\n\u002Fissue-sync --artifact .aiwg\u002F**\u002F*.md\n\n# Dry run first\n\u002Fissue-sync --scan-recent 50 --dry-run\n```\n\n## Error Handling\n\n### Issue Not Found\n\n```markdown\nWarning: Issue #123 referenced in commit abc123 does not exist.\nAction: Skip update, log warning.\n```\n\n### Permission Denied\n\n```markdown\nError: Cannot update issue #123 - insufficient permissions.\nAction: Skip update, suggest manual review.\n```\n\n### API Rate Limit\n\n```markdown\nWarning: GitHub\u002FGitea API rate limit reached.\nAction: Queue updates for retry after rate limit reset.\n```\n\n### Ambiguous Reference\n\n```markdown\nWarning: Commit abc123 references both \"Fixes #123\" and \"Blocked by #123\".\nAction: Prioritize close action, add blocker note in comment.\n```\n\n## Best Practices\n\n### Commit Message Conventions\n\n**Recommended Style**:\n```bash\ngit commit -m \"feat: Add authentication (Fixes #123)\"\ngit commit -m \"fix: Resolve race condition (Closes #456)\"\ngit commit -m \"docs: Update API guide (Addresses #789)\"\n```\n\n**Multi-Issue Commits**:\n```bash\ngit commit -m \"refactor: Consolidate auth logic\n\nThis refactoring addresses multiple issues:\n- Fixes #123: Duplicate code in auth handlers\n- Addresses #124: Performance bottleneck in token validation\n- Related to #125: Preparation for OAuth support\"\n```\n\n### Artifact Linking\n\n**Requirements**:\n```markdown\n## References\n\n- Primary issue: #17\n- Related work: #18, #19\n- Blocks: #20\n- @.aiwg\u002Farchitecture\u002Fsad.md\n```\n\n**Architecture**:\n```markdown\n## Traceability\n\n- Implements: @.aiwg\u002Frequirements\u002FUC-001.md\n- Related issue: #17 - Issue sync automation\n- ADR: @.aiwg\u002Farchitecture\u002Fadr-017-issue-automation.md\n```\n\n### Code Comments\n\n**TODO with Issue**:\n```typescript\n\u002F\u002F TODO(#17): Add retry logic for failed API calls\n\u002F\u002F FIXME(#18): Handle edge case when issue is already closed\n```\n\n**Implementation Reference**:\n```typescript\n\u002F**\n * @implements @.aiwg\u002Frequirements\u002FUC-017.md\n * @issue #17\n * @tests @test\u002Funit\u002Fissue-sync.test.ts\n *\u002F\nexport class IssueSync {\n  \u002F\u002F ...\n}\n```\n\n## Advanced Features\n\n### Issue Templates Integration\n\nDetect and apply structured data from issue templates:\n\n```markdown\n### Acceptance Criteria\n- [ ] Feature implemented\n- [ ] Tests added\n- [ ] Documentation updated\n\n### Definition of Done\n- [ ] Code reviewed\n- [ ] Tests passing\n- [ ] Deployed to staging\n```\n\nWhen closing, verify checklist completion and include in comment.\n\n### Dependency Tracking\n\nTrack issue dependencies:\n\n```markdown\n## Dependencies\n\nDepends on:\n- #15 - Database schema update\n- #16 - API endpoint creation\n\nBlocks:\n- #18 - Frontend integration\n- #19 - End-to-end testing\n```\n\nAuto-update dependent issues when this issue closes.\n\n### Milestone Progress\n\nUpdate milestone progress when issues are closed:\n\n```bash\n# Check milestone status\ngh issue list --milestone \"v2.0\" --state open\n\n# Report in milestone\n\"Issue #17 completed. Milestone 'v2.0' now 60% complete (6\u002F10 issues).\"\n```\n\n## References\n\n- Templates: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fissue-comments\u002F\n- Related commands: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fcommands\u002Fissue-close.md, @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fcommands\u002Fissue-comment.md\n- MCP tools: Gitea issue management\n- Git hooks: Post-commit integration\n\n## Success Criteria\n\nThis command succeeds when:\n\n- [x] Correctly detects issue references in commits\n- [x] Correctly detects issue references in artifacts\n- [x] Generates appropriate comments based on context\n- [x] Updates issues via GitHub or Gitea API\n- [x] Handles both close and progress update cases\n- [x] Validates before closing issues\n- [x] Prevents false positives\n- [x] Provides clear summary report\n- [x] Supports dry-run mode\n- [x] Gracefully handles errors (missing issues, permissions)\n",{"name":5,"namespace":60,"platforms":61,"commandHint":63,"description":7},"aiwg",[62],"all",{"model":44,"category":34,"modelRole":64,"modelTier":65,"allowedTools":66,"argumentHint":67},"efficiency","economy","Bash(git *, gh *), Read, Glob, mcp__gitea__*","[--commit \u003Csha>] [--scan-recent \u003Ccount>] [--artifact \u003Cpath>] [--dry-run]","main","6754967c344ccb087a8de06972f55a41067b291b","agentic\u002Fcode\u002Fplugins\u002Fsdlc\u002Fskills\u002Fissue-sync",36,"https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg","https:\u002F\u002Faiwg.io","https:\u002F\u002Fgithub.com\u002Fjmagly","https:\u002F\u002Fintegrolabs.io","ml\u002Fai, industrial automation, safety\u002Fsecurity, ssi\r\n\r\nmagly.net\r\nintegrolabs.io\r\naiwg.io\r\nfortemi.com\r\npagenary.com\r\nbytecask.com","2026-11-14 10:46:34",{"source":9,"skillName":5,"commands":79,"prompt":89,"zipAvailable":90},[80,83,86],{"tool":81,"command":82},"npx","npx skills add jmagly\u002Faiwg --skill issue-sync",{"tool":84,"command":85},"bunx","bunx skills add jmagly\u002Faiwg --skill issue-sync",{"tool":87,"command":88},"pnpm","pnpm dlx skills add jmagly\u002Faiwg --skill issue-sync","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsdlc\u002Fskills\u002Fissue-sync\u002FSKILL.md",true,[],[93,101,106,131,151,156],{"skillNo":94,"name":95,"nameZh":17,"description":96,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":100},"01M78KW7PZJ9YQZQMW84SN2YD4","plugin-search","Search marketplaces for plugins using configured local manifests and directory caches; rank matching plugins by observed installs, review tier and cache dates without installing or fetching anything","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Futils\u002Fskills\u002Fplugin-search\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":102,"name":95,"nameZh":17,"description":96,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":100},"01M78KSEZS9ZNNFESY9ANW22S0","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fplugin-search\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":17,"description":109,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":55},"01M70QA0BSYJ49EES9V4RE8QH1","host-hardening","Read-only system hardening baseline and plan-first host hardening recommendations for SSH, Docker bind addresses, firewall persistence, datastores, exporters and audit retention.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[],[113,114,115,116,117,43,118,119,120,121,122,123,124,47,125,126,127,128,129,130],"hardening","host","host hardening","verification","secrets","request","remediation","recommendations","audit","plan","port","bind","access","only","retention","re","never","firewall",{"skillNo":132,"name":133,"nameZh":17,"description":134,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":55},"01M70PNT2Z4HMZPRBTAF6073NN","exposure-analysis","Read-only firewall analysis and effective host exposure reconstruction for Docker published ports, UFW bypass, stale rules, CDN scope, IPv6 asymmetry and external probe allowlists.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fforensics\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[],[138,139,140,141,142,143,43,144,123,129,47,145,114,146,126,147,148,130,149,150],"analysis","exposure analysis","collection","reconstruction","operator","write","credentials","unknown","internet","local","scope","ports","ufw",{"skillNo":152,"name":108,"nameZh":17,"description":109,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":55},"01M70P8QATMPKA78E4FT5D2TNA","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[],[113,114,115,128,129,130,124,127,120,117,43,118,119,121,122,123,116,47,125,126],{"skillNo":157,"name":133,"nameZh":17,"description":134,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":55},"01M70NMPVJ5H0JH131P60FW4R8","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[],[138,139,150,149,142,148,147,126,141,143,43,144,123,140,47,145,114,130,129,146]]