plugins/codex/code/scripts/doc-module.sh
Snider 466fe9f5a6 feat(codex): mirror claude plugins and ethics modal
Summary:\n- added Codex marketplace registry plus awareness/ethics/guardrails sub-plugins\n- mirrored Claude plugin commands/scripts/hooks into codex api/ci/code/collect/coolify/core/issue/perf/qa/review/verify\n- embedded Axioms of Life ethics modal, guardrails, and kernel files under codex/ethics\n- added Codex parity report, improvements list, and MCP integration plan\n- extended Gemini MCP tools and docs for Codex awareness
2026-02-05 20:13:01 +00:00

58 lines
1.5 KiB
Bash

#!/bin/bash
MODULE_NAME=$1
TARGET_PATH=$2
if [ -z "$MODULE_NAME" ] || [ -z "$TARGET_PATH" ]; then
echo "Usage: doc-module.sh <ModuleName> <TargetPath>" >&2
exit 1
fi
MODULE_PATH="${TARGET_PATH}/${MODULE_NAME}"
COMPOSER_JSON_PATH="${MODULE_PATH}/composer.json"
if [ ! -d "$MODULE_PATH" ]; then
echo "Error: Module directory not found at '$MODULE_PATH'." >&2
exit 1
fi
if [ ! -f "$COMPOSER_JSON_PATH" ]; then
echo "Error: 'composer.json' not found in module directory '$MODULE_PATH'." >&2
exit 1
fi
# --- PARSING & MARKDOWN GENERATION ---
# Use jq to parse the composer.json file.
NAME=$(jq -r '.name' "$COMPOSER_JSON_PATH")
DESCRIPTION=$(jq -r '.description' "$COMPOSER_JSON_PATH")
TYPE=$(jq -r '.type' "$COMPOSER_JSON_PATH")
LICENSE=$(jq -r '.license' "$COMPOSER_JSON_PATH")
echo "# Module: $NAME"
echo ""
echo "**Description:** $DESCRIPTION"
echo "**Type:** $TYPE"
echo "**License:** $LICENSE"
echo ""
# List dependencies
DEPENDENCIES=$(jq -r '.require | keys[] as $key | "\($key): \(.[$key])"' "$COMPOSER_JSON_PATH")
if [ -n "$DEPENDENCIES" ]; then
echo "## Dependencies"
echo ""
echo "$DEPENDENCIES" | while read -r DEP; do
echo "- $DEP"
done
echo ""
fi
# List dev dependencies
DEV_DEPENDENCIES=$(jq -r '.["require-dev"] | keys[] as $key | "\($key): \(.[$key])"' "$COMPOSER_JSON_PATH")
if [ -n "$DEV_DEPENDENCIES" ]; then
echo "## Dev Dependencies"
echo ""
echo "$DEV_DEPENDENCIES" | while read -r DEP; do
echo "- $DEP"
done
echo ""
fi