You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(adf): migrate should classify rules into on-demand modules, not just core.adf #6
charter adf migrate extracts rules from agent config files (agents.md, .cursorrules) and merges everything into core.adf, even when content clearly belongs in on-demand modules like frontend.adf or backend.adf.
Example
Given an agents.md with mixed content:
React components: PascalCase.tsx
Hooks/utilities: camelCase.ts
Hono route composition for worker/backend APIs
npm run db:local creates the local D1 schema
The migration classifies all of these as CONSTRAINTS → core.adf:
"React components: PascalCase.tsx" → CONSTRAINTS [advisory] core.adf
"Hono route composition for worker/..." → CONSTRAINTS [advisory] core.adf
"npm run db:local creates the local..." → CONSTRAINTS [advisory] core.adf
Expected Behavior
The migration should route rules to the appropriate on-demand module when the manifest declares them:
Rule
Target
React component naming conventions
frontend.adf
Vite dev server commands
frontend.adf
Hono route patterns
backend.adf
D1 schema/migration commands
backend.adf
TypeScript strictness, commit conventions
core.adf
Suggested Approach
Use the ON_DEMAND module metadata from manifest.adf (which already includes keyword hints like react, css, ui for frontend and api, node, db for backend) to classify migrated rules into the best-fit module rather than defaulting everything to core.
This would make the on-demand modules useful out of the box instead of leaving them as empty scaffolds after migration.
Update: The routing logic already exists in `content-classifier.ts` on both main and v0.5.0 — keyword-based matching routes to `frontend.adf` / `backend.adf` / `core.adf`:
```ts
if (/\b(design.system|ui|frontend|css|component|react|vue|svelte)\b/.test(lower)) {
return 'frontend.adf';
}
if (/\b(api|backend|deploy|server|database|db|endpoint)\b/.test(lower)) {
return 'backend.adf';
}
return 'core.adf';
```
However, when tested with v0.4.2, all 23 rules routed to `core.adf` despite rules containing keywords like "React", "Hono", "D1", "db:local". The `applyMigrationToModule()` function does handle missing files (creates an empty ADF doc), so that's not the blocker.
Possible causes:
The classifier regex isn't matching because the rule text is e.g. `"React components: PascalCase.tsx"` where "React" is at the start — the `\b` word boundary should match this. Need to verify the `lower` variable is actually the item text and not a section heading.
The published 0.4.2 npm package may not include the latest `content-classifier.ts` from main (build artifact drift).
This needs investigation — the code looks correct but the runtime behavior doesn't match.
Activity
SmartBrandStrategies commentedon Mar 2, 2026
Update: The routing logic already exists in `content-classifier.ts` on both main and v0.5.0 — keyword-based matching routes to `frontend.adf` / `backend.adf` / `core.adf`:
```ts
if (/\b(design.system|ui|frontend|css|component|react|vue|svelte)\b/.test(lower)) {
return 'frontend.adf';
}
if (/\b(api|backend|deploy|server|database|db|endpoint)\b/.test(lower)) {
return 'backend.adf';
}
return 'core.adf';
```
However, when tested with v0.4.2, all 23 rules routed to `core.adf` despite rules containing keywords like "React", "Hono", "D1", "db:local". The `applyMigrationToModule()` function does handle missing files (creates an empty ADF doc), so that's not the blocker.
Possible causes:
This needs investigation — the code looks correct but the runtime behavior doesn't match.
feat(adf): classify migrated rules into on-demand modules via trigger…
feat(bootstrap): integrate adf migrate into bootstrap flow (closes #7) (