mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 20:36:23 +08:00
Add TomlIntegration base class in base.py that mirrors MarkdownIntegration:
- Overrides command_filename() for .toml extension
- Extracts description from YAML frontmatter for top-level TOML key
- Renders prompt body in TOML multiline basic strings with escaped backslashes
- Keeps full processed template (including frontmatter) as prompt body
- Byte-for-byte parity with v0.4.4 release ZIP output
Create integrations/gemini/ and integrations/tabnine/ subpackages:
- Config-only __init__.py subclassing TomlIntegration
- Integration-specific update-context scripts (sh + ps1)
Add TomlIntegrationTests mixin with TOML-specific validations:
- Valid TOML parsing, description/prompt keys, {{args}} placeholder
- Setup/teardown, manifest tracking, install/uninstall round-trips
- CLI auto-promote (--ai) and --integration flag tests
- Complete file inventory tests (sh + ps)
Register both in INTEGRATION_REGISTRY; --ai auto-promote works automatically.
24 lines
1.1 KiB
PowerShell
24 lines
1.1 KiB
PowerShell
# update-context.ps1 — Gemini CLI integration: create/update GEMINI.md
|
|
#
|
|
# Thin wrapper that delegates to the shared update-agent-context script.
|
|
# Activated in Stage 7 when the shared script uses integration.json dispatch.
|
|
#
|
|
# Until then, this delegates to the shared script as a subprocess.
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
# Derive repo root from script location (walks up to find .specify/)
|
|
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
|
$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
|
|
# If git did not return a repo root, or the git root does not contain .specify,
|
|
# fall back to walking up from the script directory to find the initialized project root.
|
|
if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
|
|
$repoRoot = $scriptDir
|
|
$fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
|
|
while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
|
|
$repoRoot = Split-Path -Parent $repoRoot
|
|
}
|
|
}
|
|
|
|
& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType gemini
|