moai-adk 0.9.0__py3-none-any.whl → 0.15.0__py3-none-any.whl
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.
Potentially problematic release.
This version of moai-adk might be problematic. Click here for more details.
- moai_adk/cli/commands/init.py +14 -2
- moai_adk/cli/commands/update.py +214 -56
- moai_adk/core/issue_creator.py +2 -2
- moai_adk/core/project/detector.py +201 -12
- moai_adk/core/project/initializer.py +62 -1
- moai_adk/core/project/phase_executor.py +48 -6
- moai_adk/core/tags/ci_validator.py +34 -4
- moai_adk/core/tags/pre_commit_validator.py +40 -2
- moai_adk/core/tags/reporter.py +2 -3
- moai_adk/core/tags/validator.py +1 -1
- moai_adk/core/template_engine.py +20 -5
- moai_adk/templates/.claude/agents/alfred/backend-expert.md +319 -0
- moai_adk/templates/.claude/agents/alfred/devops-expert.md +464 -0
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +1 -1
- moai_adk/templates/.claude/agents/alfred/frontend-expert.md +357 -0
- moai_adk/templates/.claude/agents/alfred/git-manager.md +2 -2
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +76 -3
- moai_adk/templates/.claude/agents/alfred/project-manager.md +49 -10
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +3 -3
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +108 -3
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +74 -0
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +107 -5
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +2 -2
- moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +571 -0
- moai_adk/templates/.claude/commands/alfred/0-project.md +465 -129
- moai_adk/templates/.claude/commands/alfred/1-plan.md +139 -65
- moai_adk/templates/.claude/commands/alfred/2-run.md +214 -50
- moai_adk/templates/.claude/commands/alfred/3-sync.md +372 -46
- moai_adk/templates/.claude/commands/alfred/9-feedback.md +1 -1
- moai_adk/templates/.claude/hooks/alfred/core/project.py +25 -27
- moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
- moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +108 -0
- moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +4 -4
- moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +29 -0
- moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +11 -19
- moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +11 -19
- moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +11 -19
- moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +10 -18
- moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +2 -2
- moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +3 -3
- moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +5 -5
- moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +40 -41
- moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +55 -23
- moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +4 -4
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +132 -3
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +9 -10
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +3 -6
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +19 -0
- moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +14 -22
- moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
- moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +161 -0
- moai_adk/templates/.claude/settings.json +5 -5
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +70 -0
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +62 -0
- moai_adk/templates/{.moai/memory/CLAUDE-AGENTS-GUIDE.md → .claude/skills/moai-alfred-agent-guide/reference.md} +34 -0
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +56 -0
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +444 -0
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +62 -0
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +405 -0
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +51 -0
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +355 -0
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +239 -0
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +323 -0
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +286 -0
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +126 -0
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/SKILL.md +74 -0
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/examples.md +4 -0
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/reference.md +269 -0
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +19 -0
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +4 -0
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/SKILL.md +198 -0
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/examples.md +431 -0
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/reference.md +141 -0
- moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +89 -0
- moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +122 -0
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +508 -0
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +481 -0
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +100 -0
- moai_adk/templates/.claude/skills/moai-alfred-reporting/SKILL.md +273 -0
- moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +77 -0
- moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +265 -0
- moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +19 -0
- moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +4 -0
- moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +84 -0
- moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/SKILL.md +5 -5
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/SKILL.md +115 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/examples.md +4 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/reference.md +348 -0
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +19 -0
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +4 -0
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +211 -0
- moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +288 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/SKILL.md +19 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/examples.md +4 -0
- moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL.md +3 -3
- moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +802 -0
- moai_adk/templates/.claude/skills/moai-design-systems/examples.md +1238 -0
- moai_adk/templates/.claude/skills/moai-design-systems/reference.md +673 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +17 -13
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +15 -12
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +14 -12
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +14 -11
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +10 -8
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +15 -12
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +13 -11
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +16 -10
- moai_adk/templates/.claude/skills/moai-project-documentation.md +622 -0
- moai_adk/templates/.git-hooks/pre-push +143 -0
- moai_adk/templates/.github/workflows/c-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/cpp-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/csharp-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/dart-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/go-tag-validation.yml +130 -0
- moai_adk/templates/.github/workflows/java-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/javascript-tag-validation.yml +135 -0
- moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/moai-gitflow.yml +182 -25
- moai_adk/templates/.github/workflows/moai-release-pipeline.yml +35 -29
- moai_adk/templates/.github/workflows/php-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/python-tag-validation.yml +118 -0
- moai_adk/templates/.github/workflows/release.yml +76 -7
- moai_adk/templates/.github/workflows/ruby-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/rust-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/shell-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/spec-issue-sync.yml +208 -41
- moai_adk/templates/.github/workflows/swift-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/tag-report.yml +269 -0
- moai_adk/templates/.github/workflows/tag-validation.yml +186 -0
- moai_adk/templates/.github/workflows/typescript-tag-validation.yml +154 -0
- moai_adk/templates/.moai/config.json +3 -1
- moai_adk/templates/CLAUDE.md +940 -45
- moai_adk/templates/workflows/go-tag-validation.yml +30 -0
- moai_adk/templates/workflows/javascript-tag-validation.yml +41 -0
- moai_adk/templates/workflows/python-tag-validation.yml +42 -0
- moai_adk/templates/workflows/typescript-tag-validation.yml +31 -0
- moai_adk/utils/banner.py +5 -5
- {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/METADATA +1166 -455
- {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/RECORD +169 -109
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -209
- moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py +0 -102
- moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py +0 -102
- moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py +0 -102
- moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -640
- moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -696
- moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -474
- moai_adk/templates/.github/ISSUE_TEMPLATE/spec.yml +0 -176
- moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -69
- moai_adk/templates/.moai/memory/DEVELOPMENT-GUIDE.md +0 -344
- moai_adk/templates/.moai/memory/SPEC-METADATA.md +0 -356
- moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -330
- moai_adk/templates/.moai/project/product.md +0 -161
- moai_adk/templates/.moai/project/structure.md +0 -156
- moai_adk/templates/.moai/project/tech.md +0 -227
- moai_adk/templates/README.md +0 -256
- moai_adk/templates/__init__.py +0 -2
- /moai_adk/templates/{.moai/memory/ISSUE-LABEL-MAPPING.md → .claude/skills/moai-alfred-issue-labels/reference.md} +0 -0
- /moai_adk/templates/{.moai/memory/CLAUDE-PRACTICES.md → .claude/skills/moai-alfred-practices/reference.md} +0 -0
- /moai_adk/templates/{.moai/memory/CLAUDE-RULES.md → .claude/skills/moai-alfred-rules/reference.md} +0 -0
- /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/README.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/examples/validate-spec.sh +0 -0
- /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/examples.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/reference.md +0 -0
- /moai_adk/templates/{.moai/memory/SKILLS-DESCRIPTION-POLICY.md → .claude/skills/moai-cc-skill-descriptions/reference.md} +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/CHECKLIST.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/EXAMPLES.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/INTERACTIVE-DISCOVERY.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/METADATA.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/PARALLEL-ANALYSIS-REPORT.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/PYTHON-VERSION-MATRIX.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL-FACTORY-WORKFLOW.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL-UPDATE-ADVISOR.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/STEP-BY-STEP-GUIDE.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/STRUCTURE.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/WEB-RESEARCH.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/reference.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/scripts/generate-structure.sh +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/scripts/validate-skill.sh +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/SKILL_TEMPLATE.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/examples-template.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/reference-template.md +0 -0
- /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/scripts-template.sh +0 -0
- {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/WHEEL +0 -0
- {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
# Alfred Proactive Suggestions - Real-World Examples
|
|
2
|
+
|
|
3
|
+
> **Main Skill**: [SKILL.md](SKILL.md)
|
|
4
|
+
> **API Reference**: [reference.md](reference.md)
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Example 1: Database Migration Risk Detection
|
|
9
|
+
|
|
10
|
+
### Scenario
|
|
11
|
+
|
|
12
|
+
**User**: `/alfred:2-run SPEC-DATABASE-001`
|
|
13
|
+
|
|
14
|
+
**SPEC content**:
|
|
15
|
+
```
|
|
16
|
+
Title: Migrate user table to new schema
|
|
17
|
+
Description: Add email_verified column, rename password to password_hash
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Alfred Detection
|
|
21
|
+
|
|
22
|
+
**Risk pattern**: Database Migration
|
|
23
|
+
**Risk level**: High
|
|
24
|
+
**Affected**: Production database (10K users)
|
|
25
|
+
|
|
26
|
+
### Proactive Suggestion
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
High-risk operation detected: Database migration
|
|
30
|
+
|
|
31
|
+
SPEC-DATABASE-001 Impact Analysis:
|
|
32
|
+
|
|
33
|
+
Affected:
|
|
34
|
+
- Table: users (10,243 rows)
|
|
35
|
+
- Columns: 2 added, 1 renamed
|
|
36
|
+
- Downtime estimate: 5-10 minutes
|
|
37
|
+
|
|
38
|
+
Recommended safeguards:
|
|
39
|
+
1. ✅ Create database backup (pg_dump)
|
|
40
|
+
2. ✅ Test migration on staging environment
|
|
41
|
+
3. ✅ Prepare rollback script
|
|
42
|
+
4. ✅ Schedule maintenance window
|
|
43
|
+
5. ✅ Verify migration in dry-run mode
|
|
44
|
+
|
|
45
|
+
Proceed with implementation?
|
|
46
|
+
[Yes, I've taken precautions]
|
|
47
|
+
[No, test on staging first]
|
|
48
|
+
[Show me detailed checklist]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### User Response
|
|
52
|
+
|
|
53
|
+
**Option 1: Yes, I've taken precautions**
|
|
54
|
+
→ Alfred proceeds with TDD implementation
|
|
55
|
+
|
|
56
|
+
**Option 2: No, test on staging first**
|
|
57
|
+
→ Alfred pauses, suggests staging deployment command
|
|
58
|
+
|
|
59
|
+
**Option 3: Show me detailed checklist**
|
|
60
|
+
→ Alfred displays full migration best practices guide
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Example 2: Repetitive Task Automation
|
|
65
|
+
|
|
66
|
+
### Scenario
|
|
67
|
+
|
|
68
|
+
**User behavior** (observed pattern):
|
|
69
|
+
```
|
|
70
|
+
User edits: src/components/Button.tsx (updates import)
|
|
71
|
+
User edits: src/components/Card.tsx (updates import)
|
|
72
|
+
User edits: src/components/Modal.tsx (updates import)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Pattern**: Same operation on 3 files
|
|
76
|
+
|
|
77
|
+
### Alfred Detection
|
|
78
|
+
|
|
79
|
+
**Optimization pattern**: Repetitive tasks
|
|
80
|
+
**Files remaining**: 7 similar components
|
|
81
|
+
**Time saved**: ~15 minutes
|
|
82
|
+
|
|
83
|
+
### Proactive Suggestion
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
Repetitive pattern detected: Updating import statements
|
|
87
|
+
|
|
88
|
+
Observed pattern:
|
|
89
|
+
- Change: import { Theme } from '../theme'
|
|
90
|
+
- To: import { Theme } from '@/theme'
|
|
91
|
+
- Applied: 3/10 files
|
|
92
|
+
|
|
93
|
+
Automation opportunity:
|
|
94
|
+
1. Analyze your last edits
|
|
95
|
+
2. Generate batch refactor script
|
|
96
|
+
3. Apply to remaining 7 files
|
|
97
|
+
4. Estimated time saved: 15 minutes
|
|
98
|
+
|
|
99
|
+
Create automation script?
|
|
100
|
+
[Yes, generate and apply]
|
|
101
|
+
[No, I'll continue manually]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Outcome
|
|
105
|
+
|
|
106
|
+
**If Yes**:
|
|
107
|
+
→ Alfred generates and executes batch script
|
|
108
|
+
→ Updates 7 remaining files in 10 seconds
|
|
109
|
+
→ Reports results
|
|
110
|
+
|
|
111
|
+
**If No**:
|
|
112
|
+
→ Alfred silently continues
|
|
113
|
+
→ Won't suggest automation again this session (avoid repetition)
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Example 3: Breaking Change Detection
|
|
118
|
+
|
|
119
|
+
### Scenario
|
|
120
|
+
|
|
121
|
+
**User**: Modifies API endpoint signature
|
|
122
|
+
```diff
|
|
123
|
+
- POST /api/auth/login { email, password }
|
|
124
|
+
+ POST /api/auth/login { username, password, mfa_code }
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Alfred Detection
|
|
128
|
+
|
|
129
|
+
**Risk pattern**: Breaking change
|
|
130
|
+
**Risk level**: High
|
|
131
|
+
**Impact**: 3 frontend clients + 5 external integrations
|
|
132
|
+
|
|
133
|
+
### Proactive Suggestion
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
Breaking change detected: API endpoint signature modified
|
|
137
|
+
|
|
138
|
+
Impact Analysis:
|
|
139
|
+
- Endpoint: POST /api/auth/login
|
|
140
|
+
- Change: Added required field 'username', 'mfa_code'
|
|
141
|
+
- Affected clients:
|
|
142
|
+
- Web frontend (React)
|
|
143
|
+
- Mobile app (Flutter)
|
|
144
|
+
- Admin dashboard (Vue)
|
|
145
|
+
- 5 external integrations (webhooks)
|
|
146
|
+
|
|
147
|
+
Recommended approach:
|
|
148
|
+
1. Create v2 endpoint (/api/v2/auth/login)
|
|
149
|
+
2. Maintain v1 for 2 releases (deprecation period)
|
|
150
|
+
3. Document migration guide
|
|
151
|
+
4. Notify stakeholders 2 weeks before v1 sunset
|
|
152
|
+
5. Monitor v1 usage metrics
|
|
153
|
+
|
|
154
|
+
Proceed with breaking change?
|
|
155
|
+
[Yes, create migration plan]
|
|
156
|
+
[No, use non-breaking approach]
|
|
157
|
+
[Show API versioning best practices]
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Example 4: Security Concern Detection
|
|
163
|
+
|
|
164
|
+
### Scenario
|
|
165
|
+
|
|
166
|
+
**User** (commits file with API key):
|
|
167
|
+
```python
|
|
168
|
+
API_KEY = "sk-proj-abc123xyz789"
|
|
169
|
+
client = OpenAI(api_key=API_KEY)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Alfred Detection
|
|
173
|
+
|
|
174
|
+
**Risk pattern**: Security concern
|
|
175
|
+
**Risk level**: High
|
|
176
|
+
**Exposure**: Credentials in code
|
|
177
|
+
|
|
178
|
+
### Proactive Suggestion
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
Security concern detected: API key in code
|
|
182
|
+
|
|
183
|
+
Risk:
|
|
184
|
+
- Exposed credentials if committed to git
|
|
185
|
+
- Potential unauthorized access
|
|
186
|
+
- Compliance violation (SOC2, GDPR)
|
|
187
|
+
|
|
188
|
+
Recommended fix:
|
|
189
|
+
1. Move API_KEY to .env file
|
|
190
|
+
2. Add .env to .gitignore
|
|
191
|
+
3. Use environment variable: os.getenv('OPENAI_API_KEY')
|
|
192
|
+
4. Rotate compromised key immediately
|
|
193
|
+
|
|
194
|
+
Automatic fix available:
|
|
195
|
+
- Extract to .env
|
|
196
|
+
- Update code to use os.getenv()
|
|
197
|
+
- Add .env to .gitignore
|
|
198
|
+
- Generate key rotation reminder
|
|
199
|
+
|
|
200
|
+
Fix automatically?
|
|
201
|
+
[Yes, extract to .env now]
|
|
202
|
+
[I'll fix manually]
|
|
203
|
+
[This is a test key, ignore]
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Outcome
|
|
207
|
+
|
|
208
|
+
**If Yes (automatic)**:
|
|
209
|
+
→ Alfred creates `.env` file
|
|
210
|
+
→ Adds `OPENAI_API_KEY=sk-proj-abc123xyz789`
|
|
211
|
+
→ Updates code to `os.getenv('OPENAI_API_KEY')`
|
|
212
|
+
→ Adds `.env` to `.gitignore`
|
|
213
|
+
→ Reminds user to rotate key
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Example 5: Production Deployment Without Staging
|
|
218
|
+
|
|
219
|
+
### Scenario
|
|
220
|
+
|
|
221
|
+
**User**: `Deploy to production`
|
|
222
|
+
|
|
223
|
+
**Alfred checks**:
|
|
224
|
+
- Last staging deployment: 3 days ago
|
|
225
|
+
- No staging test of current changes
|
|
226
|
+
- Critical infrastructure change detected
|
|
227
|
+
|
|
228
|
+
### Alfred Detection
|
|
229
|
+
|
|
230
|
+
**Risk pattern**: Production operation
|
|
231
|
+
**Risk level**: High
|
|
232
|
+
**Missing**: Staging verification
|
|
233
|
+
|
|
234
|
+
### Proactive Suggestion
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
Production deployment without staging verification
|
|
238
|
+
|
|
239
|
+
Current status:
|
|
240
|
+
- Last staging test: 3 days ago (stale)
|
|
241
|
+
- Changes since then: 47 commits
|
|
242
|
+
- Risk level: High (database schema change included)
|
|
243
|
+
|
|
244
|
+
Pre-deployment checklist:
|
|
245
|
+
- [ ] Tested on staging environment
|
|
246
|
+
- [ ] Rollback plan prepared
|
|
247
|
+
- [ ] Monitoring alerts configured
|
|
248
|
+
- [ ] Team notified
|
|
249
|
+
- [ ] Database backup created
|
|
250
|
+
- [ ] Feature flags configured
|
|
251
|
+
|
|
252
|
+
Recommended action:
|
|
253
|
+
1. Deploy to staging first
|
|
254
|
+
2. Run integration tests
|
|
255
|
+
3. Verify database migration
|
|
256
|
+
4. Then proceed to production
|
|
257
|
+
|
|
258
|
+
Deploy to production?
|
|
259
|
+
[Cancel, deploy to staging first]
|
|
260
|
+
[Continue to production (risky)]
|
|
261
|
+
[Show deployment best practices]
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Example 6: Parallel Execution Optimization
|
|
267
|
+
|
|
268
|
+
### Scenario
|
|
269
|
+
|
|
270
|
+
**User workflow** (sequential):
|
|
271
|
+
```
|
|
272
|
+
Running unit tests... (2 min)
|
|
273
|
+
Running integration tests... (3 min)
|
|
274
|
+
Running E2E tests... (5 min)
|
|
275
|
+
Total: 10 minutes
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Alfred Detection
|
|
279
|
+
|
|
280
|
+
**Optimization pattern**: Parallel execution
|
|
281
|
+
**Tasks**: 3 independent test suites
|
|
282
|
+
**Time savings**: 50% (5 minutes)
|
|
283
|
+
|
|
284
|
+
### Proactive Suggestion
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
Parallel execution opportunity detected
|
|
288
|
+
|
|
289
|
+
Current workflow:
|
|
290
|
+
1. pytest tests/unit (2 min)
|
|
291
|
+
2. pytest tests/integration (3 min)
|
|
292
|
+
3. playwright test (5 min)
|
|
293
|
+
Total: 10 minutes sequential
|
|
294
|
+
|
|
295
|
+
Optimized workflow:
|
|
296
|
+
Run all test suites in parallel:
|
|
297
|
+
- pytest tests/unit &
|
|
298
|
+
- pytest tests/integration &
|
|
299
|
+
- playwright test &
|
|
300
|
+
Total: 5 minutes (max of 3 durations)
|
|
301
|
+
|
|
302
|
+
Time saved: 5 minutes (50% improvement)
|
|
303
|
+
|
|
304
|
+
Enable parallel execution?
|
|
305
|
+
[Yes, run in parallel now]
|
|
306
|
+
[No, keep sequential]
|
|
307
|
+
[Set as default for future runs]
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Example 7: Learning Opportunity (Beginner)
|
|
313
|
+
|
|
314
|
+
### Scenario
|
|
315
|
+
|
|
316
|
+
**User** (Beginner): Creates test after implementation
|
|
317
|
+
```
|
|
318
|
+
User writes: src/auth.py (implementation)
|
|
319
|
+
User writes: tests/test_auth.py (tests)
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Pattern**: Not following TDD (Test-First)
|
|
323
|
+
|
|
324
|
+
### Alfred Detection
|
|
325
|
+
|
|
326
|
+
**Learning opportunity**: TDD workflow
|
|
327
|
+
**Expertise level**: Beginner
|
|
328
|
+
**Trigger**: First-time implementation
|
|
329
|
+
|
|
330
|
+
### Proactive Suggestion
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
Observation: Tests written after implementation
|
|
334
|
+
|
|
335
|
+
Best practice: Test-Driven Development (TDD)
|
|
336
|
+
|
|
337
|
+
Current approach:
|
|
338
|
+
1. Write implementation
|
|
339
|
+
2. Write tests
|
|
340
|
+
Risk: Tests may pass incorrectly or miss edge cases
|
|
341
|
+
|
|
342
|
+
TDD approach:
|
|
343
|
+
1. Write failing test (RED) - defines behavior
|
|
344
|
+
2. Implement code (GREEN) - satisfies test
|
|
345
|
+
3. Refactor (REFACTOR) - improve with safety net
|
|
346
|
+
|
|
347
|
+
Benefits:
|
|
348
|
+
- 40% fewer bugs (industry data)
|
|
349
|
+
- Better code design
|
|
350
|
+
- Confidence in refactoring
|
|
351
|
+
|
|
352
|
+
Next time, try:
|
|
353
|
+
- Use /alfred:2-run for automated TDD workflow
|
|
354
|
+
- Skill("moai-foundation-trust") - TRUST 5 principles
|
|
355
|
+
|
|
356
|
+
Would you like to retry with TDD workflow?
|
|
357
|
+
[Yes, revert and start with tests]
|
|
358
|
+
[No, I understand but prefer current approach]
|
|
359
|
+
[Show me TDD tutorial]
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Example 8: Large File Edit Without Tests
|
|
365
|
+
|
|
366
|
+
### Scenario
|
|
367
|
+
|
|
368
|
+
**User**: Edits `src/payment/processor.py` (350 lines)
|
|
369
|
+
|
|
370
|
+
**File analysis**:
|
|
371
|
+
- Lines modified: 150
|
|
372
|
+
- Test coverage: 0%
|
|
373
|
+
- Complexity: High (payment logic)
|
|
374
|
+
|
|
375
|
+
### Alfred Detection
|
|
376
|
+
|
|
377
|
+
**Risk pattern**: Large file operation
|
|
378
|
+
**Risk level**: Medium
|
|
379
|
+
**Missing**: Test coverage
|
|
380
|
+
|
|
381
|
+
### Proactive Suggestion
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
Large file edit detected: 150 lines modified
|
|
385
|
+
|
|
386
|
+
File: src/payment/processor.py (350 lines)
|
|
387
|
+
Test coverage: 0%
|
|
388
|
+
Complexity: High (payment processing logic)
|
|
389
|
+
|
|
390
|
+
Risk:
|
|
391
|
+
- Regression without tests
|
|
392
|
+
- Payment failures in production
|
|
393
|
+
- Difficult debugging
|
|
394
|
+
|
|
395
|
+
Recommendation:
|
|
396
|
+
1. Pause current edit
|
|
397
|
+
2. Write tests first (TDD)
|
|
398
|
+
3. Use /alfred:2-run SPEC-PAYMENT-001
|
|
399
|
+
4. Ensures payment logic correctness
|
|
400
|
+
|
|
401
|
+
Alternative:
|
|
402
|
+
- Continue edit but write tests immediately after
|
|
403
|
+
- Minimum 80% coverage required for payment code
|
|
404
|
+
|
|
405
|
+
Proceed?
|
|
406
|
+
[Pause, write tests first (recommended)]
|
|
407
|
+
[Continue, I'll write tests after]
|
|
408
|
+
[Show payment testing best practices]
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Example 9: Expert User - Advanced Technique Suggestion
|
|
414
|
+
|
|
415
|
+
### Scenario
|
|
416
|
+
|
|
417
|
+
**User** (Expert): Manually performs complex git operations repeatedly
|
|
418
|
+
```
|
|
419
|
+
git checkout -b feature/auth
|
|
420
|
+
git add .
|
|
421
|
+
git commit -m "feat: add auth"
|
|
422
|
+
git push -u origin feature/auth
|
|
423
|
+
gh pr create --title "Auth" --body "..."
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
**Pattern**: Repeated 5 times in past week
|
|
427
|
+
|
|
428
|
+
### Alfred Detection
|
|
429
|
+
|
|
430
|
+
**Optimization pattern**: Manual workflow
|
|
431
|
+
**Expertise level**: Expert
|
|
432
|
+
**Candidate**: Custom workflow automation
|
|
433
|
+
|
|
434
|
+
### Proactive Suggestion
|
|
435
|
+
|
|
436
|
+
```
|
|
437
|
+
Advanced automation opportunity
|
|
438
|
+
|
|
439
|
+
Observed pattern:
|
|
440
|
+
- 5 PRs created this week
|
|
441
|
+
- Same workflow: branch → commit → push → PR
|
|
442
|
+
- Time spent: ~5 min each = 25 min/week
|
|
443
|
+
|
|
444
|
+
Suggested optimization:
|
|
445
|
+
Create custom Alfred command: /alfred:create-pr
|
|
446
|
+
|
|
447
|
+
Workflow automation:
|
|
448
|
+
1. Auto-generate branch from SPEC ID
|
|
449
|
+
2. Create commit with conventional format
|
|
450
|
+
3. Push to origin with upstream tracking
|
|
451
|
+
4. Generate PR with SPEC context
|
|
452
|
+
5. Request reviewers automatically
|
|
453
|
+
|
|
454
|
+
Time saved: 20 min/week
|
|
455
|
+
Setup time: 10 minutes
|
|
456
|
+
|
|
457
|
+
Would you like guidance on custom command creation?
|
|
458
|
+
[Yes, show me how]
|
|
459
|
+
[No, I prefer manual control]
|
|
460
|
+
[Email me documentation later]
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
## Summary: Suggestion Types by Scenario
|
|
466
|
+
|
|
467
|
+
| Scenario | Risk Level | Suggestion Type | User Action |
|
|
468
|
+
|----------|------------|-----------------|-------------|
|
|
469
|
+
| Database migration | High | Risk warning + checklist | Confirm precautions |
|
|
470
|
+
| Repetitive edits | N/A | Optimization (automation) | Accept/decline script |
|
|
471
|
+
| Breaking API change | High | Risk + migration plan | Create v2 or non-breaking |
|
|
472
|
+
| Credentials in code | High | Security fix | Auto-extract to .env |
|
|
473
|
+
| Prod without staging | High | Risk + checklist | Deploy staging first |
|
|
474
|
+
| Sequential tests | N/A | Optimization (parallel) | Enable parallel |
|
|
475
|
+
| Test after impl | N/A | Learning (TDD) | Retry with TDD |
|
|
476
|
+
| Large file no tests | Medium | Risk + TDD suggestion | Pause, write tests |
|
|
477
|
+
| Advanced workflow | N/A | Optimization (custom cmd) | Learn custom automation |
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
**End of Examples** | 2025-11-02
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Alfred Proactive Suggestions - Quick Reference
|
|
2
|
+
|
|
3
|
+
> **Main Skill**: [SKILL.md](SKILL.md)
|
|
4
|
+
> **Examples**: [examples.md](examples.md)
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Risk Classification Quick Reference
|
|
9
|
+
|
|
10
|
+
| Risk Level | Operations | Beginner | Intermediate | Expert |
|
|
11
|
+
|------------|------------|----------|--------------|--------|
|
|
12
|
+
| **Low** | Read-only, docs, typos | Confirm | Skip | Skip |
|
|
13
|
+
| **Medium** | Code changes, config | Confirm + explain | Confirm | Skip |
|
|
14
|
+
| **High** | DB migration, prod deploy | Confirm + checklist | Confirm + checklist | Confirm |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Risk Pattern Catalog
|
|
19
|
+
|
|
20
|
+
| Pattern | Keywords | Risk Level | Mitigation |
|
|
21
|
+
|---------|----------|------------|------------|
|
|
22
|
+
| **Database Migration** | migration, schema, ALTER | High | Backup, staging, rollback |
|
|
23
|
+
| **Destructive Ops** | rm, force push, reset | High | Alternative suggestion |
|
|
24
|
+
| **Breaking Changes** | API change, major version | High | Migration plan |
|
|
25
|
+
| **Production Deploy** | deploy, prod, release | High | Staging checklist |
|
|
26
|
+
| **Security** | credentials, API key | High | Environment vars |
|
|
27
|
+
| **Large File Edit** | >100 lines, no tests | Medium | TDD workflow |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Optimization Pattern Catalog
|
|
32
|
+
|
|
33
|
+
| Pattern | Detection | Time Saved | Automation |
|
|
34
|
+
|---------|-----------|------------|------------|
|
|
35
|
+
| **Repetitive Tasks** | 3+ similar edits | 10-30 min | Batch script |
|
|
36
|
+
| **Parallel Execution** | Sequential independent tasks | 30-50% | Parallel flag |
|
|
37
|
+
| **Manual Workflows** | GUI-equivalent actions | 15-20 min | `/alfred:*` command |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Suggestion Priority Matrix
|
|
42
|
+
|
|
43
|
+
**When multiple suggestions eligible, prioritize**:
|
|
44
|
+
|
|
45
|
+
1. **High-risk warnings** (always show)
|
|
46
|
+
2. **Medium-risk warnings** (if no high-risk)
|
|
47
|
+
3. **Optimization patterns** (if no risks)
|
|
48
|
+
4. **Learning opportunities** (lowest priority)
|
|
49
|
+
|
|
50
|
+
**Frequency limit**: Max 1 suggestion per 5 minutes
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Expertise-Based Thresholds
|
|
55
|
+
|
|
56
|
+
| Expertise | Suggestions/Session | Focus | Pattern Threshold |
|
|
57
|
+
|-----------|---------------------|-------|-------------------|
|
|
58
|
+
| **Beginner** | 3-5 | Learning + risks | Low (suggest common) |
|
|
59
|
+
| **Intermediate** | 2-3 | Optimizations + med risks | Medium (suggest improvements) |
|
|
60
|
+
| **Expert** | 1-2 | Advanced + high risks | High (suggest advanced only) |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Decision Tree
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Operation Detected
|
|
68
|
+
↓
|
|
69
|
+
Classify Risk (Low/Medium/High)
|
|
70
|
+
↓
|
|
71
|
+
Check Expertise Level (Beginner/Int/Expert)
|
|
72
|
+
↓
|
|
73
|
+
Determine Confirmation Threshold
|
|
74
|
+
↓
|
|
75
|
+
├─ High Risk → Always confirm (all levels)
|
|
76
|
+
├─ Medium Risk → Confirm if Beginner/Int
|
|
77
|
+
└─ Low Risk → Confirm if Beginner only
|
|
78
|
+
↓
|
|
79
|
+
Check Suggestion Frequency (1 per 5 min)
|
|
80
|
+
↓
|
|
81
|
+
├─ Within limit → Show suggestion
|
|
82
|
+
└─ Over limit → Queue for later
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Integration Points
|
|
88
|
+
|
|
89
|
+
**Called by**:
|
|
90
|
+
- All `/alfred:*` commands (risk detection)
|
|
91
|
+
- `moai-alfred-persona-roles` (role adaptation)
|
|
92
|
+
- `moai-alfred-expertise-detection` (threshold tuning)
|
|
93
|
+
|
|
94
|
+
**Calls**:
|
|
95
|
+
- `AskUserQuestion` (confirmation dialogs)
|
|
96
|
+
- Risk mitigation Skills (context-specific)
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
**End of Reference** | 2025-11-02
|