Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1bb3ed0
Adicionando psr4 e o autoload para utilização com tecnologias mais at…
Oct 11, 2017
dbdf067
Merge origin/master
Oct 11, 2017
98d87e8
Adicionando psr4 e o autoload para utilização com tecnologias mais at…
Oct 11, 2017
8bdb385
Adicionando psr4 e o autoload para utilização com tecnologias mais at…
Oct 11, 2017
a1d67e6
Adicionando psr4 e o autoload para utilização com tecnologias mais at…
Oct 12, 2017
0822ffc
CHange to psr-0
Oct 12, 2017
ce26962
CHange to psr-0
Oct 12, 2017
70a7674
Change to psr-0
Oct 12, 2017
24a7b7d
Change to psr-0
Oct 12, 2017
65b7e45
Change to psr-0
Oct 12, 2017
d655bab
chore(ci): add manager-worker orchestrator (canonical)
luizkim Aug 15, 2026
b76972f
chore(ci): add manager subworker composite action
luizkim Aug 15, 2026
d6c7201
chore(ci): add qa subworker composite action
luizkim Aug 15, 2026
d285dcb
chore(ci): add security subworker composite action
luizkim Aug 15, 2026
823da91
chore(ci): add technical-documenter subworker composite action
luizkim Aug 15, 2026
6277706
fix(ci): workers mínimos — regras só no agents-mcp (#142)
luizkim Aug 15, 2026
c8b704e
fix(ci): workers mínimos — regras só no agents-mcp (#142)
luizkim Aug 15, 2026
729bb35
fix(ci): workers mínimos — regras só no agents-mcp (#142)
luizkim Aug 15, 2026
6b85f22
fix(ci): worker com um único link canônico (#142)
luizkim Aug 15, 2026
c0230f4
fix(ci): worker com um único link canônico (#142)
luizkim Aug 15, 2026
7b5709b
fix(ci): worker com um único link canônico (#142)
luizkim Aug 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions .github/actions/workers/manager/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Manager Subworker
description: Resolve/cria issue, aplica labels e decide quais workers invocar (padrão de branch = master)
inputs:
gh_token:
description: PAT (GH_TOKEN)
required: true
branch:
description: Branch do push (master|dev|staging)
required: true
outputs:
issue_number:
description: Número da issue fonte
value: ${{ steps.resolve.outputs.issue_number }}
created:
description: true se a issue foi criada agora
value: ${{ steps.resolve.outputs.created }}
found:
description: true se issue veio do commit
value: ${{ steps.resolve.outputs.found }}
run_qa:
description: Manager decide invocar QA
value: ${{ steps.resolve.outputs.run_qa }}
run_security:
description: Manager decide invocar Security
value: ${{ steps.resolve.outputs.run_security }}
run_docs:
description: Manager decide invocar Technical Documenter
value: ${{ steps.resolve.outputs.run_docs }}
run_gates:
description: Manager decide checar quarteto em master
value: ${{ steps.resolve.outputs.run_gates }}
base_branch:
description: Branch canônico (sempre master se veio main)
value: ${{ steps.resolve.outputs.base_branch }}
runs:
using: composite
steps:
- name: Resolve issue, labels e plano de workers
id: resolve
shell: bash
env:
GH_TOKEN: ${{ inputs.gh_token }}
BRANCH_IN: ${{ inputs.branch }}
REPO: ${{ github.repository }}
SHA: ${{ github.sha }}
MSG: ${{ github.event.head_commit.message }}
BEFORE: ${{ github.event.before }}
run: |
set -euo pipefail

# Padrão da org: master (nunca main como branch de trabalho)
BRANCH="$BRANCH_IN"
if [ "$BRANCH" = "main" ]; then
echo "AVISO: branch main detectada — tratando como master (padrão org)"
BRANCH="master"
fi
echo "base_branch=$BRANCH" >> "$GITHUB_OUTPUT"

MESSAGES=$(git log --pretty=format:"%s %b" "${BEFORE}..${SHA}" 2>/dev/null || git log -1 --pretty=format:"%s %b")
ISSUE_REF=$(echo "$MESSAGES" | grep -oE '([A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)?#([0-9]+)' | head -1 || true)

if [ -n "$ISSUE_REF" ]; then
NUM=$(echo "$ISSUE_REF" | grep -oE '[0-9]+$')
echo "found=true" >> "$GITHUB_OUTPUT"
echo "created=false" >> "$GITHUB_OUTPUT"
echo "issue_number=$NUM" >> "$GITHUB_OUTPUT"
echo "Issue fonte: #$NUM"
else
echo "Push sem issue → Manager cria issue"
TITLE="ops: orquestração automática (push ${BRANCH} ${SHA:0:7})"
BODY=$(cat <<EOF
## Manager Worker — issue automática

Push em \`${BRANCH}\` sem referência de issue no commit.

- **Commit**: ${SHA}
- **Mensagem**: ${MSG}

O Manager aplica labels e **invoca** os workers necessários (QA / Security / Technical Documenter) conforme o branch.

Fonte: https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/roles/manager/agent.md
EOF
)

LABELS='["agent:manager"]'
case "$BRANCH" in
master)
LABELS='["agent:manager","agent:technical-documenter"]'
;;
dev)
LABELS='["agent:manager","agent:qa","agent:security","agent:developer:done"]'
;;
staging)
LABELS='["agent:manager","agent:qa","agent:security"]'
;;
esac

RESPONSE=$(gh api --method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${REPO}/issues" \
--input - <<EOF
{
"title": $(echo "$TITLE" | jq -Rs .),
"body": $(echo "$BODY" | jq -Rs .),
"labels": $LABELS
}
EOF
)
NUM=$(echo "$RESPONSE" | jq -r .number)
echo "found=false" >> "$GITHUB_OUTPUT"
echo "created=true" >> "$GITHUB_OUTPUT"
echo "issue_number=$NUM" >> "$GITHUB_OUTPUT"
echo "Issue criada: #$NUM"
fi

# Manager decide quais workers invocar
run_qa=false
run_security=false
run_docs=false
run_gates=false

case "$BRANCH" in
master)
run_docs=true
run_gates=true
gh issue edit "$NUM" --repo "$REPO" --add-label "agent:technical-documenter" || true
;;
dev)
run_qa=true
run_security=true
gh issue edit "$NUM" --repo "$REPO" --add-label "agent:qa" --add-label "agent:security" --add-label "agent:developer:done" || true
;;
staging)
run_qa=true
run_security=true
gh issue edit "$NUM" --repo "$REPO" --add-label "agent:qa" --add-label "agent:security" || true
;;
esac

echo "run_qa=$run_qa" >> "$GITHUB_OUTPUT"
echo "run_security=$run_security" >> "$GITHUB_OUTPUT"
echo "run_docs=$run_docs" >> "$GITHUB_OUTPUT"
echo "run_gates=$run_gates" >> "$GITHUB_OUTPUT"

gh issue comment "$NUM" --repo "$REPO" --body \
"**Manager** orquestrou push \`${BRANCH}\`: run_qa=$run_qa run_security=$run_security run_docs=$run_docs run_gates=$run_gates. Workers serão invocados a seguir."
44 changes: 44 additions & 0 deletions .github/actions/workers/qa/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: QA Worker
description: Assign Copilot as QA — single link to agents-mcp
inputs:
gh_token:
required: true
issue_number:
required: true
base_branch:
default: dev
runs:
using: composite
steps:
- name: Assign Copilot as QA
shell: bash
env:
GH_TOKEN: ${{ inputs.gh_token }}
ISSUE: ${{ inputs.issue_number }}
REPO: ${{ github.repository }}
BASE: ${{ inputs.base_branch }}
run: |
set -euo pipefail
CUSTOM_INSTRUCTIONS='Atue 100% como QA do ControleOnline.
Leia e siga OBRIGATORIAMENTE a fonte canônica única:
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/roles/qa/agent.md'

gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:qa" || true

gh api --method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${REPO}/issues/${ISSUE}/assignees" \
--input - <<EOFINNER
{
"assignees": ["copilot-swe-agent[bot]"],
"agent_assignment": {
"target_repo": "${REPO}",
"base_branch": "${BASE}",
"custom_instructions": $(echo "$CUSTOM_INSTRUCTIONS" | jq -Rs .)
}
}
EOFINNER

gh issue comment "$ISSUE" --repo "$REPO" --body \
"Manager Worker → **QA**. Fonte: agents-mcp/agents/roles/qa/agent.md"
44 changes: 44 additions & 0 deletions .github/actions/workers/security/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Security Worker
description: Assign Copilot as Security — single link to agents-mcp
inputs:
gh_token:
required: true
issue_number:
required: true
base_branch:
default: dev
runs:
using: composite
steps:
- name: Assign Copilot as Security
shell: bash
env:
GH_TOKEN: ${{ inputs.gh_token }}
ISSUE: ${{ inputs.issue_number }}
REPO: ${{ github.repository }}
BASE: ${{ inputs.base_branch }}
run: |
set -euo pipefail
CUSTOM_INSTRUCTIONS='Atue 100% como Security do ControleOnline.
Leia e siga OBRIGATORIAMENTE a fonte canônica única:
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/roles/security/agent.md'

gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:security" || true

gh api --method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${REPO}/issues/${ISSUE}/assignees" \
--input - <<EOFINNER
{
"assignees": ["copilot-swe-agent[bot]"],
"agent_assignment": {
"target_repo": "${REPO}",
"base_branch": "${BASE}",
"custom_instructions": $(echo "$CUSTOM_INSTRUCTIONS" | jq -Rs .)
}
}
EOFINNER

gh issue comment "$ISSUE" --repo "$REPO" --body \
"Manager Worker → **Security**. Fonte: agents-mcp/agents/roles/security/agent.md"
51 changes: 51 additions & 0 deletions .github/actions/workers/technical-documenter/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Technical Documenter Worker
description: Assign Copilot as technical-documenter — rules live only in agents-mcp
inputs:
gh_token:
required: true
issue_number:
required: true
base_branch:
default: master
runs:
using: composite
steps:
- name: Assign Copilot as technical-documenter
shell: bash
env:
GH_TOKEN: ${{ inputs.gh_token }}
ISSUE: ${{ inputs.issue_number }}
REPO: ${{ github.repository }}
BASE: ${{ inputs.base_branch }}
run: |
set -euo pipefail
# Regras 100% no agents-mcp — não copiar checklist/labels aqui
CUSTOM_INSTRUCTIONS='Atue 100% como technical-documenter do ControleOnline.
Leia e siga OBRIGATORIAMENTE (fonte canônica única):
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/roles/technical-documenter/agent.md

Também leia:
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/skills/shared/operations/copilot-cooperation.md
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/skills/by-role/technical-documenter/README.md

Não use regras embutidas neste assignment; a fonte acima prevalece.'

gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:technical-documenter" || true

gh api --method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${REPO}/issues/${ISSUE}/assignees" \
--input - <<EOFINNER
{
"assignees": ["copilot-swe-agent[bot]"],
"agent_assignment": {
"target_repo": "${REPO}",
"base_branch": "${BASE}",
"custom_instructions": $(echo "$CUSTOM_INSTRUCTIONS" | jq -Rs .)
}
}
EOFINNER

gh issue comment "$ISSUE" --repo "$REPO" --body \
"Manager Worker → **technical-documenter**. Fonte: agents-mcp/agents/roles/technical-documenter/agent.md"
Loading