moai-adk 0.9.0__py3-none-any.whl → 0.15.1__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 +180 -41
- 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 +928 -263
- moai_adk/templates/.claude/commands/alfred/1-plan.md +220 -68
- moai_adk/templates/.claude/commands/alfred/2-run.md +299 -51
- moai_adk/templates/.claude/commands/alfred/3-sync.md +452 -51
- 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.1.dist-info}/METADATA +1253 -527
- {moai_adk-0.9.0.dist-info → moai_adk-0.15.1.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.1.dist-info}/WHEEL +0 -0
- {moai_adk-0.9.0.dist-info → moai_adk-0.15.1.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.9.0.dist-info → moai_adk-0.15.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# MoAI-ADK GitFlow Main Branch Control Hook
|
|
4
|
+
# Purpose: Enforce GitFlow in team mode, advisory in personal mode
|
|
5
|
+
# Enforces: Strict team workflow, flexible personal development
|
|
6
|
+
#
|
|
7
|
+
# This hook runs before any git push operation:
|
|
8
|
+
# Team Mode: Blocks direct main/master push (non-develop), requires confirmation for develop→main
|
|
9
|
+
# Personal Mode: Advisory warnings, allows flexibility
|
|
10
|
+
#
|
|
11
|
+
# Exit codes:
|
|
12
|
+
# 0 - Push allowed
|
|
13
|
+
# 1 - Push blocked (team mode violation or user declined)
|
|
14
|
+
|
|
15
|
+
# Check team mode from .moai/config.json
|
|
16
|
+
is_team_mode() {
|
|
17
|
+
if [ -f ".moai/config.json" ]; then
|
|
18
|
+
# Check if mode is "team"
|
|
19
|
+
grep -q '"mode".*:.*"team"' ".moai/config.json" 2>/dev/null
|
|
20
|
+
return $?
|
|
21
|
+
fi
|
|
22
|
+
return 1
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Colors for output
|
|
26
|
+
RED='\033[0;31m'
|
|
27
|
+
YELLOW='\033[1;33m'
|
|
28
|
+
GREEN='\033[0;32m'
|
|
29
|
+
BLUE='\033[0;34m'
|
|
30
|
+
NC='\033[0m' # No Color
|
|
31
|
+
|
|
32
|
+
TEAM_MODE=false
|
|
33
|
+
is_team_mode && TEAM_MODE=true
|
|
34
|
+
|
|
35
|
+
# Read from stdin (git sends remote, local ref info)
|
|
36
|
+
# Format: <local ref> <local oid> <remote ref> <remote oid>
|
|
37
|
+
while read local_ref local_oid remote_ref remote_oid; do
|
|
38
|
+
# Extract the remote branch name from the reference
|
|
39
|
+
# remote_ref format: refs/heads/main
|
|
40
|
+
remote_branch=$(echo "$remote_ref" | sed 's|refs/heads/||')
|
|
41
|
+
local_branch=$(echo "$local_ref" | sed 's|refs/heads/||')
|
|
42
|
+
|
|
43
|
+
# Check if attempting to push to main branch
|
|
44
|
+
if [ "$remote_branch" = "main" ] || [ "$remote_branch" = "master" ]; then
|
|
45
|
+
# Get the current branch to determine if this is the develop branch
|
|
46
|
+
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
|
47
|
+
|
|
48
|
+
# TEAM MODE ENFORCEMENT
|
|
49
|
+
if [ "$TEAM_MODE" = true ]; then
|
|
50
|
+
# Block non-develop, non-release branches from pushing to main
|
|
51
|
+
if [ "$local_branch" != "develop" ] && [ "${local_branch#release/}" = "$local_branch" ]; then
|
|
52
|
+
echo ""
|
|
53
|
+
echo -e "${RED}❌ BLOCKED: Non-standard GitFlow in TEAM MODE${NC}"
|
|
54
|
+
echo ""
|
|
55
|
+
echo -e "${BLUE}Current branch: ${local_branch}${NC}"
|
|
56
|
+
echo -e "${BLUE}Target branch: ${remote_branch}${NC}"
|
|
57
|
+
echo ""
|
|
58
|
+
echo "🚀 Correct GitFlow workflow for TEAM MODE:"
|
|
59
|
+
echo " 1. Work on feature/SPEC-{ID} branch (created from develop)"
|
|
60
|
+
echo " 2. Push to feature/SPEC-{ID} and create PR to develop"
|
|
61
|
+
echo " 3. Code review & merge into develop"
|
|
62
|
+
echo " 4. When develop is stable, create PR from develop to main"
|
|
63
|
+
echo " 5. Release manager merges develop → main with tag"
|
|
64
|
+
echo ""
|
|
65
|
+
echo -e "${RED}⚠️ Push to ${remote_branch} blocked in team mode${NC}"
|
|
66
|
+
echo ""
|
|
67
|
+
exit 1
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
# For develop → main or release/* → main, ask for confirmation
|
|
71
|
+
if [ "$local_branch" = "develop" ] || [ "${local_branch#release/}" != "$local_branch" ]; then
|
|
72
|
+
echo ""
|
|
73
|
+
echo -e "${YELLOW}⚠️ TEAM MODE: Pushing ${local_branch} → ${remote_branch}${NC}"
|
|
74
|
+
echo ""
|
|
75
|
+
echo "📋 Summary:"
|
|
76
|
+
echo " • Source branch: ${local_branch}"
|
|
77
|
+
echo " • Target branch: ${remote_branch}"
|
|
78
|
+
echo " • Mode: TEAM MODE (strict enforcement)"
|
|
79
|
+
echo ""
|
|
80
|
+
read -p "❓ Are you sure you want to push ${local_branch} to ${remote_branch}? (y/n) " -n 1 -r
|
|
81
|
+
echo ""
|
|
82
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
83
|
+
echo -e "${RED}✓ Push cancelled by user${NC}"
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
fi
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
# PERSONAL MODE: Advisory warnings (allow all pushes)
|
|
90
|
+
if [ "$TEAM_MODE" = false ]; then
|
|
91
|
+
# Advisory: recommend develop -> main workflow
|
|
92
|
+
if [ "$local_branch" != "develop" ] && [ "${local_branch#release/}" = "$local_branch" ]; then
|
|
93
|
+
echo ""
|
|
94
|
+
echo -e "${YELLOW}⚠️ ADVISORY: Non-standard GitFlow detected${NC}"
|
|
95
|
+
echo ""
|
|
96
|
+
echo -e "${BLUE}Current branch: ${local_branch}${NC}"
|
|
97
|
+
echo -e "${BLUE}Target branch: ${remote_branch}${NC}"
|
|
98
|
+
echo ""
|
|
99
|
+
echo "Recommended GitFlow workflow:"
|
|
100
|
+
echo " 1. Work on feature/SPEC-{ID} branch (created from develop)"
|
|
101
|
+
echo " 2. Push to feature/SPEC-{ID} and create PR to develop"
|
|
102
|
+
echo " 3. Merge into develop after code review"
|
|
103
|
+
echo " 4. When develop is stable, create PR from develop to main"
|
|
104
|
+
echo " 5. Release manager merges develop -> main with tag"
|
|
105
|
+
echo ""
|
|
106
|
+
echo -e "${GREEN}✓ Push will proceed (personal mode - flexibility enabled)${NC}"
|
|
107
|
+
echo ""
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
# Check for delete operation
|
|
111
|
+
if [ "$local_oid" = "0000000000000000000000000000000000000000" ]; then
|
|
112
|
+
echo ""
|
|
113
|
+
echo -e "${RED}⚠️ WARNING: Attempting to delete main branch${NC}"
|
|
114
|
+
echo ""
|
|
115
|
+
echo -e "${YELLOW}This operation is highly discouraged.${NC}"
|
|
116
|
+
echo -e "${GREEN}✓ Push will proceed (personal mode - flexibility enabled)${NC}"
|
|
117
|
+
echo ""
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
# Check for force push attempts to main
|
|
121
|
+
if [ "$remote_branch" = "main" ] || [ "$remote_branch" = "master" ]; then
|
|
122
|
+
# Check if remote_oid exists (non-zero means we're trying to update existing ref)
|
|
123
|
+
if [ "$remote_oid" != "0000000000000000000000000000000000000000" ]; then
|
|
124
|
+
# Verify this is a fast-forward merge (no force push)
|
|
125
|
+
if ! git merge-base --is-ancestor "$remote_oid" "$local_oid" 2>/dev/null; then
|
|
126
|
+
echo ""
|
|
127
|
+
echo -e "${YELLOW}⚠️ ADVISORY: Force-push to main branch detected${NC}"
|
|
128
|
+
echo ""
|
|
129
|
+
echo "Recommended approach:"
|
|
130
|
+
echo " - Use GitHub PR with proper code review"
|
|
131
|
+
echo " - Ensure changes are merged via fast-forward"
|
|
132
|
+
echo ""
|
|
133
|
+
echo -e "${GREEN}✓ Push will proceed (personal mode - flexibility enabled)${NC}"
|
|
134
|
+
echo ""
|
|
135
|
+
fi
|
|
136
|
+
fi
|
|
137
|
+
fi
|
|
138
|
+
fi
|
|
139
|
+
fi
|
|
140
|
+
done
|
|
141
|
+
|
|
142
|
+
# All checks passed (or advisory warnings shown)
|
|
143
|
+
exit 0
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# @CODE:LANG-GO-001 | SPEC: SPEC-LANGUAGE-DETECTION-001.md | TEST: tests/test_workflows.py
|
|
2
|
+
# Go Project TAG Validation Workflow
|
|
3
|
+
# Automatically validates TAGs with go test, golangci-lint, and coverage
|
|
4
|
+
|
|
5
|
+
name: TAG Validation (Go)
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches: [main, develop, feature/**]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [main, develop]
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
validate:
|
|
19
|
+
name: Validate TAGs - Go ${{ matrix.go-version }}
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
strategy:
|
|
23
|
+
matrix:
|
|
24
|
+
go-version: ['1.22', '1.23']
|
|
25
|
+
fail-fast: false
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
|
|
33
|
+
- name: Set up Go ${{ matrix.go-version }}
|
|
34
|
+
uses: actions/setup-go@v6
|
|
35
|
+
with:
|
|
36
|
+
go-version: ${{ matrix.go-version }}
|
|
37
|
+
cache: true
|
|
38
|
+
|
|
39
|
+
- name: Cache Go modules
|
|
40
|
+
uses: actions/cache@v4
|
|
41
|
+
with:
|
|
42
|
+
path: |
|
|
43
|
+
~/.cache/go-build
|
|
44
|
+
~/go/pkg/mod
|
|
45
|
+
key: go-${{ runner.os }}-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
|
46
|
+
restore-keys: |
|
|
47
|
+
go-${{ runner.os }}-${{ matrix.go-version }}-
|
|
48
|
+
go-${{ runner.os }}-
|
|
49
|
+
|
|
50
|
+
- name: Download dependencies
|
|
51
|
+
run: go mod download
|
|
52
|
+
|
|
53
|
+
- name: Verify dependencies
|
|
54
|
+
run: go mod verify
|
|
55
|
+
|
|
56
|
+
- name: Run go fmt
|
|
57
|
+
run: |
|
|
58
|
+
FMT_OUTPUT=$(gofmt -l .)
|
|
59
|
+
if [ -n "$FMT_OUTPUT" ]; then
|
|
60
|
+
echo "Files need formatting:"
|
|
61
|
+
echo "$FMT_OUTPUT"
|
|
62
|
+
exit 1
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
- name: Run golangci-lint
|
|
66
|
+
uses: golangci/golangci-lint-action@v6
|
|
67
|
+
with:
|
|
68
|
+
version: latest
|
|
69
|
+
args: --timeout=5m
|
|
70
|
+
|
|
71
|
+
- name: Run tests with coverage
|
|
72
|
+
run: |
|
|
73
|
+
go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
|
|
74
|
+
go tool cover -func=coverage.out
|
|
75
|
+
|
|
76
|
+
- name: Check coverage threshold
|
|
77
|
+
run: |
|
|
78
|
+
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
|
|
79
|
+
echo "Total coverage: ${COVERAGE}%"
|
|
80
|
+
if (( $(echo "$COVERAGE < 75" | bc -l) )); then
|
|
81
|
+
echo "❌ Coverage ${COVERAGE}% is below 75% threshold"
|
|
82
|
+
exit 1
|
|
83
|
+
fi
|
|
84
|
+
echo "✅ Coverage ${COVERAGE}% meets 75% threshold"
|
|
85
|
+
|
|
86
|
+
- name: Upload coverage reports
|
|
87
|
+
if: matrix.go-version == '1.23'
|
|
88
|
+
uses: actions/upload-artifact@v4
|
|
89
|
+
with:
|
|
90
|
+
name: coverage-report-go
|
|
91
|
+
path: coverage.out
|
|
92
|
+
|
|
93
|
+
- name: Comment PR with coverage
|
|
94
|
+
if: github.event_name == 'pull_request' && matrix.go-version == '1.23'
|
|
95
|
+
uses: codecov/codecov-action@v5
|
|
96
|
+
with:
|
|
97
|
+
files: ./coverage.out
|
|
98
|
+
flags: go
|
|
99
|
+
fail_ci_if_error: false
|
|
100
|
+
|
|
101
|
+
- name: Run go vet
|
|
102
|
+
run: go vet ./...
|
|
103
|
+
|
|
104
|
+
- name: Build project
|
|
105
|
+
run: go build -v ./...
|
|
106
|
+
|
|
107
|
+
quality-gate:
|
|
108
|
+
name: Quality Gate Summary
|
|
109
|
+
needs: validate
|
|
110
|
+
runs-on: ubuntu-latest
|
|
111
|
+
if: always()
|
|
112
|
+
|
|
113
|
+
steps:
|
|
114
|
+
- name: Check validation results
|
|
115
|
+
run: |
|
|
116
|
+
if [ "${{ needs.validate.result }}" != "success" ]; then
|
|
117
|
+
echo "❌ TAG validation failed"
|
|
118
|
+
exit 1
|
|
119
|
+
fi
|
|
120
|
+
echo "✅ TAG validation passed"
|
|
121
|
+
|
|
122
|
+
- name: Quality metrics summary
|
|
123
|
+
run: |
|
|
124
|
+
echo "## Quality Metrics Summary" >> $GITHUB_STEP_SUMMARY
|
|
125
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
126
|
+
echo "- ✅ Go tests passed" >> $GITHUB_STEP_SUMMARY
|
|
127
|
+
echo "- ✅ Code coverage ≥ 75%" >> $GITHUB_STEP_SUMMARY
|
|
128
|
+
echo "- ✅ Linting passed (golangci-lint)" >> $GITHUB_STEP_SUMMARY
|
|
129
|
+
echo "- ✅ Formatting checked (gofmt)" >> $GITHUB_STEP_SUMMARY
|
|
130
|
+
echo "- ✅ Build successful" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# @CODE:LANG-JS-001 | SPEC: SPEC-LANGUAGE-DETECTION-001.md | TEST: tests/test_workflows.py
|
|
2
|
+
# JavaScript Project TAG Validation Workflow
|
|
3
|
+
# Automatically validates TAGs in JavaScript projects with npm/yarn/pnpm auto-detection
|
|
4
|
+
|
|
5
|
+
name: TAG Validation (JavaScript)
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches: [main, develop, feature/**]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [main, develop]
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
validate:
|
|
19
|
+
name: Validate TAGs - Node ${{ matrix.node-version }}
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
strategy:
|
|
23
|
+
matrix:
|
|
24
|
+
node-version: ['20', '22']
|
|
25
|
+
fail-fast: false
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
|
|
33
|
+
- name: Set up Node.js ${{ matrix.node-version }}
|
|
34
|
+
uses: actions/setup-node@v6
|
|
35
|
+
with:
|
|
36
|
+
node-version: ${{ matrix.node-version }}
|
|
37
|
+
|
|
38
|
+
- name: Detect package manager
|
|
39
|
+
id: detect-pm
|
|
40
|
+
run: |
|
|
41
|
+
if [ -f "bun.lockb" ]; then
|
|
42
|
+
echo "manager=bun" >> $GITHUB_OUTPUT
|
|
43
|
+
echo "lockfile=bun.lockb" >> $GITHUB_OUTPUT
|
|
44
|
+
elif [ -f "pnpm-lock.yaml" ]; then
|
|
45
|
+
echo "manager=pnpm" >> $GITHUB_OUTPUT
|
|
46
|
+
echo "lockfile=pnpm-lock.yaml" >> $GITHUB_OUTPUT
|
|
47
|
+
elif [ -f "yarn.lock" ]; then
|
|
48
|
+
echo "manager=yarn" >> $GITHUB_OUTPUT
|
|
49
|
+
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
|
|
50
|
+
else
|
|
51
|
+
echo "manager=npm" >> $GITHUB_OUTPUT
|
|
52
|
+
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
- name: Setup package manager cache
|
|
56
|
+
uses: actions/setup-node@v6
|
|
57
|
+
with:
|
|
58
|
+
node-version: ${{ matrix.node-version }}
|
|
59
|
+
cache: ${{ steps.detect-pm.outputs.manager }}
|
|
60
|
+
|
|
61
|
+
- name: Install pnpm (if needed)
|
|
62
|
+
if: steps.detect-pm.outputs.manager == 'pnpm'
|
|
63
|
+
run: npm install -g pnpm
|
|
64
|
+
|
|
65
|
+
- name: Install Bun (if needed)
|
|
66
|
+
if: steps.detect-pm.outputs.manager == 'bun'
|
|
67
|
+
uses: oven-sh/setup-bun@v2
|
|
68
|
+
|
|
69
|
+
- name: Install dependencies
|
|
70
|
+
run: |
|
|
71
|
+
case "${{ steps.detect-pm.outputs.manager }}" in
|
|
72
|
+
npm)
|
|
73
|
+
npm ci
|
|
74
|
+
;;
|
|
75
|
+
yarn)
|
|
76
|
+
yarn install --frozen-lockfile
|
|
77
|
+
;;
|
|
78
|
+
pnpm)
|
|
79
|
+
pnpm install --frozen-lockfile
|
|
80
|
+
;;
|
|
81
|
+
bun)
|
|
82
|
+
bun install --frozen-lockfile
|
|
83
|
+
;;
|
|
84
|
+
esac
|
|
85
|
+
|
|
86
|
+
- name: Run linting
|
|
87
|
+
run: |
|
|
88
|
+
if [ -f "biome.json" ]; then
|
|
89
|
+
npx @biomejs/biome check src/
|
|
90
|
+
elif command -v eslint &> /dev/null; then
|
|
91
|
+
npm run lint || npx eslint src/
|
|
92
|
+
fi
|
|
93
|
+
continue-on-error: false
|
|
94
|
+
|
|
95
|
+
- name: Run tests with coverage
|
|
96
|
+
run: npm test -- --coverage --coverage-threshold=80
|
|
97
|
+
continue-on-error: false
|
|
98
|
+
|
|
99
|
+
- name: Upload coverage reports
|
|
100
|
+
if: matrix.node-version == '22'
|
|
101
|
+
uses: actions/upload-artifact@v4
|
|
102
|
+
with:
|
|
103
|
+
name: coverage-report-javascript
|
|
104
|
+
path: coverage/
|
|
105
|
+
|
|
106
|
+
- name: Comment PR with coverage
|
|
107
|
+
if: github.event_name == 'pull_request' && matrix.node-version == '22'
|
|
108
|
+
uses: ArtiomTr/jest-coverage-report-action@v2
|
|
109
|
+
with:
|
|
110
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
111
|
+
threshold: 80
|
|
112
|
+
|
|
113
|
+
quality-gate:
|
|
114
|
+
name: Quality Gate Summary
|
|
115
|
+
needs: validate
|
|
116
|
+
runs-on: ubuntu-latest
|
|
117
|
+
if: always()
|
|
118
|
+
|
|
119
|
+
steps:
|
|
120
|
+
- name: Check validation results
|
|
121
|
+
run: |
|
|
122
|
+
if [ "${{ needs.validate.result }}" != "success" ]; then
|
|
123
|
+
echo "❌ TAG validation failed"
|
|
124
|
+
exit 1
|
|
125
|
+
fi
|
|
126
|
+
echo "✅ TAG validation passed"
|
|
127
|
+
|
|
128
|
+
- name: Quality metrics summary
|
|
129
|
+
run: |
|
|
130
|
+
echo "## Quality Metrics Summary" >> $GITHUB_STEP_SUMMARY
|
|
131
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
132
|
+
echo "- ✅ JavaScript tests passed" >> $GITHUB_STEP_SUMMARY
|
|
133
|
+
echo "- ✅ Code coverage ≥ 80%" >> $GITHUB_STEP_SUMMARY
|
|
134
|
+
echo "- ✅ Linting passed" >> $GITHUB_STEP_SUMMARY
|
|
135
|
+
echo "- ✅ TAG chain validated" >> $GITHUB_STEP_SUMMARY
|