3 Commits
Author SHA1 Message Date
eddiesoehnel bd8f9a641f added 2026-07-24 16:17:28 -06:00
eddiesoehnel 1e52a733d1 added 2026-07-24 15:14:23 -06:00
eddiesoehnel 614d235bbe added 2026-07-23 14:19:12 -06:00
37 changed files with 1672 additions and 149 deletions

No files matched your search

+13 -4
View File
@@ -6,9 +6,11 @@ Read, in order:
1. `README.md`
2. `AUTHOR.md`
3. `repository.json`
4. `skills.md`
5. The relevant skill or documentation for the task
3. `repository-variables.json`
4. `repository.json`
5. `content-index.json` when retrieving an individual document
6. `skills.md`
7. The relevant skill or documentation for the task
## Repository Purpose
@@ -19,7 +21,11 @@ This repository defines and validates a platform-neutral structure for human- an
- Preserve accurate existing content and stable identifiers.
- Use the smallest repository profile that fits the target.
- Do not invent maintainers, publication URLs, licenses, security contacts, provenance, or credentials.
- Keep `AUTHOR.md`, `repository.json`, `CITATION.cff`, and `LICENSE` attribution aligned.
- Keep `repository-variables.json`, `AUTHOR.md`, `repository.json`,
`CITATION.cff`, and `LICENSE` attribution aligned.
- Treat verified values in `repository-variables.json` as defaults for
repository-structure work. Ask only about missing, conflicting, or explicitly
unverified values.
- Treat `UPDATES.md` as proposed future work, not authorization.
- Record completed versioned changes in `CHANGELOG.md`.
- Keep `VERSION`, `repository.json`, `CITATION.cff`, and release notes aligned.
@@ -46,6 +52,9 @@ Also validate any modified skill with the available Codex skill validator.
## File-Specific Guidance
- Update `schemas/repository.schema.json` when the manifest contract changes.
- Update `schemas/content-index.schema.json` when the document-index contract changes.
- Update `schemas/repository-variables.schema.json` when the reusable variables
contract changes.
- Update both the skill reference and root documentation when the repository standard changes.
- Update validator tests when requirements change.
- Keep Git-host files under the correct host-specific directory.
+2 -1
View File
@@ -31,7 +31,8 @@ https://projects.eddiesoehnel.com/adminprojects/repo-template
When using this repository as the basis for another repository:
1. replace the author, publisher, and maintainer values in this file;
2. update `repository.json`, `CITATION.cff`, and `LICENSE` to match;
2. update `repository-variables.json`, `repository.json`, `CITATION.cff`, and
`LICENSE` to match;
3. update the canonical repository URL;
4. verify the license is appropriate for the new repository;
5. run the repository validator.
+34
View File
@@ -14,6 +14,40 @@ All notable released changes to this repository are documented here.
### Security
## [0.3.0] - 2026-07-24
### Added
- Optional `content-index.json` file-level discovery layer for repositories
containing recurring or numerous individual documents.
- Draft 2020-12 content-index schema, reusable template, synthetic example, and
working reference index.
- Dependency-free validation for required fields, unique content IDs and paths,
indexed-file existence, safe relative paths, and related-content references.
- Content-index coverage in the reusable repository audit and unit tests.
### Changed
- Repository standard, skill, architecture, implementation guide, glossary,
retrieval order, and examples now distinguish repository-level metadata from
individual-document indexing.
## [0.2.0] - 2026-07-24
### Added
- Required `repository-variables.json` for verified stable identity,
publication, rights, profile, and repository-skill defaults.
- Reusable variables template and Draft 2020-12 JSON Schema.
- Variable alignment checks in the profile audit, root validator, and tests.
### Changed
- Repository-structure skill now reads verified variables before asking identity
questions and creates or updates the file for every supported profile.
- Documentation, agent retrieval order, and repository templates now treat the
variables file as a standard root entry point.
## [0.1.0] - 2026-07-23
### Added
+2 -2
View File
@@ -2,8 +2,8 @@ cff-version: 1.2.0
message: "If you use this repository template, please cite it using this metadata."
title: "AI-Ready Repository Template"
type: software
version: 0.1.0
date-released: 2026-07-23
version: 0.3.0
date-released: 2026-07-24
authors:
- family-names: "Soehnel"
given-names: "Eddie"
+204 -106
View File
@@ -1,160 +1,258 @@
# AI-Ready Repository Template
A platform-neutral repository standard and reusable AI skill for creating repositories that humans and AI agents can discover, understand, validate, and reuse.
A platform-neutral repository standard, interactive AI skill, and validation toolkit for building repositories that humans and AI agents can discover, understand, safely modify, and reuse.
## What This Is
Authored and published by [Eddie Soehnel](AUTHOR.md).
This repository contains:
## What This Repository Provides
- a practical repository structure standard;
- a reusable skill that plans and builds the structure in new or existing repositories;
- machine-readable metadata and schema;
- templates, examples, validation scripts, and tests;
- contribution, security, versioning, and future-update guidance.
This repository is a working reference implementation of its own standard. It combines three layers:
The standard supports documentation, AI skill/workflow, software/automation, and dataset repositories. It is intentionally modular: use the smallest profile that accurately represents the project.
1. **Repository standard** — defines recommended files, metadata, entry points, profiles, safety boundaries, and validation expectations.
2. **Interactive AI skill** — assesses a new or existing repository, proposes the right structure, waits for approval by default, then creates and validates the approved assets.
3. **Deterministic validation** — checks required paths, metadata, attribution, versions, entry points, declared contents, licenses, and relative links.
## Problem It Solves
For content-heavy repositories, the standard also defines
`content-index.json`: a compact file-level catalog that keeps recurring
updates, articles, research, policies, and other document collections out of
the repository-level manifest.
Repositories often make sense to their original author but leave future maintainers and AI agents guessing about purpose, authoritative files, setup, inputs, outputs, validation, licensing, and safe operating boundaries. This template makes those expectations explicit and machine-findable.
It can be used as:
- a template for a new repository;
- a correction framework for an existing repository;
- a reusable skill given to an AI agent;
- a reference standard for repository consistency and AI findability.
## Why It Exists
Repositories often depend on knowledge held by their original author. A new maintainer—or an AI agent—may not know:
- what the repository is for;
- where to begin;
- which files are authoritative;
- what inputs and outputs are expected;
- what may be safely changed;
- how identity, licensing, and versioning should be handled;
- how to determine whether the repository is complete.
This template makes those answers explicit, structured, and testable.
## Who It Is For
- People starting a new repository.
- Maintainers correcting an inconsistent existing repository.
- Teams publishing reusable prompts, skills, agents, workflows, templates, data, or software.
- AI agents that need predictable entry points and approval boundaries.
- Maintainers cleaning up or standardizing an existing repository.
- Teams publishing AI skills, prompts, agents, workflows, templates, data, documentation, or software.
- AI agents that need predictable entry points, verified attribution, and clear approval boundaries.
## What It Helps You Do
## Quick Start
- Select an appropriate repository profile.
- Inventory and preserve useful existing content.
- Propose exact file actions before restructuring a live repository.
- Create human and AI entry points.
- Add machine-readable metadata.
- Validate required paths, versions, links, and entrypoints.
- Record future changes in `UPDATES.md` without confusing them with released changes.
### Use the AI skill
## Repository Contents
Give your AI agent access to:
| Path | Purpose |
| --- | --- |
| `repository.json` | Authoritative machine-readable repository manifest. |
| `AUTHOR.md` | Canonical author, publisher, maintainer, and attribution guidance. |
| `AGENTS.md` | Instructions for AI agents working in this repository. |
| `skills.md` | Index of reusable skills. |
| `skills/structure-ai-ready-repository/` | Skill that assesses, plans, builds, and validates repository structure. |
| `docs/` | Architecture, implementation guidance, and glossary. |
| `templates/` | Reusable repository metadata and update-note templates. |
| `examples/` | Synthetic examples showing completed artifacts. |
| `schemas/` | JSON Schema for `repository.json`. |
| `scripts/` | Deterministic repository validation. |
| `tests/` | Automated validation tests. |
| `UPDATES.md` | Notes and proposed changes to consider in future repository revisions. |
| `CHANGELOG.md` | Versioned record of changes already released. |
[`skills/structure-ai-ready-repository/SKILL.md`](skills/structure-ai-ready-repository/SKILL.md)
## How To Use It
Then ask:
### With an AI agent
```text
Use $structure-ai-ready-repository to build or correct this repository.
```
1. Give the agent access to `skills/structure-ai-ready-repository/SKILL.md`.
2. Ask it to apply `$structure-ai-ready-repository` to a new or existing repository.
3. By default, review the generated `tasks/<task-id>/repository-structure-plan.md`.
4. Amend or explicitly approve the current plan revision.
5. Let the skill implement and validate only the approved actions.
The skill will normally:
The plan gate may be bypassed only when the user explicitly directs the agent to implement immediately and the platform's safety and permission rules allow it.
1. read `repository-variables.json` when present;
2. confirm only missing or conflicting author, publisher, maintainer, canonical
URL, and license values;
3. inspect the target repository and preserve useful existing content;
4. select the smallest appropriate repository profile;
5. create `tasks/<task-id>/repository-structure-plan.md`;
6. wait for review, amendments, and explicit approval;
7. implement only the approved file actions;
8. validate the completed repository and report the results.
### Manually
The planning gate can be bypassed only when the user explicitly authorizes immediate implementation and applicable safety and permission rules allow it.
1. Read `docs/implementation.md`.
2. Confirm author, publisher, maintainer, canonical URL, and license.
3. Create `AUTHOR.md`.
4. Choose the smallest applicable repository profile.
5. Copy and adapt the relevant files.
6. Replace all visible placeholders with verified project facts.
7. Run:
### Apply the standard manually
1. Read the [implementation guide](docs/implementation.md).
2. Confirm repository identity and publication facts.
3. Create or adapt
[`repository-variables.json`](repository-variables.json).
4. Create or adapt [AUTHOR.md](AUTHOR.md).
5. Select the smallest applicable repository profile.
6. Start from the files in [`templates/`](templates/README.md).
7. Replace every visible placeholder with verified information.
8. Run the validator and tests:
```text
python scripts/validate_repository.py .
python -m unittest discover -s tests -p "test_*.py"
```
## Repository Profiles
## Supported Repository Profiles
| Profile | Best for |
| Profile | Use for |
| --- | --- |
| Documentation/guide | Written standards, guides, playbooks, and research. |
| Documentation/guide | Standards, guides, playbooks, research, and educational material. |
| Skill/workflow | AI skills, prompts, agents, workflows, and reusable templates. |
| Software/automation | Executable applications, services, scripts, and automations. |
| Dataset | Versioned public or controlled datasets with provenance and schemas. |
| Software/automation | Applications, services, scripts, integrations, and operational automation. |
| Dataset | Versioned data with provenance, field definitions, limitations, and schemas. |
This repository implements the skill/workflow profile.
This repository implements the **skill/workflow** profile.
## Inputs Required
Profiles are minimum useful structures, not commands to create every possible folder. Omit files and directories that have no real purpose.
Applying the template requires:
## Repository Map
- the target repository path;
- verified author, publisher, and maintainer identity;
- the repository's purpose and intended users;
- known publication, license, maintainer, and canonical URL details;
- existing files and conventions that must be preserved;
- the desired repository profile or enough context to infer one.
### Start here
| Path | Purpose |
| --- | --- |
| [`README.md`](README.md) | Primary human overview and usage guide. |
| [`AUTHOR.md`](AUTHOR.md) | Canonical author, publisher, maintainer, and attribution record. |
| [`repository-variables.json`](repository-variables.json) | Verified stable identity, publication, rights, profile, and skill defaults. |
| [`repository.json`](repository.json) | Authoritative machine-readable repository manifest. |
| [`content-index.json`](content-index.json) | Machine-readable catalog of the principal individual documents in this content-heavy reference repository. |
| [`AGENTS.md`](AGENTS.md) | Repository-scoped operating instructions for AI agents. |
| [`skills.md`](skills.md) | Skill index, triggers, inputs, outputs, and approval requirements. |
### Standard and skill
| Path | Purpose |
| --- | --- |
| [`skills/structure-ai-ready-repository/SKILL.md`](skills/structure-ai-ready-repository/SKILL.md) | Interactive repository assessment and implementation workflow. |
| [`skills/structure-ai-ready-repository/references/repository-structure-standard.md`](skills/structure-ai-ready-repository/references/repository-structure-standard.md) | Detailed repository structure standard. |
| [`skills/structure-ai-ready-repository/assets/repository-structure-plan-template.md`](skills/structure-ai-ready-repository/assets/repository-structure-plan-template.md) | Review and approval plan template. |
| [`skills/structure-ai-ready-repository/scripts/audit_repository.py`](skills/structure-ai-ready-repository/scripts/audit_repository.py) | Read-only profile audit for target repositories. |
### Supporting resources
| Path | Purpose |
| --- | --- |
| [`docs/`](docs/README.md) | Architecture, implementation guidance, and glossary. |
| [`templates/`](templates/README.md) | Reusable variables, manifest, author, and future-update templates. |
| [`examples/`](examples/README.md) | Synthetic completed examples. |
| [`schemas/`](schemas/README.md) | JSON Schemas for the repository manifest, content index, and stable repository variables. |
| [`scripts/`](scripts/README.md) | Dependency-free validation for this repository. |
| [`tests/`](tests/README.md) | Automated repository validation tests. |
| [`data/`](data/README.md) | Rules for public data when a repository needs it. |
| [`receipts/`](receipts/README.md) | Guidance for sanitized execution records. |
| [`tasks/`](tasks/README.md) | Planning and execution records created by workflows. |
| [`assets/`](assets/README.md) | Images, diagrams, screenshots, and downloads. |
| [`.gitea/`](.gitea/PULL_REQUEST_TEMPLATE.md) | Gitea issue and pull-request templates. |
### Governance and lifecycle
| Path | Purpose |
| --- | --- |
| [`UPDATES.md`](UPDATES.md) | Unapproved notes and proposed future repository improvements. |
| [`CHANGELOG.md`](CHANGELOG.md) | Completed, versioned repository changes. |
| [`VERSION`](VERSION) | Deterministic current version. |
| [`CONTRIBUTING.md`](CONTRIBUTING.md) | Contribution standards and review workflow. |
| [`SECURITY.md`](SECURITY.md) | Vulnerability, privacy, credential, and AI-safety guidance. |
| [`CITATION.cff`](CITATION.cff) | Machine-readable citation metadata. |
| [`LICENSE`](LICENSE) | MIT License and copyright terms. |
## Inputs The Skill Needs
- Target repository path.
- Repository purpose and intended users.
- Existing `repository-variables.json`, when present.
- Verified author or authors.
- Publisher and maintainer.
- Canonical repository URL.
- Intended license.
- Existing files and conventions that must be preserved.
- Constraints, risks, and actions requiring human approval.
If an existing `AUTHOR.md` is present, the skill reads and confirms it rather than silently inheriting identity.
## Expected Outputs
- a reviewed repository structure;
Depending on the selected profile, the skill produces:
- clear human and AI entry points;
- accurate `repository.json` metadata;
- profile-appropriate documentation and indexes;
- validation results and, when the normal plan flow is used, task receipts.
- a verified, reusable `repository-variables.json`;
- verified author and publication metadata;
- a machine-readable `repository.json`;
- an optional `content-index.json` for repositories with recurring or numerous individual documents;
- profile-appropriate documentation, indexes, templates, examples, scripts, schemas, and tests;
- host-specific contribution files when relevant;
- validation results and, in the normal workflow, task plans and receipts.
## AI Usage Guidance
## AI Retrieval Order
Read files in this order:
An AI agent should read:
1. `README.md`
2. `AUTHOR.md`
3. `repository.json`
4. `AGENTS.md`
5. `skills.md`
6. `skills/structure-ai-ready-repository/SKILL.md`
7. Only the references, templates, scripts, or examples required for the current task
1. [`README.md`](README.md)
2. [`AUTHOR.md`](AUTHOR.md)
3. [`repository-variables.json`](repository-variables.json)
4. [`repository.json`](repository.json)
5. [`content-index.json`](content-index.json) when locating an individual document
6. [`AGENTS.md`](AGENTS.md)
7. [`skills.md`](skills.md)
8. The relevant skill
9. Only the references and supporting files required for the current task
Treat `UPDATES.md` as unapproved future work unless a user explicitly asks to implement an item. Treat `CHANGELOG.md` as the record of completed versioned changes.
Treat `UPDATES.md` as planning context, not authorization. Treat `CHANGELOG.md` as the record of completed versioned work.
## How To Adapt It
## Validation
Keep the core entry-point and metadata concepts stable, but tailor profiles, directories, host configuration, tests, and documentation to the repository's real purpose. Do not create unused folders merely to resemble the example tree.
The included validator is read-only and uses only the Python standard library:
## Limitations
```text
python scripts/validate_repository.py .
```
- This template does not choose a license, maintainer, security contact, or publication URL for you.
- Structural validation cannot prove that documentation is accurate or complete.
- Git-host configuration varies by platform.
- The included skill does not create commits, remotes, releases, or hosting settings unless separately requested.
It checks:
- required files and directories;
- JSON parsing and core manifest and repository-variable fields;
- alignment between reusable variables and repository metadata;
- author, publisher, maintainer, citation, and license alignment;
- human, AI, skill, script, and template entry points;
- declared content and retrieval paths;
- `content-index.json` required fields, unique IDs and paths, indexed-file existence, and related-content references;
- version and license consistency;
- relative Markdown links.
Run the unit tests with:
```text
python -m unittest discover -s tests -p "test_*.py"
```
Structural validation cannot prove that documentation is accurate, that a license is legally appropriate, or that external URLs are available. Human review and project-native tests remain necessary.
## Adapting This Repository
When using this template for another repository:
1. replace the verified values in `repository-variables.json`;
2. replace the identity values in `AUTHOR.md`;
3. align `repository.json`, `CITATION.cff`, and `LICENSE`;
4. decide whether the repository is content-heavy enough to require
`content-index.json`;
5. replace the canonical URL and hosting metadata;
6. choose the correct profile;
7. remove irrelevant example structure;
8. update tests and validation requirements;
9. run the complete validation workflow.
Do not leave Eddie Soehnel's identity on a derived repository unless that attribution remains accurate.
## Security And Privacy
Never add credentials, private keys, access tokens, customer information, regulated data, private logs, or production databases. Use placeholders in examples and external secret management for live systems. See `SECURITY.md`.
Never commit passwords, API keys, access tokens, private keys, customer information, regulated data, production logs, session cookies, or proprietary records. Use synthetic examples and external secret management.
## Version
See [SECURITY.md](SECURITY.md).
Current version: `0.1.0`. See `VERSION`, `CHANGELOG.md`, and `UPDATES.md`.
## Version, Author, And License
## Author And Publisher
- **Version:** `0.3.0`
- **Author, publisher, and maintainer:** Eddie Soehnel
- **License:** MIT
- **Canonical repository:** `https://projects.eddiesoehnel.com/adminprojects/repo-template`
Eddie Soehnel. See `AUTHOR.md` for canonical attribution and adaptation guidance.
## License
Licensed under the MIT License. See `LICENSE`.
## Contributing
See `CONTRIBUTING.md`.
## Canonical Repository
`https://projects.eddiesoehnel.com/adminprojects/repo-template`
See [AUTHOR.md](AUTHOR.md), [VERSION](VERSION), [CHANGELOG.md](CHANGELOG.md), [CITATION.cff](CITATION.cff), and [LICENSE](LICENSE).
+2
View File
@@ -27,5 +27,7 @@ Items here are not approved work, release commitments, or completed changes. Whe
## Completed Or Superseded
- 2026-07-24: Added required, schema-backed `repository-variables.json` support
across the standard, skill, templates, validation, and tests.
- 2026-07-23: Set Eddie Soehnel as author, publisher, and maintainer and added `AUTHOR.md`.
- 2026-07-23: Added `UPDATES.md` to the repository standard and implemented template.
+1 -1
View File
@@ -1 +1 @@
0.1.0
0.3.0
+108
View File
@@ -0,0 +1,108 @@
{
"$schema": "./schemas/content-index.schema.json",
"schema_version": "1.0",
"collection_id": "repo-template-documentation",
"title": "AI-Ready Repository Template Documentation",
"description": "Machine-readable index of the principal standards and implementation documents in this repository.",
"updated_at": "2026-07-24",
"items": [
{
"content_id": "repo-template-readme",
"title": "AI-Ready Repository Template",
"description": "Primary overview, usage guidance, repository map, and validation instructions.",
"content_type": "repository-overview",
"path": "README.md",
"canonical_url": null,
"published_at": "2026-07-23",
"updated_at": "2026-07-24",
"status": "published",
"author": "Eddie Soehnel",
"topics": [
"ai-findability",
"repository-structure"
],
"related_content_ids": [
"repository-structure-standard",
"repository-implementation-guide"
]
},
{
"content_id": "repository-structure-standard",
"title": "AI-Ready Repository Structure Standard",
"description": "Detailed decision standard for repository files, profiles, metadata, safety, validation, and AI retrieval.",
"content_type": "standard",
"path": "skills/structure-ai-ready-repository/references/repository-structure-standard.md",
"canonical_url": null,
"published_at": "2026-07-23",
"updated_at": "2026-07-24",
"status": "published",
"author": "Eddie Soehnel",
"topics": [
"ai-findability",
"repository-structure",
"repository-metadata"
],
"related_content_ids": [
"repo-template-readme",
"repository-implementation-guide"
]
},
{
"content_id": "repository-implementation-guide",
"title": "Implementation Guide",
"description": "Practical workflow for applying the repository standard to new and existing repositories.",
"content_type": "implementation-guide",
"path": "docs/implementation.md",
"canonical_url": null,
"published_at": "2026-07-23",
"updated_at": "2026-07-24",
"status": "published",
"author": "Eddie Soehnel",
"topics": [
"repository-implementation",
"repository-profiles"
],
"related_content_ids": [
"repository-structure-standard",
"repository-architecture"
]
},
{
"content_id": "repository-architecture",
"title": "Architecture",
"description": "Explains the separation between guidance, machine-readable contracts, reusable AI behavior, and deterministic validation.",
"content_type": "architecture",
"path": "docs/architecture.md",
"canonical_url": null,
"published_at": "2026-07-23",
"updated_at": "2026-07-24",
"status": "published",
"author": "Eddie Soehnel",
"topics": [
"repository-architecture",
"machine-readable-metadata"
],
"related_content_ids": [
"repository-implementation-guide"
]
},
{
"content_id": "repository-glossary",
"title": "Glossary",
"description": "Defines the principal terms used by the repository standard and skill.",
"content_type": "glossary",
"path": "docs/glossary.md",
"canonical_url": null,
"published_at": "2026-07-23",
"updated_at": "2026-07-24",
"status": "published",
"author": "Eddie Soehnel",
"topics": [
"repository-terminology"
],
"related_content_ids": [
"repository-structure-standard"
]
}
]
}
+24 -2
View File
@@ -8,7 +8,14 @@ The repository separates human guidance, machine-readable contracts, reusable AI
README.md + AGENTS.md
|
v
repository.json ----> schemas/repository.schema.json
repository-variables.json ---> schemas/repository-variables.schema.json
|
v
repository.json -------------> schemas/repository.schema.json
|
+----> content-index.json ---> schemas/content-index.schema.json
| |
| +----> individual authoritative documents
|
v
skills/structure-ai-ready-repository/
@@ -28,7 +35,13 @@ scripts/validate_repository.py + tests/
### Entry points
`README.md` is the human entry point. `AUTHOR.md` is the canonical attribution record. `AGENTS.md` is the AI operating entry point. `repository.json` provides authoritative structured metadata and retrieval order.
`README.md` is the human entry point. `AUTHOR.md` is the canonical attribution
record. `repository-variables.json` stores verified stable inputs for future
repository-structure work. `AGENTS.md` is the AI operating entry point.
`repository.json` provides authoritative structured metadata and retrieval
order. For content-heavy repositories, `content-index.json` provides the
file-level discovery layer between the repository manifest and the complete
authoritative documents.
### Standard
@@ -42,6 +55,13 @@ The skill inspects a target repository, selects a profile, creates a reviewable
Templates provide reusable starting artifacts with explicit placeholders. Examples are synthetic completed artifacts that demonstrate expected shape without carrying private or organization-specific data.
### Content indexing
`repository.json` stays small by describing major collections.
`content-index.json` contains one compact record per individual document. The
Markdown files remain authoritative and do not require chunk IDs, knowledge
IDs, or semantic QA artifacts merely because they are indexed.
### Validation
The root validator checks this implemented template. The skill audit checks required structure for a selected profile in any target repository. Unit tests protect validator behavior and repository consistency.
@@ -62,3 +82,5 @@ The root validator checks this implemented template. The skill audit checks requ
- Allow a user to explicitly authorize immediate implementation.
- Prefer verified nulls or visible placeholders over invented metadata.
- Use deterministic scripts for structural validation.
- Use a separate content index only when individual-document volume would make
the repository manifest cumbersome.
+12
View File
@@ -20,6 +20,18 @@ The file designated as the primary source for a value or contract, such as `VERS
The canonical human-readable record of repository authorship, publishing, maintenance, preferred attribution, and downstream replacement guidance.
## Content index
The optional machine-readable `content-index.json` file that catalogs
individual documents in a content-heavy repository without duplicating their
full text.
## Content-heavy repository
A repository with recurring or numerous individually useful documents, such as
updates, articles, research entries, policies, or guides, where listing every
file in `repository.json` would be cumbersome.
## Entry point
A declared starting file for a human or AI agent.
+39 -7
View File
@@ -15,11 +15,16 @@ Add profile-specific files only when they support real content or validation.
1. Choose a clear lowercase kebab-case repository name.
2. Create human and AI entry points.
3. Create `repository.json` using `templates/repository.json.template`.
4. Select and create profile-required documentation and folders.
5. Add a verified license, version, and change record.
6. Add host-specific contribution templates.
7. Validate the repository.
3. Create `repository-variables.json` using
`templates/repository-variables.json.template`.
4. Create `repository.json` using `templates/repository.json.template`.
5. If the repository contains recurring or numerous individual documents,
create `content-index.json` using
`templates/content-index.json.template`; otherwise leave it absent.
6. Select and create profile-required documentation and folders.
7. Add a verified license, version, and change record.
8. Add host-specific contribution templates.
9. Validate the repository.
## Existing Repository Workflow
@@ -42,9 +47,33 @@ Every implementation should answer:
Declare these answers in `repository.json`.
## Content Index Decision
Use `content-index.json` when the repository contains recurring updates,
articles, research entries, policies, guides, or enough individual documents
that listing them directly in `repository.json` would be cumbersome.
Keep `repository.json` focused on repository identity, capabilities, entry
points, and major collections. Put one compact record per document in
`content-index.json`, and keep each Markdown file as the authoritative complete
text.
For only three or four major documents, list them directly in
`repository.json` and omit the content index.
Validate:
- unique `content_id` values;
- unique repository-relative paths;
- existence of every indexed file;
- resolution of `related_content_ids`;
- declaration of `content-index.json` in `repository.json`.
## Identity And Publication
At the beginning of a repository build, confirm:
At the beginning of a repository build, read `repository-variables.json` when
present. Treat its verified values as defaults, then confirm only absent,
conflicting, or explicitly unverified values:
- author or authors;
- publisher;
@@ -52,7 +81,10 @@ At the beginning of a repository build, confirm:
- canonical repository URL;
- intended license.
Record the verified values in `AUTHOR.md` and keep `repository.json`, `CITATION.cff`, and `LICENSE` aligned. When adapting an existing template, never inherit its author automatically.
Record stable verified values in `repository-variables.json` and the canonical
human-readable identity in `AUTHOR.md`. Keep both files aligned with
`repository.json`, `CITATION.cff`, and `LICENSE`. When adapting an existing
template, never inherit its author automatically.
## Metadata Rules
+2
View File
@@ -4,6 +4,8 @@ All examples in this directory are synthetic and do not represent an actual orga
| File | Purpose |
| --- | --- |
| `example-repository-variables.json` | Completed stable repository-skill variables for a fictional repository. |
| `example-repository.json` | Completed documentation-profile manifest for a fictional repository. |
| `example-content-index.json` | Completed file-level document catalog for a fictional content-heavy repository. |
Use examples to understand expected shape. Do not copy fictional URLs, maintainers, or identifiers into a real repository.
+27
View File
@@ -0,0 +1,27 @@
{
"$schema": "../schemas/content-index.schema.json",
"schema_version": "1.0",
"collection_id": "example-field-guides",
"title": "Synthetic Field Guides",
"description": "Synthetic example index for a repository containing recurring field-guide documents.",
"updated_at": "2026-01-15",
"items": [
{
"content_id": "field-guide-winter-site-visit",
"title": "Winter Site Visit Field Guide",
"description": "Explains a synthetic preparation and documentation process for a winter site visit.",
"content_type": "field-guide",
"path": "docs/field-guides/winter-site-visit.md",
"canonical_url": "https://code.example.org/example-organization/field-guide/src/branch/main/docs/field-guides/winter-site-visit.md",
"published_at": "2026-01-15",
"updated_at": "2026-01-15",
"status": "published",
"author": "Alex Example",
"topics": [
"field-practice",
"winter"
],
"related_content_ids": []
}
]
}
@@ -0,0 +1,42 @@
{
"$schema": "../schemas/repository-variables.schema.json",
"schema_version": "1.0",
"purpose": "Synthetic verified inputs for the example documentation repository.",
"repository_profile": "documentation-guide",
"identity": {
"authors": [
{
"name": "Alex Example"
}
],
"publisher": {
"name": "Example Organization"
},
"maintainer": {
"name": "Example Maintainer"
}
},
"repository": {
"repository_id": "example-organization-field-guide",
"name": "field-guide",
"title": "Synthetic Field Guide",
"canonical_url": "https://code.example.org/example-organization/field-guide",
"organization": {
"id": "example-organization",
"name": "Example Organization",
"url": "https://code.example.org/example-organization"
}
},
"rights": {
"license": "CC-BY-4.0",
"license_file": "LICENSE"
},
"skill_defaults": {
"task_id": "structure-ai-ready-repository",
"require_plan_approval": true,
"preserve_existing_content": true,
"use_smallest_fitting_profile": true
},
"verified_by": "Synthetic example fixture",
"verified_at": "2026-01-01"
}
+8
View File
@@ -6,6 +6,11 @@
"description": "A synthetic example showing machine-readable metadata for a documentation repository.",
"summary": "Demonstrates the minimum identity, profile, entrypoint, rights, and AI retrieval fields without using real organizational data.",
"canonical_url": "https://code.example.org/example-organization/field-guide",
"organization": {
"id": "example-organization",
"name": "Example Organization",
"url": "https://code.example.org/example-organization"
},
"repository_status": "active",
"visibility": "public",
"maturity": "stable",
@@ -101,6 +106,9 @@
"ai_retrieval": {
"read_first": [
"README.md",
"AUTHOR.md",
"repository-variables.json",
"repository.json",
"AGENTS.md"
],
"retrieve_as_needed": [
+42
View File
@@ -0,0 +1,42 @@
{
"$schema": "./schemas/repository-variables.schema.json",
"schema_version": "1.0",
"purpose": "Verified stable inputs for repository-structure skills and future repository maintenance.",
"repository_profile": "skill-workflow",
"identity": {
"authors": [
{
"name": "Eddie Soehnel"
}
],
"publisher": {
"name": "Eddie Soehnel"
},
"maintainer": {
"name": "Eddie Soehnel"
}
},
"repository": {
"repository_id": "adminprojects-repo-template",
"name": "repo-template",
"title": "AI-Ready Repository Template",
"canonical_url": "https://projects.eddiesoehnel.com/adminprojects/repo-template",
"organization": {
"id": "adminprojects",
"name": "adminprojects",
"url": "https://projects.eddiesoehnel.com/adminprojects"
}
},
"rights": {
"license": "MIT",
"license_file": "LICENSE"
},
"skill_defaults": {
"task_id": "structure-ai-ready-repository",
"require_plan_approval": true,
"preserve_existing_content": true,
"use_smallest_fitting_profile": true
},
"verified_by": "AUTHOR.md and repository maintainers",
"verified_at": "2026-07-24"
}
+22 -3
View File
@@ -23,9 +23,9 @@
"repository_status": "active",
"visibility": "public",
"maturity": "experimental",
"version": "0.1.0",
"version": "0.3.0",
"created_at": "2026-07-23",
"updated_at": "2026-07-23",
"updated_at": "2026-07-24",
"resource_types": [
"documentation",
"framework",
@@ -72,11 +72,14 @@
"Assess a new or existing repository.",
"Propose a profile-appropriate repository structure.",
"Create machine-readable repository metadata.",
"Catalog individual documents in content-heavy repositories without expanding the repository manifest.",
"Persist verified stable repository-skill variables.",
"Validate required paths, entrypoints, versions, and links."
],
"use_cases": [
"Start a new AI workflow repository.",
"Correct an existing repository for AI findability.",
"Add a compact discovery index to a repository containing recurring updates, articles, research, policies, or guides.",
"Standardize reusable repository documentation and metadata."
],
"required_inputs": [
@@ -110,6 +113,20 @@
"description": "Canonical author, publisher, maintainer, and attribution guidance.",
"required_for_use": true
},
{
"path": "repository-variables.json",
"type": "configuration",
"title": "Repository Variables",
"description": "Verified stable identity, publication, rights, profile, and repository-skill defaults.",
"required_for_use": true
},
{
"path": "content-index.json",
"type": "content-index",
"title": "Repository Content Index",
"description": "Machine-readable index of the principal standards and implementation documents in this repository.",
"required_for_use": true
},
{
"path": "README.md",
"type": "documentation",
@@ -172,7 +189,7 @@
"maintenance": {
"maintainer": "Eddie Soehnel",
"review_frequency": "as-needed",
"last_reviewed_at": "2026-07-23",
"last_reviewed_at": "2026-07-24",
"deprecated": false,
"archived": false
},
@@ -180,7 +197,9 @@
"read_first": [
"README.md",
"AUTHOR.md",
"repository-variables.json",
"repository.json",
"content-index.json",
"AGENTS.md",
"skills.md"
],
+2
View File
@@ -3,5 +3,7 @@
| File | Purpose |
| --- | --- |
| `repository.schema.json` | JSON Schema contract for the repository manifest. |
| `repository-variables.schema.json` | JSON Schema contract for stable repository-skill inputs. |
| `content-index.schema.json` | JSON Schema contract for optional file-level catalogs in content-heavy repositories. |
The root validator performs dependency-free contract checks. Use a Draft 2020-12 compatible JSON Schema validator for complete schema validation.
+133
View File
@@ -0,0 +1,133 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://projects.eddiesoehnel.com/adminprojects/repo-template/schemas/content-index.schema.json",
"title": "Repository Content Index",
"description": "Compact machine-readable catalog of individual documents in a content-heavy repository.",
"type": "object",
"required": [
"schema_version",
"collection_id",
"title",
"description",
"updated_at",
"items"
],
"properties": {
"$schema": {
"type": "string"
},
"schema_version": {
"type": "string",
"pattern": "^\\d+\\.\\d+$"
},
"collection_id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"title": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"updated_at": {
"type": "string",
"format": "date"
},
"items": {
"type": "array",
"items": {
"$ref": "#/$defs/contentItem"
}
}
},
"additionalProperties": false,
"$defs": {
"stringArray": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"contentItem": {
"type": "object",
"required": [
"content_id",
"title",
"description",
"content_type",
"path",
"status"
],
"properties": {
"content_id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"title": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"content_type": {
"type": "string",
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"path": {
"type": "string",
"minLength": 1
},
"canonical_url": {
"type": [
"string",
"null"
]
},
"published_at": {
"type": [
"string",
"null"
],
"format": "date"
},
"updated_at": {
"type": [
"string",
"null"
],
"format": "date"
},
"status": {
"type": "string",
"enum": [
"draft",
"published",
"deprecated",
"archived",
"superseded"
]
},
"author": {
"type": [
"string",
"null"
]
},
"topics": {
"$ref": "#/$defs/stringArray"
},
"related_content_ids": {
"$ref": "#/$defs/stringArray"
}
},
"additionalProperties": false
}
}
}
+179
View File
@@ -0,0 +1,179 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://projects.eddiesoehnel.com/adminprojects/repo-template/schemas/repository-variables.schema.json",
"title": "Repository Structure Skill Variables",
"description": "Verified stable identity, repository, rights, profile, and workflow inputs reused by repository-structure skills.",
"type": "object",
"required": [
"schema_version",
"purpose",
"repository_profile",
"identity",
"repository",
"rights",
"skill_defaults",
"verified_by",
"verified_at"
],
"properties": {
"$schema": {
"type": "string"
},
"schema_version": {
"type": "string",
"pattern": "^\\d+\\.\\d+$"
},
"purpose": {
"type": "string",
"minLength": 1
},
"repository_profile": {
"enum": [
"documentation-guide",
"skill-workflow",
"software-automation",
"dataset",
"custom"
]
},
"identity": {
"type": "object",
"required": [
"authors",
"publisher",
"maintainer"
],
"properties": {
"authors": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/namedEntity"
}
},
"publisher": {
"$ref": "#/$defs/namedEntity"
},
"maintainer": {
"$ref": "#/$defs/namedEntity"
}
},
"additionalProperties": false
},
"repository": {
"type": "object",
"required": [
"repository_id",
"name",
"title",
"canonical_url"
],
"properties": {
"repository_id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"name": {
"type": "string",
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"title": {
"type": "string",
"minLength": 1
},
"canonical_url": {
"type": [
"string",
"null"
],
"format": "uri"
},
"organization": {
"oneOf": [
{
"$ref": "#/$defs/namedEntity"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
"rights": {
"type": "object",
"required": [
"license",
"license_file"
],
"properties": {
"license": {
"type": "string",
"minLength": 1
},
"license_file": {
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
"skill_defaults": {
"type": "object",
"required": [
"task_id",
"require_plan_approval",
"preserve_existing_content",
"use_smallest_fitting_profile"
],
"properties": {
"task_id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"require_plan_approval": {
"type": "boolean"
},
"preserve_existing_content": {
"type": "boolean"
},
"use_smallest_fitting_profile": {
"type": "boolean"
}
},
"additionalProperties": false
},
"verified_by": {
"type": "string",
"minLength": 1
},
"verified_at": {
"type": "string",
"format": "date"
}
},
"$defs": {
"namedEntity": {
"type": "object",
"required": [
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string",
"minLength": 1
},
"url": {
"type": "string",
"format": "uri"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
+5 -1
View File
@@ -18,4 +18,8 @@ python scripts/validate_repository.py .
python scripts/validate_repository.py . --json
```
The validator checks required paths, JSON parsing, core manifest fields, author/publisher alignment, entrypoint paths, manifest contents paths, version alignment, license alignment, and relative Markdown links. It does not prove content accuracy or check external URLs.
The validator checks required paths, JSON parsing, repository-variable and
manifest alignment, author/publisher alignment, entrypoint paths, manifest
contents paths, optional content-index fields and references, version alignment,
license alignment, and relative Markdown links. It does not prove content
accuracy or check external URLs.
+172
View File
@@ -21,6 +21,7 @@ REQUIRED_PATHS = (
"CHANGELOG.md",
"CITATION.cff",
"CONTRIBUTING.md",
"content-index.json",
"LICENSE",
"README.md",
"SECURITY.md",
@@ -30,16 +31,22 @@ REQUIRED_PATHS = (
"data/README.md",
"docs/README.md",
"examples/README.md",
"examples/example-content-index.json",
"receipts/README.md",
"repository.json",
"repository-variables.json",
"schemas/README.md",
"schemas/content-index.schema.json",
"schemas/repository.schema.json",
"schemas/repository-variables.schema.json",
"scripts/README.md",
"skills.md",
"skills/README.md",
"skills/structure-ai-ready-repository/SKILL.md",
"tasks/README.md",
"templates/content-index.json.template",
"templates/README.md",
"templates/repository-variables.json.template",
"tests/README.md",
)
@@ -62,6 +69,24 @@ MANIFEST_REQUIRED_KEYS = (
"ai_retrieval",
)
CONTENT_INDEX_REQUIRED_KEYS = (
"schema_version",
"collection_id",
"title",
"description",
"updated_at",
"items",
)
CONTENT_ITEM_REQUIRED_KEYS = (
"content_id",
"title",
"description",
"content_type",
"path",
"status",
)
MARKDOWN_LINK = re.compile(r"(?<!!)\[[^\]]+\]\(([^)]+)\)")
CITATION_VERSION = re.compile(r"(?m)^version:\s*[\"']?([^\"'\s#]+)")
CITATION_LICENSE = re.compile(r"(?m)^license:\s*[\"']?([^\"'\s#]+)")
@@ -118,6 +143,11 @@ def validate_manifest(root: Path, findings: list[dict[str, str]]) -> dict | None
declared = item.get("path") if isinstance(item, dict) else None
if not declared or not (root / declared).exists():
add(findings, "error", f"Declared contents path does not exist: {declared}")
declared_paths = {
item.get("path") for item in contents if isinstance(item, dict)
}
if (root / "content-index.json").is_file() and "content-index.json" not in declared_paths:
add(findings, "error", "repository.json contents must declare content-index.json")
retrieval = manifest.get("ai_retrieval", {})
if isinstance(retrieval, dict):
@@ -160,6 +190,144 @@ def validate_manifest(root: Path, findings: list[dict[str, str]]) -> dict | None
return manifest
def validate_content_index(root: Path, findings: list[dict[str, str]]) -> dict | None:
path = root / "content-index.json"
try:
index = json.loads(read_text(path))
except (OSError, UnicodeError, json.JSONDecodeError) as exc:
add(findings, "error", f"content-index.json is invalid: {exc}")
return None
for key in CONTENT_INDEX_REQUIRED_KEYS:
if key not in index:
add(findings, "error", f"content-index.json lacks required key: {key}")
items = index.get("items")
if not isinstance(items, list):
add(findings, "error", "content-index.json items must be an array")
return index
content_ids: set[str] = set()
paths: set[str] = set()
related_references: list[tuple[str, str]] = []
for position, item in enumerate(items):
label = f"content-index.json item {position + 1}"
if not isinstance(item, dict):
add(findings, "error", f"{label} must be an object")
continue
for key in CONTENT_ITEM_REQUIRED_KEYS:
if key not in item:
add(findings, "error", f"{label} lacks required key: {key}")
content_id = item.get("content_id")
if not isinstance(content_id, str) or not content_id:
add(findings, "error", f"{label} has an invalid content_id")
elif content_id in content_ids:
add(findings, "error", f"Duplicate content_id in content-index.json: {content_id}")
else:
content_ids.add(content_id)
declared = item.get("path")
if not isinstance(declared, str) or not declared:
add(findings, "error", f"{label} has an invalid path")
else:
declared_path = Path(declared)
if declared_path.is_absolute() or ".." in declared_path.parts:
add(findings, "error", f"Unsafe content-index.json path: {declared}")
elif declared in paths:
add(findings, "error", f"Duplicate path in content-index.json: {declared}")
else:
paths.add(declared)
if not (root / declared_path).is_file():
add(findings, "error", f"Indexed content path does not exist: {declared}")
related = item.get("related_content_ids", [])
if not isinstance(related, list):
add(findings, "error", f"{label} related_content_ids must be an array")
elif isinstance(content_id, str):
related_references.extend((content_id, value) for value in related)
for source_id, related_id in related_references:
if related_id not in content_ids:
add(
findings,
"error",
f"Unknown related_content_id in content-index.json: {source_id} -> {related_id}",
)
return index
def validate_variables(
root: Path, manifest: dict | None, findings: list[dict[str, str]]
) -> dict | None:
path = root / "repository-variables.json"
try:
variables = json.loads(read_text(path))
except (OSError, UnicodeError, json.JSONDecodeError) as exc:
add(findings, "error", f"repository-variables.json is invalid: {exc}")
return None
required = (
"schema_version",
"purpose",
"repository_profile",
"identity",
"repository",
"rights",
"skill_defaults",
"verified_by",
"verified_at",
)
for key in required:
if key not in variables:
add(findings, "error", f"repository-variables.json lacks required key: {key}")
if not manifest:
return 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)
]
if variable_authors != manifest_authors:
add(findings, "error", "Authors differ between repository-variables.json and repository.json")
variable_publisher = identity.get("publisher", {}).get("name")
manifest_publisher = manifest.get("publisher", {}).get("name")
if variable_publisher != manifest_publisher:
add(findings, "error", "Publisher differs between repository-variables.json and repository.json")
variable_maintainer = identity.get("maintainer", {}).get("name")
manifest_maintainer = manifest.get("maintenance", {}).get("maintainer")
if variable_maintainer != manifest_maintainer:
add(findings, "error", "Maintainer differs between repository-variables.json and repository.json")
repository = variables.get("repository", {})
for key in ("repository_id", "name", "title", "canonical_url", "organization"):
if repository.get(key) != manifest.get(key):
add(
findings,
"error",
f"{key} differs between repository-variables.json and repository.json",
)
variable_rights = variables.get("rights", {})
manifest_rights = manifest.get("rights", {})
for key in ("license", "license_file"):
if variable_rights.get(key) != manifest_rights.get(key):
add(
findings,
"error",
f"{key} differs between repository-variables.json and repository.json",
)
return variables
def validate_versions(root: Path, manifest: dict | None, findings: list[dict[str, str]]) -> None:
version = read_text(root / "VERSION").strip()
if not re.fullmatch(r"\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?", version):
@@ -226,6 +394,10 @@ def validate(root: Path) -> dict:
missing_core = False
manifest = None if not (root / "repository.json").is_file() else validate_manifest(root, findings)
if (root / "content-index.json").is_file():
validate_content_index(root, findings)
if (root / "repository-variables.json").is_file():
validate_variables(root, manifest, findings)
if not missing_core:
validate_versions(root, manifest, findings)
validate_markdown_links(root, findings)
+12 -5
View File
@@ -2,17 +2,24 @@
## How To Use This Index
Read this file after `README.md`, `repository.json`, and `AGENTS.md` to determine which skill applies.
Read this file after `README.md`, `repository.json`, optional
`content-index.json`, and `AGENTS.md` to determine which skill applies.
## Skills
### Structure AI-Ready Repository
- **Path:** `skills/structure-ai-ready-repository/SKILL.md`
- **Purpose:** Assess, plan, create, correct, and validate a human- and AI-findable repository structure.
- **Use when:** Starting a repository, correcting inconsistent structure, adding repository metadata, or improving AI entry points.
- **Inputs:** Target repository, project purpose, existing contents, verified author/publisher/maintainer identity, canonical URL, license, and any constraints.
- **Outputs:** A profile-appropriate repository structure, metadata, documentation, validation, and normal-workflow task records.
- **Purpose:** Assess, plan, create, correct, and validate a human- and AI-findable repository structure, including optional file-level indexing for content-heavy repositories.
- **Use when:** Starting a repository, correcting inconsistent structure, adding repository metadata or a content index, or improving AI entry points.
- **Inputs:** Target repository, project purpose, existing contents,
`repository-variables.json` when present, verified
author/publisher/maintainer identity, canonical URL, license, and any
constraints.
- **Outputs:** A profile-appropriate repository structure,
`repository-variables.json`, repository metadata, optional
`content-index.json`, documentation, validation, and normal-workflow task
records.
- **Human approval required:** Yes by default. The user may explicitly authorize immediate implementation.
- **Related scripts:** `skills/structure-ai-ready-repository/scripts/audit_repository.py` and `scripts/validate_repository.py`.
- **Reference standard:** `skills/structure-ai-ready-repository/references/repository-structure-standard.md`.
+40 -9
View File
@@ -18,16 +18,31 @@ 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. Determine whether the repository is content-heavy. Recommend
`content-index.json` when it contains recurring updates, articles, research
entries, policies, guides, or enough individual documents that listing each
one in `repository.json` would make the repository manifest cumbersome.
Keep small repositories on `repository.json` alone.
8. Separate facts found in the repository from assumptions and recommendations.
9. 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 +99,29 @@ 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.
- for an approved content-heavy repository, create `content-index.json` as
the compact catalog of individual authoritative documents. Declare it in
`repository.json`, keep document paths repository-relative, use stable
`content_id` values, and do not copy full document bodies into the index.
Do not add chunk IDs, knowledge IDs, `chunks.json`, or `qa.json` merely
because a document is cataloged.
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. When `content-index.json` exists, check unique content
IDs, unique paths, indexed-file existence, and related-content references.
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 +138,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,7 +43,9 @@ repository-name/
│
├── README.md
├── AUTHOR.md
├── repository-variables.json
├── repository.json
├── content-index.json # optional for content-heavy repositories
├── LICENSE
├── CHANGELOG.md
├── UPDATES.md
@@ -119,6 +121,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 +264,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 +492,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": [
@@ -534,6 +579,62 @@ Do not change IDs casually after publication because other catalogs, relationshi
---
## `content-index.json`
### Purpose
Provides a compact machine-readable catalog of the individual documents inside
a content-heavy repository.
Use the separation:
```text
repository.json
Repository identity, purpose, capabilities, entry points, and major collections.
content-index.json
One compact discovery record per individual document.
Individual Markdown file
Complete authoritative human- and AI-readable content.
```
Use `content-index.json` for recurring platform updates, articles, research
entries, policies, guides, or dozens of documents. A repository with only a few
major files may list those files directly in `repository.json` and omit the
content index.
The index should include stable content IDs, titles, concise descriptions,
content types, repository-relative paths, status, dates, and topics. It may
include canonical URLs and relationships to other indexed items.
Do not:
* Copy full document bodies into the index.
* Treat the index as the authoritative source instead of the Markdown file.
* Add chunk IDs or knowledge IDs merely because a document is indexed.
* Generate `chunks.json` or `qa.json` unless a separate publishing or semantic
materialization workflow requires them.
* Allow duplicate IDs, duplicate paths, missing paths, absolute paths, or path
traversal.
Declare the index in the `contents` array of `repository.json`:
```json
{
"path": "content-index.json",
"type": "content-index",
"title": "Repository Content Index",
"description": "Machine-readable index of the repository's published documents.",
"required_for_use": true
}
```
Use `templates/content-index.json.template` and validate against
`schemas/content-index.schema.json`.
---
## `LICENSE`
### Purpose
@@ -901,9 +1002,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 +1743,7 @@ Required:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -1654,6 +1758,7 @@ Optional:
```text
CONTRIBUTING.md
skills.md
content-index.json
templates/
examples/
assets/
@@ -1668,6 +1773,7 @@ Required:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -1689,6 +1795,7 @@ tests/
receipts/
CONTRIBUTING.md
SECURITY.md
content-index.json when the repository contains a document collection
```
---
@@ -1700,6 +1807,7 @@ Required:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -1722,6 +1830,7 @@ assets/
.env.example
.gitignore
dependency manifest
content-index.json when documentation or release notes form a large collection
```
---
@@ -1733,6 +1842,7 @@ Required:
```text
README.md
AUTHOR.md
repository-variables.json
repository.json
LICENSE
CHANGELOG.md
@@ -1751,6 +1861,7 @@ scripts/
tests/
examples/
SECURITY.md
content-index.json when the repository catalogs many individually addressable records or documents
```
The README and `data/README.md` should document provenance, collection methodology, limitations, update frequency, field definitions, and rights.
@@ -1912,8 +2023,12 @@ 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.
[ ] Content-heavy repositories include a valid `content-index.json`; small repositories intentionally omit it.
[ ] Every indexed content ID and path is unique and every indexed path exists.
[ ] repository_id is stable and unique.
[ ] Canonical URL is correct.
[ ] LICENSE matches repository.json.
@@ -1941,6 +2056,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",
@@ -90,6 +94,82 @@ def read_version_from_citation(path: Path) -> str | None:
return match.group(1) if match else None
def audit_content_index(root: Path, findings: list[dict[str, str]]) -> None:
path = root / "content-index.json"
if not path.is_file():
return
try:
index = json.loads(path.read_text(encoding="utf-8-sig"))
except (OSError, UnicodeError, json.JSONDecodeError) as exc:
findings.append({"level": "error", "message": f"content-index.json is invalid: {exc}"})
return
items = index.get("items")
if not isinstance(items, list):
findings.append(
{"level": "error", "message": "content-index.json items must be an array"}
)
return
content_ids: set[str] = set()
paths: set[str] = set()
for position, item in enumerate(items):
if not isinstance(item, dict):
findings.append(
{
"level": "error",
"message": f"content-index.json item {position + 1} must be an object",
}
)
continue
content_id = item.get("content_id")
declared = item.get("path")
if not content_id:
findings.append(
{
"level": "error",
"message": f"content-index.json item {position + 1} lacks content_id",
}
)
elif content_id in content_ids:
findings.append(
{
"level": "error",
"message": f"Duplicate content_id in content-index.json: {content_id}",
}
)
else:
content_ids.add(content_id)
if not declared:
findings.append(
{
"level": "error",
"message": f"content-index.json item {position + 1} lacks path",
}
)
elif declared in paths:
findings.append(
{
"level": "error",
"message": f"Duplicate path in content-index.json: {declared}",
}
)
else:
paths.add(declared)
declared_path = Path(declared)
if (
declared_path.is_absolute()
or ".." in declared_path.parts
or not (root / declared_path).is_file()
):
findings.append(
{
"level": "error",
"message": f"Indexed content path does not exist or is unsafe: {declared}",
}
)
def audit(root: Path, profile: str) -> dict:
findings: list[dict[str, str]] = []
if not root.is_dir():
@@ -133,6 +213,106 @@ 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})"
),
}
)
audit_content_index(root, findings)
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:
@@ -0,0 +1,34 @@
# Content Index Implementation Receipt
## Result
Implemented `content-index.json` as an optional file-level discovery layer for
content-heavy repositories.
## Added
- `content-index.json`
- `schemas/content-index.schema.json`
- `templates/content-index.json.template`
- `examples/example-content-index.json`
## Updated
- Repository manifest, retrieval order, standard, reusable skill, architecture,
implementation guide, glossary, schema/template/example indexes, validator,
reusable audit, tests, changelog, citation, and version.
## Contract
Each content item uses a stable `content_id`, concise metadata, a
repository-relative path, status, and optional dates, canonical URL, author,
topics, and related content IDs.
The index does not contain full document bodies and does not require semantic
chunk or QA materialization.
## Release
The template version was advanced from `0.2.0` to `0.3.0`.
No commit, push, publication, or deployment was performed.
@@ -0,0 +1,40 @@
# Add Content Index
- **Status:** implemented
- **Revision:** 1
- **Approved scope:** Immediate implementation authorized by the user on 2026-07-24.
## Objective
Add an optional, first-class `content-index.json` layer for repositories that
contain recurring or numerous individual documents.
## Decision
Keep `repository.json` authoritative for repository identity, purpose,
capabilities, entry points, and major collections. Use `content-index.json` for
compact file-level discovery records. Keep each Markdown document authoritative
for its complete content.
Small repositories may omit the content index and list their few major files
directly in `repository.json`.
## Approved Actions
- Add a working root content index.
- Add a JSON Schema, template, and synthetic example.
- Extend validators and tests.
- Update the reusable skill and repository standard.
- Update root documentation, retrieval order, manifest, version, citation, and
changelog.
- Do not add chunk IDs, knowledge IDs, `chunks.json`, or `qa.json`.
- Do not commit, push, publish, or modify hosting-platform settings.
## Definition Of Done
- Root validation passes.
- Unit tests pass.
- Skill/workflow profile audit passes.
- Skill validation passes.
- JSON files parse.
- `VERSION`, `repository.json`, and `CITATION.cff` agree.
@@ -0,0 +1,29 @@
# Content Index Validation Results
## Date
2026-07-24
## Results
- Python syntax compilation: PASS
- `python scripts/validate_repository.py .`: PASS
- `python -m unittest discover -s tests -p "test_*.py"`: PASS, 5 tests
- Skill/workflow profile audit: PASS
- Codex skill quick validation: PASS
- JSON parsing: PASS, 10 checked files
- Git diff whitespace check: PASS
- Version alignment: PASS at `0.3.0`
## Validator Coverage
- Required content-index fields
- Unique content IDs
- Unique paths
- Safe repository-relative paths
- Indexed-file existence
- Related-content reference resolution
- Declaration of `content-index.json` in `repository.json`
External URLs and the semantic accuracy of descriptions were not
network-validated.
+3 -1
View File
@@ -26,4 +26,6 @@ Canonical repository:
## Adapting This Template
Replace these values in `AUTHOR.md`, `repository.json`, `CITATION.cff`, and `LICENSE`. Verify the license and canonical URL rather than inheriting them automatically.
Replace these values in `repository-variables.json`, `AUTHOR.md`,
`repository.json`, `CITATION.cff`, and `LICENSE`. Verify the license and
canonical URL rather than inheriting them automatically.
+6
View File
@@ -3,7 +3,13 @@
| File | Purpose |
| --- | --- |
| `repository.json.template` | Starting machine-readable repository manifest with visible placeholders. |
| `repository-variables.json.template` | Starting verified identity, publication, rights, profile, and repository-skill defaults. |
| `content-index.json.template` | Starting file-level catalog for recurring or numerous individual documents. |
| `AUTHOR.md.template` | Starting canonical author, publisher, maintainer, and attribution file. |
| `UPDATES.md.template` | Starting notes file for future repository improvements. |
Replace every `{{PLACEHOLDER}}` with a verified value before use. A template is not a completed artifact and should not be presented as valid project metadata.
Use `content-index.json.template` only for a content-heavy repository. Small
repositories should list their few major documents directly in
`repository.json`.
+24
View File
@@ -0,0 +1,24 @@
{
"$schema": "./schemas/content-index.schema.json",
"schema_version": "1.0",
"collection_id": "{{STABLE_COLLECTION_ID}}",
"title": "{{CONTENT_COLLECTION_TITLE}}",
"description": "{{CONTENT_COLLECTION_DESCRIPTION}}",
"updated_at": "{{YYYY-MM-DD}}",
"items": [
{
"content_id": "{{STABLE_CONTENT_ID}}",
"title": "{{DOCUMENT_TITLE}}",
"description": "{{ONE_SENTENCE_DOCUMENT_DESCRIPTION}}",
"content_type": "{{CONTENT_TYPE}}",
"path": "{{RELATIVE_DOCUMENT_PATH}}",
"canonical_url": null,
"published_at": "{{YYYY-MM-DD}}",
"updated_at": "{{YYYY-MM-DD}}",
"status": "published",
"author": "{{AUTHOR_NAME}}",
"topics": [],
"related_content_ids": []
}
]
}
@@ -0,0 +1,42 @@
{
"$schema": "./schemas/repository-variables.schema.json",
"schema_version": "1.0",
"purpose": "Verified stable inputs for repository-structure skills and future repository maintenance.",
"repository_profile": "{{documentation-guide|skill-workflow|software-automation|dataset|custom}}",
"identity": {
"authors": [
{
"name": "{{AUTHOR_NAME}}"
}
],
"publisher": {
"name": "{{PUBLISHER_NAME}}"
},
"maintainer": {
"name": "{{MAINTAINER_NAME}}"
}
},
"repository": {
"repository_id": "{{STABLE_REPOSITORY_ID}}",
"name": "{{REPOSITORY_NAME}}",
"title": "{{REPOSITORY_TITLE}}",
"canonical_url": "{{CANONICAL_REPOSITORY_URL}}",
"organization": {
"id": "{{ORGANIZATION_ID}}",
"name": "{{ORGANIZATION_NAME}}",
"url": "{{ORGANIZATION_URL}}"
}
},
"rights": {
"license": "{{SPDX_LICENSE_ID}}",
"license_file": "LICENSE"
},
"skill_defaults": {
"task_id": "structure-ai-ready-repository",
"require_plan_approval": true,
"preserve_existing_content": true,
"use_smallest_fitting_profile": true
},
"verified_by": "{{VERIFICATION_SOURCE}}",
"verified_at": "{{YYYY-MM-DD}}"
}
+1
View File
@@ -82,6 +82,7 @@
"read_first": [
"README.md",
"AUTHOR.md",
"repository-variables.json",
"repository.json",
"AGENTS.md"
],
+4 -1
View File
@@ -6,4 +6,7 @@ Run the dependency-free unit tests with:
python -m unittest discover -s tests -p "test_*.py"
```
The tests validate the current repository and protect key failure cases in `scripts/validate_repository.py`.
The tests validate the current repository and protect key failure cases in
`scripts/validate_repository.py`, including mismatches between
`repository-variables.json` and `repository.json`, duplicate content IDs, and
missing files declared by `content-index.json`.
+56
View File
@@ -1,7 +1,9 @@
from __future__ import annotations
import importlib.util
import json
from pathlib import Path
import shutil
import tempfile
import unittest
@@ -27,6 +29,60 @@ class RepositoryValidationTests(unittest.TestCase):
any("Missing required path" in item["message"] for item in result["findings"])
)
def test_variable_identity_mismatch_fails(self) -> None:
with tempfile.TemporaryDirectory() as directory:
copy = Path(directory) / "repository"
shutil.copytree(ROOT, copy, ignore=shutil.ignore_patterns(".git", "__pycache__"))
variables_path = copy / "repository-variables.json"
variables = json.loads(variables_path.read_text(encoding="utf-8"))
variables["identity"]["publisher"]["name"] = "Different Publisher"
variables_path.write_text(json.dumps(variables, indent=2) + "\n", encoding="utf-8")
result = VALIDATOR.validate(copy)
self.assertFalse(result["passed"])
self.assertTrue(
any(
"Publisher differs between repository-variables.json and repository.json"
in item["message"]
for item in result["findings"]
)
)
def test_duplicate_content_id_fails(self) -> None:
with tempfile.TemporaryDirectory() as directory:
copy = Path(directory) / "repository"
shutil.copytree(ROOT, copy, ignore=shutil.ignore_patterns(".git", "__pycache__"))
index_path = copy / "content-index.json"
index = json.loads(index_path.read_text(encoding="utf-8"))
duplicate = dict(index["items"][0])
duplicate["path"] = "docs/README.md"
index["items"].append(duplicate)
index_path.write_text(json.dumps(index, indent=2) + "\n", encoding="utf-8")
result = VALIDATOR.validate(copy)
self.assertFalse(result["passed"])
self.assertTrue(
any(
"Duplicate content_id in content-index.json" in item["message"]
for item in result["findings"]
)
)
def test_missing_indexed_content_fails(self) -> None:
with tempfile.TemporaryDirectory() as directory:
copy = Path(directory) / "repository"
shutil.copytree(ROOT, copy, ignore=shutil.ignore_patterns(".git", "__pycache__"))
index_path = copy / "content-index.json"
index = json.loads(index_path.read_text(encoding="utf-8"))
index["items"][0]["path"] = "docs/missing-document.md"
index_path.write_text(json.dumps(index, indent=2) + "\n", encoding="utf-8")
result = VALIDATOR.validate(copy)
self.assertFalse(result["passed"])
self.assertTrue(
any(
"Indexed content path does not exist" in item["message"]
for item in result["findings"]
)
)
if __name__ == "__main__":
unittest.main()