Skip to content

fix: standardize greenfield guard across claude-code-mastery squad agents#815

Open
GiovaneLaurencio wants to merge 2 commits into
SynkraAI:mainfrom
GiovaneLaurencio:fix/standardize-squad-greenfield-guard
Open

fix: standardize greenfield guard across claude-code-mastery squad agents#815
GiovaneLaurencio wants to merge 2 commits into
SynkraAI:mainfrom
GiovaneLaurencio:fix/standardize-squad-greenfield-guard

Conversation

@GiovaneLaurencio

@GiovaneLaurencio GiovaneLaurencio commented Jul 26, 2026

Copy link
Copy Markdown

📋 Description

Companion to #813, applying the same GREENFIELD GUARD fix to the 8 agents in squads/claude-code-mastery/, which carried the same defects — plus two problems of their own.

1. Agent Authority violation (Constitution Article II). 4 of the 8 agents recommended *environment-bootstrap, a @devops-exclusive command that none of them owns: hooks-architect, mcp-integrator, skill-craftsman, swarm-orchestrator. Verified with grep -lE "^ - name: environment-bootstrap$" across the squad — zero matches.

2. False positive in non-project directories. Same as #813: the trigger is only "not a git repository", so activating from C:\Users\{name} produced a recommendation whose task would git init over the user's profile, while labelling that directory a "Greenfield project".

3. Four typographic variants of the same three lines. Across the 8 files the guard existed as -- vs , with and without **bold**, with and without the 📊 emoji.

4. Unparseable YAML in swarm-orchestrator.md. Pre-existing, found while validating this change, and fixed in the second commit — details below.

📦 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)

🎯 Scope

  • Squad (squads/)

📝 Changes Made

Commit 1 — guard standardization

Agent Before After
hooks-architect *environment-bootstrap @devops *environment-bootstrap
mcp-integrator *environment-bootstrap @devops *environment-bootstrap
skill-craftsman *environment-bootstrap @devops *environment-bootstrap
swarm-orchestrator *environment-bootstrap @devops *environment-bootstrap
config-engineer *configure unchanged — owns it
project-integrator *integrate-project unchanged — owns it
roadmap-sentinel *check-updates unchanged — owns it
claude-mastery-chief no recommendation tip-only branch

Each of the three retained commands was verified to exist in its own agent's commands block, so no further phantom commands are being recommended.

All 8 now carry byte-identical guard lines, matching the wording landed for the core agents in #813:

- For substep 3: show "📊 **Project Status:** No git repository detected in the working directory" instead of git narrative
- After substep 6, decide from the working directory path already in the system prompt (zero I/O):
  - If it is a user home directory (...) or any other non-project directory: show "💡 **Tip:** ..." and do NOT recommend a project command
  - Otherwise (an actual project directory): show "💡 **Recommended:** Run `<command>` ..."
- Do NOT run any git commands during activation — they will fail and produce errors

Commit 2 — invalid YAML in voice_dna.lexicon

The 8 entries had the shape:

- "topology" (preferred over "structure" for agent arrangements)

YAML closes the scalar at the second quote and the trailing (preferred ...) becomes a stray token, so js-yaml rejected the entire embedded block (bad indentation of a sequence entry) — the agent definition was unparseable by any tooling that reads it as YAML. Each entry is now single-quoted, which keeps the inner double quotes verbatim and keeps the parenthetical inside the value instead of turning it into a comment:

- '"topology" (preferred over "structure" for agent arrangements)'

Entries elsewhere in the squad of the form - "text" # comment were deliberately left alone: the # makes the tail a comment, so those already parse.

🧪 Testing

  • Guard uniformity: grep -h 'For substep 3' squads/claude-code-mastery/agents/*.md | sort | uniq -c8 identical lines (was 4 variants). Same for the Do NOT run line.
  • No undelegated bootstrap recommendation remains in the squad.
  • YAML parse of the embedded block in all 8 agents → 8 valid, 0 invalid (was 7/1 before commit 2).
  • voice_dna.lexicon still yields 8 entries after the fix, text unchanged.
  • npm run lint and npm run typecheck pass, though neither inspects markdown.

⚠️ One thing for maintainers

validate:agents does not cover squads. npm run validate:agents validates only the 12 core agents in .aiox-core/development/agents/, so squad definitions have no automated YAML or consistency gate. That is precisely why 4 typographic variants and a YAML block that no parser accepts could coexist here unnoticed. Extending the validator to squads/*/agents/ would have caught both problems in this PR before they shipped.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Updated agent activation “Project Status” messaging when no git repository is detected.
    • Added clearer, path-based guidance for home/non-project directories, including a tip to activate from inside the project directory.
    • Added improved recommendations for actual project directories (e.g., running the relevant project setup/check commands).
    • Continued to avoid running git commands during activation.

…ents

The squad's 8 agents carried the same GREENFIELD GUARD as the core agents, with
the same two defects plus a consistency problem of their own.

Agent Authority (Constitution Article II): 4 of the 8 recommended
`*environment-bootstrap`, a @devops-exclusive command none of them owns
(hooks-architect, mcp-integrator, skill-craftsman, swarm-orchestrator). They now
delegate: `@devops *environment-bootstrap`. The 3 agents that recommend a
command they actually own keep it unchanged — `*configure` (config-engineer),
`*integrate-project` (project-integrator), `*check-updates` (roadmap-sentinel);
each was verified to exist in its own `commands` block.

False positive in non-project directories: the guard fired wherever there was no
git repo, including a user home directory, and labelled it a "Greenfield
project". It now decides from the working directory path already present in the
system prompt (zero extra I/O): a home or non-project directory gets a tip to
activate from inside the project instead of a command recommendation.
claude-mastery-chief, which never recommended anything, gets the tip branch only.

Typographic consistency: the three guard lines existed in 4 different variants
across the 8 files (`--` vs `—`, with and without bold, with and without emoji).
All 8 now carry byte-identical lines, matching the core agents.

Note: `npm run validate:agents` covers only the 12 core agents, not squads. A
manual YAML parse of all 8 found swarm-orchestrator.md invalid at its `lexicon:`
block — pre-existing (fails identically at HEAD, before this change) and left
untouched here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@GiovaneLaurencio is attempting to deploy a commit to the SINKRA - AIOX Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Eight Claude Code Mastery agent activation instructions now use clearer no-git status text and path-aware follow-up guidance for home, non-project, and actual project directories. Selected swarm-orchestrator lexicon strings also received quoting-format updates.

Changes

No-git activation guidance

Layer / File(s) Summary
Path-aware activation flow
squads/claude-code-mastery/agents/claude-mastery-chief.md, config-engineer.md, hooks-architect.md, mcp-integrator.md, project-integrator.md, roadmap-sentinel.md, skill-craftsman.md, swarm-orchestrator.md
No-git status messages were revised, and follow-up tips or agent-specific commands now depend on whether the working directory is a home/non-project directory or an actual project directory. Git commands remain prohibited during activation.
Voice lexicon quoting
squads/claude-code-mastery/agents/swarm-orchestrator.md
Selected voice_dna.lexicon strings now use updated quoting and escaping while retaining the same entries.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • SynkraAI/aiox-core#813: Related updates to no-git activation messaging and project-directory recommendations.

Suggested labels: area: agents

Suggested reviewers: pedrovaleriolopez

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: standardizing the greenfield guard across squad agents.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 26, 2026
The 8 entries under `voice_dna.lexicon` had the shape:

    - "topology" (preferred over "structure" for agent arrangements)

YAML closes the scalar at the second quote, leaving ` (preferred ...)` as a
stray token — js-yaml rejected the whole embedded block with "bad indentation
of a sequence entry", so the agent definition was unparseable by any tooling.

Each entry is now wrapped in single quotes, which keeps the inner double quotes
verbatim and keeps the parenthetical part of the value rather than turning it
into a comment:

    - '"topology" (preferred over "structure" for agent arrangements)'

Verified: all 8 squad agents now parse, and lexicon still yields 8 entries with
their text unchanged. Entries elsewhere in the squad of the form
`- "text" # comment` were left alone — the `#` makes those valid already.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant