@mesrai/cli 0.4.21
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.
- package/README.md +670 -0
- package/dist/agents/agent.interface.d.ts +41 -0
- package/dist/agents/agent.interface.d.ts.map +1 -0
- package/dist/agents/agent.interface.js +2 -0
- package/dist/agents/agent.interface.js.map +1 -0
- package/dist/agents/claude-code.agent.d.ts +14 -0
- package/dist/agents/claude-code.agent.d.ts.map +1 -0
- package/dist/agents/claude-code.agent.js +90 -0
- package/dist/agents/claude-code.agent.js.map +1 -0
- package/dist/agents/codex.agent.d.ts +14 -0
- package/dist/agents/codex.agent.d.ts.map +1 -0
- package/dist/agents/codex.agent.js +77 -0
- package/dist/agents/codex.agent.js.map +1 -0
- package/dist/agents/cursor.agent.d.ts +29 -0
- package/dist/agents/cursor.agent.d.ts.map +1 -0
- package/dist/agents/cursor.agent.js +85 -0
- package/dist/agents/cursor.agent.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +60 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth/index.d.ts +3 -0
- package/dist/commands/auth/index.d.ts.map +1 -0
- package/dist/commands/auth/index.js +37 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/auth/login.d.ts +11 -0
- package/dist/commands/auth/login.d.ts.map +1 -0
- package/dist/commands/auth/login.js +158 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.d.ts +2 -0
- package/dist/commands/auth/logout.d.ts.map +1 -0
- package/dist/commands/auth/logout.js +26 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/auth/status.d.ts +2 -0
- package/dist/commands/auth/status.d.ts.map +1 -0
- package/dist/commands/auth/status.js +82 -0
- package/dist/commands/auth/status.js.map +1 -0
- package/dist/commands/auth/team-key.d.ts +5 -0
- package/dist/commands/auth/team-key.d.ts.map +1 -0
- package/dist/commands/auth/team-key.js +112 -0
- package/dist/commands/auth/team-key.js.map +1 -0
- package/dist/commands/auth/token.d.ts +2 -0
- package/dist/commands/auth/token.d.ts.map +1 -0
- package/dist/commands/auth/token.js +33 -0
- package/dist/commands/auth/token.js.map +1 -0
- package/dist/commands/config.d.ts +5 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +26 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/diff.d.ts +3 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +23 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/hook/index.d.ts +3 -0
- package/dist/commands/hook/index.d.ts.map +1 -0
- package/dist/commands/hook/index.js +24 -0
- package/dist/commands/hook/index.js.map +1 -0
- package/dist/commands/hook/install.d.ts +11 -0
- package/dist/commands/hook/install.d.ts.map +1 -0
- package/dist/commands/hook/install.js +149 -0
- package/dist/commands/hook/install.js.map +1 -0
- package/dist/commands/hook/status.d.ts +2 -0
- package/dist/commands/hook/status.d.ts.map +1 -0
- package/dist/commands/hook/status.js +36 -0
- package/dist/commands/hook/status.js.map +1 -0
- package/dist/commands/hook/uninstall.d.ts +5 -0
- package/dist/commands/hook/uninstall.d.ts.map +1 -0
- package/dist/commands/hook/uninstall.js +66 -0
- package/dist/commands/hook/uninstall.js.map +1 -0
- package/dist/commands/memory/capture.d.ts +8 -0
- package/dist/commands/memory/capture.d.ts.map +1 -0
- package/dist/commands/memory/capture.js +124 -0
- package/dist/commands/memory/capture.js.map +1 -0
- package/dist/commands/memory/disable.d.ts +5 -0
- package/dist/commands/memory/disable.d.ts.map +1 -0
- package/dist/commands/memory/disable.js +67 -0
- package/dist/commands/memory/disable.js.map +1 -0
- package/dist/commands/memory/enable.d.ts +7 -0
- package/dist/commands/memory/enable.d.ts.map +1 -0
- package/dist/commands/memory/enable.js +74 -0
- package/dist/commands/memory/enable.js.map +1 -0
- package/dist/commands/memory/hooks.d.ts +31 -0
- package/dist/commands/memory/hooks.d.ts.map +1 -0
- package/dist/commands/memory/hooks.js +283 -0
- package/dist/commands/memory/hooks.js.map +1 -0
- package/dist/commands/memory/index.d.ts +3 -0
- package/dist/commands/memory/index.d.ts.map +1 -0
- package/dist/commands/memory/index.js +36 -0
- package/dist/commands/memory/index.js.map +1 -0
- package/dist/commands/memory/session-hooks/claude-code.d.ts +2 -0
- package/dist/commands/memory/session-hooks/claude-code.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks/claude-code.js +24 -0
- package/dist/commands/memory/session-hooks/claude-code.js.map +1 -0
- package/dist/commands/memory/session-hooks/codex.d.ts +2 -0
- package/dist/commands/memory/session-hooks/codex.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks/codex.js +16 -0
- package/dist/commands/memory/session-hooks/codex.js.map +1 -0
- package/dist/commands/memory/session-hooks/cursor.d.ts +2 -0
- package/dist/commands/memory/session-hooks/cursor.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks/cursor.js +20 -0
- package/dist/commands/memory/session-hooks/cursor.js.map +1 -0
- package/dist/commands/memory/session-hooks/index.d.ts +3 -0
- package/dist/commands/memory/session-hooks/index.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks/index.js +21 -0
- package/dist/commands/memory/session-hooks/index.js.map +1 -0
- package/dist/commands/memory/session-hooks/shared.d.ts +7 -0
- package/dist/commands/memory/session-hooks/shared.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks/shared.js +52 -0
- package/dist/commands/memory/session-hooks/shared.js.map +1 -0
- package/dist/commands/memory/session-hooks-install-codex.d.ts +19 -0
- package/dist/commands/memory/session-hooks-install-codex.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks-install-codex.js +91 -0
- package/dist/commands/memory/session-hooks-install-codex.js.map +1 -0
- package/dist/commands/memory/session-hooks-install-cursor.d.ts +9 -0
- package/dist/commands/memory/session-hooks-install-cursor.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks-install-cursor.js +119 -0
- package/dist/commands/memory/session-hooks-install-cursor.js.map +1 -0
- package/dist/commands/memory/session-hooks-install.d.ts +9 -0
- package/dist/commands/memory/session-hooks-install.d.ts.map +1 -0
- package/dist/commands/memory/session-hooks-install.js +173 -0
- package/dist/commands/memory/session-hooks-install.js.map +1 -0
- package/dist/commands/pr.d.ts +2 -0
- package/dist/commands/pr.d.ts.map +1 -0
- package/dist/commands/pr.js +2 -0
- package/dist/commands/pr.js.map +1 -0
- package/dist/commands/review.d.ts +2 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +2 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/rules.d.ts +31 -0
- package/dist/commands/rules.d.ts.map +1 -0
- package/dist/commands/rules.js +159 -0
- package/dist/commands/rules.js.map +1 -0
- package/dist/commands/schema.d.ts +3 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +62 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/skills.d.ts +3 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +85 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +99 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/subscribe.d.ts +4 -0
- package/dist/commands/subscribe.d.ts.map +1 -0
- package/dist/commands/subscribe.js +25 -0
- package/dist/commands/subscribe.js.map +1 -0
- package/dist/commands/update.d.ts +10 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +112 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +6 -0
- package/dist/constants.js.map +1 -0
- package/dist/features/centralized-config/actions.d.ts +20 -0
- package/dist/features/centralized-config/actions.d.ts.map +1 -0
- package/dist/features/centralized-config/actions.js +114 -0
- package/dist/features/centralized-config/actions.js.map +1 -0
- package/dist/features/centralized-config/command.d.ts +4 -0
- package/dist/features/centralized-config/command.d.ts.map +1 -0
- package/dist/features/centralized-config/command.js +43 -0
- package/dist/features/centralized-config/command.js.map +1 -0
- package/dist/features/pr/command.d.ts +4 -0
- package/dist/features/pr/command.d.ts.map +1 -0
- package/dist/features/pr/command.js +222 -0
- package/dist/features/pr/command.js.map +1 -0
- package/dist/features/repo-config/actions.d.ts +33 -0
- package/dist/features/repo-config/actions.d.ts.map +1 -0
- package/dist/features/repo-config/actions.js +271 -0
- package/dist/features/repo-config/actions.js.map +1 -0
- package/dist/features/repo-config/command.d.ts +15 -0
- package/dist/features/repo-config/command.d.ts.map +1 -0
- package/dist/features/repo-config/command.js +135 -0
- package/dist/features/repo-config/command.js.map +1 -0
- package/dist/features/review/command.d.ts +4 -0
- package/dist/features/review/command.d.ts.map +1 -0
- package/dist/features/review/command.js +404 -0
- package/dist/features/review/command.js.map +1 -0
- package/dist/features/review/diff.d.ts +23 -0
- package/dist/features/review/diff.d.ts.map +1 -0
- package/dist/features/review/diff.js +47 -0
- package/dist/features/review/diff.js.map +1 -0
- package/dist/features/review/errors.d.ts +3 -0
- package/dist/features/review/errors.d.ts.map +1 -0
- package/dist/features/review/errors.js +26 -0
- package/dist/features/review/errors.js.map +1 -0
- package/dist/features/review/hunk-context.d.ts +25 -0
- package/dist/features/review/hunk-context.d.ts.map +1 -0
- package/dist/features/review/hunk-context.js +158 -0
- package/dist/features/review/hunk-context.js.map +1 -0
- package/dist/features/review/hunk-viewer.d.ts +25 -0
- package/dist/features/review/hunk-viewer.d.ts.map +1 -0
- package/dist/features/review/hunk-viewer.js +59 -0
- package/dist/features/review/hunk-viewer.js.map +1 -0
- package/dist/features/review/no-changes.d.ts +6 -0
- package/dist/features/review/no-changes.d.ts.map +1 -0
- package/dist/features/review/no-changes.js +31 -0
- package/dist/features/review/no-changes.js.map +1 -0
- package/dist/features/review/options.d.ts +7 -0
- package/dist/features/review/options.d.ts.map +1 -0
- package/dist/features/review/options.js +18 -0
- package/dist/features/review/options.js.map +1 -0
- package/dist/features/review/result.d.ts +40 -0
- package/dist/features/review/result.d.ts.map +1 -0
- package/dist/features/review/result.js +95 -0
- package/dist/features/review/result.js.map +1 -0
- package/dist/formatters/json.d.ts +7 -0
- package/dist/formatters/json.d.ts.map +1 -0
- package/dist/formatters/json.js +7 -0
- package/dist/formatters/json.js.map +1 -0
- package/dist/formatters/markdown.d.ts +7 -0
- package/dist/formatters/markdown.d.ts.map +1 -0
- package/dist/formatters/markdown.js +93 -0
- package/dist/formatters/markdown.js.map +1 -0
- package/dist/formatters/prompt.d.ts +12 -0
- package/dist/formatters/prompt.d.ts.map +1 -0
- package/dist/formatters/prompt.js +90 -0
- package/dist/formatters/prompt.js.map +1 -0
- package/dist/formatters/repo-config.d.ts +7 -0
- package/dist/formatters/repo-config.d.ts.map +1 -0
- package/dist/formatters/repo-config.js +99 -0
- package/dist/formatters/repo-config.js.map +1 -0
- package/dist/formatters/terminal.d.ts +7 -0
- package/dist/formatters/terminal.d.ts.map +1 -0
- package/dist/formatters/terminal.js +130 -0
- package/dist/formatters/terminal.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/services/api/api-core.d.ts +27 -0
- package/dist/services/api/api-core.d.ts.map +1 -0
- package/dist/services/api/api-core.js +451 -0
- package/dist/services/api/api-core.js.map +1 -0
- package/dist/services/api/api.interface.d.ts +101 -0
- package/dist/services/api/api.interface.d.ts.map +1 -0
- package/dist/services/api/api.interface.js +2 -0
- package/dist/services/api/api.interface.js.map +1 -0
- package/dist/services/api/api.real.d.ts +19 -0
- package/dist/services/api/api.real.d.ts.map +1 -0
- package/dist/services/api/api.real.js +20 -0
- package/dist/services/api/api.real.js.map +1 -0
- package/dist/services/api/auth.api.d.ts +17 -0
- package/dist/services/api/auth.api.d.ts.map +1 -0
- package/dist/services/api/auth.api.js +73 -0
- package/dist/services/api/auth.api.js.map +1 -0
- package/dist/services/api/cli-auth.api.d.ts +29 -0
- package/dist/services/api/cli-auth.api.d.ts.map +1 -0
- package/dist/services/api/cli-auth.api.js +23 -0
- package/dist/services/api/cli-auth.api.js.map +1 -0
- package/dist/services/api/config.api.d.ts +34 -0
- package/dist/services/api/config.api.d.ts.map +1 -0
- package/dist/services/api/config.api.js +108 -0
- package/dist/services/api/config.api.js.map +1 -0
- package/dist/services/api/index.d.ts +4 -0
- package/dist/services/api/index.d.ts.map +1 -0
- package/dist/services/api/index.js +3 -0
- package/dist/services/api/index.js.map +1 -0
- package/dist/services/api/memory.api.d.ts +10 -0
- package/dist/services/api/memory.api.d.ts.map +1 -0
- package/dist/services/api/memory.api.js +19 -0
- package/dist/services/api/memory.api.js.map +1 -0
- package/dist/services/api/review.api.d.ts +27 -0
- package/dist/services/api/review.api.d.ts.map +1 -0
- package/dist/services/api/review.api.js +140 -0
- package/dist/services/api/review.api.js.map +1 -0
- package/dist/services/api/rules.api.d.ts +13 -0
- package/dist/services/api/rules.api.d.ts.map +1 -0
- package/dist/services/api/rules.api.js +41 -0
- package/dist/services/api/rules.api.js.map +1 -0
- package/dist/services/api/sessions.api.d.ts +6 -0
- package/dist/services/api/sessions.api.d.ts.map +1 -0
- package/dist/services/api/sessions.api.js +129 -0
- package/dist/services/api/sessions.api.js.map +1 -0
- package/dist/services/api/trial.api.d.ts +10 -0
- package/dist/services/api/trial.api.d.ts.map +1 -0
- package/dist/services/api/trial.api.js +11 -0
- package/dist/services/api/trial.api.js.map +1 -0
- package/dist/services/auth.service.d.ts +29 -0
- package/dist/services/auth.service.d.ts.map +1 -0
- package/dist/services/auth.service.js +190 -0
- package/dist/services/auth.service.js.map +1 -0
- package/dist/services/browser-login.service.d.ts +23 -0
- package/dist/services/browser-login.service.d.ts.map +1 -0
- package/dist/services/browser-login.service.js +187 -0
- package/dist/services/browser-login.service.js.map +1 -0
- package/dist/services/centralized-config.service.d.ts +24 -0
- package/dist/services/centralized-config.service.d.ts.map +1 -0
- package/dist/services/centralized-config.service.js +112 -0
- package/dist/services/centralized-config.service.js.map +1 -0
- package/dist/services/context.service.d.ts +25 -0
- package/dist/services/context.service.d.ts.map +1 -0
- package/dist/services/context.service.js +134 -0
- package/dist/services/context.service.js.map +1 -0
- package/dist/services/device-login.service.d.ts +23 -0
- package/dist/services/device-login.service.d.ts.map +1 -0
- package/dist/services/device-login.service.js +70 -0
- package/dist/services/device-login.service.js.map +1 -0
- package/dist/services/fix.service.d.ts +31 -0
- package/dist/services/fix.service.d.ts.map +1 -0
- package/dist/services/fix.service.js +121 -0
- package/dist/services/fix.service.js.map +1 -0
- package/dist/services/git-hooks.service.d.ts +20 -0
- package/dist/services/git-hooks.service.d.ts.map +1 -0
- package/dist/services/git-hooks.service.js +126 -0
- package/dist/services/git-hooks.service.js.map +1 -0
- package/dist/services/git.service.d.ts +44 -0
- package/dist/services/git.service.d.ts.map +1 -0
- package/dist/services/git.service.js +321 -0
- package/dist/services/git.service.js.map +1 -0
- package/dist/services/hook-logger.service.d.ts +18 -0
- package/dist/services/hook-logger.service.d.ts.map +1 -0
- package/dist/services/hook-logger.service.js +48 -0
- package/dist/services/hook-logger.service.js.map +1 -0
- package/dist/services/lifecycle-events.d.ts +49 -0
- package/dist/services/lifecycle-events.d.ts.map +1 -0
- package/dist/services/lifecycle-events.js +86 -0
- package/dist/services/lifecycle-events.js.map +1 -0
- package/dist/services/lifecycle-git-context.d.ts +15 -0
- package/dist/services/lifecycle-git-context.d.ts.map +1 -0
- package/dist/services/lifecycle-git-context.js +23 -0
- package/dist/services/lifecycle-git-context.js.map +1 -0
- package/dist/services/lifecycle-local-turn-state.d.ts +14 -0
- package/dist/services/lifecycle-local-turn-state.d.ts.map +1 -0
- package/dist/services/lifecycle-local-turn-state.js +18 -0
- package/dist/services/lifecycle-local-turn-state.js.map +1 -0
- package/dist/services/lifecycle-transcript.d.ts +25 -0
- package/dist/services/lifecycle-transcript.d.ts.map +1 -0
- package/dist/services/lifecycle-transcript.js +29 -0
- package/dist/services/lifecycle-transcript.js.map +1 -0
- package/dist/services/lifecycle-turn-data.d.ts +11 -0
- package/dist/services/lifecycle-turn-data.d.ts.map +1 -0
- package/dist/services/lifecycle-turn-data.js +23 -0
- package/dist/services/lifecycle-turn-data.js.map +1 -0
- package/dist/services/lifecycle.service.d.ts +14 -0
- package/dist/services/lifecycle.service.d.ts.map +1 -0
- package/dist/services/lifecycle.service.js +276 -0
- package/dist/services/lifecycle.service.js.map +1 -0
- package/dist/services/repo-config.service.d.ts +22 -0
- package/dist/services/repo-config.service.d.ts.map +1 -0
- package/dist/services/repo-config.service.js +81 -0
- package/dist/services/repo-config.service.js.map +1 -0
- package/dist/services/repo-settings-wizard.service.d.ts +19 -0
- package/dist/services/repo-settings-wizard.service.d.ts.map +1 -0
- package/dist/services/repo-settings-wizard.service.js +260 -0
- package/dist/services/repo-settings-wizard.service.js.map +1 -0
- package/dist/services/repo-settings.service.d.ts +30 -0
- package/dist/services/repo-settings.service.d.ts.map +1 -0
- package/dist/services/repo-settings.service.js +99 -0
- package/dist/services/repo-settings.service.js.map +1 -0
- package/dist/services/review-auth-fallback.d.ts +7 -0
- package/dist/services/review-auth-fallback.d.ts.map +1 -0
- package/dist/services/review-auth-fallback.js +25 -0
- package/dist/services/review-auth-fallback.js.map +1 -0
- package/dist/services/review-config-builder.d.ts +19 -0
- package/dist/services/review-config-builder.d.ts.map +1 -0
- package/dist/services/review-config-builder.js +29 -0
- package/dist/services/review-config-builder.js.map +1 -0
- package/dist/services/review-file-filter.d.ts +3 -0
- package/dist/services/review-file-filter.d.ts.map +1 -0
- package/dist/services/review-file-filter.js +35 -0
- package/dist/services/review-file-filter.js.map +1 -0
- package/dist/services/review-normalizer.d.ts +6 -0
- package/dist/services/review-normalizer.d.ts.map +1 -0
- package/dist/services/review-normalizer.js +62 -0
- package/dist/services/review-normalizer.js.map +1 -0
- package/dist/services/review-verbose.d.ts +28 -0
- package/dist/services/review-verbose.d.ts.map +1 -0
- package/dist/services/review-verbose.js +52 -0
- package/dist/services/review-verbose.js.map +1 -0
- package/dist/services/review.service.d.ts +38 -0
- package/dist/services/review.service.d.ts.map +1 -0
- package/dist/services/review.service.js +152 -0
- package/dist/services/review.service.js.map +1 -0
- package/dist/services/rules.service.d.ts +16 -0
- package/dist/services/rules.service.d.ts.map +1 -0
- package/dist/services/rules.service.js +98 -0
- package/dist/services/rules.service.js.map +1 -0
- package/dist/services/session-local.service.d.ts +25 -0
- package/dist/services/session-local.service.d.ts.map +1 -0
- package/dist/services/session-local.service.js +79 -0
- package/dist/services/session-local.service.js.map +1 -0
- package/dist/services/transcript-parser.service.d.ts +10 -0
- package/dist/services/transcript-parser.service.d.ts.map +1 -0
- package/dist/services/transcript-parser.service.js +127 -0
- package/dist/services/transcript-parser.service.js.map +1 -0
- package/dist/services/transcript.service.d.ts +33 -0
- package/dist/services/transcript.service.d.ts.map +1 -0
- package/dist/services/transcript.service.js +264 -0
- package/dist/services/transcript.service.js.map +1 -0
- package/dist/types/auth.d.ts +18 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +2 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/cli.d.ts +41 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +2 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/types/command-output.d.ts +29 -0
- package/dist/types/command-output.d.ts.map +1 -0
- package/dist/types/command-output.js +2 -0
- package/dist/types/command-output.js.map +1 -0
- package/dist/types/config.d.ts +68 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/errors.d.ts +8 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +15 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/memory.d.ts +39 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/memory.js +2 -0
- package/dist/types/memory.js.map +1 -0
- package/dist/types/repo-config.d.ts +24 -0
- package/dist/types/repo-config.d.ts.map +1 -0
- package/dist/types/repo-config.js +2 -0
- package/dist/types/repo-config.js.map +1 -0
- package/dist/types/review.d.ts +112 -0
- package/dist/types/review.d.ts.map +1 -0
- package/dist/types/review.js +2 -0
- package/dist/types/review.js.map +1 -0
- package/dist/types/rules.d.ts +42 -0
- package/dist/types/rules.d.ts.map +1 -0
- package/dist/types/rules.js +7 -0
- package/dist/types/rules.js.map +1 -0
- package/dist/types/session-events.d.ts +48 -0
- package/dist/types/session-events.d.ts.map +1 -0
- package/dist/types/session-events.js +2 -0
- package/dist/types/session-events.js.map +1 -0
- package/dist/types/session.d.ts +150 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +9 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/trial.d.ts +10 -0
- package/dist/types/trial.d.ts.map +1 -0
- package/dist/types/trial.js +2 -0
- package/dist/types/trial.js.map +1 -0
- package/dist/ui/interactive-formatters.d.ts +6 -0
- package/dist/ui/interactive-formatters.d.ts.map +1 -0
- package/dist/ui/interactive-formatters.js +61 -0
- package/dist/ui/interactive-formatters.js.map +1 -0
- package/dist/ui/interactive-helpers.d.ts +20 -0
- package/dist/ui/interactive-helpers.d.ts.map +1 -0
- package/dist/ui/interactive-helpers.js +82 -0
- package/dist/ui/interactive-helpers.js.map +1 -0
- package/dist/ui/interactive-renderers.d.ts +6 -0
- package/dist/ui/interactive-renderers.d.ts.map +1 -0
- package/dist/ui/interactive-renderers.js +82 -0
- package/dist/ui/interactive-renderers.js.map +1 -0
- package/dist/ui/interactive.d.ts +25 -0
- package/dist/ui/interactive.d.ts.map +1 -0
- package/dist/ui/interactive.js +228 -0
- package/dist/ui/interactive.js.map +1 -0
- package/dist/utils/auth-mode.d.ts +7 -0
- package/dist/utils/auth-mode.d.ts.map +1 -0
- package/dist/utils/auth-mode.js +42 -0
- package/dist/utils/auth-mode.js.map +1 -0
- package/dist/utils/banner.d.ts +2 -0
- package/dist/utils/banner.d.ts.map +1 -0
- package/dist/utils/banner.js +180 -0
- package/dist/utils/banner.js.map +1 -0
- package/dist/utils/cli-exit.d.ts +13 -0
- package/dist/utils/cli-exit.d.ts.map +1 -0
- package/dist/utils/cli-exit.js +29 -0
- package/dist/utils/cli-exit.js.map +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +11 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/command-context.d.ts +12 -0
- package/dist/utils/command-context.d.ts.map +1 -0
- package/dist/utils/command-context.js +15 -0
- package/dist/utils/command-context.js.map +1 -0
- package/dist/utils/command-errors.d.ts +12 -0
- package/dist/utils/command-errors.d.ts.map +1 -0
- package/dist/utils/command-errors.js +112 -0
- package/dist/utils/command-errors.js.map +1 -0
- package/dist/utils/command-output.d.ts +5 -0
- package/dist/utils/command-output.d.ts.map +1 -0
- package/dist/utils/command-output.js +46 -0
- package/dist/utils/command-output.js.map +1 -0
- package/dist/utils/command-schema.d.ts +29 -0
- package/dist/utils/command-schema.d.ts.map +1 -0
- package/dist/utils/command-schema.js +74 -0
- package/dist/utils/command-schema.js.map +1 -0
- package/dist/utils/commander-errors.d.ts +8 -0
- package/dist/utils/commander-errors.d.ts.map +1 -0
- package/dist/utils/commander-errors.js +79 -0
- package/dist/utils/commander-errors.js.map +1 -0
- package/dist/utils/commander-setup.d.ts +3 -0
- package/dist/utils/commander-setup.d.ts.map +1 -0
- package/dist/utils/commander-setup.js +10 -0
- package/dist/utils/commander-setup.js.map +1 -0
- package/dist/utils/config.d.ts +13 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +71 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/credentials.d.ts +6 -0
- package/dist/utils/credentials.d.ts.map +1 -0
- package/dist/utils/credentials.js +64 -0
- package/dist/utils/credentials.js.map +1 -0
- package/dist/utils/device.d.ts +7 -0
- package/dist/utils/device.d.ts.map +1 -0
- package/dist/utils/device.js +133 -0
- package/dist/utils/device.js.map +1 -0
- package/dist/utils/field-mask.d.ts +2 -0
- package/dist/utils/field-mask.d.ts.map +1 -0
- package/dist/utils/field-mask.js +93 -0
- package/dist/utils/field-mask.js.map +1 -0
- package/dist/utils/git-diff.d.ts +5 -0
- package/dist/utils/git-diff.d.ts.map +1 -0
- package/dist/utils/git-diff.js +14 -0
- package/dist/utils/git-diff.js.map +1 -0
- package/dist/utils/git-file-reader.d.ts +22 -0
- package/dist/utils/git-file-reader.d.ts.map +1 -0
- package/dist/utils/git-file-reader.js +45 -0
- package/dist/utils/git-file-reader.js.map +1 -0
- package/dist/utils/git-file-selection.d.ts +14 -0
- package/dist/utils/git-file-selection.d.ts.map +1 -0
- package/dist/utils/git-file-selection.js +20 -0
- package/dist/utils/git-file-selection.js.map +1 -0
- package/dist/utils/git-file-targets.d.ts +4 -0
- package/dist/utils/git-file-targets.d.ts.map +1 -0
- package/dist/utils/git-file-targets.js +11 -0
- package/dist/utils/git-file-targets.js.map +1 -0
- package/dist/utils/git-remote.d.ts +7 -0
- package/dist/utils/git-remote.d.ts.map +1 -0
- package/dist/utils/git-remote.js +94 -0
- package/dist/utils/git-remote.js.map +1 -0
- package/dist/utils/git-status.d.ts +7 -0
- package/dist/utils/git-status.d.ts.map +1 -0
- package/dist/utils/git-status.js +36 -0
- package/dist/utils/git-status.js.map +1 -0
- package/dist/utils/hunk.d.ts +15 -0
- package/dist/utils/hunk.d.ts.map +1 -0
- package/dist/utils/hunk.js +44 -0
- package/dist/utils/hunk.js.map +1 -0
- package/dist/utils/input-validation.d.ts +11 -0
- package/dist/utils/input-validation.d.ts.map +1 -0
- package/dist/utils/input-validation.js +73 -0
- package/dist/utils/input-validation.js.map +1 -0
- package/dist/utils/install-instructions.d.ts +6 -0
- package/dist/utils/install-instructions.d.ts.map +1 -0
- package/dist/utils/install-instructions.js +18 -0
- package/dist/utils/install-instructions.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +48 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/rate-limit.d.ts +5 -0
- package/dist/utils/rate-limit.d.ts.map +1 -0
- package/dist/utils/rate-limit.js +56 -0
- package/dist/utils/rate-limit.js.map +1 -0
- package/dist/utils/recent-activity.d.ts +9 -0
- package/dist/utils/recent-activity.d.ts.map +1 -0
- package/dist/utils/recent-activity.js +139 -0
- package/dist/utils/recent-activity.js.map +1 -0
- package/dist/utils/repo-settings-dashboard.d.ts +6 -0
- package/dist/utils/repo-settings-dashboard.d.ts.map +1 -0
- package/dist/utils/repo-settings-dashboard.js +36 -0
- package/dist/utils/repo-settings-dashboard.js.map +1 -0
- package/dist/utils/repo-settings-patterns.d.ts +7 -0
- package/dist/utils/repo-settings-patterns.d.ts.map +1 -0
- package/dist/utils/repo-settings-patterns.js +66 -0
- package/dist/utils/repo-settings-patterns.js.map +1 -0
- package/dist/utils/repo-settings-schema.d.ts +6 -0
- package/dist/utils/repo-settings-schema.d.ts.map +1 -0
- package/dist/utils/repo-settings-schema.js +70 -0
- package/dist/utils/repo-settings-schema.js.map +1 -0
- package/dist/utils/review-output.d.ts +4 -0
- package/dist/utils/review-output.d.ts.map +1 -0
- package/dist/utils/review-output.js +18 -0
- package/dist/utils/review-output.js.map +1 -0
- package/dist/utils/skills-sync-manifest.d.ts +5 -0
- package/dist/utils/skills-sync-manifest.d.ts.map +1 -0
- package/dist/utils/skills-sync-manifest.js +39 -0
- package/dist/utils/skills-sync-manifest.js.map +1 -0
- package/dist/utils/skills-sync-paths.d.ts +5 -0
- package/dist/utils/skills-sync-paths.d.ts.map +1 -0
- package/dist/utils/skills-sync-paths.js +60 -0
- package/dist/utils/skills-sync-paths.js.map +1 -0
- package/dist/utils/skills-sync-targets.d.ts +3 -0
- package/dist/utils/skills-sync-targets.d.ts.map +1 -0
- package/dist/utils/skills-sync-targets.js +218 -0
- package/dist/utils/skills-sync-targets.js.map +1 -0
- package/dist/utils/skills-sync.d.ts +39 -0
- package/dist/utils/skills-sync.d.ts.map +1 -0
- package/dist/utils/skills-sync.js +200 -0
- package/dist/utils/skills-sync.js.map +1 -0
- package/dist/utils/skills.d.ts +13 -0
- package/dist/utils/skills.d.ts.map +1 -0
- package/dist/utils/skills.js +117 -0
- package/dist/utils/skills.js.map +1 -0
- package/dist/utils/stream-input.d.ts +13 -0
- package/dist/utils/stream-input.d.ts.map +1 -0
- package/dist/utils/stream-input.js +36 -0
- package/dist/utils/stream-input.js.map +1 -0
- package/dist/utils/team-key-auth.d.ts +5 -0
- package/dist/utils/team-key-auth.d.ts.map +1 -0
- package/dist/utils/team-key-auth.js +14 -0
- package/dist/utils/team-key-auth.js.map +1 -0
- package/dist/utils/update-check.d.ts +2 -0
- package/dist/utils/update-check.d.ts.map +1 -0
- package/dist/utils/update-check.js +30 -0
- package/dist/utils/update-check.js.map +1 -0
- package/package.json +90 -0
- package/skills/README.md +64 -0
- package/skills/hunk-review/SKILL.md +154 -0
- package/skills/mesrai-business-rules-validation/SKILL.md +65 -0
- package/skills/mesrai-centralized-config/SKILL.md +102 -0
- package/skills/mesrai-mesrai-rules/SKILL.md +103 -0
- package/skills/mesrai-mesrai-rules/instructions/create-mesrai-rule.md +56 -0
- package/skills/mesrai-mesrai-rules/instructions/update-mesrai-rule.md +63 -0
- package/skills/mesrai-mesrai-rules/instructions/view-mesrai-rules.md +65 -0
- package/skills/mesrai-mesrai-rules/rules/create-mesrai-rule.md +48 -0
- package/skills/mesrai-mesrai-rules/rules/update-mesrai-rule.md +55 -0
- package/skills/mesrai-mesrai-rules/rules/view-mesrai-rules.md +56 -0
- package/skills/mesrai-pr-suggestions-resolver/SKILL.md +61 -0
- package/skills/mesrai-review/SKILL.md +53 -0
- package/skills/mesrai-review-dev/SKILL.md +55 -0
- package/skills/mesrai-review-dev/scripts/run-local-cli.sh +49 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hunk-review
|
|
3
|
+
description: Interacts with live Hunk diff review sessions via CLI. Inspects review focus, navigates files and hunks, reloads session contents, and adds inline review comments. Use when the user has a Hunk session running or wants to review diffs interactively.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hunk Review
|
|
7
|
+
|
|
8
|
+
Hunk is an interactive terminal diff viewer. The TUI is for the user -- do NOT run `hunk diff`, `hunk show`, or other interactive commands directly. Use `hunk session *` CLI commands to inspect and control live sessions through the local daemon.
|
|
9
|
+
|
|
10
|
+
If no session exists, ask the user to launch Hunk in their terminal first.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
1. hunk session list # find live sessions
|
|
16
|
+
2. hunk session get --repo . # inspect path / repo / source
|
|
17
|
+
3. hunk session review --repo . --json # inspect file/hunk structure first
|
|
18
|
+
4. hunk session review --repo . --include-patch --json # opt into raw diff text only when needed
|
|
19
|
+
5. hunk session context --repo . # check current focus when needed
|
|
20
|
+
6. hunk session navigate ... # move to the right place
|
|
21
|
+
7. hunk session reload -- <command> # swap contents if needed
|
|
22
|
+
8. hunk session comment add ... # leave one review note
|
|
23
|
+
9. hunk session comment apply ... # apply many agent notes in one stdin batch
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Session selection
|
|
27
|
+
|
|
28
|
+
Most session commands accept:
|
|
29
|
+
|
|
30
|
+
- `--repo <path>` -- match the live session by its current loaded repo root (most common)
|
|
31
|
+
- `<session-id>` -- match by exact ID (use when multiple sessions share a repo)
|
|
32
|
+
- If only one session exists, it auto-resolves
|
|
33
|
+
|
|
34
|
+
`reload` also supports:
|
|
35
|
+
|
|
36
|
+
- `--session-path <path>` -- match the live Hunk window by its current working directory
|
|
37
|
+
- `--source <path>` -- load the replacement `diff` / `show` command from a different directory
|
|
38
|
+
|
|
39
|
+
Use `--source` only for advanced reloads where the live session you want to control is not already associated with the checkout you want to load next. For a normal worktree session, prefer selecting it directly with `--repo /path/to/worktree`.
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
### Inspect
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
hunk session list [--json]
|
|
47
|
+
hunk session get (--repo . | <id>) [--json]
|
|
48
|
+
hunk session context (--repo . | <id>) [--json]
|
|
49
|
+
hunk session review (--repo . | <id>) [--json] [--include-patch]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- `get` shows the session `Path`, `Repo`, and `Source`, which helps when choosing between `--repo` and `--session-path`
|
|
53
|
+
- `Repo` is what `--repo` matches; `Path` is what `--session-path` matches
|
|
54
|
+
- `review --json` returns file and hunk structure by default; add `--include-patch` only when a caller truly needs raw unified diff text
|
|
55
|
+
|
|
56
|
+
### Navigate
|
|
57
|
+
|
|
58
|
+
Absolute navigation requires `--file` and exactly one of `--hunk`, `--new-line`, or `--old-line`:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
hunk session navigate --repo . --file src/App.tsx --hunk 2
|
|
62
|
+
hunk session navigate --repo . --file src/App.tsx --new-line 372
|
|
63
|
+
hunk session navigate --repo . --file src/App.tsx --old-line 355
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Relative comment navigation jumps between annotated hunks and does not require `--file`:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
hunk session navigate --repo . --next-comment
|
|
70
|
+
hunk session navigate --repo . --prev-comment
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- `--hunk <n>` is 1-based
|
|
74
|
+
- `--new-line` / `--old-line` are 1-based line numbers on that diff side
|
|
75
|
+
- Use either `--next-comment` or `--prev-comment`, not both
|
|
76
|
+
|
|
77
|
+
### Reload
|
|
78
|
+
|
|
79
|
+
Swaps the live session's contents. Pass a Hunk review command after `--`:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
hunk session reload --repo . -- diff
|
|
83
|
+
hunk session reload --repo . -- diff main...feature -- src/ui
|
|
84
|
+
hunk session reload --repo . -- show HEAD~1
|
|
85
|
+
hunk session reload --repo . -- show HEAD~1 -- README.md
|
|
86
|
+
hunk session reload --repo /path/to/worktree -- diff
|
|
87
|
+
hunk session reload --session-path /path/to/live-window --source /path/to/other-checkout -- diff
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- Always include `--` before the nested Hunk command
|
|
91
|
+
- `--repo` or `<session-id>` usually selects the session you want
|
|
92
|
+
- `--source` is advanced: it does not select the session; it only changes where the replacement review command runs
|
|
93
|
+
- If the live session is already showing the target worktree, prefer `hunk session reload --repo /path/to/worktree -- diff`
|
|
94
|
+
- `--session-path` targets the live window when you need to keep session selection separate from reload source
|
|
95
|
+
|
|
96
|
+
### Comments
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
hunk session comment add --repo . --file README.md --new-line 103 --summary "Tighten this wording" [--rationale "..."] [--author "agent"] [--focus]
|
|
100
|
+
printf '%s\n' '{"comments":[{"filePath":"README.md","newLine":103,"summary":"Tighten this wording"}]}' | hunk session comment apply --repo . --stdin [--focus]
|
|
101
|
+
hunk session comment list --repo . [--file README.md]
|
|
102
|
+
hunk session comment rm --repo . <comment-id>
|
|
103
|
+
hunk session comment clear --repo . --yes [--file README.md]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- `comment add` is best for one note; `comment apply` is best when an agent already has several notes ready
|
|
107
|
+
- `comment add` requires `--file`, `--summary`, and exactly one of `--old-line` or `--new-line`
|
|
108
|
+
- `comment apply` payload items require `filePath`, `summary`, and exactly one target such as `hunk`, `hunkNumber`, `oldLine`, or `newLine`
|
|
109
|
+
- `comment apply` reads a JSON batch from stdin and validates the full batch before mutating the live session
|
|
110
|
+
- Pass `--focus` when you want to jump to the new note or the first note in a batch
|
|
111
|
+
- `comment list` and `comment clear` accept optional `--file`
|
|
112
|
+
- Quote `--summary` and `--rationale` defensively in the shell
|
|
113
|
+
|
|
114
|
+
## New files in working-tree reviews
|
|
115
|
+
|
|
116
|
+
`hunk diff` includes untracked files by default. If the user wants tracked changes only, reload with `--exclude-untracked`:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
hunk session reload --repo . -- diff --exclude-untracked
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Guiding a review
|
|
123
|
+
|
|
124
|
+
The user may ask you to walk them through a changeset or review code using Hunk. Start with `hunk session review --json` to understand the file/hunk structure without inflating agent context, then use `--include-patch` only for the files you truly need to read in raw diff form. Use `context` and `navigate` to line up the user's current view before adding comments.
|
|
125
|
+
|
|
126
|
+
Your role is to narrate: steer the user's view to what matters and leave comments that explain what they're looking at.
|
|
127
|
+
|
|
128
|
+
Typical flow:
|
|
129
|
+
|
|
130
|
+
1. Load the right content (`reload` if needed)
|
|
131
|
+
2. Navigate to the first interesting file / hunk
|
|
132
|
+
3. Add a comment explaining what's happening and why
|
|
133
|
+
4. If you already have several notes ready, prefer one `comment apply` batch over many separate shell invocations
|
|
134
|
+
5. Summarize when done
|
|
135
|
+
|
|
136
|
+
Guidelines:
|
|
137
|
+
|
|
138
|
+
- Work in the order that tells the clearest story, not necessarily file order
|
|
139
|
+
- Navigate before commenting so the user sees the code you're discussing
|
|
140
|
+
- Use `comment apply` for agent-generated batches and `comment add` for one-off notes
|
|
141
|
+
- Use `--focus` sparingly when the note itself should actively steer the review
|
|
142
|
+
- Keep comments focused: intent, structure, risks, or follow-ups
|
|
143
|
+
- Don't comment on every hunk -- highlight what the user wouldn't spot themselves
|
|
144
|
+
|
|
145
|
+
## Common errors
|
|
146
|
+
|
|
147
|
+
- **"No visible diff file matches ..."** -- the file is not in the loaded review. Check `context`, then `reload` if needed.
|
|
148
|
+
- **"No active Hunk sessions"** -- ask the user to open Hunk in their terminal.
|
|
149
|
+
- **"Multiple active sessions match"** -- pass `<session-id>` explicitly.
|
|
150
|
+
- **"No active Hunk session matches session path ..."** -- for advanced split-path reloads, verify the live window `Path` via `hunk session get` or `list`, then use `--session-path`.
|
|
151
|
+
- **"Pass the replacement Hunk command after `--`"** -- include `--` before the nested `diff` / `show` command.
|
|
152
|
+
- **"Pass --stdin to read batch comments from stdin JSON."** -- `comment apply` only reads its batch payload from stdin.
|
|
153
|
+
- **"Specify exactly one navigation target"** -- pick one of `--hunk`, `--old-line`, or `--new-line`.
|
|
154
|
+
- **"Specify either --next-comment or --prev-comment, not both."** -- choose one comment-navigation direction.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mesrai-business-rules-validation
|
|
3
|
+
description: Use when the user wants Mesrai to validate local diff changes against task requirements, acceptance criteria, or business rules via `mesrai pr business-validation`, especially for implementation-vs-task or merge readiness checks.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Mesrai CLI auth plus Mesrai task-management integration (Jira/Linear/Notion/ClickUp) for useful task context retrieval.
|
|
6
|
+
metadata:
|
|
7
|
+
author: Mesrai
|
|
8
|
+
version: '1.0'
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Mesrai Business Rules Validation
|
|
12
|
+
|
|
13
|
+
## Goal
|
|
14
|
+
|
|
15
|
+
Run Mesrai business-rules validation from the current repository diff only.
|
|
16
|
+
|
|
17
|
+
## Required Inputs
|
|
18
|
+
|
|
19
|
+
- One local diff scope:
|
|
20
|
+
- default working tree diff
|
|
21
|
+
- or `--staged`
|
|
22
|
+
- or `--branch <name>`
|
|
23
|
+
- or `--commit <sha>`
|
|
24
|
+
- or `[files...]`
|
|
25
|
+
- Optional task reference:
|
|
26
|
+
- `--task-url <url>` or `--task-id <id>`
|
|
27
|
+
- Do not pass both.
|
|
28
|
+
|
|
29
|
+
## When to Use
|
|
30
|
+
|
|
31
|
+
- The user asks for business-validation, business validation, business rules validation, or acceptance-criteria validation
|
|
32
|
+
- The user wants to check local implementation vs task requirements
|
|
33
|
+
- The user mentions local business validation or `mesrai pr business-validation`
|
|
34
|
+
|
|
35
|
+
Do not use this skill as a substitute for `mesrai review`. Local review and business-rules validation are different flows.
|
|
36
|
+
|
|
37
|
+
## Workflow
|
|
38
|
+
|
|
39
|
+
1. Choose the local scope.
|
|
40
|
+
|
|
41
|
+
- Default working tree diff when no scope flag is provided.
|
|
42
|
+
- Use only one of `--staged`, `--branch`, `--commit`, or `[files...]`.
|
|
43
|
+
|
|
44
|
+
2. Build and run the command.
|
|
45
|
+
|
|
46
|
+
Examples:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
mesrai pr business-validation
|
|
50
|
+
mesrai pr business-validation --staged --task-id KC-1441
|
|
51
|
+
mesrai pr business-validation --branch main --task-id KC-1441
|
|
52
|
+
mesrai pr business-validation --commit HEAD~1 --task-id KC-1441
|
|
53
|
+
mesrai pr business-validation src/service.ts src/use-case.ts --task-id KC-1441
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
3. Interpret the result.
|
|
57
|
+
|
|
58
|
+
- `Mode: local diff` means validation over the provided local diff scope.
|
|
59
|
+
- If output says missing MCP/task context, report that directly and request integration/context setup.
|
|
60
|
+
|
|
61
|
+
## Notes
|
|
62
|
+
|
|
63
|
+
- `mesrai review` does not trigger this flow.
|
|
64
|
+
- Prefer `--task-id` or `--task-url` when the task is not obvious from local context.
|
|
65
|
+
- `KC-1441`-style keys are valid.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mesrai-centralized-config
|
|
3
|
+
description: Use when the user wants to manage centralized configuration via `mesrai config centralized` commands (status, init, sync, disable, and download).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mesrai Centralized Config
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Centralized configuration allows teams to manage their Mesrai configuration files in a single repository, providing a single source of truth for their settings. This skill enables users to manage their centralized configuration through Mesrai CLI commands, including initializing centralized config, syncing configuration, disabling centralized config, and downloading generated config files.
|
|
11
|
+
|
|
12
|
+
The configuration files are generated based on the user's current settings, and users have the option to review these changes in a pull request before they are merged into the repository. This approach ensures that teams can maintain control over their configuration while benefiting from the convenience of centralized management.
|
|
13
|
+
|
|
14
|
+
If the setting is enabled, then any pull request merged to the selected repository will trigger a sync to update the configuration in Mesrai. This allows teams to easily manage and update their configuration as needed, without having to manually apply changes in Mesrai.
|
|
15
|
+
|
|
16
|
+
At any time the user can run a manual sync command to pull the latest configuration from the repository, however this is not recommended.
|
|
17
|
+
|
|
18
|
+
## Goal
|
|
19
|
+
|
|
20
|
+
Manage centralized configuration through Mesrai CLI commands only.
|
|
21
|
+
|
|
22
|
+
Use this skill when the request involves enabling centralized config, selecting the source repository, syncing configuration, disabling centralized config, or downloading generated config files.
|
|
23
|
+
|
|
24
|
+
## Trigger Hints
|
|
25
|
+
|
|
26
|
+
- Mentions of centralized config, centralized configuration, config sync source repo, or source repository for rules.
|
|
27
|
+
- Requests to run: `mesrai config centralized status|init|sync|disable|download`.
|
|
28
|
+
- Requests to enable or disable centralized config from terminal.
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
Unless specifically stated, YOU must run the Mesrai CLI commands on behalf of the user. Do not provide instructions to run commands without also running them yourself.
|
|
33
|
+
|
|
34
|
+
1. Confirm team-key authentication is available.
|
|
35
|
+
|
|
36
|
+
- Centralized config commands require team-key auth.
|
|
37
|
+
- If missing, instruct the user to run:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mesrai auth team-key --key <your-key>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
2. Check current centralized status first when context is unclear.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
mesrai config centralized status
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
3. Initialize centralized config when requested.
|
|
50
|
+
|
|
51
|
+
- Preferred command shape:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
mesrai config centralized init [owner/repo] --sync-option <pr|manual>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
ALWAYS run the command `mesrai config remote list` first to get the list of repositories the user has access to and their current selection. You must provide the repo in the shape `owner/repo` for example `organization/repository-name`. If you cannot find the repository in the list, then tell the user about it.
|
|
58
|
+
|
|
59
|
+
- Defaults and behavior:
|
|
60
|
+
- `--sync-option` defaults to `pr`. Defines the behaviour of the initial sync after enabling centralized config.
|
|
61
|
+
- `pr` creates a pull request with their current config. A link to the PR is provided in the command output. Merging the PR triggers a sync to update the configuration in Mesrai.
|
|
62
|
+
- `manual` simply enables centralized config without creating a PR, the user will need to create a PR themselves with their desired config or run a manual sync after pushing changes to the repository.
|
|
63
|
+
- If repository is omitted in an interactive terminal, CLI prompts repository selection.
|
|
64
|
+
- In non-interactive mode, repository must be provided explicitly.
|
|
65
|
+
|
|
66
|
+
Prefer providing the repository in the command to avoid interactive prompts, especially in non-interactive contexts. If the repository is not provided and the terminal is interactive, the CLI will prompt the user to select a repository from their accessible repositories. If the terminal is non-interactive and the repository is not provided, the command will fail with an error indicating that the repository is required.
|
|
67
|
+
|
|
68
|
+
4. Sync centralized config on demand.
|
|
69
|
+
|
|
70
|
+
A sync will pull the latest configuration from the repository and override the user's current configuration defined in the Mesrai database with the config from the repository. Syncs happen automatically when a PR is merged regardless of the initial sync option selected, but users can also choose to run a manual sync at any time to pull the latest changes from the repository.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
mesrai config centralized sync
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Avoid running sync automatically after init to give users control over when to pull changes, especially if they want to review or customize the generated config before applying it.
|
|
77
|
+
|
|
78
|
+
Running sync will override the user's current configuration with the config from the repository, so it's best to let users decide when to do this, be sure to warn them of this when they ask to run sync and recommend downloading the config first as a backup before syncing.
|
|
79
|
+
|
|
80
|
+
5. Disable centralized config when requested.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
mesrai config centralized disable
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
6. Download centralized config zip artifact.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
mesrai config centralized download --out <path/to/centralized-config.zip>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- `--out` is required.
|
|
93
|
+
|
|
94
|
+
## Output Guidance
|
|
95
|
+
|
|
96
|
+
- Prefer using `--json` to receive structured output.
|
|
97
|
+
- When providing output to the user, summarize the key information and next steps rather than dumping raw command output.
|
|
98
|
+
|
|
99
|
+
## Safety Notes
|
|
100
|
+
|
|
101
|
+
- Do not suggest manually editing backend parameters for centralized config when CLI commands exist.
|
|
102
|
+
- If repository selection fails, verify the repository is already selected in Mesrai (`mesrai config remote list`).
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mesrai-mesrai-rules
|
|
3
|
+
description: Use when the user wants to create, update or view Mesrai Rules via `mesrai rules` command.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mesrai Mesrai Rules
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Mesrai Rules are a set of guidelines that Mesrai follows when generating code. They help ensure that the generated code is consistent, high-quality, and aligned with the user's preferences and project requirements.
|
|
11
|
+
|
|
12
|
+
## Goal
|
|
13
|
+
|
|
14
|
+
Manage Mesrai Rules through Mesrai CLI only. Do not suggest creating rule files manually.
|
|
15
|
+
|
|
16
|
+
ALWAYS Use `mesrai rules` subcommands for all create, update, and view operations. All these rules are ALWAYS managed by the `mesrai rules` command from the CLI. Do NOT suggest creating files or storing rules in any other way. When the user wants to create, update or view Mesrai Rules, utilize the `mesrai rules` command with the appropriate subcommands and options as outlined in the instructions files.
|
|
17
|
+
|
|
18
|
+
## Centralized Config Convention
|
|
19
|
+
|
|
20
|
+
When centralized config is enabled for the selected team/repository scope, `mesrai rules create` and `mesrai rules update` may return centralized PR metadata instead of directly created/updated rule records.
|
|
21
|
+
|
|
22
|
+
- Treat this as success, not failure.
|
|
23
|
+
- Prioritize reporting `prUrl` (and `prNumber` when available).
|
|
24
|
+
- Explain that the change is pending until the centralized PR is merged and synced.
|
|
25
|
+
- Do not claim a rule was directly persisted when the result is centralized PR mode.
|
|
26
|
+
- When output includes both direct results and centralized PR metadata, prefer communicating the centralized PR outcome.
|
|
27
|
+
|
|
28
|
+
## Shared Workflow
|
|
29
|
+
|
|
30
|
+
1. Confirm the requested action:
|
|
31
|
+
|
|
32
|
+
- `create`: add a new rule.
|
|
33
|
+
- `update`: modify an existing rule.
|
|
34
|
+
- `view`: list all rules or fetch a specific rule.
|
|
35
|
+
|
|
36
|
+
2. Resolve repository scope:
|
|
37
|
+
|
|
38
|
+
- Use `global` when the user does not provide a repository scope. Always confirm if the user intends to use `global` scope when no repository is specified.
|
|
39
|
+
- For repository-specific requests with unknown id, run:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mesrai config remote list --json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then select and pass `--repo-id <id>`.
|
|
46
|
+
|
|
47
|
+
3. Validate rule fields before running commands:
|
|
48
|
+
|
|
49
|
+
- `title`: short and specific.
|
|
50
|
+
- `rule`: clear and actionable guidance.
|
|
51
|
+
- `severity`: `low | medium | high | critical`.
|
|
52
|
+
- `scope`: `file | pull request`.
|
|
53
|
+
- `path`: optional glob, default effectively `**/*`.
|
|
54
|
+
|
|
55
|
+
4. Execute the proper command and report results clearly.
|
|
56
|
+
|
|
57
|
+
## How to Use
|
|
58
|
+
|
|
59
|
+
Read individual instructions files for detailed explanations and examples:
|
|
60
|
+
|
|
61
|
+
- [instructions/create-mesrai-rule.md](instructions/create-mesrai-rule.md): Guidelines for creating new Mesrai Rules.
|
|
62
|
+
- [instructions/update-mesrai-rule.md](instructions/update-mesrai-rule.md): Guidelines for updating existing Mesrai Rules.
|
|
63
|
+
- [instructions/view-mesrai-rules.md](instructions/view-mesrai-rules.md): Guidelines for viewing and retrieving Mesrai Rules.
|
|
64
|
+
|
|
65
|
+
You MUST always load at least one of these instructions files to handle the specific user request related to Mesrai Rules. Each file contains detailed steps and examples for the corresponding action (create, update, view). Always ensure that you are following the instructions in these files when managing Mesrai Rules through the `mesrai rules` command.
|
|
66
|
+
|
|
67
|
+
Should the user request an action that is not covered by these instructions, you should first clarify the user's intent and then determine if it falls under create, update, or view operations. If it does, proceed to load the corresponding instructions file to ensure that you are following the correct workflow for managing Mesrai Rules through the `mesrai rules` command.
|
|
68
|
+
|
|
69
|
+
Should the user request a new action related to Mesrai Rules that differs from the initial action, you should load the appropriate instructions file for that new action to ensure that you are following the correct workflow for managing Mesrai Rules through the `mesrai rules` command.
|
|
70
|
+
|
|
71
|
+
## Structure of a Mesrai Rule
|
|
72
|
+
|
|
73
|
+
A Mesrai Rule typically consists of the following components:
|
|
74
|
+
|
|
75
|
+
- **Repository ID**: The repository scope where the rule is stored and applied.
|
|
76
|
+
- Use `global` for shared rules that apply across all repositories.
|
|
77
|
+
- **Title**: A concise title that captures the essence of the rule.
|
|
78
|
+
- **Rule**: A detailed explanation of what the rule is and why it is important.
|
|
79
|
+
- **Severity**: A level indicating the importance of the rule (one of "low", "medium", "high" or "critical").
|
|
80
|
+
- **Low**: The rule is a suggestion and can be ignored without significant consequences.
|
|
81
|
+
- **Medium**: The rule should be followed, but violations are not critical. Default severity level.
|
|
82
|
+
- **High**: The rule is important and should be followed to avoid potential issues.
|
|
83
|
+
- **Critical**: The rule is essential and must be followed to prevent severe issues or failures.
|
|
84
|
+
- **Scope**: The level at which the rule applies (one of "pull request" or "file").
|
|
85
|
+
- **Pull Request**: The rule applies to the entire pull request and is evaluated based on the overall changes in the PR.
|
|
86
|
+
- **File**: The rule applies to individual files and is evaluated on a per-file basis. Default scope level.
|
|
87
|
+
- **Path**: An optional glob pattern indicating which files the rule applies to.
|
|
88
|
+
- For example, `src/**/*.js` would apply the rule to all JavaScript files in the `src` directory and its subdirectories.
|
|
89
|
+
- Default is all files, `**/*`.
|
|
90
|
+
|
|
91
|
+
## Example of a Mesrai Rule
|
|
92
|
+
|
|
93
|
+
**Title**: Use Async/Await for Asynchronous Operations
|
|
94
|
+
|
|
95
|
+
**Rule**: Ensure that all asynchronous operations in the codebase use async/await syntax for better readability and error handling. Avoid using raw Promises or callback functions for asynchronous code.
|
|
96
|
+
|
|
97
|
+
**Severity**: High
|
|
98
|
+
|
|
99
|
+
**Scope**: File
|
|
100
|
+
|
|
101
|
+
**Path**: `**/*.ts`
|
|
102
|
+
|
|
103
|
+
**Repository ID**: `global`
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-mesrai-rule
|
|
3
|
+
description: Mesrai Rule Creation Guidelines - Use when the user wants to create a new Mesrai Rule for Mesrai to follow when generating code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mesrai Rule Creation Guidelines
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
When creating a new Mesrai Rule, it's important to ensure that the rule is clear, actionable, and aligned with the overall goals of code generation. A well-defined Mesrai Rule helps Mesrai produce code that meets the user's expectations and project requirements.
|
|
11
|
+
|
|
12
|
+
## Workflow for Creating a Mesrai Rule
|
|
13
|
+
|
|
14
|
+
1. **Collect the user's intent**: Understand the specific coding practice, style, or requirement that the user wants to enforce with the new Mesrai Rule. Ask clarifying questions if necessary to ensure you have a clear understanding of the user's intent.
|
|
15
|
+
|
|
16
|
+
2. **Draft the Mesrai Rule**: Based on the user's intent, draft a Mesrai Rule that includes a clear description, title, and any relevant metadata such as severity and scope. Use the guidelines outlined in the "Guidelines for Creating a Mesrai Rule" section to ensure the rule is well-structured and effective.
|
|
17
|
+
|
|
18
|
+
3. **Review the Mesrai Rule with the user**: Present the drafted Mesrai Rule to the user for feedback. Discuss any potential edge cases, exceptions, or clarifications needed to ensure the rule is comprehensive and actionable.
|
|
19
|
+
|
|
20
|
+
4. **Refine the Mesrai Rule**: Based on the user's feedback, refine the Mesrai Rule to address any concerns or suggestions. Ensure that the final version of the rule is clear, specific, and aligned with the user's goals.
|
|
21
|
+
|
|
22
|
+
5. **Save and Implement the Mesrai Rule**: Once the Mesrai Rule is finalized and approved by the user, save it. Send the title, rule, and any optional fields such as severity, scope, and path.
|
|
23
|
+
|
|
24
|
+
Always include the repository id when creating a rule. Use `global` when the user does not provide one.
|
|
25
|
+
|
|
26
|
+
Use the following command to save the Mesrai Rule:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
mesrai rules create --title <title> --rule <rule-content> [--repo-id <repository-id>] [--severity <severity-level>] [--scope <scope-level>] [--path <glob-pattern>]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If `--repo-id` is omitted, the default repository id is `global`.
|
|
33
|
+
|
|
34
|
+
6. **Communicate the new Mesrai Rule**: Inform the user about the new Mesrai Rule and how it will be applied in future code generation.
|
|
35
|
+
|
|
36
|
+
## Centralized Config Behavior
|
|
37
|
+
|
|
38
|
+
When centralized config is enabled, creating a rule may return a centralized PR result instead of a directly persisted rule.
|
|
39
|
+
|
|
40
|
+
In this case:
|
|
41
|
+
|
|
42
|
+
1. Report the PR URL (and PR number if present).
|
|
43
|
+
2. State that the rule is pending and will be applied after PR merge and sync.
|
|
44
|
+
3. Do not present the rule as already created in the database.
|
|
45
|
+
|
|
46
|
+
## Guidelines for Creating a Mesrai Rule
|
|
47
|
+
|
|
48
|
+
1. **Identify the Purpose**: Clearly define what the Mesrai Rule is intended to achieve. Is it meant to enforce a coding style, ensure best practices, or address a specific use case?
|
|
49
|
+
|
|
50
|
+
2. **Be Specific**: The rule should be specific and unambiguous. Avoid vague language and ensure that the rule can be easily understood and applied by Mesrai.
|
|
51
|
+
|
|
52
|
+
3. **Consider Edge Cases**: Think about any edge cases or exceptions that might arise when applying the rule. Address these in the rule definition to ensure Mesrai can handle them appropriately.
|
|
53
|
+
|
|
54
|
+
4. **Align with Project Goals**: Ensure that the Mesrai Rule aligns with the overall goals and requirements of the project. The rule should contribute to producing code that is maintainable, efficient, and meets the user's needs.
|
|
55
|
+
|
|
56
|
+
5. **Review and Refine**: After drafting the Mesrai Rule, review it for clarity and completeness. Present it to the user for feedback and refine it as necessary to ensure it effectively guides Mesrai's code generation process.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: update-mesrai-rule
|
|
3
|
+
description: Mesrai Rule Update Guidelines - Use when the user wants to update an existing Mesrai Rule to modify its behavior, scope, or severity for Mesrai to follow when generating code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mesrai Rule Update Guidelines
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
When updating an existing Mesrai Rule, it's important to ensure that the changes are clear, justified, and aligned with the overall goals of code generation. Updating a Mesrai Rule can help refine its effectiveness and ensure that it continues to meet the user's expectations and project requirements.
|
|
11
|
+
|
|
12
|
+
## Workflow for Updating a Mesrai Rule
|
|
13
|
+
|
|
14
|
+
1. **Identify the Mesrai Rule to Update**: If the user did not specify which Mesrai Rule they want to update, ask for one of:
|
|
15
|
+
- `--uuid <uuid>`
|
|
16
|
+
|
|
17
|
+
Updates must use `--uuid`.
|
|
18
|
+
|
|
19
|
+
2. **Collect the user's intent for the update**: Understand the specific changes the user wants to make to the existing Mesrai Rule. Ask clarifying questions if necessary to ensure you have a clear understanding of the user's intent.
|
|
20
|
+
|
|
21
|
+
3. **Review the existing Mesrai Rule**: Retrieve the current definition of the Mesrai Rule that is being updated. This will help you understand the existing behavior and identify what changes need to be made.
|
|
22
|
+
|
|
23
|
+
4. **Draft the updated Mesrai Rule**: Based on the user's intent and the existing rule, draft an updated version of the Mesrai Rule that includes the desired changes. Use the guidelines outlined in the "Guidelines for Updating a Mesrai Rule" section to ensure the updated rule is well-structured and effective.
|
|
24
|
+
|
|
25
|
+
5. **Review the updated Mesrai Rule with the user**: Present the drafted updated Mesrai Rule to the user for feedback. Discuss any potential edge cases, exceptions, or clarifications needed to ensure the updated rule is comprehensive and actionable.
|
|
26
|
+
|
|
27
|
+
6. **Refine the updated Mesrai Rule**: Based on the user's feedback, refine the updated Mesrai Rule to address any concerns or suggestions. Ensure that the final version of the updated rule is clear, specific, and aligned with the user's goals.
|
|
28
|
+
|
|
29
|
+
7. **Save and Implement the updated Mesrai Rule**: Once the updated Mesrai Rule is finalized and approved by the user, save it. Send only the fields that were updated, along with the `uuid` to identify which rule to update.
|
|
30
|
+
|
|
31
|
+
Always include the repository id when updating a rule. Use `global` when the user does not provide one.
|
|
32
|
+
|
|
33
|
+
Use the following command to save the updated Mesrai Rule:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
mesrai rules update --uuid <uuid> [--repo-id <repository-id>] [--title <title>] [--rule <rule-content>] [--severity <severity-level>] [--scope <scope-level>] [--path <glob-pattern>]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If `--repo-id` is omitted, the default repository id is `global`.
|
|
40
|
+
|
|
41
|
+
8. **Communicate the updated Mesrai Rule**: Inform the user about the updated Mesrai Rule and how the changes will affect future code generation.
|
|
42
|
+
|
|
43
|
+
## Centralized Config Behavior
|
|
44
|
+
|
|
45
|
+
When centralized config is enabled, updating a rule may return a centralized PR result instead of an immediate in-database update.
|
|
46
|
+
|
|
47
|
+
In this case:
|
|
48
|
+
|
|
49
|
+
1. Report the PR URL (and PR number if present).
|
|
50
|
+
2. State that the update is pending and will be applied after PR merge and sync.
|
|
51
|
+
3. Do not claim the rule content was already updated in the database.
|
|
52
|
+
|
|
53
|
+
## Guidelines for Updating a Mesrai Rule
|
|
54
|
+
|
|
55
|
+
1. **Identify the Changes**: Clearly define what changes are being made to the existing Mesrai Rule. Are you modifying the rule's behavior, scope, severity, or other attributes?
|
|
56
|
+
|
|
57
|
+
2. **Justify the Changes**: Ensure that there is a clear justification for the changes being made to the Mesrai Rule. The updates should contribute to producing code that is more maintainable, efficient, or better aligned with the user's needs.
|
|
58
|
+
|
|
59
|
+
3. **Consider Edge Cases**: Think about any edge cases or exceptions that might arise from the updated rule. Address these in the updated rule definition to ensure Mesrai can handle them appropriately.
|
|
60
|
+
|
|
61
|
+
4. **Align with Project Goals**: Ensure that the updated Mesrai Rule continues to align with the overall goals and requirements of the project. The updated rule should contribute to producing code that meets the user's expectations and project requirements.
|
|
62
|
+
|
|
63
|
+
5. **Review and Refine**: After drafting the updated Mesrai Rule, review it for clarity and completeness. Present it to the user for feedback and refine it as necessary to ensure it effectively guides Mesrai's code generation process.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: view-mesrai-rules
|
|
3
|
+
description: Mesrai Rule Viewing Guidelines - Use when the user wants to view existing Mesrai Rules that Mesrai follows when generating code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mesrai Rule Viewing Guidelines
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
When viewing existing Mesrai Rules, it's important to understand the details of each rule, including its UUID, title, rule content, severity, scope, and any applicable file patterns. This information helps you understand how Mesrai generates code and what guidelines it follows.
|
|
11
|
+
|
|
12
|
+
## Workflow for Viewing Mesrai Rules
|
|
13
|
+
|
|
14
|
+
1. **Retrieve Rule Target**: If the user specified a particular rule(s) to view, identify it using one of:
|
|
15
|
+
- `--title <title>`
|
|
16
|
+
- `--uuid <uuid>`
|
|
17
|
+
|
|
18
|
+
If both are provided, prefer `--uuid`. If no specific rule is requested, prepare to display all existing Mesrai Rules.
|
|
19
|
+
|
|
20
|
+
2. **Fetch Mesrai Rules**: Use the appropriate command to fetch the Mesrai Rule(s) based on the identified target(s). If no specific rule was requested, fetch all existing Mesrai Rules.
|
|
21
|
+
|
|
22
|
+
Always include the repository id when fetching rules. Use `global` when the user does not provide one.
|
|
23
|
+
|
|
24
|
+
Use the following command to fetch Mesrai Rules:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
mesrai rules view [--repo-id <repository-id>] [--uuid <uuid>] [--title <title>]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If `--repo-id` is omitted, the default repository id is `global`.
|
|
31
|
+
|
|
32
|
+
3. **Display Mesrai Rules**: Present the retrieved Mesrai Rule(s) in a clear and organized manner. For each rule, display the following information:
|
|
33
|
+
- Rule UUID
|
|
34
|
+
- Repository ID
|
|
35
|
+
- Rule Title
|
|
36
|
+
- Rule
|
|
37
|
+
- Severity (if specified)
|
|
38
|
+
- Scope (if specified)
|
|
39
|
+
- Path (if specified)
|
|
40
|
+
|
|
41
|
+
Do not alter the content of the rules; display them as they are retrieved to ensure accuracy.
|
|
42
|
+
|
|
43
|
+
4. **Provide Context**: If the user is viewing a specific rule, provide additional context about how that rule is applied in code generation and any relevant examples or use cases.
|
|
44
|
+
|
|
45
|
+
5. **Answer Follow-up Questions**: Be prepared to answer any follow-up questions the user may have about the Mesrai Rules, such as how to create or update rules, or how specific rules affect code generation.
|
|
46
|
+
|
|
47
|
+
## Centralized Config Context
|
|
48
|
+
|
|
49
|
+
When centralized config is enabled, rules may have pending centralized changes.
|
|
50
|
+
|
|
51
|
+
When relevant, highlight:
|
|
52
|
+
|
|
53
|
+
- centralized path (`centralizedConfig.path`)
|
|
54
|
+
- centralized status (`pending_add`, `pending_edit`, `pending_delete`, `synced`)
|
|
55
|
+
- whether a previously returned PR URL indicates pending application until merge and sync
|
|
56
|
+
|
|
57
|
+
## Guidelines for Viewing Mesrai Rules
|
|
58
|
+
|
|
59
|
+
1. **Be Accurate**: When displaying Mesrai Rules, ensure that the information is accurate and reflects the current state of the rules as retrieved from the system.
|
|
60
|
+
|
|
61
|
+
2. **Be Clear**: Present the Mesrai Rules in a clear and organized manner, making it easy for the user to understand the details of each rule.
|
|
62
|
+
|
|
63
|
+
3. **Provide Context**: When appropriate, provide additional context about how specific Mesrai Rules are applied in code generation and how they affect the output.
|
|
64
|
+
|
|
65
|
+
4. **Be Responsive**: Be prepared to answer any follow-up questions the user may have about the Mesrai Rules, and provide helpful information to guide them in understanding and utilizing the rules effectively.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-mesrai-rule
|
|
3
|
+
description: Mesrai Rule Creation Guidelines - Use when the user wants to create a new Mesrai Rule for Mesrai to follow when generating code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mesrai Rule Creation Guidelines
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
When creating a new Mesrai Rule, it's important to ensure that the rule is clear, actionable, and aligned with the overall goals of code generation. A well-defined Mesrai Rule helps Mesrai produce code that meets the user's expectations and project requirements.
|
|
11
|
+
|
|
12
|
+
## Workflow for Creating a Mesrai Rule
|
|
13
|
+
|
|
14
|
+
1. **Collect the user's intent**: Understand the specific coding practice, style, or requirement that the user wants to enforce with the new Mesrai Rule. Ask clarifying questions if necessary to ensure you have a clear understanding of the user's intent.
|
|
15
|
+
|
|
16
|
+
2. **Draft the Mesrai Rule**: Based on the user's intent, draft a Mesrai Rule that includes a clear description, title, and any relevant metadata such as severity and scope. Use the guidelines outlined in the "Guidelines for Creating a Mesrai Rule" section to ensure the rule is well-structured and effective.
|
|
17
|
+
|
|
18
|
+
3. **Review the Mesrai Rule with the user**: Present the drafted Mesrai Rule to the user for feedback. Discuss any potential edge cases, exceptions, or clarifications needed to ensure the rule is comprehensive and actionable.
|
|
19
|
+
|
|
20
|
+
4. **Refine the Mesrai Rule**: Based on the user's feedback, refine the Mesrai Rule to address any concerns or suggestions. Ensure that the final version of the rule is clear, specific, and aligned with the user's goals.
|
|
21
|
+
|
|
22
|
+
5. **Save and Implement the Mesrai Rule**: Once the Mesrai Rule is finalized and approved by the user, save it. Send the title, rule, and any optional fields such as severity, scope, and path.
|
|
23
|
+
|
|
24
|
+
Use the following command to save the Mesrai Rule:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
mesrai rules create --title <title> --rule <rule-content> [--repo-id <repository-id>] [--severity <severity-level>] [--scope <scope-level>] [--path <glob-pattern>]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
6. **Communicate the new Mesrai Rule**: Inform the user about the new Mesrai Rule and how it will be applied in future code generation.
|
|
31
|
+
|
|
32
|
+
## Centralized Config Behavior
|
|
33
|
+
|
|
34
|
+
When centralized config is enabled, creating a rule may return centralized PR metadata instead of a direct rule record.
|
|
35
|
+
|
|
36
|
+
In this case, report PR details and clearly explain the rule will only apply after PR merge and sync.
|
|
37
|
+
|
|
38
|
+
## Guidelines for Creating a Mesrai Rule
|
|
39
|
+
|
|
40
|
+
1. **Identify the Purpose**: Clearly define what the Mesrai Rule is intended to achieve. Is it meant to enforce a coding style, ensure best practices, or address a specific use case?
|
|
41
|
+
|
|
42
|
+
2. **Be Specific**: The rule should be specific and unambiguous. Avoid vague language and ensure that the rule can be easily understood and applied by Mesrai.
|
|
43
|
+
|
|
44
|
+
3. **Consider Edge Cases**: Think about any edge cases or exceptions that might arise when applying the rule. Address these in the rule definition to ensure Mesrai can handle them appropriately.
|
|
45
|
+
|
|
46
|
+
4. **Align with Project Goals**: Ensure that the Mesrai Rule aligns with the overall goals and requirements of the project. The rule should contribute to producing code that is maintainable, efficient, and meets the user's needs.
|
|
47
|
+
|
|
48
|
+
5. **Review and Refine**: After drafting the Mesrai Rule, review it for clarity and completeness. Present it to the user for feedback and refine it as necessary to ensure it effectively guides Mesrai's code generation process.
|