Commit graph

18 commits

Author SHA1 Message Date
Gandalf
0a4b06c0f8
fix(gate-validator): address CodeRabbit review on PR #356
- Add backup before overwriting hook in installer (consistent with
  existing backup pattern for agents/skills/commands)
- Add TTL-based eviction for pendingValidations Map (prevents memory
  leak if tool.execute.after never fires on timeout/crash)
- Fix tilde fallback: skip HOME-based candidate path when HOME is
  undefined instead of using literal '~' that Node can't resolve
- Document non-atomic race window in restore-and-validate flow

Requested-by: @jeff-music-city
2026-04-15 23:34:22 -03:00
Gandalf
e916168251
feat(opencode): add gate progression validator (soft block)
OpenCode integration for the gate progression validator using
tool.execute.before/after hooks with detect-and-revert strategy.

Since OpenCode SDK lacks hard block (deny) support in tool hooks,
this uses a two-phase approach:
1. tool.execute.before: saves backup of current-cycle.json
2. tool.execute.after: runs the same shell validator used by Claude
   Code. If invalid → reverts file to previous state + replaces tool
   output with block message showing which gates need completion.

Tested in live OpenCode session: agent attempted to write
current-cycle.json with gate 8 while testing gates were pending.
Hook detected, reverted, and injected error message. Agent saw
' GATE PROGRESSION BLOCKED' instead of 'Wrote file successfully'.

Also updates installer.sh to copy validate-gate-progression.sh
to ~/.config/opencode/hooks/ during ring install.

Requested-by: @jeff-music-city
2026-04-15 23:22:20 -03:00
Jefferson Rodrigues
4b6f064474
refactor(standards): canonize POSTGRES_* env vars instead of DB_*
Align all Go standards with the boilerplate canonical naming:
- DB_HOST → POSTGRES_HOST (and all DB_* variants)
- DB_REPLICA_* → POSTGRES_REPLICA_*
- DB_MAX_OPEN_CONNS → POSTGRES_MAX_OPEN_CONNS
- PrimaryDBHost → PrimaryHost (Go field names)
- ReplicaDBHost → ReplicaHost (Go field names)

Files updated: bootstrap.md, core.md, multi-tenant.md, quality.md,
testing-unit.md, dev-service-discovery/SKILL.md, opencode/golang.md,
code-example-standards.md

MongoDB (MONGO_*) and Midaz multi-module (DB_ONBOARDING_*) patterns
are unchanged — only generic DB_* was renamed to POSTGRES_*.
2026-04-15 01:48:09 -03:00
Fred Amaral
600a505c9a
docs: propagate performance-reviewer as 8th codereview agent across all downstream references
Update all skills, agents, shared patterns, docs, and platform configs that still referenced 7 code review agents to reflect the 8th reviewer (ring:performance-reviewer). Includes agent self-descriptions, dispatch instructions, anti-rationalization tables, slicing math, gate tables, and opencode schema definitions.

X-Lerian-Ref: 0x1
2026-04-14 15:53:45 -03:00
Fred Amaral
c142c3d720
refactor(skills): remove commands layer and rename skills to match command names
Skills are now the sole invocation mechanism — commands have been eliminated
as an architectural layer. All 33 commands removed, 22 skills renamed to
match the command names teams already knew, and 1 new skill (portfolio-review)
created to replace the last orchestrator command.

Renames: brainstorming→brainstorm, requesting-code-review→codereview,
git-commit→commit, session-handoff→create-handoff, drawing-diagrams→diagram,
executing-plans→execute-plan, exploring-codebase→explore-codebase,
interviewing-user→interview-me, linting-codebase→lint,
release-guide-info→release-guide, visual-explainer→visualize,
using-git-worktrees→worktree, writing-plans→write-plan,
dev-feedback-loop→dev-report, delivery-status-tracking→delivery-status,
delivery-reporting→delivery-report, executive-reporting→executive-summary,
dependency-mapping→dependency-analysis, documentation-review→review-docs,
writing-functional-docs→write-guide, writing-api-docs→write-api

Generated-by: Claude
AI-Model: claude-opus-4-6
2026-04-12 10:14:20 -03:00
Gandalf
a994b24cd7
fix: align Ring API standards with actual Midaz patterns
Two misalignments found and fixed:

## 1. Pagination response field naming

Ring standards previously documented cursor fields as camelCase
(nextCursor, prevCursor, hasMore). The actual Midaz Pagination struct
uses snake_case json tags:

  NextCursor string `json:"next_cursor,omitempty"`
  PrevCursor string `json:"prev_cursor,omitempty"`

There is no HasMore/hasMore field in Midaz.

Changes:
- api-patterns.md: fix struct examples, JSON examples, detection
  commands, tables, and anti-rationalization rows
- golang.md (opencode): pagination section was already correct
- PM skill files: update pagination field reference tables

## 2. BusinessError struct missing title field

Ring's BusinessError lacked the title field present in both
midaz/pkg/mmodel/error.go and lib-commons ErrorResponse:

  type Error struct {
      Code       string `json:"code"`
      Title      string `json:"title"`
      Message    string `json:"message"`
      EntityType string `json:"entityType,omitempty"`
  }

Changes:
- platforms/opencode/standards/golang.md: add Title field to
  BusinessError struct and to ErrInvalidInput/ErrNotFound examples

Files changed:
- dev-team/docs/standards/golang/api-patterns.md
- platforms/opencode/standards/golang.md
- pm-team/skills/pre-dev-api-design/SKILL.md
- pm-team/skills/shared-patterns/standards-discovery.md
2026-03-31 19:36:31 -03:00
Jefferson Rodrigues
c2613f767b
Merge pull request #300 from LerianStudio/fix/278-json-camelcase
fix(standards): use camelCase for JSON field naming in code examples
2026-03-23 13:50:31 -03:00
Jefferson Rodrigues
491f85dc19
fix(standards): use camelCase for JSON field naming in code examples (#278)
Fix QueueMessage struct tags in messaging.md and opencode/golang.md (organization_id → organizationId, etc.) and invert GOOD/BAD reference examples in production-readiness-audit to match the mandatory camelCase JSON convention from api-patterns.md.

X-Lerian-Ref: 0x1
2026-03-23 13:49:37 -03:00
Jefferson Rodrigues
635b15cb19
fix(standards): enforce zero panic policy across all standards and agents (#277)
Replace all 13 panic() positive examples with return error patterns, close the bootstrap exception loophole, resolve os.Exit() contradiction in domain.md, fix InitServers() caller to handle (*Service, error), update License Manager guidance to return error instead of panic, make grep commands recursive with regexp.MustCompile exclusion, and add post-generation self-checks to prevent agents from generating panic/log.Fatal/Must* code.

X-Lerian-Ref: 0x1
2026-03-23 13:47:31 -03:00
Gandalf
e91fc6df17
fix(standards): add bootstrap-only comments to panic() examples
Agents were copying panic(err) patterns from code examples into business
logic. The examples are correct (panic IS acceptable in bootstrap/init),
but without explicit comments, agents treated them as general-purpose
patterns.

Added '// bootstrap-only: panic is acceptable in main/init; NEVER use
panic in business logic' comments to all panic() occurrences in:
- pm-team/skills/shared-patterns/code-example-standards.md
- dev-team/docs/standards/sre.md
- dev-team/docs/standards/golang/bootstrap.md
- dev-team/docs/standards/golang/core.md
- dev-team/docs/standards/golang/security.md
- platforms/opencode/standards/sre.md

Reported by: Garzão (#the-ring-feedbacks)
Refs: Ring agents generating panic() in service/handler code
2026-03-13 16:10:29 -03:00
Jefferson Rodrigues
e25427e549
fix(standards): align tracer pattern with plugin real implementation
Replace invented struct-field tracer (s.tracer.Start) with the actual
pattern from plugin-br-bank-transfer-jd: global OTel tracer via thin
wrapper package (telemetry.StartSpan).

- All s.tracer/h.tracer/r.tracer.Start → telemetry.StartSpan
- Add mandatory Telemetry Wrapper Package section with full tracer.go
- Update ASCII diagrams, instrumentation checklist, method template
- Update anti-patterns table to reference wrapper package
- Fix MIG-004 tracer criteria to match real pattern (global, not DI)

X-Lerian-Ref: 0x1
2026-03-11 20:17:31 -03:00
Jefferson Rodrigues
2eff85c55b
fix(standards): rename alias to libCommons and ensure tests in migration tasks
- Replace libUncommons alias with libCommons across golang.md and migrate-v4 skill
- Add explicit _test.go coverage to every MIG task acceptance criteria
- Add Task Generation Rule: files list MUST include test files
- Fix MIG-002 no-op line (libCommons alias stays, only import path changes)

X-Lerian-Ref: 0x1
2026-03-11 20:01:15 -03:00
Jefferson Rodrigues
510a2d8328
fix(standards): address PR review issues in v4 migration
- Re-add FORBIDDEN rule for direct Fiber response methods (chttp wrappers required)
- Fix bare tracer variable in pagination repository example (tracer → r.tracer)
- Standardize all error logging to clog.Err(err) instead of clog.Any("error", err)
- Remove cassert from MIG-003 acceptance criteria (de-para only, not new patterns)
- Add concrete OTel middleware setup in router example (chttp.NewTelemetryMiddleware)

X-Lerian-Ref: 0x1
2026-03-11 17:51:17 -03:00
Jefferson Rodrigues
59d23409c3
feat(standards): migrate Go standards from lib-commons v2 to v4
Update golang.md with all v4 patterns:
- Import aliases: lib prefix → c prefix (libCommons→libUncommons, libZap→czap, etc.)
- Logging: Printf-style → structured fields (clog.String, clog.Int, clog.Err)
- Config: SetConfigFromEnvVars → InitLocalEnvConfig + nested structs with envDefault
- Bootstrap: Launcher/ServerManager → explicit lifecycle with signal.NotifyContext + cruntime
- Telemetry: InitializeTelemetry → NewTelemetry + ApplyGlobals
- Context tracking: NewTrackingFromContext → dependency-injected logger
- 8 new sections: cassert, cruntime, cmetrics, csafe, ccrypto, cbackoff, circuit breaker, outbox

Add ring:dev-migrate-v4 skill and /ring:migrate-v4 command:
- Surgical de-para migration (replaces only what exists, no new patterns added)
- Visual HTML report via ring:visual-explainer
- Tasks in ring:dev-cycle format (MIG-001 to MIG-006 + MIG-FINAL)
- v4-only patterns reported as opportunities, not obligations

X-Lerian-Ref: 0x1
2026-03-11 17:51:17 -03:00
Fred Amaral
c1d4fe6d45
feat(review): add dead-code-reviewer agent for orphan detection
Introduces a new parallel reviewer, `ring:dead-code-reviewer`, to
systematically identify orphaned code resulting from changes. This
enhances codebase hygiene by detecting unused helpers, types, and
tests, thereby reducing technical debt and improving maintainability.

The parallel code review system is expanded from 6 to 7 concurrent
reviewers. All related workflows, skills, commands, and documentation
have been updated to integrate this new capability.

- Add the `ring:dead-code-reviewer` agent, which analyzes code across
 three concentric rings (target, direct dependents, ripple effect) to
 find unreachable code.
- Update the `/ring:codereview` command and `ring:requesting-code-review`
 skill to dispatch all 7 reviewers in a single parallel step.
- Adjust project documentation, including architecture diagrams, manuals,
 and agent guides, to reflect the 7-reviewer workflow.
2026-03-09 21:17:22 -03:00
Fred Amaral
cdec509d83
refactor(session): replace custom handoff workflow with native Plan Mode
feat(default): add session-handoff skill to enable seamless context resume
refactor(arch): move complex orchestration from commands into skills
feat(pm-team): add orchestrator skills for pre-dev planning workflows
feat(dev-team): add skill to manage development cycle state (status/cancel)
feat(default): add skill to formalize git commit generation process
refactor(default): prune granular skills to focus core library on workflows
fix(pmo-team): align pmo-retrospective skill name with ring convention
docs: update all documentation to reflect major skill refactoring
2026-03-09 07:24:07 -03:00
Fred Amaral
0e7e5ca396
refactor: decouple agents from specific model requirements
Removes the hard-coded `model: "opus"` requirement from all agent
definitions, skill examples, and command documentation. The orchestrator
is now responsible for model selection, making the agent framework more
flexible and model-agnostic.

Key changes include:
- Removing the `model` parameter from all agent frontmatter and Task
 tool examples.
- Deleting the "Model Requirement" hard gate and self-verification
 sections from all agent prompts. This simplifies the prompts and
 removes model-specific enforcement logic.
- Updating core documentation (ARCHITECTURE, MANUAL, README) to reflect
 that model selection is an orchestrator concern.
- Removing redundant `changelog` and `last_updated` fields from agent
 frontmatter, as this information is tracked by source control.

This architectural shift allows the orchestrator to dynamically choose
the best model for a given task based on complexity, cost, or speed,
without being constrained by the agent's definition. It simplifies
agent maintenance and prepares the system for easier integration of
future AI models.
2026-03-08 16:33:12 -03:00
Gandalf
f85aa61440
feat: add OpenCode platform integration (consolidate ring-for-opencode)
Move OpenCode runtime plugin and installer into Ring monorepo under platforms/opencode/.
The installer reads skills, agents, and commands directly from the Ring monorepo's
canonical directories (default/, dev-team/, pm-team/, etc.) — zero asset duplication.

What's included:
- installer.sh: reads from Ring dirs, applies frontmatter/tool transforms, installs to ~/.config/opencode/
- plugin/: TypeScript runtime (RingUnifiedPlugin) with hooks, lifecycle, loaders
- src/: CLI (doctor, config-manager)
- prompts/: session-start and context-injection templates
- standards/: coding standards (from dev-team/docs/)
- ring.jsonc: default config with full 86-skill/35-agent/33-command inventory

What's NOT included (intentionally):
- assets/ directory: eliminated, content comes from Ring monorepo
- scripts/codereview/: eliminated, replaced by mithril
- using-ring-opencode skill: uses canonical using-ring instead

Transforms applied by installer:
- Agent: type→mode, strip version/changelog/output_schema/input_schema
- Skill: keep name+description frontmatter, body unchanged
- Command: strip argument-hint (unsupported by OpenCode)
- All: normalize tool names (Bash→bash, Read→read, etc.)
- All: strip Model Requirement sections from agents

Replaces: LerianStudio/ring-for-opencode repository
Generated-by: Gandalf
AI-Model: claude-opus-4
2026-03-07 22:46:47 -03:00