fix: standardize greenfield guard across claude-code-mastery squad agents#815
Conversation
…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>
|
@GiovaneLaurencio is attempting to deploy a commit to the SINKRA - AIOX Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughEight 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. ChangesNo-git activation guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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>
📋 Description
Companion to #813, applying the same
GREENFIELD GUARDfix to the 8 agents insquads/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 withgrep -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 wouldgit initover 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
🎯 Scope
squads/)📝 Changes Made
Commit 1 — guard standardization
hooks-architect*environment-bootstrap@devops *environment-bootstrapmcp-integrator*environment-bootstrap@devops *environment-bootstrapskill-craftsman*environment-bootstrap@devops *environment-bootstrapswarm-orchestrator*environment-bootstrap@devops *environment-bootstrapconfig-engineer*configureproject-integrator*integrate-projectroadmap-sentinel*check-updatesclaude-mastery-chiefEach of the three retained commands was verified to exist in its own agent's
commandsblock, 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:
Commit 2 — invalid YAML in
voice_dna.lexiconThe 8 entries had the shape:
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" # commentwere deliberately left alone: the#makes the tail a comment, so those already parse.🧪 Testing
grep -h 'For substep 3' squads/claude-code-mastery/agents/*.md | sort | uniq -c→ 8 identical lines (was 4 variants). Same for theDo NOT runline.voice_dna.lexiconstill yields 8 entries after the fix, text unchanged.npm run lintandnpm run typecheckpass, though neither inspects markdown.validate:agentsdoes not cover squads.npm run validate:agentsvalidates 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 tosquads/*/agents/would have caught both problems in this PR before they shipped.🤖 Generated with Claude Code
Summary by CodeRabbit