This commit is contained in:
eddiesoehnel committed 2026-07-24 15:14:23 -06:00
1 parent 614d235bbe
commit 1e52a733d1
29 files changed
+728 -66

No files matched your search

+28 -9
View File
@@ -18,16 +18,26 @@ Use `scripts/audit_repository.py` for a read-only baseline and final structural
## Phase 1: Inspect
1. Resolve the target repository and determine whether it is new or existing.
2. Begin with a short identity and publication round. Ask only for values the user has not already supplied:
2. If `repository-variables.json` exists, read it before the identity round.
Treat values with a verification source and date as defaults. Ask only about
missing, conflicting, explicitly unverified, or user-overridden values.
3. Begin with a short identity and publication round. Ask only for values the
user has not already supplied or verified:
- author or authors;
- publisher and maintainer;
- canonical repository URL;
- intended license.
3. If `AUTHOR.md` exists, read it first, present its values for confirmation, and ask only about missing or conflicting facts. Do not silently inherit identity from a template or source repository.
4. For an existing repository, inspect its files, Git status, documentation, manifests, tests, host configuration, and any `AGENTS.md` or equivalent instructions. Preserve unrelated user changes.
5. Infer the most suitable profile: documentation/guide, skill/workflow, software/automation, dataset, or a justified custom minimum.
6. Separate facts found in the repository from assumptions and recommendations.
7. Run the read-only audit when Python is available. Record failures as planning inputs, not as permission to change files.
4. If `AUTHOR.md` exists, read it and compare it with
`repository-variables.json`. Ask only about missing or conflicting facts. Do
not silently inherit identity from a template or source repository.
5. For an existing repository, inspect its files, Git status, documentation,
manifests, tests, host configuration, and any `AGENTS.md` or equivalent
instructions. Preserve unrelated user changes.
6. Infer the most suitable profile: documentation/guide, skill/workflow,
software/automation, dataset, or a justified custom minimum.
7. Separate facts found in the repository from assumptions and recommendations.
8. Run the read-only audit when Python is available. Record failures as
planning inputs, not as permission to change files.
## Phase 2: Write the review plan
@@ -84,14 +94,22 @@ If implementation requires a material departure from the approved plan, update t
- provide scoped agent instructions in the repository's established agent-instruction file;
- index skills, scripts, templates, schemas, data, and examples when they exist.
- create or update `UPDATES.md` for future notes and proposals, while keeping completed versioned changes in `CHANGELOG.md`.
- create `AUTHOR.md` as the canonical human-readable attribution file and keep it aligned with `repository.json`, `CITATION.cff`, and `LICENSE`.
- create `AUTHOR.md` as the canonical human-readable attribution file and
keep it aligned with `repository-variables.json`, `repository.json`,
`CITATION.cff`, and `LICENSE`.
- create or update `repository-variables.json` with verified stable identity,
repository, rights, profile, and workflow defaults; add it to agent read
order before `repository.json`. Omit optional unknown values or use `null`
where the schema permits; never invent an organization.
7. Use placeholders only when the user has not supplied a value and the placeholder is visibly marked. Never invent URLs, maintainers, licenses, security contacts, provenance, or credentials.
8. Do not create commits, branches, remotes, releases, or hosting-platform settings unless the user separately requested them.
## Phase 5: Validate and record
1. Run `scripts/audit_repository.py` with the approved profile.
2. Parse machine-readable files and check version alignment, internal paths, and declared entry points.
2. Parse machine-readable files and check
`repository-variables.json` alignment, version alignment, internal paths, and
declared entry points.
3. Run relevant repository-native tests, linters, schema checks, and link checks that can safely run.
4. Search created examples and receipts for secrets, personal data, and organization-specific residue.
5. Confirm that `UPDATES.md` contains future planning notes only and is not presented as approval or completed work.
@@ -108,7 +126,8 @@ Record the approved revision, actual actions, deviations, commands, results, unr
Report:
- the verified author, publisher, maintainer, canonical URL, and license;
- the verified author, publisher, maintainer, canonical URL, license, and
`repository-variables.json` source;
- the selected profile and resulting entry points;
- created, modified, preserved, moved, and intentionally omitted files;
- validation results and anything not tested;
@@ -23,7 +23,8 @@
- Maintainer: `[verified name]`
- Canonical repository URL: `[verified URL or explicitly unset]`
- License: `[verified license or decision required]`
- Identity source: `[user response | AUTHOR.md | other verified source]`
- Repository variables: `[path, values used, or not present]`
- Identity source: `[user response | repository-variables.json | AUTHOR.md | other verified source]`
## Current State
@@ -64,6 +65,7 @@ Allowed actions: `create`, `preserve`, `modify`, `move`, `deprecate`, `leave abs
- Human starts at: `[path]`
- AI agent starts at: `[path]`
- Authoritative manifest: `[path]`
- Verified repository variables: `[path]`
- Retrieve next: `[ordered paths]`
## Hosting Platform Choices
@@ -74,6 +76,8 @@ Allowed actions: `create`, `preserve`, `modify`, `move`, `deprecate`, `leave abs
- [ ] Required files contain project-specific, accurate content.
- [ ] Machine-readable files parse and agree with authoritative values.
- [ ] `repository-variables.json` contains verified stable inputs and agrees
with attribution, manifest, citation, and license files.
- [ ] Declared paths and internal links resolve.
- [ ] Version references align.
- [ ] Relevant project-native tests pass.
@@ -43,6 +43,7 @@ repository-name/
│
├── README.md
├── AUTHOR.md
├── repository-variables.json
├── repository.json
├── LICENSE
├── CHANGELOG.md
@@ -119,6 +120,7 @@ The following root files should normally exist in every public repository:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -261,7 +263,47 @@ It should state:
Confirm these values with the user at the beginning of repository creation or restructuring. If an existing `AUTHOR.md` is present, present its values for confirmation rather than silently inheriting them.
Keep `AUTHOR.md`, `repository.json`, `CITATION.cff`, and `LICENSE` aligned. Never leave a source-template author attached to a derived repository unless that attribution remains accurate.
Keep `repository-variables.json`, `AUTHOR.md`, `repository.json`,
`CITATION.cff`, and `LICENSE` aligned. Never leave a source-template author
attached to a derived repository unless that attribution remains accurate.
---
## `repository-variables.json`
### Purpose
Stores verified stable inputs that repository-structure skills and future
maintainers can reuse without repeatedly asking for the same facts.
Every supported repository profile should include this file. It should contain:
* Repository profile.
* Author or authors.
* Publisher and maintainer.
* Stable repository ID, name, title, canonical URL, and organization when
applicable.
* License and license-file path.
* Repository-skill defaults, including approval and preservation behavior.
* Verification source and date.
### Rules
Read this file before an identity and publication round. Treat its values as
defaults only when a verification source and date are present. Ask about values
that are missing, conflicting, explicitly unverified, or overridden by the
user.
Keep dynamic release values such as the current version out of this file; their
authoritative sources remain `VERSION`, `repository.json`, `CITATION.cff`, and
`CHANGELOG.md`.
When verified identity, repository, or rights values change, update
`repository-variables.json`, `AUTHOR.md`, `repository.json`, `CITATION.cff`, and
`LICENSE` together.
Use `templates/repository-variables.json.template` and validate against
`schemas/repository-variables.schema.json`.
---
@@ -449,7 +491,9 @@ Do not include comments, trailing commas, Markdown, or JSON5 syntax.
"ai_retrieval": {
"read_first": [
"README.md",
"AUTHOR.md"
"AUTHOR.md",
"repository-variables.json",
"repository.json"
],
"retrieve_as_needed": [],
"exclude_by_default": [
@@ -901,9 +945,11 @@ Markdown.
## Read Order
1. `README.md`
2. `repository.json`
3. Relevant files listed in `entrypoints`
4. Supporting documentation only as needed
2. `AUTHOR.md`
3. `repository-variables.json`
4. `repository.json`
5. Relevant files listed in `entrypoints`
6. Supporting documentation only as needed
## Task Routing
@@ -1640,6 +1686,7 @@ Required:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -1668,6 +1715,7 @@ Required:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -1700,6 +1748,7 @@ Required:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -1733,6 +1782,7 @@ Required:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -1912,6 +1962,8 @@ Before publishing a new repository:
[ ] Hosting-platform description is complete.
[ ] hosting-platform topics are assigned.
[ ] README explains the purpose, users, process, inputs, and outputs.
[ ] repository-variables.json contains verified identity, repository, rights,
profile, workflow defaults, and verification metadata.
[ ] AUTHOR.md contains verified author, publisher, maintainer, canonical URL, and adaptation guidance.
[ ] repository.json is complete and valid JSON.
[ ] repository_id is stable and unique.
@@ -1941,6 +1993,7 @@ For the first implementation, every repository should begin with:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -14,6 +14,7 @@ PROFILES = {
"documentation-guide": {
"README.md",
"AUTHOR.md",
"repository-variables.json",
"repository.json",
"LICENSE",
"CHANGELOG.md",
@@ -25,6 +26,7 @@ PROFILES = {
"skill-workflow": {
"README.md",
"AUTHOR.md",
"repository-variables.json",
"repository.json",
"LICENSE",
"CHANGELOG.md",
@@ -39,6 +41,7 @@ PROFILES = {
"software-automation": {
"README.md",
"AUTHOR.md",
"repository-variables.json",
"repository.json",
"LICENSE",
"CHANGELOG.md",
@@ -54,6 +57,7 @@ PROFILES = {
"dataset": {
"README.md",
"AUTHOR.md",
"repository-variables.json",
"repository.json",
"LICENSE",
"CHANGELOG.md",
@@ -133,6 +137,104 @@ def audit(root: Path, profile: str) -> dict:
else:
findings.append({"level": "error", "message": "entrypoints must be an object"})
variables_path = root / "repository-variables.json"
variables = None
if variables_path.is_file():
try:
variables = json.loads(variables_path.read_text(encoding="utf-8-sig"))
except (OSError, UnicodeError, json.JSONDecodeError) as exc:
findings.append(
{"level": "error", "message": f"repository-variables.json is invalid: {exc}"}
)
else:
for key in (
"schema_version",
"repository_profile",
"identity",
"repository",
"rights",
"skill_defaults",
"verified_by",
"verified_at",
):
if key not in variables:
findings.append(
{
"level": "error",
"message": f"repository-variables.json lacks key: {key}",
}
)
if manifest and variables:
identity = variables.get("identity", {})
variable_authors = [
item.get("name")
for item in identity.get("authors", [])
if isinstance(item, dict)
]
manifest_authors = [
item.get("name")
for item in manifest.get("authors", [])
if isinstance(item, dict)
]
comparisons = (
("authors", variable_authors, manifest_authors),
(
"publisher",
identity.get("publisher", {}).get("name"),
manifest.get("publisher", {}).get("name"),
),
(
"maintainer",
identity.get("maintainer", {}).get("name"),
manifest.get("maintenance", {}).get("maintainer"),
),
(
"repository",
variables.get("repository"),
{
key: manifest.get(key)
for key in (
"repository_id",
"name",
"title",
"canonical_url",
"organization",
)
},
),
(
"rights",
variables.get("rights"),
{
key: manifest.get("rights", {}).get(key)
for key in ("license", "license_file")
},
),
)
for label, variable_value, manifest_value in comparisons:
if variable_value != manifest_value:
findings.append(
{
"level": "error",
"message": (
f"{label} differs between repository-variables.json "
"and repository.json"
),
}
)
if variables and variables.get("repository_profile") != profile:
findings.append(
{
"level": "error",
"message": (
"repository_profile differs between repository-variables.json "
f"({variables.get('repository_profile')}) and requested audit ({profile})"
),
}
)
version_path = root / "VERSION"
version = version_path.read_text(encoding="utf-8-sig").strip() if version_path.is_file() else None
if version and manifest and manifest.get("version") != version: