## Critical Rules (Priority Order)Cross-tool compatible: Works across all 5 platforms - Claude Code, OpenCode, Codex CLI, Cursor, and Kiro.
-
Production project - Real users depend on this. Test thoroughly and verify all edge cases before committing. WHY: Breaking changes affect all plugin users immediately.
-
Plugin for OTHER projects - Optimize for plugin users, not internal dev convenience. WHY: Every decision MUST improve the experience for developers using this in their repos.
-
Use CHANGELOG.md for completion tracking - MUST use CHANGELOG.md for release notes. NEVER create
*_AUDIT.md,*_SUMMARY.md,*_COMPLETION.mdfiles. WHY: Summary files clutter repos and add no value. Report completion verbally. -
Unless it is a very small change of max few lines, or an urgent hotfix, MUST create PRs for all changes - No direct pushes to main. WHY: PRs enable reviews, CI checks, and rollback if needed. Direct pushes are risky.
-
PR reviews - Wait 3 min for auto-reviewers, address ALL comments (Copilot, Claude, Gemini, Codex). WHY: Skipping comments leads to merged issues. Every comment must be addressed or explained.
-
Read checklists BEFORE multi-file changes - MUST read the relevant checklist before starting:
- Cross-platform work →
checklists/cross-platform-compatibility.md(MASTER REF) - Release →
checklists/release.md - New command →
checklists/new-command.md - New agent →
checklists/new-agent.md - New skill →
checklists/new-skill.md - New lib module →
checklists/new-lib-module.md - OpenCode plugin update →
checklists/update-opencode-plugin.md - Repo intel changes →
checklists/repo-intel.mdWHY: Multi-file changes have hidden dependencies. Checklists prevent missed updates.
- Cross-platform work →
-
Especially Before release, and when delivering ANY work - Check the relevant checklist for completion requirements:
- Identify which checklist applies to your work (see rule #6)
- Go through EVERY item in that checklist and apply it (e.g. run commands, which files to bump versions in, etc)
- Run the
/enhancecommand on new or modified commands, agents, skills, hooks or prompts - Verify cross-platform compatibility (OpenCode + Codex)
- Update
bin/cli.jsmappings if new command/agent added - Only mark complete after ALL checklist items are done WHY: Checklists exist because we kept missing things. They are the definition of "done".
-
Use plain text markers - MUST use
[OK],[ERROR],[WARN],[CRITICAL]for status. NEVER use emojis or ASCII art boxes.- Save tokens - conciseness and clarity over decorations
- Use markdown formatting instead of decorative borders WHY: Emojis and ASCII art waste tokens. AI models parse plain text better.
-
gh/git on Windows - Escape
$as\$in GraphQL queries, avoid!=in jq (use== "A" or == "B").gh pr checksusesstatenotconclusion- returns UPPERCASE:SUCCESS,FAILURE,PENDING- Single quotes unreliable - use double quotes with escaped inner quotes WHY: Windows shell interprets $ and ! differently. These cause silent failures.
-
Always run git hooks - Run all pre-commit and pre-push hooks. If a hook blocks, fix the reported issue.
- Hooks catch problems before they reach the repo
- Fix the root cause, then retry WHY: Hooks are safety nets. Bypassing them defeats their purpose.
- Fix all test failures - NEVER skip or ignore a failing test because it's "out of scope" or "pre-existing". Always fix it.
- If a test fails during your work, fix it before proceeding
- No test is someone else's problem WHY: Skipping failures erodes test trust. Every green run must mean everything works.
- Report script failures before manual fallback - When any project script fails (npm test/run/build, scripts/*, agentsys-dev, node bin/dev-cli.js), you MUST:
- Report the failure with exact error output to the user
- Diagnose the root cause of the failure
- Fix the script/tooling issue, not work around it manually
- NEVER silently fall back to doing the work by hand WHY: Silent fallbacks mask broken tooling. A failed script needs fixing, not bypassing.
lib/ → Shared library (vendored to plugins)
plugins/ → 0 plugins, 10 agents (0 file-based + 10 role-based), 0 skills
adapters/ → Platform adapters (opencode-plugin/, opencode/, codex/)
checklists/ → Action checklists (9 files)
bin/cli.js → npm CLI installer
| Plugin | Agents | Skills | Purpose |
|---|
Pattern: Command → Agent → Skill (orchestration → invocation → implementation)
/next-task- Master workflow: task → implementation → PR → merge/ship- PR creation, CI monitoring, merge/enhance- Run all enhancement analyzers
/audit-project- Multi-agent code review/deslop- Clean AI slop patterns/drift-detect- Compare plan vs implementation/perf- Performance investigation/repo-intel- Unified static analysis - git history, AST symbols, project metadata
/sync-docs- Update documentation to match code
npx agentsys-dev status # Project health (version, counts, branch)
npx agentsys-dev validate # Run all validators
npx agentsys-dev validate plugins # Run single validator
npx agentsys-dev bump <version> # Bump all version files (e.g., 3.7.3)
npx agentsys-dev sync-lib # Sync lib/ to plugins/
npx agentsys-dev test # Run test suite
npx agentsys-dev preflight # Change-aware checklist enforcement
npx agentsys-dev preflight --all # Run all checks
npx agentsys-dev preflight --release # All checks + release extras
npx agentsys-dev gen-docs # Auto-generate doc sections
npx agentsys-dev gen-docs --check # Validate docs are fresh (CI)
npx agentsys-dev new plugin <name> # Scaffold new plugin
npx agentsys-dev new agent <name> --plugin=<plugin> # Scaffold new agent
npx agentsys-dev new skill <name> --plugin=<plugin> # Scaffold new skill
npx agentsys-dev new command <name> --plugin=<plugin> # Scaffold new command
npx agentsys-dev --help # Show all commands
# Or invoke directly:
node bin/dev-cli.js <command>
# npm aliases still work:
npm test # Run tests (do before commits)
npm run validate # All validators via dev-cli
npm run preflight # Change-aware preflight checks
npm run preflight:all # All preflight checks
npm run preflight:release # Release preflight
npm run gen-docs # Auto-generate documentation
npm run gen-docs:check # Check if docs are stale
npm run new:plugin # Scaffold new plugin
npm run new:agent # Scaffold new agent
npm run new:skill # Scaffold new skill
npm run new:command # Scaffold new command
npm run bump <version> # Bump versions via dev-cli
npm pack # Build package
agentsys # Run installer35 agents across 15 plugins. Key agents by model:
| Model | Agents | Use Case |
|---|---|---|
| opus | exploration, planning, implementation, perf-orchestrator, debate-orchestrator, skillers-recommender | Complex reasoning, analysis |
| sonnet | task-discoverer, delivery-validator, ci-fixer, deslop-agent, reporters, learn, release-agent, skillers-compactor | Validation, pattern matching |
| haiku | worktree-manager, ci-monitor, simple-fixer | Mechanical execution |
See README.md and docs/reference/AGENTS.md for full agent list.
## Skills32 skills across plugins. Agents invoke skills for reusable implementation.
| Category | Key Skills |
|---|---|
| Workflow | orchestrate-review, discover-tasks, validate-delivery |
| Enhancement | enhance-* (9 skills for plugins, agents, docs, prompts, hooks) |
| Performance | baseline, benchmark, profile, theory-tester |
| Cleanup | deslop, sync-docs, drift-analysis, repo-intel |
See README.md for full skill list.
## State Files| File | Location | Purpose |
|---|---|---|
tasks.json |
{stateDir}/ |
Active task registry |
flow.json |
{stateDir}/ (worktree) |
Workflow progress |
preference.json |
{stateDir}/sources/ |
Cached task source |
suppressions.json |
~/.<claude|opencode|codex>/enhance/ |
Auto-learned suppressions |
Platform-aware state directory:
- Claude Code:
.claude/ - OpenCode:
config/.opencode/ - Codex:
.codex/ - Cursor:
.cursor/ - Kiro:
.kiro/
Cannot skip in /next-task:
exploration-agent→ before planningplanning-agent→ before implementation- Phase 9 review loop → MUST use orchestrate-review skill
delivery-validator→ before sync-docs:sync-docs-agentsync-docs:sync-docs-agent→ before /ship
4 reviewers: Copilot, Claude, Gemini, Codex
- Wait 3 min after PR creation (initial auto-reviews)
- Claude-review may take 10+ min - wait for it
- Read ALL comments
- Address EVERY comment
- Iterate until zero unresolved
| Model | When to Use |
|---|---|
| Opus | Complex reasoning, analysis where imperfection compounds |
| Sonnet | Validation, pattern matching, most agents |
| Haiku | Mechanical execution, no judgment needed |
- User DX (plugin users)
- Worry-free automation
- Token efficiency
- Quality output
- Simplicity