Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(ce-compound): add discoverability check for docs/solutions/ in instruction files#456

Merged
tmchow merged 3 commits into
mainfrom
feat/compound-discoverability-check
Mar 30, 2026
Merged

feat(ce-compound): add discoverability check for docs/solutions/ in instruction files#456
tmchow merged 3 commits into
mainfrom
feat/compound-discoverability-check

Conversation

@tmchow
Copy link
Copy Markdown
Collaborator

@tmchow tmchow commented Mar 30, 2026

Summary

The docs/solutions/ knowledge store only compounds value when agents can find it. Today, only plugin-mediated workflows (ce:plan via learnings-researcher) know to search there. Agents in fresh sessions, other tools (Cursor, Copilot), or collaborators without the plugin have no reason to discover it.

Both ce:compound and ce:compound-refresh now run a discoverability check after their main work completes. If the project's instruction file (AGENTS.md or CLAUDE.md) doesn't surface the knowledge store to agents, the skill suggests a minimal addition — with consent before editing.

What gets added

The addition adapts to the AGENTS.md/CLAUDE.md's existing structure. Two examples from testing:

When AGENTS.md/CLAUDE.md has a directory listing or architecture section — a single line is added:

app/
  models/        # ActiveRecord models
  controllers/   # Request handling
  views/         # ERB templates
docs/
  solutions/     # Documented solutions to past problems (bugs, best practices, workflow patterns), organized by category with YAML frontmatter (module, tags, problem_type)

When AGENTS.md/CLAUDE.md has a documentation section with bullet entries — a bullet is added:

## Documentation

- `docs/adr/` — Architecture Decision Records
- `docs/api/` — OpenAPI specs (auto-generated from code annotations)
- `docs/runbooks/` — Incident response procedures
- `docs/solutions/` — Searchable knowledge store of previously solved problems, organized by category with YAML frontmatter (`module`, `tags`, `problem_type`); relevant when implementing or debugging in documented areas

When AGENTS.md/CLAUDE.md is flat with no sections — a line is appended matching the existing style:

Use `bun test` to run tests.
Prefer Tailwind utility classes over custom CSS.
This is a Next.js 14 app with App Router.
`docs/solutions/` contains categorized write-ups (YAML frontmatter with tags, problem_type, component) of past bugs and decisions, relevant when implementing or debugging in documented areas.

The tone is always informational ("relevant when...") rather than imperative ("check before...") to avoid redundant reads when the plugin's own workflows already search docs/solutions/.

Key decisions

  • Semantic assessment, not string matching. The check evaluates whether an agent reading the file would learn three things: (1) the store exists, (2) enough about its structure to search effectively, (3) when it's relevant. The file could express this many different ways without ever using the literal path docs/solutions/.
  • Shim detection. One file may just @-include the other (e.g., CLAUDE.md containing only @AGENTS.md). The check identifies which file holds substantive content and targets that one.
  • Prefer existing sections. The skill strongly prefers adding a single line to an existing architecture/directory/documentation section over creating a new headed section.
  • Consent-gated editing. In interactive modes, explains why discoverability matters and uses the platform's question tool to get user approval. In autofix mode (compound-refresh), includes a report recommendation without editing.

Test plan

  • Tested across 12 fixture scenarios covering: shim files (both directions), directory listings, flat files, files that already mention the store, files that mention the path but not the spirit, files using different terminology, minimal files, complex multi-section files, no files, and both-files-substantive
  • Ran 2 iterations — iteration 1 identified imperative tone and unnecessary new-section creation, iteration 2 confirmed fixes landed (7/7 tone issues resolved, 3/3 section issues resolved)

Compound Engineering v2.59.0
🤖 Generated with Claude Opus 4.6 (1M context) via Claude Code

…roject instruction files

After writing or refreshing a learning, both ce:compound and ce:compound-refresh now
check whether the project's AGENTS.md or CLAUDE.md would lead agents to discover the
docs/solutions/ knowledge store. If not, the skill suggests a minimal, style-matched
addition — with user consent before editing. The check uses semantic assessment (not
string matching), detects shim files, prefers adding to existing sections over creating
new ones, and uses informational tone to avoid redundant read directives.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0f17305bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/ce-compound-refresh/SKILL.md Outdated
…ability check (#456)

The discoverability check could edit AGENTS.md/CLAUDE.md after Phase 5
already committed, leaving the tree dirty. Add explicit step to
stage/commit those edits as part of the commit flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@tmchow
Copy link
Copy Markdown
Collaborator Author

tmchow commented Mar 30, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 332e1e0c97

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/ce-compound/SKILL.md
Comment thread plugins/compound-engineering/skills/ce-compound-refresh/SKILL.md Outdated
…s with write contract and add push step (#456)

- Update one-file write contract to explicitly permit instruction-file
  edits as maintenance, not a second deliverable
- Add push instruction for discoverability follow-up commits when branch
  is already on remote

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@tmchow
Copy link
Copy Markdown
Collaborator Author

tmchow commented Mar 30, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tmchow tmchow merged commit 5ac8a2c into main Mar 30, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant