From 02ebf8f19923ecc5b30a65d74063d5195205dfc8 Mon Sep 17 00:00:00 2001 From: azizur100389 Date: Mon, 27 Jul 2026 08:47:38 +0100 Subject: [PATCH] fix(ai-context): emit compact markdown tables --- gitnexus/src/cli/ai-context.ts | 4 ++-- gitnexus/test/unit/ai-context.test.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gitnexus/src/cli/ai-context.ts b/gitnexus/src/cli/ai-context.ts index ec5ae6170..faeb13d76 100644 --- a/gitnexus/src/cli/ai-context.ts +++ b/gitnexus/src/cli/ai-context.ts @@ -175,7 +175,7 @@ export function generateGitNexusContent( const tableBody = [standardSkillsRows, generatedRows].filter(Boolean).join('\n'); const skillsTable = tableBody ? `| Task | Read this skill file | -|------|---------------------| +| --- | --- | ${tableBody}` : ''; // Docs reference the project-local runner `gitnexus analyze` writes (#1945): @@ -222,7 +222,7 @@ This project is indexed by GitNexus as **${projectName}**${noStats ? '' : ` (${s ## Resources | Resource | Use for | -|----------|---------| +| --- | --- | | \`gitnexus://repo/${projectName}/context\` | Codebase overview, check index freshness | | \`gitnexus://repo/${projectName}/clusters\` | All functional areas | | \`gitnexus://repo/${projectName}/processes\` | All execution flows | diff --git a/gitnexus/test/unit/ai-context.test.ts b/gitnexus/test/unit/ai-context.test.ts index cbe3bf457..b7e8adaad 100644 --- a/gitnexus/test/unit/ai-context.test.ts +++ b/gitnexus/test/unit/ai-context.test.ts @@ -166,6 +166,19 @@ describe('generateAIContextFiles', () => { expect(withoutPdg).toContain('explain('); }); + it('emits MD060-compatible compact tables in generated docs (#2709)', () => { + const content = generateGitNexusContent('MarkdownProject', { + nodes: 50, + edges: 100, + processes: 5, + }); + + expect(content).toContain('| Resource | Use for |\n| --- | --- |\n'); + expect(content).toContain('| Task | Read this skill file |\n| --- | --- |\n'); + expect(content).not.toContain('|----------|---------|'); + expect(content).not.toContain('|------|---------------------|'); + }); + it('degrades gracefully when the runner copy fails (#1945)', async () => { // A read-only/full-disk storage dir must not abort generation. The copy is // best-effort + logged; the generated docs still carry the inline bootstrap