[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C1ENS7M6102GZMDPYJ263A":3,"skill-same:01M6C1ENS7M6102GZMDPYJ263A":69},{"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":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":50,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6C1ENS7M6102GZMDPYJ263A","workspace-realign","工作区文档重组更新","Reorganize and update .aiwg\u002F documentation to reflect current project reality","重新组织并更新 .aiwg\u002F 文档，使其反映当前项目的实际情况。","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\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fworkspace-realign\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRFRAYBCBW9WKDY9TCSHY3","知识管理与沉淀","SCENARIO","使用场景",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",[31,32,33,34,35,36],"workspace","workspace realign","documentation","reflect","update","project","2026-11-10 10:12:30",false,"---\nnamespace: aiwg\nname: workspace-realign\nplatforms: [all]\ndescription: Reorganize and update .aiwg\u002F documentation to reflect current project reality\n---\n\n# Workspace Realign\n\nAnalyze and reorganize documentation in `.aiwg\u002F` to ensure it accurately reflects the current project state, plans, and reality. Uses git commit history to understand changes since documentation was last updated.\n\n## Parameters\n\n| Flag | Description |\n|------|-------------|\n| `project-directory` | Project root (default: `.`) |\n| `--archive-stale` | Move stale documents to `.aiwg\u002Farchive\u002F` instead of deleting |\n| `--delete-stale` | Delete stale documents (requires confirmation) |\n| `--dry-run` | Preview changes without modifying files |\n| `--since \u003Ccommit>` | Analyze changes since specific commit (default: last doc update) |\n| `--interactive` | Prompt for each decision |\n\n## Execution Steps\n\n### Step 1: Analyze Current State\n\nScan `.aiwg\u002F` directory structure:\n\n```bash\n# Count documents by category\nfind .aiwg -name \"*.md\" -type f | wc -l\n\n# Get last modification times\nfind .aiwg -name \"*.md\" -type f -exec stat -c '%Y %n' {} \\; | sort -rn\n```\n\nReport current state:\n```\nWorkspace Analysis\n==================\nTotal documents: 47\nCategories:\n  - requirements\u002F    12 docs\n  - architecture\u002F     8 docs\n  - planning\u002F         6 docs\n  - risks\u002F            4 docs\n  - testing\u002F          5 docs\n  - security\u002F         3 docs\n  - working\u002F          9 docs (temporary)\n```\n\n### Step 2: Identify Last Documentation Alignment\n\nFind when documentation was last synchronized with code:\n\n1. **Check for alignment marker:**\n   ```bash\n   cat .aiwg\u002F.last-alignment 2>\u002Fdev\u002Fnull\n   ```\n\n2. **Check git log for doc commits:**\n   ```bash\n   git log --oneline --since=\"30 days ago\" -- .aiwg\u002F\n   ```\n\n3. **Find most recent doc update:**\n   ```bash\n   git log -1 --format=\"%H %ci\" -- .aiwg\u002F\n   ```\n\nReport:\n```\nLast Alignment\n==============\nLast doc commit: abc1234 (2025-12-01)\nCurrent HEAD:    def5678\nCommits since:   23 commits\nDays since:      8 days\n```\n\n### Step 3: Analyze Code Changes Since Last Alignment\n\nCompare code changes vs documentation:\n\n```bash\n# Get changed files since last alignment\ngit diff --name-only \u003Clast-alignment-commit>..HEAD\n\n# Categorize changes\ngit diff --stat \u003Clast-alignment-commit>..HEAD\n```\n\n**Change Categories:**\n\n| Change Type | Doc Impact |\n|-------------|------------|\n| New features | Requires new requirements\u002Farch docs |\n| Refactoring | May invalidate architecture docs |\n| API changes | API docs need update |\n| Test changes | Test strategy may need update |\n| Security changes | Security docs may be stale |\n| Deleted code | Related docs may be obsolete |\n\nReport:\n```\nCode Changes Analysis\n=====================\nSince: abc1234 (2025-12-01)\n\nFeature Changes (5):\n  + src\u002Fauth\u002Foauth.ts (new)\n  + src\u002Fauth\u002Fjwt.ts (new)\n  ~ src\u002Fapi\u002Fendpoints.ts (modified)\n  ~ src\u002Fmodels\u002Fuser.ts (modified)\n  - src\u002Flegacy\u002Fold-auth.ts (deleted)\n\nImpacted Documentation:\n  - .aiwg\u002Frequirements\u002Fuser-stories.md (user auth stories)\n  - .aiwg\u002Farchitecture\u002Fapi-design.md (endpoint changes)\n  - .aiwg\u002Fsecurity\u002Fauth-strategy.md (new auth methods)\n  - .aiwg\u002Farchitecture\u002Flegacy-support.md (deleted code)\n```\n\n### Step 4: Identify Stale Documents\n\nDocuments are considered stale if:\n\n1. **References deleted code\u002Ffeatures:**\n   - Mentions files that no longer exist\n   - References APIs that were removed\n\n2. **Contradicts current implementation:**\n   - Architecture describes different structure\n   - Requirements don't match actual behavior\n\n3. **Outdated planning artifacts:**\n   - Completed iteration plans\n   - Resolved risk items\n   - Closed decision records\n\n4. **Superseded documents:**\n   - Earlier versions of refined docs\n   - Draft documents that became final\n\n**Stale Detection Heuristics:**\n\n```bash\n# Find docs referencing deleted files\nfor doc in .aiwg\u002F**\u002F*.md; do\n  # Extract file references from doc\n  grep -oE 'src\u002F[a-zA-Z0-9_\u002F.-]+' \"$doc\" | while read ref; do\n    [ ! -e \"$ref\" ] && echo \"STALE: $doc references missing $ref\"\n  done\ndone\n\n# Find docs with old terminology\ngrep -r \"deprecated_feature\" .aiwg\u002F\n\n# Find completed iteration plans\ngrep -l \"Status: Completed\" .aiwg\u002Fplanning\u002Fiteration-*.md\n```\n\nReport:\n```\nStale Document Analysis\n=======================\n\nDEFINITELY STALE (3):\n  .aiwg\u002Farchitecture\u002Flegacy-support.md\n    - References deleted: src\u002Flegacy\u002Fold-auth.ts\n    - Last updated: 45 days ago\n    Recommendation: ARCHIVE or DELETE\n\n  .aiwg\u002Fplanning\u002Fiteration-3-plan.md\n    - Status: Completed\n    - All items delivered\n    Recommendation: ARCHIVE\n\n  .aiwg\u002Frequirements\u002Ffeature-x-draft.md\n    - Superseded by: feature-x-final.md\n    Recommendation: DELETE\n\nPOSSIBLY STALE (2):\n  .aiwg\u002Farchitecture\u002Fapi-design.md\n    - References modified: src\u002Fapi\u002Fendpoints.ts\n    - May need update\n    Recommendation: REVIEW\n\n  .aiwg\u002Frisks\u002Fperformance-spike.md\n    - Linked PoC completed\n    - Risk may be retired\n    Recommendation: REVIEW\n```\n\n### Step 5: Identify Missing Documentation\n\nBased on code changes, identify gaps:\n\n```bash\n# New features without docs\nfor feature in $(git diff --name-only --diff-filter=A \u003Csince>..HEAD | grep -E '^src\u002F'); do\n  # Check if any doc references this file\n  grep -l \"$feature\" .aiwg\u002F**\u002F*.md 2>\u002Fdev\u002Fnull || echo \"UNDOCUMENTED: $feature\"\ndone\n```\n\nReport:\n```\nDocumentation Gaps\n==================\n\nNew Code Without Documentation:\n  src\u002Fauth\u002Foauth.ts\n    - No architecture doc\n    - No security review\n    Recommendation: Create .aiwg\u002Farchitecture\u002Foauth-integration.md\n\n  src\u002Fauth\u002Fjwt.ts\n    - No architecture doc\n    Recommendation: Add to .aiwg\u002Fsecurity\u002Fauth-strategy.md\n\nModified APIs Without Doc Updates:\n  src\u002Fapi\u002Fendpoints.ts (47 lines changed)\n    - .aiwg\u002Farchitecture\u002Fapi-design.md not updated since changes\n    Recommendation: Update API documentation\n```\n\n### Step 6: Generate Update Plan\n\nCreate prioritized action plan:\n\n```\nWorkspace Realignment Plan\n==========================\n\nIMMEDIATE ACTIONS (blocking accuracy):\n\n1. UPDATE: .aiwg\u002Farchitecture\u002Fapi-design.md\n   Reason: API endpoints changed significantly\n   Changes: Add new endpoints, remove deprecated ones\n\n2. UPDATE: .aiwg\u002Fsecurity\u002Fauth-strategy.md\n   Reason: New OAuth\u002FJWT implementation\n   Changes: Document new auth flows\n\n3. ARCHIVE: .aiwg\u002Farchitecture\u002Flegacy-support.md\n   Reason: Legacy code deleted\n   Target: .aiwg\u002Farchive\u002Farchitecture\u002F\n\n4. ARCHIVE: .aiwg\u002Fplanning\u002Fiteration-3-plan.md\n   Reason: Iteration completed\n   Target: .aiwg\u002Farchive\u002Fplanning\u002F\n\nRECOMMENDED ACTIONS (quality improvement):\n\n5. CREATE: .aiwg\u002Farchitecture\u002Foauth-integration.md\n   Reason: New feature without documentation\n\n6. REVIEW: .aiwg\u002Frisks\u002Fperformance-spike.md\n   Reason: May be resolved\n\n7. DELETE: .aiwg\u002Frequirements\u002Ffeature-x-draft.md\n   Reason: Superseded by final version\n```\n\n### Step 7: Execute Actions\n\n**If `--dry-run`:** Display plan and exit.\n\n**If `--interactive`:** Prompt for each action.\n\n**Otherwise:** Execute with specified flags.\n\n#### Archive Operations\n\n```bash\n# Create archive directories\nmkdir -p .aiwg\u002Farchive\u002F{requirements,architecture,planning,risks,testing,security}\n\n# Move with timestamp\nmv .aiwg\u002Farchitecture\u002Flegacy-support.md \\\n   .aiwg\u002Farchive\u002Farchitecture\u002Flegacy-support-20251209.md\n\n# Add archive index entry\necho \"| 2025-12-09 | legacy-support.md | Deleted legacy code | architecture\u002F |\" \\\n  >> .aiwg\u002Farchive\u002FINDEX.md\n```\n\n#### Delete Operations\n\n```bash\n# Only with --delete-stale and confirmation\nrm .aiwg\u002Frequirements\u002Ffeature-x-draft.md\n```\n\n#### Update Operations\n\nFor documents needing updates, launch appropriate agent:\n\n```\nLaunching documentation update agents...\n\nTask(technical-writer):\n  Target: .aiwg\u002Farchitecture\u002Fapi-design.md\n  Context: src\u002Fapi\u002Fendpoints.ts changes\n  Action: Update API documentation with new endpoints\n\nTask(security-architect):\n  Target: .aiwg\u002Fsecurity\u002Fauth-strategy.md\n  Context: src\u002Fauth\u002F new implementation\n  Action: Document OAuth\u002FJWT authentication flows\n```\n\n### Step 8: Record Alignment\n\nCreate alignment marker for future reference:\n\n```bash\n# Record current HEAD as aligned\necho \"$(git rev-parse HEAD) $(date -Iseconds)\" > .aiwg\u002F.last-alignment\n\n# Create alignment log entry\ncat >> .aiwg\u002F.alignment-log \u003C\u003CEOF\n---\ndate: $(date -Iseconds)\ncommit: $(git rev-parse HEAD)\nactions:\n  - archived: 2\n  - updated: 2\n  - created: 1\n  - deleted: 1\n  - reviewed: 1\nEOF\n```\n\n### Step 9: Report Summary\n\n```\nWorkspace Realignment Complete\n==============================\n\nActions Taken:\n  Archived:  2 documents\n  Updated:   2 documents (agents launched)\n  Created:   1 document (agent launched)\n  Deleted:   1 document\n  Reviewed:  1 document (marked for review)\n\nAlignment Recorded:\n  Commit: def5678\n  Time:   2025-12-09T10:23:45\n\nNext Steps:\n  - Review agent-generated updates\n  - Check .aiwg\u002Farchive\u002FINDEX.md for archived docs\n  - Address reviewed items in next session\n\nRun '\u002Fworkspace-realign --dry-run' periodically to check alignment.\n```\n\n## Examples\n\n```bash\n# Preview what would change\n\u002Fworkspace-realign --dry-run\n\n# Archive stale docs, don't delete\n\u002Fworkspace-realign --archive-stale\n\n# Interactive mode - decide each document\n\u002Fworkspace-realign --interactive\n\n# Check changes since specific commit\n\u002Fworkspace-realign --since abc1234\n\n# Full cleanup with deletions\n\u002Fworkspace-realign --archive-stale --delete-stale\n```\n\n## Error Handling\n\n| Condition | Action |\n|-----------|--------|\n| No .aiwg\u002F directory | Error: \"No .aiwg\u002F directory found. Initialize with \u002Fintake-wizard\" |\n| No git repository | Warning: \"Not a git repo. Skipping change analysis.\" |\n| No docs found | Info: \"No documentation to realign. Workspace is empty.\" |\n| Agent launch fails | Continue with next action, report failures at end |\n| Archive exists | Append timestamp suffix to avoid overwrite |\n\n## Related Commands\n\n- `\u002Fworkspace-prune-working` - Clean up .aiwg\u002Fworking\u002F directory\n- `\u002Fworkspace-reset` - Wipe .aiwg\u002F and start fresh\n- `\u002Fproject-status` - View current project state\n\n## References\n\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002FREADME.md — aiwg-utils addon overview\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Frules\u002Fhuman-authorization.md — Confirm before archiving or deleting stale documents\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Frules\u002Fresearch-before-decision.md — Analyze git history and doc state before generating update plan\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002FREADME.md — SDLC artifact structure used to assess documentation alignment\n","# Workspace Realign\n\nAnalyze and reorganize documentation in `.aiwg\u002F` to ensure it accurately reflects the current project state, plans, and reality. Uses git commit history to understand changes since documentation was last updated.\n\n## Parameters\n\n| Flag | Description |\n|------|-------------|\n| `project-directory` | Project root (default: `.`) |\n| `--archive-stale` | Move stale documents to `.aiwg\u002Farchive\u002F` instead of deleting |\n| `--delete-stale` | Delete stale documents (requires confirmation) |\n| `--dry-run` | Preview changes without modifying files |\n| `--since \u003Ccommit>` | Analyze changes since specific commit (default: last doc update) |\n| `--interactive` | Prompt for each decision |\n\n## Execution Steps\n\n### Step 1: Analyze Current State\n\nScan `.aiwg\u002F` directory structure:\n\n```bash\n# Count documents by category\nfind .aiwg -name \"*.md\" -type f | wc -l\n\n# Get last modification times\nfind .aiwg -name \"*.md\" -type f -exec stat -c '%Y %n' {} \\; | sort -rn\n```\n\nReport current state:\n```\nWorkspace Analysis\n==================\nTotal documents: 47\nCategories:\n  - requirements\u002F    12 docs\n  - architecture\u002F     8 docs\n  - planning\u002F         6 docs\n  - risks\u002F            4 docs\n  - testing\u002F          5 docs\n  - security\u002F         3 docs\n  - working\u002F          9 docs (temporary)\n```\n\n### Step 2: Identify Last Documentation Alignment\n\nFind when documentation was last synchronized with code:\n\n1. **Check for alignment marker:**\n   ```bash\n   cat .aiwg\u002F.last-alignment 2>\u002Fdev\u002Fnull\n   ```\n\n2. **Check git log for doc commits:**\n   ```bash\n   git log --oneline --since=\"30 days ago\" -- .aiwg\u002F\n   ```\n\n3. **Find most recent doc update:**\n   ```bash\n   git log -1 --format=\"%H %ci\" -- .aiwg\u002F\n   ```\n\nReport:\n```\nLast Alignment\n==============\nLast doc commit: abc1234 (2025-12-01)\nCurrent HEAD:    def5678\nCommits since:   23 commits\nDays since:      8 days\n```\n\n### Step 3: Analyze Code Changes Since Last Alignment\n\nCompare code changes vs documentation:\n\n```bash\n# Get changed files since last alignment\ngit diff --name-only \u003Clast-alignment-commit>..HEAD\n\n# Categorize changes\ngit diff --stat \u003Clast-alignment-commit>..HEAD\n```\n\n**Change Categories:**\n\n| Change Type | Doc Impact |\n|-------------|------------|\n| New features | Requires new requirements\u002Farch docs |\n| Refactoring | May invalidate architecture docs |\n| API changes | API docs need update |\n| Test changes | Test strategy may need update |\n| Security changes | Security docs may be stale |\n| Deleted code | Related docs may be obsolete |\n\nReport:\n```\nCode Changes Analysis\n=====================\nSince: abc1234 (2025-12-01)\n\nFeature Changes (5):\n  + src\u002Fauth\u002Foauth.ts (new)\n  + src\u002Fauth\u002Fjwt.ts (new)\n  ~ src\u002Fapi\u002Fendpoints.ts (modified)\n  ~ src\u002Fmodels\u002Fuser.ts (modified)\n  - src\u002Flegacy\u002Fold-auth.ts (deleted)\n\nImpacted Documentation:\n  - .aiwg\u002Frequirements\u002Fuser-stories.md (user auth stories)\n  - .aiwg\u002Farchitecture\u002Fapi-design.md (endpoint changes)\n  - .aiwg\u002Fsecurity\u002Fauth-strategy.md (new auth methods)\n  - .aiwg\u002Farchitecture\u002Flegacy-support.md (deleted code)\n```\n\n### Step 4: Identify Stale Documents\n\nDocuments are considered stale if:\n\n1. **References deleted code\u002Ffeatures:**\n   - Mentions files that no longer exist\n   - References APIs that were removed\n\n2. **Contradicts current implementation:**\n   - Architecture describes different structure\n   - Requirements don't match actual behavior\n\n3. **Outdated planning artifacts:**\n   - Completed iteration plans\n   - Resolved risk items\n   - Closed decision records\n\n4. **Superseded documents:**\n   - Earlier versions of refined docs\n   - Draft documents that became final\n\n**Stale Detection Heuristics:**\n\n```bash\n# Find docs referencing deleted files\nfor doc in .aiwg\u002F**\u002F*.md; do\n  # Extract file references from doc\n  grep -oE 'src\u002F[a-zA-Z0-9_\u002F.-]+' \"$doc\" | while read ref; do\n    [ ! -e \"$ref\" ] && echo \"STALE: $doc references missing $ref\"\n  done\ndone\n\n# Find docs with old terminology\ngrep -r \"deprecated_feature\" .aiwg\u002F\n\n# Find completed iteration plans\ngrep -l \"Status: Completed\" .aiwg\u002Fplanning\u002Fiteration-*.md\n```\n\nReport:\n```\nStale Document Analysis\n=======================\n\nDEFINITELY STALE (3):\n  .aiwg\u002Farchitecture\u002Flegacy-support.md\n    - References deleted: src\u002Flegacy\u002Fold-auth.ts\n    - Last updated: 45 days ago\n    Recommendation: ARCHIVE or DELETE\n\n  .aiwg\u002Fplanning\u002Fiteration-3-plan.md\n    - Status: Completed\n    - All items delivered\n    Recommendation: ARCHIVE\n\n  .aiwg\u002Frequirements\u002Ffeature-x-draft.md\n    - Superseded by: feature-x-final.md\n    Recommendation: DELETE\n\nPOSSIBLY STALE (2):\n  .aiwg\u002Farchitecture\u002Fapi-design.md\n    - References modified: src\u002Fapi\u002Fendpoints.ts\n    - May need update\n    Recommendation: REVIEW\n\n  .aiwg\u002Frisks\u002Fperformance-spike.md\n    - Linked PoC completed\n    - Risk may be retired\n    Recommendation: REVIEW\n```\n\n### Step 5: Identify Missing Documentation\n\nBased on code changes, identify gaps:\n\n```bash\n# New features without docs\nfor feature in $(git diff --name-only --diff-filter=A \u003Csince>..HEAD | grep -E '^src\u002F'); do\n  # Check if any doc references this file\n  grep -l \"$feature\" .aiwg\u002F**\u002F*.md 2>\u002Fdev\u002Fnull || echo \"UNDOCUMENTED: $feature\"\ndone\n```\n\nReport:\n```\nDocumentation Gaps\n==================\n\nNew Code Without Documentation:\n  src\u002Fauth\u002Foauth.ts\n    - No architecture doc\n    - No security review\n    Recommendation: Create .aiwg\u002Farchitecture\u002Foauth-integration.md\n\n  src\u002Fauth\u002Fjwt.ts\n    - No architecture doc\n    Recommendation: Add to .aiwg\u002Fsecurity\u002Fauth-strategy.md\n\nModified APIs Without Doc Updates:\n  src\u002Fapi\u002Fendpoints.ts (47 lines changed)\n    - .aiwg\u002Farchitecture\u002Fapi-design.md not updated since changes\n    Recommendation: Update API documentation\n```\n\n### Step 6: Generate Update Plan\n\nCreate prioritized action plan:\n\n```\nWorkspace Realignment Plan\n==========================\n\nIMMEDIATE ACTIONS (blocking accuracy):\n\n1. UPDATE: .aiwg\u002Farchitecture\u002Fapi-design.md\n   Reason: API endpoints changed significantly\n   Changes: Add new endpoints, remove deprecated ones\n\n2. UPDATE: .aiwg\u002Fsecurity\u002Fauth-strategy.md\n   Reason: New OAuth\u002FJWT implementation\n   Changes: Document new auth flows\n\n3. ARCHIVE: .aiwg\u002Farchitecture\u002Flegacy-support.md\n   Reason: Legacy code deleted\n   Target: .aiwg\u002Farchive\u002Farchitecture\u002F\n\n4. ARCHIVE: .aiwg\u002Fplanning\u002Fiteration-3-plan.md\n   Reason: Iteration completed\n   Target: .aiwg\u002Farchive\u002Fplanning\u002F\n\nRECOMMENDED ACTIONS (quality improvement):\n\n5. CREATE: .aiwg\u002Farchitecture\u002Foauth-integration.md\n   Reason: New feature without documentation\n\n6. REVIEW: .aiwg\u002Frisks\u002Fperformance-spike.md\n   Reason: May be resolved\n\n7. DELETE: .aiwg\u002Frequirements\u002Ffeature-x-draft.md\n   Reason: Superseded by final version\n```\n\n### Step 7: Execute Actions\n\n**If `--dry-run`:** Display plan and exit.\n\n**If `--interactive`:** Prompt for each action.\n\n**Otherwise:** Execute with specified flags.\n\n#### Archive Operations\n\n```bash\n# Create archive directories\nmkdir -p .aiwg\u002Farchive\u002F{requirements,architecture,planning,risks,testing,security}\n\n# Move with timestamp\nmv .aiwg\u002Farchitecture\u002Flegacy-support.md \\\n   .aiwg\u002Farchive\u002Farchitecture\u002Flegacy-support-20251209.md\n\n# Add archive index entry\necho \"| 2025-12-09 | legacy-support.md | Deleted legacy code | architecture\u002F |\" \\\n  >> .aiwg\u002Farchive\u002FINDEX.md\n```\n\n#### Delete Operations\n\n```bash\n# Only with --delete-stale and confirmation\nrm .aiwg\u002Frequirements\u002Ffeature-x-draft.md\n```\n\n#### Update Operations\n\nFor documents needing updates, launch appropriate agent:\n\n```\nLaunching documentation update agents...\n\nTask(technical-writer):\n  Target: .aiwg\u002Farchitecture\u002Fapi-design.md\n  Context: src\u002Fapi\u002Fendpoints.ts changes\n  Action: Update API documentation with new endpoints\n\nTask(security-architect):\n  Target: .aiwg\u002Fsecurity\u002Fauth-strategy.md\n  Context: src\u002Fauth\u002F new implementation\n  Action: Document OAuth\u002FJWT authentication flows\n```\n\n### Step 8: Record Alignment\n\nCreate alignment marker for future reference:\n\n```bash\n# Record current HEAD as aligned\necho \"$(git rev-parse HEAD) $(date -Iseconds)\" > .aiwg\u002F.last-alignment\n\n# Create alignment log entry\ncat >> .aiwg\u002F.alignment-log \u003C\u003CEOF\n---\ndate: $(date -Iseconds)\ncommit: $(git rev-parse HEAD)\nactions:\n  - archived: 2\n  - updated: 2\n  - created: 1\n  - deleted: 1\n  - reviewed: 1\nEOF\n```\n\n### Step 9: Report Summary\n\n```\nWorkspace Realignment Complete\n==============================\n\nActions Taken:\n  Archived:  2 documents\n  Updated:   2 documents (agents launched)\n  Created:   1 document (agent launched)\n  Deleted:   1 document\n  Reviewed:  1 document (marked for review)\n\nAlignment Recorded:\n  Commit: def5678\n  Time:   2025-12-09T10:23:45\n\nNext Steps:\n  - Review agent-generated updates\n  - Check .aiwg\u002Farchive\u002FINDEX.md for archived docs\n  - Address reviewed items in next session\n\nRun '\u002Fworkspace-realign --dry-run' periodically to check alignment.\n```\n\n## Examples\n\n```bash\n# Preview what would change\n\u002Fworkspace-realign --dry-run\n\n# Archive stale docs, don't delete\n\u002Fworkspace-realign --archive-stale\n\n# Interactive mode - decide each document\n\u002Fworkspace-realign --interactive\n\n# Check changes since specific commit\n\u002Fworkspace-realign --since abc1234\n\n# Full cleanup with deletions\n\u002Fworkspace-realign --archive-stale --delete-stale\n```\n\n## Error Handling\n\n| Condition | Action |\n|-----------|--------|\n| No .aiwg\u002F directory | Error: \"No .aiwg\u002F directory found. Initialize with \u002Fintake-wizard\" |\n| No git repository | Warning: \"Not a git repo. Skipping change analysis.\" |\n| No docs found | Info: \"No documentation to realign. Workspace is empty.\" |\n| Agent launch fails | Continue with next action, report failures at end |\n| Archive exists | Append timestamp suffix to avoid overwrite |\n\n## Related Commands\n\n- `\u002Fworkspace-prune-working` - Clean up .aiwg\u002Fworking\u002F directory\n- `\u002Fworkspace-reset` - Wipe .aiwg\u002F and start fresh\n- `\u002Fproject-status` - View current project state\n\n## References\n\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002FREADME.md — aiwg-utils addon overview\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Frules\u002Fhuman-authorization.md — Confirm before archiving or deleting stale documents\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Frules\u002Fresearch-before-decision.md — Analyze git history and doc state before generating update plan\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002FREADME.md — SDLC artifact structure used to assess documentation alignment\n",{"name":5,"namespace":42,"platforms":43,"description":7},"aiwg",[44],"all","main","6754967c344ccb087a8de06972f55a41067b291b","agentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fworkspace-realign",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":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add jmagly\u002Faiwg --skill workspace-realign",{"tool":61,"command":62},"bunx","bunx skills add jmagly\u002Faiwg --skill workspace-realign",{"tool":64,"command":65},"pnpm","pnpm dlx skills add jmagly\u002Faiwg --skill workspace-realign","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fworkspace-realign\u002FSKILL.md",true,[],[70,78,83,110,130,135],{"skillNo":71,"name":72,"nameZh":17,"description":73,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":77},"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":79,"name":72,"nameZh":17,"description":73,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":77},"01M78KSEZS9ZNNFESY9ANW22S0","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fplugin-search\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":17,"description":86,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":37},"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",[],[90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109],"hardening","host","host hardening","verification","secrets","read","request","remediation","recommendations","audit","plan","port","bind","Bash","access","only","retention","re","never","firewall",{"skillNo":111,"name":112,"nameZh":17,"description":113,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":37},"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",[],[117,118,119,120,121,122,95,123,101,108,103,124,91,125,105,126,127,109,128,129],"analysis","exposure analysis","collection","reconstruction","operator","write","credentials","unknown","internet","local","scope","ports","ufw",{"skillNo":131,"name":85,"nameZh":17,"description":86,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":37},"01M70P8QATMPKA78E4FT5D2TNA","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[],[90,91,92,107,108,109,102,106,98,94,95,96,97,99,100,101,93,103,104,105],{"skillNo":136,"name":112,"nameZh":17,"description":113,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":37},"01M70NMPVJ5H0JH131P60FW4R8","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[],[117,118,129,128,121,127,126,105,120,122,95,123,101,119,103,124,91,109,108,125]]