Skip to content

feat(sync): metrics aggregation, worktree isolation, sync-report, and scaffold policy enhancements#470

Merged
JustAGhosT merged 51 commits intomainfrom
dev
Mar 28, 2026
Merged

feat(sync): metrics aggregation, worktree isolation, sync-report, and scaffold policy enhancements#470
JustAGhosT merged 51 commits intomainfrom
dev

Conversation

@JustAGhosT
Copy link
Copy Markdown
Collaborator

Summary

  • GH#467 — Agent metrics pipeline: aggregate-metrics.mjs aggregator, [METRICS] event parsing, agent-health.json + agent-metrics.json written on session stop; wired into retrospective-analyst focus and orchestrate Phase 1 discovery
  • GH#444 — Worktree isolation rule: worktree-isolation.md template + orchestrate dispatch guidance for isolation: "worktree" on code-writing agent tasks
  • GH#422 — Block test suite scaffolding into adopter repos by default; isTestSuitePath() guard in resolveScaffoldAction(); opt-in via automation.testingExamples: true
  • GH#415sync-report.json emitted to .agentkit/ on every sync run: version, OS, git config, file counts, per-category summary, unresolved placeholders with file paths, errors; gitignored
  • GH#423 + GH#421adopt-if-missing scaffold policy added; scaffoldResults breakdown (scaffoldOnce, adoptIfMissing, managedMerged, conflicts, etc.) included in sync-report
  • GH#434 — Confirmed already resolved (session-start template already uses {{languageInferenceSource}})
  • docs — hookify event:file pattern fix, EOL normalization guide, sync sync: avoid daily churn from last_updated date headers #417 status, issue template with Sync Diagnostics section

Test plan

  • pnpm --dir .agentkit vitest run — all tests pass (232 in template-utils, full suite clean)
  • pnpm --dir .agentkit retort:sync — runs without error, writes .agentkit/sync-report.json
  • sync-report.json contains scaffoldResults, unresolvedPlaceholders, counts, git.autocrlf
  • node scripts/aggregate-metrics.mjs --state .claude/state — exits 0 (no events.log needed)
  • .claude/hooks/stop-build-check.sh — metrics aggregation block present

🤖 Generated with Claude Code

JustAGhosT and others added 30 commits March 11, 2026 08:55
* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------

Co-authored-by: Claude <noreply@anthropic.com>
* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, syncCodexSkills
- Add commandPrefix to vars from overlay settings
- Add commandPrefixedName to buildCommandVars
- Add 16 unit + integration tests (all pass, 93 existing tests unaffected)

Default is null (no prefix) for full backwards compatibility.

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

* fix(sync): address review findings for command prefix

- Remove unused afterAll import from test file
- Add clarifying comment that non-spec command files are also prefixed
- Add 2 integration tests verifying commandPrefixedName template variable
  renders correctly with and without prefix

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

---------

Co-authored-by: Claude <noreply@anthropic.com>
…ility (#390)

* fix(ci): resolve 7 bugs from project review

- BUG-001: Replace flaky discover test with controlled temp fixture
- BUG-002: Run prettier --write to fix formatting drift
- BUG-003: Add form-template detection skip in issue label validation
- BUG-005: Change claude.yml to self-hosted runner
- BUG-006: Align branch protection required status checks with project.yaml
- BUG-007: Fix command injection in resolve-merge.sh (use grep -F)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update changelog, add planning registry review findings

- Add changelog entries for Wave 1-3 fixes (Added/Changed/Fixed/Removed)
- Add Project Review Findings section to planning registry (PR-001 to PR-014)
- Update planning docs after sync merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(review): add --generate-plans flag to project-review command

Add Phase 2.5 plan generation after project review findings. When
--generate-plans is passed (default: true), scaffold plan files from
critical/high findings into docs/planning/review-findings/.

Also includes sync cleanup of stale cursor/windsurf settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate all outputs after project review fixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cli): dynamic flag loading from commands.yaml + context-aware template hook

- Replace ~200 lines of hardcoded VALID_FLAGS/FLAG_TYPES with loadCommandFlags()
  that reads flag definitions from commands.yaml at startup
- CLI_INTERNAL_FLAGS/CLI_INTERNAL_FLAG_TYPES cover commands not in commands.yaml
- Self-validation warns at startup if any flag is missing a type definition
- Update cli.test.mjs to validate CLI_INTERNAL_FLAGS consistency
- Fix scaffold-once orphan bug: carry forward manifest entries for files
  skipped by scaffold-once so orphan cleanup does not delete them
- Make protect-templates hook context-aware: skip protection in the
  agentkit-forge source repo (detected via package.json name) so
  maintainer agents can edit templates; block only in downstream repos

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(sync): add managed-mode script templates for downstream repos

Add 14 script templates (.agentkit/templates/scripts/) with `managed`
scaffold mode so downstream repos receive script updates via three-way
merge while preserving local customizations.

Templates include: create-doc, update-changelog, validate-documentation,
validate-numbering, check-documentation-requirement, sync-issues,
sync-split-pr, setup-agentkit-branch-governance, and resolve-merge
(both .sh and .ps1 variants where applicable).

Parameterized templates use {{defaultBranch}} and branch protection
variables from project.yaml. Engine wired via syncScripts() under
doc-scaffolding feature gate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(teams): add TeamForge meta-team for agent team creation (cogmesh #130)

Add the TEAMFORGE meta-team (T11) — a structured pipeline for creating,
validating, and deploying new agent team specifications. Adapted from
cogmesh #130 with a simplified 6-agent pipeline:

- input-clarifier: assess requests, extract constraints
- mission-definer: lock team definition (ID, scope, accepts)
- role-architect: design agent roles and dependencies
- prompt-engineer: write agent descriptions and rules
- flow-designer: design team command and integration points
- team-validator: quality gate for spec consistency

Includes /team-forge command with --task flag (create-team, validate-team,
audit-teams, update-team) and planning doc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(teams): add Strategic Ops team for cross-project coordination

Add the STRATEGIC OPS team (T12) — handles framework governance,
portfolio analysis, adoption strategy, impact assessment, and release
coordination across all repos using AgentKit Forge.

5-agent pipeline:
- portfolio-analyst: inventory repos, detect drift, adoption metrics
- governance-advisor: versioning strategy, breaking change protocols
- adoption-strategist: onboarding, migration paths, rollout plans
- impact-assessor: blast radius analysis for template/spec changes
- release-coordinator: version bumps, sync waves, release comms

Includes /team-strategic-ops command with --task and --scope flags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(agents): add agent/team relationship matrix analysis engine + scripts

Add comprehensive agent/team relationship analysis with 8 cross-reference
matrices and 10 supplementary analyses (orphans, cycles, bottlenecks,
reachability, critical path, notification amplifiers, etc.).

- Fix YAML structure: strategic-ops agents now under own top-level key
- Add explicit agents: lists to forge + strategic-ops teams in teams.yaml
- Add consolidation detection responsibilities to portfolio-analyst
- Create agent-analysis.mjs engine module (loadFullAgentGraph + renderers)
- Wire analyze-agents CLI command with --output/--matrix/--format flags
- Add managed-scaffold script templates (bash + PowerShell)
- Integrate into sync pipeline (auto-regenerates matrix on spec changes)
- Add 33 tests covering all matrices, analyses, and edge cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update documentation files and add plan template

- Add trailing newlines to Cursor command documentation files for consistency
- Add new plan template files for project planning
- Improve markdown table formatting in Claude skills documentation
- Remove obsolete .clinerules/testing.md file
- Update various rule files with better formatting and advisory rule alignment

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add Cost Ops team, agents, and multi-provider cost ticket (#364)

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents (#365)

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): address CodeRabbit review findings on strategic-ops PR

- Lazy-load js-yaml in cli.mjs after ensureDependencies() to prevent
  crash when node_modules is missing
- Convert YAML frontmatter to PowerShell comment blocks in all 6 PS1
  templates to fix invalid PowerShell syntax
- Fix protect-templates hook path: use 3 parent traversals to reach
  .agentkit/package.json from hooks directory
- Remove schema-invalid 'phase' field from ai-cost-ops rule domain
- Narrow strategic-ops scope: replace **/* catch-all with specific files
- Add strategic-ops to cost-ops handoff-chain for consistency
- Add Write tool to spec-compliance-auditor, vendor-arbitrage-analyst,
  and grant-hunter agents
- Fix glob matching in resolve-merge.sh (use regex instead of broken
  sed strip)
- Add merge failure vs conflict detection in resolve-merge.ps1
- Add branch existence check in setup-agentkit-branch-governance scripts
- Add gh CLI preflight check in sync-split-pr.ps1
- Deduplicate branch protection loop when defaultBranch is 'main'
- Fix applies-to glob: docs/planning/cost/** → docs/planning/cost-governance/**
- Fix non-canonical doc paths in intake-agent-proposal.md
- Add changelog entries for new teams, agents, and analysis engine
- Resolve AGENT_TEAMS.md merge conflict (accept narrowed scope)
- Run prettier on all modified files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): add gh auth preflight and changelog divider handling

- sync-split-pr.ps1: add gh auth status check before side effects
- update-changelog.ps1: stop before --- divider when appending entries

Addresses CodeRabbit review comments #7 and #13 on PR #356.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(sync): set executable permission on analyze-agents.sh

Linux CI sync produces +x permissions; align local to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): address CodeRabbit review round 3-4 findings

- Fix YAML frontmatter in copilot agent template: use double quotes
  for description field to handle apostrophes (CRITICAL)
- Fix protect-templates.sh/ps1 path traversal: correct parent
  directory count for .agentkit/package.json source repo detection
- Add $PSNativeCommandUseErrorActionPreference to sync-split-pr.ps1
  so native command failures (git, pnpm, gh) are treated as fatal
- Replace try/catch with $LASTEXITCODE check for gh auth status
- Deduplicate branch loop in setup-agentkit-branch-governance.sh
  when defaultBranch equals 'main'
- Fix duplicate verification echo lines in governance scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style(docs): fix prettier formatting on planning documents

Run prettier --write on web-intake-expansion.md and
intake-agent-proposal.md to fix CI formatting check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(tests): isolate render target gating tests with fresh temp dirs

Tests in the "render target gating" describe block shared a single temp
directory via beforeAll/afterAll. The first test ran --only claude
(generating .claude/ files), and the second ran --only warp expecting no
Claude files — but leftovers from test 1 caused the assertion to fail.

Changing to beforeEach/afterEach gives each test a clean directory.

Closes #377

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(engine): add pre-sync commit guard and interactive apply mode

Adds two safety features to the sync pipeline:

1. Pre-sync commit guard: Detects uncommitted changes in protected
   directories (.agentkit/engines, spec, overlays) before sync runs.
   In TTY mode, prompts to abort, stash, or continue. In non-TTY
   mode (CI), prints a warning and proceeds.

2. Interactive apply mode: After rendering, shows a change summary
   and prompts: apply all / skip all / prompt each file. Per-file
   prompt supports show-diff and apply-all-remaining. Default in
   TTY; bypassed with --yes, --no-prompt, or --force.

New module: sync-guard.mjs with 4 exported functions and 7 tests.
New CLI flags: --yes, --no-prompt for non-interactive sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate outputs after branch merges

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate outputs after merge of new-user-entry-point

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(engine): add configurable package manager and fix review findings

- Add `stack.packageManager` field to project.yaml (pnpm | npm | yarn)
- Derive helper template vars (pmInstall, pmRun, pmExec, pmLockfile, etc.)
- Update CLAUDE.md template and hook/workflow templates to use {{packageManager}}
- Fix sync-guard to exclude .agentkit/spec from protected dirs and add try/catch
- Remove duplicate cost-ops team definition from teams.yaml
- Pin all dependency versions in package.json (remove ^ prefixes)
- Add vitest coverage thresholds (80% statements/branches/functions/lines)
- Fix src/start/ code quality: null guards, exit delay, error boundaries
- Harden consolidate-branches.sh: self-resolution guard, stash restore
- Regenerate all 533 output files via agentkit sync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(engine): add brand color palette variables to sync vars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ci): fix test race condition, workspace config, and lockfile

- Fix ConversationFlow test: wait for 'Got it' before asserting hint text
- Add packages field to pnpm-workspace.yaml for proper workspace resolution
- Regenerate lockfile after version pinning (removed ^ prefixes)
- Remove accidental .agentkit/templates/src/ artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(start): add event loop yields to ConversationFlow tests

ink-select-input needs setImmediate yields after a new menu renders
before it can process ENTER keypresses. Without this, the second ENTER
in leaf-selection tests was swallowed, causing intermittent failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* test(start): add coverage for result screen exit path

Add App-level test that navigates through ConversationFlow to a leaf
node and verifies the result screen text is rendered before exit().
Confirms the synchronous useEffect exit is safe — React commits the
render (Ink captures the frame) before useEffect fires.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: update generated sync output timestamps

Generated files updated with current sync date from dev merge.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

---------

Co-authored-by: Claude <noreply@anthropic.com>
* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------



* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, syncCodexSkills
- Add commandPrefix to vars from overlay settings
- Add commandPrefixedName to buildCommandVars
- Add 16 unit + integration tests (all pass, 93 existing tests unaffected)

Default is null (no prefix) for full backwards compatibility.

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

* fix(sync): address review findings for command prefix

- Remove unused afterAll import from test file
- Add clarifying comment that non-spec command files are also prefixed
- Add 2 integration tests verifying commandPrefixedName template variable
  renders correctly with and without prefix

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

---------



* fix(ci): CI remediation — package manager, review findings, test stability (#390)

* fix(ci): resolve 7 bugs from project review

- BUG-001: Replace flaky discover test with controlled temp fixture
- BUG-002: Run prettier --write to fix formatting drift
- BUG-003: Add form-template detection skip in issue label validation
- BUG-005: Change claude.yml to self-hosted runner
- BUG-006: Align branch protection required status checks with project.yaml
- BUG-007: Fix command injection in resolve-merge.sh (use grep -F)



* docs: update changelog, add planning registry review findings

- Add changelog entries for Wave 1-3 fixes (Added/Changed/Fixed/Removed)
- Add Project Review Findings section to planning registry (PR-001 to PR-014)
- Update planning docs after sync merge



* feat(review): add --generate-plans flag to project-review command

Add Phase 2.5 plan generation after project review findings. When
--generate-plans is passed (default: true), scaffold plan files from
critical/high findings into docs/planning/review-findings/.

Also includes sync cleanup of stale cursor/windsurf settings.



* chore(sync): regenerate all outputs after project review fixes



* feat(cli): dynamic flag loading from commands.yaml + context-aware template hook

- Replace ~200 lines of hardcoded VALID_FLAGS/FLAG_TYPES with loadCommandFlags()
  that reads flag definitions from commands.yaml at startup
- CLI_INTERNAL_FLAGS/CLI_INTERNAL_FLAG_TYPES cover commands not in commands.yaml
- Self-validation warns at startup if any flag is missing a type definition
- Update cli.test.mjs to validate CLI_INTERNAL_FLAGS consistency
- Fix scaffold-once orphan bug: carry forward manifest entries for files
  skipped by scaffold-once so orphan cleanup does not delete them
- Make protect-templates hook context-aware: skip protection in the
  agentkit-forge source repo (detected via package.json name) so
  maintainer agents can edit templates; block only in downstream repos



* feat(sync): add managed-mode script templates for downstream repos

Add 14 script templates (.agentkit/templates/scripts/) with `managed`
scaffold mode so downstream repos receive script updates via three-way
merge while preserving local customizations.

Templates include: create-doc, update-changelog, validate-documentation,
validate-numbering, check-documentation-requirement, sync-issues,
sync-split-pr, setup-agentkit-branch-governance, and resolve-merge
(both .sh and .ps1 variants where applicable).

Parameterized templates use {{defaultBranch}} and branch protection
variables from project.yaml. Engine wired via syncScripts() under
doc-scaffolding feature gate.



* feat(teams): add TeamForge meta-team for agent team creation (cogmesh #130)

Add the TEAMFORGE meta-team (T11) — a structured pipeline for creating,
validating, and deploying new agent team specifications. Adapted from
cogmesh #130 with a simplified 6-agent pipeline:

- input-clarifier: assess requests, extract constraints
- mission-definer: lock team definition (ID, scope, accepts)
- role-architect: design agent roles and dependencies
- prompt-engineer: write agent descriptions and rules
- flow-designer: design team command and integration points
- team-validator: quality gate for spec consistency

Includes /team-forge command with --task flag (create-team, validate-team,
audit-teams, update-team) and planning doc.



* feat(teams): add Strategic Ops team for cross-project coordination

Add the STRATEGIC OPS team (T12) — handles framework governance,
portfolio analysis, adoption strategy, impact assessment, and release
coordination across all repos using AgentKit Forge.

5-agent pipeline:
- portfolio-analyst: inventory repos, detect drift, adoption metrics
- governance-advisor: versioning strategy, breaking change protocols
- adoption-strategist: onboarding, migration paths, rollout plans
- impact-assessor: blast radius analysis for template/spec changes
- release-coordinator: version bumps, sync waves, release comms

Includes /team-strategic-ops command with --task and --scope flags.



* feat(agents): add agent/team relationship matrix analysis engine + scripts

Add comprehensive agent/team relationship analysis with 8 cross-reference
matrices and 10 supplementary analyses (orphans, cycles, bottlenecks,
reachability, critical path, notification amplifiers, etc.).

- Fix YAML structure: strategic-ops agents now under own top-level key
- Add explicit agents: lists to forge + strategic-ops teams in teams.yaml
- Add consolidation detection responsibilities to portfolio-analyst
- Create agent-analysis.mjs engine module (loadFullAgentGraph + renderers)
- Wire analyze-agents CLI command with --output/--matrix/--format flags
- Add managed-scaffold script templates (bash + PowerShell)
- Integrate into sync pipeline (auto-regenerates matrix on spec changes)
- Add 33 tests covering all matrices, analyses, and edge cases



* chore: update documentation files and add plan template

- Add trailing newlines to Cursor command documentation files for consistency
- Add new plan template files for project planning
- Improve markdown table formatting in Claude skills documentation
- Remove obsolete .clinerules/testing.md file
- Update various rule files with better formatting and advisory rule alignment

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



* feat(cost-ops): add Cost Ops team, agents, and multi-provider cost ticket (#364)

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents (#365)

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



---------



* fix(teams): address CodeRabbit review findings on strategic-ops PR

- Lazy-load js-yaml in cli.mjs after ensureDependencies() to prevent
  crash when node_modules is missing
- Convert YAML frontmatter to PowerShell comment blocks in all 6 PS1
  templates to fix invalid PowerShell syntax
- Fix protect-templates hook path: use 3 parent traversals to reach
  .agentkit/package.json from hooks directory
- Remove schema-invalid 'phase' field from ai-cost-ops rule domain
- Narrow strategic-ops scope: replace **/* catch-all with specific files
- Add strategic-ops to cost-ops handoff-chain for consistency
- Add Write tool to spec-compliance-auditor, vendor-arbitrage-analyst,
  and grant-hunter agents
- Fix glob matching in resolve-merge.sh (use regex instead of broken
  sed strip)
- Add merge failure vs conflict detection in resolve-merge.ps1
- Add branch existence check in setup-agentkit-branch-governance scripts
- Add gh CLI preflight check in sync-split-pr.ps1
- Deduplicate branch protection loop when defaultBranch is 'main'
- Fix applies-to glob: docs/planning/cost/** → docs/planning/cost-governance/**
- Fix non-canonical doc paths in intake-agent-proposal.md
- Add changelog entries for new teams, agents, and analysis engine
- Resolve AGENT_TEAMS.md merge conflict (accept narrowed scope)
- Run prettier on all modified files



* fix(templates): add gh auth preflight and changelog divider handling

- sync-split-pr.ps1: add gh auth status check before side effects
- update-changelog.ps1: stop before --- divider when appending entries

Addresses CodeRabbit review comments #7 and #13 on PR #356.



* fix(sync): set executable permission on analyze-agents.sh

Linux CI sync produces +x permissions; align local to match.



* fix(templates): address CodeRabbit review round 3-4 findings

- Fix YAML frontmatter in copilot agent template: use double quotes
  for description field to handle apostrophes (CRITICAL)
- Fix protect-templates.sh/ps1 path traversal: correct parent
  directory count for .agentkit/package.json source repo detection
- Add $PSNativeCommandUseErrorActionPreference to sync-split-pr.ps1
  so native command failures (git, pnpm, gh) are treated as fatal
- Replace try/catch with $LASTEXITCODE check for gh auth status
- Deduplicate branch loop in setup-agentkit-branch-governance.sh
  when defaultBranch equals 'main'
- Fix duplicate verification echo lines in governance scripts



* style(docs): fix prettier formatting on planning documents

Run prettier --write on web-intake-expansion.md and
intake-agent-proposal.md to fix CI formatting check.



* fix(tests): isolate render target gating tests with fresh temp dirs

Tests in the "render target gating" describe block shared a single temp
directory via beforeAll/afterAll. The first test ran --only claude
(generating .claude/ files), and the second ran --only warp expecting no
Claude files — but leftovers from test 1 caused the assertion to fail.

Changing to beforeEach/afterEach gives each test a clean directory.

Closes #377



* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(engine): add pre-sync commit guard and interactive apply mode

Adds two safety features to the sync pipeline:

1. Pre-sync commit guard: Detects uncommitted changes in protected
   directories (.agentkit/engines, spec, overlays) before sync runs.
   In TTY mode, prompts to abort, stash, or continue. In non-TTY
   mode (CI), prints a warning and proceeds.

2. Interactive apply mode: After rendering, shows a change summary
   and prompts: apply all / skip all / prompt each file. Per-file
   prompt supports show-diff and apply-all-remaining. Default in
   TTY; bypassed with --yes, --no-prompt, or --force.

New module: sync-guard.mjs with 4 exported functions and 7 tests.
New CLI flags: --yes, --no-prompt for non-interactive sync.



* chore(sync): regenerate outputs after branch merges



* chore(sync): regenerate outputs after merge of new-user-entry-point



* feat(engine): add configurable package manager and fix review findings

- Add `stack.packageManager` field to project.yaml (pnpm | npm | yarn)
- Derive helper template vars (pmInstall, pmRun, pmExec, pmLockfile, etc.)
- Update CLAUDE.md template and hook/workflow templates to use {{packageManager}}
- Fix sync-guard to exclude .agentkit/spec from protected dirs and add try/catch
- Remove duplicate cost-ops team definition from teams.yaml
- Pin all dependency versions in package.json (remove ^ prefixes)
- Add vitest coverage thresholds (80% statements/branches/functions/lines)
- Fix src/start/ code quality: null guards, exit delay, error boundaries
- Harden consolidate-branches.sh: self-resolution guard, stash restore
- Regenerate all 533 output files via agentkit sync



* chore(engine): add brand color palette variables to sync vars



* fix(ci): fix test race condition, workspace config, and lockfile

- Fix ConversationFlow test: wait for 'Got it' before asserting hint text
- Add packages field to pnpm-workspace.yaml for proper workspace resolution
- Regenerate lockfile after version pinning (removed ^ prefixes)
- Remove accidental .agentkit/templates/src/ artifacts



* fix(start): add event loop yields to ConversationFlow tests

ink-select-input needs setImmediate yields after a new menu renders
before it can process ENTER keypresses. Without this, the second ENTER
in leaf-selection tests was swallowed, causing intermittent failures.



---------



* fix(spec): correct githubSlug to phoenixvc/agentkit-forge (#391)



* Add entry point for new framework users (#389)

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* test(start): add coverage for result screen exit path

Add App-level test that navigates through ConversationFlow to a leaf
node and verifies the result screen text is rendered before exit().
Confirms the synchronous useEffect exit is safe — React commits the
render (Ink captures the frame) before useEffect fires.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: update generated sync output timestamps

Generated files updated with current sync date from dev merge.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

---------



* fix: caldues heuristics (#398)

---------

Co-authored-by: Claude <noreply@anthropic.com>
- Fix Prettier formatting across engine src and start components
- Resolve 381 markdown lint errors (MD040, MD024, MD036, MD029, MD022, MD001)
- Add markdownlint config rules for intentional doc patterns
- Add .claude/worktrees to prettierignore to exclude external branches
- Enable markdownlint MD024/MD026 for duplicate headings and trailing colons

All quality checks now pass: Prettier (0 errors), Markdown lint (0 errors), Tests (111/111), Build (28.9kb)
… to '2026-03-13'. This appears to be a routine timestamp update across all the AgentKit Forge generated files.
Add detailed feedback on AgentKit Forge v3.1.0 integration, focusing on:
- Windows line-ending issues and multi-editor sync behavior
- Documentation scaffold-once limitations and override challenges
- Unresolved placeholder warnings lacking diagnostics
- Windows-specific pnpm execution problems
Clarified that modifications to `.agentkit` files are permitted in the agentkit-forge repository, while upstream directories remain protected. This ensures users understand the editing boundaries for project configuration and template files.
Made-with: Cursor
* fix(infra): resolve container app fqdn attribute and format code

* chore(sync): update AGENT_BACKLOG.md and other files for task management

- Enhanced AGENT_BACKLOG.md with detailed task scopes for CI pipeline configuration and test framework setup.
- Added new docker-compose.yml for local/staging validation of the framework.
- Updated CONTRIBUTING.md to include documentation hub link in the Discovery phase.
- Introduced README.md files in db, infra, and migrations directories to clarify their purpose for adopters.
- Added API conventions documentation to guide adopters on structuring their APIs.
- Created implementation plan for state management improvements and added relevant tests.
- Regenerated outputs across various files to reflect recent changes and ensure consistency.
* chore(ci): reduce CodeQL to weekly schedule + manual trigger

Removes push and pull_request triggers to reduce GitHub Actions costs.
Scans were running on every PR including Renovate dependency updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…adoption roadmap (#428)

* docs(architecture): add tool-neutral agent hub findings, ADR-10, and adoption roadmap

Comparative analysis of agentkit-forge sync engine vs Mystira.workspace
hand-authored .agents/ pattern. Documents 5-phase adoption roadmap to
converge both approaches: .agents/ as sync target, reflective guards,
.readme.yaml generation, cross-session traces, and schema formalisation.

Includes regenerated sync output (updated timestamps across all tools).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(architecture): add competitive landscape and strategic research report

Comprehensive analysis of the AI agent configuration & orchestration market:
- 6 primary competitors profiled (Ruler, Agent OS, ai-rules-sync, agent-rules, Block ai-rules, AGENTS.md)
- Evaluation matrix across 14 dimensions
- SWOT analysis with evidence-based assessments
- 12-KPI framework with baselines, targets, and scoring methodology
- Tracking dashboard template and priority matrix
- Market context: $8.5B market, 62% developer adoption, protocol convergence

Key finding: Rules sync is commoditising; AgentKit Forge's moat is orchestration + governance + CI validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…cord (#431)

* feat: new entry points (#426)

* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, syncCodexSkills
- Add commandPrefix to vars from overlay settings
- Add commandPrefixedName to buildCommandVars
- Add 16 unit + integration tests (all pass, 93 existing tests unaffected)

Default is null (no prefix) for full backwards compatibility.

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

* fix(sync): address review findings for command prefix

- Remove unused afterAll import from test file
- Add clarifying comment that non-spec command files are also prefixed
- Add 2 integration tests verifying commandPrefixedName template variable
  renders correctly with and without prefix

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix(ci): CI remediation — package manager, review findings, test stability (#390)

* fix(ci): resolve 7 bugs from project review

- BUG-001: Replace flaky discover test with controlled temp fixture
- BUG-002: Run prettier --write to fix formatting drift
- BUG-003: Add form-template detection skip in issue label validation
- BUG-005: Change claude.yml to self-hosted runner
- BUG-006: Align branch protection required status checks with project.yaml
- BUG-007: Fix command injection in resolve-merge.sh (use grep -F)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update changelog, add planning registry review findings

- Add changelog entries for Wave 1-3 fixes (Added/Changed/Fixed/Removed)
- Add Project Review Findings section to planning registry (PR-001 to PR-014)
- Update planning docs after sync merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(review): add --generate-plans flag to project-review command

Add Phase 2.5 plan generation after project review findings. When
--generate-plans is passed (default: true), scaffold plan files from
critical/high findings into docs/planning/review-findings/.

Also includes sync cleanup of stale cursor/windsurf settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate all outputs after project review fixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cli): dynamic flag loading from commands.yaml + context-aware template hook

- Replace ~200 lines of hardcoded VALID_FLAGS/FLAG_TYPES with loadCommandFlags()
  that reads flag definitions from commands.yaml at startup
- CLI_INTERNAL_FLAGS/CLI_INTERNAL_FLAG_TYPES cover commands not in commands.yaml
- Self-validation warns at startup if any flag is missing a type definition
- Update cli.test.mjs to validate CLI_INTERNAL_FLAGS consistency
- Fix scaffold-once orphan bug: carry forward manifest entries for files
  skipped by scaffold-once so orphan cleanup does not delete them
- Make protect-templates hook context-aware: skip protection in the
  agentkit-forge source repo (detected via package.json name) so
  maintainer agents can edit templates; block only in downstream repos

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(sync): add managed-mode script templates for downstream repos

Add 14 script templates (.agentkit/templates/scripts/) with `managed`
scaffold mode so downstream repos receive script updates via three-way
merge while preserving local customizations.

Templates include: create-doc, update-changelog, validate-documentation,
validate-numbering, check-documentation-requirement, sync-issues,
sync-split-pr, setup-agentkit-branch-governance, and resolve-merge
(both .sh and .ps1 variants where applicable).

Parameterized templates use {{defaultBranch}} and branch protection
variables from project.yaml. Engine wired via syncScripts() under
doc-scaffolding feature gate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(teams): add TeamForge meta-team for agent team creation (cogmesh #130)

Add the TEAMFORGE meta-team (T11) — a structured pipeline for creating,
validating, and deploying new agent team specifications. Adapted from
cogmesh #130 with a simplified 6-agent pipeline:

- input-clarifier: assess requests, extract constraints
- mission-definer: lock team definition (ID, scope, accepts)
- role-architect: design agent roles and dependencies
- prompt-engineer: write agent descriptions and rules
- flow-designer: design team command and integration points
- team-validator: quality gate for spec consistency

Includes /team-forge command with --task flag (create-team, validate-team,
audit-teams, update-team) and planning doc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(teams): add Strategic Ops team for cross-project coordination

Add the STRATEGIC OPS team (T12) — handles framework governance,
portfolio analysis, adoption strategy, impact assessment, and release
coordination across all repos using AgentKit Forge.

5-agent pipeline:
- portfolio-analyst: inventory repos, detect drift, adoption metrics
- governance-advisor: versioning strategy, breaking change protocols
- adoption-strategist: onboarding, migration paths, rollout plans
- impact-assessor: blast radius analysis for template/spec changes
- release-coordinator: version bumps, sync waves, release comms

Includes /team-strategic-ops command with --task and --scope flags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(agents): add agent/team relationship matrix analysis engine + scripts

Add comprehensive agent/team relationship analysis with 8 cross-reference
matrices and 10 supplementary analyses (orphans, cycles, bottlenecks,
reachability, critical path, notification amplifiers, etc.).

- Fix YAML structure: strategic-ops agents now under own top-level key
- Add explicit agents: lists to forge + strategic-ops teams in teams.yaml
- Add consolidation detection responsibilities to portfolio-analyst
- Create agent-analysis.mjs engine module (loadFullAgentGraph + renderers)
- Wire analyze-agents CLI command with --output/--matrix/--format flags
- Add managed-scaffold script templates (bash + PowerShell)
- Integrate into sync pipeline (auto-regenerates matrix on spec changes)
- Add 33 tests covering all matrices, analyses, and edge cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update documentation files and add plan template

- Add trailing newlines to Cursor command documentation files for consistency
- Add new plan template files for project planning
- Improve markdown table formatting in Claude skills documentation
- Remove obsolete .clinerules/testing.md file
- Update various rule files with better formatting and advisory rule alignment

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add Cost Ops team, agents, and multi-provider cost ticket (#364)

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents (#365)

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): address CodeRabbit review findings on strategic-ops PR

- Lazy-load js-yaml in cli.mjs after ensureDependencies() to prevent
  crash when node_modules is missing
- Convert YAML frontmatter to PowerShell comment blocks in all 6 PS1
  templates to fix invalid PowerShell syntax
- Fix protect-templates hook path: use 3 parent traversals to reach
  .agentkit/package.json from hooks directory
- Remove schema-invalid 'phase' field from ai-cost-ops rule domain
- Narrow strategic-ops scope: replace **/* catch-all with specific files
- Add strategic-ops to cost-ops handoff-chain for consistency
- Add Write tool to spec-compliance-auditor, vendor-arbitrage-analyst,
  and grant-hunter agents
- Fix glob matching in resolve-merge.sh (use regex instead of broken
  sed strip)
- Add merge failure vs conflict detection in resolve-merge.ps1
- Add branch existence check in setup-agentkit-branch-governance scripts
- Add gh CLI preflight check in sync-split-pr.ps1
- Deduplicate branch protection loop when defaultBranch is 'main'
- Fix applies-to glob: docs/planning/cost/** → docs/planning/cost-governance/**
- Fix non-canonical doc paths in intake-agent-proposal.md
- Add changelog entries for new teams, agents, and analysis engine
- Resolve AGENT_TEAMS.md merge conflict (accept narrowed scope)
- Run prettier on all modified files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): add gh auth preflight and changelog divider handling

- sync-split-pr.ps1: add gh auth status check before side effects
- update-changelog.ps1: stop before --- divider when appending entries

Addresses CodeRabbit review comments #7 and #13 on PR #356.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(sync): set executable permission on analyze-agents.sh

Linux CI sync produces +x permissions; align local to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): address CodeRabbit review round 3-4 findings

- Fix YAML frontmatter in copilot agent template: use double quotes
  for description field to handle apostrophes (CRITICAL)
- Fix protect-templates.sh/ps1 path traversal: correct parent
  directory count for .agentkit/package.json source repo detection
- Add $PSNativeCommandUseErrorActionPreference to sync-split-pr.ps1
  so native command failures (git, pnpm, gh) are treated as fatal
- Replace try/catch with $LASTEXITCODE check for gh auth status
- Deduplicate branch loop in setup-agentkit-branch-governance.sh
  when defaultBranch equals 'main'
- Fix duplicate verification echo lines in governance scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style(docs): fix prettier formatting on planning documents

Run prettier --write on web-intake-expansion.md and
intake-agent-proposal.md to fix CI formatting check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(tests): isolate render target gating tests with fresh temp dirs

Tests in the "render target gating" describe block shared a single temp
directory via beforeAll/afterAll. The first test ran --only claude
(generating .claude/ files), and the second ran --only warp expecting no
Claude files — but leftovers from test 1 caused the assertion to fail.

Changing to beforeEach/afterEach gives each test a clean directory.

Closes #377

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(engine): add pre-sync commit guard and interactive apply mode

Adds two safety features to the sync pipeline:

1. Pre-sync commit guard: Detects uncommitted changes in protected
   directories (.agentkit/engines, spec, overlays) before sync runs.
   In TTY mode, prompts to abort, stash, or continue. In non-TTY
   mode (CI), prints a warning and proceeds.

2. Interactive apply mode: After rendering, shows a change summary
   and prompts: apply all / skip all / prompt each file. Per-file
   prompt supports show-diff and apply-all-remaining. Default in
   TTY; bypassed with --yes, --no-prompt, or --force.

New module: sync-guard.mjs with 4 exported functions and 7 tests.
New CLI flags: --yes, --no-prompt for non-interactive sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate outputs after branch merges

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate outputs after merge of new-user-entry-point

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(engine): add configurable package manager and fix review findings

- Add `stack.packageManager` field to project.yaml (pnpm | npm | yarn)
- Derive helper template vars (pmInstall, pmRun, pmExec, pmLockfile, etc.)
- Update CLAUDE.md template and hook/workflow templates to use {{packageManager}}
- Fix sync-guard to exclude .agentkit/spec from protected dirs and add try/catch
- Remove duplicate cost-ops team definition from teams.yaml
- Pin all dependency versions in package.json (remove ^ prefixes)
- Add vitest coverage thresholds (80% statements/branches/functions/lines)
- Fix src/start/ code quality: null guards, exit delay, error boundaries
- Harden consolidate-branches.sh: self-resolution guard, stash restore
- Regenerate all 533 output files via agentkit sync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(engine): add brand color palette variables to sync vars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ci): fix test race condition, workspace config, and lockfile

- Fix ConversationFlow test: wait for 'Got it' before asserting hint text
- Add packages field to pnpm-workspace.yaml for proper workspace resolution
- Regenerate lockfile after version pinning (removed ^ prefixes)
- Remove accidental .agentkit/templates/src/ artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(start): add event loop yields to ConversationFlow tests

ink-select-input needs setImmediate yields after a new menu renders
before it can process ENTER keypresses. Without this, the second ENTER
in leaf-selection tests was swallowed, causing intermittent failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(spec): correct githubSlug to phoenixvc/agentkit-forge (#391)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Add entry point for new framework users (#389)

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* test(start): add coverage for result screen exit path

Add App-level test that navigates through ConversationFlow to a leaf
node and verifies the result screen text is rendered before exit().
Confirms the synchronous useEffect exit is safe — React commits the
render (Ink captures the frame) before useEffect fires.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: update generated sync output timestamps

Generated files updated with current sync date from dev merge.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix: caldues heuristics (#398)

* feat: complete revisit of agents (#399) (#400)

* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------



* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, syncCodexSkills
- Add commandPrefix to vars from overlay settings
- Add commandPrefixedName to buildCommandVars
- Add 16 unit + integration tests (all pass, 93 existing tests unaffected)

Default is null (no prefix) for full backwards compatibility.

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

* fix(sync): address review findings for command prefix

- Remove unused afterAll import from test file
- Add clarifying comment that non-spec command files are also prefixed
- Add 2 integration tests verifying commandPrefixedName template variable
  renders correctly with and without prefix

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

---------



* fix(ci): CI remediation — package manager, review findings, test stability (#390)

* fix(ci): resolve 7 bugs from project review

- BUG-001: Replace flaky discover test with controlled temp fixture
- BUG-002: Run prettier --write to fix formatting drift
- BUG-003: Add form-template detection skip in issue label validation
- BUG-005: Change claude.yml to self-hosted runner
- BUG-006: Align branch protection required status checks with project.yaml
- BUG-007: Fix command injection in resolve-merge.sh (use grep -F)



* docs: update changelog, add planning registry review findings

- Add changelog entries for Wave 1-3 fixes (Added/Changed/Fixed/Removed)
- Add Project Review Findings section to planning registry (PR-001 to PR-014)
- Update planning docs after sync merge



* feat(review): add --generate-plans flag to project-review command

Add Phase 2.5 plan generation after project review findings. When
--generate-plans is passed (default: true), scaffold plan files from
critical/high findings into docs/planning/review-findings/.

Also includes sync cleanup of stale cursor/windsurf settings.



* chore(sync): regenerate all outputs after project review fixes



* feat(cli): dynamic flag loading from commands.yaml + context-aware template hook

- Replace ~200 lines of hardcoded VALID_FLAGS/FLAG_TYPES with loadCommandFlags()
  that reads flag definitions from commands.yaml at startup
- CLI_INTERNAL_FLAGS/CLI_INTERNAL_FLAG_TYPES cover commands not in commands.yaml
- Self-validation warns at startup if any flag is missing a type definition
- Update cli.test.mjs to validate CLI_INTERNAL_FLAGS consistency
- Fix scaffold-once orphan bug: carry forward manifest entries for files
  skipped by scaffold-once so orphan cleanup does not delete them
- Make protect-templates hook context-aware: skip protection in the
  agentkit-forge source repo (detected via package.json name) so
  maintainer agents can edit templates; block only in downstream repos



* feat(sync): add managed-mode script templates for downstream repos

Add 14 script templates (.agentkit/templates/scripts/) with `managed`
scaffold mode so downstream repos receive script updates via three-way
merge while preserving local customizations.

Templates include: create-doc, update-changelog, validate-documentation,
validate-numbering, check-documentation-requirement, sync-issues,
sync-split-pr, setup-agentkit-branch-governance, and resolve-merge
(both .sh and .ps1 variants where applicable).

Parameterized templates use {{defaultBranch}} and branch protection
variables from project.yaml. Engine wired via syncScripts() under
doc-scaffolding feature gate.



* feat(teams): add TeamForge meta-team for agent team creation (cogmesh #130)

Add the TEAMFORGE meta-team (T11) — a structured pipeline for creating,
validating, and deploying new agent team specifications. Adapted from
cogmesh #130 with a simplified 6-agent pipeline:

- input-clarifier: assess requests, extract constraints
- mission-definer: lock team definition (ID, scope, accepts)
- role-architect: design agent roles and dependencies
- prompt-engineer: write agent descriptions and rules
- flow-designer: design team command and integration points
- team-validator: quality gate for spec consistency

Includes /team-forge command with --task flag (create-team, validate-team,
audit-teams, update-team) and planning doc.



* feat(teams): add Strategic Ops team for cross-project coordination

Add the STRATEGIC OPS team (T12) — handles framework governance,
portfolio analysis, adoption strategy, impact assessment, and release
coordination across all repos using AgentKit Forge.

5-agent pipeline:
- portfolio-analyst: inventory repos, detect drift, adoption metrics
- governance-advisor: versioning strategy, breaking change protocols
- adoption-strategist: onboarding, migration paths, rollout plans
- impact-assessor: blast radius analysis for template/spec changes
- release-coordinator: version bumps, sync waves, release comms

Includes /team-strategic-ops command with --task and --scope flags.



* feat(agents): add agent/team relationship matrix analysis engine + scripts

Add comprehensive agent/team relationship analysis with 8 cross-reference
matrices and 10 supplementary analyses (orphans, cycles, bottlenecks,
reachability, critical path, notification amplifiers, etc.).

- Fix YAML structure: strategic-ops agents now under own top-level key
- Add explicit agents: lists to forge + strategic-ops teams in teams.yaml
- Add consolidation detection responsibilities to portfolio-analyst
- Create agent-analysis.mjs engine module (loadFullAgentGraph + renderers)
- Wire analyze-agents CLI command with --output/--matrix/--format flags
- Add managed-scaffold script templates (bash + PowerShell)
- Integrate into sync pipeline (auto-regenerates matrix on spec changes)
- Add 33 tests covering all matrices, analyses, and edge cases



* chore: update documentation files and add plan template

- Add trailing newlines to Cursor command documentation files for consistency
- Add new plan template files for project planning
- Improve markdown table formatting in Claude skills documentation
- Remove obsolete .clinerules/testing.md file
- Update various rule files with better formatting and advisory rule alignment

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



* feat(cost-ops): add Cost Ops team, agents, and multi-provider cost ticket (#364)

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents (#365)

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



---------



* fix(teams): address CodeRabbit review findings on strategic-ops PR

- Lazy-load js-yaml in cli.mjs after ensureDependencies() to prevent
  crash when node_modules is missing
- Convert YAML frontmatter to PowerShell comment blocks in all 6 PS1
  templates to fix invalid PowerShell syntax
- Fix protect-templates hook path: use 3 parent traversals to reach
  .agentkit/package.json from hooks directory
- Remove schema-invalid 'phase' field from ai-cost-ops rule domain
- Narrow strategic-ops scope: replace **/* catch-all with specific files
- Add strategic-ops to cost-ops handoff-chain for consistency
- Add Write tool to spec-compliance-auditor, vendor-arbitrage-analyst,
  and grant-hunter agents
- Fix glob matching in resolve-merge.sh (use regex instead of broken
  sed strip)
- Add merge failure vs conflict detection in resolve-merge.ps1
- Add branch existence check in setup-agentkit-branch-governance scripts
- Add gh CLI preflight check in sync-split-pr.ps1
- Deduplicate branch protection loop when defaultBranch is 'main'
- Fix applies-to glob: docs/planning/cost/** → docs/planning/cost-governance/**
- Fix non-canonical doc paths in intake-agent-proposal.md
- Add changelog entries for new teams, agents, and analysis engine
- Resolve AGENT_TEAMS.md merge conflict (accept narrowed scope)
- Run prettier on all modified files



* fix(templates): add gh auth preflight and changelog divider handling

- sync-split-pr.ps1: add gh auth status check before side effects
- update-changelog.ps1: stop before --- divider when appending entries

Addresses CodeRabbit review comments #7 and #13 on PR #356.



* fix(sync): set executable permission on analyze-agents.sh

Linux CI sync produces +x permissions; align local to match.



* fix(templates): address CodeRabbit review round 3-4 findings

- Fix YAML frontmatter in copilot agent template: use double quotes
  for description field to handle apostrophes (CRITICAL)
- Fix protect-templates.sh/ps1 path traversal: correct parent
  directory count for .agentkit/package.json source repo detection
- Add $PSNativeCommandUseErrorActionPreference to sync-split-pr.ps1
  so native command failures (git, pnpm, gh) are treated as fatal
- Replace try/catch with $LASTEXITCODE check for gh auth status
- Deduplicate branch loop in setup-agentkit-branch-governance.sh
  when defaultBranch equals 'main'
- Fix duplicate verification echo lines in governance scripts



* style(docs): fix prettier formatting on planning documents

Run prettier --write on web-intake-expansion.md and
intake-agent-proposal.md to fix CI formatting check.



* fix(tests): isolate render target gating tests with fresh temp dirs

Tests in the "render target gating" describe block shared a single temp
directory via beforeAll/afterAll. The first test ran --only claude
(generating .claude/ files), and the second ran --only warp expecting no
Claude files — but leftovers from test 1 caused the assertion to fail.

Changing to beforeEach/afterEach gives each test a clean directory.

Closes #377



* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(engine): add pre-sync commit guard and interactive apply mode

Adds two safety features to the sync pipeline:

1. Pre-sync commit guard: Detects uncommitted changes in protected
   directories (.agentkit/engines, spec, overlays) before sync runs.
   In TTY mode, prompts to abort, stash, or continue. In non-TTY
   mode (CI), prints a warning and proceeds.

2. Interactive apply mode: After rendering, shows a change summary
   and prompts: apply all / skip all / prompt each file. Per-file
   prompt supports show-diff and apply-all-remaining. Default in
   TTY; bypassed with --yes, --no-prompt, or --force.

New module: sync-guard.mjs with 4 exported functions and 7 tests.
New CLI flags: --yes, --no-prompt for non-interactive sync.



* chore(sync): regenerate outputs after branch merges



* chore(sync): regenerate outputs after merge of new-user-entry-point



* feat(engine): add configurable package manager and fix review findings

- Add `stack.packageManager` field to project.yaml (pnpm | npm | yarn)
- Derive helper template vars (pmInstall, pmRun, pmExec, pmLockfile, etc.)
- Update CLAUDE.md template and hook/workflow templates to use {{packageManager}}
- Fix sync-guard to exclude .agentkit/spec from protected dirs and add try/catch
- Remove duplicate cost-ops team definition from teams.yaml
- Pin all dependency versions in package.json (remove ^ prefixes)
- Add vitest coverage thresholds (80% statements/branches/functions/lines)
- Fix src/start/ code quality: null guards, exit delay, error boundaries
- Harden consolidate-branches.sh: self-resolution guard, stash restore
- Regenerate all 533 output files via agentkit sync



* chore(engine): add brand color palette variables to sync vars



* fix(ci): fix test race condition, workspace config, and lockfile

- Fix ConversationFlow test: wait for 'Got it' before asserting hint text
- Add packages field to pnpm-workspace.yaml for proper workspace resolution
- Regenerate lockfile after version pinning (removed ^ prefixes)
- Remove accidental .agentkit/templates/src/ artifacts



* fix(start): add event loop yields to ConversationFlow tests

ink-select-input needs setImmediate yields after a new menu renders
before it can process ENTER keypresses. Without this, the second ENTER
in leaf-selection tests was swallowed, causing intermittent failures.



---------



* fix(spec): correct githubSlug to phoenixvc/agentkit-forge (#391)



* Add entry point for new framework users (#389)

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* test(start): add coverage for result screen exit path

Add App-level test that navigates through ConversationFlow to a leaf
node and verifies the result screen text is rendered before exit().
Confirms the synchronous useEffect exit is safe — React commits the
render (Ink captures the frame) before useEffect fires.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: update generated sync output timestamps

Generated files updated with current sync date from dev merge.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

---------



* fix: caldues heuristics (#398)

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix(quality): resolve all lint and format errors

- Fix Prettier formatting across engine src and start components
- Resolve 381 markdown lint errors (MD040, MD024, MD036, MD029, MD022, MD001)
- Add markdownlint config rules for intentional doc patterns
- Add .claude/worktrees to prettierignore to exclude external branches
- Enable markdownlint MD024/MD026 for duplicate headings and trailing colons

All quality checks now pass: Prettier (0 errors), Markdown lint (0 errors), Tests (111/111), Build (28.9kb)

* I'll update the last_updated field in all the files from '2026-03-12' to '2026-03-13'. This appears to be a routine timestamp update across all the AgentKit Forge generated files.

* docs: add AgentKit Forge sync feedback

Add detailed feedback on AgentKit Forge v3.1.0 integration, focusing on:
- Windows line-ending issues and multi-editor sync behavior
- Documentation scaffold-once limitations and override challenges
- Unresolved placeholder warnings lacking diagnostics
- Windows-specific pnpm execution problems

* docs: update CLAUDE.md with repository-specific editing guidelines

Clarified that modifications to `.agentkit` files are permitted in the agentkit-forge repository, while upstream directories remain protected. This ensures users understand the editing boundaries for project configuration and template files.

* docs(claude): allow .agentkit edits in this repo (NB for framework dev)

Made-with: Cursor

* chore(sync): regenerate outputs after agentkit:sync

Made-with: Cursor

---------

Co-authored-by: Claude <noreply@anthropic.com>

* chore(sync): regenerate outputs and update timestamps (#429)

* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts…
…#432)

* feat: new entry points (#426)

* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, syncCodexSkills
- Add commandPrefix to vars from overlay settings
- Add commandPrefixedName to buildCommandVars
- Add 16 unit + integration tests (all pass, 93 existing tests unaffected)

Default is null (no prefix) for full backwards compatibility.

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

* fix(sync): address review findings for command prefix

- Remove unused afterAll import from test file
- Add clarifying comment that non-spec command files are also prefixed
- Add 2 integration tests verifying commandPrefixedName template variable
  renders correctly with and without prefix

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix(ci): CI remediation — package manager, review findings, test stability (#390)

* fix(ci): resolve 7 bugs from project review

- BUG-001: Replace flaky discover test with controlled temp fixture
- BUG-002: Run prettier --write to fix formatting drift
- BUG-003: Add form-template detection skip in issue label validation
- BUG-005: Change claude.yml to self-hosted runner
- BUG-006: Align branch protection required status checks with project.yaml
- BUG-007: Fix command injection in resolve-merge.sh (use grep -F)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update changelog, add planning registry review findings

- Add changelog entries for Wave 1-3 fixes (Added/Changed/Fixed/Removed)
- Add Project Review Findings section to planning registry (PR-001 to PR-014)
- Update planning docs after sync merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(review): add --generate-plans flag to project-review command

Add Phase 2.5 plan generation after project review findings. When
--generate-plans is passed (default: true), scaffold plan files from
critical/high findings into docs/planning/review-findings/.

Also includes sync cleanup of stale cursor/windsurf settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate all outputs after project review fixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cli): dynamic flag loading from commands.yaml + context-aware template hook

- Replace ~200 lines of hardcoded VALID_FLAGS/FLAG_TYPES with loadCommandFlags()
  that reads flag definitions from commands.yaml at startup
- CLI_INTERNAL_FLAGS/CLI_INTERNAL_FLAG_TYPES cover commands not in commands.yaml
- Self-validation warns at startup if any flag is missing a type definition
- Update cli.test.mjs to validate CLI_INTERNAL_FLAGS consistency
- Fix scaffold-once orphan bug: carry forward manifest entries for files
  skipped by scaffold-once so orphan cleanup does not delete them
- Make protect-templates hook context-aware: skip protection in the
  agentkit-forge source repo (detected via package.json name) so
  maintainer agents can edit templates; block only in downstream repos

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(sync): add managed-mode script templates for downstream repos

Add 14 script templates (.agentkit/templates/scripts/) with `managed`
scaffold mode so downstream repos receive script updates via three-way
merge while preserving local customizations.

Templates include: create-doc, update-changelog, validate-documentation,
validate-numbering, check-documentation-requirement, sync-issues,
sync-split-pr, setup-agentkit-branch-governance, and resolve-merge
(both .sh and .ps1 variants where applicable).

Parameterized templates use {{defaultBranch}} and branch protection
variables from project.yaml. Engine wired via syncScripts() under
doc-scaffolding feature gate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(teams): add TeamForge meta-team for agent team creation (cogmesh #130)

Add the TEAMFORGE meta-team (T11) — a structured pipeline for creating,
validating, and deploying new agent team specifications. Adapted from
cogmesh #130 with a simplified 6-agent pipeline:

- input-clarifier: assess requests, extract constraints
- mission-definer: lock team definition (ID, scope, accepts)
- role-architect: design agent roles and dependencies
- prompt-engineer: write agent descriptions and rules
- flow-designer: design team command and integration points
- team-validator: quality gate for spec consistency

Includes /team-forge command with --task flag (create-team, validate-team,
audit-teams, update-team) and planning doc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(teams): add Strategic Ops team for cross-project coordination

Add the STRATEGIC OPS team (T12) — handles framework governance,
portfolio analysis, adoption strategy, impact assessment, and release
coordination across all repos using AgentKit Forge.

5-agent pipeline:
- portfolio-analyst: inventory repos, detect drift, adoption metrics
- governance-advisor: versioning strategy, breaking change protocols
- adoption-strategist: onboarding, migration paths, rollout plans
- impact-assessor: blast radius analysis for template/spec changes
- release-coordinator: version bumps, sync waves, release comms

Includes /team-strategic-ops command with --task and --scope flags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(agents): add agent/team relationship matrix analysis engine + scripts

Add comprehensive agent/team relationship analysis with 8 cross-reference
matrices and 10 supplementary analyses (orphans, cycles, bottlenecks,
reachability, critical path, notification amplifiers, etc.).

- Fix YAML structure: strategic-ops agents now under own top-level key
- Add explicit agents: lists to forge + strategic-ops teams in teams.yaml
- Add consolidation detection responsibilities to portfolio-analyst
- Create agent-analysis.mjs engine module (loadFullAgentGraph + renderers)
- Wire analyze-agents CLI command with --output/--matrix/--format flags
- Add managed-scaffold script templates (bash + PowerShell)
- Integrate into sync pipeline (auto-regenerates matrix on spec changes)
- Add 33 tests covering all matrices, analyses, and edge cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update documentation files and add plan template

- Add trailing newlines to Cursor command documentation files for consistency
- Add new plan template files for project planning
- Improve markdown table formatting in Claude skills documentation
- Remove obsolete .clinerules/testing.md file
- Update various rule files with better formatting and advisory rule alignment

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add Cost Ops team, agents, and multi-provider cost ticket (#364)

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents (#365)

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(teams): address CodeRabbit review findings on strategic-ops PR

- Lazy-load js-yaml in cli.mjs after ensureDependencies() to prevent
  crash when node_modules is missing
- Convert YAML frontmatter to PowerShell comment blocks in all 6 PS1
  templates to fix invalid PowerShell syntax
- Fix protect-templates hook path: use 3 parent traversals to reach
  .agentkit/package.json from hooks directory
- Remove schema-invalid 'phase' field from ai-cost-ops rule domain
- Narrow strategic-ops scope: replace **/* catch-all with specific files
- Add strategic-ops to cost-ops handoff-chain for consistency
- Add Write tool to spec-compliance-auditor, vendor-arbitrage-analyst,
  and grant-hunter agents
- Fix glob matching in resolve-merge.sh (use regex instead of broken
  sed strip)
- Add merge failure vs conflict detection in resolve-merge.ps1
- Add branch existence check in setup-agentkit-branch-governance scripts
- Add gh CLI preflight check in sync-split-pr.ps1
- Deduplicate branch protection loop when defaultBranch is 'main'
- Fix applies-to glob: docs/planning/cost/** → docs/planning/cost-governance/**
- Fix non-canonical doc paths in intake-agent-proposal.md
- Add changelog entries for new teams, agents, and analysis engine
- Resolve AGENT_TEAMS.md merge conflict (accept narrowed scope)
- Run prettier on all modified files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): add gh auth preflight and changelog divider handling

- sync-split-pr.ps1: add gh auth status check before side effects
- update-changelog.ps1: stop before --- divider when appending entries

Addresses CodeRabbit review comments #7 and #13 on PR #356.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(sync): set executable permission on analyze-agents.sh

Linux CI sync produces +x permissions; align local to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(templates): address CodeRabbit review round 3-4 findings

- Fix YAML frontmatter in copilot agent template: use double quotes
  for description field to handle apostrophes (CRITICAL)
- Fix protect-templates.sh/ps1 path traversal: correct parent
  directory count for .agentkit/package.json source repo detection
- Add $PSNativeCommandUseErrorActionPreference to sync-split-pr.ps1
  so native command failures (git, pnpm, gh) are treated as fatal
- Replace try/catch with $LASTEXITCODE check for gh auth status
- Deduplicate branch loop in setup-agentkit-branch-governance.sh
  when defaultBranch equals 'main'
- Fix duplicate verification echo lines in governance scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style(docs): fix prettier formatting on planning documents

Run prettier --write on web-intake-expansion.md and
intake-agent-proposal.md to fix CI formatting check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(tests): isolate render target gating tests with fresh temp dirs

Tests in the "render target gating" describe block shared a single temp
directory via beforeAll/afterAll. The first test ran --only claude
(generating .claude/ files), and the second ran --only warp expecting no
Claude files — but leftovers from test 1 caused the assertion to fail.

Changing to beforeEach/afterEach gives each test a clean directory.

Closes #377

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(engine): add pre-sync commit guard and interactive apply mode

Adds two safety features to the sync pipeline:

1. Pre-sync commit guard: Detects uncommitted changes in protected
   directories (.agentkit/engines, spec, overlays) before sync runs.
   In TTY mode, prompts to abort, stash, or continue. In non-TTY
   mode (CI), prints a warning and proceeds.

2. Interactive apply mode: After rendering, shows a change summary
   and prompts: apply all / skip all / prompt each file. Per-file
   prompt supports show-diff and apply-all-remaining. Default in
   TTY; bypassed with --yes, --no-prompt, or --force.

New module: sync-guard.mjs with 4 exported functions and 7 tests.
New CLI flags: --yes, --no-prompt for non-interactive sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate outputs after branch merges

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(sync): regenerate outputs after merge of new-user-entry-point

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(engine): add configurable package manager and fix review findings

- Add `stack.packageManager` field to project.yaml (pnpm | npm | yarn)
- Derive helper template vars (pmInstall, pmRun, pmExec, pmLockfile, etc.)
- Update CLAUDE.md template and hook/workflow templates to use {{packageManager}}
- Fix sync-guard to exclude .agentkit/spec from protected dirs and add try/catch
- Remove duplicate cost-ops team definition from teams.yaml
- Pin all dependency versions in package.json (remove ^ prefixes)
- Add vitest coverage thresholds (80% statements/branches/functions/lines)
- Fix src/start/ code quality: null guards, exit delay, error boundaries
- Harden consolidate-branches.sh: self-resolution guard, stash restore
- Regenerate all 533 output files via agentkit sync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(engine): add brand color palette variables to sync vars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ci): fix test race condition, workspace config, and lockfile

- Fix ConversationFlow test: wait for 'Got it' before asserting hint text
- Add packages field to pnpm-workspace.yaml for proper workspace resolution
- Regenerate lockfile after version pinning (removed ^ prefixes)
- Remove accidental .agentkit/templates/src/ artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(start): add event loop yields to ConversationFlow tests

ink-select-input needs setImmediate yields after a new menu renders
before it can process ENTER keypresses. Without this, the second ENTER
in leaf-selection tests was swallowed, causing intermittent failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(spec): correct githubSlug to phoenixvc/agentkit-forge (#391)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Add entry point for new framework users (#389)

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* test(start): add coverage for result screen exit path

Add App-level test that navigates through ConversationFlow to a leaf
node and verifies the result screen text is rendered before exit().
Confirms the synchronous useEffect exit is safe — React commits the
render (Ink captures the frame) before useEffect fires.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: update generated sync output timestamps

Generated files updated with current sync date from dev merge.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix: caldues heuristics (#398)

* feat: complete revisit of agents (#399) (#400)

* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------



* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, syncCodexSkills
- Add commandPrefix to vars from overlay settings
- Add commandPrefixedName to buildCommandVars
- Add 16 unit + integration tests (all pass, 93 existing tests unaffected)

Default is null (no prefix) for full backwards compatibility.

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

* fix(sync): address review findings for command prefix

- Remove unused afterAll import from test file
- Add clarifying comment that non-spec command files are also prefixed
- Add 2 integration tests verifying commandPrefixedName template variable
  renders correctly with and without prefix

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

---------



* fix(ci): CI remediation — package manager, review findings, test stability (#390)

* fix(ci): resolve 7 bugs from project review

- BUG-001: Replace flaky discover test with controlled temp fixture
- BUG-002: Run prettier --write to fix formatting drift
- BUG-003: Add form-template detection skip in issue label validation
- BUG-005: Change claude.yml to self-hosted runner
- BUG-006: Align branch protection required status checks with project.yaml
- BUG-007: Fix command injection in resolve-merge.sh (use grep -F)



* docs: update changelog, add planning registry review findings

- Add changelog entries for Wave 1-3 fixes (Added/Changed/Fixed/Removed)
- Add Project Review Findings section to planning registry (PR-001 to PR-014)
- Update planning docs after sync merge



* feat(review): add --generate-plans flag to project-review command

Add Phase 2.5 plan generation after project review findings. When
--generate-plans is passed (default: true), scaffold plan files from
critical/high findings into docs/planning/review-findings/.

Also includes sync cleanup of stale cursor/windsurf settings.



* chore(sync): regenerate all outputs after project review fixes



* feat(cli): dynamic flag loading from commands.yaml + context-aware template hook

- Replace ~200 lines of hardcoded VALID_FLAGS/FLAG_TYPES with loadCommandFlags()
  that reads flag definitions from commands.yaml at startup
- CLI_INTERNAL_FLAGS/CLI_INTERNAL_FLAG_TYPES cover commands not in commands.yaml
- Self-validation warns at startup if any flag is missing a type definition
- Update cli.test.mjs to validate CLI_INTERNAL_FLAGS consistency
- Fix scaffold-once orphan bug: carry forward manifest entries for files
  skipped by scaffold-once so orphan cleanup does not delete them
- Make protect-templates hook context-aware: skip protection in the
  agentkit-forge source repo (detected via package.json name) so
  maintainer agents can edit templates; block only in downstream repos



* feat(sync): add managed-mode script templates for downstream repos

Add 14 script templates (.agentkit/templates/scripts/) with `managed`
scaffold mode so downstream repos receive script updates via three-way
merge while preserving local customizations.

Templates include: create-doc, update-changelog, validate-documentation,
validate-numbering, check-documentation-requirement, sync-issues,
sync-split-pr, setup-agentkit-branch-governance, and resolve-merge
(both .sh and .ps1 variants where applicable).

Parameterized templates use {{defaultBranch}} and branch protection
variables from project.yaml. Engine wired via syncScripts() under
doc-scaffolding feature gate.



* feat(teams): add TeamForge meta-team for agent team creation (cogmesh #130)

Add the TEAMFORGE meta-team (T11) — a structured pipeline for creating,
validating, and deploying new agent team specifications. Adapted from
cogmesh #130 with a simplified 6-agent pipeline:

- input-clarifier: assess requests, extract constraints
- mission-definer: lock team definition (ID, scope, accepts)
- role-architect: design agent roles and dependencies
- prompt-engineer: write agent descriptions and rules
- flow-designer: design team command and integration points
- team-validator: quality gate for spec consistency

Includes /team-forge command with --task flag (create-team, validate-team,
audit-teams, update-team) and planning doc.



* feat(teams): add Strategic Ops team for cross-project coordination

Add the STRATEGIC OPS team (T12) — handles framework governance,
portfolio analysis, adoption strategy, impact assessment, and release
coordination across all repos using AgentKit Forge.

5-agent pipeline:
- portfolio-analyst: inventory repos, detect drift, adoption metrics
- governance-advisor: versioning strategy, breaking change protocols
- adoption-strategist: onboarding, migration paths, rollout plans
- impact-assessor: blast radius analysis for template/spec changes
- release-coordinator: version bumps, sync waves, release comms

Includes /team-strategic-ops command with --task and --scope flags.



* feat(agents): add agent/team relationship matrix analysis engine + scripts

Add comprehensive agent/team relationship analysis with 8 cross-reference
matrices and 10 supplementary analyses (orphans, cycles, bottlenecks,
reachability, critical path, notification amplifiers, etc.).

- Fix YAML structure: strategic-ops agents now under own top-level key
- Add explicit agents: lists to forge + strategic-ops teams in teams.yaml
- Add consolidation detection responsibilities to portfolio-analyst
- Create agent-analysis.mjs engine module (loadFullAgentGraph + renderers)
- Wire analyze-agents CLI command with --output/--matrix/--format flags
- Add managed-scaffold script templates (bash + PowerShell)
- Integrate into sync pipeline (auto-regenerates matrix on spec changes)
- Add 33 tests covering all matrices, analyses, and edge cases



* chore: update documentation files and add plan template

- Add trailing newlines to Cursor command documentation files for consistency
- Add new plan template files for project planning
- Improve markdown table formatting in Claude skills documentation
- Remove obsolete .clinerules/testing.md file
- Update various rule files with better formatting and advisory rule alignment

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



* feat(cost-ops): add Cost Ops team, agents, and multi-provider cost ticket (#364)

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents (#365)

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



---------



* fix(teams): address CodeRabbit review findings on strategic-ops PR

- Lazy-load js-yaml in cli.mjs after ensureDependencies() to prevent
  crash when node_modules is missing
- Convert YAML frontmatter to PowerShell comment blocks in all 6 PS1
  templates to fix invalid PowerShell syntax
- Fix protect-templates hook path: use 3 parent traversals to reach
  .agentkit/package.json from hooks directory
- Remove schema-invalid 'phase' field from ai-cost-ops rule domain
- Narrow strategic-ops scope: replace **/* catch-all with specific files
- Add strategic-ops to cost-ops handoff-chain for consistency
- Add Write tool to spec-compliance-auditor, vendor-arbitrage-analyst,
  and grant-hunter agents
- Fix glob matching in resolve-merge.sh (use regex instead of broken
  sed strip)
- Add merge failure vs conflict detection in resolve-merge.ps1
- Add branch existence check in setup-agentkit-branch-governance scripts
- Add gh CLI preflight check in sync-split-pr.ps1
- Deduplicate branch protection loop when defaultBranch is 'main'
- Fix applies-to glob: docs/planning/cost/** → docs/planning/cost-governance/**
- Fix non-canonical doc paths in intake-agent-proposal.md
- Add changelog entries for new teams, agents, and analysis engine
- Resolve AGENT_TEAMS.md merge conflict (accept narrowed scope)
- Run prettier on all modified files



* fix(templates): add gh auth preflight and changelog divider handling

- sync-split-pr.ps1: add gh auth status check before side effects
- update-changelog.ps1: stop before --- divider when appending entries

Addresses CodeRabbit review comments #7 and #13 on PR #356.



* fix(sync): set executable permission on analyze-agents.sh

Linux CI sync produces +x permissions; align local to match.



* fix(templates): address CodeRabbit review round 3-4 findings

- Fix YAML frontmatter in copilot agent template: use double quotes
  for description field to handle apostrophes (CRITICAL)
- Fix protect-templates.sh/ps1 path traversal: correct parent
  directory count for .agentkit/package.json source repo detection
- Add $PSNativeCommandUseErrorActionPreference to sync-split-pr.ps1
  so native command failures (git, pnpm, gh) are treated as fatal
- Replace try/catch with $LASTEXITCODE check for gh auth status
- Deduplicate branch loop in setup-agentkit-branch-governance.sh
  when defaultBranch equals 'main'
- Fix duplicate verification echo lines in governance scripts



* style(docs): fix prettier formatting on planning documents

Run prettier --write on web-intake-expansion.md and
intake-agent-proposal.md to fix CI formatting check.



* fix(tests): isolate render target gating tests with fresh temp dirs

Tests in the "render target gating" describe block shared a single temp
directory via beforeAll/afterAll. The first test ran --only claude
(generating .claude/ files), and the second ran --only warp expecting no
Claude files — but leftovers from test 1 caused the assertion to fail.

Changing to beforeEach/afterEach gives each test a clean directory.

Closes #377



* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(engine): add pre-sync commit guard and interactive apply mode

Adds two safety features to the sync pipeline:

1. Pre-sync commit guard: Detects uncommitted changes in protected
   directories (.agentkit/engines, spec, overlays) before sync runs.
   In TTY mode, prompts to abort, stash, or continue. In non-TTY
   mode (CI), prints a warning and proceeds.

2. Interactive apply mode: After rendering, shows a change summary
   and prompts: apply all / skip all / prompt each file. Per-file
   prompt supports show-diff and apply-all-remaining. Default in
   TTY; bypassed with --yes, --no-prompt, or --force.

New module: sync-guard.mjs with 4 exported functions and 7 tests.
New CLI flags: --yes, --no-prompt for non-interactive sync.



* chore(sync): regenerate outputs after branch merges



* chore(sync): regenerate outputs after merge of new-user-entry-point



* feat(engine): add configurable package manager and fix review findings

- Add `stack.packageManager` field to project.yaml (pnpm | npm | yarn)
- Derive helper template vars (pmInstall, pmRun, pmExec, pmLockfile, etc.)
- Update CLAUDE.md template and hook/workflow templates to use {{packageManager}}
- Fix sync-guard to exclude .agentkit/spec from protected dirs and add try/catch
- Remove duplicate cost-ops team definition from teams.yaml
- Pin all dependency versions in package.json (remove ^ prefixes)
- Add vitest coverage thresholds (80% statements/branches/functions/lines)
- Fix src/start/ code quality: null guards, exit delay, error boundaries
- Harden consolidate-branches.sh: self-resolution guard, stash restore
- Regenerate all 533 output files via agentkit sync



* chore(engine): add brand color palette variables to sync vars



* fix(ci): fix test race condition, workspace config, and lockfile

- Fix ConversationFlow test: wait for 'Got it' before asserting hint text
- Add packages field to pnpm-workspace.yaml for proper workspace resolution
- Regenerate lockfile after version pinning (removed ^ prefixes)
- Remove accidental .agentkit/templates/src/ artifacts



* fix(start): add event loop yields to ConversationFlow tests

ink-select-input needs setImmediate yields after a new menu renders
before it can process ENTER keypresses. Without this, the second ENTER
in leaf-selection tests was swallowed, causing intermittent failures.



---------



* fix(spec): correct githubSlug to phoenixvc/agentkit-forge (#391)



* Add entry point for new framework users (#389)

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* test(start): add coverage for result screen exit path

Add App-level test that navigates through ConversationFlow to a leaf
node and verifies the result screen text is rendered before exit().
Confirms the synchronous useEffect exit is safe — React commits the
render (Ink captures the frame) before useEffect fires.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: update generated sync output timestamps

Generated files updated with current sync date from dev merge.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

---------



* fix: caldues heuristics (#398)

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix(quality): resolve all lint and format errors

- Fix Prettier formatting across engine src and start components
- Resolve 381 markdown lint errors (MD040, MD024, MD036, MD029, MD022, MD001)
- Add markdownlint config rules for intentional doc patterns
- Add .claude/worktrees to prettierignore to exclude external branches
- Enable markdownlint MD024/MD026 for duplicate headings and trailing colons

All quality checks now pass: Prettier (0 errors), Markdown lint (0 errors), Tests (111/111), Build (28.9kb)

* I'll update the last_updated field in all the files from '2026-03-12' to '2026-03-13'. This appears to be a routine timestamp update across all the AgentKit Forge generated files.

* docs: add AgentKit Forge sync feedback

Add detailed feedback on AgentKit Forge v3.1.0 integration, focusing on:
- Windows line-ending issues and multi-editor sync behavior
- Documentation scaffold-once limitations and override challenges
- Unresolved placeholder warnings lacking diagnostics
- Windows-specific pnpm execution problems

* docs: update CLAUDE.md with repository-specific editing guidelines

Clarified that modifications to `.agentkit` files are permitted in the agentkit-forge repository, while upstream directories remain protected. This ensures users understand the editing boundaries for project configuration and template files.

* docs(claude): allow .agentkit edits in this repo (NB for framework dev)

Made-with: Cursor

* chore(sync): regenerate outputs after agentkit:sync

Made-with: Cursor

---------

Co-authored-by: Claude <noreply@anthropic.com>

* chore(sync): regenerate outputs and update timestamps (#429)

* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, sy…
Resolves 486 merge conflicts:
- Generated files (.agents/skills/, .claude/, .cursor/, .windsurf/,
  .clinerules/, .roo/, .github/): accepted main (upstream) version
  per agentkit-generated merge driver convention
- check.mjs: kept dev's robust PM detection (lockfile + commandExists
  verification) over main's simpler detectPackageManager helper;
  retained more informative warning message from dev
- cli.mjs: kept dev's Array.isArray safety check for --help short-circuit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolves conflicts from reverse-merge PR #437 (main → dev).
Main had 2 commits that dev was missing:
- chore(issues): update follow-up issues after kit-based domain filtering (#435)
- feat(rename): rebrand CLI from agentkit to retort with deprecated alias (#436)

Conflict resolution strategy:
- Engine source files (.mjs): keep dev version (more complete — has domain
  filtering, backward-compat header checks, kit detection in init.mjs)
- Template files: keep dev version (fixes "an Retort" → "a Retort" grammar)
- .github/ISSUES/006: take main's ## Resolution section (phase 5 work)
- .github/ISSUES/040: keep dev's Retort branding + add main's ## Resolution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------



* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, syncCodexSkills
- Add commandPrefix to vars from overlay settings
- Add commandPrefixedName to buildCommandVars
- Add 16 unit + integration tests (all pass, 93 existing tests unaffected)

Default is null (no prefix) for full backwards compatibility.

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

* fix(sync): address review findings for command prefix

- Remove unused afterAll import from test file
- Add clarifying comment that non-spec command files are also prefixed
- Add 2 integration tests verifying commandPrefixedName template variable
  renders correctly with and without prefix

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

---------



* fix(ci): CI remediation — package manager, review findings, test stability (#390)

* fix(ci): resolve 7 bugs from project review

- BUG-001: Replace flaky discover test with controlled temp fixture
- BUG-002: Run prettier --write to fix formatting drift
- BUG-003: Add form-template detection skip in issue label validation
- BUG-005: Change claude.yml to self-hosted runner
- BUG-006: Align branch protection required status checks with project.yaml
- BUG-007: Fix command injection in resolve-merge.sh (use grep -F)



* docs: update changelog, add planning registry review findings

- Add changelog entries for Wave 1-3 fixes (Added/Changed/Fixed/Removed)
- Add Project Review Findings section to planning registry (PR-001 to PR-014)
- Update planning docs after sync merge



* feat(review): add --generate-plans flag to project-review command

Add Phase 2.5 plan generation after project review findings. When
--generate-plans is passed (default: true), scaffold plan files from
critical/high findings into docs/planning/review-findings/.

Also includes sync cleanup of stale cursor/windsurf settings.



* chore(sync): regenerate all outputs after project review fixes



* feat(cli): dynamic flag loading from commands.yaml + context-aware template hook

- Replace ~200 lines of hardcoded VALID_FLAGS/FLAG_TYPES with loadCommandFlags()
  that reads flag definitions from commands.yaml at startup
- CLI_INTERNAL_FLAGS/CLI_INTERNAL_FLAG_TYPES cover commands not in commands.yaml
- Self-validation warns at startup if any flag is missing a type definition
- Update cli.test.mjs to validate CLI_INTERNAL_FLAGS consistency
- Fix scaffold-once orphan bug: carry forward manifest entries for files
  skipped by scaffold-once so orphan cleanup does not delete them
- Make protect-templates hook context-aware: skip protection in the
  agentkit-forge source repo (detected via package.json name) so
  maintainer agents can edit templates; block only in downstream repos



* feat(sync): add managed-mode script templates for downstream repos

Add 14 script templates (.agentkit/templates/scripts/) with `managed`
scaffold mode so downstream repos receive script updates via three-way
merge while preserving local customizations.

Templates include: create-doc, update-changelog, validate-documentation,
validate-numbering, check-documentation-requirement, sync-issues,
sync-split-pr, setup-agentkit-branch-governance, and resolve-merge
(both .sh and .ps1 variants where applicable).

Parameterized templates use {{defaultBranch}} and branch protection
variables from project.yaml. Engine wired via syncScripts() under
doc-scaffolding feature gate.



* feat(teams): add TeamForge meta-team for agent team creation (cogmesh #130)

Add the TEAMFORGE meta-team (T11) — a structured pipeline for creating,
validating, and deploying new agent team specifications. Adapted from
cogmesh #130 with a simplified 6-agent pipeline:

- input-clarifier: assess requests, extract constraints
- mission-definer: lock team definition (ID, scope, accepts)
- role-architect: design agent roles and dependencies
- prompt-engineer: write agent descriptions and rules
- flow-designer: design team command and integration points
- team-validator: quality gate for spec consistency

Includes /team-forge command with --task flag (create-team, validate-team,
audit-teams, update-team) and planning doc.



* feat(teams): add Strategic Ops team for cross-project coordination

Add the STRATEGIC OPS team (T12) — handles framework governance,
portfolio analysis, adoption strategy, impact assessment, and release
coordination across all repos using AgentKit Forge.

5-agent pipeline:
- portfolio-analyst: inventory repos, detect drift, adoption metrics
- governance-advisor: versioning strategy, breaking change protocols
- adoption-strategist: onboarding, migration paths, rollout plans
- impact-assessor: blast radius analysis for template/spec changes
- release-coordinator: version bumps, sync waves, release comms

Includes /team-strategic-ops command with --task and --scope flags.



* feat(agents): add agent/team relationship matrix analysis engine + scripts

Add comprehensive agent/team relationship analysis with 8 cross-reference
matrices and 10 supplementary analyses (orphans, cycles, bottlenecks,
reachability, critical path, notification amplifiers, etc.).

- Fix YAML structure: strategic-ops agents now under own top-level key
- Add explicit agents: lists to forge + strategic-ops teams in teams.yaml
- Add consolidation detection responsibilities to portfolio-analyst
- Create agent-analysis.mjs engine module (loadFullAgentGraph + renderers)
- Wire analyze-agents CLI command with --output/--matrix/--format flags
- Add managed-scaffold script templates (bash + PowerShell)
- Integrate into sync pipeline (auto-regenerates matrix on spec changes)
- Add 33 tests covering all matrices, analyses, and edge cases



* chore: update documentation files and add plan template

- Add trailing newlines to Cursor command documentation files for consistency
- Add new plan template files for project planning
- Improve markdown table formatting in Claude skills documentation
- Remove obsolete .clinerules/testing.md file
- Update various rule files with better formatting and advisory rule alignment

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



* feat(cost-ops): add Cost Ops team, agents, and multi-provider cost ticket (#364)

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents (#365)

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



---------



* fix(teams): address CodeRabbit review findings on strategic-ops PR

- Lazy-load js-yaml in cli.mjs after ensureDependencies() to prevent
  crash when node_modules is missing
- Convert YAML frontmatter to PowerShell comment blocks in all 6 PS1
  templates to fix invalid PowerShell syntax
- Fix protect-templates hook path: use 3 parent traversals to reach
  .agentkit/package.json from hooks directory
- Remove schema-invalid 'phase' field from ai-cost-ops rule domain
- Narrow strategic-ops scope: replace **/* catch-all with specific files
- Add strategic-ops to cost-ops handoff-chain for consistency
- Add Write tool to spec-compliance-auditor, vendor-arbitrage-analyst,
  and grant-hunter agents
- Fix glob matching in resolve-merge.sh (use regex instead of broken
  sed strip)
- Add merge failure vs conflict detection in resolve-merge.ps1
- Add branch existence check in setup-agentkit-branch-governance scripts
- Add gh CLI preflight check in sync-split-pr.ps1
- Deduplicate branch protection loop when defaultBranch is 'main'
- Fix applies-to glob: docs/planning/cost/** → docs/planning/cost-governance/**
- Fix non-canonical doc paths in intake-agent-proposal.md
- Add changelog entries for new teams, agents, and analysis engine
- Resolve AGENT_TEAMS.md merge conflict (accept narrowed scope)
- Run prettier on all modified files



* fix(templates): add gh auth preflight and changelog divider handling

- sync-split-pr.ps1: add gh auth status check before side effects
- update-changelog.ps1: stop before --- divider when appending entries

Addresses CodeRabbit review comments #7 and #13 on PR #356.



* fix(sync): set executable permission on analyze-agents.sh

Linux CI sync produces +x permissions; align local to match.



* fix(templates): address CodeRabbit review round 3-4 findings

- Fix YAML frontmatter in copilot agent template: use double quotes
  for description field to handle apostrophes (CRITICAL)
- Fix protect-templates.sh/ps1 path traversal: correct parent
  directory count for .agentkit/package.json source repo detection
- Add $PSNativeCommandUseErrorActionPreference to sync-split-pr.ps1
  so native command failures (git, pnpm, gh) are treated as fatal
- Replace try/catch with $LASTEXITCODE check for gh auth status
- Deduplicate branch loop in setup-agentkit-branch-governance.sh
  when defaultBranch equals 'main'
- Fix duplicate verification echo lines in governance scripts



* style(docs): fix prettier formatting on planning documents

Run prettier --write on web-intake-expansion.md and
intake-agent-proposal.md to fix CI formatting check.



* fix(tests): isolate render target gating tests with fresh temp dirs

Tests in the "render target gating" describe block shared a single temp
directory via beforeAll/afterAll. The first test ran --only claude
(generating .claude/ files), and the second ran --only warp expecting no
Claude files — but leftovers from test 1 caused the assertion to fail.

Changing to beforeEach/afterEach gives each test a clean directory.

Closes #377



* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(engine): add pre-sync commit guard and interactive apply mode

Adds two safety features to the sync pipeline:

1. Pre-sync commit guard: Detects uncommitted changes in protected
   directories (.agentkit/engines, spec, overlays) before sync runs.
   In TTY mode, prompts to abort, stash, or continue. In non-TTY
   mode (CI), prints a warning and proceeds.

2. Interactive apply mode: After rendering, shows a change summary
   and prompts: apply all / skip all / prompt each file. Per-file
   prompt supports show-diff and apply-all-remaining. Default in
   TTY; bypassed with --yes, --no-prompt, or --force.

New module: sync-guard.mjs with 4 exported functions and 7 tests.
New CLI flags: --yes, --no-prompt for non-interactive sync.



* chore(sync): regenerate outputs after branch merges



* chore(sync): regenerate outputs after merge of new-user-entry-point



* feat(engine): add configurable package manager and fix review findings

- Add `stack.packageManager` field to project.yaml (pnpm | npm | yarn)
- Derive helper template vars (pmInstall, pmRun, pmExec, pmLockfile, etc.)
- Update CLAUDE.md template and hook/workflow templates to use {{packageManager}}
- Fix sync-guard to exclude .agentkit/spec from protected dirs and add try/catch
- Remove duplicate cost-ops team definition from teams.yaml
- Pin all dependency versions in package.json (remove ^ prefixes)
- Add vitest coverage thresholds (80% statements/branches/functions/lines)
- Fix src/start/ code quality: null guards, exit delay, error boundaries
- Harden consolidate-branches.sh: self-resolution guard, stash restore
- Regenerate all 533 output files via agentkit sync



* chore(engine): add brand color palette variables to sync vars



* fix(ci): fix test race condition, workspace config, and lockfile

- Fix ConversationFlow test: wait for 'Got it' before asserting hint text
- Add packages field to pnpm-workspace.yaml for proper workspace resolution
- Regenerate lockfile after version pinning (removed ^ prefixes)
- Remove accidental .agentkit/templates/src/ artifacts



* fix(start): add event loop yields to ConversationFlow tests

ink-select-input needs setImmediate yields after a new menu renders
before it can process ENTER keypresses. Without this, the second ENTER
in leaf-selection tests was swallowed, causing intermittent failures.



---------



* fix(spec): correct githubSlug to phoenixvc/agentkit-forge (#391)



* Add entry point for new framework users (#389)

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* test(start): add coverage for result screen exit path

Add App-level test that navigates through ConversationFlow to a leaf
node and verifies the result screen text is rendered before exit().
Confirms the synchronous useEffect exit is safe — React commits the
render (Ink captures the frame) before useEffect fires.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: update generated sync output timestamps

Generated files updated with current sync date from dev merge.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

---------



* fix: caldues heuristics (#398)

* feat: complete revisit of agents (#399) (#400)

* Add start command: new user entry point with state detection (#387)

* fix(commands): add AskUserQuestion to VALID_TOOLS and /start command

The /start command session got stuck because AskUserQuestion was not
included in the allowed-tools whitelist. This fix addresses three issues:

1. VALID_TOOLS in spec-validator was missing AskUserQuestion, TodoWrite,
   Agent, and NotebookEdit — preventing commands from declaring these
   Claude Code built-in tools in their allowed-tools.

2. The /start command template now explicitly includes AskUserQuestion
   in its allowed-tools frontmatter and instructs the agent to use it
   for interactive guided choices (Phase 3).

3. Added /start command spec to commands.yaml with AskUserQuestion as
   a declared tool dependency.

Also adds a test case validating all four newly-added tools are accepted
by the spec validator.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

* fix(commands): remove unrendered Handlebars comment from start.md output

The generated .claude/commands/start.md contained a raw {{! ... }}
Handlebars comment that was not processed by the sync engine. Remove it
so the generated output is clean Markdown.

https://claude.ai/code/session_01Qh3Xk3jFkVdeRAXTqLvq3M

---------



* Add configurable prefix to kits commands (#388)

* feat(sync): add configurable command prefix for generated slash commands

Add `commandPrefix` setting to overlay settings that namespaces all
generated slash commands across platforms:

- Claude Code: subdirectory strategy (kits/check.md → /project:kits:check)
- Cursor/Windsurf/Copilot/Codex: filename prefix (kits-check.md → /kits-check)
- Team commands excluded from prefixing (already namespaced)

Changes:
- Add resolveCommandPath() helper with subdirectory/filename strategies
- Update syncClaudeCommands, syncClaudeSkills, syncCursorCommands,
  syncWindsurfCommands, syncCopilotPrompts, syncCodexSkills
- Add commandPrefix to vars from overlay settings
- Add commandPrefixedName to buildCommandVars
- Add 16 unit + integration tests (all pass, 93 existing tests unaffected)

Default is null (no prefix) for full backwards compatibility.

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

* fix(sync): address review findings for command prefix

- Remove unused afterAll import from test file
- Add clarifying comment that non-spec command files are also prefixed
- Add 2 integration tests verifying commandPrefixedName template variable
  renders correctly with and without prefix

https://claude.ai/code/session_01EBjmVEhi7fP2huAL3SBR6p

---------



* fix(ci): CI remediation — package manager, review findings, test stability (#390)

* fix(ci): resolve 7 bugs from project review

- BUG-001: Replace flaky discover test with controlled temp fixture
- BUG-002: Run prettier --write to fix formatting drift
- BUG-003: Add form-template detection skip in issue label validation
- BUG-005: Change claude.yml to self-hosted runner
- BUG-006: Align branch protection required status checks with project.yaml
- BUG-007: Fix command injection in resolve-merge.sh (use grep -F)



* docs: update changelog, add planning registry review findings

- Add changelog entries for Wave 1-3 fixes (Added/Changed/Fixed/Removed)
- Add Project Review Findings section to planning registry (PR-001 to PR-014)
- Update planning docs after sync merge



* feat(review): add --generate-plans flag to project-review command

Add Phase 2.5 plan generation after project review findings. When
--generate-plans is passed (default: true), scaffold plan files from
critical/high findings into docs/planning/review-findings/.

Also includes sync cleanup of stale cursor/windsurf settings.



* chore(sync): regenerate all outputs after project review fixes



* feat(cli): dynamic flag loading from commands.yaml + context-aware template hook

- Replace ~200 lines of hardcoded VALID_FLAGS/FLAG_TYPES with loadCommandFlags()
  that reads flag definitions from commands.yaml at startup
- CLI_INTERNAL_FLAGS/CLI_INTERNAL_FLAG_TYPES cover commands not in commands.yaml
- Self-validation warns at startup if any flag is missing a type definition
- Update cli.test.mjs to validate CLI_INTERNAL_FLAGS consistency
- Fix scaffold-once orphan bug: carry forward manifest entries for files
  skipped by scaffold-once so orphan cleanup does not delete them
- Make protect-templates hook context-aware: skip protection in the
  agentkit-forge source repo (detected via package.json name) so
  maintainer agents can edit templates; block only in downstream repos



* feat(sync): add managed-mode script templates for downstream repos

Add 14 script templates (.agentkit/templates/scripts/) with `managed`
scaffold mode so downstream repos receive script updates via three-way
merge while preserving local customizations.

Templates include: create-doc, update-changelog, validate-documentation,
validate-numbering, check-documentation-requirement, sync-issues,
sync-split-pr, setup-agentkit-branch-governance, and resolve-merge
(both .sh and .ps1 variants where applicable).

Parameterized templates use {{defaultBranch}} and branch protection
variables from project.yaml. Engine wired via syncScripts() under
doc-scaffolding feature gate.



* feat(teams): add TeamForge meta-team for agent team creation (cogmesh #130)

Add the TEAMFORGE meta-team (T11) — a structured pipeline for creating,
validating, and deploying new agent team specifications. Adapted from
cogmesh #130 with a simplified 6-agent pipeline:

- input-clarifier: assess requests, extract constraints
- mission-definer: lock team definition (ID, scope, accepts)
- role-architect: design agent roles and dependencies
- prompt-engineer: write agent descriptions and rules
- flow-designer: design team command and integration points
- team-validator: quality gate for spec consistency

Includes /team-forge command with --task flag (create-team, validate-team,
audit-teams, update-team) and planning doc.



* feat(teams): add Strategic Ops team for cross-project coordination

Add the STRATEGIC OPS team (T12) — handles framework governance,
portfolio analysis, adoption strategy, impact assessment, and release
coordination across all repos using AgentKit Forge.

5-agent pipeline:
- portfolio-analyst: inventory repos, detect drift, adoption metrics
- governance-advisor: versioning strategy, breaking change protocols
- adoption-strategist: onboarding, migration paths, rollout plans
- impact-assessor: blast radius analysis for template/spec changes
- release-coordinator: version bumps, sync waves, release comms

Includes /team-strategic-ops command with --task and --scope flags.



* feat(agents): add agent/team relationship matrix analysis engine + scripts

Add comprehensive agent/team relationship analysis with 8 cross-reference
matrices and 10 supplementary analyses (orphans, cycles, bottlenecks,
reachability, critical path, notification amplifiers, etc.).

- Fix YAML structure: strategic-ops agents now under own top-level key
- Add explicit agents: lists to forge + strategic-ops teams in teams.yaml
- Add consolidation detection responsibilities to portfolio-analyst
- Create agent-analysis.mjs engine module (loadFullAgentGraph + renderers)
- Wire analyze-agents CLI command with --output/--matrix/--format flags
- Add managed-scaffold script templates (bash + PowerShell)
- Integrate into sync pipeline (auto-regenerates matrix on spec changes)
- Add 33 tests covering all matrices, analyses, and edge cases



* chore: update documentation files and add plan template

- Add trailing newlines to Cursor command documentation files for consistency
- Add new plan template files for project planning
- Improve markdown table formatting in Claude skills documentation
- Remove obsolete .clinerules/testing.md file
- Update various rule files with better formatting and advisory rule alignment

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



* feat(cost-ops): add Cost Ops team, agents, and multi-provider cost ticket (#364)

* feat(agents): add spec-compliance-auditor feedback loop + Cost Ops team (T14)

- Add spec-compliance-auditor to operations category (quality team) — closes
  the feedback loop between agent specs and actual behavior
- Add Cost Ops team (T14) with 5 agents: model-economist,
  token-efficiency-engineer, vendor-arbitrage-analyst, grant-hunter,
  cost-ops-monitor
- Add ai-cost-ops rules domain with 6 conventions (model routing, token
  budgets, caching, batch APIs, vendor abstraction, credit tracking)
- Add team-cost-ops command with --task, --period, --provider flags
- Update notification chains: data→cost-ops-monitor, infra→model-economist,
  retrospective-analyst→spec-compliance-auditor
- Add intake routes: cost-ops, agent-performance



* fix(teams): add implement to cost-ops team accepts list

Resolves agent/team accepts mismatch — token-efficiency-engineer accepts
implement but the team definition only had investigate/review/plan/document.



* feat(cost-ops): add multi-provider infra cost ticket to backlog

Add detailed planning ticket for multi-provider infrastructure cost
normalisation, routing, and cost-agent integration. Covers 9 providers
(Anthropic, OpenAI, Google, Mistral, Cohere, self-hosted, Azure, AWS,
GCP) with 3-phase delivery plan and cross-team dependency tracking.



* fix(templates): resolve PR review comments from CodeRabbit

- Fix protect-templates.sh: package name check uses correct
  "agentkit-forge-runtime" instead of "agentkit-forge"
- Fix protect-templates.ps1: malformed path (missing separator before
  .agentkit) and same package name correction
- Fix update-changelog.ps1: change .mjs to .cjs to match CommonJS
  require() syntax used in the inline Node script
- Fix resolve-merge.sh: add fallback for {{defaultBranch}} placeholder
- Fix AGENT_TEAMS.md: resolve three-way merge conflict markers left
  by sync engine, keeping user formatting + implement in cost-ops



* feat(cost-ops): add WebSearch/WebFetch tools to cost-ops agents (#365)

Enable web research capabilities for cost-ops team:
- Add WebSearch and WebFetch to /team-cost-ops allowed-tools
- Add WebSearch and WebFetch to model-economist, vendor-arbitrage-analyst,
  and grant-hunter agent preferred-tools
- Add web intake expansion ticket (P2) for MCP crawler, Puppeteer
  integration, automated pricing refresh, and cross-session persistence
- Regenerate sync outputs



---------



* fix(teams): address CodeRabbit review findings on strategic-ops PR

- Lazy-load js-yaml in cli.mjs after ensureDependencies() to prevent
  crash when node_modules is missing
- Convert YAML frontmatter to PowerShell comment blocks in all 6 PS1
  templates to fix invalid PowerShell syntax
- Fix protect-templates hook path: use 3 parent traversals to reach
  .agentkit/package.json from hooks directory
- Remove schema-invalid 'phase' field from ai-cost-ops rule domain
- Narrow strategic-ops scope: replace **/* catch-all with specific files
- Add strategic-ops to cost-ops handoff-chain for consistency
- Add Write tool to spec-compliance-auditor, vendor-arbitrage-analyst,
  and grant-hunter agents
- Fix glob matching in resolve-merge.sh (use regex instead of broken
  sed strip)
- Add merge failure vs conflict detection in resolve-merge.ps1
- Add branch existence check in setup-agentkit-branch-governance scripts
- Add gh CLI preflight check in sync-split-pr.ps1
- Deduplicate branch protection loop when defaultBranch is 'main'
- Fix applies-to glob: docs/planning/cost/** → docs/planning/cost-governance/**
- Fix non-canonical doc paths in intake-agent-proposal.md
- Add changelog entries for new teams, agents, and analysis engine
- Resolve AGENT_TEAMS.md merge conflict (accept narrowed scope)
- Run prettier on all modified files



* fix(templates): add gh auth preflight and changelog divider handling

- sync-split-pr.ps1: add gh auth status check before side effects
- update-changelog.ps1: stop before --- divider when appending entries

Addresses CodeRabbit review comments #7 and #13 on PR #356.



* fix(sync): set executable permission on analyze-agents.sh

Linux CI sync produces +x permissions; align local to match.



* fix(templates): address CodeRabbit review round 3-4 findings

- Fix YAML frontmatter in copilot agent template: use double quotes
  for description field to handle apostrophes (CRITICAL)
- Fix protect-templates.sh/ps1 path traversal: correct parent
  directory count for .agentkit/package.json source repo detection
- Add $PSNativeCommandUseErrorActionPreference to sync-split-pr.ps1
  so native command failures (git, pnpm, gh) are treated as fatal
- Replace try/catch with $LASTEXITCODE check for gh auth status
- Deduplicate branch loop in setup-agentkit-branch-governance.sh
  when defaultBranch equals 'main'
- Fix duplicate verification echo lines in governance scripts



* style(docs): fix prettier formatting on planning documents

Run prettier --write on web-intake-expansion.md and
intake-agent-proposal.md to fix CI formatting check.



* fix(tests): isolate render target gating tests with fresh temp dirs

Tests in the "render target gating" describe block shared a single temp
directory via beforeAll/afterAll. The first test ran --only claude
(generating .claude/ files), and the second ran --only warp expecting no
Claude files — but leftovers from test 1 caused the assertion to fail.

Changing to beforeEach/afterEach gives each test a clean directory.

Closes #377



* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(engine): add pre-sync commit guard and interactive apply mode

Adds two safety features to the sync pipeline:

1. Pre-sync commit guard: Detects uncommitted changes in protected
   directories (.agentkit/engines, spec, overlays) before sync runs.
   In TTY mode, prompts to abort, stash, or continue. In non-TTY
   mode (CI), prints a warning and proceeds.

2. Interactive apply mode: After rendering, shows a change summary
   and prompts: apply all / skip all / prompt each file. Per-file
   prompt supports show-diff and apply-all-remaining. Default in
   TTY; bypassed with --yes, --no-prompt, or --force.

New module: sync-guard.mjs with 4 exported functions and 7 tests.
New CLI flags: --yes, --no-prompt for non-interactive sync.



* chore(sync): regenerate outputs after branch merges



* chore(sync): regenerate outputs after merge of new-user-entry-point



* feat(engine): add configurable package manager and fix review findings

- Add `stack.packageManager` field to project.yaml (pnpm | npm | yarn)
- Derive helper template vars (pmInstall, pmRun, pmExec, pmLockfile, etc.)
- Update CLAUDE.md template and hook/workflow templates to use {{packageManager}}
- Fix sync-guard to exclude .agentkit/spec from protected dirs and add try/catch
- Remove duplicate cost-ops team definition from teams.yaml
- Pin all dependency versions in package.json (remove ^ prefixes)
- Add vitest coverage thresholds (80% statements/branches/functions/lines)
- Fix src/start/ code quality: null guards, exit delay, error boundaries
- Harden consolidate-branches.sh: self-resolution guard, stash restore
- Regenerate all 533 output files via agentkit sync



* chore(engine): add brand color palette variables to sync vars



* fix(ci): fix test race condition, workspace config, and lockfile

- Fix ConversationFlow test: wait for 'Got it' before asserting hint text
- Add packages field to pnpm-workspace.yaml for proper workspace resolution
- Regenerate lockfile after version pinning (removed ^ prefixes)
- Remove accidental .agentkit/templates/src/ artifacts



* fix(start): add event loop yields to ConversationFlow tests

ink-select-input needs setImmediate yields after a new menu renders
before it can process ENTER keypresses. Without this, the second ENTER
in leaf-selection tests was swallowed, causing intermittent failures.



---------



* fix(spec): correct githubSlug to phoenixvc/agentkit-forge (#391)



* Add entry point for new framework users (#389)

* feat(commands): add /start command as new user entry point

Adds a context-aware triage command that detects repository state
(fresh clone, post-discovery, mid-session, uncommitted work) and
guides users to the right command or team for their goal.

Includes team routing table, 4 contextual flows, and decision
guidance for when users don't know which team to use.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* refactor(commands): add Arguments and State Management sections to /start

Addresses TEAMFORGE validation findings:
- Add dedicated Arguments section documenting $ARGUMENTS handling
- Add State Management section (reads/writes inventory)
- Fix frontmatter: remove misleading generated_by field
- Add explicit "manually authored" comment header

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): add /start to spec and template for cross-repo generation

Moves /start from a hand-authored command to a proper spec-driven,
sync-generated command available to any repo that adopts AgentKit Forge.

- Add start command definition to commands.yaml (no feature gate — always on)
- Create start.md template in .agentkit/templates/claude/commands/
- Add /start to CLAUDE.md Quick Reference table template

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after adding /start command

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(commands): make /start team routing dynamic instead of hardcoded

Replace the static team routing table with dynamic discovery:
1. Read AGENT_TEAMS.md (from /discover) at runtime
2. Fall back to .agentkit/spec/teams.yaml
3. Fall back to /team-* command frontmatter

This ensures /start always reflects the actual teams configured
in any repo, rather than a hardcoded list that could go stale.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore(sync): regenerate outputs after dynamic routing change

Generated by: pnpm -C .agentkit agentkit:sync

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add interactive TUI entry point with hybrid UI

Replace static markdown output with an ink-based terminal UI that
combines two modes: a guided conversation flow for first-run users
and a fuzzy-searchable command palette for returning users. A
persistent status bar shows repo state at a glance (branch, phase,
backlog count, working tree status).

- Context detection module mirrors /start Phase 1 signals
- ConversationFlow: branching dialogue tree (choose-your-own-adventure)
- CommandPalette: fuzzy search with context-ranked star recommendations
- StatusBar: tmux-style persistent strip with color-coded segments
- Supports --json flag for scripting/piping

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* feat(start): add test suite, error handling, and refactor for production readiness

- Add vitest test infrastructure with 102 tests across 7 files
- Coverage: 95.58% statements, 90.81% branches, 96.72% functions
- Extract conversation tree to separate config module for testability
- Add error boundary to App component for graceful error display
- Add --help flag with usage documentation
- Add TTY detection with JSON fallback for non-interactive environments
- Add SIGINT/SIGTERM signal handling for clean exit

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: add coverage to gitignore, include plan and workspace config

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — unused code, git cwd, magic numbers

- Call exit() after command selection so Ink process terminates
- Remove unused ctx prop from Header component
- Fix git commands to use -C flag with root path parameter
- Extract dumpContextJson() helper to deduplicate JSON output logic
- Add comment explaining hardcoded team filter exclusion
- Replace magic numbers with named constants (FUSE_THRESHOLD,
  RECOMMENDED_SCORE, MAX_BRANCH_LENGTH)
- Remove unused ink-spinner dependency
- Add test verifying git -C flag passes root correctly

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* fix(start): address review findings — security, correctness, test quality

- CRITICAL: Replace execSync shell interpolation with execFileSync to
  prevent command injection via root parameter in detect.js
- CRITICAL: Remove phantom --external:ink-spinner from build script and
  switch npx to direct esbuild invocation
- HIGH: Fix exit race condition — use useEffect instead of setTimeout
- HIGH: Wire up onSelect callback in ConversationFlow so Guide mode
  triggers the result screen in App
- HIGH: Destructure and accept ctx prop in ConversationFlow
- HIGH: Add back-navigation (Escape) in ConversationFlow
- HIGH: Guard against undefined team.focus in commands.js tags
- MEDIUM: Use functional setCursor form to avoid stale closures
- MEDIUM: Key commandIndices Map by string id instead of object identity
- MEDIUM: Improve parseTeams header detection (drop first row approach)
- MEDIUM: Filter completed/done/closed items from backlogCount
- MEDIUM: Extract shared makeCtx test utility across all test files
- MEDIUM: Add null guard to StatusBar truncate helper
- LOW: Validate orchestratorPhase is a number in range 1-5
- LOW: Fix pnpm-workspace.yaml list syntax
- Replace all setTimeout in tests with vi.waitFor deterministic waits

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* test(start): add coverage for result screen exit path

Add App-level test that navigates through ConversationFlow to a leaf
node and verifies the result screen text is rendered before exit().
Confirms the synchronous useEffect exit is safe — React commits the
render (Ink captures the frame) before useEffect fires.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

* chore: update generated sync output timestamps

Generated files updated with current sync date from dev merge.

https://claude.ai/code/session_01Gy1HvvywVe6Z2iFJ2bHYCW

---------



* fix: caldues heuristics (#398)

---------



* fix(quality): resolve all lint and format errors

- Fix Prettier formatting across engine src and start components
- Resolve 381 markdown lint errors (MD040, MD024, MD036, MD029, MD022, MD001)
- Add markdownlint config rules for intentional doc patterns
- Add .claude/worktrees to prettierignore to exclude external branches
- Enable markdownlint MD024/MD026 for duplicate headings and trailing colons

All quality checks now pass: Prettier (0 errors), Markdown lint (0 errors), Tests (111/111), Build (28.9kb)

* I'll update the last_updated field in all the files from '2026-03-12' to '2026-03-13'. This appears to be a routine timestamp update across all the AgentKit Forge generated files.

* docs: add AgentKit Forge sync feedback

Add detailed feedback on AgentKit Forge v3.1.0 integration, focusing on:
- Windows line-ending issues and multi-editor sync behavior
- Documentation scaffold-once limitations and override challenges
- Unresolved placeholder warnings lacking diagnostics
- Windows-specific pnpm execution problems

* docs: update CLAUDE.md with repository-specific editing guidelines

Clarified that modifications to `.agentkit` files are permitted in the agentkit-forge repository, while upstream directories remain protected. This ensures users understand the editing boundaries for project configuration and template files.

* docs(claude): allow .agentkit edits in this repo (NB for framework dev)

Made-with: Cursor

* chore(sync): regenerate outputs after agentkit:sync

Made-with: Cursor

* Fix/generated files and conflict markers (#427)

* fix(infra): resolve container app fqdn attribute and format code

* chore(sync): update AGENT_BACKLOG.md and other files for task management

- Enhanced AGENT_BACKLOG.md with detailed task scopes for CI pipeline configuration and test framework setup.
- Added new docker-compose.yml for local/staging validation of the framework.
- Updated CONTRIBUTING.md to include documentation hub link in the Discovery phase.
- Introduced README.md files in db, infra, and migrations directories to clarify their purpose for adopters.
- Added API conventions documentation to guide adopters on structuring their APIs.
- Created implementation plan for state management improvements and added relevant tests.
- Regenerated outputs across various files to reflect recent changes and ensure consistency.

* chore(ci): reduce CodeQL to weekly + manual only (#430)

* chore(ci): reduce CodeQL to weekly schedule + manual trigger

Removes push and pull_request triggers to reduce GitHub Actions costs.
Scans were running on every PR including Renovate dependency updates.



* Potential fix for pull request finding



---------




* docs(architecture): add tool-neutral agent hub findings, ADR-10, and adoption roadmap (#428)

* docs(architecture): add tool-neutral agent hub findings, ADR-10, and adoption roadmap

Comparative analysis of agentkit-forge sync engine vs Mystira.workspace
hand-authored .agents/ pattern. Documents 5-phase adoption roadmap to
converge both approaches: .agents/ as sync target, reflective guards,
.readme.yaml generation, cross-session traces, and schema formalisation.

Includes regenerated sync output (updated timestamps across all tools).



* docs(architecture): add competitive landscape and strategic research report

Comprehensive analysis of…

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…438)

* feat(config): add integrationBranch setting and PR base branch guard

- Add `integrationBranch` field to overlay settings.yaml template
  (defaults to defaultBranch, allows dev/main distinction)
- Add `overlays/retort/settings.yaml` — sets integrationBranch: dev
  for retort's own generated output
- Add CLAUDE.md template section: Integration Branch header + PR Target
  Branch subsection with correct `gh pr create --base` example
- Add synchronize.mjs mapping: `integrationBranch` var from overlay settings
- Add hookify rule template: claude/rules/pr-base-branch.md warns when
  `gh pr create` is used without `--base {{integrationBranch}}`
- Regenerate all sync outputs with Retort branding and integrationBranch

This prevents the reverse-merge anti-pattern (PR targeting main instead
of dev) that triggered PR #437. The rule is enforced at the framework
level — every onboarded repo gets the guard baked into its CLAUDE.md and
.claude/rules/pr-base-branch.md automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(pr-review): address four Copilot review comments on PR #438

1. template-utils.mjs syncCmd: 'agentkit:sync' → 'retort:sync' in the
   generated GENERATED header's Regenerate instruction (line 680)

2. template-utils.mjs insertHeader: treat legacy 'GENERATED by AgentKit Forge'
   marker as "already present" to prevent double-headers during transition
   (line 721)

3. protect-templates.sh/.ps1: "is an Retort source file" →
   "is a Retort source file" (grammar fix, line 50)

4. review.md / project-review.md: "an Retort template" →
   "a Retort template" (grammar fix, line 239)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docs): update ecosystem table with current repo names

cockpit -> deck, ai-cadence -> phoenix-flow, ai-flume -> sluice.
Add docket row (AI cost ops). Fix Name section reference.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ci(runners): switch all workflows from self-hosted to ubuntu-latest

Self-hosted runner is currently offline — all CI runs stuck in queue.
Switching to GitHub-hosted ubuntu-latest to unblock PR merges while
the custom runner is investigated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes #397

- scripts/retort-sync.sh + .ps1: safety wrapper that previews changes
  (--dry-run), backs up overwritten files (--backup), verifies render
  target directories, and shows a post-sync git summary
- docs/engineering/sync-safety.md: safe adoption workflow, file mode
  reference table, hook trigger explanation, and render target config
- The pre-push-validate hook template issue (write-mode sync) is
  documented and tracked; a template fix is needed upstream

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…fold noise

- .gitattributes: add explicit eol=lf for all generated output dirs
  (.claude/, .cursor/, .clinerules/, .roo/, .windsurf/, .github/instructions/,
  .github/agents/, .github/chatmodes/, .github/prompts/) to prevent LF→CRLF
  conversion warnings on Windows after every retort:sync (#420)

- .prettierignore: extend template exclusions to cover generated output
  directories so Prettier never reformats sync outputs or Handlebars YAML
  templates; also adds .agentkit/templates/**/*.hbs glob (#419)

- docs/engineering/sync-file-modes.md: new reference document listing which
  files are scaffold-once vs managed vs always-overwrite, with manifest lookup
  instructions and workarounds for issues #417 (syncDate churn) and #418
  (unresolved placeholder warnings missing file paths) (#421)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The block-agentkit-changes and branch-rules workflows only excepted
JustAGhosT/retort. Since the canonical source repo is phoenixvc/retort,
PRs from that org were incorrectly blocked from modifying .agentkit/ files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lder warnings

Closes #417, #418

engine/synchronize.mjs:
- {{syncDate}} now respects syncDateMode setting:
  'run' (default) keeps current behaviour (today's date),
  'version' emits the spec VERSION string,
  'none' emits empty string — eliminating daily header churn

engine/template-utils.mjs:
- replacePlaceholders() accepts a 4th opts = {} param
- Unresolved placeholder warnings now include the file path when
  opts.filePath is provided (e.g. "Warning: unresolved placeholders
  in .claude/rules/foo.md: {{missingVar}}")

overlays/retort/settings.yaml:
- syncDateMode: none — stops header churn in retort's own synced output

spec/settings.yaml:
- Documents sync.dateMode with all three options and per-repo override
  instructions

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Passing large strings (up to 3000 chars of truncated test/lint output) as
jq --arg arguments hits the OS E2BIG limit on Windows Git Bash, crashing
the stop and pre-push hooks with "Argument list too long".

Fix: add emit_block() helper in stop-build-check.sh that pipes the reason
string via stdin using printf '%s' | jq -Rs, avoiding argv entirely.
Apply the same stdin pattern to pre-push-validate.sh.

Fixes #453. Applied to both generated hooks and template sources.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(engine): skip shebang line in legacy-header stripping to prevent recursion

insertHeader's AgentKit Forge → Retort migration path stripped leading comment
lines by advancing index i while lines[i] matched a comment prefix. Shebang
lines (#!) start with '#!' not '# ', so i stayed at 0, bodyWithoutLegacyHeader
equalled the original content, and the recursive call hit the same branch again
→ RangeError: Maximum call stack size exceeded.

Fix: detect and preserve the shebang line before the comment-stripping loop,
then restore it when rebuilding strippedContent. Also skip the claude-review
CI job when CLAUDE_CODE_OAUTH_TOKEN secret is not configured to avoid spurious
401 failures on forks and repos where the secret has not been set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(engine): wrap tmpDir cleanup to prevent ENOTEMPTY masking primary error

fs.rm() defaults to maxRetries:0, so a single ENOTEMPTY from rmdir
(common on tmpfs/overlayfs when a prior error left files in the temp
directory) would throw and mask the original sync error. Two changes:

1. Add maxRetries:3 / retryDelay:100 so transient ENOTEMPTY is retried
   instead of immediately aborting cleanup.
2. Wrap the entire cleanup in try/catch so any remaining cleanup failure
   is logged at DEBUG level rather than propagating and hiding the real
   error that caused the sync to fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(engine): guard legacy-header check to file start to prevent recursion

content.includes('GENERATED by AgentKit Forge') triggered on any file
containing the string — including rules/language-instruction docs that
reference it in their body text (e.g. template-protection.md rendered
from rules.yaml). After stripping the header lines the body still
contained the string, causing infinite recursion.

Fix: add startsWithLegacyHeader() helper that skips an optional shebang
and blank lines before checking whether the FIRST substantive line is
the legacy header. Only then is the migration path taken.

Also run prettier on all four engine files to clear the pre-existing
formatting check failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(ci): use env-based step guard for claude-review token check

The job-level 'if: \${{ secrets.X != \"\" }}' guard is not reliably
supported across all GitHub Actions runner versions and can produce
'Unrecognized named-value: secrets' parse errors that break the entire
workflow. Move the guard to the step level using an env var (env context
IS supported in step-level if conditions).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(sync): regenerate outputs after insertHeader legacy-header migration fix

Runs the full sync pass to migrate all generated files from
"GENERATED by AgentKit Forge" headers to "GENERATED by Retort" headers,
following the fix to the insertHeader infinite-recursion bug.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sync): resolve unresolved three-way merge conflict markers in managed files

Strips stale conflict markers from 18 managed files (scripts/*.sh,
AGENT_TEAMS.md, docs/history/*/README.md) left from the agentkit-forge
→ retort header migration. The validate-templates drift check runs sync
without a scaffold-cache, so these conflict-marker lines appeared as
uncommitted deletions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(engine): update assertions from agentkit:sync prefix to retort:sync

Three tests had hardcoded log prefix strings from before the CLI rename.
Updated to match the current [retort:sync] output prefix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(engine): update getGeneratedHeader to emit retort:sync in Regenerate line

The function was still generating 'agentkit:sync' after the CLI rename.
Both 'retort:sync' and 'agentkit:sync' are valid aliases in package.json,
but headers should show the preferred new name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(sync): regenerate outputs — update Regenerate line from agentkit:sync to retort:sync

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sync): remove residual conflict markers from managed files (round 2)

The chore(sync) regenerate commit (82d455c) re-introduced conflict markers
into AGENT_TEAMS.md and docs/history/*/README.md by running sync without
a scaffold-cache, which overwrote the clean versions from 3ebbec7 with
the template output that still had unresolved merge markers.

Restored all 7 files from the clean state at 3ebbec7.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(deps): remove package-lock.json in favour of pnpm

packageManager is already set to pnpm@10.30.3 and pnpm-lock.yaml is
the canonical lockfile — the npm lockfile was stale and redundant.

Also updates vscode theme name to match current VS Code display name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(ci): fix prettier check — format files and extend .prettierignore

Format 69 files that were failing the prettier CI check (pre-existing).
Extend .prettierignore to cover:
- .claude/state/** — runtime state files
- .agentkit/state/** — runtime state files
- .agentkit/overlays/** — protected source-of-truth YAML

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
JustAGhosT and others added 18 commits March 27, 2026 16:24
…s, and engine improvements

* fix(budget-guard): security fixes, correctness improvements, and new tests

Phase 1 — Security & Critical Correctness:
- Fix command injection in budget-guard-check.sh: pass AGENTKIT_ROOT via
  env var instead of interpolating into inline node -e script
- Fix JSON construction via string interpolation: use jq --arg for deny
  reason and warning output to prevent content injection
- Replace || with ?? for all 8 policy default fallbacks — zero values
  (maxCommands: 0, warnAtPercent: 0) are now respected instead of falling
  through to defaults
- Fix extractBudgetPolicyRegex: section-aware extraction so session and
  daily warnAtPercent values are read from their respective YAML blocks
  instead of both returning the first match

Phase 2 — Correctness & Robustness:
- Fix duration rounding accumulation in checkDailyBudget: sum milliseconds
  first, convert to minutes once (10×90s sessions = 15min, not 20min)
- Fix midnight boundary race in getTodaySessions: capture date string once
  instead of calling new Date() twice in the same function
- Add filename pre-filter in getTodaySessions to skip historical sessions
  before reading file content (performance improvement)
- Add prototype pollution guard to deepMerge: skip __proto__, constructor,
  prototype keys

Tests:
- Update stale daily.warnAtPercent assertion (75 → 85) to match fixed extraction
- Add 8 new tests covering: zero-value policy limits, section-distinct
  warnAtPercent, deepMerge edge cases, duration rounding, yesterday session
  exclusion, and malformed JSON resilience

Closes #328

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(forge): add /retort dispatcher command and agent-delegation rules

- .claude/commands/retort.md: single entry point for all framework work;
  dispatch table routes to /team-testing, /team-backend, /team-devops,
  /team-forge, /team-security, /team-quality, /team-docs or handles trivial
  spec/template fixes directly
- .claude/rules/agent-delegation.md: non-generated conduct rules for test
  delegation and instruction-update routing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style(budget-guard): fix prettier formatting in test file

* fix(engine): replace pnpm -C with pnpm --dir for Windows compatibility

pnpm -C <dir> fails on Windows Git Bash — the flag is parsed as a
package/script name rather than a directory change, producing:
  '.agentkit' is not recognized as an internal or external command

pnpm --dir <dir> is the explicit long form that works cross-platform.

Changes:
- template-utils.mjs: fix syncCmd generation in getGeneratedHeader()
- init.mjs: update help text
- All 103 template files: bulk replace pnpm -C . → pnpm --dir .
- spec/commands.yaml, rules.yaml, sections.yaml: update command docs
- All generated output files (.claude/, docs/, root md files): regenerated

npm case updated to use --prefix (equivalent for npm).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(engine): fix insertHeader infinite recursion and Windows ENOTEMPTY on tmpDir cleanup

Three bugs fixed:

1. insertHeader infinite recursion (stack overflow on cline/roo rules):
   The legacy AgentKit Forge → Retort header migration code checked
   content.includes('GENERATED by AgentKit Forge') against the ENTIRE
   file. Rule files like template-protection.md reference that string in
   their body text, causing the header-stripping logic to trigger, strip
   comment lines from the body, and recurse forever.
   Fix: scope the check to content.slice(0, 500) so only files whose
   first ~500 chars contain the legacy header trigger the replacement.

2. ENOTEMPTY on tmpDir cleanup (Windows only):
   rm(tmpDir, { recursive: true, force: true }) async implementation on
   Windows attempts rmdir on parent dirs before async child deletions
   complete, throwing ENOTEMPTY. Affected all sync-integration tests that
   use AGENTKIT_ROOT (copilot, overwrite, --diff, etc.).
   Fix: replace with synchronous rmSync which does not have the race.

3. Stale assertion in sync-integration.test.mjs:
   expect(out).toContain('[agentkit:sync] Diff mode') — the prefix was
   renamed to [retort:sync] but the test was never updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style: format all files to satisfy prettier gate

Bulk format of engine source, overlay YAML, docs, and project root files
that had never been formatted. Fixes the only remaining test failure
(the prettier gate test in sync-integration suite).

Files changed: cli.mjs, validate.mjs, overlay settings.yaml files,
.roadmap.yaml, .todo.yaml, AGENT_BACKLOG.md, CHANGELOG.md, README.md,
infra/README.md, migrations/README.md, db/README.md, and numerous
docs/**/*.md files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor(tests): rename wave1-pm-overhaul to sync-agent-features

The old name referenced an internal planning phase that means nothing
to future readers. The four describe blocks cover feature-gated shared
sections, resolveTeamAgents, sync integration for agent personas, and
concurrency protocol simplification — all sync/agent feature tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(backlog): add GH#467 agent usage metrics to backlog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(handoff): 2026-03-27 session — engine fixes, pnpm --dir, GH#467

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Full sync to bring all generated outputs in line with the engine fix
from b811ec8 (syncCmd: pnpm -C → pnpm --dir, template-utils cleanup).
Also resolves three-way merge conflict markers in managed history files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes #394, #395, #396, #418

- template-utils: renderTemplate now passes targetPath as filePath to
  replacePlaceholders so unresolved-placeholder warnings include the
  source template file (completes the fix from c0c7dce which wired the
  param but never called it)
- project-mapping: add apiErrorFormat mapping from
  crosscutting.api.errorFormat so the API spec template can read it
- 03_api_spec.md: replace hardcoded RFC 7807 / Cursor-based with
  {{apiErrorFormat|...}} and {{apiPagination|...}} pipe-default syntax
- 04_git_workflow.md: replace hardcoded develop branch with
  {{integrationBranch}}; replace hardcoded CI/CodeQL status-check list
  with {{#each bpRequiredStatusChecks}} (or a config placeholder when
  the list is empty)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(metrics): emit [METRICS] events in team workflow template (GH#467)

Add structured observability to all team agent workflows. Every generated
team command now instructs the agent to emit [METRICS] log lines to
.claude/state/events.log:

  [METRICS] team=<slug> event=session_start timestamp=<ISO8601>
  [METRICS] team=<slug> event=task_complete taskId=<id> timestamp=<ISO8601>
  [METRICS] team=<slug> event=task_failed taskId=<id> reason=<r> timestamp=<ISO8601>

Source: .agentkit/templates/claude/commands/team-TEMPLATE.md
Regenerated: 367 files across all supported AI tools.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sync): resolve three-way merge conflict markers in managed files

Remove unresolved sync-engine conflict markers committed in
AGENT_TEAMS.md and docs/history/*/README.md. These caused CI's
validate-templates check to fail because CI regenerates from a clean
state (no manifest cache) while local sync tracked the conflict markers
as pristine output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
… fix

Gap 1 — date-prefixed fixture names:
  Renamed session-yesterday.json / session-today.json to
  session-YYYYMMDD-main.json so getTodaySessions() filename fast-path
  filter is exercised. Previously only the content-based fallback was tested.

Gap 2 — parser scope regression fix:
  extractBudgetPolicyRegex's getStr previously searched globally in content.
  If a sibling section (e.g. costTracking) had an enforcement key at 2-space
  indent before budgetPolicy, getStr would return the wrong value. Fixed by
  extracting the budgetPolicy block first and scoping all child searches
  within it. Added regression test to prevent recurrence.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The conventional-commit check in stop-build-check.sh was flagging
git's auto-generated merge messages (e.g. "Merge remote-tracking
branch 'origin/dev' into ..."). These are never user-authored and
should not be held to the conventional commit format.

Add a `continue` guard that skips any commit message matching:
  ^Merge (remote-tracking branch|branch|pull request)

Applied to both the template source and the generated output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y creation

- scripts/reset-state.sh/.ps1: archive completed/rejected tasks, validate orchestrator.json
- scripts/validate-state.sh/.ps1: pre-flight state check for /orchestrate --assess-only flow
- .claude/hooks/init-state.sh/.ps1: session-start hook that ensures .claude/state/tasks/ exists and warns on stale branch/health
- settings.json: register init-state hook as second SessionStart hook

Closes #371

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ot file_path

The simple `pattern:` shorthand for `event: file` hookify rules matches file
content (new_text) rather than the file path. Path-based guards must use
explicit `conditions: [{field: file_path, ...}]` syntax to work correctly.

Adds .claude/rules/hookify.md with:
- Explanation of the bug and its impact
- Broken vs correct examples
- Rules mandating explicit conditions for file event guards

Closes #445

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds docs/reference/gitattributes-eol-guide.md with:
- Recommended .gitattributes content covering all retort-generated directories
- Re-normalization steps to apply the rules to existing tracked files
- Explanation of .gitattributes vs core.autocrlf precedence

Note: adding .gitattributes to the root scaffold template requires a
spec change (protected). This guide serves as the interim adopter resource.

Closes #420

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…o configure

The syncDateMode feature (run|version|none) is already implemented in the engine.
Updated sync-file-modes.md to reflect the live status, add mode reference table,
and document the overlay config adopters need to eliminate date churn.

Closes #417

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…agnostics section

Adds a dedicated issue template for retort:sync bugs with mandatory fields:
- Sync Diagnostics (command output, version, OS, core.autocrlf, sync-report.json)
- Retort version, OS, git autocrlf setting
- Affected area dropdown (drift, LF/CRLF, scaffolding, placeholders, etc.)

The existing bug_report.yml and feature_request.yml are generated and cannot be
modified directly; this non-generated template covers the sync-specific case.

Closes #416

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…467 P1)

Adds scripts/aggregate-metrics.mjs which parses events.log for [METRICS]
lines and JSON objects, then writes agent-metrics.json and agent-health.json
to .claude/state/. Wires the script into stop-build-check.sh (template +
deployed output) so metrics are aggregated non-blockingly at every session close.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…orchestrate (GH#467 P2+P3)

P2: retrospective-analyst now reads agent-health.json and agent-metrics.json
— surfaces high-failure-rate / elevated-failure-rate agents as issues and
correlates invocation counts with observed patterns.

P3: orchestrate Phase 1 Discovery reads agent-health.json before dispatch
— records at-risk agents as risks in orchestrator.json so delegation is
informed by historical failure rates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…idance (GH#444)

Adds .agentkit/templates/claude/rules/worktree-isolation.md (syncs to
.claude/rules/) documenting when to use isolation: "worktree" (implement,
fix, refactor, migration, test tasks), the branch naming convention
(feat/agent-<name>/<slug>), EnterWorktree/ExitWorktree patterns, exemptions
for read-only agents, and the enforcement level (advisory/warn).

Updates orchestrate Phase 3 dispatch to reference worktree isolation and
point agents at the rule file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… (GH#422)

Adds isTestSuitePath() to template-utils.mjs which matches test dirs
(tests/, __tests__/, cypress/, playwright/, e2e/, spec/), test file name
patterns (*.test.*, *.spec.*, vitest.config.*, etc.), and common test
framework config files.

Updates resolveScaffoldAction() to return 'skip' for test paths when
vars.testingExamplesEnabled is false (the default). Adds
testingExamplesEnabled flag computed from project.yaml
automation.testingExamples (defaults to false).

Adds 12 tests covering the guard (default-off, opt-in, frontmatter
override) and the isTestSuitePath() function. Documents the opt-in in
project.yaml with a comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…GH#467)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a per-sync report artifact to .agentkit/sync-report.json containing:
- AgentKit version, timestamp, command + argv
- OS (platform, arch, nodeVersion)
- git.autocrlf and .gitattributes presence
- File counts (generated, skipped, cleaned, failed)
- Per-category fileSummary
- Unresolved placeholders with file paths (collected via module-level
  accumulator in replacePlaceholders, not just console.warn)
- Error list (failedFiles)

Report is skipped for --dry-run and --diff. File is gitignored as a
runtime artifact. 5 new tests in template-utils.test.mjs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eport (GH#423 GH#421)

Adds adopt-if-missing scaffold directive to resolveScaffoldAction():
- scaffold: adopt-if-missing in template frontmatter writes only when the
  destination does not exist; tracked separately from scaffold: once in
  scaffoldResults so adopters can distinguish intentional adoption from
  path-derived once policies.

Extends sync-report.json with full scaffoldResults breakdown:
- scaffoldOnce: path-pattern-derived files skipped (file existed)
- adoptIfMissing: explicit adopt-if-missing files skipped (file existed)
- alwaysRegenerated, managedRegenerated, managedMerged, managedConflicts,
  managedPreserved, managedNoCache (already tracked internally, now surfaced)

Satisfies #421 request to emit a clearer per-file scaffold policy list.
2 new tests for adopt-if-missing in resolveScaffoldAction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@blocksorg
Copy link
Copy Markdown

blocksorg bot commented Mar 28, 2026

Mention Blocks like a regular teammate with your question or request:

@blocks review this pull request
@blocks make the following changes ...
@blocks create an issue from what was mentioned in the following comment ...
@blocks explain the following code ...
@blocks are there any security or performance concerns?

Run @blocks /help for more information.

Workspace settings | Disable this message

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b5d2907c-a37a-4c22-85c9-83564ee765f5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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 and usage tips.

Node.js/TypeScript MCP server in .mcp/server/ exposing:
- get_tasks: reads .todo.yaml (filterable by status/priority)
- get_roadmap: reads .roadmap.yaml
- get_pipeline_status: GitHub Actions last 5 runs via API
- get_project_info: combined summary for AI agent context

Deploy to Railway with:
  rootDirectory: .mcp/server
  env: MCP_SECRET, GITHUB_TOKEN, REPO=phoenixvc/retort

Register with mcp-org via register_project tool once deployed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
JustAGhosT and others added 2 commits March 28, 2026 19:34
* feat(metrics): emit [METRICS] events in team workflow template (GH#467)

Add structured observability to all team agent workflows. Every generated
team command now instructs the agent to emit [METRICS] log lines to
.claude/state/events.log:

  [METRICS] team=<slug> event=session_start timestamp=<ISO8601>
  [METRICS] team=<slug> event=task_complete taskId=<id> timestamp=<ISO8601>
  [METRICS] team=<slug> event=task_failed taskId=<id> reason=<r> timestamp=<ISO8601>

Source: .agentkit/templates/claude/commands/team-TEMPLATE.md
Regenerated: 367 files across all supported AI tools.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sync): resolve three-way merge conflict markers in managed files

Remove unresolved sync-engine conflict markers committed in
AGENT_TEAMS.md and docs/history/*/README.md. These caused CI's
validate-templates check to fail because CI regenerates from a clean
state (no manifest cache) while local sync tracked the conflict markers
as pristine output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(mcp): use GitHub API fallback for YAML reading in production

* chore(mcp): add production server entry to servers.json

* fix: apply CodeRabbit auto-fixes

Fixed 2 file(s) based on 2 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

* fix(mcp): address CodeRabbit review — /ready error handling, GITHUB_TOKEN guard, parallel fetches, roadmap tasks field

- /ready: wrap readYaml calls in try/catch, return 503 on error
- fetchGitHubContent: throw on missing GITHUB_TOKEN instead of returning null
- fetchGitHubContent: add 8s AbortController timeout on GitHub API calls
- get_project_info: parallelize YAML + pipeline fetches with Promise.all
- get_roadmap + get_project_info: read roadmap.tasks first (PhoenixVC schema),
  fall back to milestones/items for forward compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style: apply prettier formatting to 5 files flagged by CI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style: prettier format template-utils.mjs

* fix(validate): rename area→sync_category in sync_bug_report.yml

The validator enforces id:area dropdowns against the team issueArea enum.
sync_bug_report uses it for bug categories, not team areas — renaming avoids
the false-positive validation errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style: prettier format .mcp/server/package.json

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
…es forward

Takes dev's versions for all generated file conflicts (dev is more recent).
Only new files from main (package-lock.json, .cursor/rules/security.mdc) are kept.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Retort Source Change Detected

This PR modifies files in the Retort source directories:

  • .agentkit/templates/ — output templates
  • .agentkit/spec/ — YAML specifications
  • .agentkit/engines/ — sync engine code
  • .agentkit/overlays/ — per-repo customizations
  • .agentkit/bin/ — CLI scripts

These are the upstream source-of-truth for all generated AI tool configs.

Review checklist

  • Changes are intentional and not accidental AI agent modifications
  • Spec schema validation passes (pnpm --dir .agentkit agentkit:spec-validate)
  • Sync produces expected output (pnpm --dir .agentkit agentkit:sync)
  • No secrets or credentials in template variables
  • Breaking changes documented in an ADR

AI agents: Do not modify these files directly. Propose changes in a dedicated PR.

@JustAGhosT JustAGhosT merged commit 184a8e9 into main Mar 28, 2026
12 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant