@rexeus/agentic 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +201 -0
  3. package/assets/opencode/agents/analyst.md +358 -0
  4. package/assets/opencode/agents/architect.md +308 -0
  5. package/assets/opencode/agents/developer.md +311 -0
  6. package/assets/opencode/agents/lead.md +368 -0
  7. package/assets/opencode/agents/refiner.md +418 -0
  8. package/assets/opencode/agents/reviewer.md +285 -0
  9. package/assets/opencode/agents/scout.md +241 -0
  10. package/assets/opencode/agents/tester.md +323 -0
  11. package/assets/opencode/commands/agentic-commit.md +128 -0
  12. package/assets/opencode/commands/agentic-develop.md +170 -0
  13. package/assets/opencode/commands/agentic-plan.md +165 -0
  14. package/assets/opencode/commands/agentic-polish.md +190 -0
  15. package/assets/opencode/commands/agentic-pr.md +226 -0
  16. package/assets/opencode/commands/agentic-review.md +119 -0
  17. package/assets/opencode/commands/agentic-simplify.md +123 -0
  18. package/assets/opencode/commands/agentic-verify.md +193 -0
  19. package/bin/agentic.js +139 -0
  20. package/opencode/config.mjs +453 -0
  21. package/opencode/doctor.mjs +9 -0
  22. package/opencode/guardrails.mjs +172 -0
  23. package/opencode/install.mjs +48 -0
  24. package/opencode/manifest.mjs +34 -0
  25. package/opencode/plugin.mjs +53 -0
  26. package/opencode/uninstall.mjs +64 -0
  27. package/package.json +69 -0
  28. package/skills/conventions/SKILL.md +83 -0
  29. package/skills/git-conventions/SKILL.md +141 -0
  30. package/skills/quality-patterns/SKILL.md +73 -0
  31. package/skills/security/SKILL.md +77 -0
  32. package/skills/setup/SKILL.md +105 -0
  33. package/skills/testing/SKILL.md +113 -0
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: quality-patterns
3
+ description: Identifies code quality anti-patterns and provides best practices. Applied when analyzing code smells, architecture decisions, complexity, or technical debt.
4
+ user-invokable: false
5
+ ---
6
+
7
+ # Quality Patterns & Anti-Patterns
8
+
9
+ Code quality isn't subjective. These patterns are proven signals — each backed
10
+ by decades of engineering wisdom. When this skill is active, evaluate code
11
+ against these patterns. Flag violations with evidence and specific remediation.
12
+
13
+ ## Anti-Patterns to Flag
14
+
15
+ ### Complexity
16
+
17
+ - **God objects**: Classes with many unrelated public methods or excessive dependencies
18
+ (typically 8+ public methods across multiple concerns, or 10+ dependencies).
19
+ Fix: Extract focused collaborators.
20
+ - **Feature envy**: A function that accesses another object's data more than its own.
21
+ Fix: Move the behavior to where the data lives.
22
+ - **Primitive obsession**: Using strings or numbers where a domain type would add clarity.
23
+ Fix: Introduce a value object (`EmailAddress`, `Money`, `UserId`).
24
+ - **Deep nesting**: More than 3 levels of indentation.
25
+ Fix: Extract to functions, use early returns, invert conditions.
26
+
27
+ ### Coupling
28
+
29
+ - **Temporal coupling**: Functions that must be called in a specific order.
30
+ Fix: Make the dependency explicit through function composition or a builder pattern.
31
+ - **Stamp coupling**: Passing a large object when only one field is needed.
32
+ Fix: Pass only what's needed. Narrow the interface.
33
+ - **Leaky abstractions**: Implementation details surfacing through a public API.
34
+ Fix: Introduce an interface boundary.
35
+
36
+ ### Duplication
37
+
38
+ - **Shotgun surgery**: A single change requires edits in many places.
39
+ Fix: Centralize the varying behavior behind an abstraction.
40
+ - **Copy-paste code**: Identical or near-identical blocks in multiple locations.
41
+ Fix: Extract a shared function. If the duplication is structural, extract a pattern.
42
+ - **Long parameter lists**: Functions taking 4+ parameters that travel together.
43
+ Fix: Introduce a parameter object or config type.
44
+ - **Data clumps**: Groups of values that always appear together across multiple functions.
45
+ Fix: Extract a cohesive type that represents the concept.
46
+
47
+ ### Error Handling
48
+
49
+ - **Silent failures**: Catching errors without logging or rethrowing.
50
+ Fix: At minimum, log. Better: rethrow or return a Result type.
51
+ - **Overly broad catches**: `catch (e: any)` or `catch (Exception e)`.
52
+ Fix: Catch the narrowest type possible.
53
+ - **Error codes as control flow**: Using return values instead of exceptions (or vice versa) inconsistently.
54
+ Fix: Pick one pattern and use it consistently within a boundary.
55
+
56
+ ## Positive Patterns to Encourage
57
+
58
+ - **Single Responsibility**: Each module has one reason to change.
59
+ - **Dependency Inversion**: Depend on abstractions, not concretions.
60
+ - **Fail Fast**: Validate inputs at the boundary, trust internals.
61
+ - **Composition over Inheritance**: Combine behaviors through composition.
62
+ - **Immutability by Default**: Mutable state is opt-in, not opt-out.
63
+ - **Explicit over Implicit**: Make side effects, dependencies, and state transitions visible.
64
+
65
+ ## Severity Classification
66
+
67
+ When reporting issues, classify by impact:
68
+
69
+ - **Critical**: Will cause bugs, data loss, or security vulnerabilities. Must fix.
70
+ - **Warning**: Increases maintenance cost or risk. Should fix.
71
+ - **Suggestion**: Improves clarity or follows best practices. Consider fixing.
72
+
73
+ Only flag issues you are confident about. False positives erode trust.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: security
3
+ description: Identifies security vulnerabilities and provides secure coding patterns. Applied when reviewing code for injection, authentication, authorization, and data exposure risks.
4
+ user-invokable: false
5
+ ---
6
+
7
+ # Security Patterns
8
+
9
+ Security isn't a feature. It's a property of well-crafted code. Every
10
+ vulnerability caught in review is an incident prevented in production.
11
+ When this skill is active, evaluate code against these patterns and flag
12
+ vulnerabilities
13
+ with specific, actionable remediation steps.
14
+
15
+ ## Injection
16
+
17
+ - **SQL Injection**: User input concatenated into SQL queries.
18
+ Fix: Use parameterized queries or prepared statements. Never interpolate.
19
+ - **Command Injection**: User input passed to shell commands or process spawning.
20
+ Fix: Use library APIs instead of shell commands. If unavoidable, use allowlists
21
+ and argument arrays instead of string interpolation.
22
+ - **XSS (Cross-Site Scripting)**: User input rendered as HTML without escaping.
23
+ Fix: Use framework-provided escaping. Never set innerHTML with user data.
24
+ - **Template Injection**: User input evaluated in template engines.
25
+ Fix: Use sandboxed templates. Never pass user input to dynamic code evaluation.
26
+
27
+ ## Authentication & Authorization
28
+
29
+ - **Hardcoded credentials**: API keys, passwords, or tokens in source code.
30
+ Fix: Use environment variables or a secrets manager. Never commit secrets.
31
+ - **Weak token generation**: Predictable session tokens or API keys.
32
+ Fix: Use cryptographically secure random generators (crypto.randomUUID).
33
+ - **Missing authorization checks**: Endpoints that verify authentication but not permissions.
34
+ Fix: Check authorization at every endpoint. Don't rely on client-side checks.
35
+ - **Insecure password handling**: Plaintext storage or weak hashing (MD5, SHA1).
36
+ Fix: Use bcrypt, scrypt, or argon2 with appropriate cost factors.
37
+
38
+ ## Data Exposure
39
+
40
+ - **Sensitive data in logs**: Passwords, tokens, or PII written to log output.
41
+ Fix: Sanitize log entries. Use structured logging with field-level filtering.
42
+ - **Verbose error messages**: Stack traces or internal paths exposed to users.
43
+ Fix: Return generic error messages to clients. Log details server-side only.
44
+ - **Missing encryption**: Sensitive data stored or transmitted in plaintext.
45
+ Fix: Use TLS for transit. Encrypt at rest with AES-256 or equivalent.
46
+
47
+ ## Server-Side Risks
48
+
49
+ - **SSRF (Server-Side Request Forgery)**: User-controlled URLs passed to server-side HTTP requests.
50
+ Fix: Validate and allowlist target URLs. Block internal/private IP ranges.
51
+ - **Insecure deserialization**: Untrusted data deserialized without validation.
52
+ Fix: Validate structure before deserialization. Use schema validation (Zod, JSON Schema).
53
+
54
+ ## Input Validation
55
+
56
+ - **Missing boundary validation**: No checks on input size, range, or format.
57
+ Fix: Validate at the system boundary. Reject before processing.
58
+ - **Type coercion vulnerabilities**: Loose comparisons that bypass checks.
59
+ Fix: Use strict equality. Validate types explicitly.
60
+ - **Path traversal**: User input used to construct file paths.
61
+ Fix: Use path.resolve and validate the result stays within allowed directories.
62
+
63
+ ## Dependency Security
64
+
65
+ - **Known vulnerable dependencies**: Packages with published CVEs.
66
+ Fix: Run npm audit or equivalent. Update or replace vulnerable packages.
67
+ - **Typosquatting risk**: Dependencies with names similar to popular packages.
68
+ Fix: Verify package names, publishers, and download counts before installing.
69
+
70
+ ## Adapting to the Project
71
+
72
+ Before flagging security issues:
73
+
74
+ 1. Check if the project has security-specific CLAUDE.md rules
75
+ 2. Understand the trust boundary — internal tools have different risk profiles
76
+ 3. Don't flag issues in test code unless they affect production security
77
+ 4. Consider the deployment context (serverless, container, bare metal)
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: setup
3
+ description: Getting started with Agentic — workflow, commands, and how the agent team works together.
4
+ ---
5
+
6
+ # Getting Started with Agentic
7
+
8
+ Agentic is a multi-agent development toolkit. Seven specialists, one
9
+ orchestrator (the Lead), zero configuration.
10
+
11
+ In OpenCode, `lead` is installed as a visible primary agent. The specialists
12
+ are installed as hidden subagents. Talk to the Lead; the Lead deploys the team.
13
+
14
+ ## Your First Session
15
+
16
+ The Lead agent is your main thread. Start with the Lead when you want to build,
17
+ fix, or improve something — it deploys the right specialists for the job.
18
+
19
+ For structured workflows, use the commands:
20
+
21
+ ```
22
+ OpenCode: /agentic-plan Claude Code: /agentic:plan
23
+ OpenCode: /agentic-develop Claude Code: /agentic:develop
24
+ OpenCode: /agentic-review Claude Code: /agentic:review
25
+ OpenCode: /agentic-simplify Claude Code: /agentic:simplify
26
+ OpenCode: /agentic-polish Claude Code: /agentic:polish
27
+ OpenCode: /agentic-verify Claude Code: /agentic:verify
28
+ OpenCode: /agentic-commit Claude Code: /agentic:commit
29
+ OpenCode: /agentic-pr Claude Code: /agentic:pr
30
+ ```
31
+
32
+ ## The Typical Flow
33
+
34
+ ```
35
+ Plan → Develop → Review → Simplify → Verify → Commit → PR
36
+
37
+ Polish (iterative loop)
38
+ ```
39
+
40
+ 1. `/agentic-plan` (OpenCode) or `/agentic:plan` (Claude Code) — describe what you want. The Lead asks questions, challenges
41
+ scope, and produces a plan. You approve before anything is built.
42
+ 2. `/agentic-develop` (OpenCode) or `/agentic:develop` (Claude Code) — the Lead scouts the codebase, designs the approach,
43
+ briefs the developer, and runs review + tests.
44
+ 3. `/agentic-review` (OpenCode) or `/agentic:review` (Claude Code) — independent parallel reviewers check correctness,
45
+ security, and conventions.
46
+ 4. `/agentic-simplify` (OpenCode) or `/agentic:simplify` (Claude Code) — the Refiner removes unnecessary complexity while
47
+ preserving behavior.
48
+
49
+ **Polish.** `/agentic-polish` (OpenCode) or `/agentic:polish` (Claude Code) is the consistency loop. It aligns the code
50
+ with established patterns, smooths out inconsistencies, and is designed for iterative runs until the codebase converges.
51
+
52
+ 5. Review the changes yourself. Stage what looks good with `git add`.
53
+ 6. `/agentic-commit` (OpenCode) or `/agentic:commit` (Claude Code) — creates the commit message from staged changes.
54
+ 7. `/agentic-pr` (OpenCode) or `/agentic:pr` (Claude Code) — creates or updates a Pull Request.
55
+
56
+ Skip steps you don't need. Every command works independently.
57
+
58
+ ## Important: You Control Staging
59
+
60
+ No agent will ever run `git add`, `git stash`, or modify your staged files.
61
+ Staging is your responsibility. The agents write code — you decide what ships.
62
+
63
+ ## The Agents
64
+
65
+ You don't deploy agents directly. The Lead does that based on your task:
66
+
67
+ - **Scout** — fast reconnaissance, maps the codebase
68
+ - **Analyst** — traces logic, follows data flows, explains mechanics
69
+ - **Architect** — designs solutions, evaluates trade-offs
70
+ - **Developer** — the only agent that writes source code
71
+ - **Reviewer** — reviews for correctness and security (read-only)
72
+ - **Tester** — writes and runs tests (test code only)
73
+ - **Refiner** — simplifies working code without changing behavior
74
+
75
+ ## Customizing Models
76
+
77
+ Agents use your default model unless overridden. In OpenCode, configure
78
+ per-agent models in `opencode.json`:
79
+
80
+ ```json
81
+ {
82
+ "agent": {
83
+ "lead": { "model": "openai/gpt-5.4" },
84
+ "scout": { "model": "anthropic/claude-haiku-4-5" },
85
+ "developer": { "model": "openai/gpt-5.4" }
86
+ }
87
+ }
88
+ ```
89
+
90
+ Model IDs use the `provider/model` format. A practical setup: fast model for
91
+ the scout (reconnaissance), capable model for the lead and developer
92
+ (orchestration and implementation), default for the rest.
93
+
94
+ In Claude Code, model overrides are configured in `settings.json` via the
95
+ `agentSettings` key.
96
+
97
+ ## Guardrails
98
+
99
+ The plugin enforces quality automatically:
100
+
101
+ - **Secrets blocked** before writing (hardcoded passwords, API tokens)
102
+ - **Commit messages validated** against Conventional Commits format
103
+ - **Debug statements flagged** after writing (console.log, debugger)
104
+ - **Unowned TODOs flagged** — use `TODO(name)` or `TODO(#123)`
105
+ - **Agent role enforcement** via Stop hooks (Claude Code integration)
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: testing
3
+ description: Provides testing philosophy, patterns, and strategies. Applied when writing tests, assessing coverage, or designing test architectures.
4
+ user-invokable: false
5
+ ---
6
+
7
+ # Testing Patterns
8
+
9
+ Examples use **TypeScript/JavaScript** conventions (Vitest, Jest, Mocha).
10
+ For other languages, adapt patterns to the project's test framework.
11
+
12
+ Tests aren't bureaucracy. They're a commitment to excellence — proof that
13
+ the code does what it claims. When this skill is active, apply these
14
+ principles to every test you write or assess.
15
+
16
+ ## Philosophy
17
+
18
+ - **Test behavior, not implementation.** Tests verify what the code does,
19
+ not how it does it. A refactoring that preserves behavior should never
20
+ break a test.
21
+ - **One assertion per concept.** Each test verifies one specific behavior.
22
+ If a test name needs "and", split it.
23
+ - **Tests are documentation.** A well-named test suite is a specification.
24
+ `it('returns 401 when token is expired')` is both test and documentation.
25
+ - **Fast tests run often.** The faster the feedback loop, the more value
26
+ tests provide. Prefer unit tests over integration tests over E2E tests.
27
+
28
+ ## Test Structure
29
+
30
+ Follow the **Arrange-Act-Assert** pattern:
31
+
32
+ ```
33
+ // Arrange: set up the preconditions
34
+ const user = createTestUser({ role: 'admin' })
35
+ const request = buildRequest({ userId: user.id })
36
+
37
+ // Act: execute the behavior under test
38
+ const result = await handleRequest(request)
39
+
40
+ // Assert: verify the outcome
41
+ expect(result.status).toBe(200)
42
+ ```
43
+
44
+ Each section should be clearly separated. If Arrange is more than 5 lines,
45
+ extract a factory or fixture.
46
+
47
+ ## Naming Conventions
48
+
49
+ Test names should read as specifications:
50
+
51
+ - `describe('TokenService')` — the unit under test
52
+ - `describe('validate()')` — the method or behavior
53
+ - `it('returns invalid when token is expired')` — the specific case
54
+
55
+ Pattern: `it('<expected outcome> when <condition>')`
56
+
57
+ ## What to Test
58
+
59
+ ### Layer 1: Unit Tests (always)
60
+
61
+ - Individual functions and methods in isolation
62
+ - Pure logic, calculations, transformations
63
+ - Error handling paths
64
+ - Boundary conditions
65
+
66
+ ### Layer 2: Integration Tests (at boundaries)
67
+
68
+ - Component interactions
69
+ - Database queries (with test database)
70
+ - API endpoint request/response cycles
71
+ - Middleware chains
72
+
73
+ ### Layer 3: Edge Cases (where bugs hide)
74
+
75
+ - Empty, null, undefined inputs
76
+ - Boundary values: 0, -1, MAX_INT, empty string, single character
77
+ - Concurrent operations and race conditions
78
+ - Large inputs, deeply nested structures
79
+ - Invalid types and malformed data
80
+ - Unicode, special characters, emoji
81
+
82
+ ## Test Doubles
83
+
84
+ Use the right double for the job:
85
+
86
+ - **Stub**: Returns predetermined data. Use when you need controlled input.
87
+ - **Mock**: Verifies interactions. Use sparingly — only when the interaction IS the behavior.
88
+ - **Fake**: Working implementation with shortcuts. Use for external services.
89
+ - **Spy**: Records calls without changing behavior. Use to observe side effects.
90
+
91
+ **Rule:** Prefer stubs over mocks. Mocking implementation details creates brittle tests.
92
+
93
+ ## Anti-Patterns to Avoid
94
+
95
+ - **Test interdependence**: Tests that must run in a specific order.
96
+ Fix: Each test sets up and tears down its own state.
97
+ - **Testing implementation**: Asserting on internal method calls or private state.
98
+ Fix: Test the public interface and observable outcomes only.
99
+ - **Flaky tests**: Tests that sometimes pass and sometimes fail.
100
+ Fix: Eliminate time-dependence, randomness, and shared state.
101
+ - **Giant test files**: Hundreds of tests in a single file.
102
+ Fix: Group by behavior. One describe block per method or feature.
103
+ - **Commented-out tests**: Tests disabled instead of fixed or removed.
104
+ Fix: Fix or delete. Commented tests rot and mislead.
105
+
106
+ ## Adapting to the Project
107
+
108
+ Before writing tests:
109
+
110
+ 1. Identify the test framework in use (Jest, Vitest, Mocha, pytest, etc.)
111
+ 2. Find existing test utilities, factories, and fixtures
112
+ 3. Match the naming convention and file structure
113
+ 4. Check for CI/CD test configuration and coverage thresholds