agentic-sdlc 1.5.1 → 1.8.1

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 (149) hide show
  1. package/.agent/rules/agent-execution.md +55 -0
  2. package/.agent/rules/ai-enforcement.md +4 -3
  3. package/.agent/rules/artifacts.md +79 -77
  4. package/.agent/rules/auto-learning.md +78 -0
  5. package/.agent/rules/code-quality.md +40 -0
  6. package/.agent/rules/git-workflow.md +44 -24
  7. package/.agent/rules/global.md +10 -6
  8. package/.agent/rules/naming-conventions.md +55 -0
  9. package/.agent/skills/role-ba.md +6 -2
  10. package/.agent/skills/role-brain.md +5 -1
  11. package/.agent/skills/role-cloud.md +38 -0
  12. package/.agent/skills/role-dev.md +31 -5
  13. package/.agent/skills/role-devops.md +9 -0
  14. package/.agent/skills/role-game.md +35 -0
  15. package/.agent/skills/role-mobile.md +55 -0
  16. package/.agent/skills/role-orchestrator.md +4 -0
  17. package/.agent/skills/role-pm.md +4 -0
  18. package/.agent/skills/role-po.md +4 -0
  19. package/.agent/skills/role-reporter.md +4 -0
  20. package/.agent/skills/role-research.md +78 -0
  21. package/.agent/skills/role-sa.md +4 -0
  22. package/.agent/skills/role-seca.md +4 -0
  23. package/.agent/skills/role-stakeholder.md +4 -0
  24. package/.agent/skills/role-tester.md +15 -3
  25. package/.agent/skills/role-uiux.md +4 -0
  26. package/.agent/templates/CHANGELOG-Template.md +2 -2
  27. package/.agent/templates/Design-Verification-Report-Template.md +4 -4
  28. package/.agent/templates/DevOps-Plan-Template.md +7 -0
  29. package/.agent/templates/Specification-Template.md +38 -0
  30. package/.agent/templates/ab-comparison-report.md +175 -0
  31. package/.agent/templates/observer-report.md +131 -0
  32. package/.agent/templates/quality-score-report.md +197 -0
  33. package/.agent/templates/self-learning-digest.md +268 -0
  34. package/.agent/templates/system-health-report.md +330 -0
  35. package/.agent/workflows/ab.md +101 -0
  36. package/.agent/workflows/autogen.md +65 -0
  37. package/.agent/workflows/brain.md +52 -42
  38. package/.agent/workflows/commit.md +61 -0
  39. package/.agent/workflows/cycle.md +36 -15
  40. package/.agent/workflows/debug.md +123 -0
  41. package/.agent/workflows/deep-search.md +82 -0
  42. package/.agent/workflows/docs.md +144 -0
  43. package/.agent/workflows/emergency.md +17 -15
  44. package/.agent/workflows/explore.md +15 -9
  45. package/.agent/workflows/housekeeping.md +24 -11
  46. package/.agent/workflows/metrics.md +14 -12
  47. package/.agent/workflows/monitor.md +98 -0
  48. package/.agent/workflows/observe.md +84 -0
  49. package/.agent/workflows/onboarding.md +135 -0
  50. package/.agent/workflows/orchestrator.md +21 -14
  51. package/.agent/workflows/planning.md +126 -0
  52. package/.agent/workflows/refactor.md +132 -0
  53. package/.agent/workflows/release.md +19 -12
  54. package/.agent/workflows/review.md +99 -0
  55. package/.agent/workflows/score.md +104 -0
  56. package/.agent/workflows/sprint.md +16 -14
  57. package/.agent/workflows/validate.md +13 -11
  58. package/.agent/workflows/worktree.md +154 -0
  59. package/CHANGELOG.md +88 -0
  60. package/README.md +12 -4
  61. package/bin/cli.js +143 -13
  62. package/docs/.brain-health-history.json +42 -0
  63. package/docs/.brain-improvements.json +53 -0
  64. package/docs/.brain-learner-log.json +27 -0
  65. package/docs/.brain-scores.json +310 -0
  66. package/docs/architecture/system-flow.mermaid +81 -0
  67. package/docs/artifacts/2026-01-05-enforcement-gates-plan.md +80 -0
  68. package/docs/artifacts/2026-01-05-workflow-analysis.md +231 -0
  69. package/docs/artifacts/README.md +26 -0
  70. package/docs/guides/MCP-GUIDE.md +1 -0
  71. package/docs/reports/2026-01-05-autogen-evaluation.md +64 -0
  72. package/docs/reports/2026-01-05-brain-layer-analysis.md +109 -0
  73. package/docs/reports/2026-01-05-repository-audit.md +253 -0
  74. package/docs/reports/Metrics-Dashboard-2026-01-08.md +29 -0
  75. package/docs/reports/Metrics-Dashboard-Final.md +29 -0
  76. package/docs/reports/Validation-Report-2026-01-05.md +40 -0
  77. package/docs/reports/Validation-Report-2026-01-08.md +40 -0
  78. package/docs/reports/worktrunk-audit.md +94 -0
  79. package/docs/solutions/README.md +96 -0
  80. package/docs/walkthroughs/2026-01-05-audit-implementation.md +36 -0
  81. package/docs/walkthroughs/2026-01-05-autonomy-release.md +54 -0
  82. package/docs/walkthroughs/2026-01-05-enforcement-gates.md +33 -0
  83. package/docs/walkthroughs/2026-01-05-judge-enhancement.md +30 -0
  84. package/docs/walkthroughs/2026-01-05-landing-page-orchestrator.md +52 -0
  85. package/docs/walkthroughs/2026-01-05-validation.md +32 -0
  86. package/docs/walkthroughs/2026-01-05-workflow-audit.md +89 -0
  87. package/docs/walkthroughs/2026-01-05-workflow-refactoring.md +44 -0
  88. package/docs/walkthroughs/2026-01-06-worktrunk-integration.md +41 -0
  89. package/docs/walkthroughs/README.md +25 -0
  90. package/package.json +33 -19
  91. package/.agent/knowledge-base/AUTO-LEARNING-GUIDE.md +0 -327
  92. package/.agent/knowledge-base/HOW-IT-WORKS.md +0 -365
  93. package/.agent/knowledge-base/INDEX.md +0 -43
  94. package/.agent/knowledge-base/README.md +0 -242
  95. package/.agent/knowledge-base/architecture/.gitkeep +0 -1
  96. package/.agent/knowledge-base/architecture/KB-2026-01-01-003-neo4j-graph-database-skills.md +0 -1146
  97. package/.agent/knowledge-base/architecture/README.md +0 -98
  98. package/.agent/knowledge-base/bugs/.gitkeep +0 -1
  99. package/.agent/knowledge-base/bugs/KB-2026-01-02-yaml-special-character-escaping.md +0 -56
  100. package/.agent/knowledge-base/bugs/medium/KB-2026-01-01-001-example-auto-learned.md +0 -198
  101. package/.agent/knowledge-base/features/.gitkeep +0 -1
  102. package/.agent/knowledge-base/features/KB-2026-01-01-001-landing-page-design-trends-2026.md +0 -646
  103. package/.agent/knowledge-base/features/KB-2026-01-01-004-uiux-design-skills-2026.md +0 -945
  104. package/.agent/knowledge-base/features/KB-2026-01-01-005-modern-ai-landing-page-ui.md +0 -310
  105. package/.agent/knowledge-base/features/KB-2026-01-01-006-award-winning-landing-page-patterns.md +0 -324
  106. package/.agent/knowledge-base/features/KB-2026-01-02-001-cleanup-workflow.md +0 -242
  107. package/.agent/knowledge-base/features/KB-2026-01-02-002-landing-page-monorepo-architecture.md +0 -148
  108. package/.agent/knowledge-base/features/KB-2026-01-02-003-premium-glassmorphism-patterns.md +0 -58
  109. package/.agent/knowledge-base/features/KB-2026-01-04-ai-agent-enforcement.md +0 -46
  110. package/.agent/knowledge-base/features/README.md +0 -83
  111. package/.agent/knowledge-base/features/figma-landing-page-workflow.md +0 -311
  112. package/.agent/knowledge-base/features/figma-mcp-sa-guide.md +0 -673
  113. package/.agent/knowledge-base/features/figma-mcp-uiux-guide.md +0 -459
  114. package/.agent/knowledge-base/performance/.gitkeep +0 -1
  115. package/.agent/knowledge-base/performance/KB-2026-01-02-lazy-loading-optimization.md +0 -80
  116. package/.agent/knowledge-base/platform-specific/.gitkeep +0 -1
  117. package/.agent/knowledge-base/platform-specific/KB-2026-01-02-windows-console-encoding.md +0 -56
  118. package/.agent/knowledge-base/role-guides/DEV-KB-Guide.md +0 -527
  119. package/.agent/knowledge-base/role-guides/DEVOPS-KB-Guide.md +0 -491
  120. package/.agent/knowledge-base/role-guides/PM-KB-Guide.md +0 -299
  121. package/.agent/knowledge-base/role-guides/SECA-KB-Guide.md +0 -555
  122. package/.agent/knowledge-base/role-guides/TESTER-KB-Guide.md +0 -519
  123. package/.agent/knowledge-base/security/.gitkeep +0 -1
  124. package/.agent/knowledge-base/security/KB-2026-01-02-input-validation-sanitization.md +0 -74
  125. package/.agent/rules/AUTO-LEARNING.md +0 -418
  126. package/.agent/rules/KNOWLEDGE-BASE.md +0 -45
  127. package/.agent/skills/role-qa.md +0 -81
  128. package/.agent/workflows/compound.md +0 -51
  129. package/.agent/workflows/preflight.md +0 -35
  130. package/.agent/workflows/route.md +0 -160
  131. package/bin/kb +0 -34
  132. package/bin/kb.bat +0 -28
  133. package/bin/kb_cli.py +0 -226
  134. package/bin/lib/README.md +0 -411
  135. package/bin/lib/__init__.py +0 -7
  136. package/bin/lib/__pycache__/kb_add.cpython-313.pyc +0 -0
  137. package/bin/lib/__pycache__/kb_common.cpython-313.pyc +0 -0
  138. package/bin/lib/__pycache__/kb_compound.cpython-313.pyc +0 -0
  139. package/bin/lib/__pycache__/kb_index.cpython-313.pyc +0 -0
  140. package/bin/lib/__pycache__/kb_list.cpython-313.pyc +0 -0
  141. package/bin/lib/__pycache__/kb_search.cpython-313.pyc +0 -0
  142. package/bin/lib/__pycache__/kb_stats.cpython-313.pyc +0 -0
  143. package/bin/lib/kb_add.py +0 -203
  144. package/bin/lib/kb_common.py +0 -224
  145. package/bin/lib/kb_compound.py +0 -250
  146. package/bin/lib/kb_index.py +0 -193
  147. package/bin/lib/kb_list.py +0 -144
  148. package/bin/lib/kb_search.py +0 -121
  149. package/bin/lib/kb_stats.py +0 -153
@@ -0,0 +1,98 @@
1
+ ---
2
+ description: Intelligence - Monitor - System Health Check
3
+ ---
4
+
5
+ # /monitor - System Health Monitoring
6
+
7
+ ## ⚠️ PURPOSE
8
+ Check overall system health, identify missing documentation, detect obsolete code, and get improvement suggestions.
9
+
10
+ // turbo-all
11
+
12
+ ## Quick Commands
13
+
14
+ ```bash
15
+ # Full health check
16
+ python tools/intelligence/monitor/health_monitor.py --check
17
+
18
+ # Get improvement suggestions
19
+ python tools/intelligence/monitor/health_monitor.py --suggest
20
+
21
+ # Check via Brain CLI
22
+ python tools/core/brain/brain_cli.py health
23
+ ```
24
+
25
+ ## When to Use
26
+
27
+ - Start of each work session
28
+ - Before major releases
29
+ - During housekeeping
30
+ - After major changes
31
+
32
+ ## Workflow Steps
33
+
34
+ ### 1. Run Health Check
35
+ ```bash
36
+ python tools/intelligence/monitor/health_monitor.py --check
37
+ ```
38
+
39
+ ### 2. Review Health Status
40
+
41
+ **Health Indicators:**
42
+ | Status | Score | Description |
43
+ |--------|-------|-------------|
44
+ | 🟢 Healthy | 80-100 | System in good shape |
45
+ | 🟡 Warning | 50-79 | Some issues to address |
46
+ | 🔴 Critical | 0-49 | Immediate attention needed |
47
+
48
+ ### 3. Review Metrics
49
+
50
+ The monitor checks:
51
+ - **Documentation Coverage** - Are all features documented?
52
+ - **Test Coverage Gaps** - Missing tests
53
+ - **Obsolete Code** - Unused files, deprecated functions
54
+ - **Compliance Trends** - Observer violation rate over time
55
+ - **Performance Issues** - Slow functions, memory leaks
56
+
57
+ ### 4. Get Suggestions
58
+ ```bash
59
+ python tools/intelligence/monitor/health_monitor.py --suggest
60
+ ```
61
+
62
+ ### 5. Address Issues
63
+ Based on suggestions:
64
+ - Add missing documentation
65
+ - Create tests for uncovered code
66
+ - Remove obsolete files
67
+ - Fix compliance issues
68
+
69
+ ### 6. Verify Fix
70
+ Re-run health check to confirm improvements.
71
+
72
+ ## Health Check Areas
73
+
74
+ | Area | What's Checked |
75
+ |------|----------------|
76
+ | Documentation | `docs/` directory, walkthroughs, plans |
77
+ | Brain State | `.agent/` directory integrity |
78
+ | Tools | `tools/` directory structure |
79
+ | KB Health | Entry count, category distribution |
80
+
81
+ ## Integration
82
+
83
+ - **@BRAIN** - System oversight
84
+ - **/housekeeping** - Maintenance routine
85
+ - **/validate** - Tool reference validation
86
+ - **/metrics** - Detailed statistics
87
+
88
+ #monitor #health #system #metrics
89
+
90
+ ## ⏭️ Next Steps
91
+ - **If Healthy:** Continue normal work
92
+ - **If Warning:** Schedule `/housekeeping`
93
+ - **If Critical:** Address issues immediately
94
+
95
+ ---
96
+
97
+ ## ENFORCEMENT REMINDER
98
+ Run health check at the start of each session.
@@ -0,0 +1,84 @@
1
+ ---
2
+ description: Intelligence - Observer - Rule Compliance Check
3
+ ---
4
+
5
+ # /observe - Rule Compliance Monitor
6
+
7
+ ## ⚠️ PURPOSE
8
+ Trigger the Observer agent to check rule compliance for actions, code, or the entire system.
9
+
10
+ // turbo-all
11
+
12
+ ## Quick Commands
13
+
14
+ ```bash
15
+ # Check overall compliance status
16
+ python tools/intelligence/observer/observer.py --report
17
+
18
+ # Check a specific action
19
+ python tools/intelligence/observer/observer.py --check-action "create file foo.py"
20
+
21
+ # Start continuous observation
22
+ python tools/intelligence/observer/observer.py --start
23
+ ```
24
+
25
+ ## When to Use
26
+
27
+ - Before committing code
28
+ - After making changes to workflows or rules
29
+ - During code review
30
+ - When debugging compliance issues
31
+
32
+ ## Workflow Steps
33
+
34
+ ### 1. Check Current Compliance
35
+ ```bash
36
+ python tools/intelligence/observer/observer.py --report
37
+ ```
38
+ Review the compliance score and any violations.
39
+
40
+ ### 2. Check Specific Action
41
+ ```bash
42
+ python tools/intelligence/observer/observer.py --check-action "[action description]"
43
+ ```
44
+ Validates a specific action against the rules.
45
+
46
+
47
+ ### 3. Review Violations
48
+ If violations are found:
49
+ - Review the violation report in `docs/reports/observer/`
50
+ - Fix the issues
51
+ - Re-run the check
52
+
53
+ ### 4. Self-Learning
54
+ ```bash
55
+ # Record the violation pattern for future reference
56
+ python tools/core/brain/brain_cli.py learn "Fixed compliance issue: [description]"
57
+ ```
58
+
59
+ ## Integration
60
+
61
+ - **@BRAIN** - Uses Observer for monitoring
62
+ - **/cycle** - Compliance check before PR
63
+ - **/commit** - Pre-commit validation
64
+ - **/housekeeping** - Part of maintenance
65
+
66
+ ## Observer Checks
67
+
68
+ | Check | Description |
69
+ |-------|-------------|
70
+ | Code Quality | Naming conventions, style |
71
+ | Template Compliance | Correct template usage |
72
+ | Workflow Steps | Mandatory steps followed |
73
+ | Documentation | Required docs present |
74
+
75
+ #observe #compliance #monitoring #rules
76
+
77
+ ## ⏭️ Next Steps
78
+ - **If Compliant:** Continue with current workflow
79
+ - **If Violations Found:** Fix issues and re-run `/observe`
80
+
81
+ ---
82
+
83
+ ## ENFORCEMENT REMINDER
84
+ Run Observer before major commits.
@@ -0,0 +1,135 @@
1
+ ---
2
+ description: Support - New Agent Onboarding Workflow
3
+ ---
4
+
5
+ # /onboarding - Agent Onboarding
6
+
7
+ ## ⚠️ PURPOSE
8
+ Quick ramp-up workflow for new AI agent sessions joining the project. Accelerates context building.
9
+
10
+ // turbo-all
11
+
12
+ ## When to Use
13
+
14
+ - Starting a new AI agent session
15
+ - Switching context to this project
16
+ - After long absence from project
17
+
18
+ ## Quick Commands
19
+
20
+ ```bash
21
+ # Check project status
22
+ agentic-sdlc brain status
23
+
24
+ # View recent activity
25
+ git log --oneline -20
26
+ ```
27
+
28
+ ## Workflow Steps
29
+
30
+ ### 1. Read Core Documents
31
+ **MANDATORY reading in order:**
32
+
33
+ 1. **GEMINI.md** - Agent instructions and rules
34
+ ```bash
35
+ cat GEMINI.md
36
+ ```
37
+
38
+ 2. **README.md** - Project overview
39
+ ```bash
40
+ cat README.md
41
+ ```
42
+
43
+ 3. **CHANGELOG.md** - Recent changes
44
+ ```bash
45
+ head -100 CHANGELOG.md
46
+ ```
47
+
48
+ ### 2. Understand Project Structure
49
+ ```bash
50
+ # View top-level structure
51
+ ls -la
52
+
53
+ # View .agent structure
54
+ ls -la .agent/
55
+
56
+ # View tools
57
+ ls -la tools/
58
+ ```
59
+
60
+ ### 3. Check Current State
61
+ ```bash
62
+ # Brain status
63
+ agentic-sdlc brain status
64
+
65
+ # Current sprint
66
+ ls docs/sprints/
67
+
68
+ # Active issues
69
+ gh issue list --limit 10
70
+ ```
71
+
72
+ ### 4. Search Knowledge Base
73
+ ```bash
74
+ # Get overview of KB
75
+ agentic-sdlc kb list
76
+
77
+ # Search for recent entries
78
+ agentic-sdlc kb search "recent"
79
+ ```
80
+
81
+ ### 5. Review Active Work
82
+ ```bash
83
+ # Check branches
84
+ git branch -a
85
+
86
+ # Check open PRs
87
+ gh pr list
88
+
89
+ # Check open issues
90
+ gh issue list
91
+ ```
92
+
93
+ ### 6. Context Checklist
94
+ By end of onboarding, you should know:
95
+
96
+ - [ ] Project purpose and goals
97
+ - [ ] Current sprint and priorities
98
+ - [ ] Active issues/PRs
99
+ - [ ] Key technologies used
100
+ - [ ] Available tools and workflows
101
+ - [ ] Team communication patterns
102
+
103
+ ## Quick Reference Card
104
+
105
+ | What | Where |
106
+ |------|-------|
107
+ | Agent rules | `GEMINI.md` |
108
+ | Project overview | `README.md` |
109
+ | Workflows | `.agent/workflows/` |
110
+ | Roles | `.agent/skills/` |
111
+ | Templates | `.agent/templates/` |
112
+ | Tools | `tools/` |
113
+ | Sprint docs | `docs/sprints/sprint-[N]/` |
114
+
115
+ ## Shortcuts for Common Tasks
116
+
117
+ | Task | Command/Workflow |
118
+ |------|------------------|
119
+ | New feature | `/orchestrator` |
120
+ | Quick fix | `/cycle` |
121
+ | Investigation | `/explore` |
122
+ | Production issue | `/emergency` |
123
+ | Code review | `/review` |
124
+ | Debugging | `/debug` |
125
+
126
+ #onboarding #context #ramp-up #new-session
127
+
128
+ ## ⏭️ Next Steps
129
+ - **If Setup Complete:** Trigger `/sprint` to check tasks
130
+ - **If Task Assigned:** Trigger `/cycle` to start work
131
+
132
+ ---
133
+
134
+ ## ENFORCEMENT REMINDER
135
+ Always read GEMINI.md before starting work.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: [Process] Orchestrator - Full Automation Workflow
2
+ description: Process - Orchestrator - Full Automation Workflow
3
3
  ---
4
4
 
5
5
  # Orchestrator Workflow
@@ -13,16 +13,16 @@ All phases must be executed in order. No skipping.
13
13
 
14
14
  ## State Machine Integration
15
15
  This workflow follows the state machine defined in `@BRAIN`. Before each phase transition:
16
- 1. Run `python tools/brain/brain_cli.py validate` to check prerequisites
17
- 2. Run `python tools/brain/brain_cli.py transition <NEW_STATE>` to update state
16
+ 1. Run `agentic-sdlc brain validate` to check prerequisites
17
+ 2. Run `agentic-sdlc brain transition <NEW_STATE>` to update state
18
18
  3. Artifacts required per state are validated automatically
19
19
 
20
20
  ### 0.0 **Team Communication (MANDATORY):**
21
- - **Announce:** `python tools/communication/cli.py send --channel general --thread "SDLC-Flow" --role ORCHESTRATOR --content "Starting Full SDLC Automation."`
21
+ - **Announce:** `agentic-sdlc run tools/communication/cli.py send --channel general --thread "SDLC-Flow" --role ORCHESTRATOR --content "Starting Full SDLC Automation."`
22
22
 
23
23
  ### 0.1 **Initialize State (If New Sprint):**
24
24
  ```bash
25
- python tools/brain/brain_cli.py init <SPRINT_NUMBER>
25
+ agentic-sdlc brain init <SPRINT_NUMBER>
26
26
  ```
27
27
 
28
28
  ## SDLC Flow (State Transitions)
@@ -55,14 +55,21 @@ python tools/brain/brain_cli.py init <SPRINT_NUMBER>
55
55
  - Update CHANGELOG, Final Review.
56
56
 
57
57
  ### Phase 11: Self-Learning
58
- - Run: `python tools/neo4j/sync_skills_to_neo4j.py`
59
- - Run: `python tools/neo4j/learning_engine.py --record-success`
58
+ - Run: `agentic-sdlc kb compound sync`
59
+ - Run: `agentic-sdlc learn --record-success`
60
60
 
61
61
  #orchestrator #automation #sdlc
62
- ---
63
- ## ⚠️ ENFORCEMENT REMINDER
64
- Before executing this workflow, agent MUST:
65
- 1. Have completed /preflight checks
66
- 2. Searched knowledge base for similar tasks
67
- 3. Checked current brain state
68
- Failure to complete pre-flight = workflow violation.
62
+
63
+ ## ⏭️ Next Steps
64
+ - **If Setup Complete:** Trigger @PM for Phase 1 (Planning)
65
+ - **If Planning Complete:** Trigger @SA + @UIUX for Phase 3 (Design)
66
+ - **If Design Complete:** Trigger @TESTER + @SECA for Phase 4 (Verification)
67
+ - **If Dev Complete:** Trigger @TESTER for Phase 6 (Testing)
68
+ - **If Deployment Complete:** Trigger @REPORTER for Phase 9 (Reporting)
69
+
70
+ ---
71
+ ## ⚠️ ENFORCEMENT REMINDER
72
+ Before executing this workflow, agent MUST:
73
+ 1. Search knowledge base for similar tasks
74
+ 2. Check current brain state
75
+ 3. Run /onboarding if new to project
@@ -0,0 +1,126 @@
1
+ ---
2
+ description: Process - Planning Phase Workflow
3
+ ---
4
+
5
+ # /planning - Task Planning Workflow
6
+
7
+ ## ⚠️ PURPOSE
8
+ Standardize the planning phase for tasks and sprints. Ensures proper requirements gathering, design, and user approval before implementation.
9
+
10
+ // turbo-all
11
+
12
+ ## Quick Commands
13
+
14
+ ```bash
15
+ # Generate project plan from template
16
+ python tools/intelligence/artifact_gen/generator.py --template project-plan --context "[project name]"
17
+
18
+ # Check brain state
19
+ python tools/core/brain/brain_cli.py status
20
+
21
+ # Transition to planning state
22
+ python tools/core/brain/brain_cli.py transition PLANNING --reason "Starting new task"
23
+ ```
24
+
25
+ ## When to Use
26
+
27
+ - Starting a new feature or project
28
+ - Beginning a new sprint
29
+ - Before any significant implementation
30
+ - After receiving new requirements
31
+
32
+ ## Workflow Steps
33
+
34
+ ### 1. Initialize Planning State
35
+ ```bash
36
+ python tools/core/brain/brain_cli.py transition PLANNING --reason "New task: [description]"
37
+ ```
38
+
39
+ ### 2. Gather Requirements
40
+ - Review user request
41
+ - Search KB for similar implementations
42
+ - Identify stakeholders
43
+
44
+ ```bash
45
+ # Research with agent
46
+ python tools/intelligence/research/research_agent.py --task "[feature]" --type general
47
+
48
+ # Deep Search (DuckDuckGo + GitHub + StackOverflow)
49
+ python mcp/connectors/deep_search.py --search "[feature]"
50
+ ```
51
+
52
+ ### 3. Create Specification (New Requirement)
53
+ For new features or complex changes, create a specification first:
54
+
55
+ ```bash
56
+ # Generate specification from template
57
+ python tools/intelligence/artifact_gen/generator.py --template specification --context "[feature description]"
58
+ ```
59
+
60
+ **Spec Review:**
61
+ - Verify user stories cover the problem
62
+ - Confirm functional requirements are complete
63
+ - Clarify open questions with user
64
+
65
+ ### 4. Create Implementation Plan
66
+
67
+ Create `implementation_plan.md` based on the approved spec:
68
+ - **Goal Description** - Link to functionality in spec
69
+ - **Proposed Changes** - File-by-file breakdown
70
+ - **Verification Plan** - How to test against requirements
71
+
72
+ ```bash
73
+ python tools/intelligence/artifact_gen/generator.py --template project-plan --context "[description]"
74
+ ```
75
+
76
+ ### 5. Request User Approval
77
+ Present the Spec and Plan to the user for review.
78
+
79
+ **Approval Checklist:**
80
+ - [ ] Requirements understood
81
+ - [ ] Scope is clear
82
+ - [ ] Risks identified
83
+ - [ ] User approved
84
+
85
+ ### 5. Transition to Execution
86
+ Once approved:
87
+ ```bash
88
+ python tools/core/brain/brain_cli.py transition EXECUTION --reason "Plan approved"
89
+ ```
90
+
91
+ ## Planning Checklist
92
+
93
+ | Item | Required |
94
+ |------|----------|
95
+ | Requirements documented | ✅ |
96
+ | KB searched | ✅ |
97
+ | Specification created | ✅ |
98
+ | Implementation plan created | ✅ |
99
+ | User approval obtained | ✅ |
100
+ | Risks identified | ✅ |
101
+
102
+ ## Artifacts
103
+
104
+ - `implementation_plan.md` - Detailed plan
105
+ - `task.md` - Task checklist
106
+ - Sprint folder structure (if new sprint)
107
+
108
+ ## Integration
109
+
110
+ - **@PM** - Primary owner
111
+ - **@BA** - Requirements
112
+ - **@SA** - Technical design
113
+ - **/orchestrator** - Full SDLC flow
114
+ - **/cycle** - Task lifecycle
115
+
116
+ #planning #requirements #design #approval
117
+
118
+ ## ⏭️ Next Steps
119
+ - **If Approved:** Trigger `/cycle` for implementation
120
+ - **If Rejected:** Revise plan based on feedback
121
+ - **If Complex:** Trigger `/explore` for deeper analysis
122
+
123
+ ---
124
+
125
+ ## ENFORCEMENT REMINDER
126
+ Never start coding without an approved plan.
@@ -0,0 +1,132 @@
1
+ ---
2
+ description: Process - Safe Refactoring Workflow
3
+ ---
4
+
5
+ # /refactor - Safe Refactoring Workflow
6
+
7
+ ## ⚠️ PURPOSE
8
+ Systematic approach to refactoring code safely without breaking existing functionality.
9
+
10
+ // turbo-all
11
+
12
+ ## When to Use
13
+
14
+ - Improving code structure
15
+ - Reducing technical debt
16
+ - Extracting reusable components
17
+ - Renaming/reorganizing files
18
+
19
+ ## Golden Rule
20
+ > **Tests MUST pass before AND after refactoring.**
21
+
22
+ ## Quick Commands
23
+
24
+ ```bash
25
+ # Run tests before starting
26
+ bun test
27
+
28
+ # Check current coverage
29
+ bun test --coverage
30
+ ```
31
+
32
+ ## Workflow Steps
33
+
34
+ ### 1. Define Scope
35
+ - [ ] What exactly will be refactored?
36
+ - [ ] What will NOT be touched?
37
+ - [ ] Expected outcome (cleaner code, better performance, etc.)
38
+
39
+ ### 2. Verify Test Coverage
40
+ ```bash
41
+ # Ensure code is covered by tests
42
+ bun test --coverage
43
+
44
+ # If coverage is low, add tests FIRST
45
+ ```
46
+
47
+ **Critical:** If no tests exist for the code being refactored, write tests first!
48
+
49
+ ### 3. Create Feature Branch
50
+ ```bash
51
+ git checkout -b refactor/[description]
52
+ ```
53
+
54
+ ### 4. Run Tests (Baseline)
55
+ ```bash
56
+ # All tests must pass before refactoring
57
+ bun test
58
+ ```
59
+
60
+ ### 5. Refactor in Small Steps
61
+ - [ ] Make ONE small change
62
+ - [ ] Run tests
63
+ - [ ] Commit if green
64
+ - [ ] Repeat
65
+
66
+ ```bash
67
+ # Atomic commits
68
+ git commit -m "refactor: extract [function] from [module]"
69
+ ```
70
+
71
+ ### 6. Run Full Test Suite
72
+ ```bash
73
+ # Verify no regressions
74
+ bun test
75
+
76
+ # Check types
77
+ bun run typecheck
78
+
79
+ # Lint check
80
+ bun run lint
81
+ ```
82
+
83
+ ### 7. Code Review
84
+ ```bash
85
+ # Create PR for review
86
+ gh pr create --title "refactor: [description]"
87
+ ```
88
+
89
+ Invoke `/review` workflow for PR.
90
+
91
+ ### 8. Self-Learning
92
+ ```bash
93
+ # Document refactoring pattern
94
+ agentic-sdlc kb compound sync
95
+ ```
96
+
97
+ ## Refactoring Patterns
98
+
99
+ | Pattern | Description | Risk |
100
+ |---------|-------------|------|
101
+ | **Extract Function** | Move code to reusable function | Low |
102
+ | **Rename** | Improve naming | Low |
103
+ | **Move File** | Reorganize structure | Medium |
104
+ | **Extract Module** | Split large file | Medium |
105
+ | **Change Signature** | Update function parameters | High |
106
+ | **Replace Algorithm** | New implementation | High |
107
+
108
+ ## Anti-Patterns (Don't Do)
109
+
110
+ - ❌ Refactor AND add features at same time
111
+ - ❌ Refactor without tests
112
+ - ❌ Large refactoring without incremental commits
113
+ - ❌ Skip code review for "safe" refactoring
114
+
115
+ ## Integration
116
+
117
+ - **@DEV** - Primary refactorer
118
+ - **@TESTER** - Verify test coverage
119
+ - **/review** - Code review after refactoring
120
+ - **/cycle** - Standard task lifecycle
121
+
122
+ #refactor #code-quality #technical-debt #cleanup
123
+
124
+ ## ⏭️ Next Steps
125
+ - **If Tests Pass:** Trigger `/review` for code review
126
+ - **If Tests Fail:** Fix regressions (do not merge)
127
+ - **If Verified:** Trigger `/release` (if applicable)
128
+
129
+ ---
130
+
131
+ ## ENFORCEMENT REMINDER
132
+ Tests MUST pass before AND after refactoring.