Skip to content

Commit c9c9306

Browse files
authored
Merge pull request #7 from bigsmartben/extension-release-v2.0.2
Update repository-governance extension to v2.0.2
2 parents 17a9559 + f7f547b commit c9c9306

11 files changed

Lines changed: 164 additions & 605 deletions

extensions/catalog.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"repository-governance": {
6666
"name": "Repository Governance",
6767
"id": "repository-governance",
68-
"version": "2.0.0",
69-
"description": "Generate Repository Governance Framework files with vertical SSOT routing and evidence",
68+
"version": "2.0.2",
69+
"description": "Generate Repository Governance Framework files from Spec Kit metadata",
7070
"author": "bigben",
7171
"repository": "https://github.com/bigsmartben/spec-kit-agent-governance",
7272
"license": "MIT",

extensions/repository-governance/.extensionignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.git/
22
.github/
3+
docs/
34
AGENTS.md
45
pyproject.toml
56
uv.lock

extensions/repository-governance/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ __pycache__/
55
.venv/
66
dist/
77
*.zip
8+
.worktrees/

extensions/repository-governance/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
## Unreleased
44

5+
### Fixed
6+
7+
- Keep spec-kit integration PR sync aligned with the runtime extension package boundary and current spec-kit test node ids.
8+
9+
## [2.0.2] - 2026-06-03
10+
11+
### Fixed
12+
13+
- Fix release workflow smoke installation after `v2.0.1` failed before artifact publication when Spec Kit already installs the bundled repository-governance extension and projects Codex commands as `.agents/skills`.
14+
- Allow tag release artifact publication to complete when the optional spec-kit integration PR token is unavailable.
15+
16+
## [2.0.1] - 2026-06-03
17+
18+
### Added
19+
20+
- Add GitHub Actions contract CI for repository governance validation.
21+
- Add a release artifact workflow that builds a deterministic runtime extension zip, smoke-installs the extension, and can open the bundled `bigsmartben/spec-kit` integration PR.
22+
- Document the local extension package build command for `dist/repository-governance.zip`.
23+
- Add repository extension governance documentation for command, template, script, path-safety, package-boundary, and verification rules.
24+
- Add a Spec Kit Agent Adapter layer and scenario capability index for repository-local skills and MCP-backed external tool evidence, with MCP config candidates treated as evidence only and runtime enumeration required before use.
25+
526
## [2.0.0] - 2026-05-25
627

728
### Changed

extensions/repository-governance/README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Generate the active Repository Governance Framework SSOT section.
1313
- Update existing target governance file.
1414
- Distill detected repository areas into action rules.
1515
- Capture repository facts as vertical SSOT evidence.
16+
- Project agent platform adapter rules from Spec Kit integration metadata.
17+
- Build a scenario capability index for repository-local skills and MCP-backed external tool evidence.
1618
- Analyze repository areas to depth 2 only.
1719
- Include hidden and cache directories in repository area governance.
1820
- Enforce one primary responsibility per directory.
@@ -24,7 +26,7 @@ Generate the active Repository Governance Framework SSOT section.
2426
## Install
2527

2628
```bash
27-
specify extension add repository-governance --from https://github.com/bigsmartben/spec-kit-agent-governance/archive/refs/tags/v2.0.0.zip
29+
specify extension add repository-governance --from https://github.com/bigsmartben/spec-kit-agent-governance/archive/refs/tags/v2.0.2.zip
2830
```
2931

3032
Local development:
@@ -45,6 +47,14 @@ Helper:
4547
uv run python .specify/extensions/repository-governance/scripts/refresh_repository_governance.py
4648
```
4749

50+
## Build
51+
52+
```bash
53+
rm -f dist/repository-governance.zip
54+
mkdir -p dist
55+
zip -qr dist/repository-governance.zip extension.yml commands scripts templates -x '*/__pycache__/*' '*.pyc'
56+
```
57+
4858
## Files
4959

5060
- `extension.yml`
@@ -59,10 +69,19 @@ uv run python .specify/extensions/repository-governance/scripts/refresh_reposito
5969
- Code Style SSOT evidence from formatter, lint, type-check, and test configuration.
6070
- Directory Structure SSOT evidence from repository areas scanned to depth 2.
6171
- Toolchain SSOT evidence from manifests, lockfiles, Docker, compose, and task runner files.
62-
- Agent Harness SSOT evidence from active agent context files, repository-local skills, and MCP configs.
72+
- Agent Harness SSOT evidence from active agent context files, repository-local skills, and MCP config candidates.
73+
74+
## Agent Adapter
75+
76+
- Repository Capability: abstract repository-local skill specs and MCP evidence into scenario-level capabilities.
77+
- Spec Kit Agent Adapter: map the active integration to the context target and supported discovery behavior.
78+
- Platform Projection: emit only rules the active agent context file can safely apply.
79+
80+
Repository-local `SKILL.md` files are indexed by declared name, description, trigger, and source path. MCP config files are reported as candidates and evidence only; active servers, resources, and tools must be enumerated from the agent platform runtime before use.
6381

6482
## Verify
6583

6684
```bash
85+
uv run python -m py_compile scripts/refresh_repository_governance.py tests/test_governance_domains.py
6786
uv run pytest -q
6887
```

extensions/repository-governance/commands/speckit.repository-governance.refresh.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,17 @@ $ARGUMENTS
3535
- Directory Structure evidence
3636
- Toolchain evidence
3737
- Agent Harness evidence
38-
9. Preserve content outside managed markers.
39-
10. Preserve managed markers verbatim.
40-
11. Run:
38+
9. Resolve the Spec Kit Agent Adapter for the active integration.
39+
- context target
40+
- repository-local skill discovery behavior
41+
- MCP runtime discovery behavior
42+
- repository MCP config candidates as evidence only
43+
10. Project the scenario capability index.
44+
- repository-local skill capabilities from `SKILL.md` name, description, trigger, and source path
45+
- MCP-backed external tool capability with runtime enumeration before use
46+
11. Preserve content outside managed markers.
47+
12. Preserve managed markers verbatim.
48+
13. Run:
4149

4250
```bash
4351
uv run python .specify/extensions/repository-governance/scripts/refresh_repository_governance.py

extensions/repository-governance/extension.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ schema_version: "1.0"
33
extension:
44
id: repository-governance
55
name: "Repository Governance"
6-
version: "2.0.0"
6+
version: "2.0.2"
77
description: "Generate Repository Governance Framework files from Spec Kit metadata"
88
author: "bigben"
99
repository: "https://github.com/bigsmartben/spec-kit-agent-governance"

extensions/repository-governance/pyproject.toml

Lines changed: 0 additions & 14 deletions
This file was deleted.

extensions/repository-governance/scripts/refresh_repository_governance.py

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,12 @@ def render_projection(root: Path, target: Path, state: dict[str, Any], created_m
485485
f"- MCP configs: {', '.join(scan_mcp_configs(root)) or 'none'}",
486486
f"- Extensions config: .specify/extensions.yml ({extensions_status(root)})",
487487
"",
488+
"## Agent Platform Adapter",
489+
*agent_adapter_lines(root, target, default_key),
490+
"",
491+
"## Capability Index",
492+
*capability_index_lines(root),
493+
"",
488494
"## Repository Evidence",
489495
*section_or_default(source_text, ["## Repository Evidence"], repository_evidence_default()),
490496
"",
@@ -773,12 +779,95 @@ def scan_skills(root: Path) -> list[str]:
773779
return sorted(rel(root, path) for path in root.rglob("SKILL.md") if not ignored(path))
774780

775781

782+
def skill_capability_lines(root: Path) -> list[str]:
783+
lines: list[str] = []
784+
for path_text in scan_skills(root):
785+
path = root / path_text
786+
fields = skill_frontmatter(path)
787+
name = fields.get("name") or fallback_skill_name(path_text)
788+
description = fields.get("description") or f"Repository-local skill spec at {path_text}."
789+
lines.extend(
790+
[
791+
f"- Repository capability: {name}",
792+
f" - Scenario: {description}",
793+
f" - Source: `{path_text}`.",
794+
" - Runtime action: read matching skill before planning or editing.",
795+
]
796+
)
797+
return lines
798+
799+
800+
def skill_frontmatter(path: Path) -> dict[str, str]:
801+
try:
802+
lines = normalize_newlines(path.read_text(encoding="utf-8-sig")).splitlines()
803+
except (OSError, UnicodeDecodeError):
804+
return {}
805+
if not lines or lines[0].strip() != "---":
806+
return {}
807+
fields: dict[str, str] = {}
808+
for line in lines[1:]:
809+
if line.strip() == "---":
810+
break
811+
key, separator, value = line.partition(":")
812+
if not separator:
813+
continue
814+
key = key.strip()
815+
value = value.strip().strip("'\"")
816+
if key in {"name", "description"} and value:
817+
fields[key] = value
818+
return fields
819+
820+
821+
def fallback_skill_name(path_text: str) -> str:
822+
parent = Path(path_text).parent.name
823+
return parent or path_text.replace("/", "-")
824+
825+
826+
def capability_index_lines(root: Path) -> list[str]:
827+
mcp_configs = scan_mcp_configs(root)
828+
mcp_sources = format_values(mcp_configs) if mcp_configs else "none detected"
829+
lines = skill_capability_lines(root)
830+
lines.extend(
831+
[
832+
"- Repository capability: MCP-backed external tools",
833+
f" - Sources: MCP config candidates are evidence, not proof of active tools: {mcp_sources}.",
834+
" - Runtime action: enumerate available servers, resources, and tools before use.",
835+
]
836+
)
837+
return lines
838+
839+
840+
def agent_adapter_lines(root: Path, target: Path, integration: str) -> list[str]:
841+
lines = [
842+
"- Repository Capability layer: abstract repository-local abilities and evidence independent of agent runtime.",
843+
"- Agent Adapter layer: translate repository capabilities into platform-specific discovery and activation rules.",
844+
"- Platform Projection layer: render the active context target without claiming unavailable platform support.",
845+
f"- Active integration: {integration}",
846+
f"- Context target: {rel(root, target)}",
847+
]
848+
if integration == "codex":
849+
lines.extend(
850+
[
851+
"- Skill discovery: repository-local `SKILL.md` capability specs, sorted by path.",
852+
"- MCP discovery: platform runtime enumeration first; repository config candidates are evidence only unless supported by this adapter.",
853+
]
854+
)
855+
else:
856+
lines.extend(
857+
[
858+
"- Skill discovery: evidence-only repository scan; platform activation is integration-specific.",
859+
"- MCP discovery: platform-specific; repository config candidates are evidence only.",
860+
]
861+
)
862+
return lines
863+
864+
776865
def scan_mcp_configs(root: Path) -> list[str]:
777866
names = {".mcp.json", "mcp.json", "mcp.yml", "mcp.yaml", "mcp.config.json"}
778867
return sorted(
779868
rel(root, path)
780869
for path in root.rglob("*")
781-
if path.is_file() and not ignored(path) and (path.name in names or "mcp" in path.name.lower())
870+
if path.is_file() and not ignored(path) and path.name in names
782871
)
783872

784873

extensions/repository-governance/templates/repository-governance-template.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,29 @@ Sync Impact Report
7171
- Protected files: implementation, CI, MCP config, secrets, permissions, tool settings
7272
- Protected-file writes: explicit user request only
7373

74+
## Agent Platform Adapter
75+
76+
- Repository Capability: abstract repository-local skill and MCP evidence into scenario capabilities.
77+
- Spec Kit Agent Adapter: map integration metadata to the active agent context target and supported discovery behavior.
78+
- Platform Projection: emit only the rules the active agent context file can safely apply.
79+
80+
## Capability Index
81+
82+
- Repository-local skills: use when the task matches a declared skill name, description, or trigger.
83+
- MCP-backed external tools: use when the task needs external tool or resource access; enumerate runtime tools before use.
84+
- Repository config candidates are evidence only unless the active adapter supports them.
85+
7486
## Skill Contract
7587

76-
- Repository-local skill specs should declare purpose, trigger, allowed read paths, allowed write paths, forbidden paths, outputs, and validation command.
88+
- Repository-local skill specs should declare name, description or trigger, allowed read paths, allowed write paths, forbidden paths, outputs, and validation command.
89+
- Read matching `SKILL.md` files before planning or editing.
7790

7891
## MCP Policy
7992

8093
- Default: read-only
8194
- Mutation: explicit user intent
95+
- Runtime discovery: enumerate available servers, resources, and tools before use.
96+
- Config candidates: evidence only, not proof of active tools.
8297
- External writes: target, action, result
8398
- Secrets: never log, never write
8499

0 commit comments

Comments
 (0)