claude-repo-native-agent-lab

INTENT-001 — Claude Repo-Native Agent + Skills: Working Local Demonstration

Status: Ready to implement
Execution target: Local machine, launched from the repository root
Owner: Repository maintainer
Priority: Demonstrate a real, testable implementation rather than an architecture illustration

1. Outcome

Build a working, self-contained demonstration repository showing how one primary Claude agent can use repository-local Markdown instructions, discoverable skills, optional subagent definitions, and executable Python tools to accomplish a useful task. The code and configuration belong in the repository. The Claude Code / Claude Agent SDK runtime executes on the local machine; it is not stored in the repository as source code. Do not provision Lambda, a microservice, a database, or GitHub Actions in this iteration.

Name this project Claude Repo-Native Agent Lab.

Demo task: Repository Readiness Report. Given a local directory (default: this repository’s sample project), inspect its files for a small number of deterministic readiness checks; redact common secrets from anything included in a report; generate readable Markdown and machine-readable JSON evidence; and have Claude explain the findings and suggest the next action. The whole demo must be useful, inexpensive to execute, and safe to run on a laptop.

2. Definition of success (observable)

A developer can clone/open the project, follow the README, install dependencies, run the tests, run an offline deterministic scan, and—when Claude credentials and the runtime are configured—run a real Claude-powered agent session. They can inspect the resulting report and evidence, see which skills were used, and distinguish deterministic tool results from Claude’s interpretation. Do not describe an offline script as an AI agent.

3. Required repository structure

Create all of the following. Each file must contain meaningful working content or instructions; no empty or placeholder files. Add small support files only where required.

claude-repo-native-agent-lab/
├── README.md
├── pyproject.toml
├── .gitignore
├── agent.py
├── CLAUDE.md
├── intent/
│   └── current-feature.md
├── .claude/
│   ├── settings.json
│   ├── skills/
│   │   ├── implementation/
│   │   │   └── SKILL.md
│   │   └── validation/
│   │       └── SKILL.md
│   └── agents/
│       ├── reviewer.md
│       └── researcher.md
├── tools/
│   ├── __init__.py
│   ├── readiness.py
│   └── redact.py
├── samples/
│   └── demo_project/
│       ├── README.md
│       ├── app.py
│       ├── requirements.txt
│       └── .env.example
├── tests/
│   ├── test_readiness.py
│   ├── test_redact.py
│   └── test_cli.py
└── output/
    └── .gitkeep

Exact roles of files:

4. Runtime behavior and interface

Implement these CLI commands (adjust syntax only when required by actual SDK compatibility and update README accordingly):

python -m pip install -e '.[dev]'
python agent.py test
python agent.py scan --target samples/demo_project
python agent.py agent --target samples/demo_project

scan must work completely offline after dependencies are installed. It must generate output/evidence.json and output/report.md in a deterministic way; print a concise summary and paths. agent must perform a real Claude Agent SDK session and make a meaningful contribution (interprets scan evidence and proposes prioritized fixes), not merely print a canned string. Use the current, officially supported Python SDK API, discover project-local skills correctly, limit turns and tools, set the working directory to repo root, and enforce read-only-by-default behavior for the demo. Never permit arbitrary edits outside repo. An authenticated Claude runtime, compatible SDK, and appropriate model access are prerequisites for agent mode; validate and explain those prerequisites.

The agent run should first cause the deterministic scan to be executed or validate current fresh scan evidence, then read output/evidence.json, invoke the validation procedure, and give a short evidence-grounded assessment. Keep the actual scan/report generation deterministic and locally reproducible. If Claude-specific calls are unavailable, fail with an actionable diagnostic rather than pretending an agent ran.

5. Required output format

output/evidence.json must contain at minimum:

{
  "schema_version": "1.0",
  "target": "samples/demo_project",
  "checks": [
    {
      "id": "readme_present",
      "status": "pass",
      "detail": "README.md exists",
      "recommendation": "None"
    }
  ],
  "summary": {"pass": 0, "warn": 0, "fail": 0},
  "redaction_applied": true
}

This is a shape example; counts and check results must be computed from actual scans. output/report.md must contain a clear title, target, summary, a table of all checks, recommended next actions, and evidence source. Reports must never expose secrets.

6. Validation and acceptance tests

All must be demonstrated, not asserted:

  1. All required files exist and contain functioning code or meaningful instructions. No TODO-only files or empty placeholder implementations.
  2. python agent.py test exits zero; pytest covers both success and failure paths.
  3. python agent.py scan --target samples/demo_project exits zero for a completed scan even if readiness checks contain failures; reports are generated and parseable.
  4. The sample produces at least one passing and one warning/failing readiness check. The report correctly lists both.
  5. Test strings containing fake secrets are redacted from generated evidence and report text; tests assert this behavior.
  6. Running the scanner again on unchanged input yields identical substantive check results (ignore volatile metadata, or omit such metadata entirely).
  7. The repository’s skills are discoverable using supported Claude Code conventions. Show how they are invoked; do not claim a skill was used without evidence.
  8. The agent path genuinely invokes Claude’s runtime when prerequisites exist. If unavailable, display the exact blocked prerequisite and the locally executable steps to resolve it.
  9. Check exit codes, inspect the actual generated reports, and include the commands and observed results in the final response.
  10. No credentials, hardcoded secrets, production integrations, unbounded loops, or external infrastructure.

7. Constraints and safety

8. Execution sequence for Claude (do the work now)

  1. Inspect the current working directory. If an existing repository is open, do not overwrite unrelated files; create a dedicated claude-repo-native-agent-lab/ subdirectory unless the root is empty/new or I explicitly opened the target repo.
  2. Confirm the installed Claude Code / Agent SDK capabilities and implement against the actual supported interfaces. Do not invent imports, CLI flags, hook schemas, or skill metadata.
  3. Create every required file and supply working implementation code, configuration, sample inputs, and tests.
  4. Install dependencies in the available local environment if allowed, then run the test suite and offline sample scan. Fix failures and rerun until passing or report a genuine environmental blocker.
  5. Attempt the Claude-powered agent mode if authenticated runtime access is already available; otherwise report what is missing. Do not request secrets in chat or log them.
  6. Inspect output/report.md and output/evidence.json; verify no fake sensitive strings survive unmasked in reports.
  7. End with a concise evidence report: project path, file tree, exact commands executed, pass/fail results, what the agent actually did, any blocked step, and the one next step for enabling GitHub Actions later.

9. Stop conditions

Stop rather than guessing when a requested operation requires unavailable credentials, unexpected external privileges, destructive changes, or unsupported SDK behavior. Complete all safe local deterministic work first and disclose any blocked live-agent step. Do not stop after writing a plan; implement and execute the demo in this session.