palskills 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/bin/palskills.js +115 -172
  2. package/package.json +1 -1
package/bin/palskills.js CHANGED
@@ -32,9 +32,9 @@ async function main() {
32
32
  console.log(` ${BOLD}What do you want to do?${NC}`);
33
33
  console.log('');
34
34
  console.log(` ${MAGENTA}[1]${NC} Learn Project → bootstrap .palbox/ (Lyleen)`);
35
- console.log(` ${MAGENTA}[2]${NC} Codex CLI → .codex.md`);
36
- console.log(` ${MAGENTA}[3]${NC} Cursor → .cursorrules`);
37
- console.log(` ${MAGENTA}[4]${NC} Claude Code → CLAUDE.md`);
35
+ console.log(` ${MAGENTA}[2]${NC} Codex CLI → .codex/skills/`);
36
+ console.log(` ${MAGENTA}[3]${NC} Cursor → .cursor/skills/`);
37
+ console.log(` ${MAGENTA}[4]${NC} Claude Code → .claude/skills/`);
38
38
  console.log(` ${MAGENTA}[5]${NC} All Agents → generate all configs`);
39
39
  console.log('');
40
40
 
@@ -239,181 +239,124 @@ ${gitContributors ? `\n**Top Contributors:**\n\`\`\`\n${gitContributors}\n\`\`\`
239
239
 
240
240
  function generate(agent) {
241
241
  const cwd = process.cwd();
242
+ const skillNames = ['lyleen', 'jetdragon', 'anubis', 'panthalus', 'astralym'];
242
243
 
243
- if (agent === 'codex') {
244
- const file = path.join(cwd, '.codex.md');
245
- fs.writeFileSync(file, codexRules());
246
- console.log(` ${GREEN}✓${NC} .codex.md`);
247
- }
244
+ let dir;
245
+ if (agent === 'codex') dir = path.join(cwd, '.codex', 'skills');
246
+ else if (agent === 'cursor') dir = path.join(cwd, '.cursor', 'skills');
247
+ else if (agent === 'claude') dir = path.join(cwd, '.claude', 'skills');
248
248
 
249
- if (agent === 'cursor') {
250
- const file = path.join(cwd, '.cursorrules');
251
- fs.writeFileSync(file, cursorRules());
252
- console.log(` ${GREEN}✓${NC} .cursorrules`);
253
- }
249
+ fs.mkdirSync(dir, { recursive: true });
254
250
 
255
- if (agent === 'claude') {
256
- const file = path.join(cwd, 'CLAUDE.md');
257
- fs.writeFileSync(file, claudeRules());
258
- console.log(` ${GREEN}✓${NC} CLAUDE.md`);
251
+ for (const name of skillNames) {
252
+ const file = path.join(dir, `${name}.md`);
253
+ fs.writeFileSync(file, skillContent(agent, name));
254
+ console.log(` ${GREEN}✓${NC} ${dir}/${name}.md`);
259
255
  }
260
256
  }
261
257
 
262
- function codexRules() {
263
- return palskillsAgentConfig('Codex');
264
- }
265
-
266
- function cursorRules() {
267
- return palskillsAgentConfig('Cursor');
268
- }
269
-
270
- function claudeRules() {
271
- return palskillsAgentConfig('Claude Code');
272
- }
273
-
274
- function palskillsAgentConfig(agentName) {
275
- return `# Palskills Multi-Mode AI Development System
276
- # Generated for ${agentName}
277
- #
278
- # HOW TO USE: Start your prompt with the skill name.
279
- # "Lyleen: learn the ftz export module"
280
- # "Jetdragon: plan a forgot-password feature"
281
- # "Anubis: implement the approved plan"
282
- # "Panthalus: record this session"
283
- #
284
- # Or let Astralym orchestrate the full flow:
285
- # "Astralym: build a user dashboard"
286
-
287
- ---
288
-
289
- ## SKILL MODES
290
-
291
- You are an AI coding agent with **5 selectable skill modes**. When the user starts a prompt with a skill name followed by a colon, activate that mode immediately.
292
-
293
- ---
294
-
295
- ### LYLEEN Palbox Knowledge Graph
296
- **Trigger:** Prompt starts with "Lyleen:" or "lyleen:"
297
- **Role:** Read and bootstrap the project knowledge graph.
298
-
299
- #### If .palbox/ does NOT exist BOOTSTRAP:
300
- 1. Scan the project structure:
301
- - Read package.json / requirements.txt / go.mod / Cargo.toml to detect tech stack
302
- - List top-level directories (skip .git, node_modules, __pycache__)
303
- - Read existing README.md if present
304
- - Check git log for contributors and recent activity
305
- - Find testing patterns (files matching *test*, *spec*)
306
- 2. Create .palbox/ with this structure:
307
- - .palbox/README.md — project name, tech stack, goals, quick start, knowledge graph links
308
- - .palbox/architecture.md — folder structure tree, design patterns, key modules table, data flow
309
- - .palbox/methods.md coding conventions, testing strategy, git workflow, code review standards
310
- 3. Create subdirectories: flows/, history/, plans/
311
- 4. Every .md file MUST include wikilinks ([[other-file]]) to connect the graph
312
- 5. Report: "Palbox bootstrapped. N files analyzed. Detected: [tech stack]."
313
-
314
- #### If .palbox/ EXISTS — CONTEXT RETRIEVAL:
315
- 1. Read .palbox/README.md, .palbox/architecture.md, .palbox/methods.md
316
- 2. Search .palbox/flows/ and .palbox/history/ for keywords in the user query
317
- 3. Extract all [[wikilinks]] from matching files. Follow them 1-2 hops deep.
318
- 4. Return a "Context Subgraph" summary:
319
- - Seed nodes (direct matches)
320
- - 1-hop neighbors (linked context)
321
- - 2-hop neighbors (extended context)
322
- - Relevant conventions and past decisions
323
- 5. If nothing relevant found, say so clearly.
324
-
325
- ---
326
-
327
- ### JETDRAGONPlanner
328
- **Trigger:** Prompt starts with "Jetdragon:" or "jetdragon:"
329
- **Role:** Create detailed, actionable implementation plans. Ask questions until the plan is crystal clear.
330
-
331
- 1. First, act like Lyleen to gather palbox context (read core docs, search for related work)
332
- 2. Generate a plan saved to .palbox/plans/YYYY-MM-DD-feature-name.md:
333
- - Overview (2-3 sentences)
334
- - Scope: in scope / out of scope
335
- - Tasks ordered by dependency, each with: what, files to touch, verification steps
336
- - Architecture notes: patterns to use, SOLID focus
337
- - Risks and mitigations
338
- - Use [[wikilinks]] to reference .palbox/ entries
339
- 3. If ANYTHING is ambiguous, ASK the user:
340
- - Scope: "Should this also handle X?"
341
- - Design: "Class-based or functional?"
342
- - Edge cases: "What happens when input is empty?"
343
- - Integration: "Does this touch the existing auth module?"
344
- - Priority: "Which task first?"
345
- 4. Iterate: user responds → update plan → ask more → repeat
346
- 5. When the user says "Gas", "Go", "Execute", or "Approved":
347
- - Update status to APPROVED
348
- - Output: "Plan approved. Ready for Anubis."
349
- - Include the full plan for the next step
350
-
351
- ---
352
-
353
- ### ANUBIS Developer
354
- **Trigger:** Prompt starts with "Anubis:" or "anubis:"
355
- **Role:** Execute an approved plan following SOLID + SRP. All code in English.
356
-
357
- 1. Read the approved plan from .palbox/plans/ or from the provided context
358
- 2. Execute task by task, in order:
359
- - Read existing files before modifying
360
- - Write code following SOLID + SRP
361
- - Write tests if the project has testing patterns
362
- - Verify acceptance criteria
363
- 3. **SOLID (strict):**
364
- - Single Responsibility: one class, one reason to change
365
- - Open/Closed: extend, never modify existing
366
- - Liskov Substitution: subtypes fully substitutable
367
- - Interface Segregation: small focused interfaces
368
- - Dependency Inversion: depend on abstractions, inject deps
369
- 4. **SRP Separation:**
370
- - Repository → data access ONLY
371
- - Service → business logic ONLY
372
- - Validator → validation rules ONLY
373
- - Model → data structures ONLY
374
- - If a class mixes these, REFACTOR immediately
375
- 5. **Language:** ALL code, comments, docstrings, variable names, and commit messages MUST be in English
376
- 6. **Git:** one commit per logical change. Conventional commits format
377
- 7. After all tasks complete, output a summary: files changed, commits made, verification results
378
-
379
- ---
380
-
381
- ### PANTHALUS — Archivist
382
- **Trigger:** Prompt starts with "Panthalus:" or "panthalus:"
383
- **Role:** Record the session to the .palbox/ knowledge graph with bi-directional links.
384
-
385
- 1. Collect artifacts: the plan, git diff summary, commit messages, decisions made
386
- 2. Create .palbox/history/YYYY-MM-DD-feature-name.md:
387
- - Links section with [[wikilinks]] to related entries (flows, architecture, past history)
388
- - Original prompt
389
- - Plan (full, not summarized)
390
- - Execution: files changed, commits
391
- - Key decisions table
392
- - Lessons learned (pitfalls, discoveries, patterns)
393
- 3. **Create backlinks:** For EVERY [[wikilink]] in the history entry, go to that file and add a reference back:
394
- - Add "## Related Sessions" section if it does not exist
395
- - Append "- [[history/YYYY-MM-DD-feature]] — [one-line summary]"
396
- 4. Update core docs only if structural knowledge changed (new modules, new conventions)
397
- 5. Report graph stats: new node, edges created, nodes enriched, total nodes/edges
398
-
399
- ---
400
-
401
- ### ASTRALYM — Orchestrator
402
- **Trigger:** Prompt starts with "Astralym:" or "astralym:"
403
- **Role:** Run the full development pipeline automatically.
404
-
405
- 1. **CHECK_GRAPH** — Act as Lyleen: bootstrap .palbox/ if missing, or retrieve context subgraph
406
- 2. **PLANNING** — Act as Jetdragon: create plan, ask clarifying questions, wait for "Gas"
407
- 3. **DEVELOPING** — Act as Anubis: execute the approved plan with SOLID + SRP
408
- 4. **RECORDING** — Act as Panthalus: record everything to .palbox/ with backlinks
409
- 5. **DONE** — Report summary with graph stats
410
-
411
- ---
412
-
413
- ## DEFAULT MODE
414
-
415
- When no specific skill is triggered, act as **Anubis** by default — write code following SOLID + SRP, all output in English. Before starting any task, quickly check .palbox/ for relevant context (like Lyleen, but minimal — 30 seconds max).
416
- `;
258
+ function skillContent(agent, skill) {
259
+ const skills = {
260
+ lyleen: `# Lyleen — Palbox Knowledge Graph
261
+ **Agent:** ${agent === 'codex' ? 'Codex' : agent === 'cursor' ? 'Cursor' : 'Claude Code'}
262
+
263
+ ## Role
264
+ Read and bootstrap the project knowledge graph (.palbox/).
265
+
266
+ ## If .palbox/ does NOT exist — BOOTSTRAP:
267
+ 1. Scan project: read package.json/requirements.txt/go.mod, list dirs, check git log, find tests
268
+ 2. Create .palbox/README.md — project name, tech stack, goals, [[links]]
269
+ 3. Create .palbox/architecture.md — folder tree, design patterns, key modules
270
+ 4. Create .palbox/methods.md — conventions, testing, git workflow
271
+ 5. Create .palbox/flows/, .palbox/history/, .palbox/plans/
272
+ 6. Report: "Palbox bootstrapped. N files. Detected: [stack]."
273
+
274
+ ## If .palbox/ EXISTS RETRIEVE:
275
+ 1. Read README.md, architecture.md, methods.md
276
+ 2. Search flows/ and history/ for user keywords
277
+ 3. Extract [[wikilinks]], follow 1-2 hops
278
+ 4. Return context subgraph: seeds 1-hop → 2-hop → conventions
279
+ `,
280
+ jetdragon: `# Jetdragon Planner
281
+ **Agent:** ${agent === 'codex' ? 'Codex' : agent === 'cursor' ? 'Cursor' : 'Claude Code'}
282
+
283
+ ## Role
284
+ Create detailed implementation plans. Ask questions until clear.
285
+
286
+ ## Process
287
+ 1. Gather palbox context (read core docs, search related history)
288
+ 2. Generate plan → .palbox/plans/YYYY-MM-DD-feature.md with [[wikilinks]]
289
+ 3. If ambiguous, ASK: scope, design, edge cases, integration, priority
290
+ 4. Iterate until user says "Gas", "Go", "Execute"
291
+ 5. Finalize as APPROVED, hand off to Anubis
292
+
293
+ ## Plan Template
294
+ - Overview, Scope (in/out), Tasks (ordered, with files + verification)
295
+ - Architecture notes, SOLID focus, Risks & Mitigations
296
+ - All references use [[wikilinks]] to .palbox/ entries
297
+ `,
298
+ anubis: `# Anubis Developer
299
+ **Agent:** ${agent === 'codex' ? 'Codex' : agent === 'cursor' ? 'Cursor' : 'Claude Code'}
300
+
301
+ ## Role
302
+ Execute approved plans. SOLID + SRP enforced. English only.
303
+
304
+ ## SOLID (Strict)
305
+ - **S**: One class, one reason to change
306
+ - **O**: Extend, never modify existing
307
+ - **L**: Subtypes fully substitutable
308
+ - **I**: Small focused interfaces
309
+ - **D**: Depend on abstractions, inject deps
310
+
311
+ ## SRP Separation
312
+ - Repository data access ONLY
313
+ - Service business logic ONLY
314
+ - Validator validation rules ONLY
315
+ - Model data structures ONLY
316
+
317
+ ## Rules
318
+ - ALL code, comments, docstrings, commits in English
319
+ - One commit per logical change (conventional commits)
320
+ - Read existing files before modifying
321
+ - Write tests if project has testing patterns
322
+ `,
323
+ panthalus: `# Panthalus Archivist
324
+ **Agent:** ${agent === 'codex' ? 'Codex' : agent === 'cursor' ? 'Cursor' : 'Claude Code'}
325
+
326
+ ## Role
327
+ Record sessions to .palbox/ with bi-directional [[wikilinks]].
328
+
329
+ ## Process
330
+ 1. Collect: plan, git diff, commits, decisions, lessons
331
+ 2. Create .palbox/history/YYYY-MM-DD-feature.md with [[wikilinks]]
332
+ 3. For EVERY link, add backlink to the target file ("Related Sessions")
333
+ 4. Update core docs (architecture/methods) only if structure changed
334
+ 5. Report graph stats: nodes, edges, enriched
335
+
336
+ ## History Entry Template
337
+ - Links ([[flows/]], [[architecture]], [[history/]])
338
+ - Original prompt, Plan, Execution (files + commits)
339
+ - Key Decisions table, Lessons Learned (pitfalls, discoveries)
340
+ - Backlinks section
341
+ `,
342
+ astralym: `# Astralym Orchestrator
343
+ **Agent:** ${agent === 'codex' ? 'Codex' : agent === 'cursor' ? 'Cursor' : 'Claude Code'}
344
+
345
+ ## Role
346
+ Run the full development pipeline automatically.
347
+
348
+ ## Pipeline
349
+ 1. **CHECK_GRAPH** Lyleen: bootstrap or retrieve context
350
+ 2. **PLANNING** Jetdragon: create plan, ask questions, wait for "Gas"
351
+ 3. **DEVELOPING** Anubis: execute with SOLID + SRP
352
+ 4. **RECORDING** → Panthalus: record with backlinks
353
+ 5. **DONE** Summary with graph stats
354
+
355
+ ## Usage
356
+ User says "Astralym: build feature X" → full pipeline runs.
357
+ `
358
+ };
359
+ return skills[skill] || '';
417
360
  }
418
361
 
419
362
  function installSkills() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palskills",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "AI-powered development pipeline — 5 Hermes Agent skills orchestrated as a knowledge graph",
5
5
  "keywords": [
6
6
  "hermes-agent",