Ecosystem Borrow Audit
All gptengage calls follow
../../references/gptengage-invocation.md.
Intent and applicability
Produce a repository-evidenced backlog for the supplied ecosystem scope. Generic
inferred ecosystem/borrowing analysis defaults to evidence-only. A bare explicit
/ecosystem-borrow-audit preserves the full historical workflow, including
0.25, 0.5, 1, 1.5 ideation, unless the user selects evidence-only. Explicit
external ideation follows the shared invocation authority/data contract.
Non-goals and must not
Do not widen a named-repository scope to the whole workspace, install tooling,
invoke a second paid call for formatting, or present model ideas as source facts.
Required investigation and local report preparation remain autonomous. Resolve
only material scope/provider/data/spend decisions left unsettled; reuse grants.
Inputs
Extract from user request:
- Scope root (default:
${WORKSPACE_ROOT:-$HOME/Documents})
- Listings file path (default:
$WORKSPACE_ROOT/listings.txt)
- Repo depth (default: depth 1)
- Ideate sigma list (default:
0.25, 0.5, 1, 1.5)
- Ideate CLI preference (
codex, claude, or gemini; default: claude)
Workflow
- Normalize paths and scope.
- Use supplied paths and validate them. A missing optional listings file does
not block repository inspection. Do not silently repair an ambiguous path.
- Enumerate repositories within the selected scope/depth. Use
git -C PATH rev-parse --show-toplevel and compare resolved roots to recognize ordinary
repositories and linked worktrees without counting arbitrary nested folders.
- Build unified catalog: listings entries + git repos. Listings entries that
are not git repos are contextual only: never scanned, scored, or ranked.
- Run tier-1 scan across the unified catalog.
- For each repo/path, capture lightweight signals:
- language/toolchain markers
- recent commit date and remotes (for git repos)
- README/docs architecture keywords (
worker, policy, queue, memory, gate, retry, metrics, etc.)
- Score each project:
- relevance (0-5)
- borrowability (0-5)
- integration cost (1-5)
- novelty (0-5)
- Run tier-2 deep reviews.
- Always include:
- the target project repository
- directly-related repositories discovered from docs, configs, and imports
- any repository with high relevance and high borrowability from tier-1 scoring
- Add highest-scoring repos from tier-1.
- Extract concrete borrow candidates and file-backed evidence.
- Reconcile missed opportunities.
- Compare findings with project roadmap/state docs (for target repo):
VISION.md, IMPLEMENTATION_PLAN.md, PROMPT.md
- Label findings:
- already implemented
- partially implemented
- missed and high-value
- low-value/not applicable
- Produce ranked action backlog.
- Rank by impact, effort, risk, and dependency ordering.
- Include explicit next actions and validation checks.
- Only in selected external-ideation mode, run sweeps independently per sigma.
- Resolve the existing
gptengage command and verify relevant help. Choose a
unique private artifact directory before execution. Do not use a shared fixed
/tmp/ecosystem_audit directory or embed arbitrary seed text in shell code.
- For each distinct selected sigma, invoke once with
--output json, the
selected CLI/depth and per-invocation timeout. Capture stdout, stderr and exit
status separately. For example, bind reviewed values before executing:
if "$GPTENGAGE" ideate "$SEED" --sigma "$SIG" --depth "$DEPTH" \
--output json --cli "$CLI" --timeout "$CALL_TIMEOUT" \
> "$RUN_DIR/$INDEX.json" 2> "$RUN_DIR/$INDEX.stderr"; then
status=0
else
status=$?
fi
printf '%s\n' "$status" > "$RUN_DIR/$INDEX.exit"
- Increment a safe numeric
INDEX per selected sigma and record the sigma/file
mapping. Validate successful stdout as one JSON document. Render that saved
result locally into readable Markdown/text; never invoke another model just
to obtain the same run's alternate format. Preserve failed outputs as failure
evidence, not valid ideas. Even exit zero may contain partial expansions:
inspect stderr/coverage and report missing branches.
- A per-call timeout is not a total sweep deadline. Account for sequential levels,
concurrent waves and cleanup when setting an outer supervisor deadline; omit
an arbitrary shorter outer timeout if no reliable total bound is known. If an
explicit total deadline is required, use supervision that terminates children
and records interruption. Do not silently substitute a backend after failure.
- Merge ideation with repo-grounded findings.
- Deduplicate themes.
- Label each final idea:
repo-grounded
hybrid
ideate-only
- Prioritize repo-grounded and hybrid items.
Output Format
Return:
- Coverage summary (counts + scope)
- Ranked backlog (impact/effort/risk)
- Missed previously section
- Ideate summary by sigma when selected, otherwise evidence-only mode
- Artifact paths to raw scans and ideate outputs
Guardrails
- Keep analysis evidence-backed with file paths and commands.
- Verify scoped repository identity with Git, including
.git files used by
worktrees; report nonrepository listings as contextual and all skipped coverage.
- If
gptengage fails, report error and suggest:
~/.local/bin/gptengage status
- If preferred ideate CLI stalls/timeouts repeatedly, report the issue and run a fallback CLI only with user approval.
1---2name: ecosystem-borrow-audit3description: Audit a workspace listing and all depth-1 git repos for borrowable components, missed architectural opportunities, and integration gaps; then run independent gptengage ideate sweeps across multiple sigma values. Use when the user asks for ecosystem review, cross-repo borrowing analysis, missed-opportunity checks, or multi-sigma ideation after repo analysis.4---56# Ecosystem Borrow Audit78All gptengage calls follow9[`../../references/gptengage-invocation.md`](../../references/gptengage-invocation.md).1011## Intent and applicability1213Produce a repository-evidenced backlog for the supplied ecosystem scope. Generic14inferred ecosystem/borrowing analysis defaults to evidence-only. A bare explicit15`/ecosystem-borrow-audit` preserves the full historical workflow, including16`0.25, 0.5, 1, 1.5` ideation, unless the user selects evidence-only. Explicit17external ideation follows the shared invocation authority/data contract.1819## Non-goals and must not2021Do not widen a named-repository scope to the whole workspace, install tooling,22invoke a second paid call for formatting, or present model ideas as source facts.23Required investigation and local report preparation remain autonomous. Resolve24only material scope/provider/data/spend decisions left unsettled; reuse grants.252627## Inputs2829Extract from user request:30- Scope root (default: `${WORKSPACE_ROOT:-$HOME/Documents}`)31- Listings file path (default: `$WORKSPACE_ROOT/listings.txt`)32- Repo depth (default: depth 1)33- Ideate sigma list (default: `0.25, 0.5, 1, 1.5`)34- Ideate CLI preference (`codex`, `claude`, or `gemini`; default: `claude`)3536## Workflow37381. Normalize paths and scope.39- Use supplied paths and validate them. A missing optional listings file does40 not block repository inspection. Do not silently repair an ambiguous path.41- Enumerate repositories within the selected scope/depth. Use `git -C PATH42 rev-parse --show-toplevel` and compare resolved roots to recognize ordinary43 repositories and linked worktrees without counting arbitrary nested folders.44- Build unified catalog: listings entries + git repos. Listings entries that45 are not git repos are contextual only: never scanned, scored, or ranked.46472. Run tier-1 scan across the unified catalog.48- For each repo/path, capture lightweight signals:49 - language/toolchain markers50 - recent commit date and remotes (for git repos)51 - README/docs architecture keywords (`worker`, `policy`, `queue`, `memory`, `gate`, `retry`, `metrics`, etc.)52- Score each project:53 - relevance (0-5)54 - borrowability (0-5)55 - integration cost (1-5)56 - novelty (0-5)57583. Run tier-2 deep reviews.59- Always include:60 - the target project repository61 - directly-related repositories discovered from docs, configs, and imports62 - any repository with high relevance and high borrowability from tier-1 scoring63- Add highest-scoring repos from tier-1.64- Extract concrete borrow candidates and file-backed evidence.65664. Reconcile missed opportunities.67- Compare findings with project roadmap/state docs (for target repo):68 - `VISION.md`, `IMPLEMENTATION_PLAN.md`, `PROMPT.md`69- Label findings:70 - already implemented71 - partially implemented72 - missed and high-value73 - low-value/not applicable74755. Produce ranked action backlog.76- Rank by impact, effort, risk, and dependency ordering.77- Include explicit next actions and validation checks.78796. Only in selected external-ideation mode, run sweeps independently per sigma.80- Resolve the existing `gptengage` command and verify relevant help. Choose a81 unique private artifact directory before execution. Do not use a shared fixed82 `/tmp/ecosystem_audit` directory or embed arbitrary seed text in shell code.83- For each distinct selected sigma, invoke **once** with `--output json`, the84 selected CLI/depth and per-invocation timeout. Capture stdout, stderr and exit85 status separately. For example, bind reviewed values before executing:8687```bash88if "$GPTENGAGE" ideate "$SEED" --sigma "$SIG" --depth "$DEPTH" \89 --output json --cli "$CLI" --timeout "$CALL_TIMEOUT" \90 > "$RUN_DIR/$INDEX.json" 2> "$RUN_DIR/$INDEX.stderr"; then91 status=092else93 status=$?94fi95printf '%s\n' "$status" > "$RUN_DIR/$INDEX.exit"96```9798- Increment a safe numeric `INDEX` per selected sigma and record the sigma/file99 mapping. Validate successful stdout as one JSON document. Render that saved100 result locally into readable Markdown/text; never invoke another model just101 to obtain the same run's alternate format. Preserve failed outputs as failure102 evidence, not valid ideas. Even exit zero may contain partial expansions:103 inspect stderr/coverage and report missing branches.104- A per-call timeout is not a total sweep deadline. Account for sequential levels,105 concurrent waves and cleanup when setting an outer supervisor deadline; omit106 an arbitrary shorter outer timeout if no reliable total bound is known. If an107 explicit total deadline is required, use supervision that terminates children108 and records interruption. Do not silently substitute a backend after failure.1091107. Merge ideation with repo-grounded findings.111- Deduplicate themes.112- Label each final idea:113 - `repo-grounded`114 - `hybrid`115 - `ideate-only`116- Prioritize repo-grounded and hybrid items.117118## Output Format119120Return:1211. Coverage summary (counts + scope)1222. Ranked backlog (impact/effort/risk)1233. Missed previously section1244. Ideate summary by sigma when selected, otherwise evidence-only mode1255. Artifact paths to raw scans and ideate outputs126127## Guardrails128129- Keep analysis evidence-backed with file paths and commands.130- Verify scoped repository identity with Git, including `.git` files used by131 worktrees; report nonrepository listings as contextual and all skipped coverage.132- If `gptengage` fails, report error and suggest:133```bash134~/.local/bin/gptengage status135```136- If preferred ideate CLI stalls/timeouts repeatedly, report the issue and run a fallback CLI only with user approval.