Repository navigation
feat(install): add grok-bot install target for agent-data/workflows - #3106
Sergio Sisternes (sergio-sisternes-epam) wants to merge 21 commits into
Conversation
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 1 | 1 | Catalog + TargetProfile follow hermes pattern; detect_target elif remains pre-existing debt. |
| CLI Logging Expert | 0 | 0 | 0 | No new logging/output surface beyond catalog description string. |
| DevX UX Expert | 0 | 1 | 1 | Explicit-only + skills-only is the right default; call out visible project-root agent-data/. |
| Supply Chain Security Expert | 0 | 1 | 0 | Same skill-trust model as peer targets; visible root raises accidental-commit risk -- document it. |
| OSS Growth Hacker | 0 | 0 | 1 | Solid adoption unlock; naming triad (grok-bot / grok-build / grok-cloud) stays clear. |
| Doc Writer | 0 | 1 | 1 | Reference docs + CHANGELOG land together; consider a one-liner on commit/gitignore posture. |
| Test Coverage Expert | 0 | 1 | 0 | Deploy + parser + cross-map coverage is strong; add a drop-target reconcile trap when convenient. |
| Auth Expert | -- | -- | -- | inactive -- no auth/token/host surfaces touched. |
| Performance Expert | -- | -- | -- | inactive -- catalog registration only; no hot-path complexity change. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 4 follow-ups
- [DevX UX Expert] Document project-scope
agent-data/visibility -- The root is intentionally dotless (issue [FEATURE] Add install target for Grok Bot agent skills folder #3083). Add a one-line note in the grok-bot targets-matrix section on whether consumers typically commitagent-data/workflows/or gitignore it, so first-time installers are not surprised by a new top-level directory. - [Supply Chain Security Expert] Same trust model, new writable root -- Skills under
agent-data/workflows/execute in the Grok Bot runtime. Confirm (in docs) that install still routes through the existing collision / path-security checks in BaseIntegrator so a malicious skill name cannot escape the workflows subtree. - [Test Coverage Expert] Drop-target reconcile regression trap -- Existing tests prove install lands files. A short follow-up that removes
grok-botfromtargets:(or reinstalls without it) and asserts reconcile removes ownership would close the uninstall half of the install contract. - [Python Architect] detect_target elif growth (pre-existing) -- This PR correctly adds two more elif arms. Not required here, but a later cleanup that dispatches via catalog membership would stop the chain from growing with every new explicit-only target.
Architecture
classDiagram
class TargetCapability {
<<Catalog entry>>
+name
+explicit_only
+primitive_profile
}
class TargetProfile {
<<Deploy shape>>
+root_dir
+primitives
+detect_by_dir
+user_root_dir
}
class PrimitiveMapping {
+subdir
+file_suffix
+adapter
}
class TARGET_CAPABILITIES {
<<single owner>>
}
class KNOWN_TARGETS {
<<single owner>>
}
TARGET_CAPABILITIES *-- TargetCapability
KNOWN_TARGETS *-- TargetProfile
TargetProfile o-- TargetCapability : capability
TargetProfile *-- PrimitiveMapping : primitives
class GrokBotCapability {
name = grok-bot
explicit_only = True
}
class GrokBotProfile {
root_dir = agent-data
user_root_dir = agent-data
detect_by_dir = False
}
GrokBotCapability --|> TargetCapability
GrokBotProfile --|> TargetProfile
class GrokBotCapability:::touched
class GrokBotProfile:::touched
class PrimitiveMapping:::touched
flowchart TD
CLI["apm install --target grok-bot"] --> Detect["detect_target / TargetParamType"]
Detect --> Catalog["TARGET_CAPABILITIES['grok-bot']\nexplicit_only=True"]
Catalog --> Profile["KNOWN_TARGETS['grok-bot']\nroot_dir=agent-data"]
Profile --> Scope{user scope?}
Scope -->|project| Proj["project/agent-data/workflows/name/SKILL.md"]
Scope -->|--global| Home["~/agent-data/workflows/name/SKILL.md"]
Profile --> Map["_CROSS_TARGET_MAPS\n.github/skills/ -> agent-data/workflows/"]
Recommendation
Ship once CI is green. The change is narrowly scoped, catalog-owned, documented, and covered by integration tests for the two deploy paths that matter. Track the visibility/gitignore doc note and the drop-target reconcile trap as post-merge (or quick in-PR) follow-ups; neither is a correctness regression on the happy path this PR delivers.
Full per-persona findings
Python Architect
- [recommended] detect_target continues a hand-rolled elif chain for explicit-only targets at
src/apm_cli/core/target_detection.py
Pre-existing pattern; this PR adds grok-bot arms for--targetandapm.yml. Catalog already owns explicit_only; a later dispatch via membership would remove the fork.
Suggested: Follow-up PR: resolve explicit-only targets from EXPLICIT_ONLY_TARGETS / TARGET_CAPABILITIES instead of per-slug elif. - [nit] TargetProfile comment block is thorough and matches hermes/agent-skills modeling -- keep as the template for the next skills-only target.
CLI Logging Expert
No findings.
DevX UX Expert
- [recommended] Project-scope deploy creates a visible top-level
agent-data/directory atsrc/apm_cli/integration/targets.py
Intentional per [FEATURE] Add install target for Grok Bot agent skills folder #3083, but first-run users may wonder whether to commit it. Docs should say so explicitly next to the deploy-directory bullet.
Suggested: One sentence in targets-matrix grok-bot section: commit vs gitignore guidance. - [nit] Help-text exclusion lists and install flag docs correctly name grok-bot beside hermes -- good parity.
Supply Chain Security Expert
- [recommended] New writable root
agent-data/workflows/inherits skill-execution trust atsrc/apm_cli/integration/targets.py
Same BaseIntegrator collision and path checks should apply; confirm in review that skill-name sanitization still prevents../escapes into sibling trees under agent-data/. Document that grok-bot skills are trusted the same way as hermes/agent-skills.
Suggested: Spot-check BaseIntegrator path join for the new root; add a one-liner to the grok-bot doc section on trust posture.
OSS Growth Hacker
- [nit] CHANGELOG Unreleased entry is clear and issue-linked -- good release-note seed for the next cut.
Auth Expert -- inactive
No auth, token, host-classification, or credential surfaces touched (target catalog / profile / docs / tests only).
Doc Writer
- [recommended] Add commit/gitignore posture for project-scope
agent-data/indocs/src/content/docs/reference/targets-matrix.md
Deploy directory and file conventions are documented; the missing reader question is "do I check this in?". - [nit]
packages/apm-guide/.../commands.mdcell is already enormous; the grok-bot clause is correct but hard to scan -- acceptable for this PR.
Test Coverage Expert
- [recommended] Missing drop-target / reconcile coverage for grok-bot at
tests/integration/test_grok_bot_target.py
Install happy-path and parser constants are well covered (integration-with-fixtures). The install contract also promises reconcile when a target is dropped fromtargets:; no assertion defends that half for grok-bot yet.
Proof (missing at):tests/integration/test_grok_bot_target.py-- proves: dropping grok-bot from targets reconciles away owned agent-data/workflows artifacts [multi-harness-support,devx]
Suggested: Mirror hermes reconcile coverage with one test that installs, removes the target, reinstalls, and asserts ownership cleanup.
Performance Expert -- inactive
Catalog and profile registration only; no change to download, cache, materialization, or algorithmic hot paths.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The target is omitted from apm targets, while documentation, behavioral coverage, and changelog updates remain incomplete.
Review effort: Balanced
Findings: 2
Open (5)
What changed in this PR
Adds the stable, explicit-only grok-bot target requested by #3083, deploying skills to agent-data/workflows/ at project and user scope.
Changes:
- Registers target detection, capabilities, deployment paths, and lockfile mapping.
- Adds install and catalog coverage.
- Updates CLI documentation and changelog.
| File | Description |
|---|---|
src/apm_cli/core/target_catalog.py |
Registers the target capability. |
src/apm_cli/core/target_detection.py |
Adds parsing and descriptions. |
src/apm_cli/integration/targets.py |
Defines project/user skill paths. |
src/apm_cli/bundle/lockfile_enrichment.py |
Adds cross-target skill mapping. |
tests/integration/test_grok_bot_target.py |
Tests parsing and deployment. |
tests/integration/test_global_scope_e2e.py |
Allows the dotless user root. |
tests/unit/core/test_target_catalog.py |
Updates catalog expectations. |
tests/unit/core/test_target_catalog_owner_invariant.py |
Updates ownership guard data. |
tests/unit/core/test_scope.py |
Updates known-target coverage. |
tests/unit/test_cli_consistency.py |
Updates exclusion help coverage. |
docs/src/content/docs/reference/targets-matrix.md |
Documents target capabilities. |
docs/src/content/docs/reference/manifest-schema.md |
Adds the manifest target slug. |
docs/src/content/docs/reference/cli/install.md |
Documents install selection. |
docs/src/content/docs/reference/cli/deps.md |
Documents update selection. |
docs/src/content/docs/reference/cli/compile.md |
Documents no-op compilation. |
docs/src/content/docs/concepts/primitives-and-targets.md |
Adds the target to the conceptual catalog. |
packages/apm-guide/.apm/skills/apm-usage/commands.md |
Adds install guidance. |
packages/apm-guide/.apm/skills/apm-usage/dependencies.md |
Adds dependency-routing guidance. |
CHANGELOG.md |
Announces the target. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Address open review comments and in-scope panel follow-ups on PR #3106: - Add behavioral grok-bot coverage to _filter_files_by_target tests (remapped file list + path_mappings), mirroring peer targets. - Surface grok-bot (and agent-skills) in `apm targets --all --json`, deriving deploy_dir from the catalog instead of hard-coding it; add command coverage. - Fix CHANGELOG.md entry to use `(#3106)` per changelog convention. - Complete the grok-bot docs sweep: primitives-and-targets.md intro, producer/compile.md explicit-only/no-op set, the-three-promises.md, and what-is-apm.md. - Deduplicate the drifted `apm install` rows in the apm-usage skill's commands.md (kept the single row already updated with grok-bot and correct stable-Hermes wording). - Add a commit-vs-gitignore note and a BaseIntegrator trust-model note to the grok-bot docs section. - Add a drop-target/reconcile regression test for grok-bot (uninstall cleans agent-data/workflows/ ownership), mirroring the agent-skills target's equivalent test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fold for PR #3106 (closes #3083 Mode-B silent-extension gate). The OpenAPM v0.1 explicit-only target enumeration (Section 4.2.1 and req-tg-001) named only agent-skills and antigravity, silently drifting from the already-registered hermes target and omitting the new stable explicit-only grok-bot target added in this PR. Both spots now name agent-skills, antigravity, hermes, and grok-bot. Editorial-only: no new normative statement, count remains 123 (118 MUST, 5 SHOULD). Added a 0.1.42 version-history row documenting the fold. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI on PR #3106 caught two tests that hardcoded target tie-break / active-target ordering assumptions tied to the old KNOWN_TARGETS / TARGET_CAPABILITIES insertion order: - test_compile_target_flag.py: multi-target AGENTS.md-only collapse now deterministically picks 'codex' over 'opencode' (alphabetical catalog order), not the reverse. - test_skill_integrator.py: with both .github and .claude present, active_targets() now yields claude before copilot (alphabetical), swapping which index in copy_skill_to_target's return list holds the claude vs github path. No production behavior regression; both are deterministic-order tests updated to match the (equally deterministic) alphabetical catalog order established in a prior commit on this branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a first-class install target for Grok Bot agent skills. The grok-bot target is skills-only, stable, and explicit-only, deploying skill packages to agent-data/workflows/<skill-name>/SKILL.md at project scope and ~/agent-data/workflows/<skill-name>/SKILL.md at user scope (--global), consistent with the hermes/agent-skills profile pattern. - Register the grok-bot capability in target_catalog.py and the TargetProfile in integration/targets.py. - Wire grok-bot into target_detection.py's explicit-target and apm.yml config-target resolution paths. - Add a lockfile_enrichment.py cross-target mapping remapping .github/skills/ to agent-data/workflows/ for pack-time reuse. - Document the target in the targets matrix, manifest schema, CLI reference pages, primitives-and-targets concepts page, and the apm-usage skill resources. - Add integration tests covering target resolution, install routing at project and user scope, and cross-target lockfile mapping. - Update characterization tests (target_catalog, cli_consistency, scope) to include the new target. Fixes #3083 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sort KNOWN_TARGETS and TARGET_CAPABILITIES entries, the internal TargetType/UserTargetType literals, the target description map, and the cross-target path map alphabetically by target slug. Also alphabetize the corresponding characterization test fixture in test_target_catalog.py. No behavior change; grok-bot remains in scope and unchanged, grok-build/grok-cloud are untouched in design. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address open review comments and in-scope panel follow-ups on PR #3106: - Add behavioral grok-bot coverage to _filter_files_by_target tests (remapped file list + path_mappings), mirroring peer targets. - Surface grok-bot (and agent-skills) in `apm targets --all --json`, deriving deploy_dir from the catalog instead of hard-coding it; add command coverage. - Fix CHANGELOG.md entry to use `(#3106)` per changelog convention. - Complete the grok-bot docs sweep: primitives-and-targets.md intro, producer/compile.md explicit-only/no-op set, the-three-promises.md, and what-is-apm.md. - Deduplicate the drifted `apm install` rows in the apm-usage skill's commands.md (kept the single row already updated with grok-bot and correct stable-Hermes wording). - Add a commit-vs-gitignore note and a BaseIntegrator trust-model note to the grok-bot docs section. - Add a drop-target/reconcile regression test for grok-bot (uninstall cleans agent-data/workflows/ ownership), mirroring the agent-skills target's equivalent test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fold for PR #3106 (closes #3083 Mode-B silent-extension gate). The OpenAPM v0.1 explicit-only target enumeration (Section 4.2.1 and req-tg-001) named only agent-skills and antigravity, silently drifting from the already-registered hermes target and omitting the new stable explicit-only grok-bot target added in this PR. Both spots now name agent-skills, antigravity, hermes, and grok-bot. Editorial-only: no new normative statement, count remains 123 (118 MUST, 5 SHOULD). Added a 0.1.42 version-history row documenting the fold. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI on PR #3106 caught two tests that hardcoded target tie-break / active-target ordering assumptions tied to the old KNOWN_TARGETS / TARGET_CAPABILITIES insertion order: - test_compile_target_flag.py: multi-target AGENTS.md-only collapse now deterministically picks 'codex' over 'opencode' (alphabetical catalog order), not the reverse. - test_skill_integrator.py: with both .github and .claude present, active_targets() now yields claude before copilot (alphabetical), swapping which index in copy_skill_to_target's return list holds the claude vs github path. No production behavior regression; both are deterministic-order tests updated to match the (equally deterministic) alphabetical catalog order established in a prior commit on this branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SkillIntegrator, uninstall, cleanup and ownership maps hardcoded 'skills'; grok-bot maps skills to 'workflows'. Add TargetProfile.skills_rel_root/skills_subdir/skills_only and use them everywhere. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nly targets Packages declaring agent-skills were skipped for skills-only targets. Also fail explicit --target installs when every target is filtered out; auto-detected sets stay a warning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid leaving an empty agent-data/ behind and stop hard-coding explicit-only target names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Integration tests for project/global install, reinstall, uninstall and package target rules; unit tests for helpers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The error only named targets; now it says which --target to use, lists declared targets, and notes agent-skills acceptance by skills-only targets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Guards that apm targets --all lists every stable explicit-only target and no experimental ones. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tibility Docs lagged the catalog-derived --all output and the package targets narrowing rules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b7613e8 to
b8c1672
Compare
Grok Bot reads skills from ~/agent-data/workflows/, so a project-scope install only lands under ./agent-data/workflows/ in the current folder. Point live Grok Bot users at `apm install --target grok-bot --global`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Error details carry actionable hints and were hidden unless --verbose. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per-package no-overlap is a warning again (matches main). With --target, fail before any primitive is written only when no package deploys or a named package and its whole subtree cannot, so the transaction rolls back and no orphan files remain. Tests cover transitive, named-subtree and all-filtered cases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Default output now exposes debug details, target metadata is misclassified, and the implementation exceeds the approved compatibility scope.
8 open findings
Incorrectly infers meta-targets from shared .agents paths · New Scope compatibility expansion to grok-bot or obtain approval · New Keep detailed install errors behind the verbose flag · New Correct changelog description of explicit target failures · New Clarify manifest-wide versus explicit subtree failure behavior · New Include agent-skills in the explicit-only target list · New Update OpenAPM conformance for the req-tg-001 change · New Add architecture registry and linter guards for skills-root ownership · New
5 resolved since last review
🧠 Review effort: Balanced
meta_target was inferred from shared deploy roots, wrongly flagging real harnesses (hermes, antigravity). It is now explicit catalog data, true only for agent-skills. The catalog also gains accepts_agent_skills_packages, used by the next commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accepting packages that declare agent-skills applied to every skills-only profile (hermes, openclaw, grok-cloud, copilot-cowork), which is broader than the approved #3083 scope. Drive it from the catalog-owned accepts_agent_skills_packages capability, enabled for grok-bot only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The explicit --target failure applies only when nothing in the install deploys (or a named package subtree has no compatible target); other filtered dependencies warn. Also scope the agent-skills compatibility wording to grok-bot and list all four stable explicit-only targets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…arget The whole-install nothing-deploys check ignored the project's own .apm primitives, so a cursor-only dependency plus local skills failed with --target grok-bot although the local skills deploy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Always rendering error detail exposes tracebacks and "run with --verbose" text in normal output. The explicit --target hint lives in the raised error message, so it stays visible without --verbose. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TargetProfile.skills_rel_root is the single owner of the skills-root derivation. Record it in the owner registry and add an AST guard that flags open-coded <root>/skills derivations in integration/ and install/, so consumers cannot silently diverge from the target profile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Description
Adds a first-class
grok-botinstall target for Grok Bot agent skills.Skill packages deploy to
agent-data/workflows/<skill-name>/SKILL.mdatproject scope and
~/agent-data/workflows/<skill-name>/SKILL.mdat userscope (
--global), so Grok Bot reads them directly without a manualcopy or symlink from
.agents/skills/orapm_modules. The target isstable and explicit-only (select with
--target grok-bot); existinggrok-buildandgrok-cloud(.grok/) targets are unchanged.Issue and approved scope
Issue: #3083
Human scope-approval comment: #3083 (comment)
This PR completes the accepted scope.
Type of change
Testing
Ran:
uv run --extra dev ruff check src/ tests/,uv run --extra dev ruff format --check src/ tests/,uv run --extra dev python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/,bash scripts/lint-auth-signals.sh, and the target-resolution/install testsuites (
tests/unit/core/test_target_catalog.py,tests/unit/core/test_scope.py,tests/integration/test_grok_bot_target.py,tests/integration/test_hermes_target.py,tests/unit/commands/test_targets_command.py,tests/unit/test_lockfile_enrichment.py) -- all passed.Spec conformance (OpenAPM v0.1)
If this PR changes behaviour that an OpenAPM v0.1
req-XXXcovers,confirm the three-step ritual in the
development guide:
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.
Fixes #3083