agileflow 2.77.0 → 2.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +6 -6
  2. package/package.json +6 -1
  3. package/scripts/agileflow-configure.js +174 -2
  4. package/scripts/agileflow-statusline.sh +171 -78
  5. package/scripts/agileflow-welcome.js +88 -64
  6. package/scripts/auto-self-improve.js +23 -45
  7. package/scripts/check-update.js +35 -42
  8. package/scripts/damage-control/bash-tool-damage-control.js +257 -0
  9. package/scripts/damage-control/edit-tool-damage-control.js +279 -0
  10. package/scripts/damage-control/patterns.yaml +227 -0
  11. package/scripts/damage-control/write-tool-damage-control.js +274 -0
  12. package/scripts/damage-control-bash.js +232 -0
  13. package/scripts/damage-control-edit.js +243 -0
  14. package/scripts/damage-control-write.js +243 -0
  15. package/scripts/obtain-context.js +22 -3
  16. package/scripts/ralph-loop.js +191 -63
  17. package/scripts/screenshot-verifier.js +213 -0
  18. package/scripts/session-manager.js +12 -33
  19. package/src/core/agents/accessibility.md +124 -53
  20. package/src/core/agents/adr-writer.md +192 -52
  21. package/src/core/agents/analytics.md +139 -60
  22. package/src/core/agents/api.md +173 -63
  23. package/src/core/agents/ci.md +139 -57
  24. package/src/core/agents/compliance.md +159 -68
  25. package/src/core/agents/configuration/damage-control.md +356 -0
  26. package/src/core/agents/configuration-damage-control.md +248 -0
  27. package/src/core/agents/database.md +162 -61
  28. package/src/core/agents/datamigration.md +179 -66
  29. package/src/core/agents/design.md +179 -57
  30. package/src/core/agents/devops.md +160 -3
  31. package/src/core/agents/documentation.md +204 -60
  32. package/src/core/agents/epic-planner.md +147 -55
  33. package/src/core/agents/integrations.md +197 -69
  34. package/src/core/agents/mentor.md +158 -57
  35. package/src/core/agents/mobile.md +159 -67
  36. package/src/core/agents/monitoring.md +154 -65
  37. package/src/core/agents/multi-expert.md +115 -43
  38. package/src/core/agents/orchestrator.md +77 -24
  39. package/src/core/agents/performance.md +130 -75
  40. package/src/core/agents/product.md +151 -55
  41. package/src/core/agents/qa.md +162 -74
  42. package/src/core/agents/readme-updater.md +178 -76
  43. package/src/core/agents/refactor.md +148 -95
  44. package/src/core/agents/research.md +143 -72
  45. package/src/core/agents/security.md +154 -65
  46. package/src/core/agents/testing.md +176 -97
  47. package/src/core/agents/ui.md +170 -79
  48. package/src/core/commands/adr/list.md +171 -0
  49. package/src/core/commands/adr/update.md +235 -0
  50. package/src/core/commands/adr/view.md +252 -0
  51. package/src/core/commands/adr.md +207 -50
  52. package/src/core/commands/agent.md +16 -0
  53. package/src/core/commands/assign.md +148 -44
  54. package/src/core/commands/auto.md +18 -1
  55. package/src/core/commands/babysit.md +391 -38
  56. package/src/core/commands/baseline.md +14 -0
  57. package/src/core/commands/blockers.md +170 -51
  58. package/src/core/commands/board.md +144 -66
  59. package/src/core/commands/changelog.md +15 -0
  60. package/src/core/commands/ci.md +179 -69
  61. package/src/core/commands/compress.md +18 -0
  62. package/src/core/commands/configure.md +16 -0
  63. package/src/core/commands/context/export.md +193 -4
  64. package/src/core/commands/context/full.md +191 -18
  65. package/src/core/commands/context/note.md +248 -4
  66. package/src/core/commands/debt.md +17 -0
  67. package/src/core/commands/deploy.md +208 -65
  68. package/src/core/commands/deps.md +15 -0
  69. package/src/core/commands/diagnose.md +16 -0
  70. package/src/core/commands/docs.md +196 -64
  71. package/src/core/commands/epic/list.md +170 -0
  72. package/src/core/commands/epic/view.md +242 -0
  73. package/src/core/commands/epic.md +192 -69
  74. package/src/core/commands/feedback.md +191 -71
  75. package/src/core/commands/handoff.md +162 -48
  76. package/src/core/commands/help.md +9 -0
  77. package/src/core/commands/ideate.md +446 -0
  78. package/src/core/commands/impact.md +16 -0
  79. package/src/core/commands/metrics.md +141 -37
  80. package/src/core/commands/multi-expert.md +77 -0
  81. package/src/core/commands/packages.md +16 -0
  82. package/src/core/commands/pr.md +161 -67
  83. package/src/core/commands/readme-sync.md +16 -0
  84. package/src/core/commands/research/analyze.md +568 -0
  85. package/src/core/commands/research/ask.md +345 -20
  86. package/src/core/commands/research/import.md +562 -19
  87. package/src/core/commands/research/list.md +173 -5
  88. package/src/core/commands/research/view.md +181 -8
  89. package/src/core/commands/retro.md +135 -48
  90. package/src/core/commands/review.md +219 -47
  91. package/src/core/commands/session/end.md +209 -0
  92. package/src/core/commands/session/history.md +210 -0
  93. package/src/core/commands/session/init.md +116 -0
  94. package/src/core/commands/session/new.md +296 -0
  95. package/src/core/commands/session/resume.md +166 -0
  96. package/src/core/commands/session/status.md +166 -0
  97. package/src/core/commands/setup/visual-e2e.md +462 -0
  98. package/src/core/commands/skill/create.md +115 -17
  99. package/src/core/commands/skill/delete.md +117 -0
  100. package/src/core/commands/skill/edit.md +104 -0
  101. package/src/core/commands/skill/list.md +128 -0
  102. package/src/core/commands/skill/test.md +135 -0
  103. package/src/core/commands/skill/upgrade.md +542 -0
  104. package/src/core/commands/sprint.md +17 -1
  105. package/src/core/commands/status.md +133 -21
  106. package/src/core/commands/story/list.md +176 -0
  107. package/src/core/commands/story/view.md +265 -0
  108. package/src/core/commands/story-validate.md +101 -1
  109. package/src/core/commands/story.md +204 -51
  110. package/src/core/commands/template.md +16 -1
  111. package/src/core/commands/tests.md +226 -64
  112. package/src/core/commands/update.md +17 -1
  113. package/src/core/commands/validate-expertise.md +16 -0
  114. package/src/core/commands/velocity.md +140 -36
  115. package/src/core/commands/verify.md +14 -0
  116. package/src/core/commands/whats-new.md +30 -0
  117. package/src/core/skills/_learnings/README.md +91 -0
  118. package/src/core/skills/_learnings/_template.yaml +106 -0
  119. package/src/core/skills/_learnings/code-review.yaml +118 -0
  120. package/src/core/skills/_learnings/commit.yaml +69 -0
  121. package/src/core/skills/_learnings/story-writer.yaml +71 -0
  122. package/src/core/templates/damage-control-patterns.yaml +234 -0
  123. package/src/core/templates/skill-template.md +53 -11
  124. package/tools/cli/commands/start.js +180 -0
  125. package/tools/cli/installers/ide/claude-code.js +127 -0
  126. package/tools/cli/tui/Dashboard.js +66 -0
  127. package/tools/cli/tui/StoryList.js +69 -0
  128. package/tools/cli/tui/index.js +16 -0
@@ -0,0 +1,91 @@
1
+ # Skill Learnings
2
+
3
+ This directory contains learnings files for self-improving skills. Each skill can have a corresponding `.yaml` file that stores user preferences and corrections learned over time.
4
+
5
+ ## Purpose
6
+
7
+ Just like agents have `expertise.yaml` files that accumulate codebase knowledge, skills have learnings files that accumulate **user preferences**.
8
+
9
+ | Component | Agents | Skills |
10
+ |-----------|--------|--------|
11
+ | **What they learn** | Codebase knowledge | User preferences |
12
+ | **Learning file** | `expertise.yaml` | `learnings.yaml` |
13
+ | **Example learning** | "sessions table uses UUID primary keys" | "User prefers conventional commits" |
14
+
15
+ ## How It Works
16
+
17
+ 1. **On skill invocation**: Skill reads its learnings file (if exists)
18
+ 2. **Apply preferences**: Skill output follows learned preferences
19
+ 3. **On correction**: Skill extracts signal and updates learnings file
20
+ 4. **Persist**: Changes saved for next session
21
+
22
+ ```
23
+ ┌─────────────────────────────────────────────────────────────┐
24
+ │ Skill Execution Flow │
25
+ ├─────────────────────────────────────────────────────────────┤
26
+ │ │
27
+ │ 1. Read _learnings/{skill}.yaml │
28
+ │ 2. Execute skill with learned preferences │
29
+ │ 3. User provides output │
30
+ │ 4. If correction detected: │
31
+ │ - Extract signal (what was wrong) │
32
+ │ - Determine confidence (high/medium/low) │
33
+ │ - Update learnings file │
34
+ │ 5. Continue with corrected output │
35
+ │ │
36
+ └─────────────────────────────────────────────────────────────┘
37
+ ```
38
+
39
+ ## File Naming
40
+
41
+ Learnings files are named after their skill:
42
+
43
+ | Skill | Learnings File |
44
+ |-------|----------------|
45
+ | `commit-message-formatter` | `commit.yaml` |
46
+ | `agileflow-story-writer` | `story-writer.yaml` |
47
+ | `code-review` | `code-review.yaml` |
48
+
49
+ ## Schema
50
+
51
+ See `_template.yaml` for the full schema. Key sections:
52
+
53
+ ```yaml
54
+ skill: commit-message-formatter
55
+ version: 1
56
+ last_updated: 2026-01-06
57
+
58
+ preferences:
59
+ - signal: "User said 'no AI attribution'"
60
+ learning: "Never add AI footers"
61
+ confidence: high
62
+ captured: 2026-01-06
63
+
64
+ conventions:
65
+ - "Use imperative mood"
66
+ - "Keep subject under 50 chars"
67
+
68
+ anti_patterns:
69
+ - "Don't add emojis"
70
+ ```
71
+
72
+ ## Confidence Levels
73
+
74
+ | Level | Trigger | Example |
75
+ |-------|---------|---------|
76
+ | **high** | Explicit correction ("never do X", "always do Y") | "Never include AI footers" |
77
+ | **medium** | Approval or pattern that worked | "User approved conventional commit format" |
78
+ | **low** | Observation to review | "User seemed to prefer shorter messages" |
79
+
80
+ ## Version Control
81
+
82
+ Learnings files are version-controlled in git. This allows:
83
+ - **History**: See how preferences evolved over time
84
+ - **Rollback**: Revert if learning was incorrect
85
+ - **Sharing**: Team can share learned preferences
86
+
87
+ ## Related
88
+
89
+ - [Agent Expert System](../../agents/experts/README.md) - Same pattern for agents
90
+ - [20260106-self-improving-skills-claude-code.md](../../../../../../../docs/10-research/20260106-self-improving-skills-claude-code.md) - Research
91
+ - [20251216-agent-experts-self-improving-agents.md](../../../../../../../docs/10-research/20251216-agent-experts-self-improving-agents.md) - Original pattern
@@ -0,0 +1,106 @@
1
+ # Skill Learnings Template
2
+ # Copy this file and rename to match your skill (e.g., commit.yaml)
3
+ #
4
+ # This file stores learned user preferences for a skill.
5
+ # It mirrors the expertise.yaml pattern used by agent experts.
6
+
7
+ # Skill identifier (matches the skill filename without extension)
8
+ skill: skill-name
9
+
10
+ # Schema version for migrations
11
+ version: 1
12
+
13
+ # Last time this file was updated
14
+ last_updated: 2026-01-06T00:00:00.000Z
15
+
16
+ # =============================================================================
17
+ # PREFERENCES
18
+ # =============================================================================
19
+ # Explicit preferences learned from user corrections.
20
+ # Each entry captures: what triggered the learning, what was learned, and confidence.
21
+
22
+ preferences:
23
+ # Example: High confidence from explicit correction
24
+ # - signal: "User said 'no AI attribution in commits'"
25
+ # learning: "Never add AI footers or Co-Authored-By lines"
26
+ # confidence: high
27
+ # captured: 2026-01-06T10:30:00.000Z
28
+
29
+ # Example: Medium confidence from approval
30
+ # - signal: "User approved 'feat(api): add user endpoint'"
31
+ # learning: "Use conventional commits with scope in parentheses"
32
+ # confidence: medium
33
+ # captured: 2026-01-06T11:00:00.000Z
34
+
35
+ # Example: Low confidence from observation
36
+ # - signal: "User shortened message from 60 to 45 chars"
37
+ # learning: "User may prefer shorter commit messages"
38
+ # confidence: low
39
+ # captured: 2026-01-06T11:30:00.000Z
40
+
41
+ # =============================================================================
42
+ # CONVENTIONS
43
+ # =============================================================================
44
+ # Established patterns this skill should always follow.
45
+ # These are high-confidence learnings that have been validated.
46
+
47
+ conventions:
48
+ # - "Use imperative mood in commit subject"
49
+ # - "Keep subject line under 50 characters"
50
+ # - "Separate subject from body with blank line"
51
+
52
+ # =============================================================================
53
+ # ANTI-PATTERNS
54
+ # =============================================================================
55
+ # Things this skill should never do.
56
+ # These are typically from explicit "never do X" corrections.
57
+
58
+ anti_patterns:
59
+ # - "Don't add emojis unless user explicitly requests"
60
+ # - "Don't use past tense in commit messages"
61
+ # - "Don't include issue numbers without prefix"
62
+
63
+ # =============================================================================
64
+ # CONTEXT
65
+ # =============================================================================
66
+ # Project-specific context the skill has learned.
67
+ # This helps the skill understand the environment it's operating in.
68
+
69
+ context:
70
+ # project_type: nodejs
71
+ # primary_language: typescript
72
+ # framework: next.js
73
+ # style_guide: conventional-commits
74
+
75
+ # =============================================================================
76
+ # EXAMPLES
77
+ # =============================================================================
78
+ # Good examples the skill has learned from.
79
+ # Can be referenced when generating new output.
80
+
81
+ examples:
82
+ # good:
83
+ # - "feat(auth): add OAuth2 login flow"
84
+ # - "fix(api): handle null response from external service"
85
+ #
86
+ # bad:
87
+ # - "Added stuff" # Too vague
88
+ # - "fixed bug" # No scope, past tense
89
+
90
+ # =============================================================================
91
+ # METADATA
92
+ # =============================================================================
93
+ # Tracking information for the learnings file.
94
+
95
+ metadata:
96
+ # Total number of corrections captured
97
+ corrections_count: 0
98
+
99
+ # Total number of approvals captured
100
+ approvals_count: 0
101
+
102
+ # When the file was first created
103
+ created: 2026-01-06T00:00:00.000Z
104
+
105
+ # Sessions that contributed to learnings
106
+ sessions: []
@@ -0,0 +1,118 @@
1
+ # Learnings for agileflow-code-review skill
2
+ # This file accumulates user preferences for code review criteria.
3
+
4
+ skill: code-review
5
+ version: 1
6
+ last_updated: 2026-01-09T00:00:00.000Z
7
+
8
+ # =============================================================================
9
+ # PREFERENCES
10
+ # =============================================================================
11
+ preferences:
12
+ # Initial preferences from project conventions
13
+ - signal: "Project code review standards"
14
+ learning: "Use 6-category analysis with severity-based prioritization"
15
+ confidence: high
16
+ captured: 2026-01-09T00:00:00.000Z
17
+
18
+ # =============================================================================
19
+ # CONVENTIONS
20
+ # =============================================================================
21
+ conventions:
22
+ - "Be constructive, not critical - frame feedback helpfully"
23
+ - "Always show BAD and GOOD code examples"
24
+ - "Include Positive Observations section"
25
+ - "Calculate code quality score (0-100)"
26
+ - "Never auto-fix without explicit approval"
27
+ - "Save report to docs/08-project/code-reviews/"
28
+
29
+ # =============================================================================
30
+ # ANTI-PATTERNS
31
+ # =============================================================================
32
+ anti_patterns:
33
+ - "Don't use harsh language or blame developers"
34
+ - "Don't only show bad examples - show fixes too"
35
+ - "Don't auto-commit fixes without approval"
36
+ - "Don't treat MEDIUM issues as CRITICAL"
37
+ - "Don't skip the Positive Observations section"
38
+
39
+ # =============================================================================
40
+ # SEVERITY_THRESHOLDS
41
+ # =============================================================================
42
+ # Custom severity mappings learned from user feedback
43
+ severity_thresholds:
44
+ # Default thresholds (can be overridden by learnings)
45
+ cyclomatic_complexity:
46
+ acceptable: 10
47
+ warning: 15
48
+ critical: 20
49
+
50
+ function_length:
51
+ acceptable: 50
52
+ warning: 100
53
+ critical: 150
54
+
55
+ file_length:
56
+ acceptable: 500
57
+ warning: 1000
58
+ critical: 1500
59
+
60
+ test_coverage:
61
+ acceptable: 80
62
+ warning: 60
63
+ critical: 40
64
+
65
+ # =============================================================================
66
+ # CUSTOM_RULES
67
+ # =============================================================================
68
+ # Project-specific rules learned from corrections
69
+ custom_rules:
70
+ # Example: rules that would be learned from corrections
71
+ # - pattern: "console.log"
72
+ # severity: "HIGH"
73
+ # reason: "No console.log in production code"
74
+ # confidence: high
75
+ # captured: 2026-01-09T00:00:00.000Z
76
+
77
+ # =============================================================================
78
+ # FOCUS_AREAS
79
+ # =============================================================================
80
+ # Weighted focus areas (higher = more important)
81
+ focus_areas:
82
+ security: 1.5
83
+ performance: 1.2
84
+ code_quality: 1.0
85
+ best_practices: 1.0
86
+ testing: 1.2
87
+ documentation: 0.8
88
+
89
+ # =============================================================================
90
+ # CONTEXT
91
+ # =============================================================================
92
+ context:
93
+ report_location: docs/08-project/code-reviews/
94
+ score_threshold_block: 60
95
+ score_threshold_warn: 80
96
+
97
+ # =============================================================================
98
+ # EXAMPLES
99
+ # =============================================================================
100
+ examples:
101
+ good_feedback:
102
+ - "This could be improved by using parameterized queries to prevent SQL injection"
103
+ - "Consider extracting this into a helper function for reusability"
104
+ - "Good use of TypeScript strict mode"
105
+
106
+ bad_feedback:
107
+ - "This code is terrible"
108
+ - "Wrong"
109
+ - "Fix this"
110
+
111
+ # =============================================================================
112
+ # METADATA
113
+ # =============================================================================
114
+ metadata:
115
+ corrections_count: 0
116
+ approvals_count: 0
117
+ created: 2026-01-09T00:00:00.000Z
118
+ sessions: []
@@ -0,0 +1,69 @@
1
+ # Learnings for commit-message-formatter skill
2
+ # This file accumulates user preferences for commit message generation.
3
+
4
+ skill: commit-message-formatter
5
+ version: 1
6
+ last_updated: 2026-01-06T00:00:00.000Z
7
+
8
+ # =============================================================================
9
+ # PREFERENCES
10
+ # =============================================================================
11
+ preferences:
12
+ # From CLAUDE.md project settings
13
+ - signal: "Project CLAUDE.md specifies no AI attribution"
14
+ learning: "Never add AI footers, Co-Authored-By, or robot emojis to commits"
15
+ confidence: high
16
+ captured: 2026-01-06T00:00:00.000Z
17
+
18
+ # =============================================================================
19
+ # CONVENTIONS
20
+ # =============================================================================
21
+ conventions:
22
+ - "Use conventional commits format (feat/fix/chore/docs/refactor/test/style)"
23
+ - "Include scope in parentheses when applicable"
24
+ - "Use imperative mood in subject line"
25
+ - "Keep subject under 50 characters"
26
+ - "Separate subject from body with blank line"
27
+ - "Wrap body at 72 characters"
28
+
29
+ # =============================================================================
30
+ # ANTI-PATTERNS
31
+ # =============================================================================
32
+ anti_patterns:
33
+ - "Don't add AI attribution (footers, Co-Authored-By, emojis)"
34
+ - "Don't use past tense (use 'add' not 'added')"
35
+ - "Don't use vague messages ('fix stuff', 'update code')"
36
+ - "Don't include emojis unless explicitly requested"
37
+
38
+ # =============================================================================
39
+ # CONTEXT
40
+ # =============================================================================
41
+ context:
42
+ style_guide: conventional-commits
43
+ attribution: none
44
+
45
+ # =============================================================================
46
+ # EXAMPLES
47
+ # =============================================================================
48
+ examples:
49
+ good:
50
+ - "feat(auth): add OAuth2 login flow"
51
+ - "fix(api): handle null response from external service"
52
+ - "chore: update dependencies to latest versions"
53
+ - "docs: add API endpoint documentation"
54
+ - "refactor(db): extract query builder to separate module"
55
+
56
+ bad:
57
+ - "Added stuff"
58
+ - "fixed bug"
59
+ - "WIP"
60
+ - "feat: add feature 🚀"
61
+
62
+ # =============================================================================
63
+ # METADATA
64
+ # =============================================================================
65
+ metadata:
66
+ corrections_count: 0
67
+ approvals_count: 0
68
+ created: 2026-01-06T00:00:00.000Z
69
+ sessions: []
@@ -0,0 +1,71 @@
1
+ # Learnings for agileflow-story-writer skill
2
+ # This file accumulates user preferences for user story formatting.
3
+
4
+ skill: story-writer
5
+ version: 1
6
+ last_updated: 2026-01-09T00:00:00.000Z
7
+
8
+ # =============================================================================
9
+ # PREFERENCES
10
+ # =============================================================================
11
+ preferences:
12
+ # Initial preferences from project conventions
13
+ - signal: "Project uses AgileFlow story template"
14
+ learning: "Use standard AgileFlow user story format with frontmatter"
15
+ confidence: high
16
+ captured: 2026-01-09T00:00:00.000Z
17
+
18
+ # =============================================================================
19
+ # CONVENTIONS
20
+ # =============================================================================
21
+ conventions:
22
+ - "Use 'As a [role], I want [action], So that [benefit]' format"
23
+ - "Include 2-5 acceptance criteria with Given/When/Then"
24
+ - "Use P0/P1/P2/P3 priority levels"
25
+ - "Use Fibonacci estimation (1,2,3,5,8,13)"
26
+ - "Assign owner based on work type (AG-UI, AG-API, AG-CI, AG-DEVOPS)"
27
+ - "Include Technical Notes section for implementation guidance"
28
+ - "Include Definition of Done checklist"
29
+ - "File naming: US-####-descriptive-name.md"
30
+
31
+ # =============================================================================
32
+ # ANTI-PATTERNS
33
+ # =============================================================================
34
+ anti_patterns:
35
+ - "Don't create stories > 13 points (split into multiple)"
36
+ - "Don't skip acceptance criteria"
37
+ - "Don't use vague descriptions ('implement feature')"
38
+ - "Don't forget to update status.json"
39
+ - "Don't skip the diff-first/YES-NO pattern"
40
+
41
+ # =============================================================================
42
+ # CONTEXT
43
+ # =============================================================================
44
+ context:
45
+ story_location: docs/06-stories/
46
+ status_file: docs/09-agents/status.json
47
+ test_stub_location: docs/07-testing/test-cases/
48
+ index_file: docs/06-stories/README.md
49
+
50
+ # =============================================================================
51
+ # EXAMPLES
52
+ # =============================================================================
53
+ examples:
54
+ good:
55
+ - "US-0042: User Login Form (clear, specific, testable)"
56
+ - "US-0015: Add pagination to user list (scoped, estimable)"
57
+ - "US-0023: Database connection pooling (technical, well-defined)"
58
+
59
+ bad:
60
+ - "US-0099: Implement stuff (vague)"
61
+ - "US-0100: Fix all bugs (not specific)"
62
+ - "US-0101: Make it work better (no acceptance criteria)"
63
+
64
+ # =============================================================================
65
+ # METADATA
66
+ # =============================================================================
67
+ metadata:
68
+ corrections_count: 0
69
+ approvals_count: 0
70
+ created: 2026-01-09T00:00:00.000Z
71
+ sessions: []
@@ -0,0 +1,234 @@
1
+ # AgileFlow Damage Control - Security Rules
2
+ # Protects your codebase from destructive agent commands
3
+ #
4
+ # Configuration: /agileflow:configure → Damage Control
5
+ # Documentation: See research/20260106-claude-code-damage-control-hooks.md
6
+ #
7
+ # Schema Version: 1.0.0
8
+
9
+ version: "1.0.0"
10
+
11
+ # =====================================================
12
+ # BLOCKED BASH COMMANDS - Always blocked (exit code 2)
13
+ # =====================================================
14
+ # Regex patterns matched against the full bash command
15
+ # These commands are considered too dangerous to ever run
16
+
17
+ bashToolPatterns:
18
+ # ─── File System Destruction ───
19
+ - pattern: '\brm\s+(-[rRf]+\s+)*/'
20
+ reason: "rm with absolute path - could delete system files"
21
+
22
+ - pattern: '\brm\s+-[rRf]*\s+\.\.'
23
+ reason: "rm with parent directory - could escape project"
24
+
25
+ - pattern: '\brm\s+-rf\s+'
26
+ reason: "Recursive force delete - extremely dangerous"
27
+
28
+ - pattern: '\brmdir\s+(-p\s+)*/'
29
+ reason: "rmdir with absolute path"
30
+
31
+ # ─── Git Destructive Operations ───
32
+ - pattern: '\bgit\s+push\s+.*--force'
33
+ reason: "Force push can destroy remote history"
34
+
35
+ - pattern: '\bgit\s+push\s+.*-f\b'
36
+ reason: "Force push can destroy remote history"
37
+
38
+ - pattern: '\bgit\s+reset\s+--hard'
39
+ reason: "Hard reset discards uncommitted changes"
40
+
41
+ - pattern: '\bgit\s+clean\s+-fd'
42
+ reason: "Git clean with force deletes untracked files"
43
+
44
+ - pattern: '\bgit\s+branch\s+-D'
45
+ reason: "Force delete branch without merge check"
46
+
47
+ # ─── Database Destructive Operations ───
48
+ - pattern: 'DROP\s+(TABLE|DATABASE|INDEX|VIEW|SCHEMA)'
49
+ reason: "DROP commands are destructive"
50
+ flags: "i"
51
+
52
+ - pattern: 'TRUNCATE\s+TABLE'
53
+ reason: "TRUNCATE removes all data without logging"
54
+ flags: "i"
55
+
56
+ - pattern: 'DELETE\s+FROM\s+\w+\s*;'
57
+ reason: "DELETE without WHERE clause deletes all rows"
58
+ flags: "i"
59
+
60
+ # ─── System Modification ───
61
+ - pattern: '\bsudo\s+'
62
+ reason: "Sudo commands require manual execution"
63
+
64
+ - pattern: '\bchmod\s+777'
65
+ reason: "World-writable permissions are dangerous"
66
+
67
+ - pattern: '\bchown\s+-R'
68
+ reason: "Recursive ownership change"
69
+
70
+ - pattern: '\bchmod\s+-R'
71
+ reason: "Recursive permission change"
72
+
73
+ # ─── Disk Operations ───
74
+ - pattern: '\bdd\s+if='
75
+ reason: "dd can overwrite disks"
76
+
77
+ - pattern: '\bmkfs\.'
78
+ reason: "Filesystem creation"
79
+
80
+ - pattern: '\bfdisk\b'
81
+ reason: "Disk partitioning"
82
+
83
+ # ─── Process Control ───
84
+ - pattern: '\bkill\s+-9'
85
+ reason: "Force kill processes"
86
+
87
+ - pattern: '\bkillall\b'
88
+ reason: "Kill all matching processes"
89
+
90
+ - pattern: '\bpkill\s+-9'
91
+ reason: "Force kill by pattern"
92
+
93
+ # ─── Network/System ───
94
+ - pattern: '\biptables\s+'
95
+ reason: "Firewall modification"
96
+
97
+ - pattern: '\bsystemctl\s+(stop|disable|mask)'
98
+ reason: "System service modification"
99
+
100
+ # ─── Credential Exposure ───
101
+ - pattern: '\bcat\s+.*\.pem'
102
+ reason: "Displaying private keys"
103
+
104
+ - pattern: '\bcat\s+.*id_rsa'
105
+ reason: "Displaying SSH private keys"
106
+
107
+ # =====================================================
108
+ # ASK PATTERNS - Require user confirmation
109
+ # =====================================================
110
+ # Risky but sometimes valid - ask first before executing
111
+
112
+ askPatterns:
113
+ - pattern: 'DELETE\s+FROM\s+\w+\s+WHERE'
114
+ reason: "Deleting specific records - please confirm"
115
+ flags: "i"
116
+
117
+ - pattern: '\bnpm\s+publish'
118
+ reason: "Publishing to npm - please confirm"
119
+
120
+ - pattern: '\bgit\s+push\s+origin\s+(main|master)'
121
+ reason: "Pushing to main branch - please confirm"
122
+
123
+ - pattern: '\brm\s+-[rRf]*\s+node_modules'
124
+ reason: "Removing node_modules - please confirm"
125
+
126
+ - pattern: '\baws\s+.*delete'
127
+ reason: "AWS delete operation - please confirm"
128
+ flags: "i"
129
+
130
+ - pattern: '\bgcloud\s+.*delete'
131
+ reason: "GCloud delete operation - please confirm"
132
+ flags: "i"
133
+
134
+ - pattern: '\baz\s+.*delete'
135
+ reason: "Azure delete operation - please confirm"
136
+ flags: "i"
137
+
138
+ - pattern: '\bnpx\s+.*--force'
139
+ reason: "Force npx operation - please confirm"
140
+
141
+ - pattern: 'UPDATE\s+\w+\s+SET.*WHERE'
142
+ reason: "Database update - please confirm"
143
+ flags: "i"
144
+
145
+ # =====================================================
146
+ # PATH PROTECTION - File/directory access controls
147
+ # =====================================================
148
+
149
+ # Zero access - cannot read, write, edit, or delete
150
+ # These paths are completely off-limits
151
+ zeroAccessPaths:
152
+ - "~/.ssh/"
153
+ - "~/.aws/"
154
+ - "~/.gnupg/"
155
+ - "~/.config/gh/"
156
+ - ".env.production"
157
+ - ".env.local"
158
+ - ".env.secrets"
159
+ - "credentials.json"
160
+ - "secrets.yaml"
161
+ - "secrets.json"
162
+ - "*.pem"
163
+ - "*.key"
164
+ - "id_rsa"
165
+ - "id_ed25519"
166
+
167
+ # Read-only - can read but not modify
168
+ # Safe to view, but changes should be manual
169
+ readOnlyPaths:
170
+ - "~/.bashrc"
171
+ - "~/.zshrc"
172
+ - "~/.gitconfig"
173
+ - "/etc/"
174
+ - "package-lock.json"
175
+ - "yarn.lock"
176
+ - "pnpm-lock.yaml"
177
+
178
+ # No delete - can read and modify but not delete
179
+ # Important files that shouldn't be removed
180
+ noDeletePaths:
181
+ - ".claude/"
182
+ - ".agileflow/"
183
+ - "docs/09-agents/status.json"
184
+ - ".git/"
185
+ - "CLAUDE.md"
186
+ - "README.md"
187
+ - "package.json"
188
+ - "tsconfig.json"
189
+
190
+ # =====================================================
191
+ # AGILEFLOW-SPECIFIC PROTECTIONS
192
+ # =====================================================
193
+ # Additional rules specific to AgileFlow projects
194
+
195
+ agileflowProtections:
196
+ - pattern: '\brm\s+.*status\.json'
197
+ reason: "status.json tracks story progress - protected"
198
+
199
+ - pattern: '\brm\s+.*\.claude/'
200
+ reason: "Claude Code configuration - protected"
201
+
202
+ - pattern: '\brm\s+.*\.agileflow/'
203
+ reason: "AgileFlow installation - protected"
204
+
205
+ - pattern: '\brm\s+.*session-state\.json'
206
+ reason: "Session state tracking - protected"
207
+
208
+ - pattern: '\brm\s+.*expertise\.yaml'
209
+ reason: "Agent expertise files - protected"
210
+
211
+ # =====================================================
212
+ # NOTES
213
+ # =====================================================
214
+ #
215
+ # Exit Codes:
216
+ # 0 = Allow command to proceed
217
+ # 2 = Block command (show error message)
218
+ #
219
+ # Ask Pattern JSON Output:
220
+ # { "result": "ask", "message": "Confirm this action?" }
221
+ #
222
+ # Flags:
223
+ # "i" = case-insensitive matching
224
+ #
225
+ # Customization:
226
+ # Add project-specific patterns below this line
227
+ # Run /agileflow:configure → Damage Control to reconfigure
228
+ #
229
+ # =====================================================
230
+
231
+ # ─── Project-Specific Patterns (add yours below) ───
232
+ # customPatterns:
233
+ # - pattern: 'your-pattern-here'
234
+ # reason: "Your reason"