@massa-ai/codex-plugin 1.6.0
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/.codex-plugin/plugin.json +30 -0
- package/README.md +96 -0
- package/agents/massa-ai-architecture-specialist.toml +64 -0
- package/agents/massa-ai-audit-specialist.toml +80 -0
- package/agents/massa-ai-builder.toml +66 -0
- package/agents/massa-ai-context-curator.toml +66 -0
- package/agents/massa-ai-documentation-agent.toml +64 -0
- package/agents/massa-ai-furps-analyst.toml +70 -0
- package/agents/massa-ai-investigator.toml +67 -0
- package/agents/massa-ai-mobile-specialist.toml +81 -0
- package/agents/massa-ai-navigator.toml +74 -0
- package/agents/massa-ai-plan-critic.toml +89 -0
- package/agents/massa-ai-planner.toml +64 -0
- package/agents/massa-ai-requirements-analyst.toml +63 -0
- package/agents/massa-ai-reviewer.toml +65 -0
- package/agents/massa-ai-test-engineer.toml +65 -0
- package/agents/massa-ai-verification-agent.toml +64 -0
- package/hooks/hooks.json +52 -0
- package/hooks/massa-ai-hook +298 -0
- package/install.sh +475 -0
- package/package.json +30 -0
- package/skills/agents/architecture-specialist/SKILL.md +69 -0
- package/skills/agents/audit-specialist/SKILL.md +85 -0
- package/skills/agents/builder/SKILL.md +71 -0
- package/skills/agents/context-curator/SKILL.md +71 -0
- package/skills/agents/documentation-agent/SKILL.md +69 -0
- package/skills/agents/furps-analyst/SKILL.md +74 -0
- package/skills/agents/investigator/SKILL.md +72 -0
- package/skills/agents/mobile-specialist/SKILL.md +86 -0
- package/skills/agents/navigator/SKILL.md +79 -0
- package/skills/agents/plan-critic/SKILL.md +93 -0
- package/skills/agents/planner/SKILL.md +69 -0
- package/skills/agents/requirements-analyst/SKILL.md +68 -0
- package/skills/agents/reviewer/SKILL.md +70 -0
- package/skills/agents/test-engineer/SKILL.md +70 -0
- package/skills/agents/verification-agent/SKILL.md +69 -0
- package/skills/def.md +17 -0
- package/skills/find.md +19 -0
- package/skills/graph.md +16 -0
- package/skills/index.md +19 -0
- package/skills/map.md +24 -0
- package/skills/massa-ai/SKILL.md +315 -0
- package/skills/massa-ai/personas/README.md +35 -0
- package/skills/massa-ai/personas/ai-native-nodejs-cli-architect.md +76 -0
- package/skills/massa-ai/personas/catalog.json +157 -0
- package/skills/massa-ai/personas/context-skill-harness-engineer-architect.md +74 -0
- package/skills/massa-ai/personas/product-manager.md +67 -0
- package/skills/massa-ai/personas/senior-mobile-engineer.md +74 -0
- package/skills/massa-ai/personas/senior-mobile-qa-automation-engineer.md +75 -0
- package/skills/massa-ai/references/adr-authoring.md +189 -0
- package/skills/massa-ai/references/agent-orchestration.md +221 -0
- package/skills/massa-ai/references/architecture-coupling-lens.md +239 -0
- package/skills/massa-ai/references/architecture-deepening-lens.md +136 -0
- package/skills/massa-ai/references/architecture-domain-lens.md +186 -0
- package/skills/massa-ai/references/architecture-lenses.md +108 -0
- package/skills/massa-ai/references/audit-report-io.md +459 -0
- package/skills/massa-ai/references/audit-scope.md +103 -0
- package/skills/massa-ai/references/code-annotation.md +111 -0
- package/skills/massa-ai/references/codebase-investigation.md +96 -0
- package/skills/massa-ai/references/context-firewall.md +62 -0
- package/skills/massa-ai/references/conversation-feedback.md +104 -0
- package/skills/massa-ai/references/debug-diagnosis-loop.md +140 -0
- package/skills/massa-ai/references/decision-engine.md +73 -0
- package/skills/massa-ai/references/evidence-gate.md +53 -0
- package/skills/massa-ai/references/furps/analyst-role.md +49 -0
- package/skills/massa-ai/references/furps/checklist.md +92 -0
- package/skills/massa-ai/references/furps/intake.md +104 -0
- package/skills/massa-ai/references/furps/report-contract.md +140 -0
- package/skills/massa-ai/references/hook-enforcement.md +137 -0
- package/skills/massa-ai/references/implementation-delivery.md +101 -0
- package/skills/massa-ai/references/installation.md +110 -0
- package/skills/massa-ai/references/lessons.md +119 -0
- package/skills/massa-ai/references/maestro/artifacts-reports.md +69 -0
- package/skills/massa-ai/references/maestro/cli-device.md +65 -0
- package/skills/massa-ai/references/maestro/cloud.md +67 -0
- package/skills/massa-ai/references/maestro/config-env-output.md +76 -0
- package/skills/massa-ai/references/maestro/fact-ledger.md +71 -0
- package/skills/massa-ai/references/maestro/js-scripting.md +70 -0
- package/skills/massa-ai/references/maestro/mcp.md +59 -0
- package/skills/massa-ai/references/maestro/patterns.md +96 -0
- package/skills/massa-ai/references/maestro/selectors.md +91 -0
- package/skills/massa-ai/references/maestro/workspace-execution.md +81 -0
- package/skills/massa-ai/references/maestro/yaml-commands.md +203 -0
- package/skills/massa-ai/references/maestro.md +47 -0
- package/skills/massa-ai/references/mcp-tools.md +296 -0
- package/skills/massa-ai/references/memory-policy.md +103 -0
- package/skills/massa-ai/references/mobile-context.md +113 -0
- package/skills/massa-ai/references/mobile-diagnosis.md +106 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ATTRIBUTION.md +5 -0
- package/skills/massa-ai/references/mobile-figma-matcher/android-compose.md +13 -0
- package/skills/massa-ai/references/mobile-figma-matcher/android-views.md +13 -0
- package/skills/massa-ai/references/mobile-figma-matcher/core.md +117 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ios-swiftui.md +12 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ios-uikit.md +12 -0
- package/skills/massa-ai/references/mobile-figma-matcher/kmp-compose-multiplatform.md +14 -0
- package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +77 -0
- package/skills/massa-ai/references/naming-standards.md +47 -0
- package/skills/massa-ai/references/pr-task-fix.md +80 -0
- package/skills/massa-ai/references/project-context.md +76 -0
- package/skills/massa-ai/references/rfc/ATTRIBUTION.md +5 -0
- package/skills/massa-ai/references/rfc/discovery-and-sizing.md +120 -0
- package/skills/massa-ai/references/rfc/document-contract.md +85 -0
- package/skills/massa-ai/references/rfc/quality-and-lifecycle.md +101 -0
- package/skills/massa-ai/references/root-cause-scripts.md +97 -0
- package/skills/massa-ai/references/spec-driven/artifact-store.md +98 -0
- package/skills/massa-ai/references/spec-driven/code-analysis.md +119 -0
- package/skills/massa-ai/references/spec-driven/coding-principles.md +80 -0
- package/skills/massa-ai/references/spec-driven/context-limits.md +64 -0
- package/skills/massa-ai/references/spec-driven/design.md +257 -0
- package/skills/massa-ai/references/spec-driven/discuss.md +182 -0
- package/skills/massa-ai/references/spec-driven/execute.md +471 -0
- package/skills/massa-ai/references/spec-driven/lessons.md +5 -0
- package/skills/massa-ai/references/spec-driven/memory.md +214 -0
- package/skills/massa-ai/references/spec-driven/specify.md +283 -0
- package/skills/massa-ai/references/spec-driven/sub-agents.md +151 -0
- package/skills/massa-ai/references/spec-driven/tasks.md +494 -0
- package/skills/massa-ai/references/spec-driven/validate.md +397 -0
- package/skills/massa-ai/references/subagent-design.md +132 -0
- package/skills/massa-ai/references/synapse-policy.md +160 -0
- package/skills/massa-ai/references/tdd/calibrated-examples.md +54 -0
- package/skills/massa-ai/references/tdd/discovery-and-sizing.md +83 -0
- package/skills/massa-ai/references/tdd/document-contract.md +136 -0
- package/skills/massa-ai/references/tdd/quality-and-lifecycle.md +83 -0
- package/skills/massa-ai/references/the-fool/cognitive-bias-inventory.md +103 -0
- package/skills/massa-ai/references/the-fool/dialectic-synthesis.md +170 -0
- package/skills/massa-ai/references/the-fool/evidence-audit.md +202 -0
- package/skills/massa-ai/references/the-fool/mode-selection-guide.md +113 -0
- package/skills/massa-ai/references/the-fool/pre-mortem-analysis.md +200 -0
- package/skills/massa-ai/references/the-fool/red-team-adversarial.md +206 -0
- package/skills/massa-ai/references/the-fool/socratic-questioning.md +153 -0
- package/skills/massa-ai/references/ticket/atlassian-fix.md +130 -0
- package/skills/massa-ai/references/ticket/intake-and-sources.md +65 -0
- package/skills/massa-ai/references/ticket/templates-and-quality.md +129 -0
- package/skills/massa-ai/references/verification-ladder.md +62 -0
- package/skills/massa-ai/scripts/lessons.py +590 -0
- package/skills/massa-ai/workflows/adr.md +33 -0
- package/skills/massa-ai/workflows/architecture/architecture-audit.md +125 -0
- package/skills/massa-ai/workflows/architecture/architecture-fix.md +110 -0
- package/skills/massa-ai/workflows/bugs/bugs-audit.md +113 -0
- package/skills/massa-ai/workflows/bugs/bugs-fix.md +97 -0
- package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +154 -0
- package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +99 -0
- package/skills/massa-ai/workflows/commit.md +61 -0
- package/skills/massa-ai/workflows/debug.md +86 -0
- package/skills/massa-ai/workflows/design.md +54 -0
- package/skills/massa-ai/workflows/exploration.md +119 -0
- package/skills/massa-ai/workflows/feature.md +52 -0
- package/skills/massa-ai/workflows/general.md +46 -0
- package/skills/massa-ai/workflows/implementation/implementation-audit.md +87 -0
- package/skills/massa-ai/workflows/implementation/implementation-fix.md +90 -0
- package/skills/massa-ai/workflows/long-session.md +44 -0
- package/skills/massa-ai/workflows/maestro/maestro-audit.md +56 -0
- package/skills/massa-ai/workflows/maestro/maestro-fix.md +74 -0
- package/skills/massa-ai/workflows/maestro/maestro.md +68 -0
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +68 -0
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +74 -0
- package/skills/massa-ai/workflows/onboarding.md +23 -0
- package/skills/massa-ai/workflows/refactor.md +47 -0
- package/skills/massa-ai/workflows/refinement/furps-refinement.md +81 -0
- package/skills/massa-ai/workflows/requirements/requirements-audit.md +114 -0
- package/skills/massa-ai/workflows/requirements/requirements-fix.md +93 -0
- package/skills/massa-ai/workflows/rfc.md +55 -0
- package/skills/massa-ai/workflows/security/security-audit.md +113 -0
- package/skills/massa-ai/workflows/security/security-fix.md +97 -0
- package/skills/massa-ai/workflows/spec-driven.md +217 -0
- package/skills/massa-ai/workflows/tdd.md +71 -0
- package/skills/massa-ai/workflows/tests/tests-audit.md +114 -0
- package/skills/massa-ai/workflows/tests/tests-fix.md +96 -0
- package/skills/massa-ai/workflows/the-fool.md +82 -0
- package/skills/massa-ai/workflows/ticket.md +42 -0
- package/skills/persona-router/SKILL.md +158 -0
- package/skills/status.md +15 -0
package/install.sh
ADDED
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# massa-ai Codex plugin installer
|
|
4
|
+
#
|
|
5
|
+
# Copies the plugin bundle (manifest, skills, hooks.json, binary symlink) into
|
|
6
|
+
# the user's or project's Codex config directory and merges the 6 massa-ai hook
|
|
7
|
+
# events into ~/.codex/hooks.json (or ./.codex/hooks.json) using an
|
|
8
|
+
# array-append merge that preserves existing user hooks.
|
|
9
|
+
#
|
|
10
|
+
# MCP registration is delegated to scripts/install-agents.sh, the single writer
|
|
11
|
+
# of host MCP config. This installer no longer ships a plugin-local .mcp.json.
|
|
12
|
+
#
|
|
13
|
+
# Complementary to the marketplace route, NOT a duplicate of it. Installing via
|
|
14
|
+
# `codex plugin add massa-ai@massa-ai` gives Codex the skills and the /plugins
|
|
15
|
+
# entry; it CANNOT give it hooks, because a Codex plugin manifest has no hooks
|
|
16
|
+
# key (none of the 203 manifests shipped by the bundled/curated/runtime
|
|
17
|
+
# marketplaces declares one). Hooks reach Codex only through ~/.codex/hooks.json,
|
|
18
|
+
# which this script writes. So there is no double-fire to guard against here —
|
|
19
|
+
# unlike apps/claude-plugin/install.sh, whose plugin does ship hooks/hooks.json.
|
|
20
|
+
#
|
|
21
|
+
# Idempotent: re-running is a no-op when owned entries already present.
|
|
22
|
+
# Uninstall removes only ownership-marked entries + the plugin directory.
|
|
23
|
+
#
|
|
24
|
+
# Usage:
|
|
25
|
+
# apps/codex-plugin/install.sh # install at user scope (~/.codex)
|
|
26
|
+
# apps/codex-plugin/install.sh --user # (same)
|
|
27
|
+
# apps/codex-plugin/install.sh --project # install at project scope (./.codex)
|
|
28
|
+
# apps/codex-plugin/install.sh --uninstall # remove owned entries + plugin dir
|
|
29
|
+
# apps/codex-plugin/install.sh -h|--help # show this help
|
|
30
|
+
|
|
31
|
+
set -euo pipefail
|
|
32
|
+
|
|
33
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
34
|
+
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
35
|
+
CLAUDE_PLUGIN_BIN="$REPO_ROOT/apps/claude-plugin/hooks/massa-ai-hook.ts"
|
|
36
|
+
|
|
37
|
+
SCOPE="user"
|
|
38
|
+
UNINSTALL=0
|
|
39
|
+
DRY_RUN=0
|
|
40
|
+
|
|
41
|
+
for arg in "$@"; do
|
|
42
|
+
case "$arg" in
|
|
43
|
+
--user) SCOPE="user" ;;
|
|
44
|
+
--project) SCOPE="project" ;;
|
|
45
|
+
--uninstall) UNINSTALL=1 ;;
|
|
46
|
+
--quiet) MASSA_AI_VERBOSE=0 ;;
|
|
47
|
+
--verbose) MASSA_AI_VERBOSE=1 ;;
|
|
48
|
+
--dry-run) DRY_RUN=1; MASSA_AI_VERBOSE=1 ;;
|
|
49
|
+
-h|--help)
|
|
50
|
+
sed -n '2,/^$/p' "$0" | sed 's/^# \{0,1\}//'
|
|
51
|
+
exit 0
|
|
52
|
+
;;
|
|
53
|
+
*) echo "Unknown flag: $arg" >&2; exit 2 ;;
|
|
54
|
+
esac
|
|
55
|
+
done
|
|
56
|
+
|
|
57
|
+
# Banner
|
|
58
|
+
source "$SCRIPT_DIR/../../scripts/banner.sh"
|
|
59
|
+
massa_ai_banner
|
|
60
|
+
|
|
61
|
+
# Resolve target base dir
|
|
62
|
+
if [[ "$SCOPE" == "project" ]]; then
|
|
63
|
+
CODEX_DIR="$(pwd)/.codex"
|
|
64
|
+
else
|
|
65
|
+
CODEX_DIR="$HOME/.codex"
|
|
66
|
+
fi
|
|
67
|
+
PLUGIN_DIR="$CODEX_DIR/plugins/massa-ai"
|
|
68
|
+
HOOKS_JSON="$CODEX_DIR/hooks.json"
|
|
69
|
+
AGENTS_DIR="$CODEX_DIR/agents"
|
|
70
|
+
|
|
71
|
+
# Array-append merge (F5 mitigation): for each of the 6 events, append the
|
|
72
|
+
# massa-ai hook entry to the event's array if no entry with
|
|
73
|
+
# _massaAiOwned: true already exists. Backup before first write. Uses node
|
|
74
|
+
# (preferred) or bun for safe JSON manipulation — bash cannot do JSON safely.
|
|
75
|
+
#
|
|
76
|
+
# Entry shape is Codex's matcher-group form — an outer object whose "hooks" is
|
|
77
|
+
# an ARRAY of { type, command }:
|
|
78
|
+
# { "hooks": [{ "type": "command", "command": "<bin> <sub>" }],
|
|
79
|
+
# "_massaAiOwned": true }
|
|
80
|
+
# Codex addresses hook state as "<file>:<event>:<group>:<hook>", so a flat entry
|
|
81
|
+
# (type/command at the top level, no inner array) has no ":<hook>" index, is
|
|
82
|
+
# never enumerated, and never appears in /hooks. Releases before this one wrote
|
|
83
|
+
# the flat form; the install path migrates them (see MIGRATION below).
|
|
84
|
+
merge_hooks_json() {
|
|
85
|
+
local file="$1"
|
|
86
|
+
local mode="$2" # "install" or "uninstall"
|
|
87
|
+
local ts
|
|
88
|
+
ts="$(date +%Y%m%d%H%M%S)"
|
|
89
|
+
|
|
90
|
+
local runner=""
|
|
91
|
+
if command -v node &>/dev/null; then
|
|
92
|
+
runner="node"
|
|
93
|
+
elif command -v bun &>/dev/null; then
|
|
94
|
+
runner="bun"
|
|
95
|
+
else
|
|
96
|
+
echo "Error: node or bun required to merge hooks.json (JSON manipulation)" >&2
|
|
97
|
+
exit 3
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
"$runner" - "$file" "$mode" "$ts" "$PLUGIN_DIR" <<'NODE'
|
|
101
|
+
const fs = require("fs");
|
|
102
|
+
const path = require("path");
|
|
103
|
+
|
|
104
|
+
const file = process.argv[2];
|
|
105
|
+
const mode = process.argv[3];
|
|
106
|
+
const ts = process.argv[4];
|
|
107
|
+
const pluginDir = process.argv[5];
|
|
108
|
+
|
|
109
|
+
const EVENTS = [
|
|
110
|
+
["SessionStart", "session-start"],
|
|
111
|
+
["UserPromptSubmit", "user-prompt-submit"],
|
|
112
|
+
["PreToolUse", "pre-tool-use"],
|
|
113
|
+
["PostToolUse", "post-tool-use"],
|
|
114
|
+
["PreCompact", "pre-compact"],
|
|
115
|
+
["Stop", "stop"],
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
let cfg = {};
|
|
119
|
+
let existed = false;
|
|
120
|
+
try {
|
|
121
|
+
const raw = fs.readFileSync(file, "utf8");
|
|
122
|
+
if (raw.trim()) {
|
|
123
|
+
cfg = JSON.parse(raw);
|
|
124
|
+
existed = true;
|
|
125
|
+
}
|
|
126
|
+
} catch (e) {
|
|
127
|
+
if (e.code === "ENOENT") {
|
|
128
|
+
// no file — start empty
|
|
129
|
+
} else {
|
|
130
|
+
throw e;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Ensure nested hooks object exists (Codex schema requires this structure)
|
|
135
|
+
if (typeof cfg.hooks !== "object" || cfg.hooks === null) {
|
|
136
|
+
cfg.hooks = {};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function isOwned(e) {
|
|
140
|
+
return Boolean(e) && e._massaAiOwned === true;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// A correctly-shaped owned entry is a matcher group: its "hooks" is an array.
|
|
144
|
+
// Anything owned that fails this is a pre-fix flat entry Codex cannot enumerate.
|
|
145
|
+
function isOwnedMatcherGroup(e) {
|
|
146
|
+
return isOwned(e) && Array.isArray(e.hooks);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function hasOwned(arr) {
|
|
150
|
+
return Array.isArray(arr) && arr.some(isOwnedMatcherGroup);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (mode === "uninstall") {
|
|
154
|
+
// Remove owned entries from nested location + perform flat→nested migration
|
|
155
|
+
const hooks = cfg.hooks;
|
|
156
|
+
|
|
157
|
+
// First, remove owned entries from the correct nested location
|
|
158
|
+
for (const [evt] of EVENTS) {
|
|
159
|
+
if (Array.isArray(hooks[evt])) {
|
|
160
|
+
hooks[evt] = hooks[evt].filter((e) => !(e && e._massaAiOwned === true));
|
|
161
|
+
if (hooks[evt].length === 0) delete hooks[evt];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Clean up if hooks object is now empty
|
|
166
|
+
if (Object.keys(hooks).length === 0) delete cfg.hooks;
|
|
167
|
+
} else {
|
|
168
|
+
// install: backup before first write if file existed
|
|
169
|
+
if (existed) {
|
|
170
|
+
const bak = `${file}.massa-ai.bak-${ts}`;
|
|
171
|
+
fs.copyFileSync(file, bak);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Migration: check for broken flat-key entries at top level that should be removed
|
|
175
|
+
for (const [evt] of EVENTS) {
|
|
176
|
+
if (Array.isArray(cfg[evt])) {
|
|
177
|
+
const ownedEntries = cfg[evt].filter((e) => e && e._massaAiOwned === true);
|
|
178
|
+
// Only remove if ALL entries are owned (user entries are never marked)
|
|
179
|
+
if (ownedEntries.length > 0 && ownedEntries.length === cfg[evt].length) {
|
|
180
|
+
delete cfg[evt];
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// MIGRATION: drop owned entries written in the pre-fix flat shape. They are
|
|
186
|
+
// invisible to Codex, so leaving them would both keep /hooks empty and make
|
|
187
|
+
// hasOwned() below treat the event as already wired. Only owned entries are
|
|
188
|
+
// touched — user entries are never marked.
|
|
189
|
+
for (const [evt] of EVENTS) {
|
|
190
|
+
if (Array.isArray(cfg.hooks[evt])) {
|
|
191
|
+
cfg.hooks[evt] = cfg.hooks[evt].filter(
|
|
192
|
+
(e) => !(isOwned(e) && !isOwnedMatcherGroup(e)),
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Now write to the correct nested location
|
|
198
|
+
for (const [evt, sub] of EVENTS) {
|
|
199
|
+
if (!Array.isArray(cfg.hooks[evt])) cfg.hooks[evt] = [];
|
|
200
|
+
if (!hasOwned(cfg.hooks[evt])) {
|
|
201
|
+
cfg.hooks[evt].push({
|
|
202
|
+
hooks: [
|
|
203
|
+
{
|
|
204
|
+
type: "command",
|
|
205
|
+
command: `${pluginDir}/hooks/massa-ai-hook ${sub}`,
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
_massaAiOwned: true,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
215
|
+
fs.writeFileSync(file, JSON.stringify(cfg, null, 2) + "\n");
|
|
216
|
+
NODE
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
# ── Skills bundling (PDO-08, 09 / D3 two-writer ownership) ──────────────────
|
|
220
|
+
# scripts/install-skills.sh remains the single writer once it has already
|
|
221
|
+
# claimed this platform (skillsOwner: "repo" in the shared install-state.json).
|
|
222
|
+
# This plugin installs its bundled massa-ai/persona-router skills into the
|
|
223
|
+
# SAME harness skills directory ($CODEX_DIR/skills — NOT $PLUGIN_DIR/skills,
|
|
224
|
+
# which is Codex's own marketplace-plugin skill cache, a separate mechanism)
|
|
225
|
+
# only when that has not happened, mirroring the MCP single-writer precedent
|
|
226
|
+
# (test-mcp-single-writer.sh). A repo checkout's own --apply always takes
|
|
227
|
+
# precedence over a prior plugin install — see install-skills.sh.
|
|
228
|
+
HARNESS_STATE_FILE="$HOME/.config/massa-ai/install-state.json"
|
|
229
|
+
HARNESS_SKILLS_DIR="$CODEX_DIR/skills"
|
|
230
|
+
HARNESS_HOST="codex"
|
|
231
|
+
|
|
232
|
+
harness_skills_owner() {
|
|
233
|
+
local runner="$1"
|
|
234
|
+
"$runner" - "$HARNESS_STATE_FILE" "$HARNESS_HOST" <<'NODE'
|
|
235
|
+
const fs = require("fs");
|
|
236
|
+
const [, , file, host] = process.argv;
|
|
237
|
+
try {
|
|
238
|
+
const data = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
239
|
+
const rec = data && data.platforms && data.platforms[host];
|
|
240
|
+
process.stdout.write(rec && rec.skillsOwner === "repo" ? "repo" : "none");
|
|
241
|
+
} catch {
|
|
242
|
+
process.stdout.write("none");
|
|
243
|
+
}
|
|
244
|
+
NODE
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
install_bundled_skills() {
|
|
248
|
+
local runner=""
|
|
249
|
+
if command -v node &>/dev/null; then runner="node"
|
|
250
|
+
elif command -v bun &>/dev/null; then runner="bun"
|
|
251
|
+
else
|
|
252
|
+
echo " ⚠ node or bun required to install bundled skills — skipping" >&2
|
|
253
|
+
return 0
|
|
254
|
+
fi
|
|
255
|
+
|
|
256
|
+
if [[ "$(harness_skills_owner "$runner")" == "repo" ]]; then
|
|
257
|
+
vecho " ↷ skills already installed by scripts/install-skills.sh (repo-owned) — skipping bundled copy"
|
|
258
|
+
return 0
|
|
259
|
+
fi
|
|
260
|
+
|
|
261
|
+
local installed=0 name src dest
|
|
262
|
+
for name in massa-ai persona-router; do
|
|
263
|
+
src="$SCRIPT_DIR/skills/$name"
|
|
264
|
+
[[ -d "$src" ]] || continue
|
|
265
|
+
dest="$HARNESS_SKILLS_DIR/$name"
|
|
266
|
+
if [[ -e "$dest" && ! -d "$dest" ]]; then
|
|
267
|
+
echo " ⚠ $dest exists and is not a directory — skipping" >&2
|
|
268
|
+
continue
|
|
269
|
+
fi
|
|
270
|
+
mkdir -p "$HARNESS_SKILLS_DIR"
|
|
271
|
+
rm -rf "$dest"
|
|
272
|
+
cp -R "$src" "$dest"
|
|
273
|
+
installed=$((installed + 1))
|
|
274
|
+
done
|
|
275
|
+
vecho " + ${installed} harness skills installed to $HARNESS_SKILLS_DIR (plugin-owned)"
|
|
276
|
+
|
|
277
|
+
"$runner" - "$HARNESS_STATE_FILE" "$HARNESS_HOST" "$CODEX_DIR" <<'NODE'
|
|
278
|
+
const fs = require("fs");
|
|
279
|
+
const path = require("path");
|
|
280
|
+
const [, , file, host, root] = process.argv;
|
|
281
|
+
let data = { version: 2, platforms: {} };
|
|
282
|
+
try {
|
|
283
|
+
const existing = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
284
|
+
if (existing && typeof existing === "object" && !Array.isArray(existing)) data = existing;
|
|
285
|
+
} catch { /* fresh */ }
|
|
286
|
+
if (typeof data.platforms !== "object" || data.platforms === null || Array.isArray(data.platforms)) {
|
|
287
|
+
data.platforms = {};
|
|
288
|
+
}
|
|
289
|
+
data.version = 2;
|
|
290
|
+
data.platforms[host] = { root, skillsOwner: "plugin", skills: ["massa-ai", "persona-router"] };
|
|
291
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
292
|
+
fs.writeFileSync(file, JSON.stringify(data, null, 2) + "\n");
|
|
293
|
+
NODE
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
uninstall_bundled_skills() {
|
|
297
|
+
local runner=""
|
|
298
|
+
if command -v node &>/dev/null; then runner="node"
|
|
299
|
+
elif command -v bun &>/dev/null; then runner="bun"
|
|
300
|
+
else return 0
|
|
301
|
+
fi
|
|
302
|
+
|
|
303
|
+
local raw_owner
|
|
304
|
+
raw_owner="$("$runner" - "$HARNESS_STATE_FILE" "$HARNESS_HOST" <<'NODE'
|
|
305
|
+
const fs = require("fs");
|
|
306
|
+
const [, , file, host] = process.argv;
|
|
307
|
+
try {
|
|
308
|
+
const data = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
309
|
+
const rec = data && data.platforms && data.platforms[host];
|
|
310
|
+
process.stdout.write(rec ? String(rec.skillsOwner) : "none");
|
|
311
|
+
} catch {
|
|
312
|
+
process.stdout.write("none");
|
|
313
|
+
}
|
|
314
|
+
NODE
|
|
315
|
+
)"
|
|
316
|
+
[[ "$raw_owner" == "plugin" ]] || return 0
|
|
317
|
+
|
|
318
|
+
local name
|
|
319
|
+
for name in massa-ai persona-router; do
|
|
320
|
+
rm -rf "$HARNESS_SKILLS_DIR/$name"
|
|
321
|
+
done
|
|
322
|
+
rmdir "$HARNESS_SKILLS_DIR" 2>/dev/null || true
|
|
323
|
+
echo " - removed plugin-owned harness skills from $HARNESS_SKILLS_DIR"
|
|
324
|
+
|
|
325
|
+
"$runner" - "$HARNESS_STATE_FILE" "$HARNESS_HOST" <<'NODE'
|
|
326
|
+
const fs = require("fs");
|
|
327
|
+
const [, , file, host] = process.argv;
|
|
328
|
+
try {
|
|
329
|
+
const data = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
330
|
+
if (data && data.platforms && data.platforms[host] && data.platforms[host].skillsOwner === "plugin") {
|
|
331
|
+
delete data.platforms[host];
|
|
332
|
+
fs.writeFileSync(file, JSON.stringify(data, null, 2) + "\n");
|
|
333
|
+
}
|
|
334
|
+
} catch { /* nothing to clean up */ }
|
|
335
|
+
NODE
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
# ── Uninstall ───────────────────────────────────────────────────────────────
|
|
339
|
+
if [[ "$UNINSTALL" -eq 1 ]]; then
|
|
340
|
+
echo "Uninstalling massa-ai Codex plugin (scope: $SCOPE)..."
|
|
341
|
+
uninstall_bundled_skills
|
|
342
|
+
# Remove owned hook entries (preserves user hooks)
|
|
343
|
+
if [[ -f "$HOOKS_JSON" ]]; then
|
|
344
|
+
merge_hooks_json "$HOOKS_JSON" "uninstall"
|
|
345
|
+
echo " - removed massa-ai hook entries from $HOOKS_JSON"
|
|
346
|
+
fi
|
|
347
|
+
# Remove plugin directory
|
|
348
|
+
if [[ -d "$PLUGIN_DIR" ]]; then
|
|
349
|
+
rm -rf "$PLUGIN_DIR"
|
|
350
|
+
echo " - removed $PLUGIN_DIR"
|
|
351
|
+
fi
|
|
352
|
+
# Remove only ownership-marked agent TOML files (R3: shared agents dir, user
|
|
353
|
+
# agents preserved). Marker = "# massa-ai-owned" top comment.
|
|
354
|
+
if [[ -d "$AGENTS_DIR" ]]; then
|
|
355
|
+
removed=0
|
|
356
|
+
for f in "$AGENTS_DIR/"*.toml; do
|
|
357
|
+
[[ -f "$f" ]] || continue
|
|
358
|
+
if head -n1 "$f" | grep -q "^# massa-ai-owned$"; then
|
|
359
|
+
rm -f "$f"
|
|
360
|
+
removed=$((removed + 1))
|
|
361
|
+
fi
|
|
362
|
+
done
|
|
363
|
+
if [[ "$removed" -gt 0 ]]; then
|
|
364
|
+
echo " - removed ${removed} massa-ai-owned agent TOML files from $AGENTS_DIR/"
|
|
365
|
+
fi
|
|
366
|
+
fi
|
|
367
|
+
echo ""
|
|
368
|
+
echo "Done. User hooks and user agents preserved."
|
|
369
|
+
exit 0
|
|
370
|
+
fi
|
|
371
|
+
|
|
372
|
+
# ── Install ──────────────────────────────────────────────────────────────────
|
|
373
|
+
vecho "Installing massa-ai Codex plugin to: $PLUGIN_DIR"
|
|
374
|
+
mkdir -p "$PLUGIN_DIR/.codex-plugin" "$PLUGIN_DIR/skills" "$PLUGIN_DIR/hooks"
|
|
375
|
+
|
|
376
|
+
# Copy manifest
|
|
377
|
+
cp "$SCRIPT_DIR/.codex-plugin/plugin.json" "$PLUGIN_DIR/.codex-plugin/plugin.json"
|
|
378
|
+
vecho " + .codex-plugin/plugin.json"
|
|
379
|
+
|
|
380
|
+
# Copy skills
|
|
381
|
+
skill_count=0
|
|
382
|
+
for src in "$SCRIPT_DIR/skills/"*.md; do
|
|
383
|
+
name="$(basename "$src")"
|
|
384
|
+
cp "$src" "$PLUGIN_DIR/skills/$name"
|
|
385
|
+
vecho " + skills/$name"
|
|
386
|
+
skill_count=$((skill_count + 1))
|
|
387
|
+
done
|
|
388
|
+
|
|
389
|
+
# Copy hooks.json (the placeholder version — installer replaces paths)
|
|
390
|
+
cp "$SCRIPT_DIR/hooks/hooks.json" "$PLUGIN_DIR/hooks/hooks.json"
|
|
391
|
+
vecho " + hooks/hooks.json"
|
|
392
|
+
|
|
393
|
+
# Older installs shipped a plugin-local .mcp.json here. It was never a Codex
|
|
394
|
+
# read path, and MCP is now owned by scripts/install-agents.sh — drop the
|
|
395
|
+
# residue so upgraders converge on a single registration.
|
|
396
|
+
if [[ -f "$PLUGIN_DIR/.mcp.json" ]]; then
|
|
397
|
+
rm -f "$PLUGIN_DIR/.mcp.json"
|
|
398
|
+
# Not gated by --quiet: this deletes a file in the user's home, so it is a
|
|
399
|
+
# mutation notice rather than per-file chatter.
|
|
400
|
+
echo -e " - removed stale .mcp.json (MCP is now registered in ~/.codex/config.toml)"
|
|
401
|
+
fi
|
|
402
|
+
|
|
403
|
+
# Copy the real hooks/massa-ai-hook this plugin already ships (T14/PDO-14: a
|
|
404
|
+
# generated real file, no longer a symlink into apps/claude-plugin/ — that
|
|
405
|
+
# path does not exist in a registry tarball install, where $REPO_ROOT is not
|
|
406
|
+
# this monorepo. $CLAUDE_PLUGIN_BIN is kept only as a repo-checkout fallback.
|
|
407
|
+
if [[ -f "$SCRIPT_DIR/hooks/massa-ai-hook" ]]; then
|
|
408
|
+
cp "$SCRIPT_DIR/hooks/massa-ai-hook" "$PLUGIN_DIR/hooks/massa-ai-hook"
|
|
409
|
+
chmod +x "$PLUGIN_DIR/hooks/massa-ai-hook"
|
|
410
|
+
vecho " + hooks/massa-ai-hook"
|
|
411
|
+
elif [[ -f "$CLAUDE_PLUGIN_BIN" ]]; then
|
|
412
|
+
ln -sfn "$CLAUDE_PLUGIN_BIN" "$PLUGIN_DIR/hooks/massa-ai-hook"
|
|
413
|
+
vecho " + hooks/massa-ai-hook → $CLAUDE_PLUGIN_BIN"
|
|
414
|
+
else
|
|
415
|
+
echo " ⚠ Warning: no massa-ai-hook binary found" >&2
|
|
416
|
+
echo " Hooks will not fire until the binary is available." >&2
|
|
417
|
+
fi
|
|
418
|
+
|
|
419
|
+
# Merge hooks.json (array-append, backup, idempotent)
|
|
420
|
+
vecho ""
|
|
421
|
+
vecho "Merging hooks into $HOOKS_JSON..."
|
|
422
|
+
merge_hooks_json "$HOOKS_JSON" "install"
|
|
423
|
+
vecho " + 6 massa-ai hook events wired (array-append, user hooks preserved)"
|
|
424
|
+
|
|
425
|
+
# Write the generated subagent specialist TOML files to ~/.codex/agents/ (OUTSIDE the
|
|
426
|
+
# plugin dir — Codex custom agents load from the config-root agents/ dir, not
|
|
427
|
+
# the plugin dir). Each file carries a "# massa-ai-owned" top comment for
|
|
428
|
+
# scoped uninstall (R3: shared agents dir, user agents preserved).
|
|
429
|
+
mkdir -p "$AGENTS_DIR"
|
|
430
|
+
specialist_count=0
|
|
431
|
+
for src in "$SCRIPT_DIR/agents/"massa-ai-*.toml; do
|
|
432
|
+
[[ -f "$src" ]] || continue
|
|
433
|
+
name="$(basename "$src")"
|
|
434
|
+
cp "$src" "$AGENTS_DIR/$name"
|
|
435
|
+
vecho " + $name"
|
|
436
|
+
specialist_count=$((specialist_count + 1))
|
|
437
|
+
done
|
|
438
|
+
vecho " + ${specialist_count} subagent specialists (generated from skills/agents/*/SKILL.md)"
|
|
439
|
+
|
|
440
|
+
# Skills bundling (PDO-08, 09): install massa-ai/persona-router into the
|
|
441
|
+
# shared harness skills directory, unless scripts/install-skills.sh already
|
|
442
|
+
# owns it for this platform.
|
|
443
|
+
vecho ""
|
|
444
|
+
install_bundled_skills
|
|
445
|
+
|
|
446
|
+
# ── MCP registration (delegated) ─────────────────────────────────────────────
|
|
447
|
+
# scripts/install-agents.sh is the single writer of host MCP config. It writes
|
|
448
|
+
# [mcp_servers.massa-ai] into ~/.codex/config.toml at USER scope — a --project
|
|
449
|
+
# plugin install still registers MCP for the whole user.
|
|
450
|
+
vecho ""
|
|
451
|
+
vecho "Registering MCP server (user scope) via scripts/install-agents.sh..."
|
|
452
|
+
if [[ -f "$REPO_ROOT/scripts/install-agents.sh" ]]; then
|
|
453
|
+
# On success the delegated output is detail (usually "up to date"), so it is
|
|
454
|
+
# gated. On failure it is never gated: a silently-failed MCP registration is
|
|
455
|
+
# exactly the bug this change set exists to fix.
|
|
456
|
+
if agents_out="$(MASSA_AI_SUPPRESS_SPECIALIST_HINT=1 bash "$REPO_ROOT/scripts/install-agents.sh" --agent codex --yes 2>&1)"; then
|
|
457
|
+
vecho "$agents_out"
|
|
458
|
+
else
|
|
459
|
+
echo "$agents_out" >&2
|
|
460
|
+
echo " ⚠ MCP wiring failed — run: bash scripts/install-agents.sh --agent codex --yes" >&2
|
|
461
|
+
fi
|
|
462
|
+
else
|
|
463
|
+
echo " ⚠ scripts/install-agents.sh not found — register MCP with: bash scripts/install-agents.sh --agent codex --yes" >&2
|
|
464
|
+
fi
|
|
465
|
+
|
|
466
|
+
# Summary line in quiet mode
|
|
467
|
+
if [ "${MASSA_AI_VERBOSE:-0}" != "1" ]; then
|
|
468
|
+
ok "codex plugin installed (${skill_count} skills, ${specialist_count} specialists, 6 hooks)"
|
|
469
|
+
else
|
|
470
|
+
vecho ""
|
|
471
|
+
vecho "Done. Restart Codex to pick up the plugin."
|
|
472
|
+
vecho ""
|
|
473
|
+
vecho "⚠ Run /hooks in Codex to trust massa-ai hooks, or no observations will be captured."
|
|
474
|
+
vecho "💡 MCP is registered in ~/.codex/config.toml by scripts/install-agents.sh (single writer)."
|
|
475
|
+
fi
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@massa-ai/codex-plugin",
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "massa-ai plugin for Codex — semantic code search, memory, and context compression",
|
|
5
|
+
"files": [
|
|
6
|
+
"agents",
|
|
7
|
+
"hooks",
|
|
8
|
+
"skills",
|
|
9
|
+
"install.sh",
|
|
10
|
+
"README.md",
|
|
11
|
+
".codex-plugin/plugin.json"
|
|
12
|
+
],
|
|
13
|
+
"author": "luizgmassa",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"codex",
|
|
16
|
+
"plugin",
|
|
17
|
+
"massa-ai",
|
|
18
|
+
"semantic-search",
|
|
19
|
+
"code-search",
|
|
20
|
+
"memory",
|
|
21
|
+
"context-compression",
|
|
22
|
+
"ai",
|
|
23
|
+
"llm"
|
|
24
|
+
],
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/luizgmassa/massa-ai"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architecture-specialist
|
|
3
|
+
description: Read-only architecture guidance agent. Evaluate architecture, suggest boundaries, recommend abstractions, evaluate trade-offs, and suggest modularization. Folds the existing domain-mapper, coupling-auditor, and deepening-architect roles into one specialist. Triggers when a workflow needs architectural guidance before or during design. Never implements or rewrites code.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: S1LV4, luizgmassa
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
model_hint: MiniMax M3
|
|
9
|
+
permission: read-only
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Architecture Specialist Agent Skill
|
|
13
|
+
|
|
14
|
+
## Mission
|
|
15
|
+
Provide architectural guidance by evaluating structure, suggesting boundaries, and weighing trade-offs.
|
|
16
|
+
|
|
17
|
+
## Responsibilities
|
|
18
|
+
- Evaluate architecture (layering, boundaries, coupling, depth).
|
|
19
|
+
- Suggest module boundaries and seams.
|
|
20
|
+
- Recommend abstractions where duplication or volatility warrants them.
|
|
21
|
+
- Evaluate trade-offs between approaches.
|
|
22
|
+
- Suggest modularization for shallow or over-coupled modules.
|
|
23
|
+
|
|
24
|
+
## Restrictions
|
|
25
|
+
- Never implement.
|
|
26
|
+
- Never rewrite code.
|
|
27
|
+
- Never spawn subagents and never load the `massa-ai` router; the dispatching workflow owns routing.
|
|
28
|
+
|
|
29
|
+
## Inputs
|
|
30
|
+
- `scope`: the module, service, or area under evaluation.
|
|
31
|
+
- `inputs`: recalled facts, source pointers, existing architecture docs.
|
|
32
|
+
- `sensors`: static coupling/depth metrics when available.
|
|
33
|
+
|
|
34
|
+
## Outputs
|
|
35
|
+
- Status: Complete | Partial | Blocked
|
|
36
|
+
- Scope: modules and boundaries evaluated
|
|
37
|
+
- Evidence: `path:line` pointers, coupling/depth metrics, source locations
|
|
38
|
+
- Findings: boundary suggestions, abstraction recommendations, trade-off analysis, modularization plan
|
|
39
|
+
- Risks and skipped checks
|
|
40
|
+
- Exact next step
|
|
41
|
+
|
|
42
|
+
## Invocation
|
|
43
|
+
### Use when
|
|
44
|
+
- A workflow needs architectural guidance before or during design.
|
|
45
|
+
- The work crosses module or service boundaries.
|
|
46
|
+
- The user asks for architecture evaluation, coupling analysis, or modularization.
|
|
47
|
+
|
|
48
|
+
### Do not use when
|
|
49
|
+
- The work is a single-file fix with no architectural surface.
|
|
50
|
+
- The task needs a concrete implementation (route to builder).
|
|
51
|
+
- An audit-specific lens is needed (route to audit-specialist with `lens: architecture`).
|
|
52
|
+
|
|
53
|
+
## massa-ai Integration
|
|
54
|
+
- Context Firewall: summarize source reads; return findings and metrics, not raw code.
|
|
55
|
+
- Verification Ladder: static (coupling, depth, boundary) checks; no behavioral changes.
|
|
56
|
+
- Massa-ai Memory: suggest durable architecture-decision memories only when a boundary or abstraction is recommended; main agent persists.
|
|
57
|
+
- Synapse: own ephemeral session when evaluation spans multiple modules with repeated searches.
|
|
58
|
+
- References: `references/architecture-lenses.md`, `references/architecture-domain-lens.md`, `references/architecture-coupling-lens.md`, `references/architecture-deepening-lens.md`.
|
|
59
|
+
|
|
60
|
+
## Model Hint
|
|
61
|
+
MiniMax M3 (advisory). Fallback to the workflow's configured default model if unavailable.
|
|
62
|
+
|
|
63
|
+
## Validation Sensors
|
|
64
|
+
- Every finding has a `path:line` or metric pointer.
|
|
65
|
+
- Trade-offs name at least two alternatives.
|
|
66
|
+
- Boundary suggestions reference concrete modules.
|
|
67
|
+
|
|
68
|
+
## Memory Boundary
|
|
69
|
+
Suggest durable memories only when an architectural boundary or abstraction is recommended and accepted. The main agent persists. Do not persist one-off evaluation chatter.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit-specialist
|
|
3
|
+
description: Configurable read-only audit agent. Execute specialized audits through six lenses — bugs, architecture, security, requirements, code-quality, performance — selected via the lens field in the capability packet. Triggers when a workflow needs a findings-only audit. Never modifies implementation.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: S1LV4, luizgmassa
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
model_hint: GLM-5.2
|
|
9
|
+
permission: read-only
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Audit Specialist Agent Skill
|
|
13
|
+
|
|
14
|
+
## Mission
|
|
15
|
+
Execute a specialized audit through one configurable lens and return findings-only output.
|
|
16
|
+
|
|
17
|
+
## Responsibilities
|
|
18
|
+
- Execute the audit checklist for the selected lens.
|
|
19
|
+
- Tie every finding to a `path:line` source location.
|
|
20
|
+
- Rank findings by severity.
|
|
21
|
+
- Produce a findings report following the project audit-report format.
|
|
22
|
+
|
|
23
|
+
## Restrictions
|
|
24
|
+
- Never modify implementation.
|
|
25
|
+
- One lens per dispatch; do not mix lenses in one run.
|
|
26
|
+
- Never spawn subagents and never load the `massa-ai` router; the dispatching workflow owns routing.
|
|
27
|
+
|
|
28
|
+
## Lenses
|
|
29
|
+
|
|
30
|
+
The `lens` field in the capability packet selects the audit behavior:
|
|
31
|
+
|
|
32
|
+
| Lens | Focus | Per-lens references |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `bugs` | Bug discovery: null paths, error handling, race conditions, logic errors | `workflows/bugs/bugs-audit.md` |
|
|
35
|
+
| `architecture` | DDD, boundaries, coupling, module depth, seams | `references/architecture-lenses.md`, `references/architecture-domain-lens.md`, `references/architecture-coupling-lens.md`, `references/architecture-deepening-lens.md` |
|
|
36
|
+
| `security` | Security, privacy, auth, validation, secret handling | `workflows/security/security-audit.md` |
|
|
37
|
+
| `requirements` | Requirements, spec, acceptance, scope alignment | `workflows/requirements/requirements-audit.md` |
|
|
38
|
+
| `code-quality` | SOLID, Clean Code, KISS, YAGNI, DRY, maintainability | `workflows/code-quality/code-quality-audit.md` |
|
|
39
|
+
| `performance` | Performance hotspots, allocation, latency, throughput | Domain-specific; no fixed reference |
|
|
40
|
+
|
|
41
|
+
All lenses share `references/audit-scope.md` (scope rules) and `references/audit-report-io.md` (report format).
|
|
42
|
+
|
|
43
|
+
## Inputs
|
|
44
|
+
- `scope`: the target area, diff, or module to audit.
|
|
45
|
+
- `lens`: one of `bugs | architecture | security | requirements | code-quality | performance` (required).
|
|
46
|
+
- `inputs`: recalled facts, existing audit reports, source pointers.
|
|
47
|
+
- `sensors`: static checks available for the lens (lint, typecheck, security scanners).
|
|
48
|
+
|
|
49
|
+
## Outputs
|
|
50
|
+
- Status: Complete | Partial | Blocked
|
|
51
|
+
- Scope: area audited + lens used
|
|
52
|
+
- Evidence: `path:line` pointers, static-check results, source locations
|
|
53
|
+
- Findings: ranked list (severity, location, problem, suggestion) in the project audit-report format
|
|
54
|
+
- Risks and skipped checks
|
|
55
|
+
- Exact next step
|
|
56
|
+
|
|
57
|
+
## Invocation
|
|
58
|
+
### Use when
|
|
59
|
+
- A workflow needs a findings-only audit of an implementation target.
|
|
60
|
+
- The user asks for a bug, architecture, security, requirements, code-quality, or performance audit.
|
|
61
|
+
- A high/critical finding needs independent verification.
|
|
62
|
+
|
|
63
|
+
### Do not use when
|
|
64
|
+
- The task needs a fix (route to the matching `*-fix` workflow or builder).
|
|
65
|
+
- No concrete target exists to audit.
|
|
66
|
+
- The lens is ambiguous (ask the user to pick one).
|
|
67
|
+
|
|
68
|
+
## massa-ai Integration
|
|
69
|
+
- Context Firewall: summarize the audit scope; return findings, not raw source dumps.
|
|
70
|
+
- Verification Ladder: static checks per lens; no behavioral changes (findings-only).
|
|
71
|
+
- Massa-ai Memory: suggest durable audit-pattern memories only when a lens reveals a recurring issue class; main agent persists.
|
|
72
|
+
- Synapse: own ephemeral session when the audit spans multiple modules with repeated searches.
|
|
73
|
+
- References: `references/audit-scope.md`, `references/audit-report-io.md`, plus the per-lens references above.
|
|
74
|
+
|
|
75
|
+
## Model Hint
|
|
76
|
+
GLM-5.2 (advisory). Fallback to the workflow's configured default model if unavailable.
|
|
77
|
+
|
|
78
|
+
## Validation Sensors
|
|
79
|
+
- Every finding has a `path:line` pointer.
|
|
80
|
+
- Findings follow the project audit-report format (`references/audit-report-io.md`).
|
|
81
|
+
- Severity is assigned per the lens rubric.
|
|
82
|
+
- No fix actions taken (findings-only).
|
|
83
|
+
|
|
84
|
+
## Memory Boundary
|
|
85
|
+
Suggest durable memories only when a lens reveals a recurring issue class worth remembering. The main agent persists. Do not persist the audit report itself (it lives in `.specs/`).
|