Project linker

From lightspeedwp/.github · View interactive version

Project linker is an AI agent skill from the GitHub repository lightspeedwp/.github. Find active projects and issues for a repository

How to use this skill

Skill file

Project Linker Skill

Overview

Discovers related projects and GitHub issues for a repository during session closure. This skill integrates with the Chat Closure Agent to find context-relevant work that should be included in handoff prompts.

When to Use

Input Parameters

Required

Optional

Output Format

{
  projects: [
    {
      name: "Chat Closure Agent",
      path: ".github/projects/active/chat-closure-agent-2026-08-12/",
      description: "Automate session handoff workflows",
      type: "active",
      link: "../../issues/1888"
    }
  ],
  issues: [
    {
      number: "#1888",
      title: "Epic: Chat Closure Agent Implementation",
      type: "epic",
      status: "🟢 Open",
      link: "../../issues/1888"
    }
  ],
  projectCount: 1,
  issueCount: 3
}

Repository-Specific Discovery

Control-Plane (.github) Repositories

Project discovery strategy:

// Look for projects in .github/projects/active/
const projectPath = path.join(repoPath, '.github', 'projects', 'active')
const projects = fs.readdirSync(projectPath)
  .filter(dir => fs.existsSync(path.join(projectPath, dir, 'README.md')))
  .map(dir => parseProjectREADME(path.join(projectPath, dir, 'README.md')))

Extract related issues from project README files:

// Find "Related Issues" section and extract issue links
const relatedIssuesPattern = /## Related Issues\n([\s\S]*?)(?:##|$)/
const matches = readme.match(relatedIssuesPattern)
// Parse `[#XXXX](../../issues/XXXX)` format

WordPress Plugin Repositories

Project discovery strategy:

// Parse plugin metadata from plugin.php
const pluginMetadata = parsePluginHeader(path.join(repoPath, 'plugin.php'))
// Extract from:
// * Plugin Name
// * Description
// * Author
// * GitHub links in header comments

Check composer.json for project metadata:

const composer = JSON.parse(fs.readFileSync('composer.json'))
const projectUrl = composer.homepage || composer.repository?.url
// Extract GitHub project/issue references

WordPress Theme Repositories

Project discovery strategy:

// Parse theme metadata from style.css
const themeMetadata = parseThemeHeader(path.join(repoPath, 'style.css'))
// Extract from:
// * Theme Name
// * Description
// * Author
// * Theme URI

Check theme.json for project info:

const themeJson = JSON.parse(fs.readFileSync('theme.json'))
// Extract from metadata section
// Look for documentation URLs or issue trackers

Issue Number Enrichment

Enhance pre-extracted issue numbers with metadata:

async function enrichIssueNumbers(issueNumbers) {
  return Promise.all(
    issueNumbers.map(async (num) => {
      try {
        const issue = await github.rest.issues.get({
          repo: '...',
          issue_number: parseInt(num.slice(1))
        })
        return {
          number: num,
          title: issue.title,
          type: detectIssueType(issue.labels),
          status: getStatusEmoji(issue.state)
        }
      } catch (error) {
        return { number: num, error: 'Could not fetch' }
      }
    })
  )
}

Usage Examples

Find All Projects

const { findProjects } = require('./skills/project-linker')

const projects = findProjects('.', 'control-plane')
console.log(`Found ${projects.projectCount} projects`)
projects.projects.forEach(p => {
  console.log(`- ${p.name}: ${p.description}`)
})

Enrich Issue Numbers

const { enrichIssueNumbers } = require('./skills/project-linker')

const issues = ['#1850', '#1851', '#1852']
const enriched = await enrichIssueNumbers(issues)
enriched.forEach(i => {
  console.log(`${i.number}: ${i.title} (${i.type})`)
})

Find Projects by Branch Scope

const { findProjectsByScope } = require('./skills/project-linker')

const scope = 'chat-closure'
const related = findProjectsByScope('.', scope)
console.log(`Projects related to ${scope}:`)
related.forEach(p => console.log(`- ${p.name}`))

Full Project & Issue Discovery

const coreAnalysis = require('./shared/core-analysis')
const projectLinker = require('./skills/project-linker')

const metadata = coreAnalysis.analyzeRepository('.')
const discovered = projectLinker.discoverAll('.', metadata.repoType, {
  issueNumbers: metadata.issueNumbers,
  branchScope: metadata.parsedBranch.scope
})

console.log(`Projects: ${discovered.projectCount}`)
console.log(`Issues: ${discovered.issueCount}`)

Integration with Memory & Handoff

The project-linker output is used by the continuation-prompt-builder:

const projectLinker = require('./skills/project-linker')
const promptBuilder = require('./shared/continuation-prompt-builder')

const discovered = projectLinker.discoverAll(repoPath, repoType)
const prompt = promptBuilder.buildContinuationPrompt(coreAnalysisData, {
  projects: discovered.projects,
  issues: discovered.issues
})

Error Handling

This skill handles these scenarios:

Example Error Handling

const coreAnalysis = require('./shared/core-analysis')
const projectLinker = require('./skills/project-linker')

try {
  const discovered = projectLinker.discoverAll(
    '.',
    coreAnalysis.detectRepoType('.')
  )
  console.log(`Found ${discovered.projectCount} projects`)
} catch (error) {
  if (error.message.includes('Unknown repo type')) {
    console.error('Repository type not supported')
  } else {
    console.error(`Project discovery failed: ${error.message}`)
  }
}

Testing

This skill includes Jest unit tests:

npm test -- project-linker.test.js

Test fixtures include:

Performance Notes

Related Skills

Version History

v1.0.0 (2026-08-12)

_This page brought to you by the 🦄 Magic Automation Unicorns of LightSpeedWP._

Automation Docs

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.