agentme 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: 004-select-relevant-xdrs
3
+ description: >
4
+ Analyzes a client repository, extracts the full agentme XDR set, and excludes the records that do
5
+ not fit the project's structure and workflow needs. Activate this skill when the user asks to
6
+ choose relevant agentme XDRs automatically, install the right XDR set for an existing project, or
7
+ bootstrap agentme guidance into a repository without manually deciding which records to keep.
8
+ metadata:
9
+ author: flaviostutz
10
+ version: "1.0"
11
+ compatibility: Node.js 18+
12
+ ---
13
+
14
+ ## Overview
15
+
16
+ Installs the full agentme XDR set for a repository through the published CLI, then removes only the
17
+ records that clearly do not fit the target project by passing explicit `--exclude` flags during
18
+ extraction. When the repository also needs speckit workflow artifacts, the skill adds that decision
19
+ separately instead of using presets to narrow the XDR set.
20
+
21
+ ## Instructions
22
+
23
+ ### Phase 1: Discover the available extractable artifacts
24
+
25
+ 1. Discover how the current published package exposes extraction. Prefer the package CLI help,
26
+ installed package metadata, and the agentme README so you know how to invoke:
27
+ - the full XDR extraction path with `extract --all`
28
+ - any optional workflow artifacts such as `speckit`
29
+ 2. Build an explicit inventory of the shipped agentme XDR files so exclusions can be chosen by
30
+ stable path.
31
+ 3. If the runtime environment cannot enumerate the shipped XDRs directly, fall back to the package
32
+ metadata or repository documentation and continue with that published inventory.
33
+ 4. If the fallback still cannot identify the shipped XDRs, stop and report that automatic
34
+ selection is blocked because the package does not expose enough metadata in the current
35
+ environment.
36
+
37
+ ### Phase 2: Analyze the current project
38
+
39
+ 1. Inspect the repository root and identify:
40
+ - primary languages (`package.json`, `go.mod`, `pyproject.toml`, `Cargo.toml`, etc.)
41
+ - project shape (single package, monorepo, library, application, CLI, service)
42
+ - frameworks and tooling (`next.config.*`, `vite.config.*`, `jest.config.*`, `.mise.toml`,
43
+ `docker-compose.*`, CI workflows, Makefiles)
44
+ - existing agent workflow files (`.xdrs/`, `AGENTS.md`, `.github/agents/`, `.github/prompts/`,
45
+ `.specify/`, `.vscode/settings.json`)
46
+ 2. Determine whether the repository already has:
47
+ - XDR-driven guidance in `.xdrs/`
48
+ - spec-driven workflow artifacts from speckit
49
+ - local conventions that would make a preset redundant or conflicting
50
+ 3. Summarize the project in a short decision note before selecting exclusions:
51
+ - what the project is
52
+ - which languages and frameworks are present
53
+ - whether it appears to want only XDRs or also agent workflow scaffolding such as `speckit`
54
+ 4. From that analysis, build a candidate list of XDRs that are obviously out of scope for the
55
+ repository. Only include exclusions when the mismatch is concrete, for example:
56
+ - language-specific XDRs for languages not used in the repository
57
+ - monorepo structure guidance for a clear single-package repository
58
+ - service/runtime/deployment guidance for a pure library with no deployed application surface
59
+ 5. Do not exclude baseline or broadly applicable guidance just because the project is small or
60
+ simple. Exclusions must remove only XDRs that would clearly mislead the repository.
61
+
62
+ ### Phase 3: Select exclusions and optional workflow artifacts
63
+
64
+ 1. Start from the full shipped agentme XDR set as the default installation target.
65
+ 2. Reduce that set only by excluding the XDRs that clearly do not fit the repository. Use
66
+ path-stable identifiers so the extraction command is auditable, for example:
67
+ - `.xdrs/agentme/edrs/application/010-golang-project-tooling.md` for non-Go projects
68
+ - `.xdrs/agentme/edrs/devops/005-monorepo-structure.md` for non-monorepos
69
+ - `.xdrs/agentme/edrs/observability/011-service-health-check-endpoint.md` for projects without
70
+ a long-running service surface
71
+ 3. Decide separately whether the repository also needs `speckit` workflow artifacts.
72
+ 4. Use these default workflow selection rules for the current agentme artifact set:
73
+ - Install the full XDR set when the repository wants agentme decision records, `AGENTS.md`, or a
74
+ baseline decision framework.
75
+ - Add `speckit` only when the repository already uses speckit artifacts, explicitly asks for
76
+ specification-driven workflow support, or clearly needs the `.github/agents/`, `.github/prompts/`,
77
+ `.specify/`, and related workflow files shipped by that preset.
78
+ 5. If the repository does not want agentme XDRs and does not want any optional workflow artifacts,
79
+ stop and explain why instead of forcing an installation.
80
+ 6. State the final decision with:
81
+ - whether full XDR extraction will run
82
+ - whether `speckit` will be added
83
+ - the final exclude list with one-line rationale per excluded XDR
84
+
85
+ ### Phase 4: Install the selected presets
86
+
87
+ 1. Build an ordered exclude list for the irrelevant XDRs selected in Phase 3.
88
+ 2. Run full XDR extraction first, using `--all`, and append one `--exclude` flag per XDR:
89
+
90
+ ```sh
91
+ npx -y agentme extract --output . --all --exclude <xdr-path> --exclude <xdr-path>
92
+ ```
93
+
94
+ 3. If the repository also needs `speckit`, run that extraction separately so the workflow decision
95
+ stays explicit:
96
+
97
+ ```sh
98
+ npx -y agentme extract --output . --presets speckit
99
+ ```
100
+
101
+ 4. If the user wants a pinned dependency instead of one-off extraction, prefer:
102
+
103
+ ```sh
104
+ pnpm add -D agentme
105
+ pnpm exec agentme extract --output . --all --exclude <xdr-path> --exclude <xdr-path>
106
+ pnpm exec agentme extract --output . --presets speckit
107
+ ```
108
+
109
+ 5. After extraction, verify that the expected XDR files now exist:
110
+ - `.xdrs/index.md`, `.xdrs/agentme/`, `AGENTS.md`
111
+ 6. If `speckit` was selected, verify that its workflow files now exist:
112
+ - `.github/agents/`, `.github/prompts/`, `.specify/`, `.vscode/settings.json`
113
+ 7. Also verify that each excluded XDR path is absent from the extracted output.
114
+ 8. Report whether full XDR extraction ran, whether `speckit` was added, which XDRs were excluded
115
+ with `--exclude`, and the paths that were added or updated.
116
+
117
+ ### Phase 5: Handle conflicts and repeat runs
118
+
119
+ 1. If the repository already contains extracted agentme files, treat the operation as an update, not
120
+ a fresh bootstrap.
121
+ 2. Do not delete unrelated local files to make a preset fit.
122
+ 3. If extracted files conflict with existing local decisions, tell the user which areas now need a
123
+ local `_local` XDR override or manual merge.
124
+ 4. When rerunning the skill after repository changes, recompute the exclude list instead of
125
+ reusing stale exclusions from a previous run.
126
+ 5. When rerunning the skill after repository changes, repeat the analysis instead of assuming the
127
+ previous workflow-artifact decision is still correct.
128
+
129
+ ## Examples
130
+
131
+ Input: "Install the right agentme XDR presets for this Node.js library"
132
+ - Inventory the shipped agentme XDR files
133
+ - Analyze the repository and detect a JavaScript library with Makefiles and no existing `.specify/`
134
+ - Exclude `.xdrs/agentme/edrs/application/010-golang-project-tooling.md` and `.xdrs/agentme/edrs/observability/011-service-health-check-endpoint.md`
135
+ - Run `npx -y agentme extract --output . --all --exclude .xdrs/agentme/edrs/application/010-golang-project-tooling.md --exclude .xdrs/agentme/edrs/observability/011-service-health-check-endpoint.md`
136
+
137
+ Input: "Set up agentme for this repo and keep the speckit workflow we already use"
138
+ - Inventory the shipped agentme XDR files
139
+ - Detect `.specify/`, `.github/agents/`, and `.github/prompts/`
140
+ - Choose full XDR extraction and keep `speckit`
141
+ - Exclude only the XDRs that are concretely irrelevant for the repository shape
142
+ - Run `npx -y agentme extract --output . --all --exclude <irrelevant-xdr-path>`
143
+ - Run `npx -y agentme extract --output . --presets speckit`
144
+
145
+ ## Edge Cases
146
+
147
+ - If the CLI cannot directly list the shipped XDRs, use the package's published metadata or README
148
+ as a fallback instead of failing immediately.
149
+ - If the repository already has `.xdrs/` but no sign of speckit, install or update only the XDR
150
+ set unless the user requests the workflow files.
151
+ - If a candidate exclusion is debatable, keep the XDR. The skill should exclude only records that
152
+ clearly do not make sense for the project.
153
+ - If the user asks specifically for XDRs, do not add `speckit` unless they also request that
154
+ workflow.
155
+ - If preset extraction would overwrite locally customized agent files, warn the user and describe the
156
+ likely merge points.
157
+ - If the repository is a spike or intentionally minimal experiment, still prefer the smallest preset
158
+ set of workflow artifacts and avoid adding scaffolding that the project will not use.
159
+
160
+ ## References
161
+
162
+ - [agentme README](../../../../../../README.md)
163
+ - [agentme-edr-003 - JavaScript project tooling and structure](../../003-javascript-project-tooling.md)
164
+ - [agentme-edr-005 - Monorepo structure](../../../devops/005-monorepo-structure.md)
165
+ - [agentme-edr-007 - Project quality standards](../../../principles/007-project-quality-standards.md)
166
+ - [agentme-edr-008 - Common development script names](../../../devops/008-common-targets.md)
167
+ - [_core-adr-003 - Skill standards](../../../../../_core/adrs/principles/003-skill-standards.md)
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "agentme",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "dependencies": {
6
- "filedist": "^0.21.2",
7
- "xdrs-core": "^0.3.8"
6
+ "filedist": "^0.24.0",
7
+ "xdrs-core": "^0.4.2"
8
8
  },
9
9
  "bin": "bin/filedist.js",
10
10
  "files": [
@@ -36,9 +36,24 @@
36
36
  "gitignore": false
37
37
  },
38
38
  "presets": [
39
+ "core",
39
40
  "basic"
40
41
  ]
41
42
  },
43
+ {
44
+ "selector": {
45
+ "files": [
46
+ ".xdrs/agentme/edrs/application/skills/004-select-relevant-xdrs/**"
47
+ ]
48
+ },
49
+ "output": {
50
+ "path": ".",
51
+ "gitignore": false
52
+ },
53
+ "presets": [
54
+ "core"
55
+ ]
56
+ },
42
57
  {
43
58
  "selector": {
44
59
  "files": [