From 96f4f00d4f2627e152b41ceb3969ba9a5c996930 Mon Sep 17 00:00:00 2001 From: cyre Date: Tue, 28 Jul 2026 04:23:49 +0000 Subject: [PATCH] feat: add periscope ECC bundle (onto merged) Replays only ECC paths (.agents, .claude, .codex) onto current merged. Preserves attribution guard scripts and .cursor/rules from merged PR #7. Fixes accidental guard deletion from the prior tree-replay reanchor. --- .agents/skills/periscope/SKILL.md | 74 +++++ .agents/skills/periscope/agents/openai.yaml | 6 + .claude/ecc-tools.json | 229 ++++++++++++++ .../inherited/periscope-instincts.yaml | 299 ++++++++++++++++++ .claude/identity.json | 14 + .claude/skills/periscope/SKILL.md | 74 +++++ .codex/AGENTS.md | 26 ++ .codex/agents/docs-researcher.toml | 9 + .codex/agents/explorer.toml | 9 + .codex/agents/reviewer.toml | 9 + .codex/config.toml | 48 +++ 11 files changed, 797 insertions(+) create mode 100644 .agents/skills/periscope/SKILL.md create mode 100644 .agents/skills/periscope/agents/openai.yaml create mode 100644 .claude/ecc-tools.json create mode 100644 .claude/homunculus/instincts/inherited/periscope-instincts.yaml create mode 100644 .claude/identity.json create mode 100644 .claude/skills/periscope/SKILL.md create mode 100644 .codex/AGENTS.md create mode 100644 .codex/agents/docs-researcher.toml create mode 100644 .codex/agents/explorer.toml create mode 100644 .codex/agents/reviewer.toml create mode 100644 .codex/config.toml diff --git a/.agents/skills/periscope/SKILL.md b/.agents/skills/periscope/SKILL.md new file mode 100644 index 000000000..cb26abdba --- /dev/null +++ b/.agents/skills/periscope/SKILL.md @@ -0,0 +1,74 @@ +```markdown +# periscope Development Patterns + +> Auto-generated skill from repository analysis + +## Overview +This skill teaches you the core development patterns and conventions used in the `periscope` TypeScript codebase. You'll learn how to name files, structure imports/exports, write commits, and organize tests. This guide also provides suggested commands for common workflows, ensuring consistency and efficiency in your contributions. + +## Coding Conventions + +### File Naming +- Use **kebab-case** for all file names. + - Example: + ``` + user-profile.ts + data-fetcher.test.ts + ``` + +### Import Style +- Use **relative imports** for module references. + - Example: + ```typescript + import { fetchData } from './data-fetcher'; + ``` + +### Export Style +- Use **named exports** only. + - Example: + ```typescript + // In user-profile.ts + export function getUserProfile(id: string) { ... } + ``` + +### Commit Messages +- Follow **conventional commit** format. +- Use the `chore` prefix for all commits. +- Keep commit messages concise (average ~59 characters). + - Example: + ``` + chore: update dependencies to latest versions + ``` + +## Workflows + +### Code Contribution +**Trigger:** When adding or updating code +**Command:** `/contribute` + +1. Create or update files using kebab-case naming. +2. Use relative imports and named exports. +3. Write clear, conventional commit messages with the `chore` prefix. +4. If applicable, add or update corresponding test files (`*.test.ts`). + +### Testing +**Trigger:** When verifying code correctness +**Command:** `/test` + +1. Locate or create a test file matching `*.test.*` pattern. +2. Write or update test cases as needed. +3. Run your test suite using the project's test runner (framework unknown; check project scripts or documentation). +4. Ensure all tests pass before committing. + +## Testing Patterns + +- Test files follow the `*.test.*` naming convention (e.g., `user-profile.test.ts`). +- The specific testing framework is not detected; check existing test files for structure or consult project documentation. +- Place tests close to the code they verify for clarity and maintainability. + +## Commands +| Command | Purpose | +|--------------|--------------------------------------------| +| /contribute | Guide for contributing code changes | +| /test | Steps for writing and running tests | +``` diff --git a/.agents/skills/periscope/agents/openai.yaml b/.agents/skills/periscope/agents/openai.yaml new file mode 100644 index 000000000..49cec3212 --- /dev/null +++ b/.agents/skills/periscope/agents/openai.yaml @@ -0,0 +1,6 @@ +interface: + display_name: "Periscope" + short_description: "Repo-specific patterns and workflows for periscope" + default_prompt: "Use the periscope repo skill to follow existing architecture, testing, and workflow conventions." +policy: + allow_implicit_invocation: true \ No newline at end of file diff --git a/.claude/ecc-tools.json b/.claude/ecc-tools.json new file mode 100644 index 000000000..01251f22b --- /dev/null +++ b/.claude/ecc-tools.json @@ -0,0 +1,229 @@ +{ + "version": "1.3", + "schemaVersion": "1.0", + "generatedBy": "ecc-tools", + "generatedAt": "2026-07-28T00:55:21.186Z", + "repo": "https://github.com/diazMelgarejo/periscope", + "referenceSetReadiness": { + "score": 14, + "present": 1, + "total": 7, + "items": [ + { + "id": "deep-analyzer-corpus", + "label": "Deep analyzer corpus", + "status": "missing", + "evidence": [], + "recommendation": "Add analyzer fixture, golden, benchmark, or reference-set files that can catch analyzer regressions." + }, + { + "id": "rag-evaluator", + "label": "RAG/evaluator comparison", + "status": "missing", + "evidence": [], + "recommendation": "Add retrieval or evaluator reference-set comparison fixtures with expected ranking behavior." + }, + { + "id": "pr-salvage", + "label": "PR salvage/review corpus", + "status": "missing", + "evidence": [], + "recommendation": "Add stale-PR, review-thread, reopen-flow, or salvage reference cases for queue cleanup automation." + }, + { + "id": "discussion-triage", + "label": "Discussion triage corpus", + "status": "missing", + "evidence": [], + "recommendation": "Add public discussion triage fixtures, golden cases, or reference sets for informational, answered, and no-response classifications." + }, + { + "id": "harness-compatibility", + "label": "Harness compatibility", + "status": "missing", + "evidence": [], + "recommendation": "Add cross-harness, adapter-compliance, or harness-audit evidence for Claude, Codex, OpenCode, Zed, dmux, and agent surfaces." + }, + { + "id": "security-evidence", + "label": "Security evidence", + "status": "present", + "evidence": [ + "scripts/git/audit_attribution.sh" + ], + "recommendation": "Attach security evidence such as SBOMs, SARIF, audit reports, or AgentShield evidence packs." + }, + { + "id": "ci-failure-mode", + "label": "CI failure-mode evidence", + "status": "missing", + "evidence": [], + "recommendation": "Add captured CI failure logs, dry-run fixtures, or troubleshooting docs for common workflow failure modes." + } + ] + }, + "profiles": { + "requested": "core", + "recommended": "core", + "effective": "core", + "requestedAlias": "core", + "recommendedAlias": "core", + "effectiveAlias": "core" + }, + "requestedProfile": "core", + "profile": "core", + "recommendedProfile": "core", + "effectiveProfile": "core", + "tier": "free", + "requestedComponents": [ + "repo-baseline" + ], + "selectedComponents": [ + "repo-baseline" + ], + "requestedAddComponents": [], + "requestedRemoveComponents": [], + "blockedRemovalComponents": [], + "tierFilteredComponents": [], + "requestedRootPackages": [ + "runtime-core" + ], + "selectedRootPackages": [ + "runtime-core" + ], + "requestedPackages": [ + "runtime-core" + ], + "requestedAddPackages": [], + "requestedRemovePackages": [], + "selectedPackages": [ + "runtime-core" + ], + "packages": [ + "runtime-core" + ], + "blockedRemovalPackages": [], + "tierFilteredRootPackages": [], + "tierFilteredPackages": [], + "conflictingPackages": [], + "dependencyGraph": { + "runtime-core": [] + }, + "resolutionOrder": [ + "runtime-core" + ], + "requestedModules": [ + "runtime-core" + ], + "selectedModules": [ + "runtime-core" + ], + "modules": [ + "runtime-core" + ], + "managedFiles": [ + ".claude/skills/periscope/SKILL.md", + ".agents/skills/periscope/SKILL.md", + ".agents/skills/periscope/agents/openai.yaml", + ".claude/identity.json", + ".codex/config.toml", + ".codex/AGENTS.md", + ".codex/agents/explorer.toml", + ".codex/agents/reviewer.toml", + ".codex/agents/docs-researcher.toml", + ".claude/homunculus/instincts/inherited/periscope-instincts.yaml" + ], + "packageFiles": { + "runtime-core": [ + ".claude/skills/periscope/SKILL.md", + ".agents/skills/periscope/SKILL.md", + ".agents/skills/periscope/agents/openai.yaml", + ".claude/identity.json", + ".codex/config.toml", + ".codex/AGENTS.md", + ".codex/agents/explorer.toml", + ".codex/agents/reviewer.toml", + ".codex/agents/docs-researcher.toml", + ".claude/homunculus/instincts/inherited/periscope-instincts.yaml" + ] + }, + "moduleFiles": { + "runtime-core": [ + ".claude/skills/periscope/SKILL.md", + ".agents/skills/periscope/SKILL.md", + ".agents/skills/periscope/agents/openai.yaml", + ".claude/identity.json", + ".codex/config.toml", + ".codex/AGENTS.md", + ".codex/agents/explorer.toml", + ".codex/agents/reviewer.toml", + ".codex/agents/docs-researcher.toml", + ".claude/homunculus/instincts/inherited/periscope-instincts.yaml" + ] + }, + "files": [ + { + "moduleId": "runtime-core", + "path": ".claude/skills/periscope/SKILL.md", + "description": "Repository-specific Claude Code skill generated from git history." + }, + { + "moduleId": "runtime-core", + "path": ".agents/skills/periscope/SKILL.md", + "description": "Codex-facing copy of the generated repository skill." + }, + { + "moduleId": "runtime-core", + "path": ".agents/skills/periscope/agents/openai.yaml", + "description": "Codex skill metadata so the repo skill appears cleanly in the skill interface." + }, + { + "moduleId": "runtime-core", + "path": ".claude/identity.json", + "description": "Suggested identity.json baseline derived from repository conventions." + }, + { + "moduleId": "runtime-core", + "path": ".codex/config.toml", + "description": "Repo-local Codex MCP and multi-agent baseline aligned with ECC defaults." + }, + { + "moduleId": "runtime-core", + "path": ".codex/AGENTS.md", + "description": "Codex usage guide that points at the generated repo skill and workflow bundle." + }, + { + "moduleId": "runtime-core", + "path": ".codex/agents/explorer.toml", + "description": "Read-only explorer role config for Codex multi-agent work." + }, + { + "moduleId": "runtime-core", + "path": ".codex/agents/reviewer.toml", + "description": "Read-only reviewer role config focused on correctness and security." + }, + { + "moduleId": "runtime-core", + "path": ".codex/agents/docs-researcher.toml", + "description": "Read-only docs researcher role config for API verification." + }, + { + "moduleId": "runtime-core", + "path": ".claude/homunculus/instincts/inherited/periscope-instincts.yaml", + "description": "Continuous-learning instincts derived from repository patterns." + } + ], + "workflows": [], + "adapters": { + "claudeCode": { + "skillPath": ".claude/skills/periscope/SKILL.md", + "identityPath": ".claude/identity.json", + "commandPaths": [] + }, + "codex": { + "configPath": ".codex/config.toml", + "agentsGuidePath": ".codex/AGENTS.md", + "skillPath": ".agents/skills/periscope/SKILL.md" + } + } +} \ No newline at end of file diff --git a/.claude/homunculus/instincts/inherited/periscope-instincts.yaml b/.claude/homunculus/instincts/inherited/periscope-instincts.yaml new file mode 100644 index 000000000..3ce691db6 --- /dev/null +++ b/.claude/homunculus/instincts/inherited/periscope-instincts.yaml @@ -0,0 +1,299 @@ +# Instincts generated from https://github.com/diazMelgarejo/periscope +# Generated: 2026-07-28T00:55:34.446Z +# Version: 2.0 +# NOTE: This file supplements (does not replace) any existing curated instincts. +# High-confidence manually curated instincts should be preserved alongside these. + +--- +id: periscope-commit-conventional +trigger: "when writing a commit message" +confidence: 0.85 +domain: git +source: repo-analysis +source_repo: https://github.com/diazMelgarejo/periscope +--- + +# Periscope Commit Conventional + +## Action + +Use conventional commit format with prefixes: chore + +## Evidence + +- 1 commits analyzed +- Detected conventional commit pattern +- Examples: chore(git): sync attribution guard scripts and cursor rules + +--- +id: periscope-commit-length +trigger: "when writing a commit message" +confidence: 0.6 +domain: git +source: repo-analysis +source_repo: https://github.com/diazMelgarejo/periscope +--- + +# Periscope Commit Length + +## Action + +Write moderate-length commit messages (~59 characters) + +## Evidence + +- Average commit message length: 59 chars +- Based on 1 commits + +--- +id: periscope-naming-files +trigger: "when creating a new file" +confidence: 0.8 +domain: code-style +source: repo-analysis +source_repo: https://github.com/diazMelgarejo/periscope +--- + +# Periscope Naming Files + +## Action + +Use kebab-case naming convention + +## Evidence + +- Analyzed file naming patterns in repository +- Dominant pattern: kebab-case + +--- +id: periscope-import-relative +trigger: "when importing modules" +confidence: 0.75 +domain: code-style +source: repo-analysis +source_repo: https://github.com/diazMelgarejo/periscope +--- + +# Periscope Import Relative + +## Action + +Use relative imports for project files + +## Evidence + +- Import analysis shows relative import pattern +- Example: import { x } from '../lib/x' + +--- +id: periscope-export-style +trigger: "when exporting from a module" +confidence: 0.7 +domain: code-style +source: repo-analysis +source_repo: https://github.com/diazMelgarejo/periscope +--- + +# Periscope Export Style + +## Action + +Prefer named exports + +## Evidence + +- Export pattern analysis +- Dominant style: named + +--- +id: periscope-test-separate +trigger: "when writing tests" +confidence: 0.8 +domain: testing +source: repo-analysis +source_repo: https://github.com/diazMelgarejo/periscope +--- + +# Periscope Test Separate + +## Action + +Place tests in the tests/ or __tests__/ directory, mirroring src structure + +## Evidence + +- Separate test directory pattern detected +- Tests live in dedicated test folders + +--- +id: periscope-instinct-file-naming +trigger: "When creating a new file" +confidence: 0.9 +domain: code-style +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct File Naming + +## Action + +Name the file using kebab-case + +## Evidence + +- Pattern in namingConventions.files + +--- +id: periscope-instinct-function-naming +trigger: "When defining a function" +confidence: 0.9 +domain: code-style +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct Function Naming + +## Action + +Use camelCase for the function name + +## Evidence + +- Pattern in namingConventions.functions + +--- +id: periscope-instinct-class-naming +trigger: "When defining a class" +confidence: 0.9 +domain: code-style +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct Class Naming + +## Action + +Use PascalCase for the class name + +## Evidence + +- Pattern in namingConventions.classes + +--- +id: periscope-instinct-constant-naming +trigger: "When defining a constant" +confidence: 0.9 +domain: code-style +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct Constant Naming + +## Action + +Use SCREAMING_SNAKE_CASE for the constant name + +## Evidence + +- Pattern in namingConventions.constants + +--- +id: periscope-instinct-import-style +trigger: "When importing modules" +confidence: 0.8 +domain: code-style +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct Import Style + +## Action + +Use relative import paths + +## Evidence + +- Pattern in importStyle + +--- +id: periscope-instinct-export-style +trigger: "When exporting from a module" +confidence: 0.8 +domain: code-style +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct Export Style + +## Action + +Use named exports + +## Evidence + +- Pattern in exportStyle + +--- +id: periscope-instinct-git-commit-format +trigger: "When writing a commit message" +confidence: 0.9 +domain: git +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct Git Commit Format + +## Action + +Use the conventional commit format with a 'chore' prefix + +## Evidence + +- Seen in commit: chore(git): sync attribution guard scripts and cursor rules +- Pattern in commits.prefixes + +--- +id: periscope-instinct-git-commit-length +trigger: "When writing a commit message" +confidence: 0.7 +domain: git +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct Git Commit Length + +## Action + +Keep the commit message concise, around 59 characters on average + +## Evidence + +- Pattern in commits.averageLength + +--- +id: periscope-instinct-test-location +trigger: "When adding or updating tests" +confidence: 0.8 +domain: testing +source: repo-analysis +source_repo: diazMelgarejo/periscope +--- + +# Periscope Instinct Test Location + +## Action + +Place test files in a separate test directory + +## Evidence + +- Pattern in architecture.folderStructure.testLocation + diff --git a/.claude/identity.json b/.claude/identity.json new file mode 100644 index 000000000..fa7972c3e --- /dev/null +++ b/.claude/identity.json @@ -0,0 +1,14 @@ +{ + "version": "2.0", + "technicalLevel": "technical", + "preferredStyle": { + "verbosity": "detailed", + "codeComments": true, + "explanations": true + }, + "domains": [ + "typescript" + ], + "suggestedBy": "ecc-tools-repo-analysis", + "createdAt": "2026-07-28T00:55:34.446Z" +} \ No newline at end of file diff --git a/.claude/skills/periscope/SKILL.md b/.claude/skills/periscope/SKILL.md new file mode 100644 index 000000000..cb26abdba --- /dev/null +++ b/.claude/skills/periscope/SKILL.md @@ -0,0 +1,74 @@ +```markdown +# periscope Development Patterns + +> Auto-generated skill from repository analysis + +## Overview +This skill teaches you the core development patterns and conventions used in the `periscope` TypeScript codebase. You'll learn how to name files, structure imports/exports, write commits, and organize tests. This guide also provides suggested commands for common workflows, ensuring consistency and efficiency in your contributions. + +## Coding Conventions + +### File Naming +- Use **kebab-case** for all file names. + - Example: + ``` + user-profile.ts + data-fetcher.test.ts + ``` + +### Import Style +- Use **relative imports** for module references. + - Example: + ```typescript + import { fetchData } from './data-fetcher'; + ``` + +### Export Style +- Use **named exports** only. + - Example: + ```typescript + // In user-profile.ts + export function getUserProfile(id: string) { ... } + ``` + +### Commit Messages +- Follow **conventional commit** format. +- Use the `chore` prefix for all commits. +- Keep commit messages concise (average ~59 characters). + - Example: + ``` + chore: update dependencies to latest versions + ``` + +## Workflows + +### Code Contribution +**Trigger:** When adding or updating code +**Command:** `/contribute` + +1. Create or update files using kebab-case naming. +2. Use relative imports and named exports. +3. Write clear, conventional commit messages with the `chore` prefix. +4. If applicable, add or update corresponding test files (`*.test.ts`). + +### Testing +**Trigger:** When verifying code correctness +**Command:** `/test` + +1. Locate or create a test file matching `*.test.*` pattern. +2. Write or update test cases as needed. +3. Run your test suite using the project's test runner (framework unknown; check project scripts or documentation). +4. Ensure all tests pass before committing. + +## Testing Patterns + +- Test files follow the `*.test.*` naming convention (e.g., `user-profile.test.ts`). +- The specific testing framework is not detected; check existing test files for structure or consult project documentation. +- Place tests close to the code they verify for clarity and maintainability. + +## Commands +| Command | Purpose | +|--------------|--------------------------------------------| +| /contribute | Guide for contributing code changes | +| /test | Steps for writing and running tests | +``` diff --git a/.codex/AGENTS.md b/.codex/AGENTS.md new file mode 100644 index 000000000..072229cfc --- /dev/null +++ b/.codex/AGENTS.md @@ -0,0 +1,26 @@ +# ECC for Codex CLI + +This supplements the root `AGENTS.md` with a repo-local ECC baseline. + +## Repo Skill + +- Repo-generated Codex skill: `.agents/skills/periscope/SKILL.md` +- Claude-facing companion skill: `.claude/skills/periscope/SKILL.md` +- Keep user-specific credentials and private MCPs in `~/.codex/config.toml`, not in this repo. + +## MCP Baseline + +Treat `.codex/config.toml` as the default ECC-safe baseline for work in this repository. +The generated baseline enables GitHub, Context7, Exa, Memory, Playwright, and Sequential Thinking. + +## Multi-Agent Support + +- Explorer: read-only evidence gathering +- Reviewer: correctness, security, and regression review +- Docs researcher: API and release-note verification + +## Workflow Files + +- No dedicated workflow command files were generated for this repo. + +Use these workflow files as reusable task scaffolds when the detected repository workflows recur. \ No newline at end of file diff --git a/.codex/agents/docs-researcher.toml b/.codex/agents/docs-researcher.toml new file mode 100644 index 000000000..0daae570b --- /dev/null +++ b/.codex/agents/docs-researcher.toml @@ -0,0 +1,9 @@ +model = "gpt-5.4" +model_reasoning_effort = "medium" +sandbox_mode = "read-only" + +developer_instructions = """ +Verify APIs, framework behavior, and release-note claims against primary documentation before changes land. +Cite the exact docs or file paths that support each claim. +Do not invent undocumented behavior. +""" \ No newline at end of file diff --git a/.codex/agents/explorer.toml b/.codex/agents/explorer.toml new file mode 100644 index 000000000..732df7aff --- /dev/null +++ b/.codex/agents/explorer.toml @@ -0,0 +1,9 @@ +model = "gpt-5.4" +model_reasoning_effort = "medium" +sandbox_mode = "read-only" + +developer_instructions = """ +Stay in exploration mode. +Trace the real execution path, cite files and symbols, and avoid proposing fixes unless the parent agent asks for them. +Prefer targeted search and file reads over broad scans. +""" \ No newline at end of file diff --git a/.codex/agents/reviewer.toml b/.codex/agents/reviewer.toml new file mode 100644 index 000000000..b13ed9cf1 --- /dev/null +++ b/.codex/agents/reviewer.toml @@ -0,0 +1,9 @@ +model = "gpt-5.4" +model_reasoning_effort = "high" +sandbox_mode = "read-only" + +developer_instructions = """ +Review like an owner. +Prioritize correctness, security, behavioral regressions, and missing tests. +Lead with concrete findings and avoid style-only feedback unless it hides a real bug. +""" \ No newline at end of file diff --git a/.codex/config.toml b/.codex/config.toml new file mode 100644 index 000000000..bc1ee67f6 --- /dev/null +++ b/.codex/config.toml @@ -0,0 +1,48 @@ +#:schema https://developers.openai.com/codex/config-schema.json + +# ECC Tools generated Codex baseline +approval_policy = "on-request" +sandbox_mode = "workspace-write" +web_search = "live" + +[mcp_servers.github] +command = "npx" +args = ["-y", "@modelcontextprotocol/server-github"] + +[mcp_servers.context7] +command = "npx" +args = ["-y", "@upstash/context7-mcp@latest"] + +[mcp_servers.exa] +url = "https://mcp.exa.ai/mcp" + +[mcp_servers.memory] +command = "npx" +args = ["-y", "@modelcontextprotocol/server-memory"] + +[mcp_servers.playwright] +command = "npx" +args = ["-y", "@playwright/mcp@latest", "--extension"] + +[mcp_servers.sequential-thinking] +command = "npx" +args = ["-y", "@modelcontextprotocol/server-sequential-thinking"] + +[features] +multi_agent = true + +[agents] +max_threads = 6 +max_depth = 1 + +[agents.explorer] +description = "Read-only codebase explorer for gathering evidence before changes are proposed." +config_file = "agents/explorer.toml" + +[agents.reviewer] +description = "PR reviewer focused on correctness, security, and missing tests." +config_file = "agents/reviewer.toml" + +[agents.docs_researcher] +description = "Documentation specialist that verifies APIs, framework behavior, and release notes." +config_file = "agents/docs-researcher.toml" \ No newline at end of file