feat(cli): add --skip-skills and --index-only flags to analyze#742
feat(cli): add --skip-skills and --index-only flags to analyze#742achianuri wants to merge 1 commit intoabhigyanpatwari:mainfrom
Conversation
|
@achianuri is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
|
Good work! Hope this gets merged soon |
|
nice! |
|
Please rebase your changes on the |
The `installSkills()` call in `generateAIContextFiles()` runs unconditionally, injecting 6 skill files into `.claude/skills/gitnexus/` even when `--skip-agents-md` is passed. This is problematic for bulk indexing operations on read-only mirrors or third-party repos. Add two new flags: - `--skip-skills`: suppress standard GitNexus skill file injection - `--index-only`: pure index mode that suppresses all file injection (AGENTS.md, CLAUDE.md, and skills), writing only to `.gitnexus/` This gives users three levels of control: - `--skip-agents-md` — suppress only root context files - `--skip-skills` — suppress only skill injection - `--index-only` — suppress everything (pure indexing) Discovery context: while bulk-indexing 176 repos with `--skip-agents-md`, all 144 indexed repos were contaminated with `.claude/skills/gitnexus/` files requiring manual cleanup.
2ba5d44 to
4ce3f19
Compare
|
Rebased on latest |
|
@magyargergo please review new change and merge soon, thanks! |
|
Claude finished @magyargergo's task in 3m 15s —— View job PR #742 Review: feat(cli): add --skip-skills and --index-only flags to analyzeTasks:
Review bar for this PRTailored from
Understanding of the changeUser problem: Affected file-writing paths:
Flags added:
Behavior that must stay unchanged: default analyze (no flags), Findings[high] No tests for
|
| DoD item | Status |
|---|---|
--skip-skills suppresses installSkills() through the full call chain |
satisfied |
--index-only resolves into both skipAgentsMd=true and skipSkills=true |
satisfied (for the non---skills path) |
--index-only prevents ALL non-.gitnexus/ writes |
partially satisfied — fails when combined with --skills |
Existing --skip-agents-md behavior unchanged |
satisfied |
| Option propagation uses resolved values (not raw) everywhere | satisfied |
| Tests verify no filesystem side effects when flags are set | not satisfied |
Typecheck passes (npx tsc --noEmit) |
not verifiable from diff — CI status unclear |
| AGENTS.md/CLAUDE.md content is consistent with installed files | not satisfied (--skip-skills leaves stale skill references) |
Validation assessment
- Tests added/updated: None. The PR description's test checklist is prose description, not automated tests.
- Validation claimed by PR: Prose checklist only; all items unchecked at submission.
- Validation verified from diff/CI evidence:
ci-quality.yml(typecheck + lint) is not clearly passing from the available CI run data.ci-tests.yml(vitest) — no evidence of a passing run against this branch. - Missing/not-verifiable:
npx tsc --noEmitingitnexus/— not verifiable- Unit tests for
generateAIContextFiles({ skipSkills: true })— absent - Integration test for
--skip-skills/--index-onlyfilesystem side effects — absent - Test for
--index-only --skillsnot contaminating repos — absent
- Whether missing validation blocks production readiness: Yes. Per
CONTRIBUTING.md: "Tests pass for the packages you touched." Theai-context.tstest suite (test/unit/ai-context.test.ts) testsskipAgentsMdwith filesystem assertions but has no equivalent forskipSkills. This is the minimum regression test needed for the fix.
Final verdict
not production-ready
The core option plumbing is correct and the primary bug (standard skills injected during --skip-agents-md bulk indexing) is fixed. However, three issues block merge: (1) no tests asserting the filesystem state when skipSkills=true — the repo's own CONTRIBUTING.md requires tests to pass for touched packages, and this fix is specifically about filesystem contamination; (2) --index-only --skills still writes community skill files, violating the "skip ALL file injection" contract; (3) --skip-skills without --skip-agents-md produces AGENTS.md/CLAUDE.md that references non-existent skill files. Issues (2) and (3) are each a one-line fix; issue (1) requires adding 2–3 test cases to the existing ai-context.test.ts. The PR is close — these are all small, targeted changes.
Suggested fixes before merge:
- Fix this → — Add
skipSkillsfilesystem tests toai-context.test.ts - Fix this → — Gate
generateSkillFiles()with!skipAllinanalyze.ts - Fix this → — Omit skills table in
generateGitNexusContent()whenskipSkills=true
CI Report❌ Some checks failed Pipeline Status
Test Results
✅ All 6884 tests passed 97 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
Summary
gitnexus analyze --skip-agents-mdcorrectly suppresses AGENTS.md/CLAUDE.md, but unconditionally injects 6 skill files into.claude/skills/gitnexus/in every analyzed repo--skip-skills— suppress standard GitNexus skill file injection--index-only— pure index mode: skip all file injection (AGENTS.md, CLAUDE.md, skills), writing only to.gitnexus/Motivation
While bulk-indexing 176 repos with
--skip-agents-md, all 144 indexed repos were contaminated with.claude/skills/gitnexus/files that had to be cleaned up manually. The--skip-agents-mdflag name implies it controls all AI context injection, but skills bypass it entirely.Changes
src/cli/index.ts--skip-skillsand--index-onlyCLI optionssrc/cli/analyze.ts--index-onlyinto both skip flags, pass through call chainsrc/core/run-analyze.tsskipSkillstoAnalyzeOptions, pass togenerateAIContextFilessrc/cli/ai-context.tsskipSkillstoAIContextOptions, guardinstallSkills()callThree levels of control
Test plan
gitnexus analyze .creates AGENTS.md, CLAUDE.md, and 6 skill dirs--skip-skills: AGENTS.md/CLAUDE.md created, no.claude/skills/gitnexus/--skip-agents-md: skills created, no AGENTS.md/CLAUDE.md--index-only: only.gitnexus/created, nothing else--skills --skip-skills: community-derived skills also suppressed